primevue 3.30.2 → 3.31.0
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.
- package/breadcrumb/Breadcrumb.d.ts +15 -0
- package/breadcrumb/BreadcrumbItem.vue +18 -8
- package/breadcrumb/breadcrumb.cjs.js +18 -8
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +18 -8
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +18 -8
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/cascadeselect/CascadeSelect.vue +1 -0
- package/cascadeselect/CascadeSelectSub.vue +1 -0
- package/cascadeselect/cascadeselect.cjs.js +6 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +6 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +6 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/config/PrimeVue.d.ts +14 -0
- package/contextmenu/ContextMenu.d.ts +8 -0
- package/contextmenu/ContextMenuSub.vue +13 -11
- package/contextmenu/contextmenu.cjs.js +13 -11
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +13 -11
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +13 -11
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +3417 -18
- package/core/core.min.js +5 -3
- package/dock/Dock.d.ts +4 -0
- package/dock/DockSub.vue +8 -7
- package/dock/dock.cjs.js +8 -7
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +8 -7
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +8 -7
- package/dock/dock.min.js +1 -1
- package/dropdown/BaseDropdown.vue +5 -5
- package/dropdown/dropdown.cjs.js +5 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +5 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +5 -5
- package/dropdown/dropdown.min.js +1 -1
- package/image/Image.vue +2 -2
- package/image/image.cjs.js +2 -2
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +2 -2
- package/image/image.esm.min.js +1 -1
- package/image/image.js +2 -2
- package/image/image.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +2 -2
- package/megamenu/MegaMenu.d.ts +8 -0
- package/megamenu/MegaMenuSub.vue +13 -11
- package/megamenu/megamenu.cjs.js +13 -11
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +13 -11
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +13 -11
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +8 -0
- package/menu/Menu.vue +1 -1
- package/menu/Menuitem.vue +4 -1
- package/menu/menu.cjs.js +6 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +6 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +6 -2
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +8 -0
- package/menubar/MenubarSub.vue +12 -10
- package/menubar/menubar.cjs.js +12 -10
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +12 -10
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +12 -10
- package/menubar/menubar.min.js +1 -1
- package/package.json +1 -1
- package/panelmenu/PanelMenu.d.ts +8 -0
- package/panelmenu/PanelMenu.vue +12 -11
- package/panelmenu/PanelMenuSub.vue +13 -11
- package/panelmenu/panelmenu.cjs.js +25 -22
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +25 -22
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +25 -22
- package/panelmenu/panelmenu.min.js +1 -1
- package/resources/themes/bootstrap4-dark-blue/theme.css +0 -7
- package/resources/themes/bootstrap4-dark-purple/theme.css +0 -7
- package/resources/themes/bootstrap4-light-blue/theme.css +0 -7
- package/resources/themes/bootstrap4-light-purple/theme.css +0 -7
- package/splitterpanel/SplitterPanel.d.ts +11 -0
- package/splitterpanel/SplitterPanel.vue +7 -0
- package/splitterpanel/splitterpanel.cjs.js +7 -0
- package/splitterpanel/splitterpanel.cjs.min.js +1 -1
- package/splitterpanel/splitterpanel.esm.js +7 -0
- package/splitterpanel/splitterpanel.esm.min.js +1 -1
- package/splitterpanel/splitterpanel.js +7 -0
- package/splitterpanel/splitterpanel.min.js +1 -1
- package/steps/BaseSteps.vue +1 -1
- package/steps/Steps.d.ts +25 -0
- package/steps/Steps.vue +17 -7
- package/steps/steps.cjs.js +19 -9
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +19 -9
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +19 -9
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +6 -2
- package/tabmenu/TabMenu.vue +11 -10
- package/tabmenu/tabmenu.cjs.js +11 -10
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +11 -10
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +11 -10
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/TabView.vue +1 -0
- package/tabview/tabview.cjs.js +2 -1
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +2 -1
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +2 -1
- package/tabview/tabview.min.js +1 -1
- package/tailwind/Tailwind.d.ts +5 -0
- package/tailwind/package.json +6 -0
- package/tailwind/tailwind.cjs.js +3388 -0
- package/tailwind/tailwind.cjs.min.js +1 -0
- package/tailwind/tailwind.esm.js +3386 -0
- package/tailwind/tailwind.esm.min.js +1 -0
- package/tailwind/tailwind.js +3392 -0
- package/tailwind/tailwind.min.js +1 -0
- package/tieredmenu/TieredMenu.d.ts +8 -0
- package/tieredmenu/TieredMenuSub.vue +13 -11
- package/tieredmenu/tieredmenu.cjs.js +13 -11
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +13 -11
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -11
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/web-types.json +1 -1
|
@@ -346,8 +346,9 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
346
346
|
optionGroupLabel: $props.optionGroupLabel,
|
|
347
347
|
optionGroupChildren: $props.optionGroupChildren,
|
|
348
348
|
onOptionChange: $options.onOptionChange,
|
|
349
|
-
pt: _ctx.pt
|
|
350
|
-
|
|
349
|
+
pt: _ctx.pt,
|
|
350
|
+
unstyled: _ctx.unstyled
|
|
351
|
+
}, null, 8, ["class", "selectId", "focusedOptionId", "options", "activeOptionPath", "level", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_1$1);
|
|
351
352
|
}), 128))], 16);
|
|
352
353
|
}
|
|
353
354
|
|
|
@@ -1170,8 +1171,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1170
1171
|
optionGroupLabel: _ctx.optionGroupLabel,
|
|
1171
1172
|
optionGroupChildren: _ctx.optionGroupChildren,
|
|
1172
1173
|
onOptionChange: $options.onOptionChange,
|
|
1173
|
-
pt: _ctx.pt
|
|
1174
|
-
|
|
1174
|
+
pt: _ctx.pt,
|
|
1175
|
+
unstyled: _ctx.unstyled
|
|
1176
|
+
}, null, 8, ["id", "selectId", "focusedOptionId", "options", "activeOptionPath", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "pt", "unstyled"])], 16), createElementVNode("span", mergeProps({
|
|
1175
1177
|
role: "status",
|
|
1176
1178
|
"aria-live": "polite",
|
|
1177
1179
|
"class": "p-hidden-accessible"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/icons/angleright";import t from"primevue/icons/chevrondown";import i from"primevue/icons/spinner";import n from"primevue/overlayeventbus";import o from"primevue/portal";import{ObjectUtils as s,DomHandler as a,UniqueComponentId as r,ZIndexUtils as l,ConnectedOverlayScrollHandler as p}from"primevue/utils";import c from"primevue/basecomponent";import{useStyle as d}from"primevue/usestyle";import u from"primevue/ripple";import{resolveComponent as h,resolveDirective as f,openBlock as v,createElementBlock as O,mergeProps as y,Fragment as b,renderList as g,withDirectives as m,createBlock as I,resolveDynamicComponent as x,toDisplayString as w,createCommentVNode as L,normalizeClass as S,createElementVNode as V,renderSlot as k,createTextVNode as C,createVNode as P,withCtx as K,Transition as G}from"vue";var D={root:function(e){return{position:"self"===e.props.appendTo?"relative":void 0}}},E=d("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n}\n\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\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\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n",{name:"cascadeselect",manual:!0}),F={name:"BaseCascadeSelect",extends:c,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}},css:{classes:{root:function(e){var t=e.instance,i=e.props;return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":i.disabled,"p-focus":t.focused,"p-inputwrapper-filled":i.modelValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-overlay-open":t.overlayVisible}]},label:function(e){var t=e.instance;return["p-cascadeselect-label p-inputtext",{"p-placeholder":t.label===e.props.placeholder,"p-cascadeselect-label-empty":!t.$slots.value&&("p-emptylabel"===t.label||0===t.label.length)}]},dropdownButton:"p-cascadeselect-trigger",loadingIcon:"p-cascadeselect-trigger-icon",dropdownIcon:"p-cascadeselect-trigger-icon",panel:function(e){var t=e.instance;return["p-cascadeselect-panel p-component",{"p-input-filled":"filled"===t.$primevue.config.inputStyle,"p-ripple-disabled":!1===t.$primevue.config.ripple}]},wrapper:"p-cascadeselect-items-wrapper",list:"p-cascadeselect-panel p-cascadeselect-items",item:function(e){var t=e.instance,i=e.processedOption;return["p-cascadeselect-item",{"p-cascadeselect-item-group":t.isOptionGroup(i),"p-cascadeselect-item-active p-highlight":t.isOptionActive(i),"p-focus":t.isOptionFocused(i),"p-disabled":t.isOptionDisabled(i)}]},content:"p-cascadeselect-item-content",text:"p-cascadeselect-item-text",groupIcon:"p-cascadeselect-group-icon",sublist:"p-cascadeselect-sublist"},inlineStyles:D,loadStyle:E.load},provide:function(){return{$parentInstance:this}}},$={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:c,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:function(){s.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},position:function(){var e=this.$el.parentElement,t=a.getOffset(e),i=a.getViewport(),n=this.$el.offsetParent?this.$el.offsetWidth:a.getHiddenElementOuterWidth(this.$el),o=a.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+n>i.width-a.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:u},components:{AngleRightIcon:e}},A=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],M=["onClick"];$.render=function(e,t,i,n,o,s){var a=h("AngleRightIcon"),r=h("CascadeSelectSub",!0),l=f("ripple");return v(),O("ul",y({class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(v(!0),O(b,null,g(i.options,(function(t,n){return v(),O("li",y({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption: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"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[m((v(),O("div",y({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(v(),I(x(i.templates.option),{key:0,option:t.option},null,8,["option"])):(v(),O("span",y({key:1,class:e.cx("text")},e.ptm("text")),w(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(v(),O(b,{key:2},[i.templates.optiongroupicon?(v(),I(x(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(v(),O("span",y({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(v(),I(a,y({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):L("",!0)],16,M)),[[l]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(v(),I(r,{key:0,role:"group",class:S(e.cx("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,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt"])):L("",!0)],16,A)})),128))],16)};var T={name:"CascadeSelect",extends:F,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){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||r()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||r(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&a.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&a.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var 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&&s.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.isEmpty(i)){var r=i.index,l=i.level,p=i.parentKey,c=s.isNotEmpty(i.children),d=this.activeOptionPath.filter((function(e){return e.parentKey!==p}));d.push(i),this.focusedOptionInfo={index:r,level:l,parentKey:p},this.activeOptionPath=d,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&a.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),a.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,a=s.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),a||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return 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:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var 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:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){l.set("overlay",e,this.$primevue.config.zIndex.overlay),a.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){l.clear(e)},alignOverlay:function(){"self"===this.appendTo?a.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=a.getOuterWidth(this.$el)+"px",a.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new p(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!a.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var a=this.findOptionPathByValue(e,o.children,i+1);if(a)return a.unshift(o),a}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(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:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=a.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){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:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,a){var r=(""!==o?o+"_":"")+a,l={option:e,index:a,level:i,key:r,parent:n,parentKey:o};l.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,l,r),s.push(l)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:$,Portal:o,ChevronDownIcon:t,SpinnerIcon:i,AngleRightIcon:e}};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function j(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?j(Object(i),!0).forEach((function(t){B(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):j(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function B(e,t,i){return(t=H(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function H(e){var t=N(e,"string");return"symbol"===R(t)?t:String(t)}function N(e,t){if("object"!==R(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var _=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];T.render=function(e,t,i,n,o,s){var a=h("SpinnerIcon"),r=h("CascadeSelectSub"),l=h("Portal");return v(),O("div",y({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[V("div",y({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[V("input",y({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.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]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},z(z({},e.inputProps),e.ptm("input"))),null,16,_)],16),V("span",y({class:e.cx("label")},e.ptm("label")),[k(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[C(w(s.label),1)]}))],16),V("div",y({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?k(e.$slots,"loadingicon",{key:0,class:S(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(v(),O("span",y({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(v(),I(a,y({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):k(e.$slots,"dropdownicon",{key:1,class:S(e.cx("dropdownIcon"))},(function(){return[(v(),I(x(e.dropdownIcon?"span":"ChevronDownIcon"),y({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),V("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),w(s.searchResultMessageText),17),P(l,{appendTo:e.appendTo},{default:K((function(){return[P(G,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:K((function(){return[o.overlayVisible?(v(),O("div",y({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},z(z({},e.panelProps),e.ptm("panel"))),[V("div",y({class:e.cx("wrapper")},e.ptm("wrapper")),[P(r,{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:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt"])],16),V("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),w(s.selectedMessageText),17)],16)):L("",!0)]})),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)};export{T as default};
|
|
1
|
+
import e from"primevue/icons/angleright";import t from"primevue/icons/chevrondown";import i from"primevue/icons/spinner";import n from"primevue/overlayeventbus";import o from"primevue/portal";import{ObjectUtils as s,DomHandler as a,UniqueComponentId as r,ZIndexUtils as l,ConnectedOverlayScrollHandler as p}from"primevue/utils";import c from"primevue/basecomponent";import{useStyle as d}from"primevue/usestyle";import u from"primevue/ripple";import{resolveComponent as h,resolveDirective as f,openBlock as v,createElementBlock as O,mergeProps as y,Fragment as b,renderList as g,withDirectives as m,createBlock as I,resolveDynamicComponent as x,toDisplayString as w,createCommentVNode as L,normalizeClass as S,createElementVNode as V,renderSlot as k,createTextVNode as C,createVNode as P,withCtx as K,Transition as G}from"vue";var D={root:function(e){return{position:"self"===e.props.appendTo?"relative":void 0}}},E=d("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n}\n\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\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\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n",{name:"cascadeselect",manual:!0}),F={name:"BaseCascadeSelect",extends:c,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}},css:{classes:{root:function(e){var t=e.instance,i=e.props;return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":i.disabled,"p-focus":t.focused,"p-inputwrapper-filled":i.modelValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-overlay-open":t.overlayVisible}]},label:function(e){var t=e.instance;return["p-cascadeselect-label p-inputtext",{"p-placeholder":t.label===e.props.placeholder,"p-cascadeselect-label-empty":!t.$slots.value&&("p-emptylabel"===t.label||0===t.label.length)}]},dropdownButton:"p-cascadeselect-trigger",loadingIcon:"p-cascadeselect-trigger-icon",dropdownIcon:"p-cascadeselect-trigger-icon",panel:function(e){var t=e.instance;return["p-cascadeselect-panel p-component",{"p-input-filled":"filled"===t.$primevue.config.inputStyle,"p-ripple-disabled":!1===t.$primevue.config.ripple}]},wrapper:"p-cascadeselect-items-wrapper",list:"p-cascadeselect-panel p-cascadeselect-items",item:function(e){var t=e.instance,i=e.processedOption;return["p-cascadeselect-item",{"p-cascadeselect-item-group":t.isOptionGroup(i),"p-cascadeselect-item-active p-highlight":t.isOptionActive(i),"p-focus":t.isOptionFocused(i),"p-disabled":t.isOptionDisabled(i)}]},content:"p-cascadeselect-item-content",text:"p-cascadeselect-item-text",groupIcon:"p-cascadeselect-group-icon",sublist:"p-cascadeselect-sublist"},inlineStyles:D,loadStyle:E.load},provide:function(){return{$parentInstance:this}}},$={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:c,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:function(){s.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},position:function(){var e=this.$el.parentElement,t=a.getOffset(e),i=a.getViewport(),n=this.$el.offsetParent?this.$el.offsetWidth:a.getHiddenElementOuterWidth(this.$el),o=a.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+n>i.width-a.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:u},components:{AngleRightIcon:e}},A=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],M=["onClick"];$.render=function(e,t,i,n,o,s){var a=h("AngleRightIcon"),r=h("CascadeSelectSub",!0),l=f("ripple");return v(),O("ul",y({class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(v(!0),O(b,null,g(i.options,(function(t,n){return v(),O("li",y({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption: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"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[m((v(),O("div",y({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(v(),I(x(i.templates.option),{key:0,option:t.option},null,8,["option"])):(v(),O("span",y({key:1,class:e.cx("text")},e.ptm("text")),w(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(v(),O(b,{key:2},[i.templates.optiongroupicon?(v(),I(x(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(v(),O("span",y({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(v(),I(a,y({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):L("",!0)],16,M)),[[l]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(v(),I(r,{key:0,role:"group",class:S(e.cx("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,unstyled:e.unstyled},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])):L("",!0)],16,A)})),128))],16)};var T={name:"CascadeSelect",extends:F,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){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||r()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||r(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&a.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&a.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var 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&&s.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.isEmpty(i)){var r=i.index,l=i.level,p=i.parentKey,c=s.isNotEmpty(i.children),d=this.activeOptionPath.filter((function(e){return e.parentKey!==p}));d.push(i),this.focusedOptionInfo={index:r,level:l,parentKey:p},this.activeOptionPath=d,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&a.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),a.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,a=s.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),a||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return 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:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var 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:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){l.set("overlay",e,this.$primevue.config.zIndex.overlay),a.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){l.clear(e)},alignOverlay:function(){"self"===this.appendTo?a.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=a.getOuterWidth(this.$el)+"px",a.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new p(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!a.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var a=this.findOptionPathByValue(e,o.children,i+1);if(a)return a.unshift(o),a}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(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:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=a.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){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:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,a){var r=(""!==o?o+"_":"")+a,l={option:e,index:a,level:i,key:r,parent:n,parentKey:o};l.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,l,r),s.push(l)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:$,Portal:o,ChevronDownIcon:t,SpinnerIcon:i,AngleRightIcon:e}};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function j(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?j(Object(i),!0).forEach((function(t){B(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):j(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function B(e,t,i){return(t=H(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function H(e){var t=N(e,"string");return"symbol"===R(t)?t:String(t)}function N(e,t){if("object"!==R(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var _=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];T.render=function(e,t,i,n,o,s){var a=h("SpinnerIcon"),r=h("CascadeSelectSub"),l=h("Portal");return v(),O("div",y({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[V("div",y({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[V("input",y({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.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]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},z(z({},e.inputProps),e.ptm("input"))),null,16,_)],16),V("span",y({class:e.cx("label")},e.ptm("label")),[k(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[C(w(s.label),1)]}))],16),V("div",y({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?k(e.$slots,"loadingicon",{key:0,class:S(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(v(),O("span",y({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(v(),I(a,y({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):k(e.$slots,"dropdownicon",{key:1,class:S(e.cx("dropdownIcon"))},(function(){return[(v(),I(x(e.dropdownIcon?"span":"ChevronDownIcon"),y({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),V("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),w(s.searchResultMessageText),17),P(l,{appendTo:e.appendTo},{default:K((function(){return[P(G,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:K((function(){return[o.overlayVisible?(v(),O("div",y({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},z(z({},e.panelProps),e.ptm("panel"))),[V("div",y({class:e.cx("wrapper")},e.ptm("wrapper")),[P(r,{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:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),V("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),w(s.selectedMessageText),17)],16)):L("",!0)]})),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)};export{T as default};
|
|
@@ -349,8 +349,9 @@ this.primevue.cascadeselect = (function (AngleRightIcon, ChevronDownIcon, Spinne
|
|
|
349
349
|
optionGroupLabel: $props.optionGroupLabel,
|
|
350
350
|
optionGroupChildren: $props.optionGroupChildren,
|
|
351
351
|
onOptionChange: $options.onOptionChange,
|
|
352
|
-
pt: _ctx.pt
|
|
353
|
-
|
|
352
|
+
pt: _ctx.pt,
|
|
353
|
+
unstyled: _ctx.unstyled
|
|
354
|
+
}, null, 8, ["class", "selectId", "focusedOptionId", "options", "activeOptionPath", "level", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "pt", "unstyled"])) : vue.createCommentVNode("", true)], 16, _hoisted_1$1);
|
|
354
355
|
}), 128))], 16);
|
|
355
356
|
}
|
|
356
357
|
|
|
@@ -1173,8 +1174,9 @@ this.primevue.cascadeselect = (function (AngleRightIcon, ChevronDownIcon, Spinne
|
|
|
1173
1174
|
optionGroupLabel: _ctx.optionGroupLabel,
|
|
1174
1175
|
optionGroupChildren: _ctx.optionGroupChildren,
|
|
1175
1176
|
onOptionChange: $options.onOptionChange,
|
|
1176
|
-
pt: _ctx.pt
|
|
1177
|
-
|
|
1177
|
+
pt: _ctx.pt,
|
|
1178
|
+
unstyled: _ctx.unstyled
|
|
1179
|
+
}, null, 8, ["id", "selectId", "focusedOptionId", "options", "activeOptionPath", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "pt", "unstyled"])], 16), vue.createElementVNode("span", vue.mergeProps({
|
|
1178
1180
|
role: "status",
|
|
1179
1181
|
"aria-live": "polite",
|
|
1180
1182
|
"class": "p-hidden-accessible"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.cascadeselect=function(e,t,i,n,o,s,l,r,a,c){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=p(e),u=p(t),h=p(i),f=p(n),O=p(o),v=p(l),y=p(a),b={root:function(e){return{position:"self"===e.props.appendTo?"relative":void 0}}},m=r.useStyle("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n}\n\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\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\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n",{name:"cascadeselect",manual:!0}),g={name:"BaseCascadeSelect",extends:v.default,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}},css:{classes:{root:function(e){var t=e.instance,i=e.props;return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":i.disabled,"p-focus":t.focused,"p-inputwrapper-filled":i.modelValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-overlay-open":t.overlayVisible}]},label:function(e){var t=e.instance;return["p-cascadeselect-label p-inputtext",{"p-placeholder":t.label===e.props.placeholder,"p-cascadeselect-label-empty":!t.$slots.value&&("p-emptylabel"===t.label||0===t.label.length)}]},dropdownButton:"p-cascadeselect-trigger",loadingIcon:"p-cascadeselect-trigger-icon",dropdownIcon:"p-cascadeselect-trigger-icon",panel:function(e){var t=e.instance;return["p-cascadeselect-panel p-component",{"p-input-filled":"filled"===t.$primevue.config.inputStyle,"p-ripple-disabled":!1===t.$primevue.config.ripple}]},wrapper:"p-cascadeselect-items-wrapper",list:"p-cascadeselect-panel p-cascadeselect-items",item:function(e){var t=e.instance,i=e.processedOption;return["p-cascadeselect-item",{"p-cascadeselect-item-group":t.isOptionGroup(i),"p-cascadeselect-item-active p-highlight":t.isOptionActive(i),"p-focus":t.isOptionFocused(i),"p-disabled":t.isOptionDisabled(i)}]},content:"p-cascadeselect-item-content",text:"p-cascadeselect-item-text",groupIcon:"p-cascadeselect-group-icon",sublist:"p-cascadeselect-sublist"},inlineStyles:b,loadStyle:m.load},provide:function(){return{$parentInstance:this}}},I={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:v.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:function(){s.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},position:function(){var e=this.$el.parentElement,t=s.DomHandler.getOffset(e),i=s.DomHandler.getViewport(),n=this.$el.offsetParent?this.$el.offsetWidth:s.DomHandler.getHiddenElementOuterWidth(this.$el),o=s.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+n>i.width-s.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:y.default},components:{AngleRightIcon:d.default}},x=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],w=["onClick"];I.render=function(e,t,i,n,o,s){var l=c.resolveComponent("AngleRightIcon"),r=c.resolveComponent("CascadeSelectSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.options,(function(t,n){return c.openBlock(),c.createElementBlock("li",c.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption: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"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[c.withDirectives((c.openBlock(),c.createElementBlock("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.option),{key:0,option:t.option},null,8,["option"])):(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:e.cx("text")},e.ptm("text")),c.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.optiongroupicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(c.openBlock(),c.createBlock(l,c.mergeProps({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,w)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(c.openBlock(),c.createBlock(r,{key:0,role:"group",class:c.normalizeClass(e.cx("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,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt"])):c.createCommentVNode("",!0)],16,x)})),128))],16)};var S={name:"CascadeSelect",extends:g,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){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||s.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.ObjectUtils.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var 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&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.ObjectUtils.isEmpty(i)){var l=i.index,r=i.level,a=i.parentKey,c=s.ObjectUtils.isNotEmpty(i.children),p=this.activeOptionPath.filter((function(e){return e.parentKey!==a}));p.push(i),this.focusedOptionInfo={index:l,level:r,parentKey:a},this.activeOptionPath=p,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.DomHandler.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){f.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,l=s.ObjectUtils.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),l||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return 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:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var 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:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),s.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){s.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.ObjectUtils.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var l=this.findOptionPathByValue(e,o.children,i+1);if(l)return l.unshift(o),l}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(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:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){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:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,l){var r=(""!==o?o+"_":"")+l,a={option:e,index:l,level:i,key:r,parent:n,parentKey:o};a.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,a,r),s.push(a)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.ObjectUtils.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:I,Portal:O.default,ChevronDownIcon:u.default,SpinnerIcon:h.default,AngleRightIcon:d.default}};function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function V(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){C(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function C(e,t,i){return(t=P(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function P(e){var t=D(e,"string");return"symbol"===k(t)?t:String(t)}function D(e,t){if("object"!==k(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var E=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];return S.render=function(e,t,i,n,o,s){var l=c.resolveComponent("SpinnerIcon"),r=c.resolveComponent("CascadeSelectSub"),a=c.resolveComponent("Portal");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[c.createElementVNode("div",c.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[c.createElementVNode("input",c.mergeProps({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.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]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},V(V({},e.inputProps),e.ptm("input"))),null,16,E)],16),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},e.ptm("label")),[c.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[c.createTextVNode(c.toDisplayString(s.label),1)]}))],16),c.createElementVNode("div",c.mergeProps({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?c.renderSlot(e.$slots,"loadingicon",{key:0,class:c.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(c.openBlock(),c.createBlock(l,c.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):c.renderSlot(e.$slots,"dropdownicon",{key:1,class:c.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),c.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.searchResultMessageText),17),c.createVNode(a,{appendTo:e.appendTo},{default:c.withCtx((function(){return[c.createVNode(c.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:c.withCtx((function(){return[o.overlayVisible?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},V(V({},e.panelProps),e.ptm("panel"))),[c.createElementVNode("div",c.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[c.createVNode(r,{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:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt"])],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.selectedMessageText),17)],16)):c.createCommentVNode("",!0)]})),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)},S}(primevue.icons.angleright,primevue.icons.chevrondown,primevue.icons.spinner,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.usestyle,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.cascadeselect=function(e,t,n,i,o,s,l,r,a,c){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=p(e),u=p(t),h=p(n),f=p(i),O=p(o),v=p(l),y=p(a),b={root:function(e){return{position:"self"===e.props.appendTo?"relative":void 0}}},m=r.useStyle("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n}\n\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\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\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n",{name:"cascadeselect",manual:!0}),g={name:"BaseCascadeSelect",extends:v.default,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}},css:{classes:{root:function(e){var t=e.instance,n=e.props;return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":n.disabled,"p-focus":t.focused,"p-inputwrapper-filled":n.modelValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-overlay-open":t.overlayVisible}]},label:function(e){var t=e.instance;return["p-cascadeselect-label p-inputtext",{"p-placeholder":t.label===e.props.placeholder,"p-cascadeselect-label-empty":!t.$slots.value&&("p-emptylabel"===t.label||0===t.label.length)}]},dropdownButton:"p-cascadeselect-trigger",loadingIcon:"p-cascadeselect-trigger-icon",dropdownIcon:"p-cascadeselect-trigger-icon",panel:function(e){var t=e.instance;return["p-cascadeselect-panel p-component",{"p-input-filled":"filled"===t.$primevue.config.inputStyle,"p-ripple-disabled":!1===t.$primevue.config.ripple}]},wrapper:"p-cascadeselect-items-wrapper",list:"p-cascadeselect-panel p-cascadeselect-items",item:function(e){var t=e.instance,n=e.processedOption;return["p-cascadeselect-item",{"p-cascadeselect-item-group":t.isOptionGroup(n),"p-cascadeselect-item-active p-highlight":t.isOptionActive(n),"p-focus":t.isOptionFocused(n),"p-disabled":t.isOptionDisabled(n)}]},content:"p-cascadeselect-item-content",text:"p-cascadeselect-item-text",groupIcon:"p-cascadeselect-group-icon",sublist:"p-cascadeselect-sublist"},inlineStyles:b,loadStyle:m.load},provide:function(){return{$parentInstance:this}}},I={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:v.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:function(){s.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},position:function(){var e=this.$el.parentElement,t=s.DomHandler.getOffset(e),n=s.DomHandler.getViewport(),i=this.$el.offsetParent?this.$el.offsetWidth:s.DomHandler.getHiddenElementOuterWidth(this.$el),o=s.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+i>n.width-s.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")}},directives:{ripple:y.default},components:{AngleRightIcon:d.default}},x=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],w=["onClick"];I.render=function(e,t,n,i,o,s){var l=c.resolveComponent("AngleRightIcon"),r=c.resolveComponent("CascadeSelectSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({class:e.cx("list")},e.ptm(0===n.level?"list":"sublist")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.options,(function(t,i){return c.openBlock(),c.createElementBlock("li",c.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption: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":n.level+1,"aria-setsize":n.options.length,"aria-posinset":i+1},e.ptm("item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[c.withDirectives((c.openBlock(),c.createElementBlock("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[n.templates.option?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.templates.option),{key:0,option:t.option},null,8,["option"])):(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:e.cx("text")},e.ptm("text")),c.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[n.templates.optiongroupicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):n.optionGroupIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("groupIcon"),n.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(c.openBlock(),c.createBlock(l,c.mergeProps({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,w)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(c.openBlock(),c.createBlock(r,{key:0,role:"group",class:c.normalizeClass(e.cx("sublist")),selectId:n.selectId,focusedOptionId:n.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:n.activeOptionPath,level:n.level+1,templates:n.templates,optionLabel:n.optionLabel,optionValue:n.optionValue,optionDisabled:n.optionDisabled,optionGroupIcon:n.optionGroupIcon,optionGroupLabel:n.optionGroupLabel,optionGroupChildren:n.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])):c.createCommentVNode("",!0)],16,x)})),128))],16)};var S={name:"CascadeSelect",extends:g,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){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||s.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.ObjectUtils.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var 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&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,n=e.processedOption,i=e.isFocus,o=e.isHide;if(!s.ObjectUtils.isEmpty(n)){var l=n.index,r=n.level,a=n.parentKey,c=s.ObjectUtils.isNotEmpty(n.children),p=this.activeOptionPath.filter((function(e){return e.parentKey!==a}));p.push(n),this.focusedOptionInfo={index:l,level:r,parentKey:a},this.activeOptionPath=p,c?this.onOptionGroupSelect(t,n):this.onOptionSelect(t,n,o),i&&s.DomHandler.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,i),n&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){f.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var n=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,n),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var n=this.visibleOptions[this.focusedOptionInfo.index],i=this.activeOptionPath.find((function(e){return e.key===n.parentKey})),o=""===this.focusedOptionInfo.parentKey||i&&i.key===this.focusedOptionInfo.parentKey,l=s.ObjectUtils.isEmpty(n.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),l||(this.focusedOptionInfo={index:-1,parentKey:i?i.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return 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:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],n=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!n&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),s.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){s.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,n=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return n>-1?n+e+1:e},findPrevOptionIndex:function(e){var t=this,n=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return n>-1?n:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===n&&this.processedOptions))return null;if(s.ObjectUtils.isEmpty(e))return[];for(var i=0;i<t.length;i++){var o=t[i];if(s.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var l=this.findOptionPathByValue(e,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions:function(e,t){var n=this;this.searchValue=(this.searchValue||"")+t;var i=-1,o=!1;return-1!==(i=-1!==this.focusedOptionInfo.index?-1===(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return n.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return n.isOptionMatched(e)})):i+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return n.isOptionMatched(e)})))&&(o=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){n.searchValue="",n.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(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:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,n=s.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){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:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,l){var r=(""!==o?o+"_":"")+l,a={option:e,index:l,level:n,key:r,parent:i,parentKey:o};a.children=t.createProcessedOptions(t.getOptionGroupChildren(e,n),n+1,a,r),s.push(a)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.ObjectUtils.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),n=s.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return n?this.getOptionLabel(n.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:I,Portal:O.default,ChevronDownIcon:u.default,SpinnerIcon:h.default,AngleRightIcon:d.default}};function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=D(e,"string");return"symbol"===k(t)?t:String(t)}function D(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==k(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var E=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];return S.render=function(e,t,n,i,o,s){var l=c.resolveComponent("SpinnerIcon"),r=c.resolveComponent("CascadeSelectSub"),a=c.resolveComponent("Portal");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[c.createElementVNode("div",c.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[c.createElementVNode("input",c.mergeProps({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.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]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},V(V({},e.inputProps),e.ptm("input"))),null,16,E)],16),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},e.ptm("label")),[c.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[c.createTextVNode(c.toDisplayString(s.label),1)]}))],16),c.createElementVNode("div",c.mergeProps({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?c.renderSlot(e.$slots,"loadingicon",{key:0,class:c.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(c.openBlock(),c.createBlock(l,c.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):c.renderSlot(e.$slots,"dropdownicon",{key:1,class:c.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),c.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.searchResultMessageText),17),c.createVNode(a,{appendTo:e.appendTo},{default:c.withCtx((function(){return[c.createVNode(c.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:c.withCtx((function(){return[o.overlayVisible?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},V(V({},e.panelProps),e.ptm("panel"))),[c.createElementVNode("div",c.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[c.createVNode(r,{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:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.selectedMessageText),17)],16)):c.createCommentVNode("",!0)]})),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)},S}(primevue.icons.angleright,primevue.icons.chevrondown,primevue.icons.spinner,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.usestyle,primevue.ripple,Vue);
|
package/config/PrimeVue.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AccordionPassThroughOptions } from '../accordion';
|
|
|
3
3
|
import { AccordionTabPassThroughOptions } from '../accordiontab';
|
|
4
4
|
import { AutoCompletePassThroughOptions } from '../autocomplete';
|
|
5
5
|
import { AvatarPassThroughOptions } from '../avatar';
|
|
6
|
+
import { AvatarGroupPassThroughOptions } from '../avatargroup';
|
|
6
7
|
import { BadgePassThroughOptions } from '../badge';
|
|
7
8
|
import { BadgeDirectivePassThroughOptions } from '../badgedirective';
|
|
8
9
|
import { BlockUIPassThroughOptions } from '../blockui';
|
|
@@ -17,6 +18,7 @@ import { CheckboxPassThroughOptions } from '../checkbox';
|
|
|
17
18
|
import { ChipPassThroughOptions } from '../chip';
|
|
18
19
|
import { ChipsPassThroughOptions } from '../chips';
|
|
19
20
|
import { ColorPickerPassThroughOptions } from '../colorpicker';
|
|
21
|
+
import { ColumnPassThroughOptions } from '../column';
|
|
20
22
|
import { ColumnGroupPassThroughOptions } from '../columngroup';
|
|
21
23
|
import { ConfirmDialogPassThroughOptions } from '../confirmdialog';
|
|
22
24
|
import { ConfirmPopupPassThroughOptions } from '../confirmpopup';
|
|
@@ -59,6 +61,7 @@ import { PickListPassThroughOptions } from '../picklist';
|
|
|
59
61
|
import { ProgressBarPassThroughOptions } from '../progressbar';
|
|
60
62
|
import { ProgressSpinnerPassThroughOptions } from '../progressspinner';
|
|
61
63
|
import { RadioButtonPassThroughOptions } from '../radiobutton';
|
|
64
|
+
import { RatingPassThroughOptions } from '../rating';
|
|
62
65
|
import { RippleDirectivePassThroughOptions } from '../ripple';
|
|
63
66
|
import { RowPassThroughOptions } from '../row';
|
|
64
67
|
import { ScrollPanelPassThroughOptions } from '../scrollpanel';
|
|
@@ -66,9 +69,11 @@ import { ScrollTopPassThroughOptions } from '../scrolltop';
|
|
|
66
69
|
import { SelectButtonPassThroughOptions } from '../selectbutton';
|
|
67
70
|
import { SidebarPassThroughOptions } from '../sidebar';
|
|
68
71
|
import { SkeletonPassThroughOptions } from '../skeleton';
|
|
72
|
+
import { SliderPassThroughOptions } from '../slider';
|
|
69
73
|
import { SpeedDialPassThroughOptions } from '../speeddial';
|
|
70
74
|
import { SplitButtonPassThroughOptions } from '../splitbutton';
|
|
71
75
|
import { SplitterPassThroughOptions } from '../splitter';
|
|
76
|
+
import { SplitterPanelPassThroughOptions } from '../splitterpanel';
|
|
72
77
|
import { StepsPassThroughOptions } from '../steps';
|
|
73
78
|
import { StyleClassDirectivePassThroughOptions } from '../styleclass';
|
|
74
79
|
import { TabMenuPassThroughOptions } from '../tabmenu';
|
|
@@ -80,11 +85,13 @@ import { TextareaPassThroughOptions } from '../textarea';
|
|
|
80
85
|
import { TieredMenuPassThroughOptions } from '../tieredmenu';
|
|
81
86
|
import { TimelinePassThroughOptions } from '../timeline';
|
|
82
87
|
import { ToastPassThroughOptions } from '../toast';
|
|
88
|
+
import { ToggleButtonPassThroughOptions } from '../togglebutton';
|
|
83
89
|
import { ToolbarPassThroughOptions } from '../toolbar';
|
|
84
90
|
import { TooltipDirectivePassThroughOptions } from '../tooltip';
|
|
85
91
|
import { TreePassThroughOptions } from '../tree';
|
|
86
92
|
import { TreeSelectPassThroughOptions } from '../treeselect';
|
|
87
93
|
import { TreeTablePassThroughOptions } from '../treetable';
|
|
94
|
+
import { TriStateCheckboxPassThroughOptions } from '../tristatecheckbox';
|
|
88
95
|
import { DefaultPTOptions } from '../ts-helpers';
|
|
89
96
|
import { VirtualScrollerPassThroughOptions } from '../virtualscroller';
|
|
90
97
|
|
|
@@ -110,6 +117,7 @@ export interface PrimeVuePTOptions {
|
|
|
110
117
|
accordiontab?: DefaultPTOptions<AccordionTabPassThroughOptions>;
|
|
111
118
|
autocomplete?: DefaultPTOptions<AutoCompletePassThroughOptions>;
|
|
112
119
|
avatar?: DefaultPTOptions<AvatarPassThroughOptions>;
|
|
120
|
+
avatargroup?: DefaultPTOptions<AvatarGroupPassThroughOptions>;
|
|
113
121
|
badge?: DefaultPTOptions<BadgePassThroughOptions>;
|
|
114
122
|
blockui?: DefaultPTOptions<BlockUIPassThroughOptions>;
|
|
115
123
|
breadcrumb?: DefaultPTOptions<BreadcrumbPassThroughOptions>;
|
|
@@ -123,6 +131,7 @@ export interface PrimeVuePTOptions {
|
|
|
123
131
|
chip?: DefaultPTOptions<ChipPassThroughOptions>;
|
|
124
132
|
chips?: DefaultPTOptions<ChipsPassThroughOptions>;
|
|
125
133
|
colorpicker?: DefaultPTOptions<ColorPickerPassThroughOptions>;
|
|
134
|
+
column?: DefaultPTOptions<ColumnPassThroughOptions>;
|
|
126
135
|
columngroup?: DefaultPTOptions<ColumnGroupPassThroughOptions>;
|
|
127
136
|
confirmdialog?: DefaultPTOptions<ConfirmDialogPassThroughOptions>;
|
|
128
137
|
confirmpopup?: DefaultPTOptions<ConfirmPopupPassThroughOptions>;
|
|
@@ -165,15 +174,18 @@ export interface PrimeVuePTOptions {
|
|
|
165
174
|
progressbar?: DefaultPTOptions<ProgressBarPassThroughOptions>;
|
|
166
175
|
progressspinner?: DefaultPTOptions<ProgressSpinnerPassThroughOptions>;
|
|
167
176
|
radiobutton?: DefaultPTOptions<RadioButtonPassThroughOptions>;
|
|
177
|
+
rating?: DefaultPTOptions<RatingPassThroughOptions>;
|
|
168
178
|
row?: DefaultPTOptions<RowPassThroughOptions>;
|
|
169
179
|
scrollpanel?: DefaultPTOptions<ScrollPanelPassThroughOptions>;
|
|
170
180
|
scrolltop?: DefaultPTOptions<ScrollTopPassThroughOptions>;
|
|
171
181
|
sidebar?: DefaultPTOptions<SidebarPassThroughOptions>;
|
|
172
182
|
skeleton?: DefaultPTOptions<SkeletonPassThroughOptions>;
|
|
183
|
+
slider?: DefaultPTOptions<SliderPassThroughOptions>;
|
|
173
184
|
speeddial?: DefaultPTOptions<SpeedDialPassThroughOptions>;
|
|
174
185
|
selectbutton?: DefaultPTOptions<SelectButtonPassThroughOptions>;
|
|
175
186
|
splitbutton?: DefaultPTOptions<SplitButtonPassThroughOptions>;
|
|
176
187
|
splitter?: DefaultPTOptions<SplitterPassThroughOptions>;
|
|
188
|
+
splitterpanel?: DefaultPTOptions<SplitterPanelPassThroughOptions>;
|
|
177
189
|
steps?: DefaultPTOptions<StepsPassThroughOptions>;
|
|
178
190
|
tabmenu?: DefaultPTOptions<TabMenuPassThroughOptions>;
|
|
179
191
|
tabpanel?: DefaultPTOptions<TabPanelPassThroughOptions>;
|
|
@@ -184,9 +196,11 @@ export interface PrimeVuePTOptions {
|
|
|
184
196
|
tieredmenu?: DefaultPTOptions<TieredMenuPassThroughOptions>;
|
|
185
197
|
timeline?: DefaultPTOptions<TimelinePassThroughOptions>;
|
|
186
198
|
toast?: DefaultPTOptions<ToastPassThroughOptions>;
|
|
199
|
+
togglebutton?: DefaultPTOptions<ToggleButtonPassThroughOptions>;
|
|
187
200
|
toolbar?: DefaultPTOptions<ToolbarPassThroughOptions>;
|
|
188
201
|
tree?: DefaultPTOptions<TreePassThroughOptions>;
|
|
189
202
|
treeselect?: DefaultPTOptions<TreeSelectPassThroughOptions>;
|
|
203
|
+
tristatecheckbox?: DefaultPTOptions<TriStateCheckboxPassThroughOptions>;
|
|
190
204
|
treetable?: DefaultPTOptions<TreeTablePassThroughOptions>;
|
|
191
205
|
virtualscroller?: DefaultPTOptions<VirtualScrollerPassThroughOptions>;
|
|
192
206
|
directives?: {
|
|
@@ -141,6 +141,14 @@ export interface ContextMenuState {
|
|
|
141
141
|
* Defines current options in ContextMenu component.
|
|
142
142
|
*/
|
|
143
143
|
export interface ContextMenuContext {
|
|
144
|
+
/**
|
|
145
|
+
* Current menuitem
|
|
146
|
+
*/
|
|
147
|
+
item: any;
|
|
148
|
+
/**
|
|
149
|
+
* Index of the menuitem
|
|
150
|
+
*/
|
|
151
|
+
index: number;
|
|
144
152
|
/**
|
|
145
153
|
* Current active state of menuitem as a boolean.
|
|
146
154
|
* @defaultValue false
|
|
@@ -15,27 +15,27 @@
|
|
|
15
15
|
:aria-level="level + 1"
|
|
16
16
|
:aria-setsize="getAriaSetSize()"
|
|
17
17
|
:aria-posinset="getAriaPosInset(index)"
|
|
18
|
-
v-bind="getPTOptions(processedItem,
|
|
18
|
+
v-bind="getPTOptions('menuitem', processedItem, index)"
|
|
19
19
|
:data-p-highlight="isItemActive(processedItem)"
|
|
20
20
|
:data-p-focused="isItemFocused(processedItem)"
|
|
21
21
|
:data-p-disabled="isItemDisabled(processedItem)"
|
|
22
22
|
>
|
|
23
|
-
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" v-bind="getPTOptions(processedItem,
|
|
23
|
+
<div :class="cx('content')" @click="onItemClick($event, processedItem)" @mouseenter="onItemMouseEnter($event, processedItem)" v-bind="getPTOptions('content', processedItem, index)">
|
|
24
24
|
<template v-if="!templates.item">
|
|
25
25
|
<router-link v-if="getItemProp(processedItem, 'to') && !isItemDisabled(processedItem)" v-slot="{ navigate, href, isActive, isExactActive }" :to="getItemProp(processedItem, 'to')" custom>
|
|
26
|
-
<a v-ripple :href="href" :class="cx('action', { isActive, isExactActive })" tabindex="-1" aria-hidden="true" @click="onItemActionClick($event, navigate)" v-bind="getPTOptions(processedItem,
|
|
26
|
+
<a v-ripple :href="href" :class="cx('action', { isActive, isExactActive })" tabindex="-1" aria-hidden="true" @click="onItemActionClick($event, navigate)" v-bind="getPTOptions('action', processedItem, index)">
|
|
27
27
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" />
|
|
28
|
-
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions(processedItem,
|
|
29
|
-
<span :class="cx('label')" v-bind="getPTOptions(processedItem,
|
|
28
|
+
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions('icon', processedItem, index)" />
|
|
29
|
+
<span :class="cx('label')" v-bind="getPTOptions('label', processedItem, index)">{{ getItemLabel(processedItem) }}</span>
|
|
30
30
|
</a>
|
|
31
31
|
</router-link>
|
|
32
|
-
<a v-else v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions(processedItem,
|
|
32
|
+
<a v-else v-ripple :href="getItemProp(processedItem, 'url')" :class="cx('action')" :target="getItemProp(processedItem, 'target')" tabindex="-1" aria-hidden="true" v-bind="getPTOptions('action', processedItem, index)">
|
|
33
33
|
<component v-if="templates.itemicon" :is="templates.itemicon" :item="processedItem.item" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" />
|
|
34
|
-
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions(processedItem,
|
|
35
|
-
<span :class="cx('label')" v-bind="getPTOptions(processedItem,
|
|
34
|
+
<span v-else-if="getItemProp(processedItem, 'icon')" :class="[cx('icon'), getItemProp(processedItem, 'icon')]" v-bind="getPTOptions('icon', processedItem, index)" />
|
|
35
|
+
<span :class="cx('label')" v-bind="getPTOptions('label', processedItem, index)">{{ getItemLabel(processedItem) }}</span>
|
|
36
36
|
<template v-if="getItemProp(processedItem, 'items')">
|
|
37
37
|
<component v-if="templates.submenuicon" :is="templates.submenuicon" :active="isItemActive(processedItem)" :class="cx('submenuIcon')" />
|
|
38
|
-
<AngleRightIcon v-else :class="cx('submenuIcon')" v-bind="getPTOptions(processedItem,
|
|
38
|
+
<AngleRightIcon v-else :class="cx('submenuIcon')" v-bind="getPTOptions('submenuicon', processedItem, index)" />
|
|
39
39
|
</template>
|
|
40
40
|
</a>
|
|
41
41
|
</template>
|
|
@@ -139,11 +139,13 @@ export default {
|
|
|
139
139
|
getItemLabel(processedItem) {
|
|
140
140
|
return this.getItemProp(processedItem, 'label');
|
|
141
141
|
},
|
|
142
|
-
getPTOptions(processedItem,
|
|
142
|
+
getPTOptions(key, processedItem, index) {
|
|
143
143
|
return this.ptm(key, {
|
|
144
144
|
context: {
|
|
145
|
+
item: processedItem,
|
|
145
146
|
active: this.isItemActive(processedItem),
|
|
146
|
-
focused: this.isItemFocused(processedItem)
|
|
147
|
+
focused: this.isItemFocused(processedItem),
|
|
148
|
+
index
|
|
147
149
|
}
|
|
148
150
|
});
|
|
149
151
|
},
|