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