primevue 3.26.0 → 3.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/api/Api.d.ts +292 -284
  2. package/badge/Badge.d.ts +1 -1
  3. package/button/Button.d.ts +1 -1
  4. package/calendar/Calendar.vue +1 -1
  5. package/calendar/calendar.cjs.js +1 -1
  6. package/calendar/calendar.cjs.min.js +1 -1
  7. package/calendar/calendar.esm.js +1 -1
  8. package/calendar/calendar.esm.min.js +1 -1
  9. package/calendar/calendar.js +1 -1
  10. package/calendar/calendar.min.js +1 -1
  11. package/config/config.cjs.js +1 -1
  12. package/config/config.cjs.min.js +1 -1
  13. package/config/config.esm.js +1 -1
  14. package/config/config.esm.min.js +1 -1
  15. package/config/config.js +1 -1
  16. package/config/config.min.js +1 -1
  17. package/core/core.js +5 -4
  18. package/core/core.min.js +3 -3
  19. package/datatable/DataTable.d.ts +2 -2
  20. package/datatable/DataTable.vue +3 -1
  21. package/datatable/TableBody.vue +17 -5
  22. package/datatable/datatable.cjs.js +18 -15
  23. package/datatable/datatable.cjs.min.js +1 -1
  24. package/datatable/datatable.esm.js +18 -15
  25. package/datatable/datatable.esm.min.js +1 -1
  26. package/datatable/datatable.js +18 -15
  27. package/datatable/datatable.min.js +1 -1
  28. package/dropdown/Dropdown.d.ts +1 -1
  29. package/dropdown/Dropdown.vue +3 -2
  30. package/dropdown/dropdown.cjs.js +3 -2
  31. package/dropdown/dropdown.cjs.min.js +1 -1
  32. package/dropdown/dropdown.esm.js +3 -2
  33. package/dropdown/dropdown.esm.min.js +1 -1
  34. package/dropdown/dropdown.js +3 -2
  35. package/dropdown/dropdown.min.js +1 -1
  36. package/image/Image.d.ts +25 -0
  37. package/image/Image.vue +24 -6
  38. package/image/image.cjs.js +51 -41
  39. package/image/image.cjs.min.js +1 -1
  40. package/image/image.esm.js +51 -41
  41. package/image/image.esm.min.js +1 -1
  42. package/image/image.js +51 -41
  43. package/image/image.min.js +1 -1
  44. package/inlinemessage/InlineMessage.d.ts +1 -1
  45. package/listbox/Listbox.d.ts +1 -1
  46. package/message/Message.d.ts +1 -1
  47. package/multiselect/MultiSelect.d.ts +1 -1
  48. package/multiselect/MultiSelect.vue +3 -2
  49. package/multiselect/multiselect.cjs.js +3 -2
  50. package/multiselect/multiselect.cjs.min.js +1 -1
  51. package/multiselect/multiselect.esm.js +3 -2
  52. package/multiselect/multiselect.esm.min.js +1 -1
  53. package/multiselect/multiselect.js +3 -2
  54. package/multiselect/multiselect.min.js +1 -1
  55. package/package.json +1 -1
  56. package/splitbutton/SplitButton.d.ts +1 -1
  57. package/splitbutton/splitbutton.cjs.js +2 -2
  58. package/splitbutton/splitbutton.cjs.min.js +1 -1
  59. package/splitbutton/splitbutton.esm.js +2 -2
  60. package/splitbutton/splitbutton.esm.min.js +1 -1
  61. package/splitbutton/splitbutton.js +2 -2
  62. package/splitbutton/splitbutton.min.js +1 -1
  63. package/splitter/Splitter.vue +2 -11
  64. package/splitter/splitter.cjs.js +1 -2
  65. package/splitter/splitter.cjs.min.js +1 -1
  66. package/splitter/splitter.esm.js +1 -2
  67. package/splitter/splitter.esm.min.js +1 -1
  68. package/splitter/splitter.js +1 -2
  69. package/splitter/splitter.min.js +1 -1
  70. package/tag/Tag.d.ts +1 -1
  71. package/toast/Toast.d.ts +1 -1
  72. package/treetable/TreeTable.d.ts +2 -2
  73. package/vetur-attributes.json +4 -0
  74. package/vetur-tags.json +2 -1
  75. package/virtualscroller/VirtualScroller.vue +1 -1
  76. package/virtualscroller/virtualscroller.cjs.js +1 -1
  77. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  78. package/virtualscroller/virtualscroller.esm.js +1 -1
  79. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  80. package/virtualscroller/virtualscroller.js +1 -1
  81. package/virtualscroller/virtualscroller.min.js +1 -1
  82. package/web-types.json +37 -2
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.image=function(e,i,t,a){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),r={name:"Image",inheritAttrs:!1,emits:["show","hide","error"],props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null}},mask:null,data:()=>({maskVisible:!1,previewVisible:!1,rotate:0,scale:1}),beforeUnmount(){this.mask&&t.ZIndexUtils.clear(this.container)},methods:{maskRef(e){this.mask=e},toolbarRef(e){this.toolbarRef=e},onImageClick(){this.preview&&(this.maskVisible=!0,setTimeout((()=>{this.previewVisible=!0}),25))},onPreviewImageClick(){this.previewClick=!0},onMaskClick(){this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1},onMaskKeydown(e){if("Escape"===e.code)this.onMaskClick(),setTimeout((()=>{t.DomHandler.focus(this.$refs.previewButton)}),25),e.preventDefault()},onError(){this.$emit("error")},rotateRight(){this.rotate+=90,this.previewClick=!0},rotateLeft(){this.rotate-=90,this.previewClick=!0},zoomIn(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter(){t.ZIndexUtils.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter(){this.focus(),this.$emit("show")},onBeforeLeave(){t.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide")},onAfterLeave(e){t.ZIndexUtils.clear(e),this.maskVisible=!1},focus(){let e=this.mask.querySelector("[autofocus]");e&&e.focus()}},computed:{containerClass(){return["p-image p-component",this.class,{"p-image-preview-container":this.preview}]},maskClass:()=>["p-image-mask p-component-overlay p-component-overlay-enter"],rotateClass(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},zoomDisabled(){return this.scale<=.5||this.scale>=1.5},rightAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:n(i).default},directives:{focustrap:o.default}};const l=a.createElementVNode("i",{class:"p-image-preview-icon pi pi-eye"},null,-1),s=["aria-modal"],c={class:"p-image-toolbar"},m=["aria-label"],p=[a.createElementVNode("i",{class:"pi pi-refresh"},null,-1)],u=["aria-label"],d=[a.createElementVNode("i",{class:"pi pi-undo"},null,-1)],v=["disabled","aria-label"],h=[a.createElementVNode("i",{class:"pi pi-search-minus"},null,-1)],f=["disabled","aria-label"],g=[a.createElementVNode("i",{class:"pi pi-search-plus"},null,-1)],k=["aria-label"],b=[a.createElementVNode("i",{class:"pi pi-times"},null,-1)],w={key:0},y=["src"];return function(e,i){void 0===i&&(i={});var t=i.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n.p-image-preview-icon {\n font-size: 1.5rem;\n}\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n.p-image-preview-container > img {\n cursor: pointer;\n}\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n"),r.render=function(e,i,t,n,o,r){const C=a.resolveComponent("Portal"),E=a.resolveDirective("focustrap");return a.openBlock(),a.createElementBlock("span",{class:a.normalizeClass(r.containerClass),style:a.normalizeStyle(t.style)},[a.createElementVNode("img",a.mergeProps(e.$attrs,{style:t.imageStyle,class:t.imageClass,onError:i[0]||(i[0]=(...e)=>r.onError&&r.onError(...e))}),null,16),t.preview?(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:0,ref:"previewButton",class:"p-image-preview-indicator",onClick:i[1]||(i[1]=(...e)=>r.onImageClick&&r.onImageClick(...e))},t.previewButtonProps),[a.renderSlot(e.$slots,"indicator",{},(()=>[l]))],16)):a.createCommentVNode("",!0),a.createVNode(C,null,{default:a.withCtx((()=>[o.maskVisible?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,ref:r.maskRef,role:"dialog",class:a.normalizeClass(r.maskClass),"aria-modal":o.maskVisible,onClick:i[8]||(i[8]=(...e)=>r.onMaskClick&&r.onMaskClick(...e)),onKeydown:i[9]||(i[9]=(...e)=>r.onMaskKeydown&&r.onMaskKeydown(...e))},[a.createElementVNode("div",c,[a.createElementVNode("button",{class:"p-image-action p-link",onClick:i[2]||(i[2]=(...e)=>r.rotateRight&&r.rotateRight(...e)),type:"button","aria-label":r.rightAriaLabel},p,8,m),a.createElementVNode("button",{class:"p-image-action p-link",onClick:i[3]||(i[3]=(...e)=>r.rotateLeft&&r.rotateLeft(...e)),type:"button","aria-label":r.leftAriaLabel},d,8,u),a.createElementVNode("button",{class:"p-image-action p-link",onClick:i[4]||(i[4]=(...e)=>r.zoomOut&&r.zoomOut(...e)),type:"button",disabled:r.zoomDisabled,"aria-label":r.zoomOutAriaLabel},h,8,v),a.createElementVNode("button",{class:"p-image-action p-link",onClick:i[5]||(i[5]=(...e)=>r.zoomIn&&r.zoomIn(...e)),type:"button",disabled:r.zoomDisabled,"aria-label":r.zoomInAriaLabel},g,8,f),a.createElementVNode("button",{class:"p-image-action p-link",type:"button",onClick:i[6]||(i[6]=(...i)=>e.hidePreview&&e.hidePreview(...i)),"aria-label":r.closeAriaLabel,autofocus:""},b,8,k)]),a.createVNode(a.Transition,{name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},{default:a.withCtx((()=>[o.previewVisible?(a.openBlock(),a.createElementBlock("div",w,[a.createElementVNode("img",{src:e.$attrs.src,class:"p-image-preview",style:a.normalizeStyle(r.imagePreviewStyle),onClick:i[7]||(i[7]=(...e)=>r.onPreviewImageClick&&r.onPreviewImageClick(...e))},null,12,y)])):a.createCommentVNode("",!0)])),_:1},8,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],42,s)),[[E]]):a.createCommentVNode("",!0)])),_:1})],6)},r}(primevue.focustrap,primevue.portal,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.image=function(e,t,i,a){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(e),r={name:"Image",inheritAttrs:!1,emits:["show","hide","error"],props:{preview:{type:Boolean,default:!1},class:{type:null,default:null},style:{type:null,default:null},imageStyle:{type:null,default:null},imageClass:{type:null,default:null},previewButtonProps:{type:null,default:null},indicatorIcon:{type:String,default:"pi pi-eye"}},mask:null,data:()=>({maskVisible:!1,previewVisible:!1,rotate:0,scale:1}),beforeUnmount(){this.mask&&i.ZIndexUtils.clear(this.container)},methods:{maskRef(e){this.mask=e},toolbarRef(e){this.toolbarRef=e},onImageClick(){this.preview&&(this.maskVisible=!0,setTimeout((()=>{this.previewVisible=!0}),25))},onPreviewImageClick(){this.previewClick=!0},onMaskClick(){this.previewClick||(this.previewVisible=!1,this.rotate=0,this.scale=1),this.previewClick=!1},onMaskKeydown(e){if("Escape"===e.code)this.onMaskClick(),setTimeout((()=>{i.DomHandler.focus(this.$refs.previewButton)}),25),e.preventDefault()},onError(){this.$emit("error")},rotateRight(){this.rotate+=90,this.previewClick=!0},rotateLeft(){this.rotate-=90,this.previewClick=!0},zoomIn(){this.scale=this.scale+.1,this.previewClick=!0},zoomOut(){this.scale=this.scale-.1,this.previewClick=!0},onBeforeEnter(){i.ZIndexUtils.set("modal",this.mask,this.$primevue.config.zIndex.modal)},onEnter(){this.focus(),this.$emit("show")},onBeforeLeave(){i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide")},onAfterLeave(e){i.ZIndexUtils.clear(e),this.maskVisible=!1},focus(){let e=this.mask.querySelector("[autofocus]");e&&e.focus()}},computed:{containerClass(){return["p-image p-component",this.class,{"p-image-preview-container":this.preview}]},maskClass:()=>["p-image-mask p-component-overlay p-component-overlay-enter"],rotateClass(){return"p-image-preview-rotate-"+this.rotate},imagePreviewStyle(){return{transform:"rotate("+this.rotate+"deg) scale("+this.scale+")"}},zoomDisabled(){return this.scale<=.5||this.scale>=1.5},rightAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateRight:void 0},leftAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.rotateLeft:void 0},zoomInAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomIn:void 0},zoomOutAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.zoomOut:void 0},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{Portal:o(t).default},directives:{focustrap:n.default}};const l=["aria-modal"],s={class:"p-image-toolbar"},c=["aria-label"],m=a.createElementVNode("i",{class:"pi pi-refresh"},null,-1),p=["aria-label"],u=a.createElementVNode("i",{class:"pi pi-undo"},null,-1),d=["disabled","aria-label"],v=a.createElementVNode("i",{class:"pi pi-search-minus"},null,-1),h=["disabled","aria-label"],f=a.createElementVNode("i",{class:"pi pi-search-plus"},null,-1),g=["aria-label"],k=a.createElementVNode("i",{class:"pi pi-times"},null,-1),b={key:0},w=["src"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-image-preview-container {\n position: relative;\n display: inline-block;\n}\n.p-image-preview-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n}\n.p-image-preview-icon {\n font-size: 1.5rem;\n}\n.p-image-preview-container:hover > .p-image-preview-indicator {\n opacity: 1;\n cursor: pointer;\n}\n.p-image-preview-container > img {\n cursor: pointer;\n}\n.p-image-toolbar {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n}\n.p-image-action.p-link {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.p-image-preview {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n.p-image-preview-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-image-preview-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-image-preview-enter-from,\n.p-image-preview-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n"),r.render=function(e,t,i,o,n,r){const y=a.resolveComponent("Portal"),C=a.resolveDirective("focustrap");return a.openBlock(),a.createElementBlock("span",{class:a.normalizeClass(r.containerClass),style:a.normalizeStyle(i.style)},[a.createElementVNode("img",a.mergeProps(e.$attrs,{style:i.imageStyle,class:i.imageClass,onError:t[0]||(t[0]=(...e)=>r.onError&&r.onError(...e))}),null,16),i.preview?(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:0,ref:"previewButton",class:"p-image-preview-indicator",onClick:t[1]||(t[1]=(...e)=>r.onImageClick&&r.onImageClick(...e))},i.previewButtonProps),[a.renderSlot(e.$slots,"indicator",{},(()=>[a.createElementVNode("i",{class:a.normalizeClass(["p-image-preview-icon",i.indicatorIcon])},null,2)]))],16)):a.createCommentVNode("",!0),a.createVNode(y,null,{default:a.withCtx((()=>[n.maskVisible?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,ref:r.maskRef,role:"dialog",class:a.normalizeClass(r.maskClass),"aria-modal":n.maskVisible,onClick:t[8]||(t[8]=(...e)=>r.onMaskClick&&r.onMaskClick(...e)),onKeydown:t[9]||(t[9]=(...e)=>r.onMaskKeydown&&r.onMaskKeydown(...e))},[a.createElementVNode("div",s,[a.createElementVNode("button",{class:"p-image-action p-link",onClick:t[2]||(t[2]=(...e)=>r.rotateRight&&r.rotateRight(...e)),type:"button","aria-label":r.rightAriaLabel},[a.renderSlot(e.$slots,"refresh",{},(()=>[m]))],8,c),a.createElementVNode("button",{class:"p-image-action p-link",onClick:t[3]||(t[3]=(...e)=>r.rotateLeft&&r.rotateLeft(...e)),type:"button","aria-label":r.leftAriaLabel},[a.renderSlot(e.$slots,"undo",{},(()=>[u]))],8,p),a.createElementVNode("button",{class:"p-image-action p-link",onClick:t[4]||(t[4]=(...e)=>r.zoomOut&&r.zoomOut(...e)),type:"button",disabled:r.zoomDisabled,"aria-label":r.zoomOutAriaLabel},[a.renderSlot(e.$slots,"zoomout",{},(()=>[v]))],8,d),a.createElementVNode("button",{class:"p-image-action p-link",onClick:t[5]||(t[5]=(...e)=>r.zoomIn&&r.zoomIn(...e)),type:"button",disabled:r.zoomDisabled,"aria-label":r.zoomInAriaLabel},[a.renderSlot(e.$slots,"zoomin",{},(()=>[f]))],8,h),a.createElementVNode("button",{class:"p-image-action p-link",type:"button",onClick:t[6]||(t[6]=(...t)=>e.hidePreview&&e.hidePreview(...t)),"aria-label":r.closeAriaLabel,autofocus:""},[a.renderSlot(e.$slots,"close",{},(()=>[k]))],8,g)]),a.createVNode(a.Transition,{name:"p-image-preview",onBeforeEnter:r.onBeforeEnter,onEnter:r.onEnter,onLeave:r.onLeave,onBeforeLeave:r.onBeforeLeave,onAfterLeave:r.onAfterLeave},{default:a.withCtx((()=>[n.previewVisible?(a.openBlock(),a.createElementBlock("div",b,[a.createElementVNode("img",{src:e.$attrs.src,class:"p-image-preview",style:a.normalizeStyle(r.imagePreviewStyle),onClick:t[7]||(t[7]=(...e)=>r.onPreviewImageClick&&r.onPreviewImageClick(...e))},null,12,w)])):a.createCommentVNode("",!0)])),_:1},8,["onBeforeEnter","onEnter","onLeave","onBeforeLeave","onAfterLeave"])],42,l)),[[C]]):a.createCommentVNode("",!0)])),_:3})],6)},r}(primevue.focustrap,primevue.portal,primevue.utils,Vue);
@@ -18,7 +18,7 @@ export interface InlineMessageProps {
18
18
  * Severity level of the message.
19
19
  * @defaultValue info
20
20
  */
21
- severity?: 'success' | 'info' | 'warn' | 'error' | undefined;
21
+ severity?: 'success' | 'info' | 'warn' | 'error' | string | undefined;
22
22
  }
23
23
  /**
24
24
  * Defines valid slots in InlineMessage slots.
@@ -114,7 +114,7 @@ export interface ListboxProps {
114
114
  * Defines the filtering algorithm to use when searching the options.
115
115
  * @defaultValue contains
116
116
  */
117
- filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | undefined;
117
+ filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | string | undefined;
118
118
  /**
119
119
  * Fields used when filtering the options, defaults to optionLabel.
120
120
  */
@@ -18,7 +18,7 @@ export interface MessageProps {
18
18
  * Severity level of the message.
19
19
  * @defaultValue info
20
20
  */
21
- severity?: 'success' | 'info' | 'warn' | 'error' | undefined;
21
+ severity?: 'success' | 'info' | 'warn' | 'error' | string | undefined;
22
22
  /**
23
23
  * Whether the message can be closed manually using the close icon.
24
24
  * @defaultValue true
@@ -151,7 +151,7 @@ export interface MultiSelectProps {
151
151
  * Defines the filtering algorithm to use when searching the options.
152
152
  * @defaultValue contains
153
153
  */
154
- filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | undefined;
154
+ filterMatchMode?: 'contains' | 'startsWith' | 'endsWith' | string | undefined;
155
155
  /**
156
156
  * Fields used when filtering the options, defaults to optionLabel.
157
157
  */
@@ -1093,9 +1093,10 @@ export default {
1093
1093
  const filtered = [];
1094
1094
 
1095
1095
  optionGroups.forEach((group) => {
1096
- const filteredItems = group.items.filter((item) => filteredOptions.includes(item));
1096
+ const groupChildren = this.getOptionGroupChildren(group);
1097
+ const filteredItems = groupChildren.filter((item) => filteredOptions.includes(item));
1097
1098
 
1098
- if (filteredItems.length > 0) filtered.push({ ...group, items: [...filteredItems] });
1099
+ if (filteredItems.length > 0) filtered.push({ ...group, [typeof this.optionGroupChildren === 'string' ? this.optionGroupChildren : 'items']: [...filteredItems] });
1099
1100
  });
1100
1101
 
1101
1102
  return this.flatOptions(filtered);
@@ -949,9 +949,10 @@ var script = {
949
949
  const filtered = [];
950
950
 
951
951
  optionGroups.forEach((group) => {
952
- const filteredItems = group.items.filter((item) => filteredOptions.includes(item));
952
+ const groupChildren = this.getOptionGroupChildren(group);
953
+ const filteredItems = groupChildren.filter((item) => filteredOptions.includes(item));
953
954
 
954
- if (filteredItems.length > 0) filtered.push({ ...group, items: [...filteredItems] });
955
+ if (filteredItems.length > 0) filtered.push({ ...group, [typeof this.optionGroupChildren === 'string' ? this.optionGroupChildren : 'items']: [...filteredItems] });
955
956
  });
956
957
 
957
958
  return this.flatOptions(filtered);
@@ -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),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;
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=this.getOptionGroupChildren(e).filter((e=>i.includes(e)));l.length>0&&t.push({...e,["string"==typeof this.optionGroupChildren?this.optionGroupChildren:"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;
@@ -940,9 +940,10 @@ var script = {
940
940
  const filtered = [];
941
941
 
942
942
  optionGroups.forEach((group) => {
943
- const filteredItems = group.items.filter((item) => filteredOptions.includes(item));
943
+ const groupChildren = this.getOptionGroupChildren(group);
944
+ const filteredItems = groupChildren.filter((item) => filteredOptions.includes(item));
944
945
 
945
- if (filteredItems.length > 0) filtered.push({ ...group, items: [...filteredItems] });
946
+ if (filteredItems.length > 0) filtered.push({ ...group, [typeof this.optionGroupChildren === 'string' ? this.optionGroupChildren : 'items']: [...filteredItems] });
946
947
  });
947
948
 
948
949
  return this.flatOptions(filtered);
@@ -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{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};
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=this.getOptionGroupChildren(e).filter((e=>i.includes(e)));s.length>0&&t.push({...e,["string"==typeof this.optionGroupChildren?this.optionGroupChildren:"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};
@@ -943,9 +943,10 @@ this.primevue.multiselect = (function (api, OverlayEventBus, Portal, Ripple, uti
943
943
  const filtered = [];
944
944
 
945
945
  optionGroups.forEach((group) => {
946
- const filteredItems = group.items.filter((item) => filteredOptions.includes(item));
946
+ const groupChildren = this.getOptionGroupChildren(group);
947
+ const filteredItems = groupChildren.filter((item) => filteredOptions.includes(item));
947
948
 
948
- if (filteredItems.length > 0) filtered.push({ ...group, items: [...filteredItems] });
949
+ if (filteredItems.length > 0) filtered.push({ ...group, [typeof this.optionGroupChildren === 'string' ? this.optionGroupChildren : 'items']: [...filteredItems] });
949
950
  });
950
951
 
951
952
  return this.flatOptions(filtered);