primevue 3.22.2 → 3.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/accordion/Accordion.vue +7 -3
- package/accordion/accordion.cjs.js +7 -3
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +8 -4
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +7 -3
- package/accordion/accordion.min.js +1 -1
- package/autocomplete/AutoComplete.vue +6 -3
- package/autocomplete/autocomplete.cjs.js +12 -9
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +13 -10
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +12 -9
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/Breadcrumb.vue +2 -2
- package/breadcrumb/breadcrumb.cjs.js +17 -10
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +17 -10
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +17 -10
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/cascadeselect/CascadeSelect.vue +6 -3
- package/cascadeselect/cascadeselect.cjs.js +9 -6
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +10 -7
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +9 -6
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/contextmenu/ContextMenu.vue +6 -3
- package/contextmenu/contextmenu.cjs.js +8 -5
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +9 -6
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +8 -5
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +48 -34
- package/core/core.min.js +5 -5
- package/datatable/BodyCell.vue +4 -2
- package/datatable/datatable.cjs.js +4 -2
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +4 -2
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +4 -2
- package/datatable/datatable.min.js +1 -1
- package/dock/DockSub.vue +9 -3
- package/dock/dock.cjs.js +10 -4
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +11 -5
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +10 -4
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.vue +6 -3
- package/dropdown/dropdown.cjs.js +13 -10
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +14 -11
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +13 -10
- package/dropdown/dropdown.min.js +1 -1
- package/listbox/Listbox.vue +6 -3
- package/listbox/listbox.cjs.js +11 -8
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +12 -9
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +11 -8
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.vue +7 -3
- package/megamenu/megamenu.cjs.js +10 -6
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +11 -7
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +10 -6
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.vue +8 -3
- package/menu/menu.cjs.js +13 -8
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +14 -9
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +13 -8
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.vue +7 -3
- package/menubar/menubar.cjs.js +10 -6
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +11 -7
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +10 -6
- package/menubar/menubar.min.js +1 -1
- package/multiselect/MultiSelect.vue +6 -3
- package/multiselect/multiselect.cjs.js +11 -8
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +12 -9
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +11 -8
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.vue +8 -3
- package/orderlist/orderlist.cjs.js +11 -6
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +12 -7
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +11 -6
- package/orderlist/orderlist.min.js +1 -1
- package/package.json +1 -1
- package/panelmenu/PanelMenu.vue +9 -6
- package/panelmenu/PanelMenuList.vue +1 -1
- package/panelmenu/panelmenu.cjs.js +11 -8
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +11 -8
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +11 -8
- package/panelmenu/panelmenu.min.js +1 -1
- package/picklist/PickList.vue +8 -2
- package/picklist/picklist.cjs.js +8 -2
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +9 -3
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +8 -2
- package/picklist/picklist.min.js +1 -1
- package/rating/Rating.vue +9 -3
- package/rating/rating.cjs.js +11 -5
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +12 -6
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +11 -5
- package/rating/rating.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +7 -0
- package/resources/themes/arya-green/theme.css +7 -0
- package/resources/themes/arya-orange/theme.css +7 -0
- package/resources/themes/arya-purple/theme.css +7 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +7 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +7 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +7 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +7 -0
- package/resources/themes/fluent-light/theme.css +7 -0
- package/resources/themes/lara-dark-blue/theme.css +7 -0
- package/resources/themes/lara-dark-indigo/theme.css +7 -0
- package/resources/themes/lara-dark-purple/theme.css +7 -0
- package/resources/themes/lara-dark-teal/theme.css +7 -0
- package/resources/themes/lara-light-blue/theme.css +7 -0
- package/resources/themes/lara-light-indigo/theme.css +7 -0
- package/resources/themes/lara-light-purple/theme.css +7 -0
- package/resources/themes/lara-light-teal/theme.css +7 -0
- package/resources/themes/luna-amber/theme.css +7 -0
- package/resources/themes/luna-blue/theme.css +7 -0
- package/resources/themes/luna-green/theme.css +7 -0
- package/resources/themes/luna-pink/theme.css +7 -0
- package/resources/themes/md-dark-deeppurple/theme.css +10 -2
- package/resources/themes/md-dark-indigo/theme.css +10 -2
- package/resources/themes/md-light-deeppurple/theme.css +10 -2
- package/resources/themes/md-light-indigo/theme.css +10 -2
- package/resources/themes/mdc-dark-deeppurple/theme.css +10 -2
- package/resources/themes/mdc-dark-indigo/theme.css +10 -2
- package/resources/themes/mdc-light-deeppurple/theme.css +10 -2
- package/resources/themes/mdc-light-indigo/theme.css +10 -2
- package/resources/themes/nova/theme.css +7 -0
- package/resources/themes/nova-accent/theme.css +7 -0
- package/resources/themes/nova-alt/theme.css +7 -0
- package/resources/themes/nova-vue/theme.css +7 -0
- package/resources/themes/rhea/theme.css +7 -0
- package/resources/themes/saga-blue/theme.css +7 -0
- package/resources/themes/saga-green/theme.css +7 -0
- package/resources/themes/saga-orange/theme.css +7 -0
- package/resources/themes/saga-purple/theme.css +7 -0
- package/resources/themes/tailwind-light/theme.css +7 -0
- package/resources/themes/vela-blue/theme.css +7 -0
- package/resources/themes/vela-green/theme.css +7 -0
- package/resources/themes/vela-orange/theme.css +7 -0
- package/resources/themes/vela-purple/theme.css +7 -0
- package/speeddial/SpeedDial.vue +6 -3
- package/speeddial/speeddial.cjs.js +11 -8
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +12 -9
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +11 -8
- package/speeddial/speeddial.min.js +1 -1
- package/tabview/TabView.vue +6 -3
- package/tabview/tabview.cjs.js +6 -3
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +7 -4
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +6 -3
- package/tabview/tabview.min.js +1 -1
- package/tieredmenu/TieredMenu.vue +7 -3
- package/tieredmenu/tieredmenu.cjs.js +10 -6
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +11 -7
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +10 -6
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/tooltip/tooltip.cjs.js +0 -2
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +1 -3
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +0 -2
- package/tooltip/tooltip.min.js +1 -1
- package/utils/utils.cjs.js +12 -8
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +12 -8
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +12 -8
- package/utils/utils.min.js +1 -1
- package/web-types.json +1 -1
package/dock/DockSub.vue
CHANGED
|
@@ -103,11 +103,20 @@ export default {
|
|
|
103
103
|
},
|
|
104
104
|
data() {
|
|
105
105
|
return {
|
|
106
|
+
id: this.menuId,
|
|
106
107
|
currentIndex: -3,
|
|
107
108
|
focused: false,
|
|
108
109
|
focusedOptionIndex: -1
|
|
109
110
|
};
|
|
110
111
|
},
|
|
112
|
+
watch: {
|
|
113
|
+
menuId(newValue) {
|
|
114
|
+
this.id = newValue || UniqueComponentId();
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
mounted() {
|
|
118
|
+
this.id = this.id || UniqueComponentId();
|
|
119
|
+
},
|
|
111
120
|
methods: {
|
|
112
121
|
getItemId(index) {
|
|
113
122
|
return `${this.id}_${index}`;
|
|
@@ -263,9 +272,6 @@ export default {
|
|
|
263
272
|
}
|
|
264
273
|
},
|
|
265
274
|
computed: {
|
|
266
|
-
id() {
|
|
267
|
-
return this.menuId || UniqueComponentId();
|
|
268
|
-
},
|
|
269
275
|
focusedOptionId() {
|
|
270
276
|
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
|
|
271
277
|
}
|
package/dock/dock.cjs.js
CHANGED
|
@@ -50,11 +50,20 @@ var script$1 = {
|
|
|
50
50
|
},
|
|
51
51
|
data() {
|
|
52
52
|
return {
|
|
53
|
+
id: this.menuId,
|
|
53
54
|
currentIndex: -3,
|
|
54
55
|
focused: false,
|
|
55
56
|
focusedOptionIndex: -1
|
|
56
57
|
};
|
|
57
58
|
},
|
|
59
|
+
watch: {
|
|
60
|
+
menuId(newValue) {
|
|
61
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
mounted() {
|
|
65
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
66
|
+
},
|
|
58
67
|
methods: {
|
|
59
68
|
getItemId(index) {
|
|
60
69
|
return `${this.id}_${index}`;
|
|
@@ -207,9 +216,6 @@ var script$1 = {
|
|
|
207
216
|
}
|
|
208
217
|
},
|
|
209
218
|
computed: {
|
|
210
|
-
id() {
|
|
211
|
-
return this.menuId || utils.UniqueComponentId();
|
|
212
|
-
},
|
|
213
219
|
focusedOptionId() {
|
|
214
220
|
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
|
|
215
221
|
}
|
|
@@ -235,7 +241,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
235
241
|
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
236
242
|
vue.createElementVNode("ul", {
|
|
237
243
|
ref: "list",
|
|
238
|
-
id: $
|
|
244
|
+
id: $data.id,
|
|
239
245
|
class: "p-dock-list",
|
|
240
246
|
role: "menu",
|
|
241
247
|
"aria-orientation": $props.position === 'bottom' || $props.position === 'top' ? 'horizontal' : 'vertical',
|
package/dock/dock.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/ripple"),t=require("primevue/tooltip"),n=require("primevue/utils"),i=require("vue");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),s=o(t),a={name:"DockSub",emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data
|
|
1
|
+
"use strict";var e=require("primevue/ripple"),t=require("primevue/tooltip"),n=require("primevue/utils"),i=require("vue");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),s=o(t),a={name:"DockSub",emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId(e){this.id=e||n.UniqueComponentId()}},mounted(){this.id=this.id||n.UniqueComponentId()},methods:{getItemId(e){return`${this.id}_${e}`},getItemProp:(e,t)=>e&&e.item?n.ObjectUtils.getItemValue(e.item[t]):void 0,isSameMenuItem:e=>e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest(".p-menuitem"))),onListMouseLeave(){this.currentIndex=-3},onItemMouseEnter(e){this.currentIndex=e},onItemActionClick(e,t){t&&t(e)},onItemClick(e,t){if(this.isSameMenuItem(e)){const n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey(){const e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey(){const e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey(){this.changeFocusedOptionIndex(0)},onEndKey(){this.changeFocusedOptionIndex(n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)").length-1)},onSpaceKey(){const e=n.DomHandler.findSingle(this.$refs.list,`li[id="${this.focusedOptionIndex}"]`),t=e&&n.DomHandler.findSingle(e,".p-dock-link");t?t.click():e&&e.click()},findNextOptionIndex(e){const t=[...n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[i].getAttribute("id")},itemClass(e,t,n){return["p-dock-item",{"p-focus":n===this.focusedOptionIndex,"p-disabled":this.disabled(e),"p-dock-item-second-prev":this.currentIndex-2===t,"p-dock-item-prev":this.currentIndex-1===t,"p-dock-item-current":this.currentIndex===t,"p-dock-item-next":this.currentIndex+1===t,"p-dock-item-second-next":this.currentIndex+2===t}]},linkClass(e){return["p-dock-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}};const r={class:"p-dock-list-container"},d=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],c=["id","aria-label","aria-disabled","onClick","onMouseenter"],p={class:"p-menuitem-content"},u=["href","target","onClick"],m=["href","target"];a.render=function(e,t,n,o,l,s){const a=i.resolveComponent("router-link"),f=i.resolveDirective("ripple"),k=i.resolveDirective("tooltip");return i.openBlock(),i.createElementBlock("div",r,[i.createElementVNode("ul",{ref:"list",id:l.id,class:"p-dock-list",role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":l.focused?s.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>s.onListFocus&&s.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onListBlur&&s.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onListKeyDown&&s.onListKeyDown(...e)),onMouseleave:t[3]||(t[3]=(...e)=>s.onListMouseLeave&&s.onListMouseLeave(...e))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.model,((e,t)=>(i.openBlock(),i.createElementBlock("li",{key:t,id:s.getItemId(t),class:i.normalizeClass(s.itemClass(e,t,s.getItemId(t))),role:"menuitem","aria-label":e.label,"aria-disabled":s.disabled(e),onClick:t=>s.onItemClick(t,e),onMouseenter:e=>s.onItemMouseEnter(t)},[i.createElementVNode("div",p,[n.templates.item?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.templates.item),{key:1,item:e,index:t},null,8,["item","index"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[e.to&&!s.disabled(e)?(i.openBlock(),i.createBlock(a,{key:0,to:e.to,custom:""},{default:i.withCtx((({navigate:t,href:o,isActive:l,isExactActive:a})=>[i.withDirectives((i.openBlock(),i.createElementBlock("a",{href:o,class:i.normalizeClass(s.linkClass({isActive:l,isExactActive:a})),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:n=>s.onItemActionClick(n,e,t)},[n.templates.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.templates.icon),{key:1,item:e},null,8,["item"])):i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["p-dock-icon",e.icon])},null,2)),[[f]])],10,u)),[[k,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])])),_:2},1032,["to"])):i.withDirectives((i.openBlock(),i.createElementBlock("a",{key:1,href:e.url,class:i.normalizeClass(s.linkClass()),target:e.target,tabindex:"-1","aria-hidden":"true"},[n.templates.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.templates.icon),{key:1,item:e},null,8,["item"])):i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["p-dock-icon",e.icon])},null,2)),[[f]])],10,m)),[[k,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))])],42,c)))),128))],40,d)])};var f={name:"Dock",props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},computed:{containerClass(){return["p-dock p-component",`p-dock-${this.position}`,this.class]}},components:{DockSub:a}};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n"),f.render=function(e,t,n,o,l,s){const a=i.resolveComponent("DockSub");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.containerClass),style:i.normalizeStyle(n.style)},[i.createVNode(a,{model:n.model,templates:e.$slots,exact:n.exact,tooltipOptions:n.tooltipOptions,position:n.position,menuId:n.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:n.tabindex},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex"])],6)},module.exports=f;
|
package/dock/dock.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Ripple from 'primevue/ripple';
|
|
2
2
|
import Tooltip from 'primevue/tooltip';
|
|
3
|
-
import { ObjectUtils, DomHandler
|
|
3
|
+
import { UniqueComponentId, ObjectUtils, DomHandler } from 'primevue/utils';
|
|
4
4
|
import { resolveComponent, resolveDirective, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, createBlock, withCtx, withDirectives, resolveDynamicComponent, normalizeStyle, createVNode } from 'vue';
|
|
5
5
|
|
|
6
6
|
var script$1 = {
|
|
@@ -43,11 +43,20 @@ var script$1 = {
|
|
|
43
43
|
},
|
|
44
44
|
data() {
|
|
45
45
|
return {
|
|
46
|
+
id: this.menuId,
|
|
46
47
|
currentIndex: -3,
|
|
47
48
|
focused: false,
|
|
48
49
|
focusedOptionIndex: -1
|
|
49
50
|
};
|
|
50
51
|
},
|
|
52
|
+
watch: {
|
|
53
|
+
menuId(newValue) {
|
|
54
|
+
this.id = newValue || UniqueComponentId();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
mounted() {
|
|
58
|
+
this.id = this.id || UniqueComponentId();
|
|
59
|
+
},
|
|
51
60
|
methods: {
|
|
52
61
|
getItemId(index) {
|
|
53
62
|
return `${this.id}_${index}`;
|
|
@@ -200,9 +209,6 @@ var script$1 = {
|
|
|
200
209
|
}
|
|
201
210
|
},
|
|
202
211
|
computed: {
|
|
203
|
-
id() {
|
|
204
|
-
return this.menuId || UniqueComponentId();
|
|
205
|
-
},
|
|
206
212
|
focusedOptionId() {
|
|
207
213
|
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
|
|
208
214
|
}
|
|
@@ -228,7 +234,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
228
234
|
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
229
235
|
createElementVNode("ul", {
|
|
230
236
|
ref: "list",
|
|
231
|
-
id: $
|
|
237
|
+
id: $data.id,
|
|
232
238
|
class: "p-dock-list",
|
|
233
239
|
role: "menu",
|
|
234
240
|
"aria-orientation": $props.position === 'bottom' || $props.position === 'top' ? 'horizontal' : 'vertical',
|
package/dock/dock.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/ripple";import t from"primevue/tooltip";import{
|
|
1
|
+
import e from"primevue/ripple";import t from"primevue/tooltip";import{UniqueComponentId as n,ObjectUtils as i,DomHandler as o}from"primevue/utils";import{resolveComponent as s,resolveDirective as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as c,renderList as p,normalizeClass as u,createBlock as m,withCtx as f,withDirectives as h,resolveDynamicComponent as b,normalizeStyle as k,createVNode as x}from"vue";var y={name:"DockSub",emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId(e){this.id=e||n()}},mounted(){this.id=this.id||n()},methods:{getItemId(e){return`${this.id}_${e}`},getItemProp:(e,t)=>e&&e.item?i.getItemValue(e.item[t]):void 0,isSameMenuItem:e=>e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest(".p-menuitem"))),onListMouseLeave(){this.currentIndex=-3},onItemMouseEnter(e){this.currentIndex=e},onItemActionClick(e,t){t&&t(e)},onItemClick(e,t){if(this.isSameMenuItem(e)){const n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey(){const e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey(){const e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey(){this.changeFocusedOptionIndex(0)},onEndKey(){this.changeFocusedOptionIndex(o.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)").length-1)},onSpaceKey(){const e=o.findSingle(this.$refs.list,`li[id="${this.focusedOptionIndex}"]`),t=e&&o.findSingle(e,".p-dock-link");t?t.click():e&&e.click()},findNextOptionIndex(e){const t=[...o.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...o.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=o.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)");let n=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[n].getAttribute("id")},itemClass(e,t,n){return["p-dock-item",{"p-focus":n===this.focusedOptionIndex,"p-disabled":this.disabled(e),"p-dock-item-second-prev":this.currentIndex-2===t,"p-dock-item-prev":this.currentIndex-1===t,"p-dock-item-current":this.currentIndex===t,"p-dock-item-next":this.currentIndex+1===t,"p-dock-item-second-next":this.currentIndex+2===t}]},linkClass(e){return["p-dock-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:e,tooltip:t}};const g={class:"p-dock-list-container"},I=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],v=["id","aria-label","aria-disabled","onClick","onMouseenter"],O={class:"p-menuitem-content"},w=["href","target","onClick"],S=["href","target"];y.render=function(e,t,n,i,o,k){const x=s("router-link"),y=l("ripple"),A=l("tooltip");return a(),d("div",g,[r("ul",{ref:"list",id:o.id,class:"p-dock-list",role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":o.focused?k.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>k.onListFocus&&k.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>k.onListBlur&&k.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>k.onListKeyDown&&k.onListKeyDown(...e)),onMouseleave:t[3]||(t[3]=(...e)=>k.onListMouseLeave&&k.onListMouseLeave(...e))},[(a(!0),d(c,null,p(n.model,((e,t)=>(a(),d("li",{key:t,id:k.getItemId(t),class:u(k.itemClass(e,t,k.getItemId(t))),role:"menuitem","aria-label":e.label,"aria-disabled":k.disabled(e),onClick:t=>k.onItemClick(t,e),onMouseenter:e=>k.onItemMouseEnter(t)},[r("div",O,[n.templates.item?(a(),m(b(n.templates.item),{key:1,item:e,index:t},null,8,["item","index"])):(a(),d(c,{key:0},[e.to&&!k.disabled(e)?(a(),m(x,{key:0,to:e.to,custom:""},{default:f((({navigate:t,href:i,isActive:o,isExactActive:s})=>[h((a(),d("a",{href:i,class:u(k.linkClass({isActive:o,isExactActive:s})),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:n=>k.onItemActionClick(n,e,t)},[n.templates.icon?(a(),m(b(n.templates.icon),{key:1,item:e},null,8,["item"])):h((a(),d("span",{key:0,class:u(["p-dock-icon",e.icon])},null,2)),[[y]])],10,w)),[[A,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])])),_:2},1032,["to"])):h((a(),d("a",{key:1,href:e.url,class:u(k.linkClass()),target:e.target,tabindex:"-1","aria-hidden":"true"},[n.templates.icon?(a(),m(b(n.templates.icon),{key:1,item:e},null,8,["item"])):h((a(),d("span",{key:0,class:u(["p-dock-icon",e.icon])},null,2)),[[y]])],10,S)),[[A,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))])],42,v)))),128))],40,I)])};var A={name:"Dock",props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},computed:{containerClass(){return["p-dock p-component",`p-dock-${this.position}`,this.class]}},components:{DockSub:y}};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n"),A.render=function(e,t,n,i,o,l){const r=s("DockSub");return a(),d("div",{class:u(l.containerClass),style:k(n.style)},[x(r,{model:n.model,templates:e.$slots,exact:n.exact,tooltipOptions:n.tooltipOptions,position:n.position,menuId:n.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:n.tabindex},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex"])],6)};export{A as default};
|
package/dock/dock.js
CHANGED
|
@@ -47,11 +47,20 @@ this.primevue.dock = (function (Ripple, Tooltip, utils, vue) {
|
|
|
47
47
|
},
|
|
48
48
|
data() {
|
|
49
49
|
return {
|
|
50
|
+
id: this.menuId,
|
|
50
51
|
currentIndex: -3,
|
|
51
52
|
focused: false,
|
|
52
53
|
focusedOptionIndex: -1
|
|
53
54
|
};
|
|
54
55
|
},
|
|
56
|
+
watch: {
|
|
57
|
+
menuId(newValue) {
|
|
58
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
mounted() {
|
|
62
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
63
|
+
},
|
|
55
64
|
methods: {
|
|
56
65
|
getItemId(index) {
|
|
57
66
|
return `${this.id}_${index}`;
|
|
@@ -204,9 +213,6 @@ this.primevue.dock = (function (Ripple, Tooltip, utils, vue) {
|
|
|
204
213
|
}
|
|
205
214
|
},
|
|
206
215
|
computed: {
|
|
207
|
-
id() {
|
|
208
|
-
return this.menuId || utils.UniqueComponentId();
|
|
209
|
-
},
|
|
210
216
|
focusedOptionId() {
|
|
211
217
|
return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
|
|
212
218
|
}
|
|
@@ -232,7 +238,7 @@ this.primevue.dock = (function (Ripple, Tooltip, utils, vue) {
|
|
|
232
238
|
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
233
239
|
vue.createElementVNode("ul", {
|
|
234
240
|
ref: "list",
|
|
235
|
-
id: $
|
|
241
|
+
id: $data.id,
|
|
236
242
|
class: "p-dock-list",
|
|
237
243
|
role: "menu",
|
|
238
244
|
"aria-orientation": $props.position === 'bottom' || $props.position === 'top' ? 'horizontal' : 'vertical',
|
package/dock/dock.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.dock=function(e,t,n,i){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),s=o(t),a={name:"DockSub",emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.dock=function(e,t,n,i){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),s=o(t),a={name:"DockSub",emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId(e){this.id=e||n.UniqueComponentId()}},mounted(){this.id=this.id||n.UniqueComponentId()},methods:{getItemId(e){return`${this.id}_${e}`},getItemProp:(e,t)=>e&&e.item?n.ObjectUtils.getItemValue(e.item[t]):void 0,isSameMenuItem:e=>e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest(".p-menuitem"))),onListMouseLeave(){this.currentIndex=-3},onItemMouseEnter(e){this.currentIndex=e},onItemActionClick(e,t){t&&t(e)},onItemClick(e,t){if(this.isSameMenuItem(e)){const n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey(){const e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey(){const e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey(){this.changeFocusedOptionIndex(0)},onEndKey(){this.changeFocusedOptionIndex(n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)").length-1)},onSpaceKey(){const e=n.DomHandler.findSingle(this.$refs.list,`li[id="${this.focusedOptionIndex}"]`),t=e&&n.DomHandler.findSingle(e,".p-dock-link");t?t.click():e&&e.click()},findNextOptionIndex(e){const t=[...n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=n.DomHandler.find(this.$refs.list,"li.p-dock-item:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;this.focusedOptionIndex=t[i].getAttribute("id")},itemClass(e,t,n){return["p-dock-item",{"p-focus":n===this.focusedOptionIndex,"p-disabled":this.disabled(e),"p-dock-item-second-prev":this.currentIndex-2===t,"p-dock-item-prev":this.currentIndex-1===t,"p-dock-item-current":this.currentIndex===t,"p-dock-item-next":this.currentIndex+1===t,"p-dock-item-second-next":this.currentIndex+2===t}]},linkClass(e){return["p-dock-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}};const r={class:"p-dock-list-container"},c=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],d=["id","aria-label","aria-disabled","onClick","onMouseenter"],p={class:"p-menuitem-content"},u=["href","target","onClick"],m=["href","target"];a.render=function(e,t,n,o,l,s){const a=i.resolveComponent("router-link"),f=i.resolveDirective("ripple"),h=i.resolveDirective("tooltip");return i.openBlock(),i.createElementBlock("div",r,[i.createElementVNode("ul",{ref:"list",id:l.id,class:"p-dock-list",role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":l.focused?s.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>s.onListFocus&&s.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onListBlur&&s.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onListKeyDown&&s.onListKeyDown(...e)),onMouseleave:t[3]||(t[3]=(...e)=>s.onListMouseLeave&&s.onListMouseLeave(...e))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.model,((e,t)=>(i.openBlock(),i.createElementBlock("li",{key:t,id:s.getItemId(t),class:i.normalizeClass(s.itemClass(e,t,s.getItemId(t))),role:"menuitem","aria-label":e.label,"aria-disabled":s.disabled(e),onClick:t=>s.onItemClick(t,e),onMouseenter:e=>s.onItemMouseEnter(t)},[i.createElementVNode("div",p,[n.templates.item?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.templates.item),{key:1,item:e,index:t},null,8,["item","index"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[e.to&&!s.disabled(e)?(i.openBlock(),i.createBlock(a,{key:0,to:e.to,custom:""},{default:i.withCtx((({navigate:t,href:o,isActive:l,isExactActive:a})=>[i.withDirectives((i.openBlock(),i.createElementBlock("a",{href:o,class:i.normalizeClass(s.linkClass({isActive:l,isExactActive:a})),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:n=>s.onItemActionClick(n,e,t)},[n.templates.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.templates.icon),{key:1,item:e},null,8,["item"])):i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["p-dock-icon",e.icon])},null,2)),[[f]])],10,u)),[[h,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])])),_:2},1032,["to"])):i.withDirectives((i.openBlock(),i.createElementBlock("a",{key:1,href:e.url,class:i.normalizeClass(s.linkClass()),target:e.target,tabindex:"-1","aria-hidden":"true"},[n.templates.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.templates.icon),{key:1,item:e},null,8,["item"])):i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["p-dock-icon",e.icon])},null,2)),[[f]])],10,m)),[[h,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))])],42,d)))),128))],40,c)])};var f={name:"Dock",props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},computed:{containerClass(){return["p-dock p-component",`p-dock-${this.position}`,this.class]}},components:{DockSub:a}};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n"),f.render=function(e,t,n,o,l,s){const a=i.resolveComponent("DockSub");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.containerClass),style:i.normalizeStyle(n.style)},[i.createVNode(a,{model:n.model,templates:e.$slots,exact:n.exact,tooltipOptions:n.tooltipOptions,position:n.position,menuId:n.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:n.tabindex},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex"])],6)},f}(primevue.ripple,primevue.tooltip,primevue.utils,Vue);
|
package/dropdown/Dropdown.vue
CHANGED
|
@@ -308,6 +308,7 @@ export default {
|
|
|
308
308
|
focusOnHover: false,
|
|
309
309
|
data() {
|
|
310
310
|
return {
|
|
311
|
+
id: this.$attrs.id,
|
|
311
312
|
focused: false,
|
|
312
313
|
focusedOptionIndex: -1,
|
|
313
314
|
filterValue: null,
|
|
@@ -315,6 +316,9 @@ export default {
|
|
|
315
316
|
};
|
|
316
317
|
},
|
|
317
318
|
watch: {
|
|
319
|
+
'$attrs.id': function (newValue) {
|
|
320
|
+
this.id = newValue || UniqueComponentId();
|
|
321
|
+
},
|
|
318
322
|
modelValue() {
|
|
319
323
|
this.isModelValueChanged = true;
|
|
320
324
|
},
|
|
@@ -323,6 +327,8 @@ export default {
|
|
|
323
327
|
}
|
|
324
328
|
},
|
|
325
329
|
mounted() {
|
|
330
|
+
this.id = this.id || UniqueComponentId();
|
|
331
|
+
|
|
326
332
|
this.autoUpdateModel();
|
|
327
333
|
},
|
|
328
334
|
updated() {
|
|
@@ -1025,9 +1031,6 @@ export default {
|
|
|
1025
1031
|
selectedMessageText() {
|
|
1026
1032
|
return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
|
|
1027
1033
|
},
|
|
1028
|
-
id() {
|
|
1029
|
-
return this.$attrs.id || UniqueComponentId();
|
|
1030
|
-
},
|
|
1031
1034
|
focusedOptionId() {
|
|
1032
1035
|
return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
|
|
1033
1036
|
},
|
package/dropdown/dropdown.cjs.js
CHANGED
|
@@ -180,6 +180,7 @@ var script = {
|
|
|
180
180
|
focusOnHover: false,
|
|
181
181
|
data() {
|
|
182
182
|
return {
|
|
183
|
+
id: this.$attrs.id,
|
|
183
184
|
focused: false,
|
|
184
185
|
focusedOptionIndex: -1,
|
|
185
186
|
filterValue: null,
|
|
@@ -187,6 +188,9 @@ var script = {
|
|
|
187
188
|
};
|
|
188
189
|
},
|
|
189
190
|
watch: {
|
|
191
|
+
'$attrs.id': function (newValue) {
|
|
192
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
193
|
+
},
|
|
190
194
|
modelValue() {
|
|
191
195
|
this.isModelValueChanged = true;
|
|
192
196
|
},
|
|
@@ -195,6 +199,8 @@ var script = {
|
|
|
195
199
|
}
|
|
196
200
|
},
|
|
197
201
|
mounted() {
|
|
202
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
203
|
+
|
|
198
204
|
this.autoUpdateModel();
|
|
199
205
|
},
|
|
200
206
|
updated() {
|
|
@@ -891,9 +897,6 @@ var script = {
|
|
|
891
897
|
selectedMessageText() {
|
|
892
898
|
return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
|
|
893
899
|
},
|
|
894
|
-
id() {
|
|
895
|
-
return this.$attrs.id || utils.UniqueComponentId();
|
|
896
|
-
},
|
|
897
900
|
focusedOptionId() {
|
|
898
901
|
return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
|
|
899
902
|
},
|
|
@@ -960,7 +963,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
960
963
|
|
|
961
964
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
962
965
|
ref: "container",
|
|
963
|
-
id: $
|
|
966
|
+
id: $data.id,
|
|
964
967
|
class: vue.normalizeClass($options.containerClass),
|
|
965
968
|
onClick: _cache[16] || (_cache[16] = (...args) => ($options.onContainerClick && $options.onContainerClick(...args)))
|
|
966
969
|
}, [
|
|
@@ -982,7 +985,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
982
985
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
983
986
|
"aria-haspopup": "listbox",
|
|
984
987
|
"aria-expanded": $data.overlayVisible,
|
|
985
|
-
"aria-controls": $
|
|
988
|
+
"aria-controls": $data.id + '_list',
|
|
986
989
|
"aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
|
|
987
990
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
988
991
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
|
|
@@ -1001,7 +1004,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1001
1004
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
1002
1005
|
"aria-haspopup": "listbox",
|
|
1003
1006
|
"aria-expanded": $data.overlayVisible,
|
|
1004
|
-
"aria-controls": $
|
|
1007
|
+
"aria-controls": $data.id + '_list',
|
|
1005
1008
|
"aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
|
|
1006
1009
|
"aria-disabled": $props.disabled,
|
|
1007
1010
|
onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
@@ -1073,7 +1076,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1073
1076
|
placeholder: $props.filterPlaceholder,
|
|
1074
1077
|
role: "searchbox",
|
|
1075
1078
|
autocomplete: "off",
|
|
1076
|
-
"aria-owns": $
|
|
1079
|
+
"aria-owns": $data.id + '_list',
|
|
1077
1080
|
"aria-activedescendant": $options.focusedOptionId,
|
|
1078
1081
|
onKeydown: _cache[10] || (_cache[10] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
|
|
1079
1082
|
onBlur: _cache[11] || (_cache[11] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
|
|
@@ -1099,7 +1102,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1099
1102
|
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
|
|
1100
1103
|
vue.createElementVNode("ul", {
|
|
1101
1104
|
ref: (el) => $options.listRef(el, contentRef),
|
|
1102
|
-
id: $
|
|
1105
|
+
id: $data.id + '_list',
|
|
1103
1106
|
class: vue.normalizeClass(['p-dropdown-items', styleClass]),
|
|
1104
1107
|
style: vue.normalizeStyle(contentStyle),
|
|
1105
1108
|
role: "listbox"
|
|
@@ -1111,7 +1114,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1111
1114
|
($options.isOptionGroup(option))
|
|
1112
1115
|
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
1113
1116
|
key: 0,
|
|
1114
|
-
id: $
|
|
1117
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1115
1118
|
style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
1116
1119
|
class: "p-dropdown-item-group",
|
|
1117
1120
|
role: "option"
|
|
@@ -1125,7 +1128,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1125
1128
|
], 12, _hoisted_10))
|
|
1126
1129
|
: vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
|
|
1127
1130
|
key: 1,
|
|
1128
|
-
id: $
|
|
1131
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1129
1132
|
style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
1130
1133
|
class: vue.normalizeClass(['p-dropdown-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
|
|
1131
1134
|
role: "option",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/api"),t=require("primevue/overlayeventbus"),i=require("primevue/portal"),n=require("primevue/ripple"),o=require("primevue/utils"),s=require("primevue/virtualscroller"),l=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(t),d=r(i),p=r(n),c=r(s),u={name:"Dropdown",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data:()=>({focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}),watch:{modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(o.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?o.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?o.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?o.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&o.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&o.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&o.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key))}},onEditableInput(e){const t=e.target.value;this.searchValue="";!this.searchOptions(e,t)&&(this.focusedOptionIndex=-1),this.$emit("update:modelValue",t)},onContainerClick(e){this.disabled||this.loading||o.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick(e){this.updateModel(e,null)},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?o.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;o.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?o.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;o.DomHandler.focus(t)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.updateModel(e,n),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){a.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){t?(e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),e.preventDefault()},onEndKey(e,t=!1){if(t){const t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onSpaceKey(e,t=!1){!t&&this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(o.DomHandler.focus(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey(e,t=!1){t&&!this.overlayVisible&&this.show()},onOverlayEnter(e){o.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&o.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){o.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?o.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=o.DomHandler.getOuterWidth(this.$el)+"px",o.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!o.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return o.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionIndex?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionIndex&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=o.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-dropdown p-component p-inputwrapper",{"p-disabled":this.disabled,"p-dropdown-clearable":this.showClear&&!this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-dropdown-label p-inputtext",this.inputClass,{"p-placeholder":!this.editable&&this.label===this.placeholder,"p-dropdown-label-empty":!(this.editable||this.$slots.value||"p-emptylabel"!==this.label&&0!==this.label.length)}]},panelStyleClass(){return["p-dropdown-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-dropdown-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const n=e.items.filter((e=>i.includes(e)));n.length>0&&t.push({...e,items:[...n]})})),this.flatOptions(t)}return i}return t},hasSelectedOption(){return o.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.placeholder||"p-emptylabel"},editableInputValue(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.modelValue||""},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return o.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},id(){return this.$attrs.id||o.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:p.default},components:{VirtualScroller:c.default,Portal:d.default}};const h=["id"],f=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],y=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],b={class:"p-dropdown-trigger"},v={key:0,class:"p-dropdown-header"},m={class:"p-dropdown-filter-container"},O=["value","placeholder","aria-owns","aria-activedescendant"],g={role:"status","aria-live":"polite",class:"p-hidden-accessible"},x=["id"],w=["id"],I=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],S={key:0,class:"p-dropdown-empty-message",role:"option"},V={key:1,class:"p-dropdown-empty-message",role:"option"},k={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},F={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-dropdown-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-dropdown-label-empty {\n overflow: hidden;\n opacity: 0;\n}\ninput.p-dropdown-label {\n cursor: default;\n}\n.p-dropdown .p-dropdown-panel {\n min-width: 100%;\n}\n.p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-dropdown-items-wrapper {\n overflow: auto;\n}\n.p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-dropdown-item-group {\n cursor: auto;\n}\n.p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-dropdown-filter {\n width: 100%;\n}\n.p-dropdown-filter-container {\n position: relative;\n}\n.p-dropdown-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-fluid .p-dropdown {\n display: flex;\n}\n.p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n}\n"),u.render=function(e,t,i,n,o,s){const r=l.resolveComponent("VirtualScroller"),a=l.resolveComponent("Portal"),d=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",{ref:"container",id:s.id,class:l.normalizeClass(s.containerClass),onClick:t[16]||(t[16]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.editable?(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.editableInputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onEditableInput&&s.onEditableInput(...e))},i.inputProps),null,16,f)):(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:s.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===s.label?void 0:s.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[4]||(t[4]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[6]||(t[6]=(...e)=>s.onKeyDown&&s.onKeyDown(...e))},i.inputProps),[l.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[l.createTextVNode(l.toDisplayString("p-emptylabel"===s.label?" ":s.label||"empty"),1)]))],16,y)),i.showClear&&null!=i.modelValue?(l.openBlock(),l.createElementBlock("i",l.mergeProps({key:2,class:["p-dropdown-clear-icon",i.clearIcon],onClick:t[7]||(t[7]=(...e)=>s.onClearClick&&s.onClearClick(...e))},i.clearIconProps),null,16)):l.createCommentVNode("",!0),l.createElementVNode("div",b,[l.renderSlot(e.$slots,"indicator",{},(()=>[l.createElementVNode("span",{class:l.normalizeClass(s.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),l.createVNode(a,{appendTo:i.appendTo},{default:l.withCtx((()=>[l.createVNode(l.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:l.withCtx((()=>[o.overlayVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.overlayRef,style:i.panelStyle,class:s.panelStyleClass,onClick:t[14]||(t[14]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[15]||(t[15]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[l.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[8]||(t[8]=(...e)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...e))},null,544),l.renderSlot(e.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.filter?(l.openBlock(),l.createElementBlock("div",v,[l.createElementVNode("div",m,[l.createElementVNode("input",l.mergeProps({ref:"filterInput",type:"text",value:o.filterValue,onVnodeUpdated:t[9]||(t[9]=(...e)=>s.onFilterUpdated&&s.onFilterUpdated(...e)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":s.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:t[10]||(t[10]=(...e)=>s.onFilterKeyDown&&s.onFilterKeyDown(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onFilterBlur&&s.onFilterBlur(...e)),onInput:t[12]||(t[12]=(...e)=>s.onFilterChange&&s.onFilterChange(...e))},i.filterInputProps),null,16,O),l.createElementVNode("span",{class:l.normalizeClass(["p-dropdown-filter-icon",i.filterIcon])},null,2)]),l.createElementVNode("span",g,l.toDisplayString(s.filterResultMessageText),1)])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"p-dropdown-items-wrapper",style:l.normalizeStyle({"max-height":s.virtualScrollerDisabled?i.scrollHeight:""})},[l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled}),l.createSlots({content:l.withCtx((({styleClass:t,contentRef:n,items:r,getItemOptions:a,contentStyle:p,itemSize:c})=>[l.createElementVNode("ul",{ref:e=>s.listRef(e,n),id:s.id+"_list",class:l.normalizeClass(["p-dropdown-items",t]),style:l.normalizeStyle(p),role:"listbox"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r,((t,i)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,a))},[s.isOptionGroup(t)?(l.openBlock(),l.createElementBlock("li",{key:0,id:s.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:c?c+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[l.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,w)):l.withDirectives((l.openBlock(),l.createElementBlock("li",{key:1,id:s.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:c?c+"px":void 0}),class:l.normalizeClass(["p-dropdown-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,a),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,a)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,a))},[l.renderSlot(e.$slots,"option",{option:t,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionLabel(t)),1)]))],46,I)),[[d]])],64)))),128)),o.filterValue&&(!r||r&&0===r.length)?(l.openBlock(),l.createElementBlock("li",S,[l.renderSlot(e.$slots,"emptyfilter",{},(()=>[l.createTextVNode(l.toDisplayString(s.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(l.openBlock(),l.createElementBlock("li",V,[l.renderSlot(e.$slots,"empty",{},(()=>[l.createTextVNode(l.toDisplayString(s.emptyMessageText),1)]))])):l.createCommentVNode("",!0)],14,x)])),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((({options:t})=>[l.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),l.renderSlot(e.$slots,"footer",{value:i.modelValue,options:s.visibleOptions}),!i.options||i.options&&0===i.options.length?(l.openBlock(),l.createElementBlock("span",k,l.toDisplayString(s.emptyMessageText),1)):l.createCommentVNode("",!0),l.createElementVNode("span",F,l.toDisplayString(s.selectedMessageText),1),l.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[13]||(t[13]=(...e)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...e))},null,544)],16)):l.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],10,h)},module.exports=u;
|
|
1
|
+
"use strict";var e=require("primevue/api"),t=require("primevue/overlayeventbus"),i=require("primevue/portal"),n=require("primevue/ripple"),o=require("primevue/utils"),s=require("primevue/virtualscroller"),l=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(t),d=r(i),p=r(n),c=r(s),u={name:"Dropdown",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||o.UniqueComponentId(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(o.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?o.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?o.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?o.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&o.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&o.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&o.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key))}},onEditableInput(e){const t=e.target.value;this.searchValue="";!this.searchOptions(e,t)&&(this.focusedOptionIndex=-1),this.$emit("update:modelValue",t)},onContainerClick(e){this.disabled||this.loading||o.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||"INPUT"===e.target.tagName||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick(e){this.updateModel(e,null)},onFirstHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?o.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;o.DomHandler.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?o.DomHandler.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;o.DomHandler.focus(t)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.updateModel(e,n),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){a.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){t?(e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),e.preventDefault()},onEndKey(e,t=!1){if(t){const t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onSpaceKey(e,t=!1){!t&&this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(o.DomHandler.focus(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey(e,t=!1){t&&!this.overlayVisible&&this.show()},onOverlayEnter(e){o.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&o.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){o.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?o.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=o.DomHandler.getOuterWidth(this.$el)+"px",o.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!o.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return o.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionIndex?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionIndex&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=o.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-dropdown p-component p-inputwrapper",{"p-disabled":this.disabled,"p-dropdown-clearable":this.showClear&&!this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-dropdown-label p-inputtext",this.inputClass,{"p-placeholder":!this.editable&&this.label===this.placeholder,"p-dropdown-label-empty":!(this.editable||this.$slots.value||"p-emptylabel"!==this.label&&0!==this.label.length)}]},panelStyleClass(){return["p-dropdown-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-dropdown-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const i=e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const n=e.items.filter((e=>i.includes(e)));n.length>0&&t.push({...e,items:[...n]})})),this.flatOptions(t)}return i}return t},hasSelectedOption(){return o.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.placeholder||"p-emptylabel"},editableInputValue(){const e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.modelValue||""},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return o.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:p.default},components:{VirtualScroller:c.default,Portal:d.default}};const h=["id"],f=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],y=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],b={class:"p-dropdown-trigger"},v={key:0,class:"p-dropdown-header"},m={class:"p-dropdown-filter-container"},O=["value","placeholder","aria-owns","aria-activedescendant"],g={role:"status","aria-live":"polite",class:"p-hidden-accessible"},x=["id"],I=["id"],w=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],S={key:0,class:"p-dropdown-empty-message",role:"option"},V={key:1,class:"p-dropdown-empty-message",role:"option"},k={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},F={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-dropdown {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-dropdown-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-dropdown-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-dropdown-label-empty {\n overflow: hidden;\n opacity: 0;\n}\ninput.p-dropdown-label {\n cursor: default;\n}\n.p-dropdown .p-dropdown-panel {\n min-width: 100%;\n}\n.p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-dropdown-items-wrapper {\n overflow: auto;\n}\n.p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-dropdown-item-group {\n cursor: auto;\n}\n.p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-dropdown-filter {\n width: 100%;\n}\n.p-dropdown-filter-container {\n position: relative;\n}\n.p-dropdown-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-fluid .p-dropdown {\n display: flex;\n}\n.p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n}\n"),u.render=function(e,t,i,n,o,s){const r=l.resolveComponent("VirtualScroller"),a=l.resolveComponent("Portal"),d=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",{ref:"container",id:o.id,class:l.normalizeClass(s.containerClass),onClick:t[16]||(t[16]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.editable?(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.editableInputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onEditableInput&&s.onEditableInput(...e))},i.inputProps),null,16,f)):(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:s.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===s.label?void 0:s.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[4]||(t[4]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[6]||(t[6]=(...e)=>s.onKeyDown&&s.onKeyDown(...e))},i.inputProps),[l.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[l.createTextVNode(l.toDisplayString("p-emptylabel"===s.label?" ":s.label||"empty"),1)]))],16,y)),i.showClear&&null!=i.modelValue?(l.openBlock(),l.createElementBlock("i",l.mergeProps({key:2,class:["p-dropdown-clear-icon",i.clearIcon],onClick:t[7]||(t[7]=(...e)=>s.onClearClick&&s.onClearClick(...e))},i.clearIconProps),null,16)):l.createCommentVNode("",!0),l.createElementVNode("div",b,[l.renderSlot(e.$slots,"indicator",{},(()=>[l.createElementVNode("span",{class:l.normalizeClass(s.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),l.createVNode(a,{appendTo:i.appendTo},{default:l.withCtx((()=>[l.createVNode(l.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:l.withCtx((()=>[o.overlayVisible?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:s.overlayRef,style:i.panelStyle,class:s.panelStyleClass,onClick:t[14]||(t[14]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[15]||(t[15]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[l.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[8]||(t[8]=(...e)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...e))},null,544),l.renderSlot(e.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.filter?(l.openBlock(),l.createElementBlock("div",v,[l.createElementVNode("div",m,[l.createElementVNode("input",l.mergeProps({ref:"filterInput",type:"text",value:o.filterValue,onVnodeUpdated:t[9]||(t[9]=(...e)=>s.onFilterUpdated&&s.onFilterUpdated(...e)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:t[10]||(t[10]=(...e)=>s.onFilterKeyDown&&s.onFilterKeyDown(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onFilterBlur&&s.onFilterBlur(...e)),onInput:t[12]||(t[12]=(...e)=>s.onFilterChange&&s.onFilterChange(...e))},i.filterInputProps),null,16,O),l.createElementVNode("span",{class:l.normalizeClass(["p-dropdown-filter-icon",i.filterIcon])},null,2)]),l.createElementVNode("span",g,l.toDisplayString(s.filterResultMessageText),1)])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"p-dropdown-items-wrapper",style:l.normalizeStyle({"max-height":s.virtualScrollerDisabled?i.scrollHeight:""})},[l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled}),l.createSlots({content:l.withCtx((({styleClass:t,contentRef:n,items:r,getItemOptions:a,contentStyle:p,itemSize:c})=>[l.createElementVNode("ul",{ref:e=>s.listRef(e,n),id:o.id+"_list",class:l.normalizeClass(["p-dropdown-items",t]),style:l.normalizeStyle(p),role:"listbox"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r,((t,i)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,a))},[s.isOptionGroup(t)?(l.openBlock(),l.createElementBlock("li",{key:0,id:o.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:c?c+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[l.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,I)):l.withDirectives((l.openBlock(),l.createElementBlock("li",{key:1,id:o.id+"_"+s.getOptionIndex(i,a),style:l.normalizeStyle({height:c?c+"px":void 0}),class:l.normalizeClass(["p-dropdown-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,a),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,a)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,a))},[l.renderSlot(e.$slots,"option",{option:t,index:s.getOptionIndex(i,a)},(()=>[l.createTextVNode(l.toDisplayString(s.getOptionLabel(t)),1)]))],46,w)),[[d]])],64)))),128)),o.filterValue&&(!r||r&&0===r.length)?(l.openBlock(),l.createElementBlock("li",S,[l.renderSlot(e.$slots,"emptyfilter",{},(()=>[l.createTextVNode(l.toDisplayString(s.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(l.openBlock(),l.createElementBlock("li",V,[l.renderSlot(e.$slots,"empty",{},(()=>[l.createTextVNode(l.toDisplayString(s.emptyMessageText),1)]))])):l.createCommentVNode("",!0)],14,x)])),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((({options:t})=>[l.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),l.renderSlot(e.$slots,"footer",{value:i.modelValue,options:s.visibleOptions}),!i.options||i.options&&0===i.options.length?(l.openBlock(),l.createElementBlock("span",k,l.toDisplayString(s.emptyMessageText),1)):l.createCommentVNode("",!0),l.createElementVNode("span",F,l.toDisplayString(s.selectedMessageText),1),l.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[13]||(t[13]=(...e)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...e))},null,544)],16)):l.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],10,h)},module.exports=u;
|