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
package/core/core.js CHANGED
@@ -5,19 +5,25 @@ this.primevue.utils = (function (exports) {
5
5
  var DomHandler = {
6
6
 
7
7
  innerWidth(el) {
8
- let width = el.offsetWidth;
9
- let style = getComputedStyle(el);
8
+ if (el) {
9
+ let width = el.offsetWidth;
10
+ let style = getComputedStyle(el);
10
11
 
11
- width += parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
12
- return width;
12
+ width += parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
13
+ return width;
14
+ }
15
+ return 0;
13
16
  },
14
17
 
15
18
  width(el) {
16
- let width = el.offsetWidth;
17
- let style = getComputedStyle(el);
19
+ if (el) {
20
+ let width = el.offsetWidth;
21
+ let style = getComputedStyle(el);
18
22
 
19
- width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
20
- return width;
23
+ width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
24
+ return width;
25
+ }
26
+ return 0;
21
27
  },
22
28
 
23
29
  getWindowScrollTop() {
@@ -41,9 +47,7 @@ this.primevue.utils = (function (exports) {
41
47
 
42
48
  return width;
43
49
  }
44
- else {
45
- return 0;
46
- }
50
+ return 0;
47
51
  },
48
52
 
49
53
  getOuterHeight(el, margin) {
@@ -57,9 +61,7 @@ this.primevue.utils = (function (exports) {
57
61
 
58
62
  return height;
59
63
  }
60
- else {
61
- return 0;
62
- }
64
+ return 0;
63
65
  },
64
66
 
65
67
  getClientHeight(el, margin) {
@@ -72,9 +74,8 @@ this.primevue.utils = (function (exports) {
72
74
  }
73
75
 
74
76
  return height;
75
- } else {
76
- return 0;
77
77
  }
78
+ return 0;
78
79
  },
79
80
 
80
81
  getViewport() {
@@ -85,56 +86,71 @@ this.primevue.utils = (function (exports) {
85
86
  w = win.innerWidth || e.clientWidth || g.clientWidth,
86
87
  h = win.innerHeight || e.clientHeight || g.clientHeight;
87
88
 
88
- return {width: w, height: h};
89
+ return { width: w, height: h };
89
90
  },
90
91
 
91
92
  getOffset(el) {
92
- var rect = el.getBoundingClientRect();
93
+ if (el) {
94
+ let rect = el.getBoundingClientRect();
95
+
96
+ return {
97
+ top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
98
+ left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0),
99
+ };
100
+ }
93
101
 
94
102
  return {
95
- top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
96
- left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0),
103
+ top: 'auto',
104
+ left: 'auto'
97
105
  };
98
106
  },
99
107
 
100
108
  index(element) {
101
- let children = element.parentNode.childNodes;
102
- let num = 0;
103
- for (var i = 0; i < children.length; i++) {
104
- if (children[i] === element) return num;
105
- if (children[i].nodeType === 1) num++;
109
+ if (element) {
110
+ let children = element.parentNode.childNodes;
111
+ let num = 0;
112
+ for (let i = 0; i < children.length; i++) {
113
+ if (children[i] === element) return num;
114
+ if (children[i].nodeType === 1) num++;
115
+ }
106
116
  }
107
117
  return -1;
108
118
  },
109
119
 
110
120
  addMultipleClasses(element, className) {
111
- if (element.classList) {
112
- let styles = className.split(' ');
113
- for (let i = 0; i < styles.length; i++) {
114
- element.classList.add(styles[i]);
115
- }
121
+ if (element && className) {
122
+ if (element.classList) {
123
+ let styles = className.split(' ');
124
+ for (let i = 0; i < styles.length; i++) {
125
+ element.classList.add(styles[i]);
126
+ }
116
127
 
117
- }
118
- else {
119
- let styles = className.split(' ');
120
- for (let i = 0; i < styles.length; i++) {
121
- element.className += ' ' + styles[i];
128
+ }
129
+ else {
130
+ let styles = className.split(' ');
131
+ for (let i = 0; i < styles.length; i++) {
132
+ element.className += ' ' + styles[i];
133
+ }
122
134
  }
123
135
  }
124
136
  },
125
137
 
126
138
  addClass(element, className) {
127
- if (element.classList)
128
- element.classList.add(className);
129
- else
130
- element.className += ' ' + className;
139
+ if (element && className) {
140
+ if (element.classList)
141
+ element.classList.add(className);
142
+ else
143
+ element.className += ' ' + className;
144
+ }
131
145
  },
132
146
 
133
147
  removeClass(element, className) {
134
- if (element.classList)
135
- element.classList.remove(className);
136
- else
137
- element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
148
+ if (element && className) {
149
+ if (element.classList)
150
+ element.classList.remove(className);
151
+ else
152
+ element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
153
+ }
138
154
  },
139
155
 
140
156
  hasClass(element, className) {
@@ -149,99 +165,112 @@ this.primevue.utils = (function (exports) {
149
165
  },
150
166
 
151
167
  find(element, selector) {
152
- return element.querySelectorAll(selector);
168
+ return element ? element.querySelectorAll(selector) : [];
153
169
  },
154
170
 
155
171
  findSingle(element, selector) {
156
- return element.querySelector(selector);
172
+ if (element) {
173
+ return element.querySelector(selector);
174
+ }
175
+ return null;
157
176
  },
158
177
 
159
178
  getHeight(el) {
160
- let height = el.offsetHeight;
161
- let style = getComputedStyle(el);
179
+ if (el) {
180
+ let height = el.offsetHeight;
181
+ let style = getComputedStyle(el);
162
182
 
163
- height -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
183
+ height -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
164
184
 
165
- return height;
185
+ return height;
186
+ }
187
+ return 0;
166
188
  },
167
189
 
168
190
  getWidth(el) {
169
- let width = el.offsetWidth;
170
- let style = getComputedStyle(el);
191
+ if (el) {
192
+ let width = el.offsetWidth;
193
+ let style = getComputedStyle(el);
171
194
 
172
- width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
195
+ width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
173
196
 
174
- return width;
197
+ return width;
198
+ }
199
+ return 0;
175
200
  },
176
201
 
177
202
  absolutePosition(element, target) {
178
- let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);
179
- let elementOuterHeight = elementDimensions.height;
180
- let elementOuterWidth = elementDimensions.width;
181
- let targetOuterHeight = target.offsetHeight;
182
- let targetOuterWidth = target.offsetWidth;
183
- let targetOffset = target.getBoundingClientRect();
184
- let windowScrollTop = this.getWindowScrollTop();
185
- let windowScrollLeft = this.getWindowScrollLeft();
186
- let viewport = this.getViewport();
187
- let top, left;
188
-
189
- if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {
190
- top = targetOffset.top + windowScrollTop - elementOuterHeight;
191
- element.style.transformOrigin = 'bottom';
192
-
193
- if (top < 0) {
194
- top = windowScrollTop;
203
+ if (element) {
204
+ let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);
205
+ let elementOuterHeight = elementDimensions.height;
206
+ let elementOuterWidth = elementDimensions.width;
207
+ let targetOuterHeight = target.offsetHeight;
208
+ let targetOuterWidth = target.offsetWidth;
209
+ let targetOffset = target.getBoundingClientRect();
210
+ let windowScrollTop = this.getWindowScrollTop();
211
+ let windowScrollLeft = this.getWindowScrollLeft();
212
+ let viewport = this.getViewport();
213
+ let top, left;
214
+
215
+ if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {
216
+ top = targetOffset.top + windowScrollTop - elementOuterHeight;
217
+ element.style.transformOrigin = 'bottom';
218
+
219
+ if (top < 0) {
220
+ top = windowScrollTop;
221
+ }
222
+ }
223
+ else {
224
+ top = targetOuterHeight + targetOffset.top + windowScrollTop;
225
+ element.style.transformOrigin = 'top';
195
226
  }
196
- }
197
- else {
198
- top = targetOuterHeight + targetOffset.top + windowScrollTop;
199
- element.style.transformOrigin = 'top';
200
- }
201
227
 
202
- if (targetOffset.left + elementOuterWidth > viewport.width)
203
- left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);
204
- else
205
- left = targetOffset.left + windowScrollLeft;
228
+ if (targetOffset.left + elementOuterWidth > viewport.width)
229
+ left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);
230
+ else
231
+ left = targetOffset.left + windowScrollLeft;
206
232
 
207
- element.style.top = top + 'px';
208
- element.style.left = left + 'px';
233
+ element.style.top = top + 'px';
234
+ element.style.left = left + 'px';
235
+ }
209
236
  },
210
237
 
211
238
  relativePosition(element, target) {
212
- let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);
213
- const targetHeight = target.offsetHeight;
214
- const targetOffset = target.getBoundingClientRect();
215
- const viewport = this.getViewport();
216
- let top, left;
239
+ if (element) {
240
+ let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);
241
+ const targetHeight = target.offsetHeight;
242
+ const targetOffset = target.getBoundingClientRect();
243
+ const viewport = this.getViewport();
244
+ let top, left;
245
+
246
+ if ((targetOffset.top + targetHeight + elementDimensions.height) > viewport.height) {
247
+ top = -1 * (elementDimensions.height);
248
+ element.style.transformOrigin = 'bottom';
249
+ if (targetOffset.top + top < 0) {
250
+ top = -1 * targetOffset.top;
251
+ }
252
+ }
253
+ else {
254
+ top = targetHeight;
255
+ element.style.transformOrigin = 'top';
256
+ }
217
257
 
218
- if ((targetOffset.top + targetHeight + elementDimensions.height) > viewport.height) {
219
- top = -1 * (elementDimensions.height);
220
- element.style.transformOrigin = 'bottom';
221
- if (targetOffset.top + top < 0) {
222
- top = -1 * targetOffset.top;
258
+ if (elementDimensions.width > viewport.width) {
259
+ // element wider then viewport and cannot fit on screen (align at left side of viewport)
260
+ left = targetOffset.left * -1;
261
+ }
262
+ else if ((targetOffset.left + elementDimensions.width) > viewport.width) {
263
+ // element wider then viewport but can be fit on screen (align at right side of viewport)
264
+ left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;
265
+ }
266
+ else {
267
+ // element fits on screen (align with target)
268
+ left = 0;
223
269
  }
224
- }
225
- else {
226
- top = targetHeight;
227
- element.style.transformOrigin = 'top';
228
- }
229
270
 
230
- if (elementDimensions.width > viewport.width) {
231
- // element wider then viewport and cannot fit on screen (align at left side of viewport)
232
- left = targetOffset.left * -1;
271
+ element.style.top = top + 'px';
272
+ element.style.left = left + 'px';
233
273
  }
234
- else if ((targetOffset.left + elementDimensions.width) > viewport.width) {
235
- // element wider then viewport but can be fit on screen (align at right side of viewport)
236
- left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;
237
- }
238
- else {
239
- // element fits on screen (align with target)
240
- left = 0;
241
- }
242
-
243
- element.style.top = top + 'px';
244
- element.style.left = left + 'px';
245
274
  },
246
275
 
247
276
  getParents(element, parents = []) {
@@ -281,71 +310,84 @@ this.primevue.utils = (function (exports) {
281
310
  },
282
311
 
283
312
  getHiddenElementOuterHeight(element) {
284
- element.style.visibility = 'hidden';
285
- element.style.display = 'block';
286
- let elementHeight = element.offsetHeight;
287
- element.style.display = 'none';
288
- element.style.visibility = 'visible';
313
+ if (element) {
314
+ element.style.visibility = 'hidden';
315
+ element.style.display = 'block';
316
+ let elementHeight = element.offsetHeight;
317
+ element.style.display = 'none';
318
+ element.style.visibility = 'visible';
289
319
 
290
- return elementHeight;
320
+ return elementHeight;
321
+ }
322
+ return 0;
291
323
  },
292
324
 
293
325
  getHiddenElementOuterWidth(element) {
294
- element.style.visibility = 'hidden';
295
- element.style.display = 'block';
296
- let elementWidth = element.offsetWidth;
297
- element.style.display = 'none';
298
- element.style.visibility = 'visible';
326
+ if (element) {
327
+ element.style.visibility = 'hidden';
328
+ element.style.display = 'block';
329
+ let elementWidth = element.offsetWidth;
330
+ element.style.display = 'none';
331
+ element.style.visibility = 'visible';
299
332
 
300
- return elementWidth;
333
+ return elementWidth;
334
+ }
335
+ return 0;
301
336
  },
302
337
 
303
338
  getHiddenElementDimensions(element) {
304
- var dimensions = {};
305
- element.style.visibility = 'hidden';
306
- element.style.display = 'block';
307
- dimensions.width = element.offsetWidth;
308
- dimensions.height = element.offsetHeight;
309
- element.style.display = 'none';
310
- element.style.visibility = 'visible';
311
-
312
- return dimensions;
339
+ if (element) {
340
+ let dimensions = {};
341
+ element.style.visibility = 'hidden';
342
+ element.style.display = 'block';
343
+ dimensions.width = element.offsetWidth;
344
+ dimensions.height = element.offsetHeight;
345
+ element.style.display = 'none';
346
+ element.style.visibility = 'visible';
347
+
348
+ return dimensions;
349
+ }
350
+ return 0;
313
351
  },
314
352
 
315
353
  fadeIn(element, duration) {
316
- element.style.opacity = 0;
354
+ if (element) {
355
+ element.style.opacity = 0;
317
356
 
318
- var last = +new Date();
319
- var opacity = 0;
320
- var tick = function () {
321
- opacity = +element.style.opacity + (new Date().getTime() - last) / duration;
322
- element.style.opacity = opacity;
323
- last = +new Date();
357
+ let last = +new Date();
358
+ let opacity = 0;
359
+ let tick = function () {
360
+ opacity = +element.style.opacity + (new Date().getTime() - last) / duration;
361
+ element.style.opacity = opacity;
362
+ last = +new Date();
324
363
 
325
- if (+opacity < 1) {
326
- (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
327
- }
328
- };
364
+ if (+opacity < 1) {
365
+ (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
366
+ }
367
+ };
329
368
 
330
- tick();
369
+ tick();
370
+ }
331
371
  },
332
372
 
333
373
  fadeOut(element, ms) {
334
- var opacity = 1,
335
- interval = 50,
336
- duration = ms,
337
- gap = interval / duration;
374
+ if (element) {
375
+ let opacity = 1,
376
+ interval = 50,
377
+ duration = ms,
378
+ gap = interval / duration;
338
379
 
339
- let fading = setInterval(() => {
340
- opacity -= gap;
380
+ let fading = setInterval(() => {
381
+ opacity -= gap;
341
382
 
342
- if (opacity <= 0) {
343
- opacity = 0;
344
- clearInterval(fading);
345
- }
383
+ if (opacity <= 0) {
384
+ opacity = 0;
385
+ clearInterval(fading);
386
+ }
346
387
 
347
- element.style.opacity = opacity;
348
- }, interval);
388
+ element.style.opacity = opacity;
389
+ }, interval);
390
+ }
349
391
  },
350
392
 
351
393
  getUserAgent() {
@@ -353,9 +395,9 @@ this.primevue.utils = (function (exports) {
353
395
  },
354
396
 
355
397
  appendChild(element, target) {
356
- if(this.isElement(target))
398
+ if (this.isElement(target))
357
399
  target.appendChild(element);
358
- else if(target.el && target.elElement)
400
+ else if (target.el && target.elElement)
359
401
  target.elElement.appendChild(element);
360
402
  else
361
403
  throw new Error('Cannot append ' + target + ' to ' + element);
@@ -382,14 +424,14 @@ this.primevue.utils = (function (exports) {
382
424
  },
383
425
 
384
426
  clearSelection() {
385
- if(window.getSelection) {
386
- if(window.getSelection().empty) {
427
+ if (window.getSelection) {
428
+ if (window.getSelection().empty) {
387
429
  window.getSelection().empty();
388
- } else if(window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) {
430
+ } else if (window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) {
389
431
  window.getSelection().removeAllRanges();
390
432
  }
391
433
  }
392
- else if(document['selection'] && document['selection'].empty) {
434
+ else if (document['selection'] && document['selection'].empty) {
393
435
  try {
394
436
  document['selection'].empty();
395
437
  } catch(error) {
@@ -399,7 +441,7 @@ this.primevue.utils = (function (exports) {
399
441
  },
400
442
 
401
443
  calculateScrollbarWidth() {
402
- if(this.calculatedScrollbarWidth != null)
444
+ if (this.calculatedScrollbarWidth != null)
403
445
  return this.calculatedScrollbarWidth;
404
446
 
405
447
  let scrollDiv = document.createElement("div");
@@ -415,7 +457,7 @@ this.primevue.utils = (function (exports) {
415
457
  },
416
458
 
417
459
  getBrowser() {
418
- if(!this.browser) {
460
+ if (!this.browser) {
419
461
  let matched = this.resolveUserAgent();
420
462
  this.browser = {};
421
463
 
@@ -450,7 +492,7 @@ this.primevue.utils = (function (exports) {
450
492
  },
451
493
 
452
494
  isVisible(element) {
453
- return element.offsetParent != null;
495
+ return element && element.offsetParent != null;
454
496
  },
455
497
 
456
498
  invokeElementMethod(element, methodName, args) {
@@ -461,13 +503,15 @@ this.primevue.utils = (function (exports) {
461
503
  return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
462
504
  },
463
505
 
464
- getFocusableElements(element) {
465
- let focusableElements = this.find(element, `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
466
- [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
467
- input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
468
- textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]), [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden]),
469
- [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`
470
- );
506
+ getFocusableElements(element, selector = '') {
507
+ let focusableElements = this.find(element, `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
508
+ [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
509
+ input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
510
+ select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
511
+ textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
512
+ [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
513
+ [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector}`
514
+ );
471
515
 
472
516
  let visibleFocusableElements = [];
473
517
  for (let focusableElement of focusableElements) {
@@ -478,8 +522,8 @@ this.primevue.utils = (function (exports) {
478
522
  return visibleFocusableElements;
479
523
  },
480
524
 
481
- getFirstFocusableElement(element) {
482
- const focusableElements = this.getFocusableElements(element);
525
+ getFirstFocusableElement(element, selector) {
526
+ const focusableElements = this.getFocusableElements(element, selector);
483
527
  return focusableElements.length > 0 ? focusableElements[0] : null;
484
528
  },
485
529
 
@@ -793,8 +837,30 @@ this.primevue.utils = (function (exports) {
793
837
 
794
838
  isNotEmpty(value) {
795
839
  return !this.isEmpty(value);
796
- }
840
+ },
797
841
 
842
+ isPrintableCharacter(char = '') {
843
+ return this.isNotEmpty(char) && char.length === 1 && char.match(/\S| /);
844
+ },
845
+
846
+ /**
847
+ * Firefox-v103 does not currently support the "findLastIndex" method. It is stated that this method will be supported with Firefox-v104.
848
+ * https://caniuse.com/mdn-javascript_builtins_array_findlastindex
849
+ */
850
+ findLastIndex(arr, callback) {
851
+ let index = -1;
852
+
853
+ if (this.isNotEmpty(arr)) {
854
+ try {
855
+ index = arr.findLastIndex(callback);
856
+ }
857
+ catch {
858
+ index = arr.lastIndexOf([...arr].reverse().find(callback));
859
+ }
860
+ }
861
+
862
+ return index;
863
+ }
798
864
  };
799
865
 
800
866
  function handler() {
@@ -1451,6 +1517,23 @@ this.primevue.config = (function (exports, vue, api) {
1451
1517
  dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"],
1452
1518
  monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December"],
1453
1519
  monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
1520
+ chooseYear: 'Choose Year',
1521
+ chooseMonth: 'Choose Month',
1522
+ chooseDate: 'Choose Date',
1523
+ prevDecade: 'Previous Decade',
1524
+ nextDecade: 'Next Decade',
1525
+ prevYear: 'Previous Year',
1526
+ nextYear: 'Next Year',
1527
+ prevMonth: 'Previous Month',
1528
+ nextMonth: 'Next Month',
1529
+ prevHour: 'Previous Hour',
1530
+ nextHour: 'Next Hour',
1531
+ prevMinute: 'Previous Minute',
1532
+ nextMinute: 'Next Minute',
1533
+ prevSecond: 'Previous Second',
1534
+ nextSecond: 'Next Second',
1535
+ am: 'am',
1536
+ pm: 'pm',
1454
1537
  today: 'Today',
1455
1538
  weekHeader: 'Wk',
1456
1539
  firstDayOfWeek: 0,
@@ -1459,8 +1542,22 @@ this.primevue.config = (function (exports, vue, api) {
1459
1542
  medium: 'Medium',
1460
1543
  strong: 'Strong',
1461
1544
  passwordPrompt: 'Enter a password',
1462
- emptyFilterMessage: 'No results found',
1463
- emptyMessage: 'No available options'
1545
+ emptyFilterMessage: 'No results found', // @deprecated Use 'emptySearchMessage' option instead.
1546
+ searchMessage: '{0} results are available',
1547
+ selectionMessage: '{0} items selected',
1548
+ emptySelectionMessage: 'No selected item',
1549
+ emptySearchMessage: 'No results found',
1550
+ emptyMessage: 'No available options',
1551
+ aria: {
1552
+ trueLabel: 'True',
1553
+ falseLabel: 'False',
1554
+ nullLabel: 'Not Selected',
1555
+ star: '1 star',
1556
+ stars: '{star} stars',
1557
+ selectAll: 'All items selected',
1558
+ unselectAll: 'All items unselected',
1559
+ close: 'Close'
1560
+ }
1464
1561
  },
1465
1562
  filterMatchModeOptions: {
1466
1563
  text: [
@@ -1500,8 +1597,8 @@ this.primevue.config = (function (exports, vue, api) {
1500
1597
  const PrimeVue = vue.inject(PrimeVueSymbol);
1501
1598
  if (!PrimeVue) {
1502
1599
  throw new Error('PrimeVue is not installed!');
1503
- }
1504
-
1600
+ }
1601
+
1505
1602
  return PrimeVue;
1506
1603
  }
1507
1604
 
@@ -1540,6 +1637,7 @@ this.primevue.ripple = (function (utils) {
1540
1637
  function create(el) {
1541
1638
  let ink = document.createElement('span');
1542
1639
  ink.className = 'p-ink';
1640
+ ink.setAttribute("role", "presentation");
1543
1641
  el.appendChild(ink);
1544
1642
 
1545
1643
  ink.addEventListener('animationend', onAnimationEnd);
@@ -1959,12 +2057,16 @@ this.primevue.tooltip = (function (utils) {
1959
2057
  target.$_ptooltipClass = null;
1960
2058
  target.$_ptooltipFitContent = true;
1961
2059
  }
1962
- else {
1963
- target.$_ptooltipValue = options.value.value;
1964
- target.$_ptooltipDisabled = options.value.disabled || false;
1965
- target.$_ptooltipEscape = options.value.escape || false;
1966
- target.$_ptooltipClass = options.value.class;
1967
- target.$_ptooltipFitContent = options.value.fitContent || true;
2060
+ else if (typeof options.value === 'object' && options.value) {
2061
+ if (options.value.value === undefined || options.value.value === null || options.value.value.trim() === '') return;
2062
+ else {
2063
+ /* eslint-disable */
2064
+ target.$_ptooltipValue = options.value.value;
2065
+ target.$_ptooltipDisabled = !!options.value.disabled === options.value.disabled ? options.value.disabled : false;
2066
+ target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : false;
2067
+ target.$_ptooltipClass = options.value.class;
2068
+ target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true;
2069
+ }
1968
2070
  }
1969
2071
 
1970
2072
  target.$_ptooltipZIndex = options.instance.$primevue && options.instance.$primevue.config && options.instance.$primevue.config.zIndex.tooltip;
@@ -1993,11 +2095,16 @@ this.primevue.tooltip = (function (utils) {
1993
2095
  target.$_ptooltipEscape = false;
1994
2096
  target.$_ptooltipClass = null;
1995
2097
  }
1996
- else {
1997
- target.$_ptooltipValue = options.value.value;
1998
- target.$_ptooltipDisabled = options.value.disabled || false;
1999
- target.$_ptooltipEscape = options.value.escape || false;
2000
- target.$_ptooltipClass = options.value.class;
2098
+ else if (typeof options.value === 'object' && options.value) {
2099
+ if (options.value.value === undefined || options.value.value === null || options.value.value.trim() === '') return;
2100
+ else {
2101
+ /* eslint-disable */
2102
+ target.$_ptooltipValue = options.value.value;
2103
+ target.$_ptooltipDisabled = !!options.value.disabled === options.value.disabled ? options.value.disabled : false;
2104
+ target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : false;
2105
+ target.$_ptooltipClass = options.value.class;
2106
+ target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true;
2107
+ }
2001
2108
  }
2002
2109
  }
2003
2110
  };
@@ -2069,6 +2176,10 @@ this.primevue.virtualscroller = (function (vue) {
2069
2176
  showLoader: {
2070
2177
  type: Boolean,
2071
2178
  default: false
2179
+ },
2180
+ tabindex: {
2181
+ type: Number,
2182
+ default: 0
2072
2183
  }
2073
2184
  },
2074
2185
  data() {
@@ -2133,24 +2244,20 @@ this.primevue.virtualscroller = (function (vue) {
2133
2244
  const first = this.first;
2134
2245
  const { numToleratedItems } = this.calculateNumItems();
2135
2246
  const itemSize = this.itemSize;
2136
- const contentPos = this.getContentPosition();
2137
2247
  const calculateFirst = (_index = 0, _numT) => (_index <= _numT ? 0 : _index);
2138
- const calculateCoord = (_first, _size, _cpos) => (_first * _size) + _cpos;
2248
+ const calculateCoord = (_first, _size) => (_first * _size);
2139
2249
  const scrollTo = (left = 0, top = 0) => this.scrollTo({ left, top, behavior });
2140
2250
 
2141
2251
  if (both) {
2142
2252
  const newFirst = { rows: calculateFirst(index[0], numToleratedItems[0]), cols: calculateFirst(index[1], numToleratedItems[1]) };
2143
2253
  if (newFirst.rows !== first.rows || newFirst.cols !== first.cols) {
2144
- scrollTo(calculateCoord(newFirst.cols, itemSize[1], contentPos.left), calculateCoord(newFirst.rows, itemSize[0], contentPos.top));
2145
- this.first = newFirst;
2254
+ scrollTo(calculateCoord(newFirst.cols, itemSize[1]), calculateCoord(newFirst.rows, itemSize[0]));
2146
2255
  }
2147
2256
  }
2148
2257
  else {
2149
2258
  const newFirst = calculateFirst(index, numToleratedItems);
2150
-
2151
2259
  if (newFirst !== first) {
2152
- horizontal ? scrollTo(calculateCoord(newFirst, itemSize, contentPos.left), 0) : scrollTo(0, calculateCoord(newFirst, itemSize, contentPos.top));
2153
- this.first = newFirst;
2260
+ horizontal ? scrollTo(calculateCoord(newFirst, itemSize), 0) : scrollTo(0, calculateCoord(newFirst, itemSize));
2154
2261
  }
2155
2262
  }
2156
2263
  },
@@ -2381,9 +2488,10 @@ this.primevue.virtualscroller = (function (vue) {
2381
2488
  const scrollTop = calculateScrollPos(target.scrollTop, contentPos.top);
2382
2489
  const scrollLeft = calculateScrollPos(target.scrollLeft, contentPos.left);
2383
2490
 
2384
- let newFirst = 0;
2491
+ let newFirst = both ? { rows: 0, cols: 0 } : 0;
2385
2492
  let newLast = this.last;
2386
2493
  let isRangeChanged = false;
2494
+ let newScrollPos = this.lastScrollPos;
2387
2495
 
2388
2496
  if (both) {
2389
2497
  const isScrollDown = this.lastScrollPos.top <= scrollTop;
@@ -2403,9 +2511,8 @@ this.primevue.virtualscroller = (function (vue) {
2403
2511
  cols: calculateLast(currentIndex.cols, newFirst.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], true)
2404
2512
  };
2405
2513
 
2406
- isRangeChanged = (newFirst.rows !== this.first.rows && newLast.rows !== this.last.rows) || (newFirst.cols !== this.first.cols && newLast.cols !== this.last.cols);
2407
-
2408
- this.lastScrollPos = { top: scrollTop, left: scrollLeft };
2514
+ isRangeChanged = (newFirst.rows !== this.first.rows || newLast.rows !== this.last.rows) || (newFirst.cols !== this.first.cols || newLast.cols !== this.last.cols);
2515
+ newScrollPos = { top: scrollTop, left: scrollLeft };
2409
2516
  }
2410
2517
  else {
2411
2518
  const scrollPos = horizontal ? scrollLeft : scrollTop;
@@ -2415,19 +2522,19 @@ this.primevue.virtualscroller = (function (vue) {
2415
2522
 
2416
2523
  newFirst = calculateFirst(currentIndex, triggerIndex, this.first, this.last, this.numItemsInViewport, this.d_numToleratedItems, isScrollDownOrRight);
2417
2524
  newLast = calculateLast(currentIndex, newFirst, this.last, this.numItemsInViewport, this.d_numToleratedItems);
2418
- isRangeChanged = newFirst !== this.first && newLast !== this.last;
2419
-
2420
- this.lastScrollPos = scrollPos;
2525
+ isRangeChanged = newFirst !== this.first || newLast !== this.last;
2526
+ newScrollPos = scrollPos;
2421
2527
  }
2422
2528
 
2423
2529
  return {
2424
2530
  first: newFirst,
2425
2531
  last: newLast,
2426
- isRangeChanged
2532
+ isRangeChanged,
2533
+ scrollPos: newScrollPos
2427
2534
  }
2428
2535
  },
2429
2536
  onScrollChange(event) {
2430
- const { first, last, isRangeChanged } = this.onScrollPositionChange(event);
2537
+ const { first, last, isRangeChanged, scrollPos } = this.onScrollPositionChange(event);
2431
2538
 
2432
2539
  if (isRangeChanged) {
2433
2540
  const newState = { first, last };
@@ -2436,6 +2543,7 @@ this.primevue.virtualscroller = (function (vue) {
2436
2543
 
2437
2544
  this.first = first;
2438
2545
  this.last = last;
2546
+ this.lastScrollPos = scrollPos;
2439
2547
 
2440
2548
  this.$emit('scroll-index-change', newState);
2441
2549
 
@@ -2551,7 +2659,8 @@ this.primevue.virtualscroller = (function (vue) {
2551
2659
  }
2552
2660
  };
2553
2661
 
2554
- const _hoisted_1 = {
2662
+ const _hoisted_1 = ["tabindex"];
2663
+ const _hoisted_2 = {
2555
2664
  key: 1,
2556
2665
  class: "p-virtualscroller-loading-icon pi pi-spinner pi-spin"
2557
2666
  };
@@ -2562,7 +2671,7 @@ this.primevue.virtualscroller = (function (vue) {
2562
2671
  key: 0,
2563
2672
  ref: $options.elementRef,
2564
2673
  class: vue.normalizeClass($options.containerClass),
2565
- tabindex: 0,
2674
+ tabindex: $props.tabindex,
2566
2675
  style: vue.normalizeStyle($props.style),
2567
2676
  onScroll: _cache[0] || (_cache[0] = (...args) => ($options.onScroll && $options.onScroll(...args)))
2568
2677
  }, [
@@ -2615,10 +2724,10 @@ this.primevue.virtualscroller = (function (vue) {
2615
2724
  options: $options.getLoaderOptions(index, $options.isBoth() && { numCols: _ctx.d_numItemsInViewport.cols })
2616
2725
  })
2617
2726
  }), 128))
2618
- : (vue.openBlock(), vue.createElementBlock("i", _hoisted_1))
2727
+ : (vue.openBlock(), vue.createElementBlock("i", _hoisted_2))
2619
2728
  ], 2))
2620
2729
  : vue.createCommentVNode("", true)
2621
- ], 38))
2730
+ ], 46, _hoisted_1))
2622
2731
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2623
2732
  vue.renderSlot(_ctx.$slots, "default"),
2624
2733
  vue.renderSlot(_ctx.$slots, "content", {
@@ -2855,6 +2964,9 @@ this.primevue.button = (function (Ripple, vue) {
2855
2964
  },
2856
2965
  disabled() {
2857
2966
  return this.$attrs.disabled || this.loading;
2967
+ },
2968
+ defaultAriaLabel() {
2969
+ return (this.label ? this.label + (this.badge ? ' ' + this.badge : '') : this.$attrs['aria-label']);
2858
2970
  }
2859
2971
  },
2860
2972
  directives: {
@@ -2862,7 +2974,7 @@ this.primevue.button = (function (Ripple, vue) {
2862
2974
  }
2863
2975
  };
2864
2976
 
2865
- const _hoisted_1 = ["disabled"];
2977
+ const _hoisted_1 = ["aria-label", "disabled"];
2866
2978
  const _hoisted_2 = { class: "p-button-label" };
2867
2979
 
2868
2980
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -2871,6 +2983,7 @@ this.primevue.button = (function (Ripple, vue) {
2871
2983
  return vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
2872
2984
  class: vue.normalizeClass($options.buttonClass),
2873
2985
  type: "button",
2986
+ "aria-label": $options.defaultAriaLabel,
2874
2987
  disabled: $options.disabled
2875
2988
  }, [
2876
2989
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
@@ -2911,7 +3024,6 @@ this.primevue.inputtext = (function (vue) {
2911
3024
 
2912
3025
  var script = {
2913
3026
  name: 'InputText',
2914
- inheritAttrs: false,
2915
3027
  emits: ['update:modelValue'],
2916
3028
  props: {
2917
3029
  modelValue: null
@@ -2931,11 +3043,11 @@ this.primevue.inputtext = (function (vue) {
2931
3043
  const _hoisted_1 = ["value"];
2932
3044
 
2933
3045
  function render(_ctx, _cache, $props, $setup, $data, $options) {
2934
- return (vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
2935
- class: ['p-inputtext p-component', {'p-filled': $options.filled}],
3046
+ return (vue.openBlock(), vue.createElementBlock("input", {
3047
+ class: vue.normalizeClass(['p-inputtext p-component', {'p-filled': $options.filled}]),
2936
3048
  value: $props.modelValue,
2937
3049
  onInput: _cache[0] || (_cache[0] = (...args) => ($options.onInput && $options.onInput(...args)))
2938
- }, _ctx.$attrs), null, 16, _hoisted_1))
3050
+ }, null, 42, _hoisted_1))
2939
3051
  }
2940
3052
 
2941
3053
  script.render = render;
@@ -2955,7 +3067,6 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
2955
3067
 
2956
3068
  var script = {
2957
3069
  name: 'InputNumber',
2958
- inheritAttrs: false,
2959
3070
  emits: ['update:modelValue', 'input', 'focus', 'blur'],
2960
3071
  props: {
2961
3072
  modelValue: {
@@ -3050,10 +3161,28 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3050
3161
  type: Boolean,
3051
3162
  default: false
3052
3163
  },
3053
- style: null,
3054
- class: null,
3164
+ disabled: {
3165
+ type: Boolean,
3166
+ default: false
3167
+ },
3168
+ placeholder: {
3169
+ type: String,
3170
+ default: null
3171
+ },
3172
+ inputId: null,
3173
+ inputClass: null,
3055
3174
  inputStyle: null,
3056
- inputClass: null
3175
+ inputProps: null,
3176
+ incrementButtonProps: null,
3177
+ decrementButtonProps: null,
3178
+ 'aria-labelledby': {
3179
+ type: String,
3180
+ default: null
3181
+ },
3182
+ 'aria-label': {
3183
+ type: String,
3184
+ default: null
3185
+ }
3057
3186
  },
3058
3187
  numberFormat: null,
3059
3188
  _numeral: null,
@@ -3265,24 +3394,24 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3265
3394
  }
3266
3395
  },
3267
3396
  onUpButtonMouseDown(event) {
3268
- if (!this.$attrs.disabled) {
3397
+ if (!this.disabled) {
3269
3398
  this.$refs.input.$el.focus();
3270
3399
  this.repeat(event, null, 1);
3271
3400
  event.preventDefault();
3272
3401
  }
3273
3402
  },
3274
3403
  onUpButtonMouseUp() {
3275
- if (!this.$attrs.disabled) {
3404
+ if (!this.disabled) {
3276
3405
  this.clearTimer();
3277
3406
  }
3278
3407
  },
3279
3408
  onUpButtonMouseLeave() {
3280
- if (!this.$attrs.disabled) {
3409
+ if (!this.disabled) {
3281
3410
  this.clearTimer();
3282
3411
  }
3283
3412
  },
3284
3413
  onUpButtonKeyUp() {
3285
- if (!this.$attrs.disabled) {
3414
+ if (!this.disabled) {
3286
3415
  this.clearTimer();
3287
3416
  }
3288
3417
  },
@@ -3292,24 +3421,24 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3292
3421
  }
3293
3422
  },
3294
3423
  onDownButtonMouseDown(event) {
3295
- if (!this.$attrs.disabled) {
3424
+ if (!this.disabled) {
3296
3425
  this.$refs.input.$el.focus();
3297
3426
  this.repeat(event, null, -1);
3298
3427
  event.preventDefault();
3299
3428
  }
3300
3429
  },
3301
3430
  onDownButtonMouseUp() {
3302
- if (!this.$attrs.disabled) {
3431
+ if (!this.disabled) {
3303
3432
  this.clearTimer();
3304
3433
  }
3305
3434
  },
3306
3435
  onDownButtonMouseLeave() {
3307
- if (!this.$attrs.disabled) {
3436
+ if (!this.disabled) {
3308
3437
  this.clearTimer();
3309
3438
  }
3310
3439
  },
3311
3440
  onDownButtonKeyUp() {
3312
- if (!this.$attrs.disabled) {
3441
+ if (!this.disabled) {
3313
3442
  this.clearTimer();
3314
3443
  }
3315
3444
  },
@@ -3473,6 +3602,22 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3473
3602
  this.updateValue(event, newValueStr, null, 'delete-range');
3474
3603
  }
3475
3604
  break;
3605
+
3606
+ //home
3607
+ case 36:
3608
+ if (this.min) {
3609
+ this.updateModel(event, this.min);
3610
+ event.preventDefault();
3611
+ }
3612
+ break;
3613
+
3614
+ //end
3615
+ case 35:
3616
+ if (this.max) {
3617
+ this.updateModel(event, this.max);
3618
+ event.preventDefault();
3619
+ }
3620
+ break;
3476
3621
  }
3477
3622
  },
3478
3623
  onInputKeyPress(event) {
@@ -3882,7 +4027,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3882
4027
  },
3883
4028
  computed: {
3884
4029
  containerClass() {
3885
- return ['p-inputnumber p-component p-inputwrapper', this.class, {
4030
+ return ['p-inputnumber p-component p-inputwrapper', {
3886
4031
  'p-inputwrapper-filled': this.filled,
3887
4032
  'p-inputwrapper-focus': this.focused,
3888
4033
  'p-inputnumber-buttons-stacked': this.showButtons && this.buttonLayout === 'stacked',
@@ -3946,18 +4091,23 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3946
4091
  const _component_INButton = vue.resolveComponent("INButton");
3947
4092
 
3948
4093
  return (vue.openBlock(), vue.createElementBlock("span", {
3949
- class: vue.normalizeClass($options.containerClass),
3950
- style: vue.normalizeStyle($props.style)
4094
+ class: vue.normalizeClass($options.containerClass)
3951
4095
  }, [
3952
4096
  vue.createVNode(_component_INInputText, vue.mergeProps({
3953
4097
  ref: "input",
3954
- class: ['p-inputnumber-input', $props.inputClass],
4098
+ class: ["p-inputnumber-input", $props.inputClass],
4099
+ role: "spinbutton",
4100
+ id: $props.inputId,
3955
4101
  style: $props.inputStyle,
3956
- value: $options.formattedValue
3957
- }, _ctx.$attrs, {
3958
- "aria-valumin": $props.min,
4102
+ value: $options.formattedValue,
4103
+ "aria-valuemin": $props.min,
3959
4104
  "aria-valuemax": $props.max,
4105
+ "aria-valuenow": $props.modelValue,
4106
+ disabled: $props.disabled,
3960
4107
  readonly: $props.readonly,
4108
+ placeholder: $props.placeholder,
4109
+ "aria-labelledby": _ctx.ariaLabelledby,
4110
+ "aria-label": _ctx.ariaLabel,
3961
4111
  onInput: $options.onUserInput,
3962
4112
  onKeydown: $options.onInputKeyDown,
3963
4113
  onKeypress: $options.onInputKeyPress,
@@ -3965,21 +4115,25 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3965
4115
  onClick: $options.onInputClick,
3966
4116
  onFocus: $options.onInputFocus,
3967
4117
  onBlur: $options.onInputBlur
3968
- }), null, 16, ["class", "style", "value", "aria-valumin", "aria-valuemax", "readonly", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur"]),
4118
+ }, $props.inputProps), null, 16, ["id", "class", "style", "value", "aria-valuemin", "aria-valuemax", "aria-valuenow", "disabled", "readonly", "placeholder", "aria-labelledby", "aria-label", "onInput", "onKeydown", "onKeypress", "onPaste", "onClick", "onFocus", "onBlur"]),
3969
4119
  ($props.showButtons && $props.buttonLayout === 'stacked')
3970
4120
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [
3971
4121
  vue.createVNode(_component_INButton, vue.mergeProps({
3972
4122
  class: $options.upButtonClass,
3973
4123
  icon: $props.incrementButtonIcon
3974
4124
  }, vue.toHandlers($options.upButtonListeners), {
3975
- disabled: _ctx.$attrs.disabled
3976
- }), null, 16, ["class", "icon", "disabled"]),
4125
+ disabled: $props.disabled,
4126
+ tabindex: -1,
4127
+ "aria-hidden": "true"
4128
+ }, $props.incrementButtonProps), null, 16, ["class", "icon", "disabled"]),
3977
4129
  vue.createVNode(_component_INButton, vue.mergeProps({
3978
4130
  class: $options.downButtonClass,
3979
4131
  icon: $props.decrementButtonIcon
3980
4132
  }, vue.toHandlers($options.downButtonListeners), {
3981
- disabled: _ctx.$attrs.disabled
3982
- }), null, 16, ["class", "icon", "disabled"])
4133
+ disabled: $props.disabled,
4134
+ tabindex: -1,
4135
+ "aria-hidden": "true"
4136
+ }, $props.decrementButtonProps), null, 16, ["class", "icon", "disabled"])
3983
4137
  ]))
3984
4138
  : vue.createCommentVNode("", true),
3985
4139
  ($props.showButtons && $props.buttonLayout !== 'stacked')
@@ -3988,8 +4142,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3988
4142
  class: $options.upButtonClass,
3989
4143
  icon: $props.incrementButtonIcon
3990
4144
  }, vue.toHandlers($options.upButtonListeners), {
3991
- disabled: _ctx.$attrs.disabled
3992
- }), null, 16, ["class", "icon", "disabled"]))
4145
+ disabled: $props.disabled,
4146
+ tabindex: -1,
4147
+ "aria-hidden": "true"
4148
+ }, $props.incrementButtonProps), null, 16, ["class", "icon", "disabled"]))
3993
4149
  : vue.createCommentVNode("", true),
3994
4150
  ($props.showButtons && $props.buttonLayout !== 'stacked')
3995
4151
  ? (vue.openBlock(), vue.createBlock(_component_INButton, vue.mergeProps({
@@ -3997,10 +4153,12 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
3997
4153
  class: $options.downButtonClass,
3998
4154
  icon: $props.decrementButtonIcon
3999
4155
  }, vue.toHandlers($options.downButtonListeners), {
4000
- disabled: _ctx.$attrs.disabled
4001
- }), null, 16, ["class", "icon", "disabled"]))
4156
+ disabled: $props.disabled,
4157
+ tabindex: -1,
4158
+ "aria-hidden": "true"
4159
+ }, $props.decrementButtonProps), null, 16, ["class", "icon", "disabled"]))
4002
4160
  : vue.createCommentVNode("", true)
4003
- ], 6))
4161
+ ], 2))
4004
4162
  }
4005
4163
 
4006
4164
  function styleInject(css, ref) {
@@ -4327,7 +4485,7 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4327
4485
 
4328
4486
  var script = {
4329
4487
  name: 'Dropdown',
4330
- emits: ['update:modelValue', 'before-show', 'before-hide', 'show', 'hide', 'change', 'filter', 'focus', 'blur'],
4488
+ emits: ['update:modelValue', 'change', 'focus', 'blur', 'before-show', 'before-hide', 'show', 'hide', 'filter'],
4331
4489
  props: {
4332
4490
  modelValue: null,
4333
4491
  options: Array,
@@ -4357,12 +4515,46 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4357
4515
  dataKey: null,
4358
4516
  showClear: Boolean,
4359
4517
  inputId: String,
4360
- tabindex: String,
4361
- ariaLabelledBy: null,
4518
+ inputStyle: null,
4519
+ inputClass: null,
4520
+ inputProps: null,
4521
+ panelStyle: null,
4522
+ panelClass: null,
4523
+ panelProps: null,
4524
+ filterInputProps: null,
4525
+ clearIconProps: null,
4362
4526
  appendTo: {
4363
4527
  type: String,
4364
4528
  default: 'body'
4365
4529
  },
4530
+ loading: {
4531
+ type: Boolean,
4532
+ default: false
4533
+ },
4534
+ loadingIcon: {
4535
+ type: String,
4536
+ default: 'pi pi-spinner pi-spin'
4537
+ },
4538
+ virtualScrollerOptions: {
4539
+ type: Object,
4540
+ default: null
4541
+ },
4542
+ autoOptionFocus: {
4543
+ type: Boolean,
4544
+ default: true
4545
+ },
4546
+ filterMessage: {
4547
+ type: String,
4548
+ default: null
4549
+ },
4550
+ selectionMessage: {
4551
+ type: String,
4552
+ default: null
4553
+ },
4554
+ emptySelectionMessage: {
4555
+ type: String,
4556
+ default: null
4557
+ },
4366
4558
  emptyFilterMessage: {
4367
4559
  type: String,
4368
4560
  default: null
@@ -4371,46 +4563,55 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4371
4563
  type: String,
4372
4564
  default: null
4373
4565
  },
4374
- panelClass: null,
4375
- loading: {
4376
- type: Boolean,
4377
- default: false
4566
+ tabindex: {
4567
+ type: Number,
4568
+ default: 0
4378
4569
  },
4379
- loadingIcon: {
4570
+ 'aria-label': {
4380
4571
  type: String,
4381
- default: 'pi pi-spinner pi-spin'
4572
+ default: null
4382
4573
  },
4383
- virtualScrollerOptions: {
4384
- type: Object,
4574
+ 'aria-labelledby': {
4575
+ type: String,
4385
4576
  default: null
4386
4577
  }
4387
4578
  },
4579
+ outsideClickListener: null,
4580
+ scrollHandler: null,
4581
+ resizeListener: null,
4582
+ overlay: null,
4583
+ list: null,
4584
+ virtualScroller: null,
4585
+ searchTimeout: null,
4586
+ searchValue: null,
4587
+ isModelValueChanged: false,
4588
+ selectOnFocus: false,
4589
+ focusOnHover: false,
4388
4590
  data() {
4389
4591
  return {
4592
+ id: utils.UniqueComponentId(),
4390
4593
  focused: false,
4594
+ focusedOptionIndex: -1,
4391
4595
  filterValue: null,
4392
4596
  overlayVisible: false
4393
- };
4597
+ }
4394
4598
  },
4395
4599
  watch: {
4396
4600
  modelValue() {
4397
4601
  this.isModelValueChanged = true;
4602
+ },
4603
+ options() {
4604
+ this.autoUpdateModel();
4398
4605
  }
4399
4606
  },
4400
- outsideClickListener: null,
4401
- scrollHandler: null,
4402
- resizeListener: null,
4403
- searchTimeout: null,
4404
- currentSearchChar: null,
4405
- previousSearchChar: null,
4406
- searchValue: null,
4407
- overlay: null,
4408
- itemsWrapper: null,
4409
- virtualScroller: null,
4410
- isModelValueChanged: false,
4607
+ mounted() {
4608
+ this.id = this.$attrs.id || this.id;
4609
+
4610
+ this.autoUpdateModel();
4611
+ },
4411
4612
  updated() {
4412
4613
  if (this.overlayVisible && this.isModelValueChanged) {
4413
- this.scrollValueInView();
4614
+ this.scrollInView(this.findSelectedOptionIndex());
4414
4615
  }
4415
4616
 
4416
4617
  this.isModelValueChanged = false;
@@ -4424,8 +4625,6 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4424
4625
  this.scrollHandler = null;
4425
4626
  }
4426
4627
 
4427
- this.itemsWrapper = null;
4428
-
4429
4628
  if (this.overlay) {
4430
4629
  utils.ZIndexUtils.clear(this.overlay);
4431
4630
  this.overlay = null;
@@ -4442,13 +4641,13 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4442
4641
  return this.optionValue ? utils.ObjectUtils.resolveFieldData(option, this.optionValue) : option;
4443
4642
  },
4444
4643
  getOptionRenderKey(option, index) {
4445
- return this.dataKey ? utils.ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option) + '_' + index.toString();
4644
+ return (this.dataKey ? utils.ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index;
4446
4645
  },
4447
4646
  isOptionDisabled(option) {
4448
4647
  return this.optionDisabled ? utils.ObjectUtils.resolveFieldData(option, this.optionDisabled) : false;
4449
4648
  },
4450
- getOptionGroupRenderKey(optionGroup) {
4451
- return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
4649
+ isOptionGroup(option) {
4650
+ return this.optionGroupLabel && option.optionGroup && option.group;
4452
4651
  },
4453
4652
  getOptionGroupLabel(optionGroup) {
4454
4653
  return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
@@ -4456,254 +4655,333 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4456
4655
  getOptionGroupChildren(optionGroup) {
4457
4656
  return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren);
4458
4657
  },
4459
- getSelectedOption() {
4460
- let index = this.getSelectedOptionIndex();
4461
- return index !== -1 ? (this.optionGroupLabel ? this.getOptionGroupChildren(this.visibleOptions[index.group])[index.option]: this.visibleOptions[index]) : null;
4462
- },
4463
- getSelectedOptionIndex() {
4464
- if (this.modelValue != null && this.visibleOptions) {
4465
- if (this.optionGroupLabel) {
4466
- for (let i = 0; i < this.visibleOptions.length; i++) {
4467
- let selectedOptionIndex = this.findOptionIndexInList(this.modelValue, this.getOptionGroupChildren(this.visibleOptions[i]));
4468
- if (selectedOptionIndex !== -1) {
4469
- return {group: i, option: selectedOptionIndex};
4470
- }
4471
- }
4472
- }
4473
- else {
4474
- return this.findOptionIndexInList(this.modelValue, this.visibleOptions);
4475
- }
4476
- }
4477
-
4478
- return -1;
4479
- },
4480
- findOptionIndexInList(value, list) {
4481
- for (let i = 0; i < list.length; i++) {
4482
- if ((utils.ObjectUtils.equals(value, this.getOptionValue(list[i]), this.equalityKey))) {
4483
- return i;
4484
- }
4485
- }
4486
-
4487
- return -1;
4488
- },
4489
- isSelected(option) {
4490
- return utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
4658
+ getAriaPosInset(index) {
4659
+ return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(option => this.isOptionGroup(option)).length : index) + 1;
4491
4660
  },
4492
4661
  show(isFocus) {
4493
4662
  this.$emit('before-show');
4494
4663
  this.overlayVisible = true;
4664
+ this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : (this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1);
4495
4665
 
4496
4666
  isFocus && this.$refs.focusInput.focus();
4497
4667
  },
4498
- hide() {
4499
- this.$emit('before-hide');
4500
- this.overlayVisible = false;
4668
+ hide(isFocus) {
4669
+ const _hide = () => {
4670
+ this.$emit('before-hide');
4671
+ this.overlayVisible = false;
4672
+ this.focusedOptionIndex = -1;
4673
+ this.searchValue = '';
4674
+
4675
+ isFocus && this.$refs.focusInput.focus();
4676
+ };
4677
+
4678
+ setTimeout(() => { _hide(); }, 0); // For ScreenReaders
4501
4679
  },
4502
4680
  onFocus(event) {
4503
4681
  this.focused = true;
4682
+ this.focusedOptionIndex = this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1;
4683
+ this.overlayVisible && this.scrollInView(this.focusedOptionIndex);
4504
4684
  this.$emit('focus', event);
4505
4685
  },
4506
4686
  onBlur(event) {
4507
4687
  this.focused = false;
4688
+ this.focusedOptionIndex = -1;
4689
+ this.searchValue = '';
4508
4690
  this.$emit('blur', event);
4509
4691
  },
4510
4692
  onKeyDown(event) {
4511
- switch(event.which) {
4512
- //down
4513
- case 40:
4514
- this.onDownKey(event);
4515
- break;
4693
+ switch (event.code) {
4694
+ case 'ArrowDown':
4695
+ this.onArrowDownKey(event);
4696
+ break;
4516
4697
 
4517
- //up
4518
- case 38:
4519
- this.onUpKey(event);
4520
- break;
4698
+ case 'ArrowUp':
4699
+ this.onArrowUpKey(event, this.editable);
4700
+ break;
4521
4701
 
4522
- //space
4523
- case 32:
4524
- if (!this.overlayVisible) {
4525
- this.show();
4526
- event.preventDefault();
4527
- }
4528
- break;
4702
+ case 'ArrowLeft':
4703
+ case 'ArrowRight':
4704
+ this.onArrowLeftKey(event, this.editable);
4705
+ break;
4529
4706
 
4530
- //enter and escape
4531
- case 13:
4532
- case 27:
4533
- if (this.overlayVisible) {
4534
- this.hide();
4535
- event.preventDefault();
4536
- }
4537
- break;
4707
+ case 'Home':
4708
+ this.onHomeKey(event, this.editable);
4709
+ break;
4538
4710
 
4539
- //tab
4540
- case 9:
4541
- this.hide();
4542
- break;
4711
+ case 'End':
4712
+ this.onEndKey(event, this.editable);
4713
+ break;
4714
+
4715
+ case 'PageDown':
4716
+ this.onPageDownKey(event);
4717
+ break;
4718
+
4719
+ case 'PageUp':
4720
+ this.onPageUpKey(event);
4721
+ break;
4722
+
4723
+ case 'Space':
4724
+ this.onSpaceKey(event, this.editable);
4725
+ break;
4726
+
4727
+ case 'Enter':
4728
+ this.onEnterKey(event);
4729
+ break;
4730
+
4731
+ case 'Escape':
4732
+ this.onEscapeKey(event);
4733
+ break;
4734
+
4735
+ case 'Tab':
4736
+ this.onTabKey(event);
4737
+ break;
4738
+
4739
+ case 'Backspace':
4740
+ this.onBackspaceKey(event, this.editable);
4741
+ break;
4742
+
4743
+ case 'ShiftLeft':
4744
+ case 'ShiftRight':
4745
+ //NOOP
4746
+ break;
4543
4747
 
4544
4748
  default:
4545
- this.search(event);
4546
- break;
4749
+ if (utils.ObjectUtils.isPrintableCharacter(event.key)) {
4750
+ !this.overlayVisible && this.show();
4751
+ !this.editable && this.searchOptions(event, event.key);
4752
+ }
4753
+
4754
+ break;
4755
+ }
4756
+ },
4757
+ onEditableInput(event) {
4758
+ const value = event.target.value;
4759
+
4760
+ this.searchValue = '';
4761
+ const matched = this.searchOptions(event, value);
4762
+ !matched && (this.focusedOptionIndex = -1);
4763
+
4764
+ this.$emit('update:modelValue', value);
4765
+ },
4766
+ onContainerClick(event) {
4767
+ if (this.disabled || this.loading) {
4768
+ return;
4769
+ }
4770
+
4771
+ if (utils.DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || event.target.tagName === 'INPUT') {
4772
+ return;
4773
+ }
4774
+ else if (!this.overlay || !this.overlay.contains(event.target)) {
4775
+ this.overlayVisible ? this.hide(true) : this.show(true);
4547
4776
  }
4548
4777
  },
4778
+ onClearClick(event) {
4779
+ this.updateModel(event, null);
4780
+ },
4781
+ onFirstHiddenFocus(event) {
4782
+ const relatedTarget = event.relatedTarget;
4783
+
4784
+ if (relatedTarget === this.$refs.focusInput) {
4785
+ const firstFocusableEl = utils.DomHandler.getFirstFocusableElement(this.overlay, ':not(.p-hidden-focusable)');
4786
+ firstFocusableEl && firstFocusableEl.focus();
4787
+ }
4788
+ else {
4789
+ this.$refs.focusInput.focus();
4790
+ }
4791
+ },
4792
+ onLastHiddenFocus() {
4793
+ this.$refs.firstHiddenFocusableElementOnOverlay.focus();
4794
+ },
4795
+ onOptionSelect(event, option) {
4796
+ const value = this.getOptionValue(option);
4797
+
4798
+ this.updateModel(event, value);
4799
+ this.hide(true);
4800
+ },
4801
+ onOptionMouseMove(event, index) {
4802
+ if (this.focusOnHover) {
4803
+ this.changeFocusedOptionIndex(event, index);
4804
+ }
4805
+ },
4806
+ onFilterChange(event) {
4807
+ const value = event.target.value;
4808
+
4809
+ this.filterValue = value;
4810
+ this.focusedOptionIndex = -1;
4811
+ this.$emit('filter', { originalEvent: event, value });
4812
+
4813
+ !this.virtualScrollerDisabled && this.virtualScroller.scrollToIndex(0);
4814
+ },
4549
4815
  onFilterKeyDown(event) {
4550
- switch (event.which) {
4551
- //down
4552
- case 40:
4553
- this.onDownKey(event);
4816
+ switch (event.code) {
4817
+ case 'ArrowDown':
4818
+ this.onArrowDownKey(event);
4554
4819
  break;
4555
4820
 
4556
- //up
4557
- case 38:
4558
- this.onUpKey(event);
4821
+ case 'ArrowUp':
4822
+ this.onArrowUpKey(event, true);
4559
4823
  break;
4560
4824
 
4561
- //enter and escape
4562
- case 13:
4563
- case 27:
4564
- this.overlayVisible = false;
4565
- event.preventDefault();
4566
- break;
4825
+ case 'ArrowLeft':
4826
+ case 'ArrowRight':
4827
+ this.onArrowLeftKey(event, true);
4828
+ break;
4829
+
4830
+ case 'Home':
4831
+ this.onHomeKey(event, true);
4832
+ break;
4833
+
4834
+ case 'End':
4835
+ this.onEndKey(event, true);
4836
+ break;
4837
+
4838
+ case 'Enter':
4839
+ this.onEnterKey(event);
4840
+ break;
4841
+
4842
+ case 'Escape':
4843
+ this.onEscapeKey(event);
4844
+ break;
4845
+
4846
+ case 'Tab':
4847
+ this.onTabKey(event, true);
4848
+ break;
4567
4849
  }
4568
4850
  },
4569
- onDownKey(event) {
4570
- if (this.visibleOptions) {
4571
- if (!this.overlayVisible && event.altKey) {
4572
- this.show();
4573
- }
4574
- else {
4575
- let nextOption = this.visibleOptions && this.visibleOptions.length > 0 ? this.findNextOption(this.getSelectedOptionIndex()) : null;
4576
- if (nextOption) {
4577
- this.updateModel(event, this.getOptionValue(nextOption));
4578
- }
4579
- }
4851
+ onFilterBlur() {
4852
+ this.focusedOptionIndex = -1;
4853
+ },
4854
+ onFilterUpdated() {
4855
+ if (this.overlayVisible) {
4856
+ this.alignOverlay();
4580
4857
  }
4581
-
4582
- event.preventDefault();
4583
4858
  },
4584
- onUpKey(event) {
4585
- if (this.visibleOptions) {
4586
- let prevOption = this.findPrevOption(this.getSelectedOptionIndex());
4587
- if (prevOption) {
4588
- this.updateModel(event, this.getOptionValue(prevOption));
4589
- }
4859
+ onOverlayClick(event) {
4860
+ OverlayEventBus__default["default"].emit('overlay-click', {
4861
+ originalEvent: event,
4862
+ target: this.$el
4863
+ });
4864
+ },
4865
+ onOverlayKeyDown(event) {
4866
+ switch (event.code) {
4867
+ case 'Escape':
4868
+ this.onEscapeKey(event);
4869
+ break;
4590
4870
  }
4871
+ },
4872
+ onArrowDownKey(event) {
4873
+ const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
4874
+
4875
+ this.changeFocusedOptionIndex(event, optionIndex);
4591
4876
 
4877
+ !this.overlayVisible && this.show();
4592
4878
  event.preventDefault();
4593
4879
  },
4594
- findNextOption(index) {
4595
- if (this.optionGroupLabel) {
4596
- let groupIndex = index === -1 ? 0 : index.group;
4597
- let optionIndex = index === -1 ? -1 : index.option;
4598
- let option = this.findNextOptionInList(this.getOptionGroupChildren(this.visibleOptions[groupIndex]), optionIndex);
4880
+ onArrowUpKey(event, pressedInInputText = false) {
4881
+ if (event.altKey && !pressedInInputText) {
4882
+ if (this.focusedOptionIndex !== -1) {
4883
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
4884
+ }
4599
4885
 
4600
- if (option)
4601
- return option;
4602
- else if ((groupIndex + 1) !== this.visibleOptions.length)
4603
- return this.findNextOption({group: (groupIndex + 1), option: -1});
4604
- else
4605
- return null;
4886
+ this.overlayVisible && this.hide();
4887
+ event.preventDefault();
4606
4888
  }
4607
4889
  else {
4608
- return this.findNextOptionInList(this.visibleOptions, index);
4890
+ const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();
4891
+
4892
+ this.changeFocusedOptionIndex(event, optionIndex);
4893
+
4894
+ !this.overlayVisible && this.show();
4895
+ event.preventDefault();
4609
4896
  }
4610
4897
  },
4611
- findNextOptionInList(list, index) {
4612
- let i = index + 1;
4613
- if (i === list.length) {
4614
- return null;
4615
- }
4616
-
4617
- let option = list[i];
4618
- if (this.isOptionDisabled(option))
4619
- return this.findNextOptionInList(i);
4620
- else
4621
- return option;
4898
+ onArrowLeftKey(event, pressedInInputText = false) {
4899
+ pressedInInputText && (this.focusedOptionIndex = -1);
4622
4900
  },
4623
- findPrevOption(index) {
4624
- if (index === -1) {
4625
- return null;
4901
+ onHomeKey(event, pressedInInputText = false) {
4902
+ if (pressedInInputText) {
4903
+ event.currentTarget.setSelectionRange(0, 0);
4904
+ this.focusedOptionIndex = -1;
4626
4905
  }
4906
+ else {
4907
+ this.changeFocusedOptionIndex(event, this.findFirstOptionIndex());
4627
4908
 
4628
- if (this.optionGroupLabel) {
4629
- let groupIndex = index.group;
4630
- let optionIndex = index.option;
4631
- let option = this.findPrevOptionInList(this.getOptionGroupChildren(this.visibleOptions[groupIndex]), optionIndex);
4909
+ !this.overlayVisible && this.show();
4910
+ }
4632
4911
 
4633
- if (option)
4634
- return option;
4635
- else if (groupIndex > 0)
4636
- return this.findPrevOption({group: (groupIndex - 1), option: this.getOptionGroupChildren(this.visibleOptions[groupIndex - 1]).length});
4637
- else
4638
- return null;
4912
+ event.preventDefault();
4913
+ },
4914
+ onEndKey(event, pressedInInputText = false) {
4915
+ if (pressedInInputText) {
4916
+ const target = event.currentTarget;
4917
+ const len = target.value.length;
4918
+ target.setSelectionRange(len, len);
4919
+ this.focusedOptionIndex = -1;
4639
4920
  }
4640
4921
  else {
4641
- return this.findPrevOptionInList(this.visibleOptions, index);
4642
- }
4643
- },
4644
- findPrevOptionInList(list, index) {
4645
- let i = index - 1;
4646
- if (i < 0) {
4647
- return null;
4922
+ this.changeFocusedOptionIndex(event, this.findLastOptionIndex());
4923
+
4924
+ !this.overlayVisible && this.show();
4648
4925
  }
4649
4926
 
4650
- let option = list[i];
4651
- if (this.isOptionDisabled(option))
4652
- return this.findPrevOption(i);
4653
- else
4654
- return option;
4927
+ event.preventDefault();
4655
4928
  },
4656
- onClearClick(event) {
4657
- this.updateModel(event, null);
4929
+ onPageUpKey(event) {
4930
+ this.scrollInView(0);
4931
+ event.preventDefault();
4658
4932
  },
4659
- onClick(event) {
4660
- if (this.disabled || this.loading) {
4661
- return;
4933
+ onPageDownKey(event) {
4934
+ this.scrollInView(this.visibleOptions.length - 1);
4935
+ event.preventDefault();
4936
+ },
4937
+ onEnterKey(event) {
4938
+ if (!this.overlayVisible) {
4939
+ this.onArrowDownKey(event);
4662
4940
  }
4941
+ else {
4942
+ if (this.focusedOptionIndex !== -1) {
4943
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
4944
+ }
4663
4945
 
4664
- if (utils.DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') || event.target.tagName === 'INPUT') {
4665
- return;
4946
+ this.hide();
4666
4947
  }
4667
- else if (!this.overlay || !this.overlay.contains(event.target)) {
4668
- if (this.overlayVisible)
4669
- this.hide();
4670
- else
4671
- this.show();
4672
4948
 
4673
- this.$refs.focusInput.focus();
4674
- }
4949
+ event.preventDefault();
4675
4950
  },
4676
- onOptionSelect(event, option) {
4677
- let value = this.getOptionValue(option);
4678
- this.updateModel(event, value);
4679
- this.$refs.focusInput.focus();
4951
+ onSpaceKey(event, pressedInInputText = false) {
4952
+ !pressedInInputText && this.onEnterKey(event);
4953
+ },
4954
+ onEscapeKey(event) {
4955
+ this.overlayVisible && this.hide(true);
4956
+ event.preventDefault();
4957
+ },
4958
+ onTabKey(event, pressedInInputText = false) {
4959
+ if (!pressedInInputText) {
4960
+ if (this.overlayVisible && this.hasFocusableElements()) {
4961
+ this.$refs.firstHiddenFocusableElementOnOverlay.focus();
4680
4962
 
4681
- setTimeout(() => {
4682
- this.hide();
4683
- }, 200);
4963
+ event.preventDefault();
4964
+ }
4965
+ else {
4966
+ if (this.focusedOptionIndex !== -1) {
4967
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
4968
+ }
4969
+
4970
+ this.overlayVisible && this.hide(this.filter);
4971
+ }
4972
+ }
4684
4973
  },
4685
- onEditableInput(event) {
4686
- this.$emit('update:modelValue', event.target.value);
4974
+ onBackspaceKey(event, pressedInInputText = false) {
4975
+ if (pressedInInputText) {
4976
+ !this.overlayVisible && this.show();
4977
+ }
4687
4978
  },
4688
4979
  onOverlayEnter(el) {
4689
4980
  utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
4690
4981
  this.alignOverlay();
4691
- this.scrollValueInView();
4692
-
4693
- if (!this.virtualScrollerDisabled) {
4694
- const selectedIndex = this.getSelectedOptionIndex();
4695
- if (selectedIndex !== -1) {
4696
- setTimeout(() => {
4697
- this.virtualScroller && this.virtualScroller.scrollToIndex(selectedIndex);
4698
- }, 0);
4699
- }
4700
- }
4982
+ this.scrollInView();
4701
4983
  },
4702
4984
  onOverlayAfterEnter() {
4703
- if (this.filter) {
4704
- this.$refs.filterInput.focus();
4705
- }
4706
-
4707
4985
  this.bindOutsideClickListener();
4708
4986
  this.bindScrollListener();
4709
4987
  this.bindResizeListener();
@@ -4714,8 +4992,8 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4714
4992
  this.unbindOutsideClickListener();
4715
4993
  this.unbindScrollListener();
4716
4994
  this.unbindResizeListener();
4995
+
4717
4996
  this.$emit('hide');
4718
- this.itemsWrapper = null;
4719
4997
  this.overlay = null;
4720
4998
  },
4721
4999
  onOverlayAfterLeave(el) {
@@ -4730,10 +5008,6 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4730
5008
  utils.DomHandler.absolutePosition(this.overlay, this.$el);
4731
5009
  }
4732
5010
  },
4733
- updateModel(event, value) {
4734
- this.$emit('update:modelValue', value);
4735
- this.$emit('change', {originalEvent: event, value: value});
4736
- },
4737
5011
  bindOutsideClickListener() {
4738
5012
  if (!this.outsideClickListener) {
4739
5013
  this.outsideClickListener = (event) => {
@@ -4782,162 +5056,153 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4782
5056
  this.resizeListener = null;
4783
5057
  }
4784
5058
  },
4785
- search(event) {
4786
- if (!this.visibleOptions) {
4787
- return;
5059
+ hasFocusableElements() {
5060
+ return utils.DomHandler.getFocusableElements(this.overlay, ':not(.p-hidden-focusable)').length > 0;
5061
+ },
5062
+ isOptionMatched(option) {
5063
+ return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
5064
+ },
5065
+ isValidOption(option) {
5066
+ return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
5067
+ },
5068
+ isValidSelectedOption(option) {
5069
+ return this.isValidOption(option) && this.isSelected(option);
5070
+ },
5071
+ isSelected(option) {
5072
+ return utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
5073
+ },
5074
+ findFirstOptionIndex() {
5075
+ return this.visibleOptions.findIndex(option => this.isValidOption(option));
5076
+ },
5077
+ findLastOptionIndex() {
5078
+ return utils.ObjectUtils.findLastIndex(this.visibleOptions, option => this.isValidOption(option));
5079
+ },
5080
+ findNextOptionIndex(index) {
5081
+ const matchedOptionIndex = index < (this.visibleOptions.length - 1) ? this.visibleOptions.slice(index + 1).findIndex(option => this.isValidOption(option)) : -1;
5082
+ return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
5083
+ },
5084
+ findPrevOptionIndex(index) {
5085
+ const matchedOptionIndex = index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), option => this.isValidOption(option)) : -1;
5086
+ return matchedOptionIndex > -1 ? matchedOptionIndex : index;
5087
+ },
5088
+ findSelectedOptionIndex() {
5089
+ return this.hasSelectedOption ? this.visibleOptions.findIndex(option => this.isValidSelectedOption(option)) : -1;
5090
+ },
5091
+ findFirstFocusedOptionIndex() {
5092
+ const selectedIndex = this.findSelectedOptionIndex();
5093
+ return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
5094
+ },
5095
+ findLastFocusedOptionIndex() {
5096
+ const selectedIndex = this.findSelectedOptionIndex();
5097
+ return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
5098
+ },
5099
+ searchOptions(event, char) {
5100
+ this.searchValue = (this.searchValue || '') + char;
5101
+
5102
+ let optionIndex = -1;
5103
+ let matched = false;
5104
+
5105
+ if (this.focusedOptionIndex !== -1) {
5106
+ optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(option => this.isOptionMatched(option));
5107
+ optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(option => this.isOptionMatched(option)) : optionIndex + this.focusedOptionIndex;
5108
+ }
5109
+ else {
5110
+ optionIndex = this.visibleOptions.findIndex(option => this.isOptionMatched(option));
4788
5111
  }
4789
5112
 
4790
- if (this.searchTimeout) {
4791
- clearTimeout(this.searchTimeout);
5113
+ if (optionIndex !== -1) {
5114
+ matched = true;
4792
5115
  }
4793
5116
 
4794
- const char = event.key;
4795
- this.previousSearchChar = this.currentSearchChar;
4796
- this.currentSearchChar = char;
5117
+ if (optionIndex === -1 && this.focusedOptionIndex === -1) {
5118
+ optionIndex = this.findFirstFocusedOptionIndex();
5119
+ }
4797
5120
 
4798
- if (this.previousSearchChar === this.currentSearchChar)
4799
- this.searchValue = this.currentSearchChar;
4800
- else
4801
- this.searchValue = this.searchValue ? this.searchValue + char : char;
5121
+ if (optionIndex !== -1) {
5122
+ this.changeFocusedOptionIndex(event, optionIndex);
5123
+ }
4802
5124
 
4803
- if (this.searchValue) {
4804
- let searchIndex = this.getSelectedOptionIndex();
4805
- let newOption = this.optionGroupLabel ? this.searchOptionInGroup(searchIndex) : this.searchOption(++searchIndex);
4806
- if (newOption) {
4807
- this.updateModel(event, this.getOptionValue(newOption));
4808
- }
5125
+ if (this.searchTimeout) {
5126
+ clearTimeout(this.searchTimeout);
4809
5127
  }
4810
5128
 
4811
5129
  this.searchTimeout = setTimeout(() => {
4812
- this.searchValue = null;
4813
- }, 250);
4814
- },
4815
- searchOption(index) {
4816
- let option;
5130
+ this.searchValue = '';
5131
+ this.searchTimeout = null;
5132
+ }, 500);
4817
5133
 
4818
- if (this.searchValue) {
4819
- option = this.searchOptionInRange(index, this.visibleOptions.length);
5134
+ return matched;
5135
+ },
5136
+ changeFocusedOptionIndex(event, index) {
5137
+ if (this.focusedOptionIndex !== index) {
5138
+ this.focusedOptionIndex = index;
5139
+ this.scrollInView();
4820
5140
 
4821
- if (!option) {
4822
- option = this.searchOptionInRange(0, index);
5141
+ if (this.selectOnFocus) {
5142
+ this.updateModel(event, this.getOptionValue(this.visibleOptions[index]));
4823
5143
  }
4824
5144
  }
4825
-
4826
- return option;
4827
5145
  },
4828
- searchOptionInRange(start, end) {
4829
- for (let i = start; i < end; i++) {
4830
- let opt = this.visibleOptions[i];
4831
- if (this.matchesSearchValue(opt)) {
4832
- return opt;
4833
- }
5146
+ scrollInView(index = -1) {
5147
+ const id = index !== -1 ? `${this.id}_${index}` : this.focusedOptionId;
5148
+ const element = utils.DomHandler.findSingle(this.list, `li[id="${id}"]`);
5149
+ if (element) {
5150
+ element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' });
4834
5151
  }
4835
-
4836
- return null;
4837
- },
4838
- searchOptionInGroup(index) {
4839
- let searchIndex = index === -1 ? {group: 0, option: -1} : index;
4840
-
4841
- for (let i = searchIndex.group; i < this.visibleOptions.length; i++) {
4842
- let groupOptions = this.getOptionGroupChildren(this.visibleOptions[i]);
4843
- for (let j = (searchIndex.group === i ? searchIndex.option + 1 : 0); j < groupOptions.length; j++) {
4844
- if (this.matchesSearchValue(groupOptions[j])) {
4845
- return groupOptions[j];
4846
- }
4847
- }
4848
- }
4849
-
4850
- for (let i = 0; i <= searchIndex.group; i++) {
4851
- let groupOptions = this.getOptionGroupChildren(this.visibleOptions[i]);
4852
- for (let j = 0; j < (searchIndex.group === i ? searchIndex.option: groupOptions.length); j++) {
4853
- if (this.matchesSearchValue(groupOptions[j])) {
4854
- return groupOptions[j];
4855
- }
4856
- }
5152
+ else if (!this.virtualScrollerDisabled) {
5153
+ setTimeout(() => {
5154
+ this.virtualScroller && this.virtualScroller.scrollToIndex(index !== -1 ? index : this.focusedOptionIndex);
5155
+ }, 0);
4857
5156
  }
4858
-
4859
- return null;
4860
5157
  },
4861
- matchesSearchValue(option) {
4862
- let label = this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale);
4863
- return label.startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
5158
+ autoUpdateModel() {
5159
+ if (this.selectOnFocus && this.autoOptionFocus && !this.hasSelectedOption) {
5160
+ this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
5161
+ const value = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);
5162
+ this.updateModel(null, value);
5163
+ }
4864
5164
  },
4865
- onFilterChange(event) {
4866
- this.filterValue = event.target.value;
4867
- this.$emit('filter', {originalEvent: event, value: event.target.value});
5165
+ updateModel(event, value) {
5166
+ this.$emit('update:modelValue', value);
5167
+ this.$emit('change', { originalEvent: event, value });
4868
5168
  },
4869
- onFilterUpdated() {
4870
- if (this.overlayVisible) {
4871
- this.alignOverlay();
4872
- }
5169
+ flatOptions(options) {
5170
+ return (options || []).reduce((result, option, index) => {
5171
+ result.push({ optionGroup: option, group: true, index });
5172
+
5173
+ const optionGroupChildren = this.getOptionGroupChildren(option);
5174
+ optionGroupChildren && optionGroupChildren.forEach(o => result.push(o));
5175
+
5176
+ return result;
5177
+ }, []);
4873
5178
  },
4874
5179
  overlayRef(el) {
4875
5180
  this.overlay = el;
4876
5181
  },
4877
- itemsWrapperRef(el) {
4878
- this.itemsWrapper = el;
5182
+ listRef(el, contentRef) {
5183
+ this.list = el;
5184
+ contentRef && contentRef(el); // For VirtualScroller
4879
5185
  },
4880
5186
  virtualScrollerRef(el) {
4881
5187
  this.virtualScroller = el;
4882
- },
4883
- scrollValueInView() {
4884
- if (this.overlay) {
4885
- let selectedItem = utils.DomHandler.findSingle(this.overlay, 'li.p-highlight');
4886
- if (selectedItem) {
4887
- selectedItem.scrollIntoView({ block: 'nearest', inline: 'start' });
4888
- }
4889
- }
4890
- },
4891
- onOverlayClick(event) {
4892
- OverlayEventBus__default["default"].emit('overlay-click', {
4893
- originalEvent: event,
4894
- target: this.$el
4895
- });
4896
5188
  }
4897
5189
  },
4898
5190
  computed: {
4899
- visibleOptions() {
4900
- if (this.filterValue) {
4901
- if (this.optionGroupLabel) {
4902
- let filteredGroups = [];
4903
- for (let optgroup of this.options) {
4904
- let filteredSubOptions = api.FilterService.filter(this.getOptionGroupChildren(optgroup), this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
4905
- if (filteredSubOptions && filteredSubOptions.length) {
4906
- let filteredGroup = {...optgroup};
4907
- filteredGroup[this.optionGroupChildren] = filteredSubOptions;
4908
- filteredGroups.push(filteredGroup);
4909
- }
4910
- }
4911
- return filteredGroups
4912
- }
4913
- else {
4914
- return api.FilterService.filter(this.options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
4915
- }
4916
- }
4917
- else {
4918
- return this.options;
4919
- }
4920
- },
4921
5191
  containerClass() {
4922
- return [
4923
- 'p-dropdown p-component p-inputwrapper',
4924
- {
4925
- 'p-disabled': this.disabled,
4926
- 'p-dropdown-clearable': this.showClear && !this.disabled,
4927
- 'p-focus': this.focused,
4928
- 'p-inputwrapper-filled': this.modelValue,
4929
- 'p-inputwrapper-focus': this.focused || this.overlayVisible
4930
- }
4931
- ];
5192
+ return ['p-dropdown p-component p-inputwrapper', {
5193
+ 'p-disabled': this.disabled,
5194
+ 'p-dropdown-clearable': this.showClear && !this.disabled,
5195
+ 'p-focus': this.focused,
5196
+ 'p-inputwrapper-filled': this.modelValue,
5197
+ 'p-inputwrapper-focus': this.focused || this.overlayVisible,
5198
+ 'p-overlay-open': this.overlayVisible
5199
+ }];
4932
5200
  },
4933
- labelClass() {
4934
- return [
4935
- 'p-dropdown-label p-inputtext',
4936
- {
4937
- 'p-placeholder': this.label === this.placeholder,
4938
- 'p-dropdown-label-empty': !this.$slots['value'] && (this.label === 'p-emptylabel' || this.label.length === 0)
4939
- }
4940
- ];
5201
+ inputStyleClass() {
5202
+ return ['p-dropdown-label p-inputtext', this.inputClass, {
5203
+ 'p-placeholder': !this.editable && this.label === this.placeholder,
5204
+ 'p-dropdown-label-empty': !this.editable && !this.$slots['value'] && (this.label === 'p-emptylabel' || this.label.length === 0)
5205
+ }];
4941
5206
  },
4942
5207
  panelStyleClass() {
4943
5208
  return ['p-dropdown-panel p-component', this.panelClass, {
@@ -4945,19 +5210,24 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4945
5210
  'p-ripple-disabled': this.$primevue.config.ripple === false
4946
5211
  }];
4947
5212
  },
5213
+ dropdownIconClass() {
5214
+ return ['p-dropdown-trigger-icon', (this.loading ? this.loadingIcon : 'pi pi-chevron-down')];
5215
+ },
5216
+ visibleOptions() {
5217
+ const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
5218
+
5219
+ return this.filterValue ? api.FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale) : options;
5220
+ },
5221
+ hasSelectedOption() {
5222
+ return utils.ObjectUtils.isNotEmpty(this.modelValue);
5223
+ },
4948
5224
  label() {
4949
- let selectedOption = this.getSelectedOption();
4950
- if (selectedOption !== null)
4951
- return this.getOptionLabel(selectedOption);
4952
- else
4953
- return this.placeholder||'p-emptylabel';
5225
+ const selectedOptionIndex = this.findSelectedOptionIndex();
5226
+ return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : (this.placeholder || 'p-emptylabel');
4954
5227
  },
4955
5228
  editableInputValue() {
4956
- let selectedOption = this.getSelectedOption();
4957
- if (selectedOption)
4958
- return this.getOptionLabel(selectedOption);
4959
- else
4960
- return this.modelValue;
5229
+ const selectedOptionIndex = this.findSelectedOptionIndex();
5230
+ return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : (this.modelValue || '');
4961
5231
  },
4962
5232
  equalityKey() {
4963
5233
  return this.optionValue ? null : this.dataKey;
@@ -4965,17 +5235,35 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4965
5235
  searchFields() {
4966
5236
  return this.filterFields || [this.optionLabel];
4967
5237
  },
5238
+ filterResultMessageText() {
5239
+ return utils.ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
5240
+ },
5241
+ filterMessageText() {
5242
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
5243
+ },
4968
5244
  emptyFilterMessageText() {
4969
- return this.emptyFilterMessage || this.$primevue.config.locale.emptyFilterMessage;
5245
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
4970
5246
  },
4971
5247
  emptyMessageText() {
4972
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
5248
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
5249
+ },
5250
+ selectionMessageText() {
5251
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
5252
+ },
5253
+ emptySelectionMessageText() {
5254
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
5255
+ },
5256
+ selectedMessageText() {
5257
+ return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
5258
+ },
5259
+ focusedOptionId() {
5260
+ return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
5261
+ },
5262
+ ariaSetSize() {
5263
+ return this.visibleOptions.filter(option => !this.isOptionGroup(option)).length;
4973
5264
  },
4974
5265
  virtualScrollerDisabled() {
4975
5266
  return !this.virtualScrollerOptions;
4976
- },
4977
- dropdownIconClass() {
4978
- return ['p-dropdown-trigger-icon', this.loading ? this.loadingIcon : 'pi pi-chevron-down'];
4979
5267
  }
4980
5268
  },
4981
5269
  directives: {
@@ -4987,27 +5275,45 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
4987
5275
  }
4988
5276
  };
4989
5277
 
4990
- const _hoisted_1 = { class: "p-hidden-accessible" };
4991
- const _hoisted_2 = ["id", "disabled", "tabindex", "aria-expanded", "aria-labelledby"];
4992
- const _hoisted_3 = ["disabled", "placeholder", "value", "aria-expanded"];
4993
- const _hoisted_4 = ["aria-expanded"];
5278
+ const _hoisted_1 = ["id"];
5279
+ const _hoisted_2 = ["id", "value", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant"];
5280
+ const _hoisted_3 = ["id", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-disabled"];
5281
+ const _hoisted_4 = { class: "p-dropdown-trigger" };
4994
5282
  const _hoisted_5 = {
4995
5283
  key: 0,
4996
5284
  class: "p-dropdown-header"
4997
5285
  };
4998
5286
  const _hoisted_6 = { class: "p-dropdown-filter-container" };
4999
- const _hoisted_7 = ["value", "placeholder"];
5287
+ const _hoisted_7 = ["value", "placeholder", "aria-owns", "aria-activedescendant"];
5000
5288
  const _hoisted_8 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-dropdown-filter-icon pi pi-search" }, null, -1);
5001
- const _hoisted_9 = ["onClick", "aria-label", "aria-selected"];
5002
- const _hoisted_10 = { class: "p-dropdown-item-group" };
5003
- const _hoisted_11 = ["onClick", "aria-label", "aria-selected"];
5004
- const _hoisted_12 = {
5005
- key: 2,
5006
- class: "p-dropdown-empty-message"
5289
+ const _hoisted_9 = {
5290
+ role: "status",
5291
+ "aria-live": "polite",
5292
+ class: "p-hidden-accessible"
5007
5293
  };
5294
+ const _hoisted_10 = ["id"];
5295
+ const _hoisted_11 = ["id"];
5296
+ const _hoisted_12 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove"];
5008
5297
  const _hoisted_13 = {
5009
- key: 3,
5010
- class: "p-dropdown-empty-message"
5298
+ key: 0,
5299
+ class: "p-dropdown-empty-message",
5300
+ role: "option"
5301
+ };
5302
+ const _hoisted_14 = {
5303
+ key: 1,
5304
+ class: "p-dropdown-empty-message",
5305
+ role: "option"
5306
+ };
5307
+ const _hoisted_15 = {
5308
+ key: 0,
5309
+ role: "status",
5310
+ "aria-live": "polite",
5311
+ class: "p-hidden-accessible"
5312
+ };
5313
+ const _hoisted_16 = {
5314
+ role: "status",
5315
+ "aria-live": "polite",
5316
+ class: "p-hidden-accessible"
5011
5317
  };
5012
5318
 
5013
5319
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -5017,72 +5323,76 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5017
5323
 
5018
5324
  return (vue.openBlock(), vue.createElementBlock("div", {
5019
5325
  ref: "container",
5326
+ id: $data.id,
5020
5327
  class: vue.normalizeClass($options.containerClass),
5021
- onClick: _cache[11] || (_cache[11] = $event => ($options.onClick($event)))
5328
+ onClick: _cache[16] || (_cache[16] = (...args) => ($options.onContainerClick && $options.onContainerClick(...args)))
5022
5329
  }, [
5023
- vue.createElementVNode("div", _hoisted_1, [
5024
- vue.createElementVNode("input", {
5025
- ref: "focusInput",
5026
- type: "text",
5027
- id: $props.inputId,
5028
- readonly: "",
5029
- disabled: $props.disabled,
5030
- onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
5031
- onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
5032
- onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
5033
- tabindex: $props.tabindex,
5034
- "aria-haspopup": "true",
5035
- "aria-expanded": $data.overlayVisible,
5036
- "aria-labelledby": $props.ariaLabelledBy
5037
- }, null, 40, _hoisted_2)
5038
- ]),
5039
5330
  ($props.editable)
5040
- ? (vue.openBlock(), vue.createElementBlock("input", {
5331
+ ? (vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
5041
5332
  key: 0,
5333
+ ref: "focusInput",
5334
+ id: $props.inputId,
5042
5335
  type: "text",
5043
- class: "p-dropdown-label p-inputtext",
5044
- disabled: $props.disabled,
5045
- onFocus: _cache[3] || (_cache[3] = (...args) => ($options.onFocus && $options.onFocus(...args))),
5046
- onBlur: _cache[4] || (_cache[4] = (...args) => ($options.onBlur && $options.onBlur(...args))),
5047
- placeholder: $props.placeholder,
5336
+ style: $props.inputStyle,
5337
+ class: $options.inputStyleClass,
5048
5338
  value: $options.editableInputValue,
5049
- onInput: _cache[5] || (_cache[5] = (...args) => ($options.onEditableInput && $options.onEditableInput(...args))),
5339
+ placeholder: $props.placeholder,
5340
+ tabindex: !$props.disabled ? $props.tabindex : -1,
5341
+ disabled: $props.disabled,
5342
+ autocomplete: "off",
5343
+ role: "combobox",
5344
+ "aria-label": _ctx.ariaLabel,
5345
+ "aria-labelledby": _ctx.ariaLabelledby,
5050
5346
  "aria-haspopup": "listbox",
5051
- "aria-expanded": $data.overlayVisible
5052
- }, null, 40, _hoisted_3))
5053
- : vue.createCommentVNode("", true),
5054
- (!$props.editable)
5055
- ? (vue.openBlock(), vue.createElementBlock("span", {
5347
+ "aria-expanded": $data.overlayVisible,
5348
+ "aria-controls": $data.id + '_list',
5349
+ "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
5350
+ onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
5351
+ onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
5352
+ onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
5353
+ onInput: _cache[3] || (_cache[3] = (...args) => ($options.onEditableInput && $options.onEditableInput(...args)))
5354
+ }, $props.inputProps), null, 16, _hoisted_2))
5355
+ : (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
5056
5356
  key: 1,
5057
- class: vue.normalizeClass($options.labelClass)
5058
- }, [
5357
+ ref: "focusInput",
5358
+ id: $props.inputId,
5359
+ style: $props.inputStyle,
5360
+ class: $options.inputStyleClass,
5361
+ tabindex: !$props.disabled ? $props.tabindex : -1,
5362
+ role: "combobox",
5363
+ "aria-label": _ctx.ariaLabel || ($options.label === 'p-emptylabel' ? undefined : $options.label),
5364
+ "aria-labelledby": _ctx.ariaLabelledby,
5365
+ "aria-haspopup": "listbox",
5366
+ "aria-expanded": $data.overlayVisible,
5367
+ "aria-controls": $data.id + '_list',
5368
+ "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
5369
+ "aria-disabled": $props.disabled,
5370
+ onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onFocus && $options.onFocus(...args))),
5371
+ onBlur: _cache[5] || (_cache[5] = (...args) => ($options.onBlur && $options.onBlur(...args))),
5372
+ onKeydown: _cache[6] || (_cache[6] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args)))
5373
+ }, $props.inputProps), [
5059
5374
  vue.renderSlot(_ctx.$slots, "value", {
5060
5375
  value: $props.modelValue,
5061
5376
  placeholder: $props.placeholder
5062
5377
  }, () => [
5063
- vue.createTextVNode(vue.toDisplayString($options.label||'empty'), 1)
5378
+ vue.createTextVNode(vue.toDisplayString($options.label === 'p-emptylabel' ? ' ' : $options.label || 'empty'), 1)
5064
5379
  ])
5065
- ], 2))
5066
- : vue.createCommentVNode("", true),
5380
+ ], 16, _hoisted_3)),
5067
5381
  ($props.showClear && $props.modelValue != null)
5068
- ? (vue.openBlock(), vue.createElementBlock("i", {
5382
+ ? (vue.openBlock(), vue.createElementBlock("i", vue.mergeProps({
5069
5383
  key: 2,
5070
5384
  class: "p-dropdown-clear-icon pi pi-times",
5071
- onClick: _cache[6] || (_cache[6] = $event => ($options.onClearClick($event)))
5072
- }))
5385
+ onClick: _cache[7] || (_cache[7] = (...args) => ($options.onClearClick && $options.onClearClick(...args)))
5386
+ }, $props.clearIconProps), null, 16))
5073
5387
  : vue.createCommentVNode("", true),
5074
- vue.createElementVNode("div", {
5075
- class: "p-dropdown-trigger",
5076
- role: "button",
5077
- "aria-haspopup": "listbox",
5078
- "aria-expanded": $data.overlayVisible
5079
- }, [
5388
+ vue.createElementVNode("div", _hoisted_4, [
5080
5389
  vue.renderSlot(_ctx.$slots, "indicator", {}, () => [
5081
5390
  vue.createElementVNode("span", {
5082
- class: vue.normalizeClass($options.dropdownIconClass)
5391
+ class: vue.normalizeClass($options.dropdownIconClass),
5392
+ "aria-hidden": "true"
5083
5393
  }, null, 2)
5084
5394
  ])
5085
- ], 8, _hoisted_4),
5395
+ ]),
5086
5396
  vue.createVNode(_component_Portal, { appendTo: $props.appendTo }, {
5087
5397
  default: vue.withCtx(() => [
5088
5398
  vue.createVNode(vue.Transition, {
@@ -5094,12 +5404,22 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5094
5404
  }, {
5095
5405
  default: vue.withCtx(() => [
5096
5406
  ($data.overlayVisible)
5097
- ? (vue.openBlock(), vue.createElementBlock("div", {
5407
+ ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
5098
5408
  key: 0,
5099
5409
  ref: $options.overlayRef,
5100
- class: vue.normalizeClass($options.panelStyleClass),
5101
- onClick: _cache[10] || (_cache[10] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
5102
- }, [
5410
+ style: $props.panelStyle,
5411
+ class: $options.panelStyleClass,
5412
+ onClick: _cache[14] || (_cache[14] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args))),
5413
+ onKeydown: _cache[15] || (_cache[15] = (...args) => ($options.onOverlayKeyDown && $options.onOverlayKeyDown(...args)))
5414
+ }, $props.panelProps), [
5415
+ vue.createElementVNode("span", {
5416
+ ref: "firstHiddenFocusableElementOnOverlay",
5417
+ role: "presentation",
5418
+ "aria-hidden": "true",
5419
+ class: "p-hidden-accessible p-hidden-focusable",
5420
+ tabindex: 0,
5421
+ onFocus: _cache[8] || (_cache[8] = (...args) => ($options.onFirstHiddenFocus && $options.onFirstHiddenFocus(...args)))
5422
+ }, null, 544),
5103
5423
  vue.renderSlot(_ctx.$slots, "header", {
5104
5424
  value: $props.modelValue,
5105
5425
  options: $options.visibleOptions
@@ -5107,105 +5427,106 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5107
5427
  ($props.filter)
5108
5428
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
5109
5429
  vue.createElementVNode("div", _hoisted_6, [
5110
- vue.createElementVNode("input", {
5430
+ vue.createElementVNode("input", vue.mergeProps({
5111
5431
  type: "text",
5112
5432
  ref: "filterInput",
5113
5433
  value: $data.filterValue,
5114
- onVnodeUpdated: _cache[7] || (_cache[7] = (...args) => ($options.onFilterUpdated && $options.onFilterUpdated(...args))),
5115
- autoComplete: "off",
5434
+ onVnodeUpdated: _cache[9] || (_cache[9] = (...args) => ($options.onFilterUpdated && $options.onFilterUpdated(...args))),
5116
5435
  class: "p-dropdown-filter p-inputtext p-component",
5117
5436
  placeholder: $props.filterPlaceholder,
5118
- onKeydown: _cache[8] || (_cache[8] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
5119
- onInput: _cache[9] || (_cache[9] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
5120
- }, null, 40, _hoisted_7),
5437
+ role: "searchbox",
5438
+ autocomplete: "off",
5439
+ "aria-owns": $data.id + '_list',
5440
+ "aria-activedescendant": $options.focusedOptionId,
5441
+ onKeydown: _cache[10] || (_cache[10] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
5442
+ onBlur: _cache[11] || (_cache[11] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
5443
+ onInput: _cache[12] || (_cache[12] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
5444
+ }, $props.filterInputProps), null, 16, _hoisted_7),
5121
5445
  _hoisted_8
5122
- ])
5446
+ ]),
5447
+ vue.createElementVNode("span", _hoisted_9, vue.toDisplayString($options.filterResultMessageText), 1)
5123
5448
  ]))
5124
5449
  : vue.createCommentVNode("", true),
5125
5450
  vue.createElementVNode("div", {
5126
- ref: $options.itemsWrapperRef,
5127
5451
  class: "p-dropdown-items-wrapper",
5128
5452
  style: vue.normalizeStyle({'max-height': $options.virtualScrollerDisabled ? $props.scrollHeight : ''})
5129
5453
  }, [
5130
5454
  vue.createVNode(_component_VirtualScroller, vue.mergeProps({ ref: $options.virtualScrollerRef }, $props.virtualScrollerOptions, {
5131
5455
  items: $options.visibleOptions,
5132
5456
  style: {'height': $props.scrollHeight},
5457
+ tabindex: -1,
5133
5458
  disabled: $options.virtualScrollerDisabled
5134
5459
  }), vue.createSlots({
5135
- content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle }) => [
5460
+ content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
5136
5461
  vue.createElementVNode("ul", {
5137
- ref: contentRef,
5462
+ ref: (el) => $options.listRef(el, contentRef),
5463
+ id: $data.id + '_list',
5138
5464
  class: vue.normalizeClass(['p-dropdown-items', styleClass]),
5139
5465
  style: vue.normalizeStyle(contentStyle),
5140
5466
  role: "listbox"
5141
5467
  }, [
5142
- (!$props.optionGroupLabel)
5143
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(items, (option, i) => {
5144
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
5145
- class: vue.normalizeClass(['p-dropdown-item', {'p-highlight': $options.isSelected(option), 'p-disabled': $options.isOptionDisabled(option)}]),
5146
- key: $options.getOptionRenderKey(option, i),
5147
- onClick: $event => ($options.onOptionSelect($event, option)),
5148
- role: "option",
5149
- "aria-label": $options.getOptionLabel(option),
5150
- "aria-selected": $options.isSelected(option)
5151
- }, [
5152
- vue.renderSlot(_ctx.$slots, "option", {
5153
- option: option,
5154
- index: $options.getOptionIndex(i, getItemOptions)
5155
- }, () => [
5156
- vue.createTextVNode(vue.toDisplayString($options.getOptionLabel(option)), 1)
5157
- ])
5158
- ], 10, _hoisted_9)), [
5159
- [_directive_ripple]
5160
- ])
5161
- }), 128))
5162
- : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(items, (optionGroup, i) => {
5163
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5164
- key: $options.getOptionGroupRenderKey(optionGroup)
5165
- }, [
5166
- vue.createElementVNode("li", _hoisted_10, [
5468
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (option, i) => {
5469
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5470
+ key: $options.getOptionRenderKey(option, $options.getOptionIndex(i, getItemOptions))
5471
+ }, [
5472
+ ($options.isOptionGroup(option))
5473
+ ? (vue.openBlock(), vue.createElementBlock("li", {
5474
+ key: 0,
5475
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
5476
+ style: vue.normalizeStyle({height: itemSize ? itemSize + 'px' : undefined}),
5477
+ class: "p-dropdown-item-group",
5478
+ role: "option"
5479
+ }, [
5167
5480
  vue.renderSlot(_ctx.$slots, "optiongroup", {
5168
- option: optionGroup,
5481
+ option: option.optionGroup,
5169
5482
  index: $options.getOptionIndex(i, getItemOptions)
5170
5483
  }, () => [
5171
- vue.createTextVNode(vue.toDisplayString($options.getOptionGroupLabel(optionGroup)), 1)
5484
+ vue.createTextVNode(vue.toDisplayString($options.getOptionGroupLabel(option.optionGroup)), 1)
5172
5485
  ])
5173
- ]),
5174
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.getOptionGroupChildren(optionGroup), (option, i) => {
5175
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
5176
- class: vue.normalizeClass(['p-dropdown-item', {'p-highlight': $options.isSelected(option), 'p-disabled': $options.isOptionDisabled(option)}]),
5177
- key: $options.getOptionRenderKey(option, i),
5178
- onClick: $event => ($options.onOptionSelect($event, option)),
5179
- role: "option",
5180
- "aria-label": $options.getOptionLabel(option),
5181
- "aria-selected": $options.isSelected(option)
5182
- }, [
5183
- vue.renderSlot(_ctx.$slots, "option", {
5184
- option: option,
5185
- index: $options.getOptionIndex(i, getItemOptions)
5186
- }, () => [
5187
- vue.createTextVNode(vue.toDisplayString($options.getOptionLabel(option)), 1)
5188
- ])
5189
- ], 10, _hoisted_11)), [
5190
- [_directive_ripple]
5486
+ ], 12, _hoisted_11))
5487
+ : vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
5488
+ key: 1,
5489
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
5490
+ style: vue.normalizeStyle({height: itemSize ? itemSize + 'px' : undefined}),
5491
+ class: vue.normalizeClass(['p-dropdown-item', {'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option)}]),
5492
+ role: "option",
5493
+ "aria-label": $options.getOptionLabel(option),
5494
+ "aria-selected": $options.isSelected(option),
5495
+ "aria-disabled": $options.isOptionDisabled(option),
5496
+ "aria-setsize": $options.ariaSetSize,
5497
+ "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),
5498
+ onClick: $event => ($options.onOptionSelect($event, option)),
5499
+ onMousemove: $event => ($options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions)))
5500
+ }, [
5501
+ vue.renderSlot(_ctx.$slots, "option", {
5502
+ option: option,
5503
+ index: $options.getOptionIndex(i, getItemOptions)
5504
+ }, () => [
5505
+ vue.createTextVNode(vue.toDisplayString($options.getOptionLabel(option)), 1)
5191
5506
  ])
5192
- }), 128))
5193
- ], 64))
5194
- }), 128)),
5507
+ ], 46, _hoisted_12)), [
5508
+ [_directive_ripple]
5509
+ ])
5510
+ ], 64))
5511
+ }), 128)),
5195
5512
  ($data.filterValue && (!items || (items && items.length === 0)))
5196
- ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_12, [
5513
+ ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_13, [
5197
5514
  vue.renderSlot(_ctx.$slots, "emptyfilter", {}, () => [
5198
5515
  vue.createTextVNode(vue.toDisplayString($options.emptyFilterMessageText), 1)
5199
5516
  ])
5200
5517
  ]))
5201
5518
  : ((!$props.options || ($props.options && $props.options.length === 0)))
5202
- ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_13, [
5519
+ ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_14, [
5203
5520
  vue.renderSlot(_ctx.$slots, "empty", {}, () => [
5204
5521
  vue.createTextVNode(vue.toDisplayString($options.emptyMessageText), 1)
5205
5522
  ])
5206
5523
  ]))
5207
5524
  : vue.createCommentVNode("", true)
5208
- ], 6)
5525
+ ], 14, _hoisted_10),
5526
+ ((!$props.options || ($props.options && $props.options.length === 0)))
5527
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_15, vue.toDisplayString($options.emptyMessageText), 1))
5528
+ : vue.createCommentVNode("", true),
5529
+ vue.createElementVNode("span", _hoisted_16, vue.toDisplayString($options.selectedMessageText), 1)
5209
5530
  ]),
5210
5531
  _: 2
5211
5532
  }, [
@@ -5222,8 +5543,16 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5222
5543
  vue.renderSlot(_ctx.$slots, "footer", {
5223
5544
  value: $props.modelValue,
5224
5545
  options: $options.visibleOptions
5225
- })
5226
- ], 2))
5546
+ }),
5547
+ vue.createElementVNode("span", {
5548
+ ref: "lastHiddenFocusableElementOnOverlay",
5549
+ role: "presentation",
5550
+ "aria-hidden": "true",
5551
+ class: "p-hidden-accessible p-hidden-focusable",
5552
+ tabindex: 0,
5553
+ onFocus: _cache[13] || (_cache[13] = (...args) => ($options.onLastHiddenFocus && $options.onLastHiddenFocus(...args)))
5554
+ }, null, 544)
5555
+ ], 16))
5227
5556
  : vue.createCommentVNode("", true)
5228
5557
  ]),
5229
5558
  _: 3
@@ -5231,7 +5560,7 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5231
5560
  ]),
5232
5561
  _: 3
5233
5562
  }, 8, ["appendTo"])
5234
- ], 2))
5563
+ ], 10, _hoisted_1))
5235
5564
  }
5236
5565
 
5237
5566
  function styleInject(css, ref) {
@@ -5261,7 +5590,7 @@ this.primevue.dropdown = (function (utils, OverlayEventBus, api, Ripple, Virtual
5261
5590
  }
5262
5591
  }
5263
5592
 
5264
- 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";
5593
+ 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";
5265
5594
  styleInject(css_248z);
5266
5595
 
5267
5596
  script.render = render;
@@ -6533,6 +6862,14 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6533
6862
  templates: {
6534
6863
  type: null,
6535
6864
  default: null
6865
+ },
6866
+ level: {
6867
+ type: Number,
6868
+ default: null
6869
+ },
6870
+ index: {
6871
+ type: Number,
6872
+ default: null
6536
6873
  }
6537
6874
  },
6538
6875
  nodeTouched: false,
@@ -6573,9 +6910,8 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6573
6910
  onKeyDown(event) {
6574
6911
  const nodeElement = event.target.parentElement;
6575
6912
 
6576
- switch (event.which) {
6577
- //down arrow
6578
- case 40:
6913
+ switch (event.code) {
6914
+ case 'ArrowDown':
6579
6915
  var listElement = nodeElement.children[1];
6580
6916
  if (listElement) {
6581
6917
  this.focusNode(listElement.children[0]);
@@ -6592,12 +6928,9 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6592
6928
  }
6593
6929
  }
6594
6930
  }
6595
-
6596
- event.preventDefault();
6597
6931
  break;
6598
6932
 
6599
- //up arrow
6600
- case 38:
6933
+ case 'ArrowUp':
6601
6934
  if (nodeElement.previousElementSibling) {
6602
6935
  this.focusNode(this.findLastVisibleDescendant(nodeElement.previousElementSibling));
6603
6936
  }
@@ -6607,24 +6940,20 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6607
6940
  this.focusNode(parentNodeElement);
6608
6941
  }
6609
6942
  }
6610
-
6611
- event.preventDefault();
6612
6943
  break;
6613
6944
 
6614
- //right-left arrows
6615
- case 37:
6616
- case 39:
6945
+ case 'ArrowRight':
6946
+ case 'ArrowLeft':
6617
6947
  this.$emit('node-toggle', this.node);
6618
-
6619
- event.preventDefault();
6620
6948
  break;
6621
6949
 
6622
- //enter
6623
- case 13:
6950
+ case 'Enter':
6951
+ case 'Space':
6624
6952
  this.onClick(event);
6625
- event.preventDefault();
6626
6953
  break;
6627
6954
  }
6955
+
6956
+ event.preventDefault();
6628
6957
  },
6629
6958
  toggleCheckbox() {
6630
6959
  let _selectionKeys = this.selectionKeys ? {...this.selectionKeys} : {};
@@ -6773,14 +7102,15 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6773
7102
  }
6774
7103
  };
6775
7104
 
6776
- const _hoisted_1$1 = ["aria-expanded"];
6777
- const _hoisted_2$1 = {
7105
+ const _hoisted_1$1 = ["aria-label", "aria-selected", "aria-expanded", "aria-setsize", "aria-posinset", "aria-level"];
7106
+ const _hoisted_2$1 = ["aria-expanded"];
7107
+ const _hoisted_3$1 = {
6778
7108
  key: 0,
6779
7109
  class: "p-checkbox p-component"
6780
7110
  };
6781
- const _hoisted_3$1 = ["aria-checked"];
6782
- const _hoisted_4$1 = { class: "p-treenode-label" };
6783
- const _hoisted_5$1 = {
7111
+ const _hoisted_4$1 = ["aria-checked"];
7112
+ const _hoisted_5$1 = { class: "p-treenode-label" };
7113
+ const _hoisted_6 = {
6784
7114
  key: 0,
6785
7115
  class: "p-treenode-children",
6786
7116
  role: "group"
@@ -6791,7 +7121,14 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6791
7121
  const _directive_ripple = vue.resolveDirective("ripple");
6792
7122
 
6793
7123
  return (vue.openBlock(), vue.createElementBlock("li", {
6794
- class: vue.normalizeClass($options.containerClass)
7124
+ class: vue.normalizeClass($options.containerClass),
7125
+ role: "treeitem",
7126
+ "aria-label": $options.label($props.node),
7127
+ "aria-selected": $options.selected,
7128
+ "aria-expanded": $options.expanded,
7129
+ "aria-setsize": $props.node.children ? $props.node.children.length : 0,
7130
+ "aria-posinset": $props.index + 1,
7131
+ "aria-level": $props.level
6795
7132
  }, [
6796
7133
  vue.createElementVNode("div", {
6797
7134
  class: vue.normalizeClass($options.contentClass),
@@ -6816,7 +7153,7 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6816
7153
  [_directive_ripple]
6817
7154
  ]),
6818
7155
  ($options.checkboxMode)
6819
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
7156
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
6820
7157
  vue.createElementVNode("div", {
6821
7158
  class: vue.normalizeClass($options.checkboxClass),
6822
7159
  role: "checkbox",
@@ -6825,13 +7162,13 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6825
7162
  vue.createElementVNode("span", {
6826
7163
  class: vue.normalizeClass($options.checkboxIcon)
6827
7164
  }, null, 2)
6828
- ], 10, _hoisted_3$1)
7165
+ ], 10, _hoisted_4$1)
6829
7166
  ]))
6830
7167
  : vue.createCommentVNode("", true),
6831
7168
  vue.createElementVNode("span", {
6832
7169
  class: vue.normalizeClass($options.icon)
6833
7170
  }, null, 2),
6834
- vue.createElementVNode("span", _hoisted_4$1, [
7171
+ vue.createElementVNode("span", _hoisted_5$1, [
6835
7172
  ($props.templates[$props.node.type]||$props.templates['default'])
6836
7173
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates[$props.node.type]||$props.templates['default']), {
6837
7174
  key: 0,
@@ -6841,25 +7178,26 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6841
7178
  vue.createTextVNode(vue.toDisplayString($options.label($props.node)), 1)
6842
7179
  ], 64))
6843
7180
  ])
6844
- ], 46, _hoisted_1$1),
7181
+ ], 46, _hoisted_2$1),
6845
7182
  ($options.hasChildren && $options.expanded)
6846
- ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_5$1, [
7183
+ ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_6, [
6847
7184
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.node.children, (childNode) => {
6848
7185
  return (vue.openBlock(), vue.createBlock(_component_TreeNode, {
6849
7186
  key: childNode.key,
6850
7187
  node: childNode,
6851
7188
  templates: $props.templates,
7189
+ level: $props.level + 1,
6852
7190
  expandedKeys: $props.expandedKeys,
6853
7191
  onNodeToggle: $options.onChildNodeToggle,
6854
7192
  onNodeClick: $options.onChildNodeClick,
6855
7193
  selectionMode: $props.selectionMode,
6856
7194
  selectionKeys: $props.selectionKeys,
6857
7195
  onCheckboxChange: $options.propagateUp
6858
- }, null, 8, ["node", "templates", "expandedKeys", "onNodeToggle", "onNodeClick", "selectionMode", "selectionKeys", "onCheckboxChange"]))
7196
+ }, null, 8, ["node", "templates", "level", "expandedKeys", "onNodeToggle", "onNodeClick", "selectionMode", "selectionKeys", "onCheckboxChange"]))
6859
7197
  }), 128))
6860
7198
  ]))
6861
7199
  : vue.createCommentVNode("", true)
6862
- ], 2))
7200
+ ], 10, _hoisted_1$1))
6863
7201
  }
6864
7202
 
6865
7203
  script$1.render = render$1;
@@ -6919,6 +7257,10 @@ this.primevue.tree = (function (utils, Ripple, vue) {
6919
7257
  scrollHeight: {
6920
7258
  type: String,
6921
7259
  default: null
7260
+ },
7261
+ level: {
7262
+ type: Number,
7263
+ default: 0
6922
7264
  }
6923
7265
  },
6924
7266
  data() {
@@ -7174,18 +7516,20 @@ this.primevue.tree = (function (utils, Ripple, vue) {
7174
7516
  style: vue.normalizeStyle({maxHeight: $props.scrollHeight})
7175
7517
  }, [
7176
7518
  vue.createElementVNode("ul", _hoisted_5, [
7177
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.valueToRender, (node) => {
7519
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.valueToRender, (node, index) => {
7178
7520
  return (vue.openBlock(), vue.createBlock(_component_TreeNode, {
7179
7521
  key: node.key,
7180
7522
  node: node,
7181
7523
  templates: _ctx.$slots,
7524
+ level: $props.level + 1,
7525
+ index: index,
7182
7526
  expandedKeys: $data.d_expandedKeys,
7183
7527
  onNodeToggle: $options.onNodeToggle,
7184
7528
  onNodeClick: $options.onNodeClick,
7185
7529
  selectionMode: $props.selectionMode,
7186
7530
  selectionKeys: $props.selectionKeys,
7187
7531
  onCheckboxChange: $options.onCheckboxChange
7188
- }, null, 8, ["node", "templates", "expandedKeys", "onNodeToggle", "onNodeClick", "selectionMode", "selectionKeys", "onCheckboxChange"]))
7532
+ }, null, 8, ["node", "templates", "level", "index", "expandedKeys", "onNodeToggle", "onNodeClick", "selectionMode", "selectionKeys", "onCheckboxChange"]))
7189
7533
  }), 128))
7190
7534
  ])
7191
7535
  ], 4)
@@ -7313,9 +7657,12 @@ this.primevue.menu = (function (utils, OverlayEventBus, Ripple, vue, Portal) {
7313
7657
  class: vue.normalizeClass($options.linkClass($props.item, {isActive, isExactActive})),
7314
7658
  role: "menuitem"
7315
7659
  }, [
7316
- vue.createElementVNode("span", {
7317
- class: vue.normalizeClass(['p-menuitem-icon', $props.item.icon])
7318
- }, null, 2),
7660
+ ($props.item.icon)
7661
+ ? (vue.openBlock(), vue.createElementBlock("span", {
7662
+ key: 0,
7663
+ class: vue.normalizeClass(['p-menuitem-icon', $props.item.icon])
7664
+ }, null, 2))
7665
+ : vue.createCommentVNode("", true),
7319
7666
  vue.createElementVNode("span", _hoisted_2$1, vue.toDisplayString($options.label()), 1)
7320
7667
  ], 10, _hoisted_1$1)), [
7321
7668
  [_directive_ripple]
@@ -7332,9 +7679,12 @@ this.primevue.menu = (function (utils, OverlayEventBus, Ripple, vue, Portal) {
7332
7679
  role: "menuitem",
7333
7680
  tabindex: $options.disabled($props.item) ? null : '0'
7334
7681
  }, [
7335
- vue.createElementVNode("span", {
7336
- class: vue.normalizeClass(['p-menuitem-icon', $props.item.icon])
7337
- }, null, 2),
7682
+ ($props.item.icon)
7683
+ ? (vue.openBlock(), vue.createElementBlock("span", {
7684
+ key: 0,
7685
+ class: vue.normalizeClass(['p-menuitem-icon', $props.item.icon])
7686
+ }, null, 2))
7687
+ : vue.createCommentVNode("", true),
7338
7688
  vue.createElementVNode("span", _hoisted_4, vue.toDisplayString($options.label()), 1)
7339
7689
  ], 10, _hoisted_3)), [
7340
7690
  [_directive_ripple]
@@ -7774,7 +8124,7 @@ this.primevue.tieredmenu = (function (utils, OverlayEventBus, Portal, Ripple, vu
7774
8124
  if (this.activeItem && item === this.activeItem)
7775
8125
  this.activeItem = null;
7776
8126
  else
7777
- this.activeItem = item;
8127
+ this.activeItem = item;
7778
8128
  }
7779
8129
 
7780
8130
  if (!item.items) {
@@ -7913,7 +8263,7 @@ this.primevue.tieredmenu = (function (utils, OverlayEventBus, Portal, Ripple, vu
7913
8263
  const _hoisted_4 = ["href", "target", "aria-haspopup", "aria-expanded", "onClick", "onKeydown", "tabindex"];
7914
8264
  const _hoisted_5 = { class: "p-menuitem-text" };
7915
8265
  const _hoisted_6 = {
7916
- key: 0,
8266
+ key: 1,
7917
8267
  class: "p-submenu-icon pi pi-angle-right"
7918
8268
  };
7919
8269
 
@@ -7956,9 +8306,12 @@ this.primevue.tieredmenu = (function (utils, OverlayEventBus, Portal, Ripple, vu
7956
8306
  onKeydown: $event => ($options.onItemKeyDown($event, item)),
7957
8307
  role: "menuitem"
7958
8308
  }, [
7959
- vue.createElementVNode("span", {
7960
- class: vue.normalizeClass(['p-menuitem-icon', item.icon])
7961
- }, null, 2),
8309
+ (item.icon)
8310
+ ? (vue.openBlock(), vue.createElementBlock("span", {
8311
+ key: 0,
8312
+ class: vue.normalizeClass(['p-menuitem-icon', item.icon])
8313
+ }, null, 2))
8314
+ : vue.createCommentVNode("", true),
7962
8315
  vue.createElementVNode("span", _hoisted_3, vue.toDisplayString($options.label(item)), 1)
7963
8316
  ], 42, _hoisted_2)), [
7964
8317
  [_directive_ripple]
@@ -7978,9 +8331,12 @@ this.primevue.tieredmenu = (function (utils, OverlayEventBus, Portal, Ripple, vu
7978
8331
  role: "menuitem",
7979
8332
  tabindex: $options.disabled(item) ? null : '0'
7980
8333
  }, [
7981
- vue.createElementVNode("span", {
7982
- class: vue.normalizeClass(['p-menuitem-icon', item.icon])
7983
- }, null, 2),
8334
+ (item.icon)
8335
+ ? (vue.openBlock(), vue.createElementBlock("span", {
8336
+ key: 0,
8337
+ class: vue.normalizeClass(['p-menuitem-icon', item.icon])
8338
+ }, null, 2))
8339
+ : vue.createCommentVNode("", true),
7984
8340
  vue.createElementVNode("span", _hoisted_5, vue.toDisplayString($options.label(item)), 1),
7985
8341
  (item.items)
7986
8342
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6))