primevue 3.22.2 → 3.22.4

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 (201) hide show
  1. package/README.md +1 -1
  2. package/accordion/Accordion.vue +7 -3
  3. package/accordion/accordion.cjs.js +7 -3
  4. package/accordion/accordion.cjs.min.js +1 -1
  5. package/accordion/accordion.esm.js +8 -4
  6. package/accordion/accordion.esm.min.js +1 -1
  7. package/accordion/accordion.js +7 -3
  8. package/accordion/accordion.min.js +1 -1
  9. package/autocomplete/AutoComplete.vue +6 -3
  10. package/autocomplete/autocomplete.cjs.js +12 -9
  11. package/autocomplete/autocomplete.cjs.min.js +1 -1
  12. package/autocomplete/autocomplete.esm.js +13 -10
  13. package/autocomplete/autocomplete.esm.min.js +1 -1
  14. package/autocomplete/autocomplete.js +12 -9
  15. package/autocomplete/autocomplete.min.js +1 -1
  16. package/breadcrumb/Breadcrumb.vue +2 -2
  17. package/breadcrumb/breadcrumb.cjs.js +17 -10
  18. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  19. package/breadcrumb/breadcrumb.esm.js +17 -10
  20. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  21. package/breadcrumb/breadcrumb.js +17 -10
  22. package/breadcrumb/breadcrumb.min.js +1 -1
  23. package/cascadeselect/CascadeSelect.vue +6 -3
  24. package/cascadeselect/cascadeselect.cjs.js +9 -6
  25. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  26. package/cascadeselect/cascadeselect.esm.js +10 -7
  27. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  28. package/cascadeselect/cascadeselect.js +9 -6
  29. package/cascadeselect/cascadeselect.min.js +1 -1
  30. package/contextmenu/ContextMenu.vue +6 -3
  31. package/contextmenu/contextmenu.cjs.js +8 -5
  32. package/contextmenu/contextmenu.cjs.min.js +1 -1
  33. package/contextmenu/contextmenu.esm.js +9 -6
  34. package/contextmenu/contextmenu.esm.min.js +1 -1
  35. package/contextmenu/contextmenu.js +8 -5
  36. package/contextmenu/contextmenu.min.js +1 -1
  37. package/core/core.js +48 -34
  38. package/core/core.min.js +5 -5
  39. package/datatable/BodyCell.vue +4 -2
  40. package/datatable/datatable.cjs.js +4 -2
  41. package/datatable/datatable.cjs.min.js +1 -1
  42. package/datatable/datatable.esm.js +4 -2
  43. package/datatable/datatable.esm.min.js +1 -1
  44. package/datatable/datatable.js +4 -2
  45. package/datatable/datatable.min.js +1 -1
  46. package/dock/DockSub.vue +9 -3
  47. package/dock/dock.cjs.js +10 -4
  48. package/dock/dock.cjs.min.js +1 -1
  49. package/dock/dock.esm.js +11 -5
  50. package/dock/dock.esm.min.js +1 -1
  51. package/dock/dock.js +10 -4
  52. package/dock/dock.min.js +1 -1
  53. package/dropdown/Dropdown.vue +6 -3
  54. package/dropdown/dropdown.cjs.js +13 -10
  55. package/dropdown/dropdown.cjs.min.js +1 -1
  56. package/dropdown/dropdown.esm.js +14 -11
  57. package/dropdown/dropdown.esm.min.js +1 -1
  58. package/dropdown/dropdown.js +13 -10
  59. package/dropdown/dropdown.min.js +1 -1
  60. package/listbox/Listbox.vue +6 -3
  61. package/listbox/listbox.cjs.js +11 -8
  62. package/listbox/listbox.cjs.min.js +1 -1
  63. package/listbox/listbox.esm.js +12 -9
  64. package/listbox/listbox.esm.min.js +1 -1
  65. package/listbox/listbox.js +11 -8
  66. package/listbox/listbox.min.js +1 -1
  67. package/megamenu/MegaMenu.vue +7 -3
  68. package/megamenu/megamenu.cjs.js +10 -6
  69. package/megamenu/megamenu.cjs.min.js +1 -1
  70. package/megamenu/megamenu.esm.js +11 -7
  71. package/megamenu/megamenu.esm.min.js +1 -1
  72. package/megamenu/megamenu.js +10 -6
  73. package/megamenu/megamenu.min.js +1 -1
  74. package/menu/Menu.vue +8 -3
  75. package/menu/menu.cjs.js +13 -8
  76. package/menu/menu.cjs.min.js +1 -1
  77. package/menu/menu.esm.js +14 -9
  78. package/menu/menu.esm.min.js +1 -1
  79. package/menu/menu.js +13 -8
  80. package/menu/menu.min.js +1 -1
  81. package/menubar/Menubar.vue +7 -3
  82. package/menubar/menubar.cjs.js +10 -6
  83. package/menubar/menubar.cjs.min.js +1 -1
  84. package/menubar/menubar.esm.js +11 -7
  85. package/menubar/menubar.esm.min.js +1 -1
  86. package/menubar/menubar.js +10 -6
  87. package/menubar/menubar.min.js +1 -1
  88. package/multiselect/MultiSelect.vue +6 -3
  89. package/multiselect/multiselect.cjs.js +11 -8
  90. package/multiselect/multiselect.cjs.min.js +1 -1
  91. package/multiselect/multiselect.esm.js +12 -9
  92. package/multiselect/multiselect.esm.min.js +1 -1
  93. package/multiselect/multiselect.js +11 -8
  94. package/multiselect/multiselect.min.js +1 -1
  95. package/orderlist/OrderList.vue +8 -3
  96. package/orderlist/orderlist.cjs.js +11 -6
  97. package/orderlist/orderlist.cjs.min.js +1 -1
  98. package/orderlist/orderlist.esm.js +12 -7
  99. package/orderlist/orderlist.esm.min.js +1 -1
  100. package/orderlist/orderlist.js +11 -6
  101. package/orderlist/orderlist.min.js +1 -1
  102. package/package.json +1 -1
  103. package/panelmenu/PanelMenu.vue +9 -6
  104. package/panelmenu/PanelMenuList.vue +1 -1
  105. package/panelmenu/panelmenu.cjs.js +11 -8
  106. package/panelmenu/panelmenu.cjs.min.js +1 -1
  107. package/panelmenu/panelmenu.esm.js +11 -8
  108. package/panelmenu/panelmenu.esm.min.js +1 -1
  109. package/panelmenu/panelmenu.js +11 -8
  110. package/panelmenu/panelmenu.min.js +1 -1
  111. package/picklist/PickList.vue +8 -2
  112. package/picklist/picklist.cjs.js +8 -2
  113. package/picklist/picklist.cjs.min.js +1 -1
  114. package/picklist/picklist.esm.js +9 -3
  115. package/picklist/picklist.esm.min.js +1 -1
  116. package/picklist/picklist.js +8 -2
  117. package/picklist/picklist.min.js +1 -1
  118. package/rating/Rating.vue +9 -3
  119. package/rating/rating.cjs.js +11 -5
  120. package/rating/rating.cjs.min.js +1 -1
  121. package/rating/rating.esm.js +12 -6
  122. package/rating/rating.esm.min.js +1 -1
  123. package/rating/rating.js +11 -5
  124. package/rating/rating.min.js +1 -1
  125. package/resources/themes/arya-blue/theme.css +7 -0
  126. package/resources/themes/arya-green/theme.css +7 -0
  127. package/resources/themes/arya-orange/theme.css +7 -0
  128. package/resources/themes/arya-purple/theme.css +7 -0
  129. package/resources/themes/bootstrap4-dark-blue/theme.css +7 -0
  130. package/resources/themes/bootstrap4-dark-purple/theme.css +7 -0
  131. package/resources/themes/bootstrap4-light-blue/theme.css +7 -0
  132. package/resources/themes/bootstrap4-light-purple/theme.css +7 -0
  133. package/resources/themes/fluent-light/theme.css +7 -0
  134. package/resources/themes/lara-dark-blue/theme.css +7 -0
  135. package/resources/themes/lara-dark-indigo/theme.css +7 -0
  136. package/resources/themes/lara-dark-purple/theme.css +7 -0
  137. package/resources/themes/lara-dark-teal/theme.css +7 -0
  138. package/resources/themes/lara-light-blue/theme.css +7 -0
  139. package/resources/themes/lara-light-indigo/theme.css +7 -0
  140. package/resources/themes/lara-light-purple/theme.css +7 -0
  141. package/resources/themes/lara-light-teal/theme.css +7 -0
  142. package/resources/themes/luna-amber/theme.css +7 -0
  143. package/resources/themes/luna-blue/theme.css +7 -0
  144. package/resources/themes/luna-green/theme.css +7 -0
  145. package/resources/themes/luna-pink/theme.css +7 -0
  146. package/resources/themes/md-dark-deeppurple/theme.css +10 -2
  147. package/resources/themes/md-dark-indigo/theme.css +10 -2
  148. package/resources/themes/md-light-deeppurple/theme.css +10 -2
  149. package/resources/themes/md-light-indigo/theme.css +10 -2
  150. package/resources/themes/mdc-dark-deeppurple/theme.css +10 -2
  151. package/resources/themes/mdc-dark-indigo/theme.css +10 -2
  152. package/resources/themes/mdc-light-deeppurple/theme.css +10 -2
  153. package/resources/themes/mdc-light-indigo/theme.css +10 -2
  154. package/resources/themes/nova/theme.css +7 -0
  155. package/resources/themes/nova-accent/theme.css +7 -0
  156. package/resources/themes/nova-alt/theme.css +7 -0
  157. package/resources/themes/nova-vue/theme.css +7 -0
  158. package/resources/themes/rhea/theme.css +7 -0
  159. package/resources/themes/saga-blue/theme.css +7 -0
  160. package/resources/themes/saga-green/theme.css +7 -0
  161. package/resources/themes/saga-orange/theme.css +7 -0
  162. package/resources/themes/saga-purple/theme.css +7 -0
  163. package/resources/themes/tailwind-light/theme.css +7 -0
  164. package/resources/themes/vela-blue/theme.css +7 -0
  165. package/resources/themes/vela-green/theme.css +7 -0
  166. package/resources/themes/vela-orange/theme.css +7 -0
  167. package/resources/themes/vela-purple/theme.css +7 -0
  168. package/speeddial/SpeedDial.vue +6 -3
  169. package/speeddial/speeddial.cjs.js +11 -8
  170. package/speeddial/speeddial.cjs.min.js +1 -1
  171. package/speeddial/speeddial.esm.js +12 -9
  172. package/speeddial/speeddial.esm.min.js +1 -1
  173. package/speeddial/speeddial.js +11 -8
  174. package/speeddial/speeddial.min.js +1 -1
  175. package/tabview/TabView.vue +6 -3
  176. package/tabview/tabview.cjs.js +6 -3
  177. package/tabview/tabview.cjs.min.js +1 -1
  178. package/tabview/tabview.esm.js +7 -4
  179. package/tabview/tabview.esm.min.js +1 -1
  180. package/tabview/tabview.js +6 -3
  181. package/tabview/tabview.min.js +1 -1
  182. package/tieredmenu/TieredMenu.vue +7 -3
  183. package/tieredmenu/tieredmenu.cjs.js +10 -6
  184. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  185. package/tieredmenu/tieredmenu.esm.js +11 -7
  186. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  187. package/tieredmenu/tieredmenu.js +10 -6
  188. package/tieredmenu/tieredmenu.min.js +1 -1
  189. package/tooltip/tooltip.cjs.js +0 -2
  190. package/tooltip/tooltip.cjs.min.js +1 -1
  191. package/tooltip/tooltip.esm.js +1 -3
  192. package/tooltip/tooltip.esm.min.js +1 -1
  193. package/tooltip/tooltip.js +0 -2
  194. package/tooltip/tooltip.min.js +1 -1
  195. package/utils/utils.cjs.js +12 -8
  196. package/utils/utils.cjs.min.js +1 -1
  197. package/utils/utils.esm.js +12 -8
  198. package/utils/utils.esm.min.js +1 -1
  199. package/utils/utils.js +12 -8
  200. package/utils/utils.min.js +1 -1
  201. package/web-types.json +1 -1
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/api"),t=require("primevue/overlayeventbus"),i=require("primevue/portal"),l=require("primevue/ripple"),s=require("primevue/utils"),n=require("primevue/virtualscroller"),o=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),c=a(i),d=a(l),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:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default: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},checkboxIcon:{type:String,default:"pi pi-check"},closeIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},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:()=>({focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?s.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return s.ObjectUtils.resolveFieldData(e,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&&s.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&s.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?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(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(e,t,i=-1,l=!1){if(this.disabled||this.isOptionDisabled(t))return;let n=null;n=this.isSelected(t)?this.modelValue.filter((e=>!s.ObjectUtils.equals(e,this.getOptionValue(t),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(t)],this.updateModel(e,n),-1!==i&&(this.focusedOptionIndex=i),l&&s.DomHandler.focus(this.$refs.focusInput)},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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(0,e.shiftKey?t: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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(e.shiftKey?0:t,t),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()?(s.DomHandler.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&s.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){s.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.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 s.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!s.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(e){const t=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((t=>!this.isOptionGroup(t)&&s.ObjectUtils.equals(this.getOptionValue(t),e,this.equalityKey)));return t?this.getOptionLabel(t):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.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(e,t){let i=this.modelValue.filter((e=>!s.ObjectUtils.equals(e,t,this.equalityKey)));this.updateModel(e,i)},clearFilter(){this.filterValue=null},hasFocusableElements(){return s.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(e){const t=this.getOptionValue(e);return(this.modelValue||[]).some((e=>s.ObjectUtils.equals(e,t,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e){this.searchValue=(this.searchValue||"")+e.key;let t=-1;-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&&(t=this.findFirstFocusedOptionIndex()),-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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=s.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.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,[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:this.dropdownIcon]},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 t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const l=e.items.filter((e=>i.includes(e)));l.length>0&&t.push({...e,items:[...l]})})),this.flatOptions(t)}return i}return t},label(){let e;if(this.modelValue&&this.modelValue.length){if(s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems(){return s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected(){return null!==this.selectAll?this.selectAll:s.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isOptionDisabled(e)||this.isSelected(e)))},hasSelectedOption(){return s.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 s.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},id(){return this.$attrs.id||s.UniqueComponentId()},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:d.default},components:{VirtualScroller:p.default,Portal:c.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"},y={class:"p-multiselect-token-label"},b=["onClick"],O={class:"p-multiselect-trigger"},g={key:0,class:"p-multiselect-header"},v={class:"p-hidden-accessible"},x=["checked","aria-label"],S={key:1,class:"p-multiselect-filter-container"},I=["value","placeholder","aria-owns","aria-activedescendant"],k={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},V=["aria-label"],L=["id"],C=["id"],F=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],w={class:"p-checkbox p-component"},E={key:0,class:"p-multiselect-empty-message",role:"option"},D={key:1,class:"p-multiselect-empty-message",role:"option"},K={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},B={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: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\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: inline-flex;\n align-items: center;\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: flex;\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: flex;\n align-items: center;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\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":n.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(n.chipSelectedItems,(t=>(o.openBlock(),o.createElementBlock("div",{key:n.getLabelByValue(t),class:"p-multiselect-token"},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createElementVNode("span",y,o.toDisplayString(n.getLabelByValue(t)),1)])),i.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["p-multiselect-token-icon",i.removeTokenIcon]),onClick:o.withModifiers((e=>n.removeOption(e,t)),["stop"])},null,10,b))])))),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",O,[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",g,[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",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",{[i.checkboxIcon]:n.allSelected}])},null,2)],2)],2)):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("div",S,[o.createElementVNode("input",o.mergeProps({ref:"filterInput",type:"text",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":n.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,I),o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-filter-icon",i.filterIcon])},null,2)])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("span",k,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),[o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-close-icon",i.closeIcon])},null,2)],16,V)),[[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:n.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,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.getOptionRenderKey(t,n.getOptionIndex(l,r))},[n.isOptionGroup(t)?(o.openBlock(),o.createElementBlock("li",{key:0,id:n.id+"_"+n.getOptionIndex(l,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(l,r)},(()=>[o.createTextVNode(o.toDisplayString(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,C)):o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:1,id:n.id+"_"+n.getOptionIndex(l,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(l,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(l,r)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(l,r),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(l,r))},[o.createElementVNode("div",w,[o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{[i.checkboxIcon]:n.isSelected(t)}])},null,2)],2)]),o.renderSlot(e.$slots,"option",{option:t,index:n.getOptionIndex(l,r)},(()=>[o.createElementVNode("span",null,o.toDisplayString(n.getOptionLabel(t)),1)]))],46,F)),[[c]])],64)))),128)),s.filterValue&&(!a||a&&0===a.length)?(o.openBlock(),o.createElementBlock("li",E,[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",D,[o.renderSlot(e.$slots,"empty",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyMessageText),1)]))])):o.createCommentVNode("",!0)],14,L)])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),o.renderSlot(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("span",K,o.toDisplayString(n.emptyMessageText),1)):o.createCommentVNode("",!0),o.createElementVNode("span",B,o.toDisplayString(n.selectedMessageText),1),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/api"),t=require("primevue/overlayeventbus"),i=require("primevue/portal"),l=require("primevue/ripple"),s=require("primevue/utils"),n=require("primevue/virtualscroller"),o=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),d=a(i),c=a(l),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:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default: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},checkboxIcon:{type:String,default:"pi pi-check"},closeIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},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(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||s.UniqueComponentId()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?s.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return s.ObjectUtils.resolveFieldData(e,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&&s.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&s.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?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(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?s.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;s.DomHandler.focus(t)},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(e,t,i=-1,l=!1){if(this.disabled||this.isOptionDisabled(t))return;let n=null;n=this.isSelected(t)?this.modelValue.filter((e=>!s.ObjectUtils.equals(e,this.getOptionValue(t),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(t)],this.updateModel(e,n),-1!==i&&(this.focusedOptionIndex=i),l&&s.DomHandler.focus(this.$refs.focusInput)},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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(0,e.shiftKey?t: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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(e.shiftKey?0:t,t),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()?(s.DomHandler.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&s.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){s.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.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 s.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!s.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(e){const t=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((t=>!this.isOptionGroup(t)&&s.ObjectUtils.equals(this.getOptionValue(t),e,this.equalityKey)));return t?this.getOptionLabel(t):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.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(e,t){let i=this.modelValue.filter((e=>!s.ObjectUtils.equals(e,t,this.equalityKey)));this.updateModel(e,i)},clearFilter(){this.filterValue=null},hasFocusableElements(){return s.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(e){const t=this.getOptionValue(e);return(this.modelValue||[]).some((e=>s.ObjectUtils.equals(e,t,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?s.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e){this.searchValue=(this.searchValue||"")+e.key;let t=-1;-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&&(t=this.findFirstFocusedOptionIndex()),-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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=s.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.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,[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:this.dropdownIcon]},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 t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const l=e.items.filter((e=>i.includes(e)));l.length>0&&t.push({...e,items:[...l]})})),this.flatOptions(t)}return i}return t},label(){let e;if(this.modelValue&&this.modelValue.length){if(s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems(){return s.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected(){return null!==this.selectAll?this.selectAll:s.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isOptionDisabled(e)||this.isSelected(e)))},hasSelectedOption(){return s.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 s.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:p.default,Portal:d.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"},y={class:"p-multiselect-token-label"},b=["onClick"],O={class:"p-multiselect-trigger"},g={key:0,class:"p-multiselect-header"},v={class:"p-hidden-accessible"},x=["checked","aria-label"],S={key:1,class:"p-multiselect-filter-container"},I=["value","placeholder","aria-owns","aria-activedescendant"],k={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},V=["aria-label"],L=["id"],C=["id"],F=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],w={class:"p-checkbox p-component"},E={key:0,class:"p-multiselect-empty-message",role:"option"},D={key:1,class:"p-multiselect-empty-message",role:"option"},K={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},B={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: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\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: inline-flex;\n align-items: center;\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: flex;\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: flex;\n align-items: center;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: flex;\n}\n"),h.render=function(e,t,i,l,s,n){const a=o.resolveComponent("VirtualScroller"),r=o.resolveComponent("Portal"),d=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(n.chipSelectedItems,(t=>(o.openBlock(),o.createElementBlock("div",{key:n.getLabelByValue(t),class:"p-multiselect-token"},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createElementVNode("span",y,o.toDisplayString(n.getLabelByValue(t)),1)])),i.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["p-multiselect-token-icon",i.removeTokenIcon]),onClick:o.withModifiers((e=>n.removeOption(e,t)),["stop"])},null,10,b))])))),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",O,[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",g,[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",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",{[i.checkboxIcon]:n.allSelected}])},null,2)],2)],2)):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("div",S,[o.createElementVNode("input",o.mergeProps({ref:"filterInput",type:"text",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,I),o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-filter-icon",i.filterIcon])},null,2)])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("span",k,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),[o.createElementVNode("span",{class:o.normalizeClass(["p-multiselect-close-icon",i.closeIcon])},null,2)],16,V)),[[d]])])):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:c,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(c),role:"listbox","aria-multiselectable":"true"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a,((t,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.getOptionRenderKey(t,n.getOptionIndex(l,r))},[n.isOptionGroup(t)?(o.openBlock(),o.createElementBlock("li",{key:0,id:s.id+"_"+n.getOptionIndex(l,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(l,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(l,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(l,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(l,r)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(l,r),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(l,r))},[o.createElementVNode("div",w,[o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{[i.checkboxIcon]:n.isSelected(t)}])},null,2)],2)]),o.renderSlot(e.$slots,"option",{option:t,index:n.getOptionIndex(l,r)},(()=>[o.createElementVNode("span",null,o.toDisplayString(n.getOptionLabel(t)),1)]))],46,F)),[[d]])],64)))),128)),s.filterValue&&(!a||a&&0===a.length)?(o.openBlock(),o.createElementBlock("li",E,[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",D,[o.renderSlot(e.$slots,"empty",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyMessageText),1)]))])):o.createCommentVNode("",!0)],14,L)])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),o.renderSlot(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("span",K,o.toDisplayString(n.emptyMessageText),1)):o.createCommentVNode("",!0),o.createElementVNode("span",B,o.toDisplayString(n.selectedMessageText),1),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;
@@ -2,7 +2,7 @@ import { FilterService } from 'primevue/api';
2
2
  import OverlayEventBus from 'primevue/overlayeventbus';
3
3
  import Portal from 'primevue/portal';
4
4
  import Ripple from 'primevue/ripple';
5
- import { ZIndexUtils, ObjectUtils, DomHandler, ConnectedOverlayScrollHandler, UniqueComponentId } from 'primevue/utils';
5
+ import { UniqueComponentId, ZIndexUtils, ObjectUtils, DomHandler, ConnectedOverlayScrollHandler } from 'primevue/utils';
6
6
  import VirtualScroller from 'primevue/virtualscroller';
7
7
  import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps, renderSlot, Fragment, createTextVNode, toDisplayString, renderList, withModifiers, createCommentVNode, createVNode, withCtx, Transition, withDirectives, normalizeStyle, createSlots } from 'vue';
8
8
 
@@ -181,6 +181,7 @@ var script = {
181
181
  focusOnHover: false,
182
182
  data() {
183
183
  return {
184
+ id: this.$attrs.id,
184
185
  focused: false,
185
186
  focusedOptionIndex: -1,
186
187
  headerCheckboxFocused: false,
@@ -189,11 +190,16 @@ var script = {
189
190
  };
190
191
  },
191
192
  watch: {
193
+ '$attrs.id': function (newValue) {
194
+ this.id = newValue || UniqueComponentId();
195
+ },
192
196
  options() {
193
197
  this.autoUpdateModel();
194
198
  }
195
199
  },
196
200
  mounted() {
201
+ this.id = this.id || UniqueComponentId();
202
+
197
203
  this.autoUpdateModel();
198
204
  },
199
205
  beforeUnmount() {
@@ -1010,9 +1016,6 @@ var script = {
1010
1016
  selectedMessageText() {
1011
1017
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText;
1012
1018
  },
1013
- id() {
1014
- return this.$attrs.id || UniqueComponentId();
1015
- },
1016
1019
  focusedOptionId() {
1017
1020
  return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
1018
1021
  },
@@ -1112,7 +1115,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1112
1115
  "aria-labelledby": _ctx.ariaLabelledby,
1113
1116
  "aria-haspopup": "listbox",
1114
1117
  "aria-expanded": $data.overlayVisible,
1115
- "aria-controls": $options.id + '_list',
1118
+ "aria-controls": $data.id + '_list',
1116
1119
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
1117
1120
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
1118
1121
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1237,7 +1240,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1237
1240
  placeholder: $props.filterPlaceholder,
1238
1241
  role: "searchbox",
1239
1242
  autocomplete: "off",
1240
- "aria-owns": $options.id + '_list',
1243
+ "aria-owns": $data.id + '_list',
1241
1244
  "aria-activedescendant": $options.focusedOptionId,
1242
1245
  onKeydown: _cache[8] || (_cache[8] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
1243
1246
  onBlur: _cache[9] || (_cache[9] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
@@ -1278,7 +1281,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1278
1281
  content: withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
1279
1282
  createElementVNode("ul", {
1280
1283
  ref: (el) => $options.listRef(el, contentRef),
1281
- id: $options.id + '_list',
1284
+ id: $data.id + '_list',
1282
1285
  class: normalizeClass(['p-multiselect-items p-component', styleClass]),
1283
1286
  style: normalizeStyle(contentStyle),
1284
1287
  role: "listbox",
@@ -1291,7 +1294,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1291
1294
  ($options.isOptionGroup(option))
1292
1295
  ? (openBlock(), createElementBlock("li", {
1293
1296
  key: 0,
1294
- id: $options.id + '_' + $options.getOptionIndex(i, getItemOptions),
1297
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1295
1298
  style: normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
1296
1299
  class: "p-multiselect-item-group",
1297
1300
  role: "option"
@@ -1305,7 +1308,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1305
1308
  ], 12, _hoisted_15))
1306
1309
  : withDirectives((openBlock(), createElementBlock("li", {
1307
1310
  key: 1,
1308
- id: $options.id + '_' + $options.getOptionIndex(i, getItemOptions),
1311
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1309
1312
  style: normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
1310
1313
  class: normalizeClass(['p-multiselect-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
1311
1314
  role: "option",
@@ -1 +1 @@
1
- import{FilterService as e}from"primevue/api";import t from"primevue/overlayeventbus";import i from"primevue/portal";import s from"primevue/ripple";import{ZIndexUtils as l,ObjectUtils as n,DomHandler as o,ConnectedOverlayScrollHandler as a,UniqueComponentId as r}from"primevue/utils";import d from"primevue/virtualscroller";import{resolveComponent as c,resolveDirective as p,openBlock as h,createElementBlock as u,normalizeClass as f,createElementVNode as y,mergeProps as b,renderSlot as m,Fragment as O,createTextVNode as v,toDisplayString as g,renderList as x,withModifiers as I,createCommentVNode as S,createVNode as L,withCtx as k,Transition as V,withDirectives as F,normalizeStyle as w,createSlots as C}from"vue";var K={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:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default: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},checkboxIcon:{type:String,default:"pi pi-check"},closeIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},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:()=>({focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?n.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?n.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?n.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&n.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return n.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return n.resolveFieldData(e,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&&o.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&o.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?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(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&n.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?o.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;o.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?o.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;o.focus(t)},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(e,t,i=-1,s=!1){if(this.disabled||this.isOptionDisabled(t))return;let l=null;l=this.isSelected(t)?this.modelValue.filter((e=>!n.equals(e,this.getOptionValue(t),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(t)],this.updateModel(e,l),-1!==i&&(this.focusedOptionIndex=i),s&&o.focus(this.$refs.focusInput)},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 s=Math.min(t,i),l=Math.max(t,i),n=this.visibleOptions.slice(s,l+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){t.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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(0,e.shiftKey?t: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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(e.shiftKey?0:t,t),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()?(o.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(e){l.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&o.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){l.clear(e)},alignOverlay(){"self"===this.appendTo?o.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=o.getOuterWidth(this.$el)+"px",o.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 a(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!o.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(e){const t=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((t=>!this.isOptionGroup(t)&&n.equals(this.getOptionValue(t),e,this.equalityKey)));return t?this.getOptionLabel(t):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.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(e,t){let i=this.modelValue.filter((e=>!n.equals(e,t,this.equalityKey)));this.updateModel(e,i)},clearFilter(){this.filterValue=null},hasFocusableElements(){return o.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(e){const t=this.getOptionValue(e);return(this.modelValue||[]).some((e=>n.equals(e,t,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return n.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?n.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?n.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?n.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e){this.searchValue=(this.searchValue||"")+e.key;let t=-1;-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&&(t=this.findFirstFocusedOptionIndex()),-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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=o.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.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,[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}),[])},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:this.dropdownIcon]},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 t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const s=e.items.filter((e=>i.includes(e)));s.length>0&&t.push({...e,items:[...s]})})),this.flatOptions(t)}return i}return t},label(){let e;if(this.modelValue&&this.modelValue.length){if(n.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems(){return n.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected(){return null!==this.selectAll?this.selectAll:n.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isOptionDisabled(e)||this.isSelected(e)))},hasSelectedOption(){return n.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 n.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},id(){return this.$attrs.id||r()},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:s},components:{VirtualScroller:d,Portal:i}};const M={class:"p-hidden-accessible"},$=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D={class:"p-multiselect-label-container"},T={class:"p-multiselect-token-label"},E=["onClick"],A={class:"p-multiselect-trigger"},H={key:0,class:"p-multiselect-header"},R={class:"p-hidden-accessible"},B=["checked","aria-label"],P={key:1,class:"p-multiselect-filter-container"},G=["value","placeholder","aria-owns","aria-activedescendant"],z={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},N=["aria-label"],U=["id"],_=["id"],q=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],j={class:"p-checkbox p-component"},W={key:0,class:"p-multiselect-empty-message",role:"option"},J={key:1,class:"p-multiselect-empty-message",role:"option"},Q={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},X={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 s=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&s.firstChild?s.insertBefore(l,s.firstChild):s.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\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: inline-flex;\n align-items: center;\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: flex;\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: flex;\n align-items: center;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: flex;\n}\n"),K.render=function(e,t,i,s,l,n){const o=c("VirtualScroller"),a=c("Portal"),r=p("ripple");return h(),u("div",{ref:"container",class:f(n.containerClass),onClick:t[15]||(t[15]=(...e)=>n.onContainerClick&&n.onContainerClick(...e))},[y("div",M,[y("input",b({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":l.overlayVisible,"aria-controls":n.id+"_list","aria-activedescendant":l.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,$)]),y("div",D,[y("div",{class:f(n.labelClass)},[m(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(h(),u(O,{key:0},[v(g(n.label||"empty"),1)],64)):"chip"===i.display?(h(),u(O,{key:1},[(h(!0),u(O,null,x(n.chipSelectedItems,(t=>(h(),u("div",{key:n.getLabelByValue(t),class:"p-multiselect-token"},[m(e.$slots,"chip",{value:t},(()=>[y("span",T,g(n.getLabelByValue(t)),1)])),i.disabled?S("",!0):(h(),u("span",{key:0,class:f(["p-multiselect-token-icon",i.removeTokenIcon]),onClick:I((e=>n.removeOption(e,t)),["stop"])},null,10,E))])))),128)),i.modelValue&&0!==i.modelValue.length?S("",!0):(h(),u(O,{key:0},[v(g(i.placeholder||"empty"),1)],64))],64)):S("",!0)]))],2)]),y("div",A,[m(e.$slots,"indicator",{},(()=>[y("span",{class:f(n.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),L(a,{appendTo:i.appendTo},{default:k((()=>[L(V,{name:"p-connected-overlay",onEnter:n.onOverlayEnter,onAfterEnter:n.onOverlayAfterEnter,onLeave:n.onOverlayLeave,onAfterLeave:n.onOverlayAfterLeave},{default:k((()=>[l.overlayVisible?(h(),u("div",b({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),[y("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),m(e.$slots,"header",{value:i.modelValue,options:n.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(h(),u("div",H,[i.showToggleAll&&null==i.selectionLimit?(h(),u("div",{key:0,class:f(n.headerCheckboxClass),onClick:t[6]||(t[6]=(...e)=>n.onToggleAll&&n.onToggleAll(...e))},[y("div",R,[y("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,B)]),y("div",{class:f(["p-checkbox-box",{"p-highlight":n.allSelected,"p-focus":l.headerCheckboxFocused}])},[y("span",{class:f(["p-checkbox-icon",{[i.checkboxIcon]:n.allSelected}])},null,2)],2)],2)):S("",!0),i.filter?(h(),u("div",P,[y("input",b({ref:"filterInput",type:"text",value:l.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":n.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,G),y("span",{class:f(["p-multiselect-filter-icon",i.filterIcon])},null,2)])):S("",!0),i.filter?(h(),u("span",z,g(n.filterResultMessageText),1)):S("",!0),F((h(),u("button",b({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),[y("span",{class:f(["p-multiselect-close-icon",i.closeIcon])},null,2)],16,N)),[[r]])])):S("",!0),y("div",{class:"p-multiselect-items-wrapper",style:w({"max-height":n.virtualScrollerDisabled?i.scrollHeight:""})},[L(o,b({ref:n.virtualScrollerRef},i.virtualScrollerOptions,{items:n.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:n.virtualScrollerDisabled}),C({content:k((({styleClass:t,contentRef:s,items:o,getItemOptions:a,contentStyle:d,itemSize:c})=>[y("ul",{ref:e=>n.listRef(e,s),id:n.id+"_list",class:f(["p-multiselect-items p-component",t]),style:w(d),role:"listbox","aria-multiselectable":"true"},[(h(!0),u(O,null,x(o,((t,s)=>(h(),u(O,{key:n.getOptionRenderKey(t,n.getOptionIndex(s,a))},[n.isOptionGroup(t)?(h(),u("li",{key:0,id:n.id+"_"+n.getOptionIndex(s,a),style:w({height:c?c+"px":void 0}),class:"p-multiselect-item-group",role:"option"},[m(e.$slots,"optiongroup",{option:t.optionGroup,index:n.getOptionIndex(s,a)},(()=>[v(g(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,_)):F((h(),u("li",{key:1,id:n.id+"_"+n.getOptionIndex(s,a),style:w({height:c?c+"px":void 0}),class:f(["p-multiselect-item",{"p-highlight":n.isSelected(t),"p-focus":l.focusedOptionIndex===n.getOptionIndex(s,a),"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(s,a)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(s,a),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(s,a))},[y("div",j,[y("div",{class:f(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[y("span",{class:f(["p-checkbox-icon",{[i.checkboxIcon]:n.isSelected(t)}])},null,2)],2)]),m(e.$slots,"option",{option:t,index:n.getOptionIndex(s,a)},(()=>[y("span",null,g(n.getOptionLabel(t)),1)]))],46,q)),[[r]])],64)))),128)),l.filterValue&&(!o||o&&0===o.length)?(h(),u("li",W,[m(e.$slots,"emptyfilter",{},(()=>[v(g(n.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(h(),u("li",J,[m(e.$slots,"empty",{},(()=>[v(g(n.emptyMessageText),1)]))])):S("",!0)],14,U)])),_:2},[e.$slots.loader?{name:"loader",fn:k((({options:t})=>[m(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),m(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),!i.options||i.options&&0===i.options.length?(h(),u("span",Q,g(n.emptyMessageText),1)):S("",!0),y("span",X,g(n.selectedMessageText),1),y("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)):S("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{K as default};
1
+ import{FilterService as e}from"primevue/api";import t from"primevue/overlayeventbus";import i from"primevue/portal";import s from"primevue/ripple";import{UniqueComponentId as l,ZIndexUtils as n,ObjectUtils as o,DomHandler as a,ConnectedOverlayScrollHandler as r}from"primevue/utils";import d from"primevue/virtualscroller";import{resolveComponent as c,resolveDirective as p,openBlock as h,createElementBlock as u,normalizeClass as f,createElementVNode as y,mergeProps as b,renderSlot as m,Fragment as O,createTextVNode as v,toDisplayString as g,renderList as x,withModifiers as I,createCommentVNode as S,createVNode as L,withCtx as k,Transition as V,withDirectives as F,normalizeStyle as w,createSlots as C}from"vue";var K={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:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default: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},checkboxIcon:{type:String,default:"pi pi-check"},closeIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},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(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||l()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||l(),this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(n.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?o.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?o.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&o.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.resolveFieldData(e,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&&a.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&a.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?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(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&o.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.focus(t)},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(e,t,i=-1,s=!1){if(this.disabled||this.isOptionDisabled(t))return;let l=null;l=this.isSelected(t)?this.modelValue.filter((e=>!o.equals(e,this.getOptionValue(t),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(t)],this.updateModel(e,l),-1!==i&&(this.focusedOptionIndex=i),s&&a.focus(this.$refs.focusInput)},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 s=Math.min(t,i),l=Math.max(t,i),n=this.visibleOptions.slice(s,l+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){t.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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(0,e.shiftKey?t: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){const{currentTarget:i}=e;if(t){const t=i.value.length;i.setSelectionRange(e.shiftKey?0:t,t),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()?(a.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(e){n.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&a.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){n.clear(e)},alignOverlay(){"self"===this.appendTo?a.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=a.getOuterWidth(this.$el)+"px",a.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 r(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!a.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(e){const t=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((t=>!this.isOptionGroup(t)&&o.equals(this.getOptionValue(t),e,this.equalityKey)));return t?this.getOptionLabel(t):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.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(e,t){let i=this.modelValue.filter((e=>!o.equals(e,t,this.equalityKey)));this.updateModel(e,i)},clearFilter(){this.filterValue=null},hasFocusableElements(){return a.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(e){const t=this.getOptionValue(e);return(this.modelValue||[]).some((e=>o.equals(e,t,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?o.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e){this.searchValue=(this.searchValue||"")+e.key;let t=-1;-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&&(t=this.findFirstFocusedOptionIndex()),-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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=a.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.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,[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}),[])},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:this.dropdownIcon]},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 t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const s=e.items.filter((e=>i.includes(e)));s.length>0&&t.push({...e,items:[...s]})})),this.flatOptions(t)}return i}return t},label(){let e;if(this.modelValue&&this.modelValue.length){if(o.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems(){return o.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected(){return null!==this.selectAll?this.selectAll:o.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isOptionDisabled(e)||this.isSelected(e)))},hasSelectedOption(){return o.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 o.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:s},components:{VirtualScroller:d,Portal:i}};const M={class:"p-hidden-accessible"},$=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D={class:"p-multiselect-label-container"},T={class:"p-multiselect-token-label"},E=["onClick"],A={class:"p-multiselect-trigger"},H={key:0,class:"p-multiselect-header"},R={class:"p-hidden-accessible"},B=["checked","aria-label"],P={key:1,class:"p-multiselect-filter-container"},G=["value","placeholder","aria-owns","aria-activedescendant"],z={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},N=["aria-label"],U=["id"],_=["id"],q=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],j={class:"p-checkbox p-component"},W={key:0,class:"p-multiselect-empty-message",role:"option"},J={key:1,class:"p-multiselect-empty-message",role:"option"},Q={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},X={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 s=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&s.firstChild?s.insertBefore(l,s.firstChild):s.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\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: inline-flex;\n align-items: center;\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: flex;\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: flex;\n align-items: center;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: flex;\n}\n"),K.render=function(e,t,i,s,l,n){const o=c("VirtualScroller"),a=c("Portal"),r=p("ripple");return h(),u("div",{ref:"container",class:f(n.containerClass),onClick:t[15]||(t[15]=(...e)=>n.onContainerClick&&n.onContainerClick(...e))},[y("div",M,[y("input",b({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":l.overlayVisible,"aria-controls":l.id+"_list","aria-activedescendant":l.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,$)]),y("div",D,[y("div",{class:f(n.labelClass)},[m(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(h(),u(O,{key:0},[v(g(n.label||"empty"),1)],64)):"chip"===i.display?(h(),u(O,{key:1},[(h(!0),u(O,null,x(n.chipSelectedItems,(t=>(h(),u("div",{key:n.getLabelByValue(t),class:"p-multiselect-token"},[m(e.$slots,"chip",{value:t},(()=>[y("span",T,g(n.getLabelByValue(t)),1)])),i.disabled?S("",!0):(h(),u("span",{key:0,class:f(["p-multiselect-token-icon",i.removeTokenIcon]),onClick:I((e=>n.removeOption(e,t)),["stop"])},null,10,E))])))),128)),i.modelValue&&0!==i.modelValue.length?S("",!0):(h(),u(O,{key:0},[v(g(i.placeholder||"empty"),1)],64))],64)):S("",!0)]))],2)]),y("div",A,[m(e.$slots,"indicator",{},(()=>[y("span",{class:f(n.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),L(a,{appendTo:i.appendTo},{default:k((()=>[L(V,{name:"p-connected-overlay",onEnter:n.onOverlayEnter,onAfterEnter:n.onOverlayAfterEnter,onLeave:n.onOverlayLeave,onAfterLeave:n.onOverlayAfterLeave},{default:k((()=>[l.overlayVisible?(h(),u("div",b({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),[y("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),m(e.$slots,"header",{value:i.modelValue,options:n.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(h(),u("div",H,[i.showToggleAll&&null==i.selectionLimit?(h(),u("div",{key:0,class:f(n.headerCheckboxClass),onClick:t[6]||(t[6]=(...e)=>n.onToggleAll&&n.onToggleAll(...e))},[y("div",R,[y("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,B)]),y("div",{class:f(["p-checkbox-box",{"p-highlight":n.allSelected,"p-focus":l.headerCheckboxFocused}])},[y("span",{class:f(["p-checkbox-icon",{[i.checkboxIcon]:n.allSelected}])},null,2)],2)],2)):S("",!0),i.filter?(h(),u("div",P,[y("input",b({ref:"filterInput",type:"text",value:l.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":l.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,G),y("span",{class:f(["p-multiselect-filter-icon",i.filterIcon])},null,2)])):S("",!0),i.filter?(h(),u("span",z,g(n.filterResultMessageText),1)):S("",!0),F((h(),u("button",b({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),[y("span",{class:f(["p-multiselect-close-icon",i.closeIcon])},null,2)],16,N)),[[r]])])):S("",!0),y("div",{class:"p-multiselect-items-wrapper",style:w({"max-height":n.virtualScrollerDisabled?i.scrollHeight:""})},[L(o,b({ref:n.virtualScrollerRef},i.virtualScrollerOptions,{items:n.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:n.virtualScrollerDisabled}),C({content:k((({styleClass:t,contentRef:s,items:o,getItemOptions:a,contentStyle:d,itemSize:c})=>[y("ul",{ref:e=>n.listRef(e,s),id:l.id+"_list",class:f(["p-multiselect-items p-component",t]),style:w(d),role:"listbox","aria-multiselectable":"true"},[(h(!0),u(O,null,x(o,((t,s)=>(h(),u(O,{key:n.getOptionRenderKey(t,n.getOptionIndex(s,a))},[n.isOptionGroup(t)?(h(),u("li",{key:0,id:l.id+"_"+n.getOptionIndex(s,a),style:w({height:c?c+"px":void 0}),class:"p-multiselect-item-group",role:"option"},[m(e.$slots,"optiongroup",{option:t.optionGroup,index:n.getOptionIndex(s,a)},(()=>[v(g(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,_)):F((h(),u("li",{key:1,id:l.id+"_"+n.getOptionIndex(s,a),style:w({height:c?c+"px":void 0}),class:f(["p-multiselect-item",{"p-highlight":n.isSelected(t),"p-focus":l.focusedOptionIndex===n.getOptionIndex(s,a),"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(s,a)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(s,a),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(s,a))},[y("div",j,[y("div",{class:f(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[y("span",{class:f(["p-checkbox-icon",{[i.checkboxIcon]:n.isSelected(t)}])},null,2)],2)]),m(e.$slots,"option",{option:t,index:n.getOptionIndex(s,a)},(()=>[y("span",null,g(n.getOptionLabel(t)),1)]))],46,q)),[[r]])],64)))),128)),l.filterValue&&(!o||o&&0===o.length)?(h(),u("li",W,[m(e.$slots,"emptyfilter",{},(()=>[v(g(n.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(h(),u("li",J,[m(e.$slots,"empty",{},(()=>[v(g(n.emptyMessageText),1)]))])):S("",!0)],14,U)])),_:2},[e.$slots.loader?{name:"loader",fn:k((({options:t})=>[m(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),m(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),!i.options||i.options&&0===i.options.length?(h(),u("span",Q,g(n.emptyMessageText),1)):S("",!0),y("span",X,g(n.selectedMessageText),1),y("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)):S("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{K as default};
@@ -184,6 +184,7 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
184
184
  focusOnHover: false,
185
185
  data() {
186
186
  return {
187
+ id: this.$attrs.id,
187
188
  focused: false,
188
189
  focusedOptionIndex: -1,
189
190
  headerCheckboxFocused: false,
@@ -192,11 +193,16 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
192
193
  };
193
194
  },
194
195
  watch: {
196
+ '$attrs.id': function (newValue) {
197
+ this.id = newValue || utils.UniqueComponentId();
198
+ },
195
199
  options() {
196
200
  this.autoUpdateModel();
197
201
  }
198
202
  },
199
203
  mounted() {
204
+ this.id = this.id || utils.UniqueComponentId();
205
+
200
206
  this.autoUpdateModel();
201
207
  },
202
208
  beforeUnmount() {
@@ -1013,9 +1019,6 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
1013
1019
  selectedMessageText() {
1014
1020
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText;
1015
1021
  },
1016
- id() {
1017
- return this.$attrs.id || utils.UniqueComponentId();
1018
- },
1019
1022
  focusedOptionId() {
1020
1023
  return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
1021
1024
  },
@@ -1115,7 +1118,7 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
1115
1118
  "aria-labelledby": _ctx.ariaLabelledby,
1116
1119
  "aria-haspopup": "listbox",
1117
1120
  "aria-expanded": $data.overlayVisible,
1118
- "aria-controls": $options.id + '_list',
1121
+ "aria-controls": $data.id + '_list',
1119
1122
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
1120
1123
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
1121
1124
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1240,7 +1243,7 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
1240
1243
  placeholder: $props.filterPlaceholder,
1241
1244
  role: "searchbox",
1242
1245
  autocomplete: "off",
1243
- "aria-owns": $options.id + '_list',
1246
+ "aria-owns": $data.id + '_list',
1244
1247
  "aria-activedescendant": $options.focusedOptionId,
1245
1248
  onKeydown: _cache[8] || (_cache[8] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
1246
1249
  onBlur: _cache[9] || (_cache[9] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
@@ -1281,7 +1284,7 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
1281
1284
  content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
1282
1285
  vue.createElementVNode("ul", {
1283
1286
  ref: (el) => $options.listRef(el, contentRef),
1284
- id: $options.id + '_list',
1287
+ id: $data.id + '_list',
1285
1288
  class: vue.normalizeClass(['p-multiselect-items p-component', styleClass]),
1286
1289
  style: vue.normalizeStyle(contentStyle),
1287
1290
  role: "listbox",
@@ -1294,7 +1297,7 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
1294
1297
  ($options.isOptionGroup(option))
1295
1298
  ? (vue.openBlock(), vue.createElementBlock("li", {
1296
1299
  key: 0,
1297
- id: $options.id + '_' + $options.getOptionIndex(i, getItemOptions),
1300
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1298
1301
  style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
1299
1302
  class: "p-multiselect-item-group",
1300
1303
  role: "option"
@@ -1308,7 +1311,7 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
1308
1311
  ], 12, _hoisted_15))
1309
1312
  : vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
1310
1313
  key: 1,
1311
- id: $options.id + '_' + $options.getOptionIndex(i, getItemOptions),
1314
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1312
1315
  style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
1313
1316
  class: vue.normalizeClass(['p-multiselect-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
1314
1317
  role: "option",