primevue 3.13.1 → 3.16.0

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