primevue
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primevue) [ • 26.5 kB
JavaScript
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/icons/angleright"),i=require("primevue/icons/chevrondown"),n=require("primevue/icons/spinner"),o=require("primevue/overlayeventbus"),s=require("primevue/portal"),l=require("primevue/utils"),a=require("primevue/ripple"),r=require("vue");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=p(e),d=p(t),h=p(i),u=p(n),O=p(o),f=p(s),y=p(a),v={name:"CascadeSelectSub",extends:c.default,emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){l.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(e){return this.optionLabel?l.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue(e){return this.optionValue?l.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled(e){return!!this.optionDisabled&&l.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?l.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:e=>l.ObjectUtils.isNotEmpty(e.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,t=l.DomHandler.getOffset(e),i=l.DomHandler.getViewport(),n=this.$el.offsetParent?this.$el.offsetWidth:l.DomHandler.getHiddenElementOuterWidth(this.$el),o=l.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+n>i.width-l.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")},getOptionClass(e){return["p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.isOptionActive(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}]}},directives:{ripple:y.default},components:{AngleRightIcon:d.default}};const b=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset"],m=["onClick"];v.render=function(e,t,i,n,o,s){const l=r.resolveComponent("CascadeSelectSub",!0),a=r.resolveDirective("ripple");return r.openBlock(),r.createElementBlock("ul",r.mergeProps({class:"p-cascadeselect-panel p-cascadeselect-items"},e.ptm("list")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,((t,n)=>(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:s.getOptionClass(t),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},e.ptm("item")),[r.withDirectives((r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"p-cascadeselect-item-content",onClick:e=>s.onOptionClick(e,t)},e.ptm("content")),[i.templates.option?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.templates.option),{key:0,option:t.option},null,8,["option"])):(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:1,class:"p-cascadeselect-item-text"},e.ptm("text")),r.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.templates.optiongroupicon?i.templates.optiongroupicon:i.optionGroupIcon?"span":"AngleRightIcon"),{key:2,class:r.normalizeClass(["p-cascadeselect-group-icon",i.optionGroupIcon]),"aria-hidden":"true"},null,8,["class"])):r.createCommentVNode("",!0)],16,m)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(r.openBlock(),r.createBlock(l,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt"])):r.createCommentVNode("",!0)],16,b)))),128))],16)};var g={name:"CascadeSelect",extends:c.default,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:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},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,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||l.UniqueComponentId()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||l.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(e){return this.optionLabel?l.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?l.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled(e){return!!this.optionDisabled&&l.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?l.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren(e,t){return l.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},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:e=>l.ObjectUtils.isNotEmpty(e.children),show(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&l.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:""};e&&l.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&l.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(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(e){if(this.disabled||this.loading)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&l.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}},onOptionChange(e){const{originalEvent:t,processedOption:i,isFocus:n,isHide:o}=e;if(l.ObjectUtils.isEmpty(i))return;const{index:s,level:a,parentKey:r,children:p}=i,c=l.ObjectUtils.isNotEmpty(p),d=this.activeOptionPath.filter((e=>e.parentKey!==r));d.push(i),this.focusedOptionInfo={index:s,level:a,parentKey:r},this.activeOptionPath=d,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&l.DomHandler.focus(this.$refs.focusInput)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,n),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(),l.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick(e){O.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(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index],i=this.activeOptionPath.find((e=>e.key===t.parentKey)),n=""===this.focusedOptionInfo.parentKey||i&&i.key===this.focusedOptionInfo.parentKey,o=l.ObjectUtils.isEmpty(t.parent);n&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:i?i.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.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){l.ZIndexUtils.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){l.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?l.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=l.DomHandler.getOuterWidth(this.$el)+"px",l.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 l.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.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 l.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?l.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(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(e,t,i=0){if(!(t=t||0===i&&this.processedOptions))return null;if(l.ObjectUtils.isEmpty(e))return[];for(let n=0;n<t.length;n++){const o=t[n];if(l.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];const s=this.findOptionPathByValue(e,o.children,i+1);if(s)return s.unshift(o),s}},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.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=l.DomHandler.findSingle(this.list,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const o=[];return e&&e.forEach(((e,s)=>{const l=(""!==n?n+"_":"")+s,a={option:e,index:s,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),o.push(a)})),o},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-inputtext",{"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}]},hasSelectedOption(){return l.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),i=l.ObjectUtils.isNotEmpty(t)?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 l.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}${l.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:v,Portal:f.default,ChevronDownIcon:h.default,SpinnerIcon:u.default,AngleRightIcon:d.default}};const I=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\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: flex;\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: 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"),g.render=function(e,t,i,n,o,s){const l=r.resolveComponent("SpinnerIcon"),a=r.resolveComponent("CascadeSelectSub"),p=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:s.containerClass,onClick:t[5]||(t[5]=e=>s.onContainerClick(e))},e.ptm("root")),[r.createElementVNode("div",r.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper")),[r.createElementVNode("input",r.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?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e))},{...i.inputProps,...e.ptm("input")}),null,16,I)],16),r.createElementVNode("span",r.mergeProps({class:s.labelClass},e.ptm("label")),[r.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[r.createTextVNode(r.toDisplayString(s.label),1)]))],16),r.createElementVNode("div",r.mergeProps({class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[i.loading?r.renderSlot(e.$slots,"loadingicon",{key:0,class:"p-cascadeselect-trigger-icon"},(()=>[i.loadingIcon?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:["p-cascadeselect-trigger-icon pi-spin",i.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(r.openBlock(),r.createBlock(l,r.mergeProps({key:1,class:"p-cascadeselect-trigger-icon",spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16))])):r.renderSlot(e.$slots,"dropdownicon",{key:1,class:"p-cascadeselect-trigger-icon"},(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.dropdownIcon?"span":"ChevronDownIcon"),r.mergeProps({class:["p-cascadeselect-trigger-icon",i.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]))],16),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("searchResultAria")),r.toDisplayString(s.searchResultMessageText),17),r.createVNode(p,{appendTo:i.appendTo},{default:r.withCtx((()=>[r.createVNode(r.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:r.withCtx((()=>[o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.overlayRef,style:i.panelStyle,class:s.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},{...i.panelProps,...e.ptm("panel")}),[r.createElementVNode("div",r.mergeProps({class:"p-cascadeselect-items-wrapper"},e.ptm("wrapper")),[r.createVNode(a,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt"])],16),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage")),r.toDisplayString(s.selectedMessageText),17)],16)):r.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],16)},module.exports=g;