primevue 3.16.1 → 3.16.2

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 (83) hide show
  1. package/autocomplete/AutoComplete.d.ts +2 -2
  2. package/autocomplete/AutoComplete.vue +2 -2
  3. package/autocomplete/autocomplete.cjs.js +2 -2
  4. package/autocomplete/autocomplete.cjs.min.js +1 -1
  5. package/autocomplete/autocomplete.esm.js +2 -2
  6. package/autocomplete/autocomplete.esm.min.js +1 -1
  7. package/autocomplete/autocomplete.js +2 -2
  8. package/autocomplete/autocomplete.min.js +1 -1
  9. package/calendar/Calendar.vue +2 -2
  10. package/calendar/calendar.cjs.js +2 -2
  11. package/calendar/calendar.cjs.min.js +1 -1
  12. package/calendar/calendar.esm.js +2 -2
  13. package/calendar/calendar.esm.min.js +1 -1
  14. package/calendar/calendar.js +2 -2
  15. package/calendar/calendar.min.js +1 -1
  16. package/cascadeselect/CascadeSelect.vue +2 -2
  17. package/cascadeselect/cascadeselect.cjs.js +2 -2
  18. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  19. package/cascadeselect/cascadeselect.esm.js +2 -2
  20. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  21. package/cascadeselect/cascadeselect.js +2 -2
  22. package/cascadeselect/cascadeselect.min.js +1 -1
  23. package/core/core.js +31 -9
  24. package/core/core.min.js +4 -4
  25. package/datatable/DataTable.vue +2 -2
  26. package/datatable/datatable.cjs.js +2 -2
  27. package/datatable/datatable.cjs.min.js +1 -1
  28. package/datatable/datatable.esm.js +2 -2
  29. package/datatable/datatable.esm.min.js +1 -1
  30. package/datatable/datatable.js +2 -2
  31. package/datatable/datatable.min.js +1 -1
  32. package/dropdown/Dropdown.vue +2 -2
  33. package/dropdown/dropdown.cjs.js +2 -2
  34. package/dropdown/dropdown.cjs.min.js +1 -1
  35. package/dropdown/dropdown.esm.js +2 -2
  36. package/dropdown/dropdown.esm.min.js +1 -1
  37. package/dropdown/dropdown.js +2 -2
  38. package/dropdown/dropdown.min.js +1 -1
  39. package/inputnumber/InputNumber.d.ts +1 -1
  40. package/inputnumber/InputNumber.vue +1 -1
  41. package/inputnumber/inputnumber.cjs.js +2 -1
  42. package/inputnumber/inputnumber.cjs.min.js +1 -1
  43. package/inputnumber/inputnumber.esm.js +2 -1
  44. package/inputnumber/inputnumber.esm.min.js +1 -1
  45. package/inputnumber/inputnumber.js +2 -1
  46. package/inputnumber/inputnumber.min.js +1 -1
  47. package/listbox/Listbox.vue +4 -4
  48. package/listbox/listbox.cjs.js +4 -4
  49. package/listbox/listbox.cjs.min.js +1 -1
  50. package/listbox/listbox.esm.js +4 -4
  51. package/listbox/listbox.esm.min.js +1 -1
  52. package/listbox/listbox.js +4 -4
  53. package/listbox/listbox.min.js +1 -1
  54. package/multiselect/MultiSelect.vue +4 -4
  55. package/multiselect/multiselect.cjs.js +4 -4
  56. package/multiselect/multiselect.cjs.min.js +1 -1
  57. package/multiselect/multiselect.esm.js +4 -4
  58. package/multiselect/multiselect.esm.min.js +1 -1
  59. package/multiselect/multiselect.js +4 -4
  60. package/multiselect/multiselect.min.js +1 -1
  61. package/overlaypanel/OverlayPanel.vue +1 -1
  62. package/overlaypanel/overlaypanel.cjs.js +1 -1
  63. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  64. package/overlaypanel/overlaypanel.esm.js +1 -1
  65. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  66. package/overlaypanel/overlaypanel.js +1 -1
  67. package/overlaypanel/overlaypanel.min.js +1 -1
  68. package/package.json +1 -1
  69. package/resources/primevue.css +0 -0
  70. package/resources/primevue.min.css +0 -0
  71. package/tooltip/tooltip.cjs.js +8 -6
  72. package/tooltip/tooltip.cjs.min.js +1 -1
  73. package/tooltip/tooltip.esm.js +9 -7
  74. package/tooltip/tooltip.esm.min.js +1 -1
  75. package/tooltip/tooltip.js +8 -6
  76. package/tooltip/tooltip.min.js +1 -1
  77. package/utils/utils.cjs.js +19 -0
  78. package/utils/utils.cjs.min.js +1 -1
  79. package/utils/utils.esm.js +19 -0
  80. package/utils/utils.esm.min.js +1 -1
  81. package/utils/utils.js +19 -0
  82. package/utils/utils.min.js +1 -1
  83. package/web-types.json +1 -1
@@ -1 +1 @@
1
- import{ObjectUtils as e,DomHandler as t,UniqueComponentId as i,ZIndexUtils as n,ConnectedOverlayScrollHandler as s}from"primevue/utils";import o from"primevue/overlayeventbus";import l from"primevue/ripple";import{resolveComponent as a,resolveDirective as r,openBlock as p,createElementBlock as d,Fragment as c,renderList as h,normalizeClass as u,withDirectives as f,createBlock as O,resolveDynamicComponent as y,toDisplayString as b,createCommentVNode as v,createElementVNode as g,mergeProps as m,renderSlot as x,createTextVNode as I,createVNode as L,withCtx as w,Transition as V}from"vue";import k from"primevue/portal";var C={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){e.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(t){return this.optionLabel?e.resolveFieldData(t.option,this.optionLabel):t.option},getOptionValue(t){return this.optionValue?e.resolveFieldData(t.option,this.optionValue):t.option},isOptionDisabled(t){return!!this.optionDisabled&&e.resolveFieldData(t.option,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.resolveFieldData(t.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:t=>e.isNotEmpty(t.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const e=this.$el.parentElement,i=t.getOffset(e),n=t.getViewport(),s=this.$el.offsetParent?this.$el.offsetWidth:t.getHiddenElementOuterWidth(this.$el),o=t.getOuterWidth(e.children[0]);parseInt(i.left,10)+o+s>n.width-t.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:l}};const S={class:"p-cascadeselect-panel p-cascadeselect-items"},K=["id","aria-label","aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-level"],P=["onClick"],D={key:1,class:"p-cascadeselect-item-text"},E={key:2,class:"p-cascadeselect-group-icon pi pi-angle-right","aria-hidden":"true"};C.render=function(e,t,i,n,s,o){const l=a("CascadeSelectSub",!0),g=r("ripple");return p(),d("ul",S,[(p(!0),d(c,null,h(i.options,((e,t)=>(p(),d("li",{key:o.getOptionLabelToRender(e),id:o.getOptionId(e),class:u(["p-cascadeselect-item",{"p-cascadeselect-item-group":o.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":o.isOptionActive(e),"p-focus":o.isOptionFocused(e),"p-disabled":o.isOptionDisabled(e)}]),role:"treeitem","aria-label":o.getOptionLabelToRender(e),"aria-selected":o.isOptionGroup(e)?void 0:o.isOptionSelected(e),"aria-expanded":o.isOptionGroup(e)?o.isOptionActive(e):void 0,"aria-setsize":e.length,"aria-posinset":t+1,"aria-level":i.level+1},[f((p(),d("div",{class:"p-cascadeselect-item-content",onClick:t=>o.onOptionClick(t,e)},[i.templates.option?(p(),O(y(i.templates.option),{key:0,option:e.option},null,8,["option"])):(p(),d("span",D,b(o.getOptionLabelToRender(e)),1)),o.isOptionGroup(e)?(p(),d("span",E)):v("",!0)],8,P)),[[g]]),o.isOptionGroup(e)&&o.isOptionActive(e)?(p(),O(l,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:o.getOptionGroupChildren(e),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:o.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"])):v("",!0)],10,K)))),128))])};var $={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:null,inputStyle:null,inputClass:null,inputProps:null,panelStyle:null,panelClass:null,panelProps:null,appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},autoOptionFocus:{type:Boolean,default:!0},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},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,selectOnFocus:!1,focusOnHover:!1,data:()=>({id:i(),focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(n.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(t){return this.optionLabel?e.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.resolveFieldData(t,this.optionValue):t},isOptionDisabled(t){return!!this.optionDisabled&&e.resolveFieldData(t,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.resolveFieldData(t,this.optionGroupLabel):null},getOptionGroupChildren(t,i){return e.resolveFieldData(t,this.optionGroupChildren[i])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:t=>e.isNotEmpty(t.children),show(t){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.findOptionPathByValue(this.modelValue),this.hasSelectedOption&&e.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};t&&this.$refs.focusInput.focus()},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&this.$refs.focusInput.focus()};setTimeout((()=>{t()}),0)},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(t){if(this.disabled||this.loading)t.preventDefault();else switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:e.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(t,t.key))}},onOptionChange(t){const{originalEvent:i,processedOption:n,isFocus:s}=t,{index:o,level:l,parentKey:a,children:r}=n,p=e.isNotEmpty(r),d=this.activeOptionPath.filter((e=>e.parentKey!==a));d.push(n),this.focusedOptionInfo={index:o,level:l,parentKey:a},this.activeOptionPath=d,p?this.onOptionGroupSelect(i,n):this.onOptionSelect(i,n),s&&this.$refs.focusInput.focus()},onOptionSelect(e,t){const i=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,i),this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus()),this.$emit("click",e))},onOverlayClick(e){o.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(t){if(this.overlayVisible){const i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===i.parentKey)),s=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,o=e.isEmpty(i.parent);s&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(t)),t.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>t.key===e.key))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t})}e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(e){n.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(e){n.clear(e)},alignOverlay(){"self"===this.appendTo?t.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=t.getOuterWidth(this.$el)+"px",t.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new s(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!t.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?this.visibleOptions.slice(0,e).findLastIndex((e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(t,i,n=0){if(!(i=i||0===n&&this.processedOptions))return null;if(e.isEmpty(t))return[];for(let s=0;s<i.length;s++){const o=i[s];if(e.equals(t,this.getOptionValue(o.option),this.equalityKey))return[o];const l=this.findOptionPathByValue(t,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(e=-1){const i=-1!==e?`${this.id}_${e}`:this.focusedOptionId,n=t.findSingle(this.list,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionInfo.index]);this.updateModel(null,e)}},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const s=[];return e&&e.forEach(((e,o)=>{const l=(""!==n?n+"_":"")+o,a={option:e,index:o,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),s.push(a)})),s},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]},hasSelectedOption(){return e.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),i=t.length?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return e.isNotEmpty(this.visibleOptions)?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||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${e.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:C,Portal:k}};const G={class:"p-hidden-accessible"},F=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],M={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},T={role:"status","aria-live":"polite",class:"p-hidden-accessible"},A={class:"p-cascadeselect-items-wrapper"},z={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],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),$.render=function(e,t,i,n,s,o){const l=a("CascadeSelectSub"),r=a("Portal");return p(),d("div",{ref:"container",class:u(o.containerClass),onClick:t[5]||(t[5]=e=>o.onContainerClick(e))},[g("div",G,[g("input",m({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_tree","aria-activedescendant":s.focused?o.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onKeyDown&&o.onKeyDown(...e))},i.inputProps),null,16,F)]),g("span",{class:u(o.labelClass)},[x(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[I(b(o.label),1)]))],2),g("div",M,[x(e.$slots,"indicator",{},(()=>[g("span",{class:u(o.dropdownIconClass)},null,2)]))]),g("span",T,b(o.searchResultMessageText),1),L(r,{appendTo:i.appendTo},{default:w((()=>[L(V,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:w((()=>[s.overlayVisible?(p(),d("div",m({key:0,ref:o.overlayRef,style:i.panelStyle,class:o.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>o.onOverlayKeyDown&&o.onOverlayKeyDown(...e))},i.panelProps),[g("div",A,[L(l,{id:s.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:s.id,focusedOptionId:s.focused?o.focusedOptionId:void 0,options:o.processedOptions,activeOptionPath:s.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:o.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"]),g("span",z,b(o.selectedMessageText),1)])],16)):v("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)};export{$ as default};
1
+ import{ObjectUtils as e,DomHandler as t,UniqueComponentId as i,ZIndexUtils as n,ConnectedOverlayScrollHandler as s}from"primevue/utils";import o from"primevue/overlayeventbus";import l from"primevue/ripple";import{resolveComponent as a,resolveDirective as r,openBlock as p,createElementBlock as d,Fragment as c,renderList as h,normalizeClass as u,withDirectives as f,createBlock as O,resolveDynamicComponent as y,toDisplayString as b,createCommentVNode as v,createElementVNode as g,mergeProps as m,renderSlot as x,createTextVNode as I,createVNode as L,withCtx as w,Transition as V}from"vue";import k from"primevue/portal";var C={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){e.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(t){return this.optionLabel?e.resolveFieldData(t.option,this.optionLabel):t.option},getOptionValue(t){return this.optionValue?e.resolveFieldData(t.option,this.optionValue):t.option},isOptionDisabled(t){return!!this.optionDisabled&&e.resolveFieldData(t.option,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.resolveFieldData(t.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:t=>e.isNotEmpty(t.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const e=this.$el.parentElement,i=t.getOffset(e),n=t.getViewport(),s=this.$el.offsetParent?this.$el.offsetWidth:t.getHiddenElementOuterWidth(this.$el),o=t.getOuterWidth(e.children[0]);parseInt(i.left,10)+o+s>n.width-t.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:l}};const S={class:"p-cascadeselect-panel p-cascadeselect-items"},K=["id","aria-label","aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-level"],P=["onClick"],D={key:1,class:"p-cascadeselect-item-text"},E={key:2,class:"p-cascadeselect-group-icon pi pi-angle-right","aria-hidden":"true"};C.render=function(e,t,i,n,s,o){const l=a("CascadeSelectSub",!0),g=r("ripple");return p(),d("ul",S,[(p(!0),d(c,null,h(i.options,((e,t)=>(p(),d("li",{key:o.getOptionLabelToRender(e),id:o.getOptionId(e),class:u(["p-cascadeselect-item",{"p-cascadeselect-item-group":o.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":o.isOptionActive(e),"p-focus":o.isOptionFocused(e),"p-disabled":o.isOptionDisabled(e)}]),role:"treeitem","aria-label":o.getOptionLabelToRender(e),"aria-selected":o.isOptionGroup(e)?void 0:o.isOptionSelected(e),"aria-expanded":o.isOptionGroup(e)?o.isOptionActive(e):void 0,"aria-setsize":e.length,"aria-posinset":t+1,"aria-level":i.level+1},[f((p(),d("div",{class:"p-cascadeselect-item-content",onClick:t=>o.onOptionClick(t,e)},[i.templates.option?(p(),O(y(i.templates.option),{key:0,option:e.option},null,8,["option"])):(p(),d("span",D,b(o.getOptionLabelToRender(e)),1)),o.isOptionGroup(e)?(p(),d("span",E)):v("",!0)],8,P)),[[g]]),o.isOptionGroup(e)&&o.isOptionActive(e)?(p(),O(l,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:o.getOptionGroupChildren(e),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:o.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"])):v("",!0)],10,K)))),128))])};var $={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:null,inputStyle:null,inputClass:null,inputProps:null,panelStyle:null,panelClass:null,panelProps:null,appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},autoOptionFocus:{type:Boolean,default:!0},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},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,selectOnFocus:!1,focusOnHover:!1,data:()=>({id:i(),focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(n.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(t){return this.optionLabel?e.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.resolveFieldData(t,this.optionValue):t},isOptionDisabled(t){return!!this.optionDisabled&&e.resolveFieldData(t,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.resolveFieldData(t,this.optionGroupLabel):null},getOptionGroupChildren(t,i){return e.resolveFieldData(t,this.optionGroupChildren[i])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:t=>e.isNotEmpty(t.children),show(t){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.findOptionPathByValue(this.modelValue),this.hasSelectedOption&&e.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};t&&this.$refs.focusInput.focus()},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&this.$refs.focusInput.focus()};setTimeout((()=>{t()}),0)},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(t){if(this.disabled||this.loading)t.preventDefault();else switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:e.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(t,t.key))}},onOptionChange(t){const{originalEvent:i,processedOption:n,isFocus:s}=t,{index:o,level:l,parentKey:a,children:r}=n,p=e.isNotEmpty(r),d=this.activeOptionPath.filter((e=>e.parentKey!==a));d.push(n),this.focusedOptionInfo={index:o,level:l,parentKey:a},this.activeOptionPath=d,p?this.onOptionGroupSelect(i,n):this.onOptionSelect(i,n),s&&this.$refs.focusInput.focus()},onOptionSelect(e,t){const i=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,i),this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus()),this.$emit("click",e))},onOverlayClick(e){o.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(t){if(this.overlayVisible){const i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===i.parentKey)),s=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,o=e.isEmpty(i.parent);s&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(t)),t.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>t.key===e.key))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t})}e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(e){n.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(e){n.clear(e)},alignOverlay(){"self"===this.appendTo?t.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=t.getOuterWidth(this.$el)+"px",t.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new s(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!t.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return e.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(t){const i=t>0?e.findLastIndex(this.visibleOptions.slice(0,t),(e=>this.isValidOption(e))):-1;return i>-1?i:t},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(t,i,n=0){if(!(i=i||0===n&&this.processedOptions))return null;if(e.isEmpty(t))return[];for(let s=0;s<i.length;s++){const o=i[s];if(e.equals(t,this.getOptionValue(o.option),this.equalityKey))return[o];const l=this.findOptionPathByValue(t,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(e=-1){const i=-1!==e?`${this.id}_${e}`:this.focusedOptionId,n=t.findSingle(this.list,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionInfo.index]);this.updateModel(null,e)}},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const s=[];return e&&e.forEach(((e,o)=>{const l=(""!==n?n+"_":"")+o,a={option:e,index:o,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),s.push(a)})),s},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]},hasSelectedOption(){return e.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),i=t.length?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return e.isNotEmpty(this.visibleOptions)?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||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${e.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:C,Portal:k}};const G={class:"p-hidden-accessible"},F=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],M={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},T={role:"status","aria-live":"polite",class:"p-hidden-accessible"},A={class:"p-cascadeselect-items-wrapper"},z={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],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),$.render=function(e,t,i,n,s,o){const l=a("CascadeSelectSub"),r=a("Portal");return p(),d("div",{ref:"container",class:u(o.containerClass),onClick:t[5]||(t[5]=e=>o.onContainerClick(e))},[g("div",G,[g("input",m({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_tree","aria-activedescendant":s.focused?o.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onKeyDown&&o.onKeyDown(...e))},i.inputProps),null,16,F)]),g("span",{class:u(o.labelClass)},[x(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[I(b(o.label),1)]))],2),g("div",M,[x(e.$slots,"indicator",{},(()=>[g("span",{class:u(o.dropdownIconClass)},null,2)]))]),g("span",T,b(o.searchResultMessageText),1),L(r,{appendTo:i.appendTo},{default:w((()=>[L(V,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:w((()=>[s.overlayVisible?(p(),d("div",m({key:0,ref:o.overlayRef,style:i.panelStyle,class:o.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>o.onOverlayKeyDown&&o.onOverlayKeyDown(...e))},i.panelProps),[g("div",A,[L(l,{id:s.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:s.id,focusedOptionId:s.focused?o.focusedOptionId:void 0,options:o.processedOptions,activeOptionPath:s.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:o.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"]),g("span",z,b(o.selectedMessageText),1)])],16)):v("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)};export{$ as default};
@@ -661,14 +661,14 @@ this.primevue.cascadeselect = (function (utils, OverlayEventBus, Ripple, vue, Po
661
661
  return this.visibleOptions.findIndex(processedOption => this.isValidOption(processedOption));
662
662
  },
663
663
  findLastOptionIndex() {
664
- return this.visibleOptions.findLastIndex(processedOption => this.isValidOption(processedOption));
664
+ return utils.ObjectUtils.findLastIndex(this.visibleOptions, processedOption => this.isValidOption(processedOption));
665
665
  },
666
666
  findNextOptionIndex(index) {
667
667
  const matchedOptionIndex = index < (this.visibleOptions.length - 1) ? this.visibleOptions.slice(index + 1).findIndex(processedOption => this.isValidOption(processedOption)) : -1;
668
668
  return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
669
669
  },
670
670
  findPrevOptionIndex(index) {
671
- const matchedOptionIndex = index > 0 ? this.visibleOptions.slice(0, index).findLastIndex(processedOption => this.isValidOption(processedOption)) : -1;
671
+ const matchedOptionIndex = index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), processedOption => this.isValidOption(processedOption)) : -1;
672
672
  return matchedOptionIndex > -1 ? matchedOptionIndex : index;
673
673
  },
674
674
  findSelectedOptionIndex() {
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.cascadeselect=function(e,t,i,n,s){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t),a=o(i),r=o(s),p={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){e.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t.option,this.optionLabel):t.option},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t.option,this.optionValue):t.option},isOptionDisabled(t){return!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t.option,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.ObjectUtils.resolveFieldData(t.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:t=>e.ObjectUtils.isNotEmpty(t.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const t=this.$el.parentElement,i=e.DomHandler.getOffset(t),n=e.DomHandler.getViewport(),s=this.$el.offsetParent?this.$el.offsetWidth:e.DomHandler.getHiddenElementOuterWidth(this.$el),o=e.DomHandler.getOuterWidth(t.children[0]);parseInt(i.left,10)+o+s>n.width-e.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:a.default}};const c={class:"p-cascadeselect-panel p-cascadeselect-items"},d=["id","aria-label","aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-level"],h=["onClick"],u={key:1,class:"p-cascadeselect-item-text"},f={key:2,class:"p-cascadeselect-group-icon pi pi-angle-right","aria-hidden":"true"};p.render=function(e,t,i,s,o,l){const a=n.resolveComponent("CascadeSelectSub",!0),r=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("ul",c,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.options,((e,t)=>(n.openBlock(),n.createElementBlock("li",{key:l.getOptionLabelToRender(e),id:l.getOptionId(e),class:n.normalizeClass(["p-cascadeselect-item",{"p-cascadeselect-item-group":l.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":l.isOptionActive(e),"p-focus":l.isOptionFocused(e),"p-disabled":l.isOptionDisabled(e)}]),role:"treeitem","aria-label":l.getOptionLabelToRender(e),"aria-selected":l.isOptionGroup(e)?void 0:l.isOptionSelected(e),"aria-expanded":l.isOptionGroup(e)?l.isOptionActive(e):void 0,"aria-setsize":e.length,"aria-posinset":t+1,"aria-level":i.level+1},[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:"p-cascadeselect-item-content",onClick:t=>l.onOptionClick(t,e)},[i.templates.option?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.templates.option),{key:0,option:e.option},null,8,["option"])):(n.openBlock(),n.createElementBlock("span",u,n.toDisplayString(l.getOptionLabelToRender(e)),1)),l.isOptionGroup(e)?(n.openBlock(),n.createElementBlock("span",f)):n.createCommentVNode("",!0)],8,h)),[[r]]),l.isOptionGroup(e)&&l.isOptionActive(e)?(n.openBlock(),n.createBlock(a,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:l.getOptionGroupChildren(e),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:l.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"])):n.createCommentVNode("",!0)],10,d)))),128))])};var O={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:null,inputStyle:null,inputClass:null,inputProps:null,panelStyle:null,panelClass:null,panelProps:null,appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},autoOptionFocus:{type:Boolean,default:!0},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},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e.UniqueComponentId(),focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},isOptionDisabled(t){return!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel):null},getOptionGroupChildren(t,i){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren[i])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:t=>e.ObjectUtils.isNotEmpty(t.children),show(t){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.findOptionPathByValue(this.modelValue),this.hasSelectedOption&&e.ObjectUtils.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};t&&this.$refs.focusInput.focus()},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&this.$refs.focusInput.focus()};setTimeout((()=>{t()}),0)},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(t){if(this.disabled||this.loading)t.preventDefault();else switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:e.ObjectUtils.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(t,t.key))}},onOptionChange(t){const{originalEvent:i,processedOption:n,isFocus:s}=t,{index:o,level:l,parentKey:a,children:r}=n,p=e.ObjectUtils.isNotEmpty(r),c=this.activeOptionPath.filter((e=>e.parentKey!==a));c.push(n),this.focusedOptionInfo={index:o,level:l,parentKey:a},this.activeOptionPath=c,p?this.onOptionGroupSelect(i,n):this.onOptionSelect(i,n),s&&this.$refs.focusInput.focus()},onOptionSelect(e,t){const i=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,i),this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus()),this.$emit("click",e))},onOverlayClick(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(t){if(this.overlayVisible){const i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===i.parentKey)),s=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,o=e.ObjectUtils.isEmpty(i.parent);s&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(t)),t.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>t.key===e.key))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t})}e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){"self"===this.appendTo?e.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?this.visibleOptions.slice(0,e).findLastIndex((e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(t,i,n=0){if(!(i=i||0===n&&this.processedOptions))return null;if(e.ObjectUtils.isEmpty(t))return[];for(let s=0;s<i.length;s++){const o=i[s];if(e.ObjectUtils.equals(t,this.getOptionValue(o.option),this.equalityKey))return[o];const l=this.findOptionPathByValue(t,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedOptionId,n=e.DomHandler.findSingle(this.list,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionInfo.index]);this.updateModel(null,e)}},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const s=[];return e&&e.forEach(((e,o)=>{const l=(""!==n?n+"_":"")+o,a={option:e,index:o,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),s.push(a)})),s},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]},hasSelectedOption(){return e.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),i=t.length?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return e.ObjectUtils.isNotEmpty(this.visibleOptions)?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||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${e.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:p,Portal:r.default}};const b={class:"p-hidden-accessible"},y=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],v={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},m={role:"status","aria-live":"polite",class:"p-hidden-accessible"},g={class:"p-cascadeselect-items-wrapper"},x={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 n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),O.render=function(e,t,i,s,o,l){const a=n.resolveComponent("CascadeSelectSub"),r=n.resolveComponent("Portal");return n.openBlock(),n.createElementBlock("div",{ref:"container",class:n.normalizeClass(l.containerClass),onClick:t[5]||(t[5]=e=>l.onContainerClick(e))},[n.createElementVNode("div",b,[n.createElementVNode("input",n.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onKeyDown&&l.onKeyDown(...e))},i.inputProps),null,16,y)]),n.createElementVNode("span",{class:n.normalizeClass(l.labelClass)},[n.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[n.createTextVNode(n.toDisplayString(l.label),1)]))],2),n.createElementVNode("div",v,[n.renderSlot(e.$slots,"indicator",{},(()=>[n.createElementVNode("span",{class:n.normalizeClass(l.dropdownIconClass)},null,2)]))]),n.createElementVNode("span",m,n.toDisplayString(l.searchResultMessageText),1),n.createVNode(r,{appendTo:i.appendTo},{default:n.withCtx((()=>[n.createVNode(n.Transition,{name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},{default:n.withCtx((()=>[o.overlayVisible?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,ref:l.overlayRef,style:i.panelStyle,class:l.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>l.onOverlayKeyDown&&l.onOverlayKeyDown(...e))},i.panelProps),[n.createElementVNode("div",g,[n.createVNode(a,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?l.focusedOptionId:void 0,options:l.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:l.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"]),n.createElementVNode("span",x,n.toDisplayString(l.selectedMessageText),1)])],16)):n.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)},O}(primevue.utils,primevue.overlayeventbus,primevue.ripple,Vue,primevue.portal);
1
+ this.primevue=this.primevue||{},this.primevue.cascadeselect=function(e,t,i,n,s){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t),a=o(i),r=o(s),p={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){e.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t.option,this.optionLabel):t.option},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t.option,this.optionValue):t.option},isOptionDisabled(t){return!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t.option,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.ObjectUtils.resolveFieldData(t.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:t=>e.ObjectUtils.isNotEmpty(t.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const t=this.$el.parentElement,i=e.DomHandler.getOffset(t),n=e.DomHandler.getViewport(),s=this.$el.offsetParent?this.$el.offsetWidth:e.DomHandler.getHiddenElementOuterWidth(this.$el),o=e.DomHandler.getOuterWidth(t.children[0]);parseInt(i.left,10)+o+s>n.width-e.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:a.default}};const c={class:"p-cascadeselect-panel p-cascadeselect-items"},d=["id","aria-label","aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-level"],h=["onClick"],u={key:1,class:"p-cascadeselect-item-text"},O={key:2,class:"p-cascadeselect-group-icon pi pi-angle-right","aria-hidden":"true"};p.render=function(e,t,i,s,o,l){const a=n.resolveComponent("CascadeSelectSub",!0),r=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("ul",c,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.options,((e,t)=>(n.openBlock(),n.createElementBlock("li",{key:l.getOptionLabelToRender(e),id:l.getOptionId(e),class:n.normalizeClass(["p-cascadeselect-item",{"p-cascadeselect-item-group":l.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":l.isOptionActive(e),"p-focus":l.isOptionFocused(e),"p-disabled":l.isOptionDisabled(e)}]),role:"treeitem","aria-label":l.getOptionLabelToRender(e),"aria-selected":l.isOptionGroup(e)?void 0:l.isOptionSelected(e),"aria-expanded":l.isOptionGroup(e)?l.isOptionActive(e):void 0,"aria-setsize":e.length,"aria-posinset":t+1,"aria-level":i.level+1},[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:"p-cascadeselect-item-content",onClick:t=>l.onOptionClick(t,e)},[i.templates.option?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.templates.option),{key:0,option:e.option},null,8,["option"])):(n.openBlock(),n.createElementBlock("span",u,n.toDisplayString(l.getOptionLabelToRender(e)),1)),l.isOptionGroup(e)?(n.openBlock(),n.createElementBlock("span",O)):n.createCommentVNode("",!0)],8,h)),[[r]]),l.isOptionGroup(e)&&l.isOptionActive(e)?(n.openBlock(),n.createBlock(a,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:l.getOptionGroupChildren(e),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:l.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"])):n.createCommentVNode("",!0)],10,d)))),128))])};var f={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:null,inputStyle:null,inputClass:null,inputProps:null,panelStyle:null,panelClass:null,panelProps:null,appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},autoOptionFocus:{type:Boolean,default:!0},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},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e.UniqueComponentId(),focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},isOptionDisabled(t){return!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},getOptionGroupLabel(t){return this.optionGroupLabel?e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel):null},getOptionGroupChildren(t,i){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren[i])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:t=>e.ObjectUtils.isNotEmpty(t.children),show(t){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.findOptionPathByValue(this.modelValue),this.hasSelectedOption&&e.ObjectUtils.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};t&&this.$refs.focusInput.focus()},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&this.$refs.focusInput.focus()};setTimeout((()=>{t()}),0)},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(t){if(this.disabled||this.loading)t.preventDefault();else switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:e.ObjectUtils.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(t,t.key))}},onOptionChange(t){const{originalEvent:i,processedOption:n,isFocus:s}=t,{index:o,level:l,parentKey:a,children:r}=n,p=e.ObjectUtils.isNotEmpty(r),c=this.activeOptionPath.filter((e=>e.parentKey!==a));c.push(n),this.focusedOptionInfo={index:o,level:l,parentKey:a},this.activeOptionPath=c,p?this.onOptionGroupSelect(i,n):this.onOptionSelect(i,n),s&&this.$refs.focusInput.focus()},onOptionSelect(e,t){const i=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,i),this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus()),this.$emit("click",e))},onOverlayClick(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(t){if(this.overlayVisible){const i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===i.parentKey)),s=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,o=e.ObjectUtils.isEmpty(i.parent);s&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(t)),t.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>t.key===e.key))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t})}e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){"self"===this.appendTo?e.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return e.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(t){const i=t>0?e.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,t),(e=>this.isValidOption(e))):-1;return i>-1?i:t},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(t,i,n=0){if(!(i=i||0===n&&this.processedOptions))return null;if(e.ObjectUtils.isEmpty(t))return[];for(let s=0;s<i.length;s++){const o=i[s];if(e.ObjectUtils.equals(t,this.getOptionValue(o.option),this.equalityKey))return[o];const l=this.findOptionPathByValue(t,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedOptionId,n=e.DomHandler.findSingle(this.list,`li[id="${i}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionInfo.index]);this.updateModel(null,e)}},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const s=[];return e&&e.forEach(((e,o)=>{const l=(""!==n?n+"_":"")+o,a={option:e,index:o,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),s.push(a)})),s},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]},hasSelectedOption(){return e.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),i=t.length?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return e.ObjectUtils.isNotEmpty(this.visibleOptions)?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||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${e.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:p,Portal:r.default}};const b={class:"p-hidden-accessible"},y=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],v={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},m={role:"status","aria-live":"polite",class:"p-hidden-accessible"},g={class:"p-cascadeselect-items-wrapper"},x={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 n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),f.render=function(e,t,i,s,o,l){const a=n.resolveComponent("CascadeSelectSub"),r=n.resolveComponent("Portal");return n.openBlock(),n.createElementBlock("div",{ref:"container",class:n.normalizeClass(l.containerClass),onClick:t[5]||(t[5]=e=>l.onContainerClick(e))},[n.createElementVNode("div",b,[n.createElementVNode("input",n.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onKeyDown&&l.onKeyDown(...e))},i.inputProps),null,16,y)]),n.createElementVNode("span",{class:n.normalizeClass(l.labelClass)},[n.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[n.createTextVNode(n.toDisplayString(l.label),1)]))],2),n.createElementVNode("div",v,[n.renderSlot(e.$slots,"indicator",{},(()=>[n.createElementVNode("span",{class:n.normalizeClass(l.dropdownIconClass)},null,2)]))]),n.createElementVNode("span",m,n.toDisplayString(l.searchResultMessageText),1),n.createVNode(r,{appendTo:i.appendTo},{default:n.withCtx((()=>[n.createVNode(n.Transition,{name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},{default:n.withCtx((()=>[o.overlayVisible?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,ref:l.overlayRef,style:i.panelStyle,class:l.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>l.onOverlayKeyDown&&l.onOverlayKeyDown(...e))},i.panelProps),[n.createElementVNode("div",g,[n.createVNode(a,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?l.focusedOptionId:void 0,options:l.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:l.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupLabel","optionGroupChildren","onOptionChange"]),n.createElementVNode("span",x,n.toDisplayString(l.selectedMessageText),1)])],16)):n.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)},f}(primevue.utils,primevue.overlayeventbus,primevue.ripple,Vue,primevue.portal);
package/core/core.js CHANGED
@@ -841,6 +841,25 @@ this.primevue.utils = (function (exports) {
841
841
 
842
842
  isPrintableCharacter(char = '') {
843
843
  return this.isNotEmpty(char) && char.length === 1 && char.match(/\S| /);
844
+ },
845
+
846
+ /**
847
+ * Firefox-v103 does not currently support the "findLastIndex" method. It is stated that this method will be supported with Firefox-v104.
848
+ * https://caniuse.com/mdn-javascript_builtins_array_findlastindex
849
+ */
850
+ findLastIndex(arr, callback) {
851
+ let index = -1;
852
+
853
+ if (this.isNotEmpty(arr)) {
854
+ try {
855
+ index = arr.findLastIndex(callback);
856
+ }
857
+ catch {
858
+ index = arr.lastIndexOf([...arr].reverse().find(callback));
859
+ }
860
+ }
861
+
862
+ return index;
844
863
  }
845
864
  };
846
865
 
@@ -2041,11 +2060,12 @@ this.primevue.tooltip = (function (utils) {
2041
2060
  else if (typeof options.value === 'object' && options.value) {
2042
2061
  if (options.value.value === undefined || options.value.value === null || options.value.value.trim() === '') return;
2043
2062
  else {
2063
+ /* eslint-disable */
2044
2064
  target.$_ptooltipValue = options.value.value;
2045
- target.$_ptooltipDisabled = options.value.disabled || false;
2046
- target.$_ptooltipEscape = options.value.escape || false;
2065
+ target.$_ptooltipDisabled = !!options.value.disabled === options.value.disabled ? options.value.disabled : false;
2066
+ target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : false;
2047
2067
  target.$_ptooltipClass = options.value.class;
2048
- target.$_ptooltipFitContent = options.value.fitContent || true;
2068
+ target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true;
2049
2069
  }
2050
2070
  }
2051
2071
 
@@ -2078,11 +2098,12 @@ this.primevue.tooltip = (function (utils) {
2078
2098
  else if (typeof options.value === 'object' && options.value) {
2079
2099
  if (options.value.value === undefined || options.value.value === null || options.value.value.trim() === '') return;
2080
2100
  else {
2101
+ /* eslint-disable */
2081
2102
  target.$_ptooltipValue = options.value.value;
2082
- target.$_ptooltipDisabled = options.value.disabled || false;
2083
- target.$_ptooltipEscape = options.value.escape || false;
2103
+ target.$_ptooltipDisabled = !!options.value.disabled === options.value.disabled ? options.value.disabled : false;
2104
+ target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : false;
2084
2105
  target.$_ptooltipClass = options.value.class;
2085
- target.$_ptooltipFitContent = options.value.fitContent || true;
2106
+ target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true;
2086
2107
  }
2087
2108
  }
2088
2109
  }
@@ -4082,6 +4103,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
4082
4103
  "aria-valuemin": $props.min,
4083
4104
  "aria-valuemax": $props.max,
4084
4105
  "aria-valuenow": $props.modelValue,
4106
+ disabled: $props.disabled,
4085
4107
  readonly: $props.readonly,
4086
4108
  placeholder: $props.placeholder,
4087
4109
  "aria-labelledby": _ctx.ariaLabelledby,
@@ -4093,7 +4115,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
4093
4115
  onClick: $options.onInputClick,
4094
4116
  onFocus: $options.onInputFocus,
4095
4117
  onBlur: $options.onInputBlur
4096
- }, $props.inputProps), null, 16, ["id", "class", "style", "value", "aria-valuemin", "aria-valuemax", "aria-valuenow", "readonly", "placeholder", "aria-labelledby", "aria-label", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur"]),
4118
+ }, $props.inputProps), null, 16, ["id", "class", "style", "value", "aria-valuemin", "aria-valuemax", "aria-valuenow", "disabled", "readonly", "placeholder", "aria-labelledby", "aria-label", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur"]),
4097
4119
  ($props.showButtons && $props.buttonLayout === 'stacked')
4098
4120
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [
4099
4121
  vue.createVNode(_component_INButton, vue.mergeProps({
@@ -5053,14 +5075,14 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5053
5075
  return this.visibleOptions.findIndex(option => this.isValidOption(option));
5054
5076
  },
5055
5077
  findLastOptionIndex() {
5056
- return this.visibleOptions.findLastIndex(option => this.isValidOption(option));
5078
+ return utils.ObjectUtils.findLastIndex(this.visibleOptions, option => this.isValidOption(option));
5057
5079
  },
5058
5080
  findNextOptionIndex(index) {
5059
5081
  const matchedOptionIndex = index < (this.visibleOptions.length - 1) ? this.visibleOptions.slice(index + 1).findIndex(option => this.isValidOption(option)) : -1;
5060
5082
  return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
5061
5083
  },
5062
5084
  findPrevOptionIndex(index) {
5063
- const matchedOptionIndex = index > 0 ? this.visibleOptions.slice(0, index).findLastIndex(option => this.isValidOption(option)) : -1;
5085
+ const matchedOptionIndex = index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), option => this.isValidOption(option)) : -1;
5064
5086
  return matchedOptionIndex > -1 ? matchedOptionIndex : index;
5065
5087
  },
5066
5088
  findSelectedOptionIndex() {