primevue 3.15.0 → 3.16.2

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 (387) hide show
  1. package/autocomplete/AutoComplete.d.ts +182 -38
  2. package/autocomplete/AutoComplete.vue +636 -342
  3. package/autocomplete/autocomplete.cjs.js +745 -416
  4. package/autocomplete/autocomplete.cjs.min.js +1 -1
  5. package/autocomplete/autocomplete.esm.js +747 -418
  6. package/autocomplete/autocomplete.esm.min.js +1 -1
  7. package/autocomplete/autocomplete.js +745 -416
  8. package/autocomplete/autocomplete.min.js +1 -1
  9. package/button/Button.vue +4 -1
  10. package/button/button.cjs.js +5 -1
  11. package/button/button.cjs.min.js +1 -1
  12. package/button/button.esm.js +5 -1
  13. package/button/button.esm.min.js +1 -1
  14. package/button/button.js +5 -1
  15. package/button/button.min.js +1 -1
  16. package/calendar/Calendar.d.ts +51 -12
  17. package/calendar/Calendar.vue +259 -114
  18. package/calendar/calendar.cjs.js +414 -220
  19. package/calendar/calendar.cjs.min.js +1 -1
  20. package/calendar/calendar.esm.js +415 -221
  21. package/calendar/calendar.esm.min.js +1 -1
  22. package/calendar/calendar.js +414 -220
  23. package/calendar/calendar.min.js +1 -1
  24. package/carousel/Carousel.vue +25 -0
  25. package/carousel/carousel.cjs.js +25 -0
  26. package/carousel/carousel.cjs.min.js +1 -1
  27. package/carousel/carousel.esm.js +25 -0
  28. package/carousel/carousel.esm.min.js +1 -1
  29. package/carousel/carousel.js +25 -0
  30. package/carousel/carousel.min.js +1 -1
  31. package/cascadeselect/CascadeSelect.d.ts +97 -17
  32. package/cascadeselect/CascadeSelect.vue +560 -135
  33. package/cascadeselect/CascadeSelectSub.vue +48 -129
  34. package/cascadeselect/cascadeselect.cjs.js +670 -306
  35. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  36. package/cascadeselect/cascadeselect.esm.js +672 -308
  37. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  38. package/cascadeselect/cascadeselect.js +670 -306
  39. package/cascadeselect/cascadeselect.min.js +1 -1
  40. package/checkbox/Checkbox.d.ts +40 -4
  41. package/checkbox/Checkbox.vue +50 -13
  42. package/checkbox/checkbox.cjs.js +64 -23
  43. package/checkbox/checkbox.cjs.min.js +1 -1
  44. package/checkbox/checkbox.esm.js +65 -24
  45. package/checkbox/checkbox.esm.min.js +1 -1
  46. package/checkbox/checkbox.js +64 -23
  47. package/checkbox/checkbox.min.js +1 -1
  48. package/chips/Chips.d.ts +36 -12
  49. package/chips/Chips.vue +116 -22
  50. package/chips/chips.cjs.js +149 -37
  51. package/chips/chips.cjs.min.js +1 -1
  52. package/chips/chips.esm.js +150 -38
  53. package/chips/chips.esm.min.js +1 -1
  54. package/chips/chips.js +150 -39
  55. package/chips/chips.min.js +1 -1
  56. package/colorpicker/ColorPicker.d.ts +3 -6
  57. package/colorpicker/ColorPicker.vue +1 -5
  58. package/colorpicker/colorpicker.cjs.js +2 -7
  59. package/colorpicker/colorpicker.cjs.min.js +1 -1
  60. package/colorpicker/colorpicker.esm.js +2 -7
  61. package/colorpicker/colorpicker.esm.min.js +1 -1
  62. package/colorpicker/colorpicker.js +2 -7
  63. package/colorpicker/colorpicker.min.js +1 -1
  64. package/column/Column.d.ts +4 -0
  65. package/column/Column.vue +4 -0
  66. package/column/column.cjs.js +4 -0
  67. package/column/column.cjs.min.js +1 -1
  68. package/column/column.esm.js +4 -0
  69. package/column/column.esm.min.js +1 -1
  70. package/column/column.js +4 -0
  71. package/column/column.min.js +1 -1
  72. package/config/PrimeVue.d.ts +42 -0
  73. package/config/config.cjs.js +35 -4
  74. package/config/config.cjs.min.js +1 -1
  75. package/config/config.esm.js +35 -4
  76. package/config/config.esm.min.js +1 -1
  77. package/config/config.js +35 -4
  78. package/config/config.min.js +1 -1
  79. package/confirmdialog/ConfirmDialog.vue +4 -1
  80. package/confirmdialog/confirmdialog.cjs.js +6 -2
  81. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  82. package/confirmdialog/confirmdialog.esm.js +6 -2
  83. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  84. package/confirmdialog/confirmdialog.js +6 -2
  85. package/confirmdialog/confirmdialog.min.js +1 -1
  86. package/contextmenu/ContextMenu.d.ts +1 -1
  87. package/contextmenu/ContextMenuSub.vue +3 -3
  88. package/contextmenu/contextmenu.cjs.js +14 -8
  89. package/contextmenu/contextmenu.cjs.min.js +1 -1
  90. package/contextmenu/contextmenu.esm.js +15 -9
  91. package/contextmenu/contextmenu.esm.min.js +1 -1
  92. package/contextmenu/contextmenu.js +14 -8
  93. package/contextmenu/contextmenu.min.js +1 -1
  94. package/core/core.js +1128 -772
  95. package/core/core.min.js +12 -12
  96. package/datatable/BodyCell.vue +11 -2
  97. package/datatable/DataTable.vue +23 -2
  98. package/datatable/datatable.cjs.js +34 -4
  99. package/datatable/datatable.cjs.min.js +1 -1
  100. package/datatable/datatable.esm.js +34 -4
  101. package/datatable/datatable.esm.min.js +1 -1
  102. package/datatable/datatable.js +34 -4
  103. package/datatable/datatable.min.js +1 -1
  104. package/dialog/Dialog.d.ts +5 -1
  105. package/dropdown/Dropdown.d.ts +92 -38
  106. package/dropdown/Dropdown.vue +538 -399
  107. package/dropdown/dropdown.cjs.js +657 -486
  108. package/dropdown/dropdown.cjs.min.js +1 -1
  109. package/dropdown/dropdown.esm.js +659 -488
  110. package/dropdown/dropdown.esm.min.js +1 -1
  111. package/dropdown/dropdown.js +657 -486
  112. package/dropdown/dropdown.min.js +1 -1
  113. package/editor/Editor.d.ts +32 -0
  114. package/editor/Editor.vue +15 -1
  115. package/editor/editor.cjs.js +15 -1
  116. package/editor/editor.cjs.min.js +1 -1
  117. package/editor/editor.esm.js +15 -1
  118. package/editor/editor.esm.min.js +1 -1
  119. package/editor/editor.js +15 -1
  120. package/editor/editor.min.js +1 -1
  121. package/inputmask/InputMask.vue +9 -6
  122. package/inputmask/inputmask.cjs.js +14 -6
  123. package/inputmask/inputmask.cjs.min.js +1 -1
  124. package/inputmask/inputmask.esm.js +15 -7
  125. package/inputmask/inputmask.esm.min.js +1 -1
  126. package/inputmask/inputmask.js +14 -6
  127. package/inputmask/inputmask.min.js +1 -1
  128. package/inputnumber/InputNumber.d.ts +31 -7
  129. package/inputnumber/InputNumber.vue +53 -20
  130. package/inputnumber/inputnumber.cjs.js +75 -29
  131. package/inputnumber/inputnumber.cjs.min.js +1 -1
  132. package/inputnumber/inputnumber.esm.js +76 -30
  133. package/inputnumber/inputnumber.esm.min.js +1 -1
  134. package/inputnumber/inputnumber.js +75 -29
  135. package/inputnumber/inputnumber.min.js +1 -1
  136. package/inputswitch/InputSwitch.d.ts +24 -8
  137. package/inputswitch/InputSwitch.vue +27 -12
  138. package/inputswitch/inputswitch.cjs.js +38 -20
  139. package/inputswitch/inputswitch.cjs.min.js +1 -1
  140. package/inputswitch/inputswitch.esm.js +39 -21
  141. package/inputswitch/inputswitch.esm.min.js +1 -1
  142. package/inputswitch/inputswitch.js +38 -20
  143. package/inputswitch/inputswitch.min.js +1 -1
  144. package/inputtext/InputText.vue +1 -2
  145. package/inputtext/inputtext.cjs.js +3 -4
  146. package/inputtext/inputtext.cjs.min.js +1 -1
  147. package/inputtext/inputtext.esm.js +4 -5
  148. package/inputtext/inputtext.esm.min.js +1 -1
  149. package/inputtext/inputtext.js +3 -4
  150. package/inputtext/inputtext.min.js +1 -1
  151. package/knob/Knob.d.ts +12 -0
  152. package/knob/Knob.vue +62 -2
  153. package/knob/knob.cjs.js +73 -5
  154. package/knob/knob.cjs.min.js +1 -1
  155. package/knob/knob.esm.js +73 -5
  156. package/knob/knob.esm.min.js +1 -1
  157. package/knob/knob.js +73 -5
  158. package/knob/knob.min.js +1 -1
  159. package/listbox/Listbox.d.ts +53 -7
  160. package/listbox/Listbox.vue +500 -135
  161. package/listbox/listbox.cjs.js +597 -193
  162. package/listbox/listbox.cjs.min.js +1 -1
  163. package/listbox/listbox.esm.js +599 -195
  164. package/listbox/listbox.esm.min.js +1 -1
  165. package/listbox/listbox.js +597 -193
  166. package/listbox/listbox.min.js +1 -1
  167. package/menu/Menu.d.ts +1 -1
  168. package/menu/Menuitem.vue +2 -2
  169. package/menu/menu.cjs.js +12 -6
  170. package/menu/menu.cjs.min.js +1 -1
  171. package/menu/menu.esm.js +13 -7
  172. package/menu/menu.esm.min.js +1 -1
  173. package/menu/menu.js +12 -6
  174. package/menu/menu.min.js +1 -1
  175. package/menubar/MenubarSub.vue +3 -3
  176. package/menubar/menubar.cjs.js +14 -8
  177. package/menubar/menubar.cjs.min.js +1 -1
  178. package/menubar/menubar.esm.js +15 -9
  179. package/menubar/menubar.esm.min.js +1 -1
  180. package/menubar/menubar.js +14 -8
  181. package/menubar/menubar.min.js +1 -1
  182. package/menuitem/MenuItem.d.ts +1 -1
  183. package/multiselect/MultiSelect.d.ts +111 -51
  184. package/multiselect/MultiSelect.vue +629 -338
  185. package/multiselect/multiselect.cjs.js +748 -428
  186. package/multiselect/multiselect.cjs.min.js +1 -1
  187. package/multiselect/multiselect.esm.js +750 -430
  188. package/multiselect/multiselect.esm.min.js +1 -1
  189. package/multiselect/multiselect.js +748 -428
  190. package/multiselect/multiselect.min.js +1 -1
  191. package/overlaypanel/OverlayPanel.d.ts +1 -1
  192. package/overlaypanel/OverlayPanel.vue +14 -2
  193. package/overlaypanel/overlaypanel.cjs.js +14 -2
  194. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  195. package/overlaypanel/overlaypanel.esm.js +14 -2
  196. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  197. package/overlaypanel/overlaypanel.js +14 -2
  198. package/overlaypanel/overlaypanel.min.js +1 -1
  199. package/package.json +2 -2
  200. package/paginator/Paginator.d.ts +2 -2
  201. package/password/Password.d.ts +36 -8
  202. package/password/Password.vue +50 -14
  203. package/password/password.cjs.js +69 -24
  204. package/password/password.cjs.min.js +1 -1
  205. package/password/password.esm.js +71 -26
  206. package/password/password.esm.min.js +1 -1
  207. package/password/password.js +69 -24
  208. package/password/password.min.js +1 -1
  209. package/picklist/PickList.d.ts +8 -0
  210. package/picklist/PickList.vue +10 -2
  211. package/picklist/picklist.cjs.js +68 -50
  212. package/picklist/picklist.cjs.min.js +1 -1
  213. package/picklist/picklist.esm.js +69 -51
  214. package/picklist/picklist.esm.min.js +1 -1
  215. package/picklist/picklist.js +68 -50
  216. package/picklist/picklist.min.js +1 -1
  217. package/portal/Portal.d.ts +1 -1
  218. package/radiobutton/RadioButton.d.ts +28 -4
  219. package/radiobutton/RadioButton.vue +36 -11
  220. package/radiobutton/radiobutton.cjs.js +49 -23
  221. package/radiobutton/radiobutton.cjs.min.js +1 -1
  222. package/radiobutton/radiobutton.esm.js +50 -24
  223. package/radiobutton/radiobutton.esm.min.js +1 -1
  224. package/radiobutton/radiobutton.js +49 -23
  225. package/radiobutton/radiobutton.min.js +1 -1
  226. package/rating/Rating.d.ts +4 -0
  227. package/rating/Rating.vue +61 -7
  228. package/rating/rating.cjs.js +90 -16
  229. package/rating/rating.cjs.min.js +1 -1
  230. package/rating/rating.esm.js +91 -17
  231. package/rating/rating.esm.min.js +1 -1
  232. package/rating/rating.js +90 -16
  233. package/rating/rating.min.js +1 -1
  234. package/resources/primevue.css +8 -0
  235. package/resources/primevue.min.css +1 -1
  236. package/resources/themes/arya-blue/theme.css +82 -40
  237. package/resources/themes/arya-green/theme.css +82 -40
  238. package/resources/themes/arya-orange/theme.css +82 -40
  239. package/resources/themes/arya-purple/theme.css +82 -40
  240. package/resources/themes/bootstrap4-dark-blue/theme.css +82 -40
  241. package/resources/themes/bootstrap4-dark-purple/theme.css +82 -40
  242. package/resources/themes/bootstrap4-light-blue/theme.css +82 -40
  243. package/resources/themes/bootstrap4-light-purple/theme.css +82 -40
  244. package/resources/themes/fluent-light/theme.css +82 -40
  245. package/resources/themes/lara-dark-blue/theme.css +82 -40
  246. package/resources/themes/lara-dark-indigo/theme.css +82 -40
  247. package/resources/themes/lara-dark-purple/theme.css +82 -40
  248. package/resources/themes/lara-dark-teal/theme.css +82 -40
  249. package/resources/themes/lara-light-blue/theme.css +82 -40
  250. package/resources/themes/lara-light-indigo/theme.css +82 -40
  251. package/resources/themes/lara-light-purple/theme.css +82 -40
  252. package/resources/themes/lara-light-teal/theme.css +82 -40
  253. package/resources/themes/luna-amber/theme.css +82 -40
  254. package/resources/themes/luna-blue/theme.css +82 -40
  255. package/resources/themes/luna-green/theme.css +82 -40
  256. package/resources/themes/luna-pink/theme.css +82 -40
  257. package/resources/themes/md-dark-deeppurple/theme.css +82 -40
  258. package/resources/themes/md-dark-indigo/theme.css +82 -40
  259. package/resources/themes/md-light-deeppurple/theme.css +82 -40
  260. package/resources/themes/md-light-indigo/theme.css +82 -40
  261. package/resources/themes/mdc-dark-deeppurple/theme.css +82 -40
  262. package/resources/themes/mdc-dark-indigo/theme.css +82 -40
  263. package/resources/themes/mdc-light-deeppurple/theme.css +82 -40
  264. package/resources/themes/mdc-light-indigo/theme.css +82 -40
  265. package/resources/themes/nova/theme.css +82 -40
  266. package/resources/themes/nova-accent/theme.css +82 -40
  267. package/resources/themes/nova-alt/theme.css +82 -40
  268. package/resources/themes/nova-vue/theme.css +82 -40
  269. package/resources/themes/rhea/theme.css +82 -40
  270. package/resources/themes/saga-blue/theme.css +82 -40
  271. package/resources/themes/saga-green/theme.css +82 -40
  272. package/resources/themes/saga-orange/theme.css +82 -40
  273. package/resources/themes/saga-purple/theme.css +82 -40
  274. package/resources/themes/tailwind-light/theme.css +82 -40
  275. package/resources/themes/vela-blue/theme.css +82 -40
  276. package/resources/themes/vela-green/theme.css +82 -40
  277. package/resources/themes/vela-orange/theme.css +82 -40
  278. package/resources/themes/vela-purple/theme.css +82 -40
  279. package/ripple/ripple.cjs.js +1 -0
  280. package/ripple/ripple.cjs.min.js +1 -1
  281. package/ripple/ripple.esm.js +1 -0
  282. package/ripple/ripple.esm.min.js +1 -1
  283. package/ripple/ripple.js +1 -0
  284. package/ripple/ripple.min.js +1 -1
  285. package/selectbutton/SelectButton.d.ts +6 -2
  286. package/selectbutton/SelectButton.vue +89 -12
  287. package/selectbutton/selectbutton.cjs.js +97 -22
  288. package/selectbutton/selectbutton.cjs.min.js +1 -1
  289. package/selectbutton/selectbutton.esm.js +99 -24
  290. package/selectbutton/selectbutton.esm.min.js +1 -1
  291. package/selectbutton/selectbutton.js +97 -22
  292. package/selectbutton/selectbutton.min.js +1 -1
  293. package/slider/Slider.d.ts +9 -1
  294. package/slider/Slider.vue +50 -34
  295. package/slider/slider.cjs.js +59 -38
  296. package/slider/slider.cjs.min.js +1 -1
  297. package/slider/slider.esm.js +59 -38
  298. package/slider/slider.esm.min.js +1 -1
  299. package/slider/slider.js +59 -38
  300. package/slider/slider.min.js +1 -1
  301. package/splitbutton/SplitButton.d.ts +1 -1
  302. package/splitter/Splitter.vue +30 -1
  303. package/splitter/splitter.cjs.js +30 -1
  304. package/splitter/splitter.cjs.min.js +1 -1
  305. package/splitter/splitter.esm.js +30 -1
  306. package/splitter/splitter.esm.min.js +1 -1
  307. package/splitter/splitter.js +30 -1
  308. package/splitter/splitter.min.js +1 -1
  309. package/textarea/Textarea.vue +1 -2
  310. package/textarea/textarea.cjs.js +3 -5
  311. package/textarea/textarea.cjs.min.js +1 -1
  312. package/textarea/textarea.esm.js +4 -6
  313. package/textarea/textarea.esm.min.js +1 -1
  314. package/textarea/textarea.js +3 -5
  315. package/textarea/textarea.min.js +1 -1
  316. package/tieredmenu/TieredMenu.d.ts +1 -1
  317. package/tieredmenu/TieredMenuSub.vue +3 -3
  318. package/tieredmenu/tieredmenu.cjs.js +14 -8
  319. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  320. package/tieredmenu/tieredmenu.esm.js +15 -9
  321. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  322. package/tieredmenu/tieredmenu.js +14 -8
  323. package/tieredmenu/tieredmenu.min.js +1 -1
  324. package/timeline/Timeline.d.ts +10 -1
  325. package/timeline/Timeline.vue +1 -1
  326. package/timeline/timeline.cjs.js +5 -1
  327. package/timeline/timeline.cjs.min.js +1 -1
  328. package/timeline/timeline.esm.js +5 -1
  329. package/timeline/timeline.esm.min.js +1 -1
  330. package/timeline/timeline.js +5 -1
  331. package/timeline/timeline.min.js +1 -1
  332. package/togglebutton/ToggleButton.d.ts +42 -0
  333. package/togglebutton/ToggleButton.vue +44 -7
  334. package/togglebutton/togglebutton.cjs.js +59 -13
  335. package/togglebutton/togglebutton.cjs.min.js +1 -1
  336. package/togglebutton/togglebutton.esm.js +60 -14
  337. package/togglebutton/togglebutton.esm.min.js +1 -1
  338. package/togglebutton/togglebutton.js +59 -13
  339. package/togglebutton/togglebutton.min.js +1 -1
  340. package/tooltip/tooltip.cjs.js +20 -11
  341. package/tooltip/tooltip.cjs.min.js +1 -1
  342. package/tooltip/tooltip.esm.js +21 -12
  343. package/tooltip/tooltip.esm.min.js +1 -1
  344. package/tooltip/tooltip.js +20 -11
  345. package/tooltip/tooltip.min.js +1 -1
  346. package/tree/Tree.vue +5 -1
  347. package/tree/TreeNode.vue +20 -19
  348. package/tree/tree.cjs.js +47 -32
  349. package/tree/tree.cjs.min.js +1 -1
  350. package/tree/tree.esm.js +47 -32
  351. package/tree/tree.esm.min.js +1 -1
  352. package/tree/tree.js +47 -32
  353. package/tree/tree.min.js +1 -1
  354. package/treeselect/TreeSelect.d.ts +26 -10
  355. package/treeselect/TreeSelect.vue +52 -29
  356. package/treeselect/treeselect.cjs.js +74 -41
  357. package/treeselect/treeselect.cjs.min.js +1 -1
  358. package/treeselect/treeselect.esm.js +76 -43
  359. package/treeselect/treeselect.esm.min.js +1 -1
  360. package/treeselect/treeselect.js +74 -41
  361. package/treeselect/treeselect.min.js +1 -1
  362. package/tristatecheckbox/TriStateCheckbox.d.ts +20 -4
  363. package/tristatecheckbox/TriStateCheckbox.vue +52 -15
  364. package/tristatecheckbox/tristatecheckbox.cjs.js +67 -26
  365. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  366. package/tristatecheckbox/tristatecheckbox.esm.js +68 -27
  367. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  368. package/tristatecheckbox/tristatecheckbox.js +67 -26
  369. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  370. package/utils/Utils.d.ts +3 -2
  371. package/utils/utils.cjs.js +239 -173
  372. package/utils/utils.cjs.min.js +1 -1
  373. package/utils/utils.esm.js +239 -173
  374. package/utils/utils.esm.min.js +1 -1
  375. package/utils/utils.js +239 -173
  376. package/utils/utils.min.js +1 -1
  377. package/vetur-attributes.json +612 -136
  378. package/vetur-tags.json +180 -59
  379. package/virtualscroller/VirtualScroller.d.ts +10 -0
  380. package/virtualscroller/VirtualScroller.vue +18 -17
  381. package/virtualscroller/virtualscroller.cjs.js +22 -20
  382. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  383. package/virtualscroller/virtualscroller.esm.js +22 -20
  384. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  385. package/virtualscroller/virtualscroller.js +22 -20
  386. package/virtualscroller/virtualscroller.min.js +1 -1
  387. package/web-types.json +1745 -338
@@ -17,7 +17,7 @@ var Portal__default = /*#__PURE__*/_interopDefaultLegacy(Portal);
17
17
 
18
18
  var script = {
19
19
  name: 'Dropdown',
20
- emits: ['update:modelValue', 'before-show', 'before-hide', 'show', 'hide', 'change', 'filter', 'focus', 'blur'],
20
+ emits: ['update:modelValue', 'change', 'focus', 'blur', 'before-show', 'before-hide', 'show', 'hide', 'filter'],
21
21
  props: {
22
22
  modelValue: null,
23
23
  options: Array,
@@ -47,12 +47,46 @@ var script = {
47
47
  dataKey: null,
48
48
  showClear: Boolean,
49
49
  inputId: String,
50
- tabindex: String,
51
- ariaLabelledBy: null,
50
+ inputStyle: null,
51
+ inputClass: null,
52
+ inputProps: null,
53
+ panelStyle: null,
54
+ panelClass: null,
55
+ panelProps: null,
56
+ filterInputProps: null,
57
+ clearIconProps: null,
52
58
  appendTo: {
53
59
  type: String,
54
60
  default: 'body'
55
61
  },
62
+ loading: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ loadingIcon: {
67
+ type: String,
68
+ default: 'pi pi-spinner pi-spin'
69
+ },
70
+ virtualScrollerOptions: {
71
+ type: Object,
72
+ default: null
73
+ },
74
+ autoOptionFocus: {
75
+ type: Boolean,
76
+ default: true
77
+ },
78
+ filterMessage: {
79
+ type: String,
80
+ default: null
81
+ },
82
+ selectionMessage: {
83
+ type: String,
84
+ default: null
85
+ },
86
+ emptySelectionMessage: {
87
+ type: String,
88
+ default: null
89
+ },
56
90
  emptyFilterMessage: {
57
91
  type: String,
58
92
  default: null
@@ -61,46 +95,55 @@ var script = {
61
95
  type: String,
62
96
  default: null
63
97
  },
64
- panelClass: null,
65
- loading: {
66
- type: Boolean,
67
- default: false
98
+ tabindex: {
99
+ type: Number,
100
+ default: 0
68
101
  },
69
- loadingIcon: {
102
+ 'aria-label': {
70
103
  type: String,
71
- default: 'pi pi-spinner pi-spin'
104
+ default: null
72
105
  },
73
- virtualScrollerOptions: {
74
- type: Object,
106
+ 'aria-labelledby': {
107
+ type: String,
75
108
  default: null
76
109
  }
77
110
  },
111
+ outsideClickListener: null,
112
+ scrollHandler: null,
113
+ resizeListener: null,
114
+ overlay: null,
115
+ list: null,
116
+ virtualScroller: null,
117
+ searchTimeout: null,
118
+ searchValue: null,
119
+ isModelValueChanged: false,
120
+ selectOnFocus: false,
121
+ focusOnHover: false,
78
122
  data() {
79
123
  return {
124
+ id: utils.UniqueComponentId(),
80
125
  focused: false,
126
+ focusedOptionIndex: -1,
81
127
  filterValue: null,
82
128
  overlayVisible: false
83
- };
129
+ }
84
130
  },
85
131
  watch: {
86
132
  modelValue() {
87
133
  this.isModelValueChanged = true;
134
+ },
135
+ options() {
136
+ this.autoUpdateModel();
88
137
  }
89
138
  },
90
- outsideClickListener: null,
91
- scrollHandler: null,
92
- resizeListener: null,
93
- searchTimeout: null,
94
- currentSearchChar: null,
95
- previousSearchChar: null,
96
- searchValue: null,
97
- overlay: null,
98
- itemsWrapper: null,
99
- virtualScroller: null,
100
- isModelValueChanged: false,
139
+ mounted() {
140
+ this.id = this.$attrs.id || this.id;
141
+
142
+ this.autoUpdateModel();
143
+ },
101
144
  updated() {
102
145
  if (this.overlayVisible && this.isModelValueChanged) {
103
- this.scrollValueInView();
146
+ this.scrollInView(this.findSelectedOptionIndex());
104
147
  }
105
148
 
106
149
  this.isModelValueChanged = false;
@@ -114,8 +157,6 @@ var script = {
114
157
  this.scrollHandler = null;
115
158
  }
116
159
 
117
- this.itemsWrapper = null;
118
-
119
160
  if (this.overlay) {
120
161
  utils.ZIndexUtils.clear(this.overlay);
121
162
  this.overlay = null;
@@ -132,13 +173,13 @@ var script = {
132
173
  return this.optionValue ? utils.ObjectUtils.resolveFieldData(option, this.optionValue) : option;
133
174
  },
134
175
  getOptionRenderKey(option, index) {
135
- return this.dataKey ? utils.ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option) + '_' + index.toString();
176
+ return (this.dataKey ? utils.ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index;
136
177
  },
137
178
  isOptionDisabled(option) {
138
179
  return this.optionDisabled ? utils.ObjectUtils.resolveFieldData(option, this.optionDisabled) : false;
139
180
  },
140
- getOptionGroupRenderKey(optionGroup) {
141
- return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
181
+ isOptionGroup(option) {
182
+ return this.optionGroupLabel && option.optionGroup && option.group;
142
183
  },
143
184
  getOptionGroupLabel(optionGroup) {
144
185
  return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
@@ -146,254 +187,333 @@ var script = {
146
187
  getOptionGroupChildren(optionGroup) {
147
188
  return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren);
148
189
  },
149
- getSelectedOption() {
150
- let index = this.getSelectedOptionIndex();
151
- return index !== -1 ? (this.optionGroupLabel ? this.getOptionGroupChildren(this.visibleOptions[index.group])[index.option]: this.visibleOptions[index]) : null;
152
- },
153
- getSelectedOptionIndex() {
154
- if (this.modelValue != null && this.visibleOptions) {
155
- if (this.optionGroupLabel) {
156
- for (let i = 0; i < this.visibleOptions.length; i++) {
157
- let selectedOptionIndex = this.findOptionIndexInList(this.modelValue, this.getOptionGroupChildren(this.visibleOptions[i]));
158
- if (selectedOptionIndex !== -1) {
159
- return {group: i, option: selectedOptionIndex};
160
- }
161
- }
162
- }
163
- else {
164
- return this.findOptionIndexInList(this.modelValue, this.visibleOptions);
165
- }
166
- }
167
-
168
- return -1;
169
- },
170
- findOptionIndexInList(value, list) {
171
- for (let i = 0; i < list.length; i++) {
172
- if ((utils.ObjectUtils.equals(value, this.getOptionValue(list[i]), this.equalityKey))) {
173
- return i;
174
- }
175
- }
176
-
177
- return -1;
178
- },
179
- isSelected(option) {
180
- return utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
190
+ getAriaPosInset(index) {
191
+ return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(option => this.isOptionGroup(option)).length : index) + 1;
181
192
  },
182
193
  show(isFocus) {
183
194
  this.$emit('before-show');
184
195
  this.overlayVisible = true;
196
+ this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : (this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1);
185
197
 
186
198
  isFocus && this.$refs.focusInput.focus();
187
199
  },
188
- hide() {
189
- this.$emit('before-hide');
190
- this.overlayVisible = false;
200
+ hide(isFocus) {
201
+ const _hide = () => {
202
+ this.$emit('before-hide');
203
+ this.overlayVisible = false;
204
+ this.focusedOptionIndex = -1;
205
+ this.searchValue = '';
206
+
207
+ isFocus && this.$refs.focusInput.focus();
208
+ };
209
+
210
+ setTimeout(() => { _hide(); }, 0); // For ScreenReaders
191
211
  },
192
212
  onFocus(event) {
193
213
  this.focused = true;
214
+ this.focusedOptionIndex = this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1;
215
+ this.overlayVisible && this.scrollInView(this.focusedOptionIndex);
194
216
  this.$emit('focus', event);
195
217
  },
196
218
  onBlur(event) {
197
219
  this.focused = false;
220
+ this.focusedOptionIndex = -1;
221
+ this.searchValue = '';
198
222
  this.$emit('blur', event);
199
223
  },
200
224
  onKeyDown(event) {
201
- switch(event.which) {
202
- //down
203
- case 40:
204
- this.onDownKey(event);
205
- break;
206
-
207
- //up
208
- case 38:
209
- this.onUpKey(event);
210
- break;
211
-
212
- //space
213
- case 32:
214
- if (!this.overlayVisible) {
215
- this.show();
216
- event.preventDefault();
217
- }
218
- break;
225
+ switch (event.code) {
226
+ case 'ArrowDown':
227
+ this.onArrowDownKey(event);
228
+ break;
219
229
 
220
- //enter and escape
221
- case 13:
222
- case 27:
223
- if (this.overlayVisible) {
224
- this.hide();
225
- event.preventDefault();
226
- }
227
- break;
230
+ case 'ArrowUp':
231
+ this.onArrowUpKey(event, this.editable);
232
+ break;
233
+
234
+ case 'ArrowLeft':
235
+ case 'ArrowRight':
236
+ this.onArrowLeftKey(event, this.editable);
237
+ break;
238
+
239
+ case 'Home':
240
+ this.onHomeKey(event, this.editable);
241
+ break;
242
+
243
+ case 'End':
244
+ this.onEndKey(event, this.editable);
245
+ break;
246
+
247
+ case 'PageDown':
248
+ this.onPageDownKey(event);
249
+ break;
228
250
 
229
- //tab
230
- case 9:
231
- this.hide();
232
- break;
251
+ case 'PageUp':
252
+ this.onPageUpKey(event);
253
+ break;
254
+
255
+ case 'Space':
256
+ this.onSpaceKey(event, this.editable);
257
+ break;
258
+
259
+ case 'Enter':
260
+ this.onEnterKey(event);
261
+ break;
262
+
263
+ case 'Escape':
264
+ this.onEscapeKey(event);
265
+ break;
266
+
267
+ case 'Tab':
268
+ this.onTabKey(event);
269
+ break;
270
+
271
+ case 'Backspace':
272
+ this.onBackspaceKey(event, this.editable);
273
+ break;
274
+
275
+ case 'ShiftLeft':
276
+ case 'ShiftRight':
277
+ //NOOP
278
+ break;
233
279
 
234
280
  default:
235
- this.search(event);
236
- break;
281
+ if (utils.ObjectUtils.isPrintableCharacter(event.key)) {
282
+ !this.overlayVisible && this.show();
283
+ !this.editable && this.searchOptions(event, event.key);
284
+ }
285
+
286
+ break;
287
+ }
288
+ },
289
+ onEditableInput(event) {
290
+ const value = event.target.value;
291
+
292
+ this.searchValue = '';
293
+ const matched = this.searchOptions(event, value);
294
+ !matched && (this.focusedOptionIndex = -1);
295
+
296
+ this.$emit('update:modelValue', value);
297
+ },
298
+ onContainerClick(event) {
299
+ if (this.disabled || this.loading) {
300
+ return;
301
+ }
302
+
303
+ if (utils.DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || event.target.tagName === 'INPUT') {
304
+ return;
305
+ }
306
+ else if (!this.overlay || !this.overlay.contains(event.target)) {
307
+ this.overlayVisible ? this.hide(true) : this.show(true);
308
+ }
309
+ },
310
+ onClearClick(event) {
311
+ this.updateModel(event, null);
312
+ },
313
+ onFirstHiddenFocus(event) {
314
+ const relatedTarget = event.relatedTarget;
315
+
316
+ if (relatedTarget === this.$refs.focusInput) {
317
+ const firstFocusableEl = utils.DomHandler.getFirstFocusableElement(this.overlay, ':not(.p-hidden-focusable)');
318
+ firstFocusableEl && firstFocusableEl.focus();
319
+ }
320
+ else {
321
+ this.$refs.focusInput.focus();
237
322
  }
238
323
  },
324
+ onLastHiddenFocus() {
325
+ this.$refs.firstHiddenFocusableElementOnOverlay.focus();
326
+ },
327
+ onOptionSelect(event, option) {
328
+ const value = this.getOptionValue(option);
329
+
330
+ this.updateModel(event, value);
331
+ this.hide(true);
332
+ },
333
+ onOptionMouseMove(event, index) {
334
+ if (this.focusOnHover) {
335
+ this.changeFocusedOptionIndex(event, index);
336
+ }
337
+ },
338
+ onFilterChange(event) {
339
+ const value = event.target.value;
340
+
341
+ this.filterValue = value;
342
+ this.focusedOptionIndex = -1;
343
+ this.$emit('filter', { originalEvent: event, value });
344
+
345
+ !this.virtualScrollerDisabled && this.virtualScroller.scrollToIndex(0);
346
+ },
239
347
  onFilterKeyDown(event) {
240
- switch (event.which) {
241
- //down
242
- case 40:
243
- this.onDownKey(event);
348
+ switch (event.code) {
349
+ case 'ArrowDown':
350
+ this.onArrowDownKey(event);
244
351
  break;
245
352
 
246
- //up
247
- case 38:
248
- this.onUpKey(event);
353
+ case 'ArrowUp':
354
+ this.onArrowUpKey(event, true);
249
355
  break;
250
356
 
251
- //enter and escape
252
- case 13:
253
- case 27:
254
- this.overlayVisible = false;
255
- event.preventDefault();
256
- break;
357
+ case 'ArrowLeft':
358
+ case 'ArrowRight':
359
+ this.onArrowLeftKey(event, true);
360
+ break;
361
+
362
+ case 'Home':
363
+ this.onHomeKey(event, true);
364
+ break;
365
+
366
+ case 'End':
367
+ this.onEndKey(event, true);
368
+ break;
369
+
370
+ case 'Enter':
371
+ this.onEnterKey(event);
372
+ break;
373
+
374
+ case 'Escape':
375
+ this.onEscapeKey(event);
376
+ break;
377
+
378
+ case 'Tab':
379
+ this.onTabKey(event, true);
380
+ break;
257
381
  }
258
382
  },
259
- onDownKey(event) {
260
- if (this.visibleOptions) {
261
- if (!this.overlayVisible && event.altKey) {
262
- this.show();
263
- }
264
- else {
265
- let nextOption = this.visibleOptions && this.visibleOptions.length > 0 ? this.findNextOption(this.getSelectedOptionIndex()) : null;
266
- if (nextOption) {
267
- this.updateModel(event, this.getOptionValue(nextOption));
268
- }
269
- }
383
+ onFilterBlur() {
384
+ this.focusedOptionIndex = -1;
385
+ },
386
+ onFilterUpdated() {
387
+ if (this.overlayVisible) {
388
+ this.alignOverlay();
270
389
  }
271
-
272
- event.preventDefault();
273
390
  },
274
- onUpKey(event) {
275
- if (this.visibleOptions) {
276
- let prevOption = this.findPrevOption(this.getSelectedOptionIndex());
277
- if (prevOption) {
278
- this.updateModel(event, this.getOptionValue(prevOption));
279
- }
391
+ onOverlayClick(event) {
392
+ OverlayEventBus__default["default"].emit('overlay-click', {
393
+ originalEvent: event,
394
+ target: this.$el
395
+ });
396
+ },
397
+ onOverlayKeyDown(event) {
398
+ switch (event.code) {
399
+ case 'Escape':
400
+ this.onEscapeKey(event);
401
+ break;
280
402
  }
403
+ },
404
+ onArrowDownKey(event) {
405
+ const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
281
406
 
407
+ this.changeFocusedOptionIndex(event, optionIndex);
408
+
409
+ !this.overlayVisible && this.show();
282
410
  event.preventDefault();
283
411
  },
284
- findNextOption(index) {
285
- if (this.optionGroupLabel) {
286
- let groupIndex = index === -1 ? 0 : index.group;
287
- let optionIndex = index === -1 ? -1 : index.option;
288
- let option = this.findNextOptionInList(this.getOptionGroupChildren(this.visibleOptions[groupIndex]), optionIndex);
412
+ onArrowUpKey(event, pressedInInputText = false) {
413
+ if (event.altKey && !pressedInInputText) {
414
+ if (this.focusedOptionIndex !== -1) {
415
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
416
+ }
289
417
 
290
- if (option)
291
- return option;
292
- else if ((groupIndex + 1) !== this.visibleOptions.length)
293
- return this.findNextOption({group: (groupIndex + 1), option: -1});
294
- else
295
- return null;
418
+ this.overlayVisible && this.hide();
419
+ event.preventDefault();
296
420
  }
297
421
  else {
298
- return this.findNextOptionInList(this.visibleOptions, index);
422
+ const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();
423
+
424
+ this.changeFocusedOptionIndex(event, optionIndex);
425
+
426
+ !this.overlayVisible && this.show();
427
+ event.preventDefault();
299
428
  }
300
429
  },
301
- findNextOptionInList(list, index) {
302
- let i = index + 1;
303
- if (i === list.length) {
304
- return null;
305
- }
306
-
307
- let option = list[i];
308
- if (this.isOptionDisabled(option))
309
- return this.findNextOptionInList(i);
310
- else
311
- return option;
430
+ onArrowLeftKey(event, pressedInInputText = false) {
431
+ pressedInInputText && (this.focusedOptionIndex = -1);
312
432
  },
313
- findPrevOption(index) {
314
- if (index === -1) {
315
- return null;
433
+ onHomeKey(event, pressedInInputText = false) {
434
+ if (pressedInInputText) {
435
+ event.currentTarget.setSelectionRange(0, 0);
436
+ this.focusedOptionIndex = -1;
316
437
  }
438
+ else {
439
+ this.changeFocusedOptionIndex(event, this.findFirstOptionIndex());
317
440
 
318
- if (this.optionGroupLabel) {
319
- let groupIndex = index.group;
320
- let optionIndex = index.option;
321
- let option = this.findPrevOptionInList(this.getOptionGroupChildren(this.visibleOptions[groupIndex]), optionIndex);
441
+ !this.overlayVisible && this.show();
442
+ }
322
443
 
323
- if (option)
324
- return option;
325
- else if (groupIndex > 0)
326
- return this.findPrevOption({group: (groupIndex - 1), option: this.getOptionGroupChildren(this.visibleOptions[groupIndex - 1]).length});
327
- else
328
- return null;
444
+ event.preventDefault();
445
+ },
446
+ onEndKey(event, pressedInInputText = false) {
447
+ if (pressedInInputText) {
448
+ const target = event.currentTarget;
449
+ const len = target.value.length;
450
+ target.setSelectionRange(len, len);
451
+ this.focusedOptionIndex = -1;
329
452
  }
330
453
  else {
331
- return this.findPrevOptionInList(this.visibleOptions, index);
332
- }
333
- },
334
- findPrevOptionInList(list, index) {
335
- let i = index - 1;
336
- if (i < 0) {
337
- return null;
454
+ this.changeFocusedOptionIndex(event, this.findLastOptionIndex());
455
+
456
+ !this.overlayVisible && this.show();
338
457
  }
339
458
 
340
- let option = list[i];
341
- if (this.isOptionDisabled(option))
342
- return this.findPrevOption(i);
343
- else
344
- return option;
459
+ event.preventDefault();
345
460
  },
346
- onClearClick(event) {
347
- this.updateModel(event, null);
461
+ onPageUpKey(event) {
462
+ this.scrollInView(0);
463
+ event.preventDefault();
348
464
  },
349
- onClick(event) {
350
- if (this.disabled || this.loading) {
351
- return;
465
+ onPageDownKey(event) {
466
+ this.scrollInView(this.visibleOptions.length - 1);
467
+ event.preventDefault();
468
+ },
469
+ onEnterKey(event) {
470
+ if (!this.overlayVisible) {
471
+ this.onArrowDownKey(event);
352
472
  }
473
+ else {
474
+ if (this.focusedOptionIndex !== -1) {
475
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
476
+ }
353
477
 
354
- if (utils.DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || event.target.tagName === 'INPUT') {
355
- return;
478
+ this.hide();
356
479
  }
357
- else if (!this.overlay || !this.overlay.contains(event.target)) {
358
- if (this.overlayVisible)
359
- this.hide();
360
- else
361
- this.show();
362
480
 
363
- this.$refs.focusInput.focus();
364
- }
481
+ event.preventDefault();
365
482
  },
366
- onOptionSelect(event, option) {
367
- let value = this.getOptionValue(option);
368
- this.updateModel(event, value);
369
- this.$refs.focusInput.focus();
483
+ onSpaceKey(event, pressedInInputText = false) {
484
+ !pressedInInputText && this.onEnterKey(event);
485
+ },
486
+ onEscapeKey(event) {
487
+ this.overlayVisible && this.hide(true);
488
+ event.preventDefault();
489
+ },
490
+ onTabKey(event, pressedInInputText = false) {
491
+ if (!pressedInInputText) {
492
+ if (this.overlayVisible && this.hasFocusableElements()) {
493
+ this.$refs.firstHiddenFocusableElementOnOverlay.focus();
370
494
 
371
- setTimeout(() => {
372
- this.hide();
373
- }, 200);
495
+ event.preventDefault();
496
+ }
497
+ else {
498
+ if (this.focusedOptionIndex !== -1) {
499
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
500
+ }
501
+
502
+ this.overlayVisible && this.hide(this.filter);
503
+ }
504
+ }
374
505
  },
375
- onEditableInput(event) {
376
- this.$emit('update:modelValue', event.target.value);
506
+ onBackspaceKey(event, pressedInInputText = false) {
507
+ if (pressedInInputText) {
508
+ !this.overlayVisible && this.show();
509
+ }
377
510
  },
378
511
  onOverlayEnter(el) {
379
512
  utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
380
513
  this.alignOverlay();
381
- this.scrollValueInView();
382
-
383
- if (!this.virtualScrollerDisabled) {
384
- const selectedIndex = this.getSelectedOptionIndex();
385
- if (selectedIndex !== -1) {
386
- setTimeout(() => {
387
- this.virtualScroller && this.virtualScroller.scrollToIndex(selectedIndex);
388
- }, 0);
389
- }
390
- }
514
+ this.scrollInView();
391
515
  },
392
516
  onOverlayAfterEnter() {
393
- if (this.filter) {
394
- this.$refs.filterInput.focus();
395
- }
396
-
397
517
  this.bindOutsideClickListener();
398
518
  this.bindScrollListener();
399
519
  this.bindResizeListener();
@@ -404,8 +524,8 @@ var script = {
404
524
  this.unbindOutsideClickListener();
405
525
  this.unbindScrollListener();
406
526
  this.unbindResizeListener();
527
+
407
528
  this.$emit('hide');
408
- this.itemsWrapper = null;
409
529
  this.overlay = null;
410
530
  },
411
531
  onOverlayAfterLeave(el) {
@@ -420,10 +540,6 @@ var script = {
420
540
  utils.DomHandler.absolutePosition(this.overlay, this.$el);
421
541
  }
422
542
  },
423
- updateModel(event, value) {
424
- this.$emit('update:modelValue', value);
425
- this.$emit('change', {originalEvent: event, value: value});
426
- },
427
543
  bindOutsideClickListener() {
428
544
  if (!this.outsideClickListener) {
429
545
  this.outsideClickListener = (event) => {
@@ -472,162 +588,153 @@ var script = {
472
588
  this.resizeListener = null;
473
589
  }
474
590
  },
475
- search(event) {
476
- if (!this.visibleOptions) {
477
- return;
591
+ hasFocusableElements() {
592
+ return utils.DomHandler.getFocusableElements(this.overlay, ':not(.p-hidden-focusable)').length > 0;
593
+ },
594
+ isOptionMatched(option) {
595
+ return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
596
+ },
597
+ isValidOption(option) {
598
+ return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
599
+ },
600
+ isValidSelectedOption(option) {
601
+ return this.isValidOption(option) && this.isSelected(option);
602
+ },
603
+ isSelected(option) {
604
+ return utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
605
+ },
606
+ findFirstOptionIndex() {
607
+ return this.visibleOptions.findIndex(option => this.isValidOption(option));
608
+ },
609
+ findLastOptionIndex() {
610
+ return utils.ObjectUtils.findLastIndex(this.visibleOptions, option => this.isValidOption(option));
611
+ },
612
+ findNextOptionIndex(index) {
613
+ const matchedOptionIndex = index < (this.visibleOptions.length - 1) ? this.visibleOptions.slice(index + 1).findIndex(option => this.isValidOption(option)) : -1;
614
+ return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
615
+ },
616
+ findPrevOptionIndex(index) {
617
+ const matchedOptionIndex = index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), option => this.isValidOption(option)) : -1;
618
+ return matchedOptionIndex > -1 ? matchedOptionIndex : index;
619
+ },
620
+ findSelectedOptionIndex() {
621
+ return this.hasSelectedOption ? this.visibleOptions.findIndex(option => this.isValidSelectedOption(option)) : -1;
622
+ },
623
+ findFirstFocusedOptionIndex() {
624
+ const selectedIndex = this.findSelectedOptionIndex();
625
+ return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
626
+ },
627
+ findLastFocusedOptionIndex() {
628
+ const selectedIndex = this.findSelectedOptionIndex();
629
+ return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
630
+ },
631
+ searchOptions(event, char) {
632
+ this.searchValue = (this.searchValue || '') + char;
633
+
634
+ let optionIndex = -1;
635
+ let matched = false;
636
+
637
+ if (this.focusedOptionIndex !== -1) {
638
+ optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(option => this.isOptionMatched(option));
639
+ optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(option => this.isOptionMatched(option)) : optionIndex + this.focusedOptionIndex;
640
+ }
641
+ else {
642
+ optionIndex = this.visibleOptions.findIndex(option => this.isOptionMatched(option));
478
643
  }
479
644
 
480
- if (this.searchTimeout) {
481
- clearTimeout(this.searchTimeout);
645
+ if (optionIndex !== -1) {
646
+ matched = true;
482
647
  }
483
648
 
484
- const char = event.key;
485
- this.previousSearchChar = this.currentSearchChar;
486
- this.currentSearchChar = char;
649
+ if (optionIndex === -1 && this.focusedOptionIndex === -1) {
650
+ optionIndex = this.findFirstFocusedOptionIndex();
651
+ }
487
652
 
488
- if (this.previousSearchChar === this.currentSearchChar)
489
- this.searchValue = this.currentSearchChar;
490
- else
491
- this.searchValue = this.searchValue ? this.searchValue + char : char;
653
+ if (optionIndex !== -1) {
654
+ this.changeFocusedOptionIndex(event, optionIndex);
655
+ }
492
656
 
493
- if (this.searchValue) {
494
- let searchIndex = this.getSelectedOptionIndex();
495
- let newOption = this.optionGroupLabel ? this.searchOptionInGroup(searchIndex) : this.searchOption(++searchIndex);
496
- if (newOption) {
497
- this.updateModel(event, this.getOptionValue(newOption));
498
- }
657
+ if (this.searchTimeout) {
658
+ clearTimeout(this.searchTimeout);
499
659
  }
500
660
 
501
661
  this.searchTimeout = setTimeout(() => {
502
- this.searchValue = null;
503
- }, 250);
504
- },
505
- searchOption(index) {
506
- let option;
662
+ this.searchValue = '';
663
+ this.searchTimeout = null;
664
+ }, 500);
507
665
 
508
- if (this.searchValue) {
509
- option = this.searchOptionInRange(index, this.visibleOptions.length);
666
+ return matched;
667
+ },
668
+ changeFocusedOptionIndex(event, index) {
669
+ if (this.focusedOptionIndex !== index) {
670
+ this.focusedOptionIndex = index;
671
+ this.scrollInView();
510
672
 
511
- if (!option) {
512
- option = this.searchOptionInRange(0, index);
673
+ if (this.selectOnFocus) {
674
+ this.updateModel(event, this.getOptionValue(this.visibleOptions[index]));
513
675
  }
514
676
  }
515
-
516
- return option;
517
677
  },
518
- searchOptionInRange(start, end) {
519
- for (let i = start; i < end; i++) {
520
- let opt = this.visibleOptions[i];
521
- if (this.matchesSearchValue(opt)) {
522
- return opt;
523
- }
678
+ scrollInView(index = -1) {
679
+ const id = index !== -1 ? `${this.id}_${index}` : this.focusedOptionId;
680
+ const element = utils.DomHandler.findSingle(this.list, `li[id="${id}"]`);
681
+ if (element) {
682
+ element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' });
524
683
  }
525
-
526
- return null;
527
- },
528
- searchOptionInGroup(index) {
529
- let searchIndex = index === -1 ? {group: 0, option: -1} : index;
530
-
531
- for (let i = searchIndex.group; i < this.visibleOptions.length; i++) {
532
- let groupOptions = this.getOptionGroupChildren(this.visibleOptions[i]);
533
- for (let j = (searchIndex.group === i ? searchIndex.option + 1 : 0); j < groupOptions.length; j++) {
534
- if (this.matchesSearchValue(groupOptions[j])) {
535
- return groupOptions[j];
536
- }
537
- }
684
+ else if (!this.virtualScrollerDisabled) {
685
+ setTimeout(() => {
686
+ this.virtualScroller && this.virtualScroller.scrollToIndex(index !== -1 ? index : this.focusedOptionIndex);
687
+ }, 0);
538
688
  }
539
-
540
- for (let i = 0; i <= searchIndex.group; i++) {
541
- let groupOptions = this.getOptionGroupChildren(this.visibleOptions[i]);
542
- for (let j = 0; j < (searchIndex.group === i ? searchIndex.option: groupOptions.length); j++) {
543
- if (this.matchesSearchValue(groupOptions[j])) {
544
- return groupOptions[j];
545
- }
546
- }
547
- }
548
-
549
- return null;
550
689
  },
551
- matchesSearchValue(option) {
552
- let label = this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale);
553
- return label.startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
690
+ autoUpdateModel() {
691
+ if (this.selectOnFocus && this.autoOptionFocus && !this.hasSelectedOption) {
692
+ this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
693
+ const value = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);
694
+ this.updateModel(null, value);
695
+ }
554
696
  },
555
- onFilterChange(event) {
556
- this.filterValue = event.target.value;
557
- this.$emit('filter', {originalEvent: event, value: event.target.value});
697
+ updateModel(event, value) {
698
+ this.$emit('update:modelValue', value);
699
+ this.$emit('change', { originalEvent: event, value });
558
700
  },
559
- onFilterUpdated() {
560
- if (this.overlayVisible) {
561
- this.alignOverlay();
562
- }
701
+ flatOptions(options) {
702
+ return (options || []).reduce((result, option, index) => {
703
+ result.push({ optionGroup: option, group: true, index });
704
+
705
+ const optionGroupChildren = this.getOptionGroupChildren(option);
706
+ optionGroupChildren && optionGroupChildren.forEach(o => result.push(o));
707
+
708
+ return result;
709
+ }, []);
563
710
  },
564
711
  overlayRef(el) {
565
712
  this.overlay = el;
566
713
  },
567
- itemsWrapperRef(el) {
568
- this.itemsWrapper = el;
714
+ listRef(el, contentRef) {
715
+ this.list = el;
716
+ contentRef && contentRef(el); // For VirtualScroller
569
717
  },
570
718
  virtualScrollerRef(el) {
571
719
  this.virtualScroller = el;
572
- },
573
- scrollValueInView() {
574
- if (this.overlay) {
575
- let selectedItem = utils.DomHandler.findSingle(this.overlay, 'li.p-highlight');
576
- if (selectedItem) {
577
- selectedItem.scrollIntoView({ block: 'nearest', inline: 'start' });
578
- }
579
- }
580
- },
581
- onOverlayClick(event) {
582
- OverlayEventBus__default["default"].emit('overlay-click', {
583
- originalEvent: event,
584
- target: this.$el
585
- });
586
720
  }
587
721
  },
588
722
  computed: {
589
- visibleOptions() {
590
- if (this.filterValue) {
591
- if (this.optionGroupLabel) {
592
- let filteredGroups = [];
593
- for (let optgroup of this.options) {
594
- let filteredSubOptions = api.FilterService.filter(this.getOptionGroupChildren(optgroup), this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
595
- if (filteredSubOptions && filteredSubOptions.length) {
596
- let filteredGroup = {...optgroup};
597
- filteredGroup[this.optionGroupChildren] = filteredSubOptions;
598
- filteredGroups.push(filteredGroup);
599
- }
600
- }
601
- return filteredGroups
602
- }
603
- else {
604
- return api.FilterService.filter(this.options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
605
- }
606
- }
607
- else {
608
- return this.options;
609
- }
610
- },
611
723
  containerClass() {
612
- return [
613
- 'p-dropdown p-component p-inputwrapper',
614
- {
615
- 'p-disabled': this.disabled,
616
- 'p-dropdown-clearable': this.showClear && !this.disabled,
617
- 'p-focus': this.focused,
618
- 'p-inputwrapper-filled': this.modelValue,
619
- 'p-inputwrapper-focus': this.focused || this.overlayVisible
620
- }
621
- ];
622
- },
623
- labelClass() {
624
- return [
625
- 'p-dropdown-label p-inputtext',
626
- {
627
- 'p-placeholder': this.label === this.placeholder,
628
- 'p-dropdown-label-empty': !this.$slots['value'] && (this.label === 'p-emptylabel' || this.label.length === 0)
629
- }
630
- ];
724
+ return ['p-dropdown p-component p-inputwrapper', {
725
+ 'p-disabled': this.disabled,
726
+ 'p-dropdown-clearable': this.showClear && !this.disabled,
727
+ 'p-focus': this.focused,
728
+ 'p-inputwrapper-filled': this.modelValue,
729
+ 'p-inputwrapper-focus': this.focused || this.overlayVisible,
730
+ 'p-overlay-open': this.overlayVisible
731
+ }];
732
+ },
733
+ inputStyleClass() {
734
+ return ['p-dropdown-label p-inputtext', this.inputClass, {
735
+ 'p-placeholder': !this.editable && this.label === this.placeholder,
736
+ 'p-dropdown-label-empty': !this.editable && !this.$slots['value'] && (this.label === 'p-emptylabel' || this.label.length === 0)
737
+ }];
631
738
  },
632
739
  panelStyleClass() {
633
740
  return ['p-dropdown-panel p-component', this.panelClass, {
@@ -635,19 +742,24 @@ var script = {
635
742
  'p-ripple-disabled': this.$primevue.config.ripple === false
636
743
  }];
637
744
  },
745
+ dropdownIconClass() {
746
+ return ['p-dropdown-trigger-icon', (this.loading ? this.loadingIcon : 'pi pi-chevron-down')];
747
+ },
748
+ visibleOptions() {
749
+ const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
750
+
751
+ return this.filterValue ? api.FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale) : options;
752
+ },
753
+ hasSelectedOption() {
754
+ return utils.ObjectUtils.isNotEmpty(this.modelValue);
755
+ },
638
756
  label() {
639
- let selectedOption = this.getSelectedOption();
640
- if (selectedOption !== null)
641
- return this.getOptionLabel(selectedOption);
642
- else
643
- return this.placeholder||'p-emptylabel';
757
+ const selectedOptionIndex = this.findSelectedOptionIndex();
758
+ return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : (this.placeholder || 'p-emptylabel');
644
759
  },
645
760
  editableInputValue() {
646
- let selectedOption = this.getSelectedOption();
647
- if (selectedOption)
648
- return this.getOptionLabel(selectedOption);
649
- else
650
- return this.modelValue;
761
+ const selectedOptionIndex = this.findSelectedOptionIndex();
762
+ return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : (this.modelValue || '');
651
763
  },
652
764
  equalityKey() {
653
765
  return this.optionValue ? null : this.dataKey;
@@ -655,17 +767,35 @@ var script = {
655
767
  searchFields() {
656
768
  return this.filterFields || [this.optionLabel];
657
769
  },
770
+ filterResultMessageText() {
771
+ return utils.ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
772
+ },
773
+ filterMessageText() {
774
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
775
+ },
658
776
  emptyFilterMessageText() {
659
- return this.emptyFilterMessage || this.$primevue.config.locale.emptyFilterMessage;
777
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
660
778
  },
661
779
  emptyMessageText() {
662
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
780
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
781
+ },
782
+ selectionMessageText() {
783
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
784
+ },
785
+ emptySelectionMessageText() {
786
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
787
+ },
788
+ selectedMessageText() {
789
+ return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
790
+ },
791
+ focusedOptionId() {
792
+ return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
793
+ },
794
+ ariaSetSize() {
795
+ return this.visibleOptions.filter(option => !this.isOptionGroup(option)).length;
663
796
  },
664
797
  virtualScrollerDisabled() {
665
798
  return !this.virtualScrollerOptions;
666
- },
667
- dropdownIconClass() {
668
- return ['p-dropdown-trigger-icon', this.loading ? this.loadingIcon : 'pi pi-chevron-down'];
669
799
  }
670
800
  },
671
801
  directives: {
@@ -677,27 +807,45 @@ var script = {
677
807
  }
678
808
  };
679
809
 
680
- const _hoisted_1 = { class: "p-hidden-accessible" };
681
- const _hoisted_2 = ["id", "disabled", "tabindex", "aria-expanded", "aria-labelledby"];
682
- const _hoisted_3 = ["disabled", "placeholder", "value", "aria-expanded"];
683
- const _hoisted_4 = ["aria-expanded"];
810
+ const _hoisted_1 = ["id"];
811
+ const _hoisted_2 = ["id", "value", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant"];
812
+ const _hoisted_3 = ["id", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-disabled"];
813
+ const _hoisted_4 = { class: "p-dropdown-trigger" };
684
814
  const _hoisted_5 = {
685
815
  key: 0,
686
816
  class: "p-dropdown-header"
687
817
  };
688
818
  const _hoisted_6 = { class: "p-dropdown-filter-container" };
689
- const _hoisted_7 = ["value", "placeholder"];
819
+ const _hoisted_7 = ["value", "placeholder", "aria-owns", "aria-activedescendant"];
690
820
  const _hoisted_8 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-dropdown-filter-icon pi pi-search" }, null, -1);
691
- const _hoisted_9 = ["onClick", "aria-label", "aria-selected"];
692
- const _hoisted_10 = { class: "p-dropdown-item-group" };
693
- const _hoisted_11 = ["onClick", "aria-label", "aria-selected"];
694
- const _hoisted_12 = {
695
- key: 2,
696
- class: "p-dropdown-empty-message"
821
+ const _hoisted_9 = {
822
+ role: "status",
823
+ "aria-live": "polite",
824
+ class: "p-hidden-accessible"
697
825
  };
826
+ const _hoisted_10 = ["id"];
827
+ const _hoisted_11 = ["id"];
828
+ const _hoisted_12 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove"];
698
829
  const _hoisted_13 = {
699
- key: 3,
700
- class: "p-dropdown-empty-message"
830
+ key: 0,
831
+ class: "p-dropdown-empty-message",
832
+ role: "option"
833
+ };
834
+ const _hoisted_14 = {
835
+ key: 1,
836
+ class: "p-dropdown-empty-message",
837
+ role: "option"
838
+ };
839
+ const _hoisted_15 = {
840
+ key: 0,
841
+ role: "status",
842
+ "aria-live": "polite",
843
+ class: "p-hidden-accessible"
844
+ };
845
+ const _hoisted_16 = {
846
+ role: "status",
847
+ "aria-live": "polite",
848
+ class: "p-hidden-accessible"
701
849
  };
702
850
 
703
851
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -707,72 +855,76 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
707
855
 
708
856
  return (vue.openBlock(), vue.createElementBlock("div", {
709
857
  ref: "container",
858
+ id: $data.id,
710
859
  class: vue.normalizeClass($options.containerClass),
711
- onClick: _cache[11] || (_cache[11] = $event => ($options.onClick($event)))
860
+ onClick: _cache[16] || (_cache[16] = (...args) => ($options.onContainerClick && $options.onContainerClick(...args)))
712
861
  }, [
713
- vue.createElementVNode("div", _hoisted_1, [
714
- vue.createElementVNode("input", {
715
- ref: "focusInput",
716
- type: "text",
717
- id: $props.inputId,
718
- readonly: "",
719
- disabled: $props.disabled,
720
- onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
721
- onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
722
- onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
723
- tabindex: $props.tabindex,
724
- "aria-haspopup": "true",
725
- "aria-expanded": $data.overlayVisible,
726
- "aria-labelledby": $props.ariaLabelledBy
727
- }, null, 40, _hoisted_2)
728
- ]),
729
862
  ($props.editable)
730
- ? (vue.openBlock(), vue.createElementBlock("input", {
863
+ ? (vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
731
864
  key: 0,
865
+ ref: "focusInput",
866
+ id: $props.inputId,
732
867
  type: "text",
733
- class: "p-dropdown-label p-inputtext",
734
- disabled: $props.disabled,
735
- onFocus: _cache[3] || (_cache[3] = (...args) => ($options.onFocus && $options.onFocus(...args))),
736
- onBlur: _cache[4] || (_cache[4] = (...args) => ($options.onBlur && $options.onBlur(...args))),
737
- placeholder: $props.placeholder,
868
+ style: $props.inputStyle,
869
+ class: $options.inputStyleClass,
738
870
  value: $options.editableInputValue,
739
- onInput: _cache[5] || (_cache[5] = (...args) => ($options.onEditableInput && $options.onEditableInput(...args))),
871
+ placeholder: $props.placeholder,
872
+ tabindex: !$props.disabled ? $props.tabindex : -1,
873
+ disabled: $props.disabled,
874
+ autocomplete: "off",
875
+ role: "combobox",
876
+ "aria-label": _ctx.ariaLabel,
877
+ "aria-labelledby": _ctx.ariaLabelledby,
740
878
  "aria-haspopup": "listbox",
741
- "aria-expanded": $data.overlayVisible
742
- }, null, 40, _hoisted_3))
743
- : vue.createCommentVNode("", true),
744
- (!$props.editable)
745
- ? (vue.openBlock(), vue.createElementBlock("span", {
879
+ "aria-expanded": $data.overlayVisible,
880
+ "aria-controls": $data.id + '_list',
881
+ "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
882
+ onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
883
+ onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
884
+ onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
885
+ onInput: _cache[3] || (_cache[3] = (...args) => ($options.onEditableInput && $options.onEditableInput(...args)))
886
+ }, $props.inputProps), null, 16, _hoisted_2))
887
+ : (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
746
888
  key: 1,
747
- class: vue.normalizeClass($options.labelClass)
748
- }, [
889
+ ref: "focusInput",
890
+ id: $props.inputId,
891
+ style: $props.inputStyle,
892
+ class: $options.inputStyleClass,
893
+ tabindex: !$props.disabled ? $props.tabindex : -1,
894
+ role: "combobox",
895
+ "aria-label": _ctx.ariaLabel || ($options.label === 'p-emptylabel' ? undefined : $options.label),
896
+ "aria-labelledby": _ctx.ariaLabelledby,
897
+ "aria-haspopup": "listbox",
898
+ "aria-expanded": $data.overlayVisible,
899
+ "aria-controls": $data.id + '_list',
900
+ "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
901
+ "aria-disabled": $props.disabled,
902
+ onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onFocus && $options.onFocus(...args))),
903
+ onBlur: _cache[5] || (_cache[5] = (...args) => ($options.onBlur && $options.onBlur(...args))),
904
+ onKeydown: _cache[6] || (_cache[6] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args)))
905
+ }, $props.inputProps), [
749
906
  vue.renderSlot(_ctx.$slots, "value", {
750
907
  value: $props.modelValue,
751
908
  placeholder: $props.placeholder
752
909
  }, () => [
753
- vue.createTextVNode(vue.toDisplayString($options.label||'empty'), 1)
910
+ vue.createTextVNode(vue.toDisplayString($options.label === 'p-emptylabel' ? ' ' : $options.label || 'empty'), 1)
754
911
  ])
755
- ], 2))
756
- : vue.createCommentVNode("", true),
912
+ ], 16, _hoisted_3)),
757
913
  ($props.showClear && $props.modelValue != null)
758
- ? (vue.openBlock(), vue.createElementBlock("i", {
914
+ ? (vue.openBlock(), vue.createElementBlock("i", vue.mergeProps({
759
915
  key: 2,
760
916
  class: "p-dropdown-clear-icon pi pi-times",
761
- onClick: _cache[6] || (_cache[6] = $event => ($options.onClearClick($event)))
762
- }))
917
+ onClick: _cache[7] || (_cache[7] = (...args) => ($options.onClearClick && $options.onClearClick(...args)))
918
+ }, $props.clearIconProps), null, 16))
763
919
  : vue.createCommentVNode("", true),
764
- vue.createElementVNode("div", {
765
- class: "p-dropdown-trigger",
766
- role: "button",
767
- "aria-haspopup": "listbox",
768
- "aria-expanded": $data.overlayVisible
769
- }, [
920
+ vue.createElementVNode("div", _hoisted_4, [
770
921
  vue.renderSlot(_ctx.$slots, "indicator", {}, () => [
771
922
  vue.createElementVNode("span", {
772
- class: vue.normalizeClass($options.dropdownIconClass)
923
+ class: vue.normalizeClass($options.dropdownIconClass),
924
+ "aria-hidden": "true"
773
925
  }, null, 2)
774
926
  ])
775
- ], 8, _hoisted_4),
927
+ ]),
776
928
  vue.createVNode(_component_Portal, { appendTo: $props.appendTo }, {
777
929
  default: vue.withCtx(() => [
778
930
  vue.createVNode(vue.Transition, {
@@ -784,12 +936,22 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
784
936
  }, {
785
937
  default: vue.withCtx(() => [
786
938
  ($data.overlayVisible)
787
- ? (vue.openBlock(), vue.createElementBlock("div", {
939
+ ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
788
940
  key: 0,
789
941
  ref: $options.overlayRef,
790
- class: vue.normalizeClass($options.panelStyleClass),
791
- onClick: _cache[10] || (_cache[10] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
792
- }, [
942
+ style: $props.panelStyle,
943
+ class: $options.panelStyleClass,
944
+ onClick: _cache[14] || (_cache[14] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args))),
945
+ onKeydown: _cache[15] || (_cache[15] = (...args) => ($options.onOverlayKeyDown && $options.onOverlayKeyDown(...args)))
946
+ }, $props.panelProps), [
947
+ vue.createElementVNode("span", {
948
+ ref: "firstHiddenFocusableElementOnOverlay",
949
+ role: "presentation",
950
+ "aria-hidden": "true",
951
+ class: "p-hidden-accessible p-hidden-focusable",
952
+ tabindex: 0,
953
+ onFocus: _cache[8] || (_cache[8] = (...args) => ($options.onFirstHiddenFocus && $options.onFirstHiddenFocus(...args)))
954
+ }, null, 544),
793
955
  vue.renderSlot(_ctx.$slots, "header", {
794
956
  value: $props.modelValue,
795
957
  options: $options.visibleOptions
@@ -797,105 +959,106 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
797
959
  ($props.filter)
798
960
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
799
961
  vue.createElementVNode("div", _hoisted_6, [
800
- vue.createElementVNode("input", {
962
+ vue.createElementVNode("input", vue.mergeProps({
801
963
  type: "text",
802
964
  ref: "filterInput",
803
965
  value: $data.filterValue,
804
- onVnodeUpdated: _cache[7] || (_cache[7] = (...args) => ($options.onFilterUpdated && $options.onFilterUpdated(...args))),
805
- autoComplete: "off",
966
+ onVnodeUpdated: _cache[9] || (_cache[9] = (...args) => ($options.onFilterUpdated && $options.onFilterUpdated(...args))),
806
967
  class: "p-dropdown-filter p-inputtext p-component",
807
968
  placeholder: $props.filterPlaceholder,
808
- onKeydown: _cache[8] || (_cache[8] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
809
- onInput: _cache[9] || (_cache[9] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
810
- }, null, 40, _hoisted_7),
969
+ role: "searchbox",
970
+ autocomplete: "off",
971
+ "aria-owns": $data.id + '_list',
972
+ "aria-activedescendant": $options.focusedOptionId,
973
+ onKeydown: _cache[10] || (_cache[10] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
974
+ onBlur: _cache[11] || (_cache[11] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
975
+ onInput: _cache[12] || (_cache[12] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
976
+ }, $props.filterInputProps), null, 16, _hoisted_7),
811
977
  _hoisted_8
812
- ])
978
+ ]),
979
+ vue.createElementVNode("span", _hoisted_9, vue.toDisplayString($options.filterResultMessageText), 1)
813
980
  ]))
814
981
  : vue.createCommentVNode("", true),
815
982
  vue.createElementVNode("div", {
816
- ref: $options.itemsWrapperRef,
817
983
  class: "p-dropdown-items-wrapper",
818
984
  style: vue.normalizeStyle({'max-height': $options.virtualScrollerDisabled ? $props.scrollHeight : ''})
819
985
  }, [
820
986
  vue.createVNode(_component_VirtualScroller, vue.mergeProps({ ref: $options.virtualScrollerRef }, $props.virtualScrollerOptions, {
821
987
  items: $options.visibleOptions,
822
988
  style: {'height': $props.scrollHeight},
989
+ tabindex: -1,
823
990
  disabled: $options.virtualScrollerDisabled
824
991
  }), vue.createSlots({
825
- content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle }) => [
992
+ content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
826
993
  vue.createElementVNode("ul", {
827
- ref: contentRef,
994
+ ref: (el) => $options.listRef(el, contentRef),
995
+ id: $data.id + '_list',
828
996
  class: vue.normalizeClass(['p-dropdown-items', styleClass]),
829
997
  style: vue.normalizeStyle(contentStyle),
830
998
  role: "listbox"
831
999
  }, [
832
- (!$props.optionGroupLabel)
833
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(items, (option, i) => {
834
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
835
- class: vue.normalizeClass(['p-dropdown-item', {'p-highlight': $options.isSelected(option), 'p-disabled': $options.isOptionDisabled(option)}]),
836
- key: $options.getOptionRenderKey(option, i),
837
- onClick: $event => ($options.onOptionSelect($event, option)),
838
- role: "option",
839
- "aria-label": $options.getOptionLabel(option),
840
- "aria-selected": $options.isSelected(option)
841
- }, [
842
- vue.renderSlot(_ctx.$slots, "option", {
843
- option: option,
844
- index: $options.getOptionIndex(i, getItemOptions)
845
- }, () => [
846
- vue.createTextVNode(vue.toDisplayString($options.getOptionLabel(option)), 1)
847
- ])
848
- ], 10, _hoisted_9)), [
849
- [_directive_ripple]
850
- ])
851
- }), 128))
852
- : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(items, (optionGroup, i) => {
853
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
854
- key: $options.getOptionGroupRenderKey(optionGroup)
855
- }, [
856
- vue.createElementVNode("li", _hoisted_10, [
1000
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (option, i) => {
1001
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
1002
+ key: $options.getOptionRenderKey(option, $options.getOptionIndex(i, getItemOptions))
1003
+ }, [
1004
+ ($options.isOptionGroup(option))
1005
+ ? (vue.openBlock(), vue.createElementBlock("li", {
1006
+ key: 0,
1007
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1008
+ style: vue.normalizeStyle({height: itemSize ? itemSize + 'px' : undefined}),
1009
+ class: "p-dropdown-item-group",
1010
+ role: "option"
1011
+ }, [
857
1012
  vue.renderSlot(_ctx.$slots, "optiongroup", {
858
- option: optionGroup,
1013
+ option: option.optionGroup,
859
1014
  index: $options.getOptionIndex(i, getItemOptions)
860
1015
  }, () => [
861
- vue.createTextVNode(vue.toDisplayString($options.getOptionGroupLabel(optionGroup)), 1)
1016
+ vue.createTextVNode(vue.toDisplayString($options.getOptionGroupLabel(option.optionGroup)), 1)
862
1017
  ])
863
- ]),
864
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.getOptionGroupChildren(optionGroup), (option, i) => {
865
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
866
- class: vue.normalizeClass(['p-dropdown-item', {'p-highlight': $options.isSelected(option), 'p-disabled': $options.isOptionDisabled(option)}]),
867
- key: $options.getOptionRenderKey(option, i),
868
- onClick: $event => ($options.onOptionSelect($event, option)),
869
- role: "option",
870
- "aria-label": $options.getOptionLabel(option),
871
- "aria-selected": $options.isSelected(option)
872
- }, [
873
- vue.renderSlot(_ctx.$slots, "option", {
874
- option: option,
875
- index: $options.getOptionIndex(i, getItemOptions)
876
- }, () => [
877
- vue.createTextVNode(vue.toDisplayString($options.getOptionLabel(option)), 1)
878
- ])
879
- ], 10, _hoisted_11)), [
880
- [_directive_ripple]
1018
+ ], 12, _hoisted_11))
1019
+ : vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
1020
+ key: 1,
1021
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1022
+ style: vue.normalizeStyle({height: itemSize ? itemSize + 'px' : undefined}),
1023
+ class: vue.normalizeClass(['p-dropdown-item', {'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option)}]),
1024
+ role: "option",
1025
+ "aria-label": $options.getOptionLabel(option),
1026
+ "aria-selected": $options.isSelected(option),
1027
+ "aria-disabled": $options.isOptionDisabled(option),
1028
+ "aria-setsize": $options.ariaSetSize,
1029
+ "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),
1030
+ onClick: $event => ($options.onOptionSelect($event, option)),
1031
+ onMousemove: $event => ($options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions)))
1032
+ }, [
1033
+ vue.renderSlot(_ctx.$slots, "option", {
1034
+ option: option,
1035
+ index: $options.getOptionIndex(i, getItemOptions)
1036
+ }, () => [
1037
+ vue.createTextVNode(vue.toDisplayString($options.getOptionLabel(option)), 1)
881
1038
  ])
882
- }), 128))
883
- ], 64))
884
- }), 128)),
1039
+ ], 46, _hoisted_12)), [
1040
+ [_directive_ripple]
1041
+ ])
1042
+ ], 64))
1043
+ }), 128)),
885
1044
  ($data.filterValue && (!items || (items && items.length === 0)))
886
- ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_12, [
1045
+ ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_13, [
887
1046
  vue.renderSlot(_ctx.$slots, "emptyfilter", {}, () => [
888
1047
  vue.createTextVNode(vue.toDisplayString($options.emptyFilterMessageText), 1)
889
1048
  ])
890
1049
  ]))
891
1050
  : ((!$props.options || ($props.options && $props.options.length === 0)))
892
- ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_13, [
1051
+ ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_14, [
893
1052
  vue.renderSlot(_ctx.$slots, "empty", {}, () => [
894
1053
  vue.createTextVNode(vue.toDisplayString($options.emptyMessageText), 1)
895
1054
  ])
896
1055
  ]))
897
1056
  : vue.createCommentVNode("", true)
898
- ], 6)
1057
+ ], 14, _hoisted_10),
1058
+ ((!$props.options || ($props.options && $props.options.length === 0)))
1059
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_15, vue.toDisplayString($options.emptyMessageText), 1))
1060
+ : vue.createCommentVNode("", true),
1061
+ vue.createElementVNode("span", _hoisted_16, vue.toDisplayString($options.selectedMessageText), 1)
899
1062
  ]),
900
1063
  _: 2
901
1064
  }, [
@@ -912,8 +1075,16 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
912
1075
  vue.renderSlot(_ctx.$slots, "footer", {
913
1076
  value: $props.modelValue,
914
1077
  options: $options.visibleOptions
915
- })
916
- ], 2))
1078
+ }),
1079
+ vue.createElementVNode("span", {
1080
+ ref: "lastHiddenFocusableElementOnOverlay",
1081
+ role: "presentation",
1082
+ "aria-hidden": "true",
1083
+ class: "p-hidden-accessible p-hidden-focusable",
1084
+ tabindex: 0,
1085
+ onFocus: _cache[13] || (_cache[13] = (...args) => ($options.onLastHiddenFocus && $options.onLastHiddenFocus(...args)))
1086
+ }, null, 544)
1087
+ ], 16))
917
1088
  : vue.createCommentVNode("", true)
918
1089
  ]),
919
1090
  _: 3
@@ -921,7 +1092,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
921
1092
  ]),
922
1093
  _: 3
923
1094
  }, 8, ["appendTo"])
924
- ], 2))
1095
+ ], 10, _hoisted_1))
925
1096
  }
926
1097
 
927
1098
  function styleInject(css, ref) {
@@ -951,7 +1122,7 @@ function styleInject(css, ref) {
951
1122
  }
952
1123
  }
953
1124
 
954
- var css_248z = "\n.p-dropdown {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-dropdown-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-dropdown-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-dropdown-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\ninput.p-dropdown-label {\n cursor: default;\n}\n.p-dropdown .p-dropdown-panel {\n min-width: 100%;\n}\n.p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-dropdown-items-wrapper {\n overflow: auto;\n}\n.p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-dropdown-item-group {\n cursor: auto;\n}\n.p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-dropdown-filter {\n width: 100%;\n}\n.p-dropdown-filter-container {\n position: relative;\n}\n.p-dropdown-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-fluid .p-dropdown {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n}\n";
1125
+ var css_248z = "\n.p-dropdown {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-dropdown-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-dropdown-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-dropdown-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-dropdown-label-empty {\n overflow: hidden;\n opacity: 0;\n}\ninput.p-dropdown-label {\n cursor: default;\n}\n.p-dropdown .p-dropdown-panel {\n min-width: 100%;\n}\n.p-dropdown-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-dropdown-items-wrapper {\n overflow: auto;\n}\n.p-dropdown-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-dropdown-item-group {\n cursor: auto;\n}\n.p-dropdown-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-dropdown-filter {\n width: 100%;\n}\n.p-dropdown-filter-container {\n position: relative;\n}\n.p-dropdown-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-fluid .p-dropdown {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-dropdown .p-dropdown-label {\n width: 1%;\n}\n";
955
1126
  styleInject(css_248z);
956
1127
 
957
1128
  script.render = render;