primevue 3.47.0 → 3.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/listbox/Listbox.vue +1 -1
  2. package/listbox/listbox.cjs.js +2 -1
  3. package/listbox/listbox.cjs.min.js +1 -1
  4. package/listbox/listbox.esm.js +2 -1
  5. package/listbox/listbox.esm.min.js +1 -1
  6. package/listbox/listbox.js +2 -1
  7. package/listbox/listbox.min.js +1 -1
  8. package/orderlist/OrderList.vue +8 -9
  9. package/orderlist/orderlist.cjs.js +9 -8
  10. package/orderlist/orderlist.cjs.min.js +1 -1
  11. package/orderlist/orderlist.esm.js +9 -8
  12. package/orderlist/orderlist.esm.min.js +1 -1
  13. package/orderlist/orderlist.js +9 -8
  14. package/orderlist/orderlist.min.js +1 -1
  15. package/package.json +1 -1
  16. package/picklist/PickList.vue +7 -7
  17. package/picklist/picklist.cjs.js +8 -6
  18. package/picklist/picklist.cjs.min.js +1 -1
  19. package/picklist/picklist.esm.js +8 -6
  20. package/picklist/picklist.esm.min.js +1 -1
  21. package/picklist/picklist.js +8 -6
  22. package/picklist/picklist.min.js +1 -1
  23. package/resources/themes/arya-blue/theme.css +4 -4
  24. package/resources/themes/arya-green/theme.css +4 -4
  25. package/resources/themes/arya-orange/theme.css +4 -4
  26. package/resources/themes/arya-purple/theme.css +4 -4
  27. package/resources/themes/aura-dark-amber/theme.css +4 -4
  28. package/resources/themes/aura-dark-blue/theme.css +4 -4
  29. package/resources/themes/aura-dark-cyan/theme.css +4 -4
  30. package/resources/themes/aura-dark-green/theme.css +4 -4
  31. package/resources/themes/aura-dark-indigo/theme.css +4 -4
  32. package/resources/themes/aura-dark-lime/theme.css +4 -4
  33. package/resources/themes/aura-dark-noir/theme.css +4 -4
  34. package/resources/themes/aura-dark-pink/theme.css +4 -4
  35. package/resources/themes/aura-dark-purple/theme.css +4 -4
  36. package/resources/themes/aura-dark-teal/theme.css +4 -4
  37. package/resources/themes/aura-light-amber/theme.css +8 -8
  38. package/resources/themes/aura-light-blue/theme.css +8 -8
  39. package/resources/themes/aura-light-cyan/theme.css +8 -8
  40. package/resources/themes/aura-light-green/theme.css +8 -8
  41. package/resources/themes/aura-light-indigo/theme.css +8 -8
  42. package/resources/themes/aura-light-lime/theme.css +8 -8
  43. package/resources/themes/aura-light-noir/theme.css +8 -8
  44. package/resources/themes/aura-light-pink/theme.css +8 -8
  45. package/resources/themes/aura-light-purple/theme.css +8 -8
  46. package/resources/themes/aura-light-teal/theme.css +8 -8
  47. package/resources/themes/bootstrap4-dark-blue/theme.css +4 -4
  48. package/resources/themes/bootstrap4-dark-purple/theme.css +4 -4
  49. package/resources/themes/bootstrap4-light-blue/theme.css +4 -4
  50. package/resources/themes/bootstrap4-light-purple/theme.css +4 -4
  51. package/resources/themes/fluent-light/theme.css +4 -4
  52. package/resources/themes/lara-dark-amber/theme.css +4 -4
  53. package/resources/themes/lara-dark-blue/theme.css +4 -4
  54. package/resources/themes/lara-dark-cyan/theme.css +4 -4
  55. package/resources/themes/lara-dark-green/theme.css +4 -4
  56. package/resources/themes/lara-dark-indigo/theme.css +4 -4
  57. package/resources/themes/lara-dark-pink/theme.css +4 -4
  58. package/resources/themes/lara-dark-purple/theme.css +4 -4
  59. package/resources/themes/lara-dark-teal/theme.css +4 -4
  60. package/resources/themes/lara-light-amber/theme.css +4 -4
  61. package/resources/themes/lara-light-blue/theme.css +4 -4
  62. package/resources/themes/lara-light-cyan/theme.css +4 -4
  63. package/resources/themes/lara-light-green/theme.css +4 -4
  64. package/resources/themes/lara-light-indigo/theme.css +4 -4
  65. package/resources/themes/lara-light-pink/theme.css +4 -4
  66. package/resources/themes/lara-light-purple/theme.css +4 -4
  67. package/resources/themes/lara-light-teal/theme.css +4 -4
  68. package/resources/themes/luna-amber/theme.css +4 -4
  69. package/resources/themes/luna-blue/theme.css +4 -4
  70. package/resources/themes/luna-green/theme.css +4 -4
  71. package/resources/themes/luna-pink/theme.css +4 -4
  72. package/resources/themes/md-dark-deeppurple/theme.css +4 -4
  73. package/resources/themes/md-dark-indigo/theme.css +4 -4
  74. package/resources/themes/md-light-deeppurple/theme.css +4 -4
  75. package/resources/themes/md-light-indigo/theme.css +4 -4
  76. package/resources/themes/mdc-dark-deeppurple/theme.css +4 -4
  77. package/resources/themes/mdc-dark-indigo/theme.css +4 -4
  78. package/resources/themes/mdc-light-deeppurple/theme.css +4 -4
  79. package/resources/themes/mdc-light-indigo/theme.css +4 -4
  80. package/resources/themes/mira/theme.css +4 -4
  81. package/resources/themes/nano/theme.css +4 -4
  82. package/resources/themes/nova/theme.css +4 -4
  83. package/resources/themes/nova-accent/theme.css +4 -4
  84. package/resources/themes/nova-alt/theme.css +4 -4
  85. package/resources/themes/nova-vue/theme.css +4 -4
  86. package/resources/themes/rhea/theme.css +4 -4
  87. package/resources/themes/saga-blue/theme.css +4 -4
  88. package/resources/themes/saga-green/theme.css +4 -4
  89. package/resources/themes/saga-orange/theme.css +4 -4
  90. package/resources/themes/saga-purple/theme.css +4 -4
  91. package/resources/themes/soho-dark/theme.css +4 -4
  92. package/resources/themes/soho-light/theme.css +4 -4
  93. package/resources/themes/tailwind-light/theme.css +4 -4
  94. package/resources/themes/vela-blue/theme.css +4 -4
  95. package/resources/themes/vela-green/theme.css +4 -4
  96. package/resources/themes/vela-orange/theme.css +4 -4
  97. package/resources/themes/vela-purple/theme.css +4 -4
  98. package/resources/themes/viva-dark/theme.css +4 -4
  99. package/resources/themes/viva-light/theme.css +4 -4
  100. package/web-types.json +1 -1
@@ -649,7 +649,7 @@ export default {
649
649
  const element = DomHandler.findSingle(this.list, `li[id="${id}"]`);
650
650
 
651
651
  if (element) {
652
- element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'nearest' });
652
+ element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'smooth' });
653
653
  } else if (!this.virtualScrollerDisabled) {
654
654
  this.virtualScroller && this.virtualScroller.scrollToIndex(index !== -1 ? index : this.focusedOptionIndex);
655
655
  }
@@ -644,7 +644,8 @@ var script = {
644
644
  if (element) {
645
645
  element.scrollIntoView && element.scrollIntoView({
646
646
  block: 'nearest',
647
- inline: 'nearest'
647
+ inline: 'nearest',
648
+ behavior: 'smooth'
648
649
  });
649
650
  } else if (!_this16.virtualScrollerDisabled) {
650
651
  _this16.virtualScroller && _this16.virtualScroller.scrollToIndex(index !== -1 ? index : _this16.focusedOptionIndex);
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/api"),t=require("primevue/icons/search"),i=require("primevue/ripple"),n=require("primevue/utils"),o=require("primevue/virtualscroller"),s=require("primevue/basecomponent"),r=require("primevue/listbox/style"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),u=a(i),d=a(o);function p(e){return m(e)||O(e)||f(e)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var g={name:"Listbox",extends:{name:"BaseListbox",extends:a(s).default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},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},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a(r).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n.UniqueComponentId(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?n.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){n.DomHandler.focus(this.list);var e=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=n.DomHandler.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');n.DomHandler.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else n.DomHandler.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var o=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,o),e.preventDefault();break}!i&&n.ObjectUtils.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(p(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(p(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),r=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,r)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey:function(e){var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){var t;return this.isValidOption(e)&&(null===(t=this.getOptionLabel(e))||void 0===t?void 0:t.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return n.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,t){return n.ObjectUtils.equals(e,t,this.equalityKey)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return t.isEquals(e,i)})):this.isEquals(this.modelValue,i)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){if(!this.multiple)return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}));for(var t,i=function(){var t=e.modelValue[n],i=e.visibleOptions.findIndex((function(i){return e.isValidSelectedOption(i)&&e.isEquals(t,e.getOptionValue(i))}));if(i>-1)return{v:i}},n=this.modelValue.length-1;n>=0;n--)if(t=i())return t.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var o=-1;n.ObjectUtils.isNotEmpty(this.searchValue)&&(-1===(o=-1!==this.focusedOptionIndex?-1===(o=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):o+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(o=this.findFirstFocusedOptionIndex()),-1!==o&&this.changeFocusedOptionIndex(e,o)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!n.ObjectUtils.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,o=n.DomHandler.findSingle(e.list,'li[id="'.concat(i,'"]'));o?o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption:function(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:u.default},components:{VirtualScroller:d.default,SearchIcon:c.default}};function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){I(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I(e,t,i){var n;return(t="symbol"==y(n=S(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function S(e,t){if("object"!=y(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var F=["id"],V=["tabindex"],M=["placeholder","aria-owns","aria-activedescendant","tabindex"],D=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],w=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],K=["tabindex"];g.render=function(e,t,i,n,o,s){var r=l.resolveComponent("VirtualScroller"),a=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",l.mergeProps({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[l.createElementVNode("span",l.mergeProps({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,V),l.renderSlot(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[l.createElementVNode("div",l.mergeProps({class:e.cx("filterContainer")},e.ptm("filterContainer")),[l.withDirectives(l.createElementVNode("input",l.mergeProps({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},x(x({},e.filterInputProps),e.ptm("filterInput"))),null,16,M),[[l.vModelText,o.filterValue]]),l.renderSlot(e.$slots,"filtericon",{class:l.normalizeClass(e.cx("filterIcon"))},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.filterIcon?"span":"SearchIcon"),l.mergeProps({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),l.createElementVNode("span",l.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.filterResultMessageText),17)],16)):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),l.createSlots({content:l.withCtx((function(i){var n=i.styleClass,r=i.contentRef,c=i.items,u=i.getItemOptions,d=i.contentStyle,p=i.itemSize;return[l.createElementVNode("ul",l.mergeProps({ref:function(e){return s.listRef(e,r)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c,(function(i,n){return l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[l.renderSlot(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,w)):l.withDirectives((l.openBlock(),l.createElementBlock("li",l.mergeProps({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[l.renderSlot(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[l.createTextVNode(l.toDisplayString(s.getOptionLabel(i)),1)]}))],16,E)),[[a]])],64)})),128)),o.filterValue&&(!c||c&&0===c.length)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[l.renderSlot(e.$slots,"emptyfilter",{},(function(){return[l.createTextVNode(l.toDisplayString(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[l.renderSlot(e.$slots,"empty",{},(function(){return[l.createTextVNode(l.toDisplayString(s.emptyMessageText),1)]}))],16)):l.createCommentVNode("",!0)],16,D)]})),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),l.renderSlot(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.emptyMessageText),17)):l.createCommentVNode("",!0),l.createElementVNode("span",l.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.selectedMessageText),17),l.createElementVNode("span",l.mergeProps({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,K)],16,F)},module.exports=g;
1
+ "use strict";var e=require("primevue/api"),t=require("primevue/icons/search"),i=require("primevue/ripple"),n=require("primevue/utils"),o=require("primevue/virtualscroller"),s=require("primevue/basecomponent"),r=require("primevue/listbox/style"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),u=a(i),d=a(o);function p(e){return m(e)||O(e)||f(e)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var g={name:"Listbox",extends:{name:"BaseListbox",extends:a(s).default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},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},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a(r).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n.UniqueComponentId(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?n.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){n.DomHandler.focus(this.list);var e=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=n.DomHandler.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');n.DomHandler.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else n.DomHandler.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var o=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,o),e.preventDefault();break}!i&&n.ObjectUtils.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(p(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(p(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),r=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,r)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey:function(e){var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){var t;return this.isValidOption(e)&&(null===(t=this.getOptionLabel(e))||void 0===t?void 0:t.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return n.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,t){return n.ObjectUtils.equals(e,t,this.equalityKey)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return t.isEquals(e,i)})):this.isEquals(this.modelValue,i)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){if(!this.multiple)return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}));for(var t,i=function(){var t=e.modelValue[n],i=e.visibleOptions.findIndex((function(i){return e.isValidSelectedOption(i)&&e.isEquals(t,e.getOptionValue(i))}));if(i>-1)return{v:i}},n=this.modelValue.length-1;n>=0;n--)if(t=i())return t.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var o=-1;n.ObjectUtils.isNotEmpty(this.searchValue)&&(-1===(o=-1!==this.focusedOptionIndex?-1===(o=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):o+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(o=this.findFirstFocusedOptionIndex()),-1!==o&&this.changeFocusedOptionIndex(e,o)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!n.ObjectUtils.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,o=n.DomHandler.findSingle(e.list,'li[id="'.concat(i,'"]'));o?o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption:function(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:u.default},components:{VirtualScroller:d.default,SearchIcon:c.default}};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?y(Object(i),!0).forEach((function(t){I(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I(e,t,i){var n;return(t="symbol"==v(n=S(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function S(e,t){if("object"!=v(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var F=["id"],V=["tabindex"],M=["placeholder","aria-owns","aria-activedescendant","tabindex"],D=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],w=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],K=["tabindex"];g.render=function(e,t,i,n,o,s){var r=l.resolveComponent("VirtualScroller"),a=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",l.mergeProps({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[l.createElementVNode("span",l.mergeProps({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,V),l.renderSlot(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[l.createElementVNode("div",l.mergeProps({class:e.cx("filterContainer")},e.ptm("filterContainer")),[l.withDirectives(l.createElementVNode("input",l.mergeProps({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},x(x({},e.filterInputProps),e.ptm("filterInput"))),null,16,M),[[l.vModelText,o.filterValue]]),l.renderSlot(e.$slots,"filtericon",{class:l.normalizeClass(e.cx("filterIcon"))},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.filterIcon?"span":"SearchIcon"),l.mergeProps({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),l.createElementVNode("span",l.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.filterResultMessageText),17)],16)):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),l.createSlots({content:l.withCtx((function(i){var n=i.styleClass,r=i.contentRef,c=i.items,u=i.getItemOptions,d=i.contentStyle,p=i.itemSize;return[l.createElementVNode("ul",l.mergeProps({ref:function(e){return s.listRef(e,r)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c,(function(i,n){return l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[l.renderSlot(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,w)):l.withDirectives((l.openBlock(),l.createElementBlock("li",l.mergeProps({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[l.renderSlot(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[l.createTextVNode(l.toDisplayString(s.getOptionLabel(i)),1)]}))],16,E)),[[a]])],64)})),128)),o.filterValue&&(!c||c&&0===c.length)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[l.renderSlot(e.$slots,"emptyfilter",{},(function(){return[l.createTextVNode(l.toDisplayString(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[l.renderSlot(e.$slots,"empty",{},(function(){return[l.createTextVNode(l.toDisplayString(s.emptyMessageText),1)]}))],16)):l.createCommentVNode("",!0)],16,D)]})),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),l.renderSlot(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.emptyMessageText),17)):l.createCommentVNode("",!0),l.createElementVNode("span",l.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.selectedMessageText),17),l.createElementVNode("span",l.mergeProps({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,K)],16,F)},module.exports=g;
@@ -634,7 +634,8 @@ var script = {
634
634
  if (element) {
635
635
  element.scrollIntoView && element.scrollIntoView({
636
636
  block: 'nearest',
637
- inline: 'nearest'
637
+ inline: 'nearest',
638
+ behavior: 'smooth'
638
639
  });
639
640
  } else if (!_this16.virtualScrollerDisabled) {
640
641
  _this16.virtualScroller && _this16.virtualScroller.scrollToIndex(index !== -1 ? index : _this16.focusedOptionIndex);
@@ -1 +1 @@
1
- import{FilterService as e}from"primevue/api";import t from"primevue/icons/search";import i from"primevue/ripple";import{UniqueComponentId as n,ObjectUtils as o,DomHandler as s}from"primevue/utils";import l from"primevue/virtualscroller";import r from"primevue/basecomponent";import a from"primevue/listbox/style";import{resolveComponent as u,resolveDirective as d,openBlock as c,createElementBlock as p,mergeProps as h,createElementVNode as f,renderSlot as O,withDirectives as b,vModelText as m,normalizeClass as y,createBlock as g,resolveDynamicComponent as v,toDisplayString as x,createCommentVNode as I,createVNode as S,createSlots as F,withCtx as M,Fragment as V,renderList as K,createTextVNode as w}from"vue";function L(e){return $(e)||T(e)||E(e)||D()}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){if(e){if("string"==typeof e)return k(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?k(e,t):void 0}}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function $(e){if(Array.isArray(e))return k(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var P={name:"Listbox",extends:{name:"BaseListbox",extends:r,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},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},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?o.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?o.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&o.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return o.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return o.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){s.focus(this.list);var e=s.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=s.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=s.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');s.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else s.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var n=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,n),e.preventDefault();break}!i&&o.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(L(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(L(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),l=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,l)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey:function(e){var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){var t;return this.isValidOption(e)&&(null===(t=this.getOptionLabel(e))||void 0===t?void 0:t.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return o.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,t){return o.equals(e,t,this.equalityKey)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return t.isEquals(e,i)})):this.isEquals(this.modelValue,i)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return o.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){if(!this.multiple)return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}));for(var t,i=function(){var t=e.modelValue[n],i=e.visibleOptions.findIndex((function(i){return e.isValidSelectedOption(i)&&e.isEquals(t,e.getOptionValue(i))}));if(i>-1)return{v:i}},n=this.modelValue.length-1;n>=0;n--)if(t=i())return t.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?o.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1;o.isNotEmpty(this.searchValue)&&(-1===(n=-1!==this.focusedOptionIndex?-1===(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!o.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,n=s.findSingle(e.list,'li[id="'.concat(i,'"]'));n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"nearest"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption:function(){return o.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return o.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:i},components:{VirtualScroller:l,SearchIcon:t}};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function A(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function H(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?A(Object(i),!0).forEach((function(t){G(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function G(e,t,i){var n;return(t="symbol"==R(n=j(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function j(e,t){if("object"!=R(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var B=["id"],C=["tabindex"],N=["placeholder","aria-owns","aria-activedescendant","tabindex"],U=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],q=["id"],_=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],z=["tabindex"];P.render=function(e,t,i,n,o,s){var l=u("VirtualScroller"),r=d("ripple");return c(),p("div",h({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[f("span",h({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,C),O(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(c(),p("div",h({key:0,class:e.cx("header")},e.ptm("header")),[f("div",h({class:e.cx("filterContainer")},e.ptm("filterContainer")),[b(f("input",h({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},H(H({},e.filterInputProps),e.ptm("filterInput"))),null,16,N),[[m,o.filterValue]]),O(e.$slots,"filtericon",{class:y(e.cx("filterIcon"))},(function(){return[(c(),g(v(e.filterIcon?"span":"SearchIcon"),h({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),f("span",h({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),x(s.filterResultMessageText),17)],16)):I("",!0),f("div",h({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[S(l,h({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),F({content:M((function(i){var n=i.styleClass,l=i.contentRef,a=i.items,u=i.getItemOptions,d=i.contentStyle,m=i.itemSize;return[f("ul",h({ref:function(e){return s.listRef(e,l)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(c(!0),p(V,null,K(a,(function(i,n){return c(),p(V,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(c(),p("li",h({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:m?m+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[O(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[w(x(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,q)):b((c(),p("li",h({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:m?m+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[O(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[w(x(s.getOptionLabel(i)),1)]}))],16,_)),[[r]])],64)})),128)),o.filterValue&&(!a||a&&0===a.length)?(c(),p("li",h({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[O(e.$slots,"emptyfilter",{},(function(){return[w(x(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(c(),p("li",h({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[O(e.$slots,"empty",{},(function(){return[w(x(s.emptyMessageText),1)]}))],16)):I("",!0)],16,U)]})),_:2},[e.$slots.loader?{name:"loader",fn:M((function(t){return[O(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),O(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(c(),p("span",h({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),x(s.emptyMessageText),17)):I("",!0),f("span",h({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),x(s.selectedMessageText),17),f("span",h({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,z)],16,B)};export{P as default};
1
+ import{FilterService as e}from"primevue/api";import t from"primevue/icons/search";import i from"primevue/ripple";import{UniqueComponentId as n,ObjectUtils as o,DomHandler as s}from"primevue/utils";import l from"primevue/virtualscroller";import r from"primevue/basecomponent";import a from"primevue/listbox/style";import{resolveComponent as u,resolveDirective as d,openBlock as c,createElementBlock as p,mergeProps as h,createElementVNode as f,renderSlot as O,withDirectives as b,vModelText as m,normalizeClass as y,createBlock as g,resolveDynamicComponent as v,toDisplayString as x,createCommentVNode as I,createVNode as S,createSlots as F,withCtx as M,Fragment as V,renderList as K,createTextVNode as w}from"vue";function L(e){return $(e)||T(e)||E(e)||D()}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){if(e){if("string"==typeof e)return k(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?k(e,t):void 0}}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function $(e){if(Array.isArray(e))return k(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var P={name:"Listbox",extends:{name:"BaseListbox",extends:r,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},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},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?o.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?o.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&o.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return o.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return o.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){s.focus(this.list);var e=s.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=s.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=s.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');s.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else s.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var n=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,n),e.preventDefault();break}!i&&o.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(L(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(L(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),l=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,l)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey:function(e){var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){var t;return this.isValidOption(e)&&(null===(t=this.getOptionLabel(e))||void 0===t?void 0:t.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return o.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,t){return o.equals(e,t,this.equalityKey)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return t.isEquals(e,i)})):this.isEquals(this.modelValue,i)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return o.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){if(!this.multiple)return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}));for(var t,i=function(){var t=e.modelValue[n],i=e.visibleOptions.findIndex((function(i){return e.isValidSelectedOption(i)&&e.isEquals(t,e.getOptionValue(i))}));if(i>-1)return{v:i}},n=this.modelValue.length-1;n>=0;n--)if(t=i())return t.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?o.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1;o.isNotEmpty(this.searchValue)&&(-1===(n=-1!==this.focusedOptionIndex?-1===(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!o.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,n=s.findSingle(e.list,'li[id="'.concat(i,'"]'));n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption:function(){return o.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return o.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:i},components:{VirtualScroller:l,SearchIcon:t}};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function A(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function H(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?A(Object(i),!0).forEach((function(t){G(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function G(e,t,i){var n;return(t="symbol"==R(n=j(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function j(e,t){if("object"!=R(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var B=["id"],C=["tabindex"],N=["placeholder","aria-owns","aria-activedescendant","tabindex"],U=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],q=["id"],_=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],z=["tabindex"];P.render=function(e,t,i,n,o,s){var l=u("VirtualScroller"),r=d("ripple");return c(),p("div",h({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[f("span",h({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,C),O(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(c(),p("div",h({key:0,class:e.cx("header")},e.ptm("header")),[f("div",h({class:e.cx("filterContainer")},e.ptm("filterContainer")),[b(f("input",h({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},H(H({},e.filterInputProps),e.ptm("filterInput"))),null,16,N),[[m,o.filterValue]]),O(e.$slots,"filtericon",{class:y(e.cx("filterIcon"))},(function(){return[(c(),g(v(e.filterIcon?"span":"SearchIcon"),h({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),f("span",h({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),x(s.filterResultMessageText),17)],16)):I("",!0),f("div",h({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[S(l,h({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),F({content:M((function(i){var n=i.styleClass,l=i.contentRef,a=i.items,u=i.getItemOptions,d=i.contentStyle,m=i.itemSize;return[f("ul",h({ref:function(e){return s.listRef(e,l)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(c(!0),p(V,null,K(a,(function(i,n){return c(),p(V,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(c(),p("li",h({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:m?m+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[O(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[w(x(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,q)):b((c(),p("li",h({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:m?m+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[O(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[w(x(s.getOptionLabel(i)),1)]}))],16,_)),[[r]])],64)})),128)),o.filterValue&&(!a||a&&0===a.length)?(c(),p("li",h({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[O(e.$slots,"emptyfilter",{},(function(){return[w(x(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(c(),p("li",h({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[O(e.$slots,"empty",{},(function(){return[w(x(s.emptyMessageText),1)]}))],16)):I("",!0)],16,U)]})),_:2},[e.$slots.loader?{name:"loader",fn:M((function(t){return[O(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),O(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(c(),p("span",h({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),x(s.emptyMessageText),17)):I("",!0),f("span",h({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),x(s.selectedMessageText),17),f("span",h({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,z)],16,B)};export{P as default};
@@ -637,7 +637,8 @@ this.primevue.listbox = (function (api, SearchIcon, Ripple, utils, VirtualScroll
637
637
  if (element) {
638
638
  element.scrollIntoView && element.scrollIntoView({
639
639
  block: 'nearest',
640
- inline: 'nearest'
640
+ inline: 'nearest',
641
+ behavior: 'smooth'
641
642
  });
642
643
  } else if (!_this16.virtualScrollerDisabled) {
643
644
  _this16.virtualScroller && _this16.virtualScroller.scrollToIndex(index !== -1 ? index : _this16.focusedOptionIndex);
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.listbox=function(e,t,i,n,o,s,l,r){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),u=a(i),d=a(o);function p(e){return m(e)||O(e)||f(e)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var g={name:"Listbox",extends:{name:"BaseListbox",extends:a(s).default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},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},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a(l).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n.UniqueComponentId(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?n.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){n.DomHandler.focus(this.list);var e=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=n.DomHandler.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');n.DomHandler.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else n.DomHandler.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var o=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,o),e.preventDefault();break}!i&&n.ObjectUtils.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(p(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(p(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),l=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,l)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey:function(e){var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){var t;return this.isValidOption(e)&&(null===(t=this.getOptionLabel(e))||void 0===t?void 0:t.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return n.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,t){return n.ObjectUtils.equals(e,t,this.equalityKey)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return t.isEquals(e,i)})):this.isEquals(this.modelValue,i)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){if(!this.multiple)return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}));for(var t,i=function(){var t=e.modelValue[n],i=e.visibleOptions.findIndex((function(i){return e.isValidSelectedOption(i)&&e.isEquals(t,e.getOptionValue(i))}));if(i>-1)return{v:i}},n=this.modelValue.length-1;n>=0;n--)if(t=i())return t.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var o=-1;n.ObjectUtils.isNotEmpty(this.searchValue)&&(-1===(o=-1!==this.focusedOptionIndex?-1===(o=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):o+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(o=this.findFirstFocusedOptionIndex()),-1!==o&&this.changeFocusedOptionIndex(e,o)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!n.ObjectUtils.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,o=n.DomHandler.findSingle(e.list,'li[id="'.concat(i,'"]'));o?o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption:function(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:u.default},components:{VirtualScroller:d.default,SearchIcon:c.default}};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?y(Object(i),!0).forEach((function(t){I(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I(e,t,i){var n;return(t="symbol"==v(n=S(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function S(e,t){if("object"!=v(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var F=["id"],V=["tabindex"],M=["placeholder","aria-owns","aria-activedescendant","tabindex"],D=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],w=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],K=["tabindex"];return g.render=function(e,t,i,n,o,s){var l=r.resolveComponent("VirtualScroller"),a=r.resolveDirective("ripple");return r.openBlock(),r.createElementBlock("div",r.mergeProps({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[r.createElementVNode("span",r.mergeProps({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,V),r.renderSlot(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[r.createElementVNode("div",r.mergeProps({class:e.cx("filterContainer")},e.ptm("filterContainer")),[r.withDirectives(r.createElementVNode("input",r.mergeProps({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},x(x({},e.filterInputProps),e.ptm("filterInput"))),null,16,M),[[r.vModelText,o.filterValue]]),r.renderSlot(e.$slots,"filtericon",{class:r.normalizeClass(e.cx("filterIcon"))},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.filterIcon?"span":"SearchIcon"),r.mergeProps({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.filterResultMessageText),17)],16)):r.createCommentVNode("",!0),r.createElementVNode("div",r.mergeProps({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[r.createVNode(l,r.mergeProps({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),r.createSlots({content:r.withCtx((function(i){var n=i.styleClass,l=i.contentRef,c=i.items,u=i.getItemOptions,d=i.contentStyle,p=i.itemSize;return[r.createElementVNode("ul",r.mergeProps({ref:function(e){return s.listRef(e,l)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c,(function(i,n){return r.openBlock(),r.createElementBlock(r.Fragment,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[r.renderSlot(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[r.createTextVNode(r.toDisplayString(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,w)):r.withDirectives((r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[r.renderSlot(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[r.createTextVNode(r.toDisplayString(s.getOptionLabel(i)),1)]}))],16,E)),[[a]])],64)})),128)),o.filterValue&&(!c||c&&0===c.length)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[r.renderSlot(e.$slots,"emptyfilter",{},(function(){return[r.createTextVNode(r.toDisplayString(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[r.renderSlot(e.$slots,"empty",{},(function(){return[r.createTextVNode(r.toDisplayString(s.emptyMessageText),1)]}))],16)):r.createCommentVNode("",!0)],16,D)]})),_:2},[e.$slots.loader?{name:"loader",fn:r.withCtx((function(t){return[r.renderSlot(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),r.renderSlot(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.emptyMessageText),17)):r.createCommentVNode("",!0),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.selectedMessageText),17),r.createElementVNode("span",r.mergeProps({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,K)],16,F)},g}(primevue.api,primevue.icons.search,primevue.ripple,primevue.utils,primevue.virtualscroller,primevue.basecomponent,primevue.listbox.style,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.listbox=function(e,t,i,n,o,s,l,r){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),u=a(i),d=a(o);function p(e){return m(e)||O(e)||f(e)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var g={name:"Listbox",extends:{name:"BaseListbox",extends:a(s).default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},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},filterIcon:{type:String,default:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a(l).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n.UniqueComponentId(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?n.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){n.DomHandler.focus(this.list);var e=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=n.DomHandler.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');n.DomHandler.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else n.DomHandler.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var o=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,o),e.preventDefault();break}!i&&n.ObjectUtils.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.focused&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(p(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(p(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),l=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,l)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey:function(e){var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){var t;return this.isValidOption(e)&&(null===(t=this.getOptionLabel(e))||void 0===t?void 0:t.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return n.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,t){return n.ObjectUtils.equals(e,t,this.equalityKey)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return t.isEquals(e,i)})):this.isEquals(this.modelValue,i)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){if(!this.multiple)return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}));for(var t,i=function(){var t=e.modelValue[n],i=e.visibleOptions.findIndex((function(i){return e.isValidSelectedOption(i)&&e.isEquals(t,e.getOptionValue(i))}));if(i>-1)return{v:i}},n=this.modelValue.length-1;n>=0;n--)if(t=i())return t.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var o=-1;n.ObjectUtils.isNotEmpty(this.searchValue)&&(-1===(o=-1!==this.focusedOptionIndex?-1===(o=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):o+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(o=this.findFirstFocusedOptionIndex()),-1!==o&&this.changeFocusedOptionIndex(e,o)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!n.ObjectUtils.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,o=n.DomHandler.findSingle(e.list,'li[id="'.concat(i,'"]'));o?o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption:function(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:u.default},components:{VirtualScroller:d.default,SearchIcon:c.default}};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?y(Object(i),!0).forEach((function(t){I(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I(e,t,i){var n;return(t="symbol"==v(n=S(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function S(e,t){if("object"!=v(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var F=["id"],V=["tabindex"],M=["placeholder","aria-owns","aria-activedescendant","tabindex"],D=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],w=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],K=["tabindex"];return g.render=function(e,t,i,n,o,s){var l=r.resolveComponent("VirtualScroller"),a=r.resolveDirective("ripple");return r.openBlock(),r.createElementBlock("div",r.mergeProps({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[r.createElementVNode("span",r.mergeProps({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,V),r.renderSlot(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[r.createElementVNode("div",r.mergeProps({class:e.cx("filterContainer")},e.ptm("filterContainer")),[r.withDirectives(r.createElementVNode("input",r.mergeProps({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},x(x({},e.filterInputProps),e.ptm("filterInput"))),null,16,M),[[r.vModelText,o.filterValue]]),r.renderSlot(e.$slots,"filtericon",{class:r.normalizeClass(e.cx("filterIcon"))},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.filterIcon?"span":"SearchIcon"),r.mergeProps({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.filterResultMessageText),17)],16)):r.createCommentVNode("",!0),r.createElementVNode("div",r.mergeProps({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[r.createVNode(l,r.mergeProps({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),r.createSlots({content:r.withCtx((function(i){var n=i.styleClass,l=i.contentRef,c=i.items,u=i.getItemOptions,d=i.contentStyle,p=i.itemSize;return[r.createElementVNode("ul",r.mergeProps({ref:function(e){return s.listRef(e,l)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c,(function(i,n){return r.openBlock(),r.createElementBlock(r.Fragment,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[r.renderSlot(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[r.createTextVNode(r.toDisplayString(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,w)):r.withDirectives((r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[r.renderSlot(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[r.createTextVNode(r.toDisplayString(s.getOptionLabel(i)),1)]}))],16,E)),[[a]])],64)})),128)),o.filterValue&&(!c||c&&0===c.length)?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[r.renderSlot(e.$slots,"emptyfilter",{},(function(){return[r.createTextVNode(r.toDisplayString(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[r.renderSlot(e.$slots,"empty",{},(function(){return[r.createTextVNode(r.toDisplayString(s.emptyMessageText),1)]}))],16)):r.createCommentVNode("",!0)],16,D)]})),_:2},[e.$slots.loader?{name:"loader",fn:r.withCtx((function(t){return[r.renderSlot(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),r.renderSlot(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.emptyMessageText),17)):r.createCommentVNode("",!0),r.createElementVNode("span",r.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),r.toDisplayString(s.selectedMessageText),17),r.createElementVNode("span",r.mergeProps({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,K)],16,F)},g}(primevue.api,primevue.icons.search,primevue.ripple,primevue.utils,primevue.virtualscroller,primevue.basecomponent,primevue.listbox.style,Vue);
@@ -142,6 +142,7 @@ export default {
142
142
  onListFocus(event) {
143
143
  this.focused = true;
144
144
  this.findCurrentFocusedIndex();
145
+ this.scrollInView(this.focusedOptionIndex);
145
146
  this.$emit('focus', event);
146
147
  },
147
148
  onListBlur(event) {
@@ -189,9 +190,7 @@ export default {
189
190
  }
190
191
  },
191
192
  onOptionMouseDown(event, index) {
192
- this.focused = true;
193
- this.focusedOptionIndex = `${this.id}_${index}`;
194
- event.preventDefault();
193
+ this.changeFocusedOptionIndex(index);
195
194
  },
196
195
  onOptionMouseMove(index) {
197
196
  if (this.focusOnHover && this.focused) {
@@ -282,13 +281,13 @@ export default {
282
281
  return DomHandler.findSingle(this.list, `[data-pc-section="item"][id=${this.focusedOptionIndex}]`);
283
282
  },
284
283
  findCurrentFocusedIndex() {
285
- this.focusedOptionIndex = this.findFirstSelectedOptionIndex();
284
+ if (this.focusedOptionIndex === -1) {
285
+ this.focusedOptionIndex = this.findFirstSelectedOptionIndex();
286
286
 
287
- if (this.autoOptionFocus && this.focusedOptionIndex === -1) {
288
- this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
287
+ if (this.autoOptionFocus && this.focusedOptionIndex === -1) {
288
+ this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
289
+ }
289
290
  }
290
-
291
- this.scrollInView(this.focusedOptionIndex);
292
291
  },
293
292
  findFirstFocusedOptionIndex() {
294
293
  const firstFocusableItem = DomHandler.findSingle(this.list, '[data-pc-section="item"]');
@@ -340,7 +339,7 @@ export default {
340
339
  const element = DomHandler.findSingle(this.list, `[data-pc-section="item"][id="${id}"]`);
341
340
 
342
341
  if (element) {
343
- element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' });
342
+ element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start', behavior: 'smooth' });
344
343
  }
345
344
  },
346
345
  moveUp(event) {
@@ -167,6 +167,7 @@ var script = {
167
167
  onListFocus: function onListFocus(event) {
168
168
  this.focused = true;
169
169
  this.findCurrentFocusedIndex();
170
+ this.scrollInView(this.focusedOptionIndex);
170
171
  this.$emit('focus', event);
171
172
  },
172
173
  onListBlur: function onListBlur(event) {
@@ -204,9 +205,7 @@ var script = {
204
205
  }
205
206
  },
206
207
  onOptionMouseDown: function onOptionMouseDown(event, index) {
207
- this.focused = true;
208
- this.focusedOptionIndex = "".concat(this.id, "_").concat(index);
209
- event.preventDefault();
208
+ this.changeFocusedOptionIndex(index);
210
209
  },
211
210
  onOptionMouseMove: function onOptionMouseMove(index) {
212
211
  if (this.focusOnHover && this.focused) {
@@ -284,11 +283,12 @@ var script = {
284
283
  return utils.DomHandler.findSingle(this.list, "[data-pc-section=\"item\"][id=".concat(this.focusedOptionIndex, "]"));
285
284
  },
286
285
  findCurrentFocusedIndex: function findCurrentFocusedIndex() {
287
- this.focusedOptionIndex = this.findFirstSelectedOptionIndex();
288
- if (this.autoOptionFocus && this.focusedOptionIndex === -1) {
289
- this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
286
+ if (this.focusedOptionIndex === -1) {
287
+ this.focusedOptionIndex = this.findFirstSelectedOptionIndex();
288
+ if (this.autoOptionFocus && this.focusedOptionIndex === -1) {
289
+ this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
290
+ }
290
291
  }
291
- this.scrollInView(this.focusedOptionIndex);
292
292
  },
293
293
  findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {
294
294
  var firstFocusableItem = utils.DomHandler.findSingle(this.list, '[data-pc-section="item"]');
@@ -334,7 +334,8 @@ var script = {
334
334
  if (element) {
335
335
  element.scrollIntoView && element.scrollIntoView({
336
336
  block: 'nearest',
337
- inline: 'start'
337
+ inline: 'start',
338
+ behavior: 'smooth'
338
339
  });
339
340
  }
340
341
  },