primevue 3.22.2 → 3.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +1 -1
  2. package/accordion/Accordion.vue +7 -3
  3. package/accordion/accordion.cjs.js +7 -3
  4. package/accordion/accordion.cjs.min.js +1 -1
  5. package/accordion/accordion.esm.js +8 -4
  6. package/accordion/accordion.esm.min.js +1 -1
  7. package/accordion/accordion.js +7 -3
  8. package/accordion/accordion.min.js +1 -1
  9. package/autocomplete/AutoComplete.vue +6 -3
  10. package/autocomplete/autocomplete.cjs.js +12 -9
  11. package/autocomplete/autocomplete.cjs.min.js +1 -1
  12. package/autocomplete/autocomplete.esm.js +13 -10
  13. package/autocomplete/autocomplete.esm.min.js +1 -1
  14. package/autocomplete/autocomplete.js +12 -9
  15. package/autocomplete/autocomplete.min.js +1 -1
  16. package/breadcrumb/Breadcrumb.vue +2 -2
  17. package/breadcrumb/breadcrumb.cjs.js +17 -10
  18. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  19. package/breadcrumb/breadcrumb.esm.js +17 -10
  20. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  21. package/breadcrumb/breadcrumb.js +17 -10
  22. package/breadcrumb/breadcrumb.min.js +1 -1
  23. package/cascadeselect/CascadeSelect.vue +6 -3
  24. package/cascadeselect/cascadeselect.cjs.js +9 -6
  25. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  26. package/cascadeselect/cascadeselect.esm.js +10 -7
  27. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  28. package/cascadeselect/cascadeselect.js +9 -6
  29. package/cascadeselect/cascadeselect.min.js +1 -1
  30. package/contextmenu/ContextMenu.vue +6 -3
  31. package/contextmenu/contextmenu.cjs.js +8 -5
  32. package/contextmenu/contextmenu.cjs.min.js +1 -1
  33. package/contextmenu/contextmenu.esm.js +9 -6
  34. package/contextmenu/contextmenu.esm.min.js +1 -1
  35. package/contextmenu/contextmenu.js +8 -5
  36. package/contextmenu/contextmenu.min.js +1 -1
  37. package/core/core.js +48 -34
  38. package/core/core.min.js +5 -5
  39. package/datatable/BodyCell.vue +4 -2
  40. package/datatable/datatable.cjs.js +4 -2
  41. package/datatable/datatable.cjs.min.js +1 -1
  42. package/datatable/datatable.esm.js +4 -2
  43. package/datatable/datatable.esm.min.js +1 -1
  44. package/datatable/datatable.js +4 -2
  45. package/datatable/datatable.min.js +1 -1
  46. package/dock/DockSub.vue +9 -3
  47. package/dock/dock.cjs.js +10 -4
  48. package/dock/dock.cjs.min.js +1 -1
  49. package/dock/dock.esm.js +11 -5
  50. package/dock/dock.esm.min.js +1 -1
  51. package/dock/dock.js +10 -4
  52. package/dock/dock.min.js +1 -1
  53. package/dropdown/Dropdown.vue +6 -3
  54. package/dropdown/dropdown.cjs.js +13 -10
  55. package/dropdown/dropdown.cjs.min.js +1 -1
  56. package/dropdown/dropdown.esm.js +14 -11
  57. package/dropdown/dropdown.esm.min.js +1 -1
  58. package/dropdown/dropdown.js +13 -10
  59. package/dropdown/dropdown.min.js +1 -1
  60. package/listbox/Listbox.vue +6 -3
  61. package/listbox/listbox.cjs.js +11 -8
  62. package/listbox/listbox.cjs.min.js +1 -1
  63. package/listbox/listbox.esm.js +12 -9
  64. package/listbox/listbox.esm.min.js +1 -1
  65. package/listbox/listbox.js +11 -8
  66. package/listbox/listbox.min.js +1 -1
  67. package/megamenu/MegaMenu.vue +7 -3
  68. package/megamenu/megamenu.cjs.js +10 -6
  69. package/megamenu/megamenu.cjs.min.js +1 -1
  70. package/megamenu/megamenu.esm.js +11 -7
  71. package/megamenu/megamenu.esm.min.js +1 -1
  72. package/megamenu/megamenu.js +10 -6
  73. package/megamenu/megamenu.min.js +1 -1
  74. package/menu/Menu.vue +8 -3
  75. package/menu/menu.cjs.js +13 -8
  76. package/menu/menu.cjs.min.js +1 -1
  77. package/menu/menu.esm.js +14 -9
  78. package/menu/menu.esm.min.js +1 -1
  79. package/menu/menu.js +13 -8
  80. package/menu/menu.min.js +1 -1
  81. package/menubar/Menubar.vue +7 -3
  82. package/menubar/menubar.cjs.js +10 -6
  83. package/menubar/menubar.cjs.min.js +1 -1
  84. package/menubar/menubar.esm.js +11 -7
  85. package/menubar/menubar.esm.min.js +1 -1
  86. package/menubar/menubar.js +10 -6
  87. package/menubar/menubar.min.js +1 -1
  88. package/multiselect/MultiSelect.vue +6 -3
  89. package/multiselect/multiselect.cjs.js +11 -8
  90. package/multiselect/multiselect.cjs.min.js +1 -1
  91. package/multiselect/multiselect.esm.js +12 -9
  92. package/multiselect/multiselect.esm.min.js +1 -1
  93. package/multiselect/multiselect.js +11 -8
  94. package/multiselect/multiselect.min.js +1 -1
  95. package/orderlist/OrderList.vue +8 -3
  96. package/orderlist/orderlist.cjs.js +11 -6
  97. package/orderlist/orderlist.cjs.min.js +1 -1
  98. package/orderlist/orderlist.esm.js +12 -7
  99. package/orderlist/orderlist.esm.min.js +1 -1
  100. package/orderlist/orderlist.js +11 -6
  101. package/orderlist/orderlist.min.js +1 -1
  102. package/package.json +1 -1
  103. package/panelmenu/PanelMenu.vue +9 -6
  104. package/panelmenu/PanelMenuList.vue +1 -1
  105. package/panelmenu/panelmenu.cjs.js +11 -8
  106. package/panelmenu/panelmenu.cjs.min.js +1 -1
  107. package/panelmenu/panelmenu.esm.js +11 -8
  108. package/panelmenu/panelmenu.esm.min.js +1 -1
  109. package/panelmenu/panelmenu.js +11 -8
  110. package/panelmenu/panelmenu.min.js +1 -1
  111. package/picklist/PickList.vue +8 -2
  112. package/picklist/picklist.cjs.js +8 -2
  113. package/picklist/picklist.cjs.min.js +1 -1
  114. package/picklist/picklist.esm.js +9 -3
  115. package/picklist/picklist.esm.min.js +1 -1
  116. package/picklist/picklist.js +8 -2
  117. package/picklist/picklist.min.js +1 -1
  118. package/rating/Rating.vue +9 -3
  119. package/rating/rating.cjs.js +11 -5
  120. package/rating/rating.cjs.min.js +1 -1
  121. package/rating/rating.esm.js +12 -6
  122. package/rating/rating.esm.min.js +1 -1
  123. package/rating/rating.js +11 -5
  124. package/rating/rating.min.js +1 -1
  125. package/resources/themes/arya-blue/theme.css +7 -0
  126. package/resources/themes/arya-green/theme.css +7 -0
  127. package/resources/themes/arya-orange/theme.css +7 -0
  128. package/resources/themes/arya-purple/theme.css +7 -0
  129. package/resources/themes/bootstrap4-dark-blue/theme.css +7 -0
  130. package/resources/themes/bootstrap4-dark-purple/theme.css +7 -0
  131. package/resources/themes/bootstrap4-light-blue/theme.css +7 -0
  132. package/resources/themes/bootstrap4-light-purple/theme.css +7 -0
  133. package/resources/themes/fluent-light/theme.css +7 -0
  134. package/resources/themes/lara-dark-blue/theme.css +7 -0
  135. package/resources/themes/lara-dark-indigo/theme.css +7 -0
  136. package/resources/themes/lara-dark-purple/theme.css +7 -0
  137. package/resources/themes/lara-dark-teal/theme.css +7 -0
  138. package/resources/themes/lara-light-blue/theme.css +7 -0
  139. package/resources/themes/lara-light-indigo/theme.css +7 -0
  140. package/resources/themes/lara-light-purple/theme.css +7 -0
  141. package/resources/themes/lara-light-teal/theme.css +7 -0
  142. package/resources/themes/luna-amber/theme.css +7 -0
  143. package/resources/themes/luna-blue/theme.css +7 -0
  144. package/resources/themes/luna-green/theme.css +7 -0
  145. package/resources/themes/luna-pink/theme.css +7 -0
  146. package/resources/themes/md-dark-deeppurple/theme.css +10 -2
  147. package/resources/themes/md-dark-indigo/theme.css +10 -2
  148. package/resources/themes/md-light-deeppurple/theme.css +10 -2
  149. package/resources/themes/md-light-indigo/theme.css +10 -2
  150. package/resources/themes/mdc-dark-deeppurple/theme.css +10 -2
  151. package/resources/themes/mdc-dark-indigo/theme.css +10 -2
  152. package/resources/themes/mdc-light-deeppurple/theme.css +10 -2
  153. package/resources/themes/mdc-light-indigo/theme.css +10 -2
  154. package/resources/themes/nova/theme.css +7 -0
  155. package/resources/themes/nova-accent/theme.css +7 -0
  156. package/resources/themes/nova-alt/theme.css +7 -0
  157. package/resources/themes/nova-vue/theme.css +7 -0
  158. package/resources/themes/rhea/theme.css +7 -0
  159. package/resources/themes/saga-blue/theme.css +7 -0
  160. package/resources/themes/saga-green/theme.css +7 -0
  161. package/resources/themes/saga-orange/theme.css +7 -0
  162. package/resources/themes/saga-purple/theme.css +7 -0
  163. package/resources/themes/tailwind-light/theme.css +7 -0
  164. package/resources/themes/vela-blue/theme.css +7 -0
  165. package/resources/themes/vela-green/theme.css +7 -0
  166. package/resources/themes/vela-orange/theme.css +7 -0
  167. package/resources/themes/vela-purple/theme.css +7 -0
  168. package/speeddial/SpeedDial.vue +6 -3
  169. package/speeddial/speeddial.cjs.js +11 -8
  170. package/speeddial/speeddial.cjs.min.js +1 -1
  171. package/speeddial/speeddial.esm.js +12 -9
  172. package/speeddial/speeddial.esm.min.js +1 -1
  173. package/speeddial/speeddial.js +11 -8
  174. package/speeddial/speeddial.min.js +1 -1
  175. package/tabview/TabView.vue +6 -3
  176. package/tabview/tabview.cjs.js +6 -3
  177. package/tabview/tabview.cjs.min.js +1 -1
  178. package/tabview/tabview.esm.js +7 -4
  179. package/tabview/tabview.esm.min.js +1 -1
  180. package/tabview/tabview.js +6 -3
  181. package/tabview/tabview.min.js +1 -1
  182. package/tieredmenu/TieredMenu.vue +7 -3
  183. package/tieredmenu/tieredmenu.cjs.js +10 -6
  184. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  185. package/tieredmenu/tieredmenu.esm.js +11 -7
  186. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  187. package/tieredmenu/tieredmenu.js +10 -6
  188. package/tieredmenu/tieredmenu.min.js +1 -1
  189. package/tooltip/tooltip.cjs.js +0 -2
  190. package/tooltip/tooltip.cjs.min.js +1 -1
  191. package/tooltip/tooltip.esm.js +1 -3
  192. package/tooltip/tooltip.esm.min.js +1 -1
  193. package/tooltip/tooltip.js +0 -2
  194. package/tooltip/tooltip.min.js +1 -1
  195. package/utils/utils.cjs.js +12 -8
  196. package/utils/utils.cjs.min.js +1 -1
  197. package/utils/utils.esm.js +12 -8
  198. package/utils/utils.esm.min.js +1 -1
  199. package/utils/utils.js +12 -8
  200. package/utils/utils.min.js +1 -1
  201. package/web-types.json +1 -1
@@ -1 +1 @@
1
- import e from"primevue/button";import t from"primevue/overlayeventbus";import i from"primevue/portal";import n from"primevue/ripple";import{ObjectUtils as o,ZIndexUtils as s,DomHandler as l,ConnectedOverlayScrollHandler as a,UniqueComponentId as r}from"primevue/utils";import p from"primevue/virtualscroller";import{resolveComponent as d,resolveDirective as u,openBlock as c,createElementBlock as h,normalizeClass as f,mergeProps as y,createCommentVNode as m,Fragment as O,renderList as g,renderSlot as v,createElementVNode as b,toDisplayString as x,createBlock as I,createVNode as w,withCtx as S,Transition as C,createSlots as k,normalizeStyle as L,createTextVNode as M,withDirectives as V}from"vue";var $={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},dropdownClass:{type:String,default:null},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data:()=>({focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}),watch:{suggestions(){this.searching&&(o.isNotEmpty(this.suggestions)||this.$slots.empty?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?o.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!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.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&l.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&l.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,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.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(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":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((e=>this.isOptionMatched(e,this.$refs.focusInput.value||"")));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.disabled||(this.focused=!0)},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||l.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(l.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],n])):this.updateModel(e,n),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){t.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-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();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(o.isEmpty(t.value)&&this.hasSelectedOption?(l.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(0,e.shiftKey?i:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(e.shiftKey?0:i,i),this.focusedOptionIndex=-1,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&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(o.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,l.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){s.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},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.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?l.relativePosition(this.overlay,e):(this.overlay.style.minWidth=l.getOuterWidth(e)+"px",l.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new a(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.equals(this.modelValue,this.getOptionValue(e),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},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],n=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,n),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,l.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=l.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},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 n=this.getOptionGroupChildren(t);return n&&n.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-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||o.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return o.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return o.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},id(){return this.$attrs.id||r()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:e,VirtualScroller:p,Portal:i},directives:{ripple:n}};const K=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D=["aria-activedescendant"],F=["id","aria-label","aria-setsize","aria-posinset"],E={class:"p-autocomplete-token-label"},T=["onClick"],A={class:"p-autocomplete-input-token",role:"option"},B=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],R={role:"status","aria-live":"polite",class:"p-hidden-accessible"},z=["id"],P=["id"],G=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],H={key:0,class:"p-autocomplete-empty-message",role:"option"},_={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 n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-autocomplete {\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-autocomplete-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n flex: 1 1 auto;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),$.render=function(e,t,i,n,o,s){const l=d("Button"),a=d("VirtualScroller"),r=d("Portal"),p=u("ripple");return c(),h("div",{ref:"container",class:f(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.multiple?m("",!0):(c(),h("input",y({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,K)),i.multiple?(c(),h("ul",{key:1,ref:"multiContainer",class:f(s.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":o.focused?s.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>s.onMultipleContainerFocus&&s.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onMultipleContainerBlur&&s.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown(...e))},[(c(!0),h(O,null,g(i.modelValue,((t,n)=>(c(),h("li",{key:n,id:s.id+"_multiple_option_"+n,class:f(["p-autocomplete-token",{"p-focus":o.focusedMultipleOptionIndex===n}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":n+1},[v(e.$slots,"chip",{value:t},(()=>[b("span",E,x(s.getOptionLabel(t)),1)])),b("span",{class:f(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>s.removeOption(e,n),"aria-hidden":"true"},null,10,T)],10,F)))),128)),b("li",A,[b("input",y({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,B)])],42,D)):m("",!0),o.searching?(c(),h("i",{key:2,class:f(s.loadingIconClass),"aria-hidden":"true"},null,2)):m("",!0),i.dropdown?(c(),I(l,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:f(["p-autocomplete-dropdown",i.dropdownClass]),tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:s.onDropdownClick},null,8,["icon","class","disabled","onClick"])):m("",!0),b("span",R,x(s.searchResultMessageText),1),w(r,{appendTo:i.appendTo},{default:S((()=>[w(C,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:S((()=>[o.overlayVisible?(c(),h("div",y({key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{...i.panelStyle,"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[v(e.$slots,"header",{value:i.modelValue,suggestions:s.visibleOptions}),w(a,y({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),k({content:S((({styleClass:t,contentRef:i,items:n,getItemOptions:l,contentStyle:a,itemSize:r})=>[b("ul",{ref:e=>s.listRef(e,i),id:s.id+"_list",class:f(["p-autocomplete-items",t]),style:L(a),role:"listbox"},[(c(!0),h(O,null,g(n,((t,i)=>(c(),h(O,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,l))},[s.isOptionGroup(t)?(c(),h("li",{key:0,id:s.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[v(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,P)):V((c(),h("li",{key:1,id:s.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:f(["p-autocomplete-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,l),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,l)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,l))},[e.$slots.option?v(e.$slots,"option",{key:0,option:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)])):v(e.$slots,"item",{key:1,item:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)]))],46,G)),[[p]])],64)))),128)),!n||n&&0===n.length?(c(),h("li",H,[v(e.$slots,"empty",{},(()=>[M(x(s.searchResultMessageText),1)]))])):m("",!0)],14,z)])),_:2},[e.$slots.loader?{name:"loader",fn:S((({options:t})=>[v(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),v(e.$slots,"footer",{value:i.modelValue,suggestions:s.visibleOptions}),b("span",_,x(s.selectedMessageText),1)],16)):m("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{$ as default};
1
+ import e from"primevue/button";import t from"primevue/overlayeventbus";import i from"primevue/portal";import n from"primevue/ripple";import{UniqueComponentId as o,ObjectUtils as s,ZIndexUtils as l,DomHandler as a,ConnectedOverlayScrollHandler as r}from"primevue/utils";import p from"primevue/virtualscroller";import{resolveComponent as d,resolveDirective as u,openBlock as c,createElementBlock as h,normalizeClass as f,mergeProps as y,createCommentVNode as m,Fragment as O,renderList as g,renderSlot as v,createElementVNode as b,toDisplayString as x,createBlock as I,createVNode as w,withCtx as S,Transition as C,createSlots as k,normalizeStyle as L,createTextVNode as M,withDirectives as V}from"vue";var $={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},dropdownClass:{type:String,default:null},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}},watch:{"$attrs.id":function(e){this.id=e||o()},suggestions(){this.searching&&(s.isNotEmpty(this.suggestions)||this.$slots.empty?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.id=this.id||o(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?s.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?s.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&s.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return s.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return s.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.dirty=!0,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.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&a.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,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.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(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":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((e=>this.isOptionMatched(e,this.$refs.focusInput.value||"")));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.disabled||(this.focused=!0)},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||a.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(a.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],n])):this.updateModel(e,n),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){t.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-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();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(s.isEmpty(t.value)&&this.hasSelectedOption?(a.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(0,e.shiftKey?i:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(e.shiftKey?0:i,i),this.focusedOptionIndex=-1,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&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(s.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,a.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){l.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){l.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?a.relativePosition(this.overlay,e):(this.overlay.style.minWidth=a.getOuterWidth(e)+"px",a.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&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.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return s.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return s.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.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],n=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,n),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,a.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},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:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},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 n=this.getOptionGroupChildren(t);return n&&n.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-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||s.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return s.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return s.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:e,VirtualScroller:p,Portal:i},directives:{ripple:n}};const K=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D=["aria-activedescendant"],F=["id","aria-label","aria-setsize","aria-posinset"],E={class:"p-autocomplete-token-label"},T=["onClick"],A={class:"p-autocomplete-input-token",role:"option"},B=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],R={role:"status","aria-live":"polite",class:"p-hidden-accessible"},z=["id"],P=["id"],G=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],H={key:0,class:"p-autocomplete-empty-message",role:"option"},_={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 n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-autocomplete {\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-autocomplete-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n flex: 1 1 auto;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),$.render=function(e,t,i,n,o,s){const l=d("Button"),a=d("VirtualScroller"),r=d("Portal"),p=u("ripple");return c(),h("div",{ref:"container",class:f(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.multiple?m("",!0):(c(),h("input",y({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,K)),i.multiple?(c(),h("ul",{key:1,ref:"multiContainer",class:f(s.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":o.focused?s.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>s.onMultipleContainerFocus&&s.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onMultipleContainerBlur&&s.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown(...e))},[(c(!0),h(O,null,g(i.modelValue,((t,n)=>(c(),h("li",{key:n,id:o.id+"_multiple_option_"+n,class:f(["p-autocomplete-token",{"p-focus":o.focusedMultipleOptionIndex===n}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":n+1},[v(e.$slots,"chip",{value:t},(()=>[b("span",E,x(s.getOptionLabel(t)),1)])),b("span",{class:f(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>s.removeOption(e,n),"aria-hidden":"true"},null,10,T)],10,F)))),128)),b("li",A,[b("input",y({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,B)])],42,D)):m("",!0),o.searching?(c(),h("i",{key:2,class:f(s.loadingIconClass),"aria-hidden":"true"},null,2)):m("",!0),i.dropdown?(c(),I(l,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:f(["p-autocomplete-dropdown",i.dropdownClass]),tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:s.onDropdownClick},null,8,["icon","class","disabled","onClick"])):m("",!0),b("span",R,x(s.searchResultMessageText),1),w(r,{appendTo:i.appendTo},{default:S((()=>[w(C,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:S((()=>[o.overlayVisible?(c(),h("div",y({key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{...i.panelStyle,"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[v(e.$slots,"header",{value:i.modelValue,suggestions:s.visibleOptions}),w(a,y({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),k({content:S((({styleClass:t,contentRef:i,items:n,getItemOptions:l,contentStyle:a,itemSize:r})=>[b("ul",{ref:e=>s.listRef(e,i),id:o.id+"_list",class:f(["p-autocomplete-items",t]),style:L(a),role:"listbox"},[(c(!0),h(O,null,g(n,((t,i)=>(c(),h(O,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,l))},[s.isOptionGroup(t)?(c(),h("li",{key:0,id:o.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[v(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,P)):V((c(),h("li",{key:1,id:o.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:f(["p-autocomplete-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,l),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,l)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,l))},[e.$slots.option?v(e.$slots,"option",{key:0,option:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)])):v(e.$slots,"item",{key:1,item:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)]))],46,G)),[[p]])],64)))),128)),!n||n&&0===n.length?(c(),h("li",H,[v(e.$slots,"empty",{},(()=>[M(x(s.searchResultMessageText),1)]))])):m("",!0)],14,z)])),_:2},[e.$slots.loader?{name:"loader",fn:S((({options:t})=>[v(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),v(e.$slots,"footer",{value:i.modelValue,suggestions:s.visibleOptions}),b("span",_,x(s.selectedMessageText),1)],16)):m("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{$ as default};
@@ -180,6 +180,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
180
180
  dirty: false,
181
181
  data() {
182
182
  return {
183
+ id: this.$attrs.id,
183
184
  focused: false,
184
185
  focusedOptionIndex: -1,
185
186
  focusedMultipleOptionIndex: -1,
@@ -188,6 +189,9 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
188
189
  };
189
190
  },
190
191
  watch: {
192
+ '$attrs.id': function (newValue) {
193
+ this.id = newValue || utils.UniqueComponentId();
194
+ },
191
195
  suggestions() {
192
196
  if (this.searching) {
193
197
  utils.ObjectUtils.isNotEmpty(this.suggestions) ? this.show() : !!this.$slots.empty ? this.show() : this.hide();
@@ -199,6 +203,8 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
199
203
  }
200
204
  },
201
205
  mounted() {
206
+ this.id = this.id || utils.UniqueComponentId();
207
+
202
208
  this.autoUpdateModel();
203
209
  },
204
210
  updated() {
@@ -906,9 +912,6 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
906
912
  selectedMessageText() {
907
913
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.modelValue.length : '1') : this.emptySelectionMessageText;
908
914
  },
909
- id() {
910
- return this.$attrs.id || utils.UniqueComponentId();
911
- },
912
915
  focusedOptionId() {
913
916
  return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
914
917
  },
@@ -991,7 +994,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
991
994
  "aria-haspopup": "listbox",
992
995
  "aria-autocomplete": "list",
993
996
  "aria-expanded": $data.overlayVisible,
994
- "aria-controls": $options.id + '_list',
997
+ "aria-controls": $data.id + '_list',
995
998
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
996
999
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
997
1000
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1016,7 +1019,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
1016
1019
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue, (option, i) => {
1017
1020
  return (vue.openBlock(), vue.createElementBlock("li", {
1018
1021
  key: i,
1019
- id: $options.id + '_multiple_option_' + i,
1022
+ id: $data.id + '_multiple_option_' + i,
1020
1023
  class: vue.normalizeClass(['p-autocomplete-token', { 'p-focus': $data.focusedMultipleOptionIndex === i }]),
1021
1024
  role: "option",
1022
1025
  "aria-label": $options.getOptionLabel(option),
@@ -1051,7 +1054,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
1051
1054
  "aria-haspopup": "listbox",
1052
1055
  "aria-autocomplete": "list",
1053
1056
  "aria-expanded": $data.overlayVisible,
1054
- "aria-controls": $options.id + '_list',
1057
+ "aria-controls": $data.id + '_list',
1055
1058
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
1056
1059
  onFocus: _cache[5] || (_cache[5] = (...args) => ($options.onFocus && $options.onFocus(...args))),
1057
1060
  onBlur: _cache[6] || (_cache[6] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1115,7 +1118,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
1115
1118
  content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
1116
1119
  vue.createElementVNode("ul", {
1117
1120
  ref: (el) => $options.listRef(el, contentRef),
1118
- id: $options.id + '_list',
1121
+ id: $data.id + '_list',
1119
1122
  class: vue.normalizeClass(['p-autocomplete-items', styleClass]),
1120
1123
  style: vue.normalizeStyle(contentStyle),
1121
1124
  role: "listbox"
@@ -1127,7 +1130,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
1127
1130
  ($options.isOptionGroup(option))
1128
1131
  ? (vue.openBlock(), vue.createElementBlock("li", {
1129
1132
  key: 0,
1130
- id: $options.id + '_' + $options.getOptionIndex(i, getItemOptions),
1133
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1131
1134
  style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
1132
1135
  class: "p-autocomplete-item-group",
1133
1136
  role: "option"
@@ -1142,7 +1145,7 @@ this.primevue.autocomplete = (function (Button, OverlayEventBus, Portal, Ripple,
1142
1145
  ], 12, _hoisted_10))
1143
1146
  : vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
1144
1147
  key: 1,
1145
- id: $options.id + '_' + $options.getOptionIndex(i, getItemOptions),
1148
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1146
1149
  style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
1147
1150
  class: vue.normalizeClass(['p-autocomplete-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
1148
1151
  role: "option",
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.autocomplete=function(e,t,i,o,n,s,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),d=a(t),p=a(i),u=a(o),c=a(s),h={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},dropdownClass:{type:String,default:null},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data:()=>({focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}),watch:{suggestions(){this.searching&&(n.ObjectUtils.isNotEmpty(this.suggestions)||this.$slots.empty?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(n.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return n.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.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&n.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&n.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,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.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(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":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((e=>this.isOptionMatched(e,this.$refs.focusInput.value||"")));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.disabled||(this.focused=!0)},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||n.DomHandler.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(n.DomHandler.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const o=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],o])):this.updateModel(e,o),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){d.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-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();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(n.ObjectUtils.isEmpty(t.value)&&this.hasSelectedOption?(n.DomHandler.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(0,e.shiftKey?i:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(e.shiftKey?0:i,i),this.focusedOptionIndex=-1,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&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(n.ObjectUtils.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,n.DomHandler.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){n.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},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.ZIndexUtils.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?n.DomHandler.relativePosition(this.overlay,e):(this.overlay.style.minWidth=n.DomHandler.getOuterWidth(e)+"px",n.DomHandler.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&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 n.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!n.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return n.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return n.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?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],o=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,o),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,n.DomHandler.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=n.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},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 o=this.getOptionGroupChildren(t);return o&&o.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-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||n.ObjectUtils.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},id(){return this.$attrs.id||n.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:r.default,VirtualScroller:c.default,Portal:p.default},directives:{ripple:u.default}};const f=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],m=["aria-activedescendant"],y=["id","aria-label","aria-setsize","aria-posinset"],O={class:"p-autocomplete-token-label"},g=["onClick"],b={class:"p-autocomplete-input-token",role:"option"},v=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],x={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I=["id"],S=["id"],C=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],k={key:0,class:"p-autocomplete-empty-message",role:"option"},w={role:"status","aria-live":"polite",class:"p-hidden-accessible"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-autocomplete {\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-autocomplete-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n flex: 1 1 auto;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),h.render=function(e,t,i,o,n,s){const a=l.resolveComponent("Button"),r=l.resolveComponent("VirtualScroller"),d=l.resolveComponent("Portal"),p=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",{ref:"container",class:l.normalizeClass(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.multiple?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":n.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":n.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,f)),i.multiple?(l.openBlock(),l.createElementBlock("ul",{key:1,ref:"multiContainer",class:l.normalizeClass(s.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":n.focused?s.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>s.onMultipleContainerFocus&&s.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onMultipleContainerBlur&&s.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown(...e))},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.modelValue,((t,o)=>(l.openBlock(),l.createElementBlock("li",{key:o,id:s.id+"_multiple_option_"+o,class:l.normalizeClass(["p-autocomplete-token",{"p-focus":n.focusedMultipleOptionIndex===o}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":o+1},[l.renderSlot(e.$slots,"chip",{value:t},(()=>[l.createElementVNode("span",O,l.toDisplayString(s.getOptionLabel(t)),1)])),l.createElementVNode("span",{class:l.normalizeClass(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>s.removeOption(e,o),"aria-hidden":"true"},null,10,g)],10,y)))),128)),l.createElementVNode("li",b,[l.createElementVNode("input",l.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":n.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":n.focused?s.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,v)])],42,m)):l.createCommentVNode("",!0),n.searching?(l.openBlock(),l.createElementBlock("i",{key:2,class:l.normalizeClass(s.loadingIconClass),"aria-hidden":"true"},null,2)):l.createCommentVNode("",!0),i.dropdown?(l.openBlock(),l.createBlock(a,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:l.normalizeClass(["p-autocomplete-dropdown",i.dropdownClass]),tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:s.onDropdownClick},null,8,["icon","class","disabled","onClick"])):l.createCommentVNode("",!0),l.createElementVNode("span",x,l.toDisplayString(s.searchResultMessageText),1),l.createVNode(d,{appendTo:i.appendTo},{default:l.withCtx((()=>[l.createVNode(l.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:l.withCtx((()=>[n.overlayVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{...i.panelStyle,"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[l.renderSlot(e.$slots,"header",{value:i.modelValue,suggestions:s.visibleOptions}),l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),l.createSlots({content:l.withCtx((({styleClass:t,contentRef:i,items:o,getItemOptions:a,contentStyle:r,itemSize:d})=>[l.createElementVNode("ul",{ref:e=>s.listRef(e,i),id:s.id+"_list",class:l.normalizeClass(["p-autocomplete-items",t]),style:l.normalizeStyle(r),role:"listbox"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o,((t,i)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,a))},[s.isOptionGroup(t)?(l.openBlock(),l.createElementBlock("li",{key:0,id:s.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:d?d+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[l.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,S)):l.withDirectives((l.openBlock(),l.createElementBlock("li",{key:1,id:s.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:d?d+"px":void 0}),class:l.normalizeClass(["p-autocomplete-item",{"p-highlight":s.isSelected(t),"p-focus":n.focusedOptionIndex===s.getOptionIndex(i,a),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,a)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,a))},[e.$slots.option?l.renderSlot(e.$slots,"option",{key:0,option:t,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionLabel(t)),1)])):l.renderSlot(e.$slots,"item",{key:1,item:t,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionLabel(t)),1)]))],46,C)),[[p]])],64)))),128)),!o||o&&0===o.length?(l.openBlock(),l.createElementBlock("li",k,[l.renderSlot(e.$slots,"empty",{},(()=>[l.createTextVNode(l.toDisplayString(s.searchResultMessageText),1)]))])):l.createCommentVNode("",!0)],14,I)])),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((({options:t})=>[l.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),l.renderSlot(e.$slots,"footer",{value:i.modelValue,suggestions:s.visibleOptions}),l.createElementVNode("span",w,l.toDisplayString(s.selectedMessageText),1)],16)):l.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},h}(primevue.button,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.autocomplete=function(e,t,i,o,n,s,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),d=a(t),p=a(i),u=a(o),c=a(s),h={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},dropdownClass:{type:String,default:null},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()},suggestions(){this.searching&&(n.ObjectUtils.isNotEmpty(this.suggestions)||this.$slots.empty?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.id=this.id||n.UniqueComponentId(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(n.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return n.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.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&n.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&n.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,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.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(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":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((e=>this.isOptionMatched(e,this.$refs.focusInput.value||"")));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.disabled||(this.focused=!0)},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||n.DomHandler.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(n.DomHandler.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const o=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],o])):this.updateModel(e,o),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){d.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-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();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(n.ObjectUtils.isEmpty(t.value)&&this.hasSelectedOption?(n.DomHandler.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(0,e.shiftKey?i:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const{currentTarget:t}=e,i=t.value.length;t.setSelectionRange(e.shiftKey?0:i,i),this.focusedOptionIndex=-1,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&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(n.ObjectUtils.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,n.DomHandler.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){n.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},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.ZIndexUtils.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?n.DomHandler.relativePosition(this.overlay,e):(this.overlay.style.minWidth=n.DomHandler.getOuterWidth(e)+"px",n.DomHandler.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&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 n.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!n.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return n.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return n.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?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],o=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,o),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,n.DomHandler.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=n.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},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 o=this.getOptionGroupChildren(t);return o&&o.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-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||n.ObjectUtils.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:r.default,VirtualScroller:c.default,Portal:p.default},directives:{ripple:u.default}};const f=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],m=["aria-activedescendant"],y=["id","aria-label","aria-setsize","aria-posinset"],O={class:"p-autocomplete-token-label"},g=["onClick"],b={class:"p-autocomplete-input-token",role:"option"},v=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],x={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I=["id"],S=["id"],C=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],k={key:0,class:"p-autocomplete-empty-message",role:"option"},w={role:"status","aria-live":"polite",class:"p-hidden-accessible"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-autocomplete {\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-autocomplete-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n flex: 1 1 auto;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),h.render=function(e,t,i,o,n,s){const a=l.resolveComponent("Button"),r=l.resolveComponent("VirtualScroller"),d=l.resolveComponent("Portal"),p=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",{ref:"container",class:l.normalizeClass(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.multiple?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":n.overlayVisible,"aria-controls":n.id+"_list","aria-activedescendant":n.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,f)),i.multiple?(l.openBlock(),l.createElementBlock("ul",{key:1,ref:"multiContainer",class:l.normalizeClass(s.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":n.focused?s.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>s.onMultipleContainerFocus&&s.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onMultipleContainerBlur&&s.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown(...e))},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.modelValue,((t,o)=>(l.openBlock(),l.createElementBlock("li",{key:o,id:n.id+"_multiple_option_"+o,class:l.normalizeClass(["p-autocomplete-token",{"p-focus":n.focusedMultipleOptionIndex===o}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":o+1},[l.renderSlot(e.$slots,"chip",{value:t},(()=>[l.createElementVNode("span",O,l.toDisplayString(s.getOptionLabel(t)),1)])),l.createElementVNode("span",{class:l.normalizeClass(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>s.removeOption(e,o),"aria-hidden":"true"},null,10,g)],10,y)))),128)),l.createElementVNode("li",b,[l.createElementVNode("input",l.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":n.overlayVisible,"aria-controls":n.id+"_list","aria-activedescendant":n.focused?s.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,v)])],42,m)):l.createCommentVNode("",!0),n.searching?(l.openBlock(),l.createElementBlock("i",{key:2,class:l.normalizeClass(s.loadingIconClass),"aria-hidden":"true"},null,2)):l.createCommentVNode("",!0),i.dropdown?(l.openBlock(),l.createBlock(a,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:l.normalizeClass(["p-autocomplete-dropdown",i.dropdownClass]),tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:s.onDropdownClick},null,8,["icon","class","disabled","onClick"])):l.createCommentVNode("",!0),l.createElementVNode("span",x,l.toDisplayString(s.searchResultMessageText),1),l.createVNode(d,{appendTo:i.appendTo},{default:l.withCtx((()=>[l.createVNode(l.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:l.withCtx((()=>[n.overlayVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{...i.panelStyle,"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[l.renderSlot(e.$slots,"header",{value:i.modelValue,suggestions:s.visibleOptions}),l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),l.createSlots({content:l.withCtx((({styleClass:t,contentRef:i,items:o,getItemOptions:a,contentStyle:r,itemSize:d})=>[l.createElementVNode("ul",{ref:e=>s.listRef(e,i),id:n.id+"_list",class:l.normalizeClass(["p-autocomplete-items",t]),style:l.normalizeStyle(r),role:"listbox"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o,((t,i)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,a))},[s.isOptionGroup(t)?(l.openBlock(),l.createElementBlock("li",{key:0,id:n.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:d?d+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[l.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,S)):l.withDirectives((l.openBlock(),l.createElementBlock("li",{key:1,id:n.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:d?d+"px":void 0}),class:l.normalizeClass(["p-autocomplete-item",{"p-highlight":s.isSelected(t),"p-focus":n.focusedOptionIndex===s.getOptionIndex(i,a),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,a)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,a))},[e.$slots.option?l.renderSlot(e.$slots,"option",{key:0,option:t,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionLabel(t)),1)])):l.renderSlot(e.$slots,"item",{key:1,item:t,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionLabel(t)),1)]))],46,C)),[[p]])],64)))),128)),!o||o&&0===o.length?(l.openBlock(),l.createElementBlock("li",k,[l.renderSlot(e.$slots,"empty",{},(()=>[l.createTextVNode(l.toDisplayString(s.searchResultMessageText),1)]))])):l.createCommentVNode("",!0)],14,I)])),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((({options:t})=>[l.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),l.renderSlot(e.$slots,"footer",{value:i.modelValue,suggestions:s.visibleOptions}),l.createElementVNode("span",w,l.toDisplayString(s.selectedMessageText),1)],16)):l.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},h}(primevue.button,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
@@ -2,8 +2,8 @@
2
2
  <nav class="p-breadcrumb p-component">
3
3
  <ol class="p-breadcrumb-list">
4
4
  <BreadcrumbItem v-if="home" :item="home" class="p-breadcrumb-home" :exact="exact" />
5
- <template v-for="item of model" :key="item.label">
6
- <li class="p-menuitem-separator">
5
+ <template v-for="(item, i) of model" :key="item.label">
6
+ <li v-if="home || i !== 0" class="p-menuitem-separator">
7
7
  <span class="pi pi-chevron-right" aria-hidden="true"></span>
8
8
  </li>
9
9
  <BreadcrumbItem :item="item" :template="$slots.item" :exact="exact" />
@@ -63,7 +63,7 @@ const _hoisted_2$1 = {
63
63
  class: "p-menuitem-text"
64
64
  };
65
65
  const _hoisted_3$1 = ["href", "target", "aria-current"];
66
- const _hoisted_4 = {
66
+ const _hoisted_4$1 = {
67
67
  key: 1,
68
68
  class: "p-menuitem-text"
69
69
  };
@@ -119,7 +119,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
119
119
  }, null, 2))
120
120
  : vue.createCommentVNode("", true),
121
121
  ($props.item.label)
122
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString($options.label()), 1))
122
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$1, vue.toDisplayString($options.label()), 1))
123
123
  : vue.createCommentVNode("", true)
124
124
  ], 10, _hoisted_3$1))
125
125
  ], 64))
@@ -156,12 +156,17 @@ var script = {
156
156
 
157
157
  const _hoisted_1 = { class: "p-breadcrumb p-component" };
158
158
  const _hoisted_2 = { class: "p-breadcrumb-list" };
159
- const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("li", { class: "p-menuitem-separator" }, [
160
- /*#__PURE__*/vue.createElementVNode("span", {
161
- class: "pi pi-chevron-right",
162
- "aria-hidden": "true"
163
- })
164
- ], -1);
159
+ const _hoisted_3 = {
160
+ key: 0,
161
+ class: "p-menuitem-separator"
162
+ };
163
+ const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("span", {
164
+ class: "pi pi-chevron-right",
165
+ "aria-hidden": "true"
166
+ }, null, -1);
167
+ const _hoisted_5 = [
168
+ _hoisted_4
169
+ ];
165
170
 
166
171
  function render(_ctx, _cache, $props, $setup, $data, $options) {
167
172
  const _component_BreadcrumbItem = vue.resolveComponent("BreadcrumbItem");
@@ -176,11 +181,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
176
181
  exact: $props.exact
177
182
  }, null, 8, ["item", "exact"]))
178
183
  : vue.createCommentVNode("", true),
179
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.model, (item) => {
184
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.model, (item, i) => {
180
185
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
181
186
  key: item.label
182
187
  }, [
183
- _hoisted_3,
188
+ ($props.home || i !== 0)
189
+ ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_3, _hoisted_5))
190
+ : vue.createCommentVNode("", true),
184
191
  vue.createVNode(_component_BreadcrumbItem, {
185
192
  item: item,
186
193
  template: _ctx.$slots.item,
@@ -1 +1 @@
1
- "use strict";var e=require("vue"),t={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(){return["p-menuitem",{"p-disabled":this.disabled()},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label},isCurrentUrl(){const{to:e,url:t}=this.item;let n=this.$router?this.$router.currentRoute.path:"";return e===n||t===n?"page":void 0}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const n=["href","aria-current","onClick"],l={key:1,class:"p-menuitem-text"},i=["href","target","aria-current"],a={key:1,class:"p-menuitem-text"};t.render=function(t,r,o,c,s,m){const p=e.resolveComponent("router-link");return m.visible()?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass(m.containerClass())},[o.template?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.template),{key:1,item:o.item},null,8,["item"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.item.to?(e.openBlock(),e.createBlock(p,{key:0,to:o.item.to,custom:""},{default:e.withCtx((({navigate:t,href:i,isActive:a,isExactActive:r})=>[e.createElementVNode("a",{href:i,class:e.normalizeClass(m.linkClass({isActive:a,isExactActive:r})),"aria-current":m.isCurrentUrl(),onClick:e=>m.onClick(e,t)},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(m.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",l,e.toDisplayString(m.label()),1)):e.createCommentVNode("",!0)],10,n)])),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:o.item.url||"#",class:e.normalizeClass(m.linkClass()),target:o.item.target,"aria-current":m.isCurrentUrl(),onClick:r[0]||(r[0]=(...e)=>m.onClick&&m.onClick(...e))},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(m.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",a,e.toDisplayString(m.label()),1)):e.createCommentVNode("",!0)],10,i))],64))],2)):e.createCommentVNode("",!0)};var r={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:t}};const o={class:"p-breadcrumb p-component"},c={class:"p-breadcrumb-list"},s=e.createElementVNode("li",{class:"p-menuitem-separator"},[e.createElementVNode("span",{class:"pi pi-chevron-right","aria-hidden":"true"})],-1);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb .p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n.p-breadcrumb .p-menuitem-separator {\n display: flex;\n align-items: center;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),r.render=function(t,n,l,i,a,r){const m=e.resolveComponent("BreadcrumbItem");return e.openBlock(),e.createElementBlock("nav",o,[e.createElementVNode("ol",c,[l.home?(e.openBlock(),e.createBlock(m,{key:0,item:l.home,class:"p-breadcrumb-home",exact:l.exact},null,8,["item","exact"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.model,(n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.label},[s,e.createVNode(m,{item:n,template:t.$slots.item,exact:l.exact},null,8,["item","template","exact"])],64)))),128))])])},module.exports=r;
1
+ "use strict";var e=require("vue"),t={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(){return["p-menuitem",{"p-disabled":this.disabled()},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label},isCurrentUrl(){const{to:e,url:t}=this.item;let n=this.$router?this.$router.currentRoute.path:"";return e===n||t===n?"page":void 0}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const n=["href","aria-current","onClick"],l={key:1,class:"p-menuitem-text"},i=["href","target","aria-current"],a={key:1,class:"p-menuitem-text"};t.render=function(t,r,o,c,m,s){const p=e.resolveComponent("router-link");return s.visible()?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass(s.containerClass())},[o.template?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.template),{key:1,item:o.item},null,8,["item"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.item.to?(e.openBlock(),e.createBlock(p,{key:0,to:o.item.to,custom:""},{default:e.withCtx((({navigate:t,href:i,isActive:a,isExactActive:r})=>[e.createElementVNode("a",{href:i,class:e.normalizeClass(s.linkClass({isActive:a,isExactActive:r})),"aria-current":s.isCurrentUrl(),onClick:e=>s.onClick(e,t)},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",l,e.toDisplayString(s.label()),1)):e.createCommentVNode("",!0)],10,n)])),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:o.item.url||"#",class:e.normalizeClass(s.linkClass()),target:o.item.target,"aria-current":s.isCurrentUrl(),onClick:r[0]||(r[0]=(...e)=>s.onClick&&s.onClick(...e))},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",a,e.toDisplayString(s.label()),1)):e.createCommentVNode("",!0)],10,i))],64))],2)):e.createCommentVNode("",!0)};var r={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:t}};const o={class:"p-breadcrumb p-component"},c={class:"p-breadcrumb-list"},m={key:0,class:"p-menuitem-separator"},s=[e.createElementVNode("span",{class:"pi pi-chevron-right","aria-hidden":"true"},null,-1)];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb .p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n.p-breadcrumb .p-menuitem-separator {\n display: flex;\n align-items: center;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),r.render=function(t,n,l,i,a,r){const p=e.resolveComponent("BreadcrumbItem");return e.openBlock(),e.createElementBlock("nav",o,[e.createElementVNode("ol",c,[l.home?(e.openBlock(),e.createBlock(p,{key:0,item:l.home,class:"p-breadcrumb-home",exact:l.exact},null,8,["item","exact"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.model,((n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.label},[l.home||0!==i?(e.openBlock(),e.createElementBlock("li",m,s)):e.createCommentVNode("",!0),e.createVNode(p,{item:n,template:t.$slots.item,exact:l.exact},null,8,["item","template","exact"])],64)))),128))])])},module.exports=r;
@@ -61,7 +61,7 @@ const _hoisted_2$1 = {
61
61
  class: "p-menuitem-text"
62
62
  };
63
63
  const _hoisted_3$1 = ["href", "target", "aria-current"];
64
- const _hoisted_4 = {
64
+ const _hoisted_4$1 = {
65
65
  key: 1,
66
66
  class: "p-menuitem-text"
67
67
  };
@@ -117,7 +117,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
117
117
  }, null, 2))
118
118
  : createCommentVNode("", true),
119
119
  ($props.item.label)
120
- ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString($options.label()), 1))
120
+ ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString($options.label()), 1))
121
121
  : createCommentVNode("", true)
122
122
  ], 10, _hoisted_3$1))
123
123
  ], 64))
@@ -154,12 +154,17 @@ var script = {
154
154
 
155
155
  const _hoisted_1 = { class: "p-breadcrumb p-component" };
156
156
  const _hoisted_2 = { class: "p-breadcrumb-list" };
157
- const _hoisted_3 = /*#__PURE__*/createElementVNode("li", { class: "p-menuitem-separator" }, [
158
- /*#__PURE__*/createElementVNode("span", {
159
- class: "pi pi-chevron-right",
160
- "aria-hidden": "true"
161
- })
162
- ], -1);
157
+ const _hoisted_3 = {
158
+ key: 0,
159
+ class: "p-menuitem-separator"
160
+ };
161
+ const _hoisted_4 = /*#__PURE__*/createElementVNode("span", {
162
+ class: "pi pi-chevron-right",
163
+ "aria-hidden": "true"
164
+ }, null, -1);
165
+ const _hoisted_5 = [
166
+ _hoisted_4
167
+ ];
163
168
 
164
169
  function render(_ctx, _cache, $props, $setup, $data, $options) {
165
170
  const _component_BreadcrumbItem = resolveComponent("BreadcrumbItem");
@@ -174,11 +179,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
174
179
  exact: $props.exact
175
180
  }, null, 8, ["item", "exact"]))
176
181
  : createCommentVNode("", true),
177
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.model, (item) => {
182
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.model, (item, i) => {
178
183
  return (openBlock(), createElementBlock(Fragment, {
179
184
  key: item.label
180
185
  }, [
181
- _hoisted_3,
186
+ ($props.home || i !== 0)
187
+ ? (openBlock(), createElementBlock("li", _hoisted_3, _hoisted_5))
188
+ : createCommentVNode("", true),
182
189
  createVNode(_component_BreadcrumbItem, {
183
190
  item: item,
184
191
  template: _ctx.$slots.item,
@@ -1 +1 @@
1
- import{resolveComponent as e,openBlock as t,createElementBlock as i,normalizeClass as n,Fragment as l,createBlock as a,withCtx as r,createElementVNode as s,createCommentVNode as m,toDisplayString as c,resolveDynamicComponent as o,renderList as u,createVNode as p}from"vue";var d={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(){return["p-menuitem",{"p-disabled":this.disabled()},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label},isCurrentUrl(){const{to:e,url:t}=this.item;let i=this.$router?this.$router.currentRoute.path:"";return e===i||t===i?"page":void 0}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const b=["href","aria-current","onClick"],h={key:1,class:"p-menuitem-text"},f=["href","target","aria-current"],y={key:1,class:"p-menuitem-text"};d.render=function(u,p,d,k,x,v){const C=e("router-link");return v.visible()?(t(),i("li",{key:0,class:n(v.containerClass())},[d.template?(t(),a(o(d.template),{key:1,item:d.item},null,8,["item"])):(t(),i(l,{key:0},[d.item.to?(t(),a(C,{key:0,to:d.item.to,custom:""},{default:r((({navigate:e,href:l,isActive:a,isExactActive:r})=>[s("a",{href:l,class:n(v.linkClass({isActive:a,isExactActive:r})),"aria-current":v.isCurrentUrl(),onClick:t=>v.onClick(t,e)},[d.item.icon?(t(),i("span",{key:0,class:n(v.iconClass)},null,2)):m("",!0),d.item.label?(t(),i("span",h,c(v.label()),1)):m("",!0)],10,b)])),_:1},8,["to"])):(t(),i("a",{key:1,href:d.item.url||"#",class:n(v.linkClass()),target:d.item.target,"aria-current":v.isCurrentUrl(),onClick:p[0]||(p[0]=(...e)=>v.onClick&&v.onClick(...e))},[d.item.icon?(t(),i("span",{key:0,class:n(v.iconClass)},null,2)):m("",!0),d.item.label?(t(),i("span",y,c(v.label()),1)):m("",!0)],10,f))],64))],2)):m("",!0)};var k={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:d}};const x={class:"p-breadcrumb p-component"},v={class:"p-breadcrumb-list"},C=s("li",{class:"p-menuitem-separator"},[s("span",{class:"pi pi-chevron-right","aria-hidden":"true"})],-1);!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb .p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n.p-breadcrumb .p-menuitem-separator {\n display: flex;\n align-items: center;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),k.render=function(n,r,c,o,d,b){const h=e("BreadcrumbItem");return t(),i("nav",x,[s("ol",v,[c.home?(t(),a(h,{key:0,item:c.home,class:"p-breadcrumb-home",exact:c.exact},null,8,["item","exact"])):m("",!0),(t(!0),i(l,null,u(c.model,(e=>(t(),i(l,{key:e.label},[C,p(h,{item:e,template:n.$slots.item,exact:c.exact},null,8,["item","template","exact"])],64)))),128))])])};export{k as default};
1
+ import{resolveComponent as e,openBlock as t,createElementBlock as i,normalizeClass as n,Fragment as l,createBlock as a,withCtx as r,createElementVNode as s,createCommentVNode as m,toDisplayString as c,resolveDynamicComponent as o,renderList as u,createVNode as p}from"vue";var d={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(){return["p-menuitem",{"p-disabled":this.disabled()},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label},isCurrentUrl(){const{to:e,url:t}=this.item;let i=this.$router?this.$router.currentRoute.path:"";return e===i||t===i?"page":void 0}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const b=["href","aria-current","onClick"],h={key:1,class:"p-menuitem-text"},f=["href","target","aria-current"],y={key:1,class:"p-menuitem-text"};d.render=function(u,p,d,k,x,v){const C=e("router-link");return v.visible()?(t(),i("li",{key:0,class:n(v.containerClass())},[d.template?(t(),a(o(d.template),{key:1,item:d.item},null,8,["item"])):(t(),i(l,{key:0},[d.item.to?(t(),a(C,{key:0,to:d.item.to,custom:""},{default:r((({navigate:e,href:l,isActive:a,isExactActive:r})=>[s("a",{href:l,class:n(v.linkClass({isActive:a,isExactActive:r})),"aria-current":v.isCurrentUrl(),onClick:t=>v.onClick(t,e)},[d.item.icon?(t(),i("span",{key:0,class:n(v.iconClass)},null,2)):m("",!0),d.item.label?(t(),i("span",h,c(v.label()),1)):m("",!0)],10,b)])),_:1},8,["to"])):(t(),i("a",{key:1,href:d.item.url||"#",class:n(v.linkClass()),target:d.item.target,"aria-current":v.isCurrentUrl(),onClick:p[0]||(p[0]=(...e)=>v.onClick&&v.onClick(...e))},[d.item.icon?(t(),i("span",{key:0,class:n(v.iconClass)},null,2)):m("",!0),d.item.label?(t(),i("span",y,c(v.label()),1)):m("",!0)],10,f))],64))],2)):m("",!0)};var k={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:d}};const x={class:"p-breadcrumb p-component"},v={class:"p-breadcrumb-list"},C={key:0,class:"p-menuitem-separator"},g=[s("span",{class:"pi pi-chevron-right","aria-hidden":"true"},null,-1)];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb .p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n.p-breadcrumb .p-menuitem-separator {\n display: flex;\n align-items: center;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),k.render=function(n,r,c,o,d,b){const h=e("BreadcrumbItem");return t(),i("nav",x,[s("ol",v,[c.home?(t(),a(h,{key:0,item:c.home,class:"p-breadcrumb-home",exact:c.exact},null,8,["item","exact"])):m("",!0),(t(!0),i(l,null,u(c.model,((e,a)=>(t(),i(l,{key:e.label},[c.home||0!==a?(t(),i("li",C,g)):m("",!0),p(h,{item:e,template:n.$slots.item,exact:c.exact},null,8,["item","template","exact"])],64)))),128))])])};export{k as default};
@@ -63,7 +63,7 @@ this.primevue.breadcrumb = (function (vue) {
63
63
  class: "p-menuitem-text"
64
64
  };
65
65
  const _hoisted_3$1 = ["href", "target", "aria-current"];
66
- const _hoisted_4 = {
66
+ const _hoisted_4$1 = {
67
67
  key: 1,
68
68
  class: "p-menuitem-text"
69
69
  };
@@ -119,7 +119,7 @@ this.primevue.breadcrumb = (function (vue) {
119
119
  }, null, 2))
120
120
  : vue.createCommentVNode("", true),
121
121
  ($props.item.label)
122
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString($options.label()), 1))
122
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$1, vue.toDisplayString($options.label()), 1))
123
123
  : vue.createCommentVNode("", true)
124
124
  ], 10, _hoisted_3$1))
125
125
  ], 64))
@@ -156,12 +156,17 @@ this.primevue.breadcrumb = (function (vue) {
156
156
 
157
157
  const _hoisted_1 = { class: "p-breadcrumb p-component" };
158
158
  const _hoisted_2 = { class: "p-breadcrumb-list" };
159
- const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("li", { class: "p-menuitem-separator" }, [
160
- /*#__PURE__*/vue.createElementVNode("span", {
161
- class: "pi pi-chevron-right",
162
- "aria-hidden": "true"
163
- })
164
- ], -1);
159
+ const _hoisted_3 = {
160
+ key: 0,
161
+ class: "p-menuitem-separator"
162
+ };
163
+ const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("span", {
164
+ class: "pi pi-chevron-right",
165
+ "aria-hidden": "true"
166
+ }, null, -1);
167
+ const _hoisted_5 = [
168
+ _hoisted_4
169
+ ];
165
170
 
166
171
  function render(_ctx, _cache, $props, $setup, $data, $options) {
167
172
  const _component_BreadcrumbItem = vue.resolveComponent("BreadcrumbItem");
@@ -176,11 +181,13 @@ this.primevue.breadcrumb = (function (vue) {
176
181
  exact: $props.exact
177
182
  }, null, 8, ["item", "exact"]))
178
183
  : vue.createCommentVNode("", true),
179
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.model, (item) => {
184
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.model, (item, i) => {
180
185
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
181
186
  key: item.label
182
187
  }, [
183
- _hoisted_3,
188
+ ($props.home || i !== 0)
189
+ ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_3, _hoisted_5))
190
+ : vue.createCommentVNode("", true),
184
191
  vue.createVNode(_component_BreadcrumbItem, {
185
192
  item: item,
186
193
  template: _ctx.$slots.item,