primevue 3.22.3 → 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/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 +45 -33
- package/core/core.min.js +4 -4
- 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/utils/utils.cjs.js +9 -9
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +9 -9
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +9 -9
- package/utils/utils.min.js +1 -1
- package/web-types.json +1 -1
package/dropdown/dropdown.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { FilterService } from 'primevue/api';
|
|
|
2
2
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
3
3
|
import Portal from 'primevue/portal';
|
|
4
4
|
import Ripple from 'primevue/ripple';
|
|
5
|
-
import { ZIndexUtils, ObjectUtils, DomHandler, ConnectedOverlayScrollHandler
|
|
5
|
+
import { UniqueComponentId, ZIndexUtils, ObjectUtils, DomHandler, ConnectedOverlayScrollHandler } from 'primevue/utils';
|
|
6
6
|
import VirtualScroller from 'primevue/virtualscroller';
|
|
7
7
|
import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementVNode, createVNode, withCtx, Transition, normalizeStyle, createSlots, Fragment, renderList, withDirectives } from 'vue';
|
|
8
8
|
|
|
@@ -171,6 +171,7 @@ var script = {
|
|
|
171
171
|
focusOnHover: false,
|
|
172
172
|
data() {
|
|
173
173
|
return {
|
|
174
|
+
id: this.$attrs.id,
|
|
174
175
|
focused: false,
|
|
175
176
|
focusedOptionIndex: -1,
|
|
176
177
|
filterValue: null,
|
|
@@ -178,6 +179,9 @@ var script = {
|
|
|
178
179
|
};
|
|
179
180
|
},
|
|
180
181
|
watch: {
|
|
182
|
+
'$attrs.id': function (newValue) {
|
|
183
|
+
this.id = newValue || UniqueComponentId();
|
|
184
|
+
},
|
|
181
185
|
modelValue() {
|
|
182
186
|
this.isModelValueChanged = true;
|
|
183
187
|
},
|
|
@@ -186,6 +190,8 @@ var script = {
|
|
|
186
190
|
}
|
|
187
191
|
},
|
|
188
192
|
mounted() {
|
|
193
|
+
this.id = this.id || UniqueComponentId();
|
|
194
|
+
|
|
189
195
|
this.autoUpdateModel();
|
|
190
196
|
},
|
|
191
197
|
updated() {
|
|
@@ -882,9 +888,6 @@ var script = {
|
|
|
882
888
|
selectedMessageText() {
|
|
883
889
|
return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
|
|
884
890
|
},
|
|
885
|
-
id() {
|
|
886
|
-
return this.$attrs.id || UniqueComponentId();
|
|
887
|
-
},
|
|
888
891
|
focusedOptionId() {
|
|
889
892
|
return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
|
|
890
893
|
},
|
|
@@ -951,7 +954,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
951
954
|
|
|
952
955
|
return (openBlock(), createElementBlock("div", {
|
|
953
956
|
ref: "container",
|
|
954
|
-
id: $
|
|
957
|
+
id: $data.id,
|
|
955
958
|
class: normalizeClass($options.containerClass),
|
|
956
959
|
onClick: _cache[16] || (_cache[16] = (...args) => ($options.onContainerClick && $options.onContainerClick(...args)))
|
|
957
960
|
}, [
|
|
@@ -973,7 +976,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
973
976
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
974
977
|
"aria-haspopup": "listbox",
|
|
975
978
|
"aria-expanded": $data.overlayVisible,
|
|
976
|
-
"aria-controls": $
|
|
979
|
+
"aria-controls": $data.id + '_list',
|
|
977
980
|
"aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
|
|
978
981
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
979
982
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
|
|
@@ -992,7 +995,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
992
995
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
993
996
|
"aria-haspopup": "listbox",
|
|
994
997
|
"aria-expanded": $data.overlayVisible,
|
|
995
|
-
"aria-controls": $
|
|
998
|
+
"aria-controls": $data.id + '_list',
|
|
996
999
|
"aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
|
|
997
1000
|
"aria-disabled": $props.disabled,
|
|
998
1001
|
onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
@@ -1064,7 +1067,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1064
1067
|
placeholder: $props.filterPlaceholder,
|
|
1065
1068
|
role: "searchbox",
|
|
1066
1069
|
autocomplete: "off",
|
|
1067
|
-
"aria-owns": $
|
|
1070
|
+
"aria-owns": $data.id + '_list',
|
|
1068
1071
|
"aria-activedescendant": $options.focusedOptionId,
|
|
1069
1072
|
onKeydown: _cache[10] || (_cache[10] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
|
|
1070
1073
|
onBlur: _cache[11] || (_cache[11] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
|
|
@@ -1090,7 +1093,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1090
1093
|
content: withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
|
|
1091
1094
|
createElementVNode("ul", {
|
|
1092
1095
|
ref: (el) => $options.listRef(el, contentRef),
|
|
1093
|
-
id: $
|
|
1096
|
+
id: $data.id + '_list',
|
|
1094
1097
|
class: normalizeClass(['p-dropdown-items', styleClass]),
|
|
1095
1098
|
style: normalizeStyle(contentStyle),
|
|
1096
1099
|
role: "listbox"
|
|
@@ -1102,7 +1105,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1102
1105
|
($options.isOptionGroup(option))
|
|
1103
1106
|
? (openBlock(), createElementBlock("li", {
|
|
1104
1107
|
key: 0,
|
|
1105
|
-
id: $
|
|
1108
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1106
1109
|
style: normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
1107
1110
|
class: "p-dropdown-item-group",
|
|
1108
1111
|
role: "option"
|
|
@@ -1116,7 +1119,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1116
1119
|
], 12, _hoisted_10))
|
|
1117
1120
|
: withDirectives((openBlock(), createElementBlock("li", {
|
|
1118
1121
|
key: 1,
|
|
1119
|
-
id: $
|
|
1122
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1120
1123
|
style: normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
1121
1124
|
class: normalizeClass(['p-dropdown-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
|
|
1122
1125
|
role: "option",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FilterService as e}from"primevue/api";import t from"primevue/overlayeventbus";import i from"primevue/portal";import s from"primevue/ripple";import{ZIndexUtils as n,ObjectUtils as o,DomHandler as l,ConnectedOverlayScrollHandler as a,UniqueComponentId as r}from"primevue/utils";import d from"primevue/virtualscroller";import{resolveComponent as p,resolveDirective as u,openBlock as h,createElementBlock as c,normalizeClass as f,mergeProps as y,renderSlot as b,createTextVNode as v,toDisplayString as O,createCommentVNode as g,createElementVNode as m,createVNode as x,withCtx as I,Transition as w,normalizeStyle as S,createSlots as F,Fragment as L,renderList as V,withDirectives as k}from"vue";var C={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&&(n.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?o.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?o.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&l.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&l.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.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||l.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?l.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;l.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?l.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;l.focus(t)},onOptionSelect(e,t,i=!0){const s=this.getOptionValue(t);this.updateModel(e,s),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){t.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()?(l.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){n.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&l.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){n.clear(e)},alignOverlay(){"self"===this.appendTo?l.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=l.getOuterWidth(this.$el)+"px",l.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 a(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return l.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.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,s=!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&&(s=!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),s},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=l.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){this.selectOnFocus&&this.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 s=this.getOptionGroupChildren(t);return s&&s.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.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const s=e.items.filter((e=>i.includes(e)));s.length>0&&t.push({...e,items:[...s]})})),this.flatOptions(t)}return i}return t},hasSelectedOption(){return o.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.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||r()},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:s},components:{VirtualScroller:d,Portal:i}};const K=["id"],M=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],E={class:"p-dropdown-trigger"},$={key:0,class:"p-dropdown-header"},T={class:"p-dropdown-filter-container"},A=["value","placeholder","aria-owns","aria-activedescendant"],H={role:"status","aria-live":"polite",class:"p-hidden-accessible"},P=["id"],B=["id"],G=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],R={key:0,class:"p-dropdown-empty-message",role:"option"},z={key:1,class:"p-dropdown-empty-message",role:"option"},U={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},_={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 s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.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"),C.render=function(e,t,i,s,n,o){const l=p("VirtualScroller"),a=p("Portal"),r=u("ripple");return h(),c("div",{ref:"container",id:o.id,class:f(o.containerClass),onClick:t[16]||(t[16]=(...e)=>o.onContainerClick&&o.onContainerClick(...e))},[i.editable?(h(),c("input",y({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:o.inputStyleClass,value:o.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":n.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":n.focused?o.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>o.onEditableInput&&o.onEditableInput(...e))},i.inputProps),null,16,M)):(h(),c("span",y({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:o.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===o.label?void 0:o.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":n.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":n.focused?o.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[4]||(t[4]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[6]||(t[6]=(...e)=>o.onKeyDown&&o.onKeyDown(...e))},i.inputProps),[b(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[v(O("p-emptylabel"===o.label?" ":o.label||"empty"),1)]))],16,D)),i.showClear&&null!=i.modelValue?(h(),c("i",y({key:2,class:["p-dropdown-clear-icon",i.clearIcon],onClick:t[7]||(t[7]=(...e)=>o.onClearClick&&o.onClearClick(...e))},i.clearIconProps),null,16)):g("",!0),m("div",E,[b(e.$slots,"indicator",{},(()=>[m("span",{class:f(o.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),x(a,{appendTo:i.appendTo},{default:I((()=>[x(w,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:I((()=>[n.overlayVisible?(h(),c("div",y({key:0,ref:o.overlayRef,style:i.panelStyle,class:o.panelStyleClass,onClick:t[14]||(t[14]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e)),onKeydown:t[15]||(t[15]=(...e)=>o.onOverlayKeyDown&&o.onOverlayKeyDown(...e))},i.panelProps),[m("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[8]||(t[8]=(...e)=>o.onFirstHiddenFocus&&o.onFirstHiddenFocus(...e))},null,544),b(e.$slots,"header",{value:i.modelValue,options:o.visibleOptions}),i.filter?(h(),c("div",$,[m("div",T,[m("input",y({ref:"filterInput",type:"text",value:n.filterValue,onVnodeUpdated:t[9]||(t[9]=(...e)=>o.onFilterUpdated&&o.onFilterUpdated(...e)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":o.focusedOptionId,onKeydown:t[10]||(t[10]=(...e)=>o.onFilterKeyDown&&o.onFilterKeyDown(...e)),onBlur:t[11]||(t[11]=(...e)=>o.onFilterBlur&&o.onFilterBlur(...e)),onInput:t[12]||(t[12]=(...e)=>o.onFilterChange&&o.onFilterChange(...e))},i.filterInputProps),null,16,A),m("span",{class:f(["p-dropdown-filter-icon",i.filterIcon])},null,2)]),m("span",H,O(o.filterResultMessageText),1)])):g("",!0),m("div",{class:"p-dropdown-items-wrapper",style:S({"max-height":o.virtualScrollerDisabled?i.scrollHeight:""})},[x(l,y({ref:o.virtualScrollerRef},i.virtualScrollerOptions,{items:o.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:o.virtualScrollerDisabled}),F({content:I((({styleClass:t,contentRef:s,items:l,getItemOptions:a,contentStyle:d,itemSize:p})=>[m("ul",{ref:e=>o.listRef(e,s),id:o.id+"_list",class:f(["p-dropdown-items",t]),style:S(d),role:"listbox"},[(h(!0),c(L,null,V(l,((t,i)=>(h(),c(L,{key:o.getOptionRenderKey(t,o.getOptionIndex(i,a))},[o.isOptionGroup(t)?(h(),c("li",{key:0,id:o.id+"_"+o.getOptionIndex(i,a),style:S({height:p?p+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[b(e.$slots,"optiongroup",{option:t.optionGroup,index:o.getOptionIndex(i,a)},(()=>[v(O(o.getOptionGroupLabel(t.optionGroup)),1)]))],12,B)):k((h(),c("li",{key:1,id:o.id+"_"+o.getOptionIndex(i,a),style:S({height:p?p+"px":void 0}),class:f(["p-dropdown-item",{"p-highlight":o.isSelected(t),"p-focus":n.focusedOptionIndex===o.getOptionIndex(i,a),"p-disabled":o.isOptionDisabled(t)}]),role:"option","aria-label":o.getOptionLabel(t),"aria-selected":o.isSelected(t),"aria-disabled":o.isOptionDisabled(t),"aria-setsize":o.ariaSetSize,"aria-posinset":o.getAriaPosInset(o.getOptionIndex(i,a)),onClick:e=>o.onOptionSelect(e,t),onMousemove:e=>o.onOptionMouseMove(e,o.getOptionIndex(i,a))},[b(e.$slots,"option",{option:t,index:o.getOptionIndex(i,a)},(()=>[v(O(o.getOptionLabel(t)),1)]))],46,G)),[[r]])],64)))),128)),n.filterValue&&(!l||l&&0===l.length)?(h(),c("li",R,[b(e.$slots,"emptyfilter",{},(()=>[v(O(o.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(h(),c("li",z,[b(e.$slots,"empty",{},(()=>[v(O(o.emptyMessageText),1)]))])):g("",!0)],14,P)])),_:2},[e.$slots.loader?{name:"loader",fn:I((({options:t})=>[b(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),b(e.$slots,"footer",{value:i.modelValue,options:o.visibleOptions}),!i.options||i.options&&0===i.options.length?(h(),c("span",U,O(o.emptyMessageText),1)):g("",!0),m("span",_,O(o.selectedMessageText),1),m("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[13]||(t[13]=(...e)=>o.onLastHiddenFocus&&o.onLastHiddenFocus(...e))},null,544)],16)):g("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],10,K)};export{C as default};
|
|
1
|
+
import{FilterService as e}from"primevue/api";import t from"primevue/overlayeventbus";import i from"primevue/portal";import s from"primevue/ripple";import{UniqueComponentId as n,ZIndexUtils as o,ObjectUtils as l,DomHandler as a,ConnectedOverlayScrollHandler as r}from"primevue/utils";import d from"primevue/virtualscroller";import{resolveComponent as p,resolveDirective as u,openBlock as h,createElementBlock as c,normalizeClass as f,mergeProps as y,renderSlot as b,createTextVNode as v,toDisplayString as O,createCommentVNode as g,createElementVNode as m,createVNode as x,withCtx as I,Transition as w,normalizeStyle as S,createSlots as F,Fragment as L,renderList as V,withDirectives as k}from"vue";var C={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||n()},modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||n(),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.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?l.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?l.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?l.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&l.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return l.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return l.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&&a.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&&a.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&&l.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||a.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?a.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.focus(t)},onLastHiddenFocus(e){const t=e.relatedTarget===this.$refs.focusInput?a.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;a.focus(t)},onOptionSelect(e,t,i=!0){const s=this.getOptionValue(t);this.updateModel(e,s),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){t.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()?(a.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.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&a.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.clear(e)},alignOverlay(){"self"===this.appendTo?a.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=a.getOuterWidth(this.$el)+"px",a.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){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 r(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!a.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return a.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 l.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return l.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?l.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,s=!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&&(s=!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),s},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=a.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){this.selectOnFocus&&this.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 s=this.getOptionGroupChildren(t);return s&&s.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.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const e=this.options||[],t=[];return e.forEach((e=>{const s=e.items.filter((e=>i.includes(e)));s.length>0&&t.push({...e,items:[...s]})})),this.flatOptions(t)}return i}return t},hasSelectedOption(){return l.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 l.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:s},components:{VirtualScroller:d,Portal:i}};const K=["id"],M=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],E={class:"p-dropdown-trigger"},$={key:0,class:"p-dropdown-header"},T={class:"p-dropdown-filter-container"},A=["value","placeholder","aria-owns","aria-activedescendant"],H={role:"status","aria-live":"polite",class:"p-hidden-accessible"},P=["id"],B=["id"],G=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],R={key:0,class:"p-dropdown-empty-message",role:"option"},z={key:1,class:"p-dropdown-empty-message",role:"option"},U={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},_={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 s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.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"),C.render=function(e,t,i,s,n,o){const l=p("VirtualScroller"),a=p("Portal"),r=u("ripple");return h(),c("div",{ref:"container",id:n.id,class:f(o.containerClass),onClick:t[16]||(t[16]=(...e)=>o.onContainerClick&&o.onContainerClick(...e))},[i.editable?(h(),c("input",y({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:o.inputStyleClass,value:o.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":n.overlayVisible,"aria-controls":n.id+"_list","aria-activedescendant":n.focused?o.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>o.onEditableInput&&o.onEditableInput(...e))},i.inputProps),null,16,M)):(h(),c("span",y({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:o.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===o.label?void 0:o.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":n.overlayVisible,"aria-controls":n.id+"_list","aria-activedescendant":n.focused?o.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[4]||(t[4]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[6]||(t[6]=(...e)=>o.onKeyDown&&o.onKeyDown(...e))},i.inputProps),[b(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[v(O("p-emptylabel"===o.label?" ":o.label||"empty"),1)]))],16,D)),i.showClear&&null!=i.modelValue?(h(),c("i",y({key:2,class:["p-dropdown-clear-icon",i.clearIcon],onClick:t[7]||(t[7]=(...e)=>o.onClearClick&&o.onClearClick(...e))},i.clearIconProps),null,16)):g("",!0),m("div",E,[b(e.$slots,"indicator",{},(()=>[m("span",{class:f(o.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),x(a,{appendTo:i.appendTo},{default:I((()=>[x(w,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:I((()=>[n.overlayVisible?(h(),c("div",y({key:0,ref:o.overlayRef,style:i.panelStyle,class:o.panelStyleClass,onClick:t[14]||(t[14]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e)),onKeydown:t[15]||(t[15]=(...e)=>o.onOverlayKeyDown&&o.onOverlayKeyDown(...e))},i.panelProps),[m("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[8]||(t[8]=(...e)=>o.onFirstHiddenFocus&&o.onFirstHiddenFocus(...e))},null,544),b(e.$slots,"header",{value:i.modelValue,options:o.visibleOptions}),i.filter?(h(),c("div",$,[m("div",T,[m("input",y({ref:"filterInput",type:"text",value:n.filterValue,onVnodeUpdated:t[9]||(t[9]=(...e)=>o.onFilterUpdated&&o.onFilterUpdated(...e)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":n.id+"_list","aria-activedescendant":o.focusedOptionId,onKeydown:t[10]||(t[10]=(...e)=>o.onFilterKeyDown&&o.onFilterKeyDown(...e)),onBlur:t[11]||(t[11]=(...e)=>o.onFilterBlur&&o.onFilterBlur(...e)),onInput:t[12]||(t[12]=(...e)=>o.onFilterChange&&o.onFilterChange(...e))},i.filterInputProps),null,16,A),m("span",{class:f(["p-dropdown-filter-icon",i.filterIcon])},null,2)]),m("span",H,O(o.filterResultMessageText),1)])):g("",!0),m("div",{class:"p-dropdown-items-wrapper",style:S({"max-height":o.virtualScrollerDisabled?i.scrollHeight:""})},[x(l,y({ref:o.virtualScrollerRef},i.virtualScrollerOptions,{items:o.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:o.virtualScrollerDisabled}),F({content:I((({styleClass:t,contentRef:s,items:l,getItemOptions:a,contentStyle:d,itemSize:p})=>[m("ul",{ref:e=>o.listRef(e,s),id:n.id+"_list",class:f(["p-dropdown-items",t]),style:S(d),role:"listbox"},[(h(!0),c(L,null,V(l,((t,i)=>(h(),c(L,{key:o.getOptionRenderKey(t,o.getOptionIndex(i,a))},[o.isOptionGroup(t)?(h(),c("li",{key:0,id:n.id+"_"+o.getOptionIndex(i,a),style:S({height:p?p+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[b(e.$slots,"optiongroup",{option:t.optionGroup,index:o.getOptionIndex(i,a)},(()=>[v(O(o.getOptionGroupLabel(t.optionGroup)),1)]))],12,B)):k((h(),c("li",{key:1,id:n.id+"_"+o.getOptionIndex(i,a),style:S({height:p?p+"px":void 0}),class:f(["p-dropdown-item",{"p-highlight":o.isSelected(t),"p-focus":n.focusedOptionIndex===o.getOptionIndex(i,a),"p-disabled":o.isOptionDisabled(t)}]),role:"option","aria-label":o.getOptionLabel(t),"aria-selected":o.isSelected(t),"aria-disabled":o.isOptionDisabled(t),"aria-setsize":o.ariaSetSize,"aria-posinset":o.getAriaPosInset(o.getOptionIndex(i,a)),onClick:e=>o.onOptionSelect(e,t),onMousemove:e=>o.onOptionMouseMove(e,o.getOptionIndex(i,a))},[b(e.$slots,"option",{option:t,index:o.getOptionIndex(i,a)},(()=>[v(O(o.getOptionLabel(t)),1)]))],46,G)),[[r]])],64)))),128)),n.filterValue&&(!l||l&&0===l.length)?(h(),c("li",R,[b(e.$slots,"emptyfilter",{},(()=>[v(O(o.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(h(),c("li",z,[b(e.$slots,"empty",{},(()=>[v(O(o.emptyMessageText),1)]))])):g("",!0)],14,P)])),_:2},[e.$slots.loader?{name:"loader",fn:I((({options:t})=>[b(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["items","style","disabled"])],4),b(e.$slots,"footer",{value:i.modelValue,options:o.visibleOptions}),!i.options||i.options&&0===i.options.length?(h(),c("span",U,O(o.emptyMessageText),1)):g("",!0),m("span",_,O(o.selectedMessageText),1),m("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[13]||(t[13]=(...e)=>o.onLastHiddenFocus&&o.onLastHiddenFocus(...e))},null,544)],16)):g("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],10,K)};export{C as default};
|
package/dropdown/dropdown.js
CHANGED
|
@@ -174,6 +174,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
174
174
|
focusOnHover: false,
|
|
175
175
|
data() {
|
|
176
176
|
return {
|
|
177
|
+
id: this.$attrs.id,
|
|
177
178
|
focused: false,
|
|
178
179
|
focusedOptionIndex: -1,
|
|
179
180
|
filterValue: null,
|
|
@@ -181,6 +182,9 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
181
182
|
};
|
|
182
183
|
},
|
|
183
184
|
watch: {
|
|
185
|
+
'$attrs.id': function (newValue) {
|
|
186
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
187
|
+
},
|
|
184
188
|
modelValue() {
|
|
185
189
|
this.isModelValueChanged = true;
|
|
186
190
|
},
|
|
@@ -189,6 +193,8 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
189
193
|
}
|
|
190
194
|
},
|
|
191
195
|
mounted() {
|
|
196
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
197
|
+
|
|
192
198
|
this.autoUpdateModel();
|
|
193
199
|
},
|
|
194
200
|
updated() {
|
|
@@ -885,9 +891,6 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
885
891
|
selectedMessageText() {
|
|
886
892
|
return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
|
|
887
893
|
},
|
|
888
|
-
id() {
|
|
889
|
-
return this.$attrs.id || utils.UniqueComponentId();
|
|
890
|
-
},
|
|
891
894
|
focusedOptionId() {
|
|
892
895
|
return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
|
|
893
896
|
},
|
|
@@ -954,7 +957,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
954
957
|
|
|
955
958
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
956
959
|
ref: "container",
|
|
957
|
-
id: $
|
|
960
|
+
id: $data.id,
|
|
958
961
|
class: vue.normalizeClass($options.containerClass),
|
|
959
962
|
onClick: _cache[16] || (_cache[16] = (...args) => ($options.onContainerClick && $options.onContainerClick(...args)))
|
|
960
963
|
}, [
|
|
@@ -976,7 +979,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
976
979
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
977
980
|
"aria-haspopup": "listbox",
|
|
978
981
|
"aria-expanded": $data.overlayVisible,
|
|
979
|
-
"aria-controls": $
|
|
982
|
+
"aria-controls": $data.id + '_list',
|
|
980
983
|
"aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
|
|
981
984
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
982
985
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
|
|
@@ -995,7 +998,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
995
998
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
996
999
|
"aria-haspopup": "listbox",
|
|
997
1000
|
"aria-expanded": $data.overlayVisible,
|
|
998
|
-
"aria-controls": $
|
|
1001
|
+
"aria-controls": $data.id + '_list',
|
|
999
1002
|
"aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
|
|
1000
1003
|
"aria-disabled": $props.disabled,
|
|
1001
1004
|
onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onFocus && $options.onFocus(...args))),
|
|
@@ -1067,7 +1070,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
1067
1070
|
placeholder: $props.filterPlaceholder,
|
|
1068
1071
|
role: "searchbox",
|
|
1069
1072
|
autocomplete: "off",
|
|
1070
|
-
"aria-owns": $
|
|
1073
|
+
"aria-owns": $data.id + '_list',
|
|
1071
1074
|
"aria-activedescendant": $options.focusedOptionId,
|
|
1072
1075
|
onKeydown: _cache[10] || (_cache[10] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
|
|
1073
1076
|
onBlur: _cache[11] || (_cache[11] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
|
|
@@ -1093,7 +1096,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
1093
1096
|
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
|
|
1094
1097
|
vue.createElementVNode("ul", {
|
|
1095
1098
|
ref: (el) => $options.listRef(el, contentRef),
|
|
1096
|
-
id: $
|
|
1099
|
+
id: $data.id + '_list',
|
|
1097
1100
|
class: vue.normalizeClass(['p-dropdown-items', styleClass]),
|
|
1098
1101
|
style: vue.normalizeStyle(contentStyle),
|
|
1099
1102
|
role: "listbox"
|
|
@@ -1105,7 +1108,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
1105
1108
|
($options.isOptionGroup(option))
|
|
1106
1109
|
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
1107
1110
|
key: 0,
|
|
1108
|
-
id: $
|
|
1111
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1109
1112
|
style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
1110
1113
|
class: "p-dropdown-item-group",
|
|
1111
1114
|
role: "option"
|
|
@@ -1119,7 +1122,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
1119
1122
|
], 12, _hoisted_10))
|
|
1120
1123
|
: vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
|
|
1121
1124
|
key: 1,
|
|
1122
|
-
id: $
|
|
1125
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1123
1126
|
style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
1124
1127
|
class: vue.normalizeClass(['p-dropdown-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
|
|
1125
1128
|
role: "option",
|
package/dropdown/dropdown.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.dropdown=function(e,t,i,n,o,s,l){"use strict";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"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],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)},u}(primevue.api,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.dropdown=function(e,t,i,n,o,s,l){"use strict";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"],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"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],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,w)):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,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)},u}(primevue.api,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);
|
package/listbox/Listbox.vue
CHANGED
|
@@ -185,17 +185,23 @@ export default {
|
|
|
185
185
|
focusOnHover: false,
|
|
186
186
|
data() {
|
|
187
187
|
return {
|
|
188
|
+
id: this.$attrs.id,
|
|
188
189
|
filterValue: null,
|
|
189
190
|
focused: false,
|
|
190
191
|
focusedOptionIndex: -1
|
|
191
192
|
};
|
|
192
193
|
},
|
|
193
194
|
watch: {
|
|
195
|
+
'$attrs.id': function (newValue) {
|
|
196
|
+
this.id = newValue || UniqueComponentId();
|
|
197
|
+
},
|
|
194
198
|
options() {
|
|
195
199
|
this.autoUpdateModel();
|
|
196
200
|
}
|
|
197
201
|
},
|
|
198
202
|
mounted() {
|
|
203
|
+
this.id = this.id || UniqueComponentId();
|
|
204
|
+
|
|
199
205
|
this.autoUpdateModel();
|
|
200
206
|
},
|
|
201
207
|
methods: {
|
|
@@ -733,9 +739,6 @@ export default {
|
|
|
733
739
|
selectedMessageText() {
|
|
734
740
|
return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.modelValue.length : '1') : this.emptySelectionMessageText;
|
|
735
741
|
},
|
|
736
|
-
id() {
|
|
737
|
-
return this.$attrs.id || UniqueComponentId();
|
|
738
|
-
},
|
|
739
742
|
focusedOptionId() {
|
|
740
743
|
return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
|
|
741
744
|
},
|
package/listbox/listbox.cjs.js
CHANGED
|
@@ -97,17 +97,23 @@ var script = {
|
|
|
97
97
|
focusOnHover: false,
|
|
98
98
|
data() {
|
|
99
99
|
return {
|
|
100
|
+
id: this.$attrs.id,
|
|
100
101
|
filterValue: null,
|
|
101
102
|
focused: false,
|
|
102
103
|
focusedOptionIndex: -1
|
|
103
104
|
};
|
|
104
105
|
},
|
|
105
106
|
watch: {
|
|
107
|
+
'$attrs.id': function (newValue) {
|
|
108
|
+
this.id = newValue || utils.UniqueComponentId();
|
|
109
|
+
},
|
|
106
110
|
options() {
|
|
107
111
|
this.autoUpdateModel();
|
|
108
112
|
}
|
|
109
113
|
},
|
|
110
114
|
mounted() {
|
|
115
|
+
this.id = this.id || utils.UniqueComponentId();
|
|
116
|
+
|
|
111
117
|
this.autoUpdateModel();
|
|
112
118
|
},
|
|
113
119
|
methods: {
|
|
@@ -642,9 +648,6 @@ var script = {
|
|
|
642
648
|
selectedMessageText() {
|
|
643
649
|
return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.modelValue.length : '1') : this.emptySelectionMessageText;
|
|
644
650
|
},
|
|
645
|
-
id() {
|
|
646
|
-
return this.$attrs.id || utils.UniqueComponentId();
|
|
647
|
-
},
|
|
648
651
|
focusedOptionId() {
|
|
649
652
|
return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
|
|
650
653
|
},
|
|
@@ -707,7 +710,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
707
710
|
const _directive_ripple = vue.resolveDirective("ripple");
|
|
708
711
|
|
|
709
712
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
710
|
-
id: $
|
|
713
|
+
id: $data.id,
|
|
711
714
|
class: vue.normalizeClass($options.containerClass),
|
|
712
715
|
onFocusout: _cache[10] || (_cache[10] = (...args) => ($options.onFocusout && $options.onFocusout(...args)))
|
|
713
716
|
}, [
|
|
@@ -734,7 +737,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
734
737
|
placeholder: $props.filterPlaceholder,
|
|
735
738
|
role: "searchbox",
|
|
736
739
|
autocomplete: "off",
|
|
737
|
-
"aria-owns": $
|
|
740
|
+
"aria-owns": $data.id + '_list',
|
|
738
741
|
"aria-activedescendant": $options.focusedOptionId,
|
|
739
742
|
tabindex: !$props.disabled && !$data.focused ? $props.tabindex : -1,
|
|
740
743
|
onInput: _cache[2] || (_cache[2] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args))),
|
|
@@ -764,7 +767,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
764
767
|
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
|
|
765
768
|
vue.createElementVNode("ul", {
|
|
766
769
|
ref: (el) => $options.listRef(el, contentRef),
|
|
767
|
-
id: $
|
|
770
|
+
id: $data.id + '_list',
|
|
768
771
|
class: vue.normalizeClass(['p-listbox-list', styleClass]),
|
|
769
772
|
style: vue.normalizeStyle(contentStyle),
|
|
770
773
|
tabindex: -1,
|
|
@@ -785,7 +788,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
785
788
|
($options.isOptionGroup(option))
|
|
786
789
|
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
787
790
|
key: 0,
|
|
788
|
-
id: $
|
|
791
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
789
792
|
style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
790
793
|
class: "p-listbox-item-group",
|
|
791
794
|
role: "option"
|
|
@@ -799,7 +802,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
799
802
|
], 12, _hoisted_8))
|
|
800
803
|
: vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
|
|
801
804
|
key: 1,
|
|
802
|
-
id: $
|
|
805
|
+
id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
803
806
|
style: vue.normalizeStyle({ height: itemSize ? itemSize + 'px' : undefined }),
|
|
804
807
|
class: vue.normalizeClass(['p-listbox-item', { 'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option) }]),
|
|
805
808
|
role: "option",
|