primevue 3.15.0 → 3.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/autocomplete/AutoComplete.d.ts +182 -38
  2. package/autocomplete/AutoComplete.vue +636 -342
  3. package/autocomplete/autocomplete.cjs.js +745 -416
  4. package/autocomplete/autocomplete.cjs.min.js +1 -1
  5. package/autocomplete/autocomplete.esm.js +747 -418
  6. package/autocomplete/autocomplete.esm.min.js +1 -1
  7. package/autocomplete/autocomplete.js +745 -416
  8. package/autocomplete/autocomplete.min.js +1 -1
  9. package/button/Button.vue +4 -1
  10. package/button/button.cjs.js +5 -1
  11. package/button/button.cjs.min.js +1 -1
  12. package/button/button.esm.js +5 -1
  13. package/button/button.esm.min.js +1 -1
  14. package/button/button.js +5 -1
  15. package/button/button.min.js +1 -1
  16. package/calendar/Calendar.d.ts +51 -12
  17. package/calendar/Calendar.vue +259 -114
  18. package/calendar/calendar.cjs.js +414 -220
  19. package/calendar/calendar.cjs.min.js +1 -1
  20. package/calendar/calendar.esm.js +415 -221
  21. package/calendar/calendar.esm.min.js +1 -1
  22. package/calendar/calendar.js +414 -220
  23. package/calendar/calendar.min.js +1 -1
  24. package/carousel/Carousel.vue +25 -0
  25. package/carousel/carousel.cjs.js +25 -0
  26. package/carousel/carousel.cjs.min.js +1 -1
  27. package/carousel/carousel.esm.js +25 -0
  28. package/carousel/carousel.esm.min.js +1 -1
  29. package/carousel/carousel.js +25 -0
  30. package/carousel/carousel.min.js +1 -1
  31. package/cascadeselect/CascadeSelect.d.ts +97 -17
  32. package/cascadeselect/CascadeSelect.vue +560 -135
  33. package/cascadeselect/CascadeSelectSub.vue +48 -129
  34. package/cascadeselect/cascadeselect.cjs.js +670 -306
  35. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  36. package/cascadeselect/cascadeselect.esm.js +672 -308
  37. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  38. package/cascadeselect/cascadeselect.js +670 -306
  39. package/cascadeselect/cascadeselect.min.js +1 -1
  40. package/checkbox/Checkbox.d.ts +40 -4
  41. package/checkbox/Checkbox.vue +50 -13
  42. package/checkbox/checkbox.cjs.js +64 -23
  43. package/checkbox/checkbox.cjs.min.js +1 -1
  44. package/checkbox/checkbox.esm.js +65 -24
  45. package/checkbox/checkbox.esm.min.js +1 -1
  46. package/checkbox/checkbox.js +64 -23
  47. package/checkbox/checkbox.min.js +1 -1
  48. package/chips/Chips.d.ts +36 -12
  49. package/chips/Chips.vue +116 -22
  50. package/chips/chips.cjs.js +149 -37
  51. package/chips/chips.cjs.min.js +1 -1
  52. package/chips/chips.esm.js +150 -38
  53. package/chips/chips.esm.min.js +1 -1
  54. package/chips/chips.js +150 -39
  55. package/chips/chips.min.js +1 -1
  56. package/colorpicker/ColorPicker.d.ts +3 -6
  57. package/colorpicker/ColorPicker.vue +1 -5
  58. package/colorpicker/colorpicker.cjs.js +2 -7
  59. package/colorpicker/colorpicker.cjs.min.js +1 -1
  60. package/colorpicker/colorpicker.esm.js +2 -7
  61. package/colorpicker/colorpicker.esm.min.js +1 -1
  62. package/colorpicker/colorpicker.js +2 -7
  63. package/colorpicker/colorpicker.min.js +1 -1
  64. package/column/Column.d.ts +4 -0
  65. package/column/Column.vue +4 -0
  66. package/column/column.cjs.js +4 -0
  67. package/column/column.cjs.min.js +1 -1
  68. package/column/column.esm.js +4 -0
  69. package/column/column.esm.min.js +1 -1
  70. package/column/column.js +4 -0
  71. package/column/column.min.js +1 -1
  72. package/config/PrimeVue.d.ts +42 -0
  73. package/config/config.cjs.js +35 -4
  74. package/config/config.cjs.min.js +1 -1
  75. package/config/config.esm.js +35 -4
  76. package/config/config.esm.min.js +1 -1
  77. package/config/config.js +35 -4
  78. package/config/config.min.js +1 -1
  79. package/confirmdialog/ConfirmDialog.vue +4 -1
  80. package/confirmdialog/confirmdialog.cjs.js +6 -2
  81. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  82. package/confirmdialog/confirmdialog.esm.js +6 -2
  83. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  84. package/confirmdialog/confirmdialog.js +6 -2
  85. package/confirmdialog/confirmdialog.min.js +1 -1
  86. package/contextmenu/ContextMenu.d.ts +1 -1
  87. package/contextmenu/ContextMenuSub.vue +3 -3
  88. package/contextmenu/contextmenu.cjs.js +14 -8
  89. package/contextmenu/contextmenu.cjs.min.js +1 -1
  90. package/contextmenu/contextmenu.esm.js +15 -9
  91. package/contextmenu/contextmenu.esm.min.js +1 -1
  92. package/contextmenu/contextmenu.js +14 -8
  93. package/contextmenu/contextmenu.min.js +1 -1
  94. package/core/core.js +1128 -772
  95. package/core/core.min.js +12 -12
  96. package/datatable/BodyCell.vue +11 -2
  97. package/datatable/DataTable.vue +23 -2
  98. package/datatable/datatable.cjs.js +34 -4
  99. package/datatable/datatable.cjs.min.js +1 -1
  100. package/datatable/datatable.esm.js +34 -4
  101. package/datatable/datatable.esm.min.js +1 -1
  102. package/datatable/datatable.js +34 -4
  103. package/datatable/datatable.min.js +1 -1
  104. package/dialog/Dialog.d.ts +5 -1
  105. package/dropdown/Dropdown.d.ts +92 -38
  106. package/dropdown/Dropdown.vue +538 -399
  107. package/dropdown/dropdown.cjs.js +657 -486
  108. package/dropdown/dropdown.cjs.min.js +1 -1
  109. package/dropdown/dropdown.esm.js +659 -488
  110. package/dropdown/dropdown.esm.min.js +1 -1
  111. package/dropdown/dropdown.js +657 -486
  112. package/dropdown/dropdown.min.js +1 -1
  113. package/editor/Editor.d.ts +32 -0
  114. package/editor/Editor.vue +15 -1
  115. package/editor/editor.cjs.js +15 -1
  116. package/editor/editor.cjs.min.js +1 -1
  117. package/editor/editor.esm.js +15 -1
  118. package/editor/editor.esm.min.js +1 -1
  119. package/editor/editor.js +15 -1
  120. package/editor/editor.min.js +1 -1
  121. package/inputmask/InputMask.vue +9 -6
  122. package/inputmask/inputmask.cjs.js +14 -6
  123. package/inputmask/inputmask.cjs.min.js +1 -1
  124. package/inputmask/inputmask.esm.js +15 -7
  125. package/inputmask/inputmask.esm.min.js +1 -1
  126. package/inputmask/inputmask.js +14 -6
  127. package/inputmask/inputmask.min.js +1 -1
  128. package/inputnumber/InputNumber.d.ts +31 -7
  129. package/inputnumber/InputNumber.vue +53 -20
  130. package/inputnumber/inputnumber.cjs.js +75 -29
  131. package/inputnumber/inputnumber.cjs.min.js +1 -1
  132. package/inputnumber/inputnumber.esm.js +76 -30
  133. package/inputnumber/inputnumber.esm.min.js +1 -1
  134. package/inputnumber/inputnumber.js +75 -29
  135. package/inputnumber/inputnumber.min.js +1 -1
  136. package/inputswitch/InputSwitch.d.ts +24 -8
  137. package/inputswitch/InputSwitch.vue +27 -12
  138. package/inputswitch/inputswitch.cjs.js +38 -20
  139. package/inputswitch/inputswitch.cjs.min.js +1 -1
  140. package/inputswitch/inputswitch.esm.js +39 -21
  141. package/inputswitch/inputswitch.esm.min.js +1 -1
  142. package/inputswitch/inputswitch.js +38 -20
  143. package/inputswitch/inputswitch.min.js +1 -1
  144. package/inputtext/InputText.vue +1 -2
  145. package/inputtext/inputtext.cjs.js +3 -4
  146. package/inputtext/inputtext.cjs.min.js +1 -1
  147. package/inputtext/inputtext.esm.js +4 -5
  148. package/inputtext/inputtext.esm.min.js +1 -1
  149. package/inputtext/inputtext.js +3 -4
  150. package/inputtext/inputtext.min.js +1 -1
  151. package/knob/Knob.d.ts +12 -0
  152. package/knob/Knob.vue +62 -2
  153. package/knob/knob.cjs.js +73 -5
  154. package/knob/knob.cjs.min.js +1 -1
  155. package/knob/knob.esm.js +73 -5
  156. package/knob/knob.esm.min.js +1 -1
  157. package/knob/knob.js +73 -5
  158. package/knob/knob.min.js +1 -1
  159. package/listbox/Listbox.d.ts +53 -7
  160. package/listbox/Listbox.vue +500 -135
  161. package/listbox/listbox.cjs.js +597 -193
  162. package/listbox/listbox.cjs.min.js +1 -1
  163. package/listbox/listbox.esm.js +599 -195
  164. package/listbox/listbox.esm.min.js +1 -1
  165. package/listbox/listbox.js +597 -193
  166. package/listbox/listbox.min.js +1 -1
  167. package/menu/Menu.d.ts +1 -1
  168. package/menu/Menuitem.vue +2 -2
  169. package/menu/menu.cjs.js +12 -6
  170. package/menu/menu.cjs.min.js +1 -1
  171. package/menu/menu.esm.js +13 -7
  172. package/menu/menu.esm.min.js +1 -1
  173. package/menu/menu.js +12 -6
  174. package/menu/menu.min.js +1 -1
  175. package/menubar/MenubarSub.vue +3 -3
  176. package/menubar/menubar.cjs.js +14 -8
  177. package/menubar/menubar.cjs.min.js +1 -1
  178. package/menubar/menubar.esm.js +15 -9
  179. package/menubar/menubar.esm.min.js +1 -1
  180. package/menubar/menubar.js +14 -8
  181. package/menubar/menubar.min.js +1 -1
  182. package/menuitem/MenuItem.d.ts +1 -1
  183. package/multiselect/MultiSelect.d.ts +111 -51
  184. package/multiselect/MultiSelect.vue +629 -338
  185. package/multiselect/multiselect.cjs.js +748 -428
  186. package/multiselect/multiselect.cjs.min.js +1 -1
  187. package/multiselect/multiselect.esm.js +750 -430
  188. package/multiselect/multiselect.esm.min.js +1 -1
  189. package/multiselect/multiselect.js +748 -428
  190. package/multiselect/multiselect.min.js +1 -1
  191. package/overlaypanel/OverlayPanel.d.ts +1 -1
  192. package/overlaypanel/OverlayPanel.vue +14 -2
  193. package/overlaypanel/overlaypanel.cjs.js +14 -2
  194. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  195. package/overlaypanel/overlaypanel.esm.js +14 -2
  196. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  197. package/overlaypanel/overlaypanel.js +14 -2
  198. package/overlaypanel/overlaypanel.min.js +1 -1
  199. package/package.json +2 -2
  200. package/paginator/Paginator.d.ts +2 -2
  201. package/password/Password.d.ts +36 -8
  202. package/password/Password.vue +50 -14
  203. package/password/password.cjs.js +69 -24
  204. package/password/password.cjs.min.js +1 -1
  205. package/password/password.esm.js +71 -26
  206. package/password/password.esm.min.js +1 -1
  207. package/password/password.js +69 -24
  208. package/password/password.min.js +1 -1
  209. package/picklist/PickList.d.ts +8 -0
  210. package/picklist/PickList.vue +10 -2
  211. package/picklist/picklist.cjs.js +68 -50
  212. package/picklist/picklist.cjs.min.js +1 -1
  213. package/picklist/picklist.esm.js +69 -51
  214. package/picklist/picklist.esm.min.js +1 -1
  215. package/picklist/picklist.js +68 -50
  216. package/picklist/picklist.min.js +1 -1
  217. package/portal/Portal.d.ts +1 -1
  218. package/radiobutton/RadioButton.d.ts +28 -4
  219. package/radiobutton/RadioButton.vue +36 -11
  220. package/radiobutton/radiobutton.cjs.js +49 -23
  221. package/radiobutton/radiobutton.cjs.min.js +1 -1
  222. package/radiobutton/radiobutton.esm.js +50 -24
  223. package/radiobutton/radiobutton.esm.min.js +1 -1
  224. package/radiobutton/radiobutton.js +49 -23
  225. package/radiobutton/radiobutton.min.js +1 -1
  226. package/rating/Rating.d.ts +4 -0
  227. package/rating/Rating.vue +61 -7
  228. package/rating/rating.cjs.js +90 -16
  229. package/rating/rating.cjs.min.js +1 -1
  230. package/rating/rating.esm.js +91 -17
  231. package/rating/rating.esm.min.js +1 -1
  232. package/rating/rating.js +90 -16
  233. package/rating/rating.min.js +1 -1
  234. package/resources/primevue.css +8 -0
  235. package/resources/primevue.min.css +1 -1
  236. package/resources/themes/arya-blue/theme.css +82 -40
  237. package/resources/themes/arya-green/theme.css +82 -40
  238. package/resources/themes/arya-orange/theme.css +82 -40
  239. package/resources/themes/arya-purple/theme.css +82 -40
  240. package/resources/themes/bootstrap4-dark-blue/theme.css +82 -40
  241. package/resources/themes/bootstrap4-dark-purple/theme.css +82 -40
  242. package/resources/themes/bootstrap4-light-blue/theme.css +82 -40
  243. package/resources/themes/bootstrap4-light-purple/theme.css +82 -40
  244. package/resources/themes/fluent-light/theme.css +82 -40
  245. package/resources/themes/lara-dark-blue/theme.css +82 -40
  246. package/resources/themes/lara-dark-indigo/theme.css +82 -40
  247. package/resources/themes/lara-dark-purple/theme.css +82 -40
  248. package/resources/themes/lara-dark-teal/theme.css +82 -40
  249. package/resources/themes/lara-light-blue/theme.css +82 -40
  250. package/resources/themes/lara-light-indigo/theme.css +82 -40
  251. package/resources/themes/lara-light-purple/theme.css +82 -40
  252. package/resources/themes/lara-light-teal/theme.css +82 -40
  253. package/resources/themes/luna-amber/theme.css +82 -40
  254. package/resources/themes/luna-blue/theme.css +82 -40
  255. package/resources/themes/luna-green/theme.css +82 -40
  256. package/resources/themes/luna-pink/theme.css +82 -40
  257. package/resources/themes/md-dark-deeppurple/theme.css +82 -40
  258. package/resources/themes/md-dark-indigo/theme.css +82 -40
  259. package/resources/themes/md-light-deeppurple/theme.css +82 -40
  260. package/resources/themes/md-light-indigo/theme.css +82 -40
  261. package/resources/themes/mdc-dark-deeppurple/theme.css +82 -40
  262. package/resources/themes/mdc-dark-indigo/theme.css +82 -40
  263. package/resources/themes/mdc-light-deeppurple/theme.css +82 -40
  264. package/resources/themes/mdc-light-indigo/theme.css +82 -40
  265. package/resources/themes/nova/theme.css +82 -40
  266. package/resources/themes/nova-accent/theme.css +82 -40
  267. package/resources/themes/nova-alt/theme.css +82 -40
  268. package/resources/themes/nova-vue/theme.css +82 -40
  269. package/resources/themes/rhea/theme.css +82 -40
  270. package/resources/themes/saga-blue/theme.css +82 -40
  271. package/resources/themes/saga-green/theme.css +82 -40
  272. package/resources/themes/saga-orange/theme.css +82 -40
  273. package/resources/themes/saga-purple/theme.css +82 -40
  274. package/resources/themes/tailwind-light/theme.css +82 -40
  275. package/resources/themes/vela-blue/theme.css +82 -40
  276. package/resources/themes/vela-green/theme.css +82 -40
  277. package/resources/themes/vela-orange/theme.css +82 -40
  278. package/resources/themes/vela-purple/theme.css +82 -40
  279. package/ripple/ripple.cjs.js +1 -0
  280. package/ripple/ripple.cjs.min.js +1 -1
  281. package/ripple/ripple.esm.js +1 -0
  282. package/ripple/ripple.esm.min.js +1 -1
  283. package/ripple/ripple.js +1 -0
  284. package/ripple/ripple.min.js +1 -1
  285. package/selectbutton/SelectButton.d.ts +6 -2
  286. package/selectbutton/SelectButton.vue +89 -12
  287. package/selectbutton/selectbutton.cjs.js +97 -22
  288. package/selectbutton/selectbutton.cjs.min.js +1 -1
  289. package/selectbutton/selectbutton.esm.js +99 -24
  290. package/selectbutton/selectbutton.esm.min.js +1 -1
  291. package/selectbutton/selectbutton.js +97 -22
  292. package/selectbutton/selectbutton.min.js +1 -1
  293. package/slider/Slider.d.ts +9 -1
  294. package/slider/Slider.vue +50 -34
  295. package/slider/slider.cjs.js +59 -38
  296. package/slider/slider.cjs.min.js +1 -1
  297. package/slider/slider.esm.js +59 -38
  298. package/slider/slider.esm.min.js +1 -1
  299. package/slider/slider.js +59 -38
  300. package/slider/slider.min.js +1 -1
  301. package/splitbutton/SplitButton.d.ts +1 -1
  302. package/splitter/Splitter.vue +30 -1
  303. package/splitter/splitter.cjs.js +30 -1
  304. package/splitter/splitter.cjs.min.js +1 -1
  305. package/splitter/splitter.esm.js +30 -1
  306. package/splitter/splitter.esm.min.js +1 -1
  307. package/splitter/splitter.js +30 -1
  308. package/splitter/splitter.min.js +1 -1
  309. package/textarea/Textarea.vue +1 -2
  310. package/textarea/textarea.cjs.js +3 -5
  311. package/textarea/textarea.cjs.min.js +1 -1
  312. package/textarea/textarea.esm.js +4 -6
  313. package/textarea/textarea.esm.min.js +1 -1
  314. package/textarea/textarea.js +3 -5
  315. package/textarea/textarea.min.js +1 -1
  316. package/tieredmenu/TieredMenu.d.ts +1 -1
  317. package/tieredmenu/TieredMenuSub.vue +3 -3
  318. package/tieredmenu/tieredmenu.cjs.js +14 -8
  319. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  320. package/tieredmenu/tieredmenu.esm.js +15 -9
  321. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  322. package/tieredmenu/tieredmenu.js +14 -8
  323. package/tieredmenu/tieredmenu.min.js +1 -1
  324. package/timeline/Timeline.d.ts +10 -1
  325. package/timeline/Timeline.vue +1 -1
  326. package/timeline/timeline.cjs.js +5 -1
  327. package/timeline/timeline.cjs.min.js +1 -1
  328. package/timeline/timeline.esm.js +5 -1
  329. package/timeline/timeline.esm.min.js +1 -1
  330. package/timeline/timeline.js +5 -1
  331. package/timeline/timeline.min.js +1 -1
  332. package/togglebutton/ToggleButton.d.ts +42 -0
  333. package/togglebutton/ToggleButton.vue +44 -7
  334. package/togglebutton/togglebutton.cjs.js +59 -13
  335. package/togglebutton/togglebutton.cjs.min.js +1 -1
  336. package/togglebutton/togglebutton.esm.js +60 -14
  337. package/togglebutton/togglebutton.esm.min.js +1 -1
  338. package/togglebutton/togglebutton.js +59 -13
  339. package/togglebutton/togglebutton.min.js +1 -1
  340. package/tooltip/tooltip.cjs.js +20 -11
  341. package/tooltip/tooltip.cjs.min.js +1 -1
  342. package/tooltip/tooltip.esm.js +21 -12
  343. package/tooltip/tooltip.esm.min.js +1 -1
  344. package/tooltip/tooltip.js +20 -11
  345. package/tooltip/tooltip.min.js +1 -1
  346. package/tree/Tree.vue +5 -1
  347. package/tree/TreeNode.vue +20 -19
  348. package/tree/tree.cjs.js +47 -32
  349. package/tree/tree.cjs.min.js +1 -1
  350. package/tree/tree.esm.js +47 -32
  351. package/tree/tree.esm.min.js +1 -1
  352. package/tree/tree.js +47 -32
  353. package/tree/tree.min.js +1 -1
  354. package/treeselect/TreeSelect.d.ts +26 -10
  355. package/treeselect/TreeSelect.vue +52 -29
  356. package/treeselect/treeselect.cjs.js +74 -41
  357. package/treeselect/treeselect.cjs.min.js +1 -1
  358. package/treeselect/treeselect.esm.js +76 -43
  359. package/treeselect/treeselect.esm.min.js +1 -1
  360. package/treeselect/treeselect.js +74 -41
  361. package/treeselect/treeselect.min.js +1 -1
  362. package/tristatecheckbox/TriStateCheckbox.d.ts +20 -4
  363. package/tristatecheckbox/TriStateCheckbox.vue +52 -15
  364. package/tristatecheckbox/tristatecheckbox.cjs.js +67 -26
  365. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  366. package/tristatecheckbox/tristatecheckbox.esm.js +68 -27
  367. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  368. package/tristatecheckbox/tristatecheckbox.js +67 -26
  369. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  370. package/utils/Utils.d.ts +3 -2
  371. package/utils/utils.cjs.js +239 -173
  372. package/utils/utils.cjs.min.js +1 -1
  373. package/utils/utils.esm.js +239 -173
  374. package/utils/utils.esm.min.js +1 -1
  375. package/utils/utils.js +239 -173
  376. package/utils/utils.min.js +1 -1
  377. package/vetur-attributes.json +612 -136
  378. package/vetur-tags.json +180 -59
  379. package/virtualscroller/VirtualScroller.d.ts +10 -0
  380. package/virtualscroller/VirtualScroller.vue +18 -17
  381. package/virtualscroller/virtualscroller.cjs.js +22 -20
  382. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  383. package/virtualscroller/virtualscroller.esm.js +22 -20
  384. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  385. package/virtualscroller/virtualscroller.js +22 -20
  386. package/virtualscroller/virtualscroller.min.js +1 -1
  387. package/web-types.json +1745 -338
@@ -17,7 +17,7 @@ var Portal__default = /*#__PURE__*/_interopDefaultLegacy(Portal);
17
17
 
18
18
  var script = {
19
19
  name: 'MultiSelect',
20
- emits: ['update:modelValue', 'before-show', 'before-hide', 'change', 'show', 'hide', 'filter', 'selectall-change'],
20
+ emits: ['update:modelValue', 'change', 'focus', 'blur' , 'before-show', 'before-hide', 'show', 'hide', 'filter', 'selectall-change'],
21
21
  props: {
22
22
  modelValue: null,
23
23
  options: Array,
@@ -32,8 +32,13 @@ var script = {
32
32
  },
33
33
  placeholder: String,
34
34
  disabled: Boolean,
35
- tabindex: String,
36
35
  inputId: String,
36
+ inputProps: null,
37
+ panelStyle: null,
38
+ panelClass: null,
39
+ panelProps: null,
40
+ filterInputProps: null,
41
+ closeButtonProps: null,
37
42
  dataKey: null,
38
43
  filter: Boolean,
39
44
  filterPlaceholder: String,
@@ -46,24 +51,14 @@ var script = {
46
51
  type: Array,
47
52
  default: null
48
53
  },
49
- ariaLabelledBy: null,
50
54
  appendTo: {
51
55
  type: String,
52
56
  default: 'body'
53
57
  },
54
- emptyFilterMessage: {
55
- type: String,
56
- default: null
57
- },
58
- emptyMessage: {
59
- type: String,
60
- default: null
61
- },
62
58
  display: {
63
59
  type: String,
64
60
  default: 'comma'
65
61
  },
66
- panelClass: null,
67
62
  selectedItemsLabel: {
68
63
  type: String,
69
64
  default: '{0} items selected'
@@ -99,21 +94,75 @@ var script = {
99
94
  virtualScrollerOptions: {
100
95
  type: Object,
101
96
  default: null
97
+ },
98
+ autoOptionFocus: {
99
+ type: Boolean,
100
+ default: true
101
+ },
102
+ filterMessage: {
103
+ type: String,
104
+ default: null
105
+ },
106
+ selectionMessage: {
107
+ type: String,
108
+ default: null
109
+ },
110
+ emptySelectionMessage: {
111
+ type: String,
112
+ default: null
113
+ },
114
+ emptyFilterMessage: {
115
+ type: String,
116
+ default: null
117
+ },
118
+ emptyMessage: {
119
+ type: String,
120
+ default: null
121
+ },
122
+ tabindex: {
123
+ type: Number,
124
+ default: 0
125
+ },
126
+ 'aria-label': {
127
+ type: String,
128
+ default: null
129
+ },
130
+ 'aria-labelledby': {
131
+ type: String,
132
+ default: null
102
133
  }
103
134
  },
135
+ outsideClickListener: null,
136
+ scrollHandler: null,
137
+ resizeListener: null,
138
+ overlay: null,
139
+ list: null,
140
+ virtualScroller: null,
141
+ startRangeIndex: -1,
142
+ searchTimeout: null,
143
+ searchValue: '',
144
+ selectOnFocus: false,
145
+ focusOnHover: false,
104
146
  data() {
105
147
  return {
148
+ id: utils.UniqueComponentId(),
106
149
  focused: false,
150
+ focusedOptionIndex: -1,
107
151
  headerCheckboxFocused: false,
108
152
  filterValue: null,
109
153
  overlayVisible: false
110
- };
154
+ }
155
+ },
156
+ watch: {
157
+ options() {
158
+ this.autoUpdateModel();
159
+ }
160
+ },
161
+ mounted() {
162
+ this.id = this.$attrs.id || this.id;
163
+
164
+ this.autoUpdateModel();
111
165
  },
112
- outsideClickListener: null,
113
- resizeListener: null,
114
- scrollHandler: null,
115
- overlay: null,
116
- virtualScroller: null,
117
166
  beforeUnmount() {
118
167
  this.unbindOutsideClickListener();
119
168
  this.unbindResizeListener();
@@ -141,15 +190,6 @@ var script = {
141
190
  getOptionRenderKey(option) {
142
191
  return this.dataKey ? utils.ObjectUtils.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);
143
192
  },
144
- getOptionGroupRenderKey(optionGroup) {
145
- return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
146
- },
147
- getOptionGroupLabel(optionGroup) {
148
- return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
149
- },
150
- getOptionGroupChildren(optionGroup) {
151
- return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren);
152
- },
153
193
  isOptionDisabled(option) {
154
194
  if (this.maxSelectionLimitReached && !this.isSelected(option)) {
155
195
  return true;
@@ -157,109 +197,141 @@ var script = {
157
197
 
158
198
  return this.optionDisabled ? utils.ObjectUtils.resolveFieldData(option, this.optionDisabled) : false;
159
199
  },
160
- getSelectedOptionIndex() {
161
- if (this.modelValue != null && this.options) {
162
- if (this.optionGroupLabel) {
163
- for (let i = 0; i < this.options.length; i++) {
164
- let selectedOptionIndex = this.findOptionIndexInList(this.modelValue, this.getOptionGroupChildren(this.options[i]));
165
- if (selectedOptionIndex !== -1) {
166
- return {group: i, option: selectedOptionIndex};
167
- }
168
- }
169
- }
170
- else {
171
- return this.findOptionIndexInList(this.modelValue, this.options);
172
- }
173
- }
174
-
175
- return -1;
200
+ isOptionGroup(option) {
201
+ return this.optionGroupLabel && option.optionGroup && option.group;
202
+ },
203
+ getOptionGroupLabel(optionGroup) {
204
+ return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel);
176
205
  },
177
- findOptionIndexInList(value, list) {
178
- return value ? list.findIndex(item => value.some(val => utils.ObjectUtils.equals(val, this.getOptionValue(item), this.equalityKey))) : -1;
206
+ getOptionGroupChildren(optionGroup) {
207
+ return utils.ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren);
179
208
  },
180
- isSelected(option) {
181
- if (this.modelValue) {
182
- let optionValue = this.getOptionValue(option);
183
- let key = this.equalityKey;
184
-
185
- return this.modelValue.some(val => utils.ObjectUtils.equals(val, optionValue, key));
186
- }
187
-
188
- return false;
209
+ getAriaPosInset(index) {
210
+ return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(option => this.isOptionGroup(option)).length : index) + 1;
189
211
  },
190
- show() {
212
+ show(isFocus) {
191
213
  this.$emit('before-show');
192
214
  this.overlayVisible = true;
215
+ this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : (this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1);
216
+
217
+ isFocus && this.$refs.focusInput.focus();
193
218
  },
194
- hide() {
219
+ hide(isFocus) {
195
220
  this.$emit('before-hide');
196
221
  this.overlayVisible = false;
197
- if (this.resetFilterOnHide) {
198
- this.filterValue = null;
199
- }
222
+ this.focusedOptionIndex = -1;
223
+ this.searchValue = '';
224
+
225
+ this.resetFilterOnHide && (this.filterValue = null);
226
+ isFocus && this.$refs.focusInput.focus();
200
227
  },
201
- onFocus() {
228
+ onFocus(event) {
202
229
  this.focused = true;
230
+ this.focusedOptionIndex = this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1;
231
+ this.overlayVisible && this.scrollInView(this.focusedOptionIndex);
232
+ this.$emit('focus', event);
203
233
  },
204
- onBlur() {
234
+ onBlur(event) {
205
235
  this.focused = false;
236
+ this.focusedOptionIndex = -1;
237
+ this.searchValue = '';
238
+ this.$emit('blur', event);
206
239
  },
207
- onHeaderCheckboxFocus() {
208
- this.headerCheckboxFocused = true;
209
- },
210
- onHeaderCheckboxBlur() {
211
- this.headerCheckboxFocused = false;
240
+ onKeyDown(event) {
241
+ switch (event.code) {
242
+ case 'ArrowDown':
243
+ this.onArrowDownKey(event);
244
+ break;
245
+
246
+ case 'ArrowUp':
247
+ this.onArrowUpKey(event);
248
+ break;
249
+
250
+ case 'Home':
251
+ this.onHomeKey(event);
252
+ break;
253
+
254
+ case 'End':
255
+ this.onEndKey(event);
256
+ break;
257
+
258
+ case 'PageDown':
259
+ this.onPageDownKey(event);
260
+ break;
261
+
262
+ case 'PageUp':
263
+ this.onPageUpKey(event);
264
+ break;
265
+
266
+ case 'Enter':
267
+ case 'Space':
268
+ this.onEnterKey(event);
269
+ break;
270
+
271
+ case 'Escape':
272
+ this.onEscapeKey(event);
273
+ break;
274
+
275
+ case 'Tab':
276
+ this.onTabKey(event);
277
+ break;
278
+
279
+ case 'ShiftLeft':
280
+ case 'ShiftRight':
281
+ this.onShiftKey(event);
282
+ break;
283
+
284
+ default:
285
+ if (event.code === 'KeyA' && (event.metaKey || event.ctrlKey)) {
286
+ const value = this.visibleOptions.filter(option => this.isValidOption(option)).map(option => this.getOptionValue(option));
287
+ this.updateModel(event, value);
288
+
289
+ event.preventDefault();
290
+ break;
291
+ }
292
+
293
+ if (utils.ObjectUtils.isPrintableCharacter(event.key)) {
294
+ !this.overlayVisible && this.show();
295
+ this.searchOptions(event);
296
+ event.preventDefault();
297
+ }
298
+
299
+ break;
300
+ }
212
301
  },
213
- onClick(event) {
302
+ onContainerClick(event) {
214
303
  if (this.disabled || this.loading) {
215
304
  return;
216
305
  }
217
306
 
218
- if ((!this.overlay || !this.overlay.contains(event.target)) && !utils.DomHandler.hasClass(event.target, 'p-multiselect-close')) {
219
- utils.DomHandler.hasClass(event.target, 'p-multiselect-close');
220
- if (this.overlayVisible)
221
- this.hide();
222
- else
223
- this.show();
307
+ if (!this.overlay || !this.overlay.contains(event.target)) {
308
+ this.overlayVisible ? this.hide(true) : this.show(true);
309
+ }
310
+ },
311
+ onFirstHiddenFocus(event) {
312
+ const relatedTarget = event.relatedTarget;
224
313
 
314
+ if (relatedTarget === this.$refs.focusInput) {
315
+ const firstFocusableEl = utils.DomHandler.getFirstFocusableElement(this.overlay, ':not(.p-hidden-focusable)');
316
+ firstFocusableEl && firstFocusableEl.focus();
317
+ }
318
+ else {
225
319
  this.$refs.focusInput.focus();
226
320
  }
227
321
  },
322
+ onLastHiddenFocus() {
323
+ this.$refs.firstHiddenFocusableElementOnOverlay.focus();
324
+ },
228
325
  onCloseClick() {
229
- this.hide();
326
+ this.hide(true);
230
327
  },
231
- onKeyDown(event) {
232
- switch(event.which) {
233
- //down
234
- case 40:
235
- if (this.visibleOptions && !this.overlayVisible && event.altKey) {
236
- this.show();
237
- }
238
- break;
239
-
240
- //space
241
- case 32:
242
- if (!this.overlayVisible) {
243
- this.show();
244
- event.preventDefault();
245
- }
246
- break;
247
-
248
- //escape
249
- case 27:
250
- if (this.overlayVisible) {
251
- this.hide();
252
- event.preventDefault();
253
- }
254
- break;
255
-
256
- //tab
257
- case 9:
258
- this.hide();
259
- break;
260
- }
328
+ onHeaderCheckboxFocus() {
329
+ this.headerCheckboxFocused = true;
330
+ },
331
+ onHeaderCheckboxBlur() {
332
+ this.headerCheckboxFocused = false;
261
333
  },
262
- onOptionSelect(event, option) {
334
+ onOptionSelect(event, option, index = -1, isFocus = false) {
263
335
  if (this.disabled || this.isOptionDisabled(option)) {
264
336
  return;
265
337
  }
@@ -272,84 +344,235 @@ var script = {
272
344
  else
273
345
  value = [...(this.modelValue || []), this.getOptionValue(option)];
274
346
 
275
- this.$emit('update:modelValue', value);
276
- this.$emit('change', {originalEvent: event, value: value});
347
+ this.updateModel(event, value);
348
+ isFocus && this.$refs.focusInput.focus();
349
+ index !== -1 && (this.focusedOptionIndex = index);
277
350
  },
278
- onOptionKeyDown(event, option) {
279
- let listItem = event.target;
351
+ onOptionMouseMove(event, index) {
352
+ if (this.focusOnHover) {
353
+ this.changeFocusedOptionIndex(event, index);
354
+ }
355
+ },
356
+ onOptionSelectRange(event, start = -1, end = -1) {
357
+ start === -1 && (start = this.findNearestSelectedOptionIndex(end, true));
358
+ end === -1 && (end = this.findNearestSelectedOptionIndex(start));
280
359
 
281
- switch(event.which) {
282
- //down
283
- case 40:
284
- var nextItem = this.findNextItem(listItem);
285
- if (nextItem) {
286
- nextItem.focus();
287
- }
360
+ if (start !== -1 && end !== -1) {
361
+ const rangeStart = Math.min(start, end);
362
+ const rangeEnd = Math.max(start, end);
363
+ const value = this.visibleOptions.slice(rangeStart, rangeEnd + 1).filter(option => this.isValidOption(option)).map(option => this.getOptionValue(option));
288
364
 
289
- event.preventDefault();
290
- break;
365
+ this.updateModel(event, value);
366
+ }
367
+ },
368
+ onFilterChange(event) {
369
+ const value = event.target.value;
291
370
 
292
- //up
293
- case 38:
294
- var prevItem = this.findPrevItem(listItem);
295
- if (prevItem) {
296
- prevItem.focus();
297
- }
371
+ this.filterValue = value;
372
+ this.focusedOptionIndex = -1;
373
+ this.$emit('filter', { originalEvent: event, value });
298
374
 
299
- event.preventDefault();
300
- break;
375
+ !this.virtualScrollerDisabled && this.virtualScroller.scrollToIndex(0);
376
+ },
377
+ onFilterKeyDown(event) {
378
+ switch (event.code) {
379
+ case 'ArrowDown':
380
+ this.onArrowDownKey(event);
381
+ break;
301
382
 
302
- //enter
303
- case 13:
304
- this.onOptionSelect(event, option);
305
- event.preventDefault();
306
- break;
383
+ case 'ArrowUp':
384
+ this.onArrowUpKey(event, true);
385
+ break;
386
+
387
+ case 'ArrowLeft':
388
+ case 'ArrowRight':
389
+ this.onArrowLeftKey(event, true);
390
+ break;
391
+
392
+ case 'Home':
393
+ this.onHomeKey(event, true);
394
+ break;
395
+
396
+ case 'End':
397
+ this.onEndKey(event, true);
398
+ break;
399
+
400
+ case 'Enter':
401
+ this.onEnterKey(event);
402
+ break;
403
+
404
+ case 'Escape':
405
+ this.onEscapeKey(event);
406
+ break;
407
+
408
+ case 'Tab':
409
+ this.onTabKey(event, true);
410
+ break;
307
411
  }
308
412
  },
309
- findNextItem(item) {
310
- let nextItem = item.nextElementSibling;
413
+ onFilterBlur() {
414
+ this.focusedOptionIndex = -1;
415
+ },
416
+ onFilterUpdated() {
417
+ if (this.overlayVisible) {
418
+ this.alignOverlay();
419
+ }
420
+ },
421
+ onOverlayClick(event) {
422
+ OverlayEventBus__default["default"].emit('overlay-click', {
423
+ originalEvent: event,
424
+ target: this.$el
425
+ });
426
+ },
427
+ onOverlayKeyDown(event) {
428
+ switch (event.code) {
429
+ case 'Escape':
430
+ this.onEscapeKey(event);
431
+ break;
432
+ }
433
+ },
434
+ onArrowDownKey(event) {
435
+ const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
311
436
 
312
- if (nextItem)
313
- return utils.DomHandler.hasClass(nextItem, 'p-disabled') || utils.DomHandler.hasClass(nextItem, 'p-multiselect-item-group') ? this.findNextItem(nextItem) : nextItem;
314
- else
315
- return null;
437
+ if (event.shiftKey) {
438
+ this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);
439
+ }
440
+
441
+ this.changeFocusedOptionIndex(event, optionIndex);
442
+
443
+ !this.overlayVisible && this.show();
444
+ event.preventDefault();
316
445
  },
317
- findPrevItem(item) {
318
- let prevItem = item.previousElementSibling;
446
+ onArrowUpKey(event, pressedInInputText = false) {
447
+ if (event.altKey && !pressedInInputText) {
448
+ if (this.focusedOptionIndex !== -1) {
449
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
450
+ }
319
451
 
320
- if (prevItem)
321
- return utils.DomHandler.hasClass(prevItem, 'p-disabled') || utils.DomHandler.hasClass(prevItem, 'p-multiselect-item-group') ? this.findPrevItem(prevItem) : prevItem;
322
- else
323
- return null;
452
+ this.overlayVisible && this.hide();
453
+ event.preventDefault();
454
+ }
455
+ else {
456
+ const optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();
457
+
458
+ if (event.shiftKey) {
459
+ this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);
460
+ }
461
+
462
+ this.changeFocusedOptionIndex(event, optionIndex);
463
+
464
+ !this.overlayVisible && this.show();
465
+ event.preventDefault();
466
+ }
324
467
  },
325
- onOverlayEnter(el) {
326
- utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
327
- this.alignOverlay();
468
+ onArrowLeftKey(event, pressedInInputText = false) {
469
+ pressedInInputText && (this.focusedOptionIndex = -1);
470
+ },
471
+ onHomeKey(event, pressedInInputText = false) {
472
+ if (pressedInInputText) {
473
+ event.currentTarget.setSelectionRange(0, 0);
474
+ this.focusedOptionIndex = -1;
475
+ }
476
+ else {
477
+ let metaKey = event.metaKey || event.ctrlKey;
478
+ let optionIndex = this.findFirstOptionIndex();
328
479
 
329
- if (!this.virtualScrollerDisabled) {
330
- const selectedIndex = this.getSelectedOptionIndex();
331
- if (selectedIndex !== -1) {
332
- setTimeout(() => {
333
- this.virtualScroller && this.virtualScroller.scrollToIndex(selectedIndex);
334
- }, 0);
480
+ if (event.shiftKey && metaKey) {
481
+ this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);
335
482
  }
483
+
484
+ this.changeFocusedOptionIndex(event, optionIndex);
485
+
486
+ !this.overlayVisible && this.show();
336
487
  }
488
+
489
+ event.preventDefault();
490
+ },
491
+ onEndKey(event, pressedInInputText = false) {
492
+ if (pressedInInputText) {
493
+ const target = event.currentTarget;
494
+ const len = target.value.length;
495
+ target.setSelectionRange(len, len);
496
+ this.focusedOptionIndex = -1;
497
+ }
498
+ else {
499
+ let metaKey = event.metaKey || event.ctrlKey;
500
+ let optionIndex = this.findLastOptionIndex();
501
+
502
+ if (event.shiftKey && metaKey) {
503
+ this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);
504
+ }
505
+
506
+ this.changeFocusedOptionIndex(event, optionIndex);
507
+
508
+ !this.overlayVisible && this.show();
509
+ }
510
+
511
+ event.preventDefault();
512
+ },
513
+ onPageUpKey(event) {
514
+ this.scrollInView(0);
515
+ event.preventDefault();
516
+ },
517
+ onPageDownKey(event) {
518
+ this.scrollInView(this.visibleOptions.length - 1);
519
+ event.preventDefault();
520
+ },
521
+ onEnterKey(event) {
522
+ if (!this.overlayVisible) {
523
+ this.onArrowDownKey(event);
524
+ }
525
+ else {
526
+ if (this.focusedOptionIndex !== -1) {
527
+ if (event.shiftKey)
528
+ this.onOptionSelectRange(event, this.focusedOptionIndex);
529
+ else
530
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
531
+ }
532
+ }
533
+
534
+ event.preventDefault();
535
+ },
536
+ onEscapeKey(event) {
537
+ this.overlayVisible && this.hide(true);
538
+ event.preventDefault();
539
+ },
540
+ onTabKey(event, pressedInInputText = false) {
541
+ if (!pressedInInputText) {
542
+ if (this.overlayVisible && this.hasFocusableElements()) {
543
+ this.$refs.firstHiddenFocusableElementOnOverlay.focus();
544
+
545
+ event.preventDefault();
546
+ }
547
+ else {
548
+ if (this.focusedOptionIndex !== -1) {
549
+ this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);
550
+ }
551
+
552
+ this.overlayVisible && this.hide(this.filter);
553
+ }
554
+ }
555
+ },
556
+ onShiftKey() {
557
+ this.startRangeIndex = this.focusedOptionIndex;
558
+ },
559
+ onOverlayEnter(el) {
560
+ utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
561
+ this.alignOverlay();
562
+ this.scrollInView();
337
563
  },
338
564
  onOverlayAfterEnter() {
339
565
  this.bindOutsideClickListener();
340
566
  this.bindScrollListener();
341
567
  this.bindResizeListener();
342
568
 
343
- if (this.filter) {
344
- this.$refs.filterInput.focus();
345
- }
346
-
347
569
  this.$emit('show');
348
570
  },
349
571
  onOverlayLeave() {
350
572
  this.unbindOutsideClickListener();
351
573
  this.unbindScrollListener();
352
574
  this.unbindResizeListener();
575
+
353
576
  this.$emit('hide');
354
577
  this.overlay = null;
355
578
  },
@@ -416,34 +639,9 @@ var script = {
416
639
  isOutsideClicked(event) {
417
640
  return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
418
641
  },
419
- getLabelByValue(val) {
420
- let option;
421
- if (this.options) {
422
- if (this.optionGroupLabel) {
423
- for (let optionGroup of this.options) {
424
- option = this.findOptionByValue(val, this.getOptionGroupChildren(optionGroup));
425
- if (option) {
426
- break;
427
- }
428
- }
429
- }
430
- else {
431
- option = this.findOptionByValue(val, this.options);
432
- }
433
- }
434
-
435
- return option ? this.getOptionLabel(option): null;
436
- },
437
- findOptionByValue(val, list) {
438
- for (let option of list) {
439
- let optionValue = this.getOptionValue(option);
440
-
441
- if(utils.ObjectUtils.equals(optionValue, val, this.equalityKey)) {
442
- return option;
443
- }
444
- }
445
-
446
- return null;
642
+ getLabelByValue(value) {
643
+ const matchedOption = this.visibleOptions.find(option => !this.isOptionGroup(option) && utils.ObjectUtils.equals(this.getOptionValue(option), value, this.equalityKey));
644
+ return matchedOption ? this.getOptionLabel(matchedOption): null;
447
645
  },
448
646
  getSelectedItemsLabel() {
449
647
  let pattern = /{(.*?)}/;
@@ -458,85 +656,176 @@ var script = {
458
656
  this.$emit('selectall-change', {originalEvent: event, checked: !this.allSelected});
459
657
  }
460
658
  else {
461
- let value = null;
659
+ const value = this.allSelected ? [] : this.visibleOptions.filter(option => !this.isOptionGroup(option)).map(option => this.getOptionValue(option));
660
+
661
+ this.updateModel(event, value);
662
+ }
663
+
664
+ this.headerCheckboxFocused = true;
665
+ },
666
+ removeOption(event, optionValue) {
667
+ let value = this.modelValue.filter(val => !utils.ObjectUtils.equals(val, optionValue, this.equalityKey));
462
668
 
463
- if (this.allSelected) {
464
- value = [];
669
+ this.updateModel(event, value);
670
+ },
671
+ clearFilter() {
672
+ this.filterValue = null;
673
+ },
674
+ hasFocusableElements() {
675
+ return utils.DomHandler.getFocusableElements(this.overlay, ':not(.p-hidden-focusable)').length > 0;
676
+ },
677
+ isOptionMatched(option) {
678
+ return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
679
+ },
680
+ isValidOption(option) {
681
+ return option && !(this.isOptionDisabled(option) || this.isOptionGroup(option));
682
+ },
683
+ isValidSelectedOption(option) {
684
+ return this.isValidOption(option) && this.isSelected(option);
685
+ },
686
+ isSelected(option) {
687
+ const optionValue = this.getOptionValue(option);
688
+ return (this.modelValue || []).some(value => utils.ObjectUtils.equals(value, optionValue, this.equalityKey));
689
+ },
690
+ findFirstOptionIndex() {
691
+ return this.visibleOptions.findIndex(option => this.isValidOption(option));
692
+ },
693
+ findLastOptionIndex() {
694
+ return utils.ObjectUtils.findLastIndex(this.visibleOptions, option => this.isValidOption(option));
695
+ },
696
+ findNextOptionIndex(index) {
697
+ const matchedOptionIndex = index < (this.visibleOptions.length - 1) ? this.visibleOptions.slice(index + 1).findIndex(option => this.isValidOption(option)) : -1;
698
+ return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
699
+ },
700
+ findPrevOptionIndex(index) {
701
+ const matchedOptionIndex = index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), option => this.isValidOption(option)) : -1;
702
+ return matchedOptionIndex > -1 ? matchedOptionIndex : index;
703
+ },
704
+ findFirstSelectedOptionIndex() {
705
+ return this.hasSelectedOption ? this.visibleOptions.findIndex(option => this.isValidSelectedOption(option)) : -1;
706
+ },
707
+ findLastSelectedOptionIndex() {
708
+ return this.hasSelectedOption ? utils.ObjectUtils.findLastIndex(this.visibleOptions, option => this.isValidSelectedOption(option)) : -1;
709
+ },
710
+ findNextSelectedOptionIndex(index) {
711
+ const matchedOptionIndex = this.hasSelectedOption && index < (this.visibleOptions.length - 1) ? this.visibleOptions.slice(index + 1).findIndex(option => this.isValidSelectedOption(option)) : -1;
712
+ return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : -1;
713
+ },
714
+ findPrevSelectedOptionIndex(index) {
715
+ const matchedOptionIndex = this.hasSelectedOption && index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), option => this.isValidSelectedOption(option)) : -1;
716
+ return matchedOptionIndex > -1 ? matchedOptionIndex : -1;
717
+ },
718
+ findNearestSelectedOptionIndex(index, firstCheckUp = false) {
719
+ let matchedOptionIndex = -1;
720
+
721
+ if (this.hasSelectedOption) {
722
+ if (firstCheckUp) {
723
+ matchedOptionIndex = this.findPrevSelectedOptionIndex(index);
724
+ matchedOptionIndex = matchedOptionIndex === -1 ? this.findNextSelectedOptionIndex(index) : matchedOptionIndex;
465
725
  }
466
- else if (this.visibleOptions) {
467
- if (this.optionGroupLabel) {
468
- value = [];
469
- this.visibleOptions.forEach(optionGroup => {
470
- for (let option of this.getOptionGroupChildren(optionGroup)) {
471
- value.push(this.getOptionValue(option));
472
- }
473
- });
474
- }
475
- else {
476
- value = this.visibleOptions.map(option => this.getOptionValue(option));
477
- }
726
+ else {
727
+ matchedOptionIndex = this.findNextSelectedOptionIndex(index);
728
+ matchedOptionIndex = matchedOptionIndex === -1 ? this.findPrevSelectedOptionIndex(index) : matchedOptionIndex;
478
729
  }
730
+ }
479
731
 
480
- this.$emit('update:modelValue', value);
481
- this.$emit('change', {originalEvent: event, value: value});
732
+ return matchedOptionIndex > -1 ? matchedOptionIndex : index;
733
+ },
734
+ findFirstFocusedOptionIndex() {
735
+ const selectedIndex = this.findFirstSelectedOptionIndex();
736
+ return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
737
+ },
738
+ findLastFocusedOptionIndex() {
739
+ const selectedIndex = this.findLastSelectedOptionIndex();
740
+ return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
741
+ },
742
+ searchOptions(event) {
743
+ this.searchValue = (this.searchValue || '') + event.key;
744
+
745
+ let optionIndex = -1;
746
+ if (this.focusedOptionIndex !== -1) {
747
+ optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(option => this.isOptionMatched(option));
748
+ optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(option => this.isOptionMatched(option)) : optionIndex + this.focusedOptionIndex;
749
+ }
750
+ else {
751
+ optionIndex = this.visibleOptions.findIndex(option => this.isOptionMatched(option));
752
+ }
753
+
754
+ if (optionIndex === -1 && this.focusedOptionIndex === -1) {
755
+ const selectedIndex = this.findSelectedOptionIndex();
756
+ optionIndex = selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
757
+ }
758
+
759
+ if (optionIndex !== -1) {
760
+ this.changeFocusedOptionIndex(event, optionIndex);
761
+ }
762
+
763
+ if (this.searchTimeout) {
764
+ clearTimeout(this.searchTimeout);
765
+ }
766
+
767
+ this.searchTimeout = setTimeout(() => {
768
+ this.searchValue = '';
769
+ this.searchTimeout = null;
770
+ }, 500);
771
+ },
772
+ changeFocusedOptionIndex(event, index) {
773
+ if (this.focusedOptionIndex !== index) {
774
+ this.focusedOptionIndex = index;
775
+ this.scrollInView();
482
776
  }
483
777
  },
484
- onFilterChange(event) {
485
- this.$emit('filter', {originalEvent: event, value: event.target.value});
486
- if (this.overlayVisible) {
487
- this.alignOverlay();
778
+ scrollInView(index = -1) {
779
+ const id = index !== -1 ? `${this.id}_${index}` : this.focusedOptionId;
780
+ const element = utils.DomHandler.findSingle(this.list, `li[id="${id}"]`);
781
+ if (element) {
782
+ element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'nearest' });
783
+ }
784
+ else if (!this.virtualScrollerDisabled) {
785
+ this.virtualScroller && this.virtualScroller.scrollToIndex(index !== -1 ? index : this.focusedOptionIndex);
488
786
  }
489
787
  },
490
- overlayRef(el) {
491
- this.overlay = el;
788
+ autoUpdateModel() {
789
+ if (this.selectOnFocus && this.autoOptionFocus && !this.hasSelectedOption) {
790
+ this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
791
+ const value = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);
792
+ this.updateModel(null, [value]);
793
+ }
492
794
  },
493
- virtualScrollerRef(el) {
494
- this.virtualScroller = el;
795
+ updateModel(event, value) {
796
+ this.$emit('update:modelValue', value);
797
+ this.$emit('change', { originalEvent: event, value });
495
798
  },
496
- removeChip(item) {
497
- let value = this.modelValue.filter(val => !utils.ObjectUtils.equals(val, item, this.equalityKey));
799
+ flatOptions(options) {
800
+ return (options || []).reduce((result, option, index) => {
801
+ result.push({ optionGroup: option, group: true, index });
498
802
 
499
- this.$emit('update:modelValue', value);
500
- this.$emit('change', {originalEvent: event, value: value});
803
+ const optionGroupChildren = this.getOptionGroupChildren(option);
804
+ optionGroupChildren && optionGroupChildren.forEach(o => result.push(o));
805
+
806
+ return result;
807
+ }, []);
501
808
  },
502
- onOverlayClick(event) {
503
- OverlayEventBus__default["default"].emit('overlay-click', {
504
- originalEvent: event,
505
- target: this.$el
506
- });
809
+ overlayRef(el) {
810
+ this.overlay = el;
507
811
  },
508
- clearFilter() {
509
- this.filterValue = null;
812
+ listRef(el, contentRef) {
813
+ this.list = el;
814
+ contentRef && contentRef(el); // For VirtualScroller
815
+ },
816
+ virtualScrollerRef(el) {
817
+ this.virtualScroller = el;
510
818
  }
511
819
  },
512
820
  computed: {
513
- visibleOptions() {
514
- if (this.filterValue) {
515
- if (this.optionGroupLabel) {
516
- let filteredGroups = [];
517
- for (let optgroup of this.options) {
518
- let filteredSubOptions = api.FilterService.filter(this.getOptionGroupChildren(optgroup), this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
519
- if (filteredSubOptions && filteredSubOptions.length) {
520
- filteredGroups.push({...optgroup, ...{items: filteredSubOptions}});
521
- }
522
- }
523
- return filteredGroups
524
- }
525
- else {
526
- return api.FilterService.filter(this.options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
527
- }
528
- }
529
- else {
530
- return this.options;
531
- }
532
- },
533
821
  containerClass() {
534
822
  return ['p-multiselect p-component p-inputwrapper', {
535
823
  'p-multiselect-chip': this.display === 'chip',
536
824
  'p-disabled': this.disabled,
537
825
  'p-focus': this.focused,
538
826
  'p-inputwrapper-filled': this.modelValue && this.modelValue.length,
539
- 'p-inputwrapper-focus': this.focused || this.overlayVisible
827
+ 'p-inputwrapper-focus': this.focused || this.overlayVisible,
828
+ 'p-overlay-open': this.overlayVisible
540
829
  }];
541
830
  },
542
831
  labelClass() {
@@ -545,13 +834,27 @@ var script = {
545
834
  'p-multiselect-label-empty': !this.placeholder && (!this.modelValue || this.modelValue.length === 0)
546
835
  }];
547
836
  },
837
+ dropdownIconClass() {
838
+ return ['p-multiselect-trigger-icon', this.loading ? this.loadingIcon : 'pi pi-chevron-down'];
839
+ },
548
840
  panelStyleClass() {
549
841
  return ['p-multiselect-panel p-component', this.panelClass, {
550
842
  'p-input-filled': this.$primevue.config.inputStyle === 'filled',
551
843
  'p-ripple-disabled': this.$primevue.config.ripple === false
552
844
  }];
553
845
  },
554
- label() {
846
+ headerCheckboxClass() {
847
+ return ['p-checkbox p-component', {
848
+ 'p-checkbox-checked': this.allSelected,
849
+ 'p-checkbox-focused': this.headerCheckboxFocused
850
+ }];
851
+ },
852
+ visibleOptions() {
853
+ const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
854
+
855
+ return this.filterValue ? api.FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale) : options;
856
+ },
857
+ label() { // TODO: Refactor
555
858
  let label;
556
859
 
557
860
  if (this.modelValue && this.modelValue.length) {
@@ -560,8 +863,8 @@ var script = {
560
863
  }
561
864
  else {
562
865
  label = '';
563
- for(let i = 0; i < this.modelValue.length; i++) {
564
- if(i !== 0) {
866
+ for (let i = 0; i < this.modelValue.length; i++) {
867
+ if (i !== 0) {
565
868
  label += ', ';
566
869
  }
567
870
 
@@ -576,48 +879,10 @@ var script = {
576
879
  return label;
577
880
  },
578
881
  allSelected() {
579
- if (this.selectAll !== null) {
580
- return this.selectAll;
581
- }
582
- else {
583
- if (this.filterValue && this.filterValue.trim().length > 0) {
584
- if (this.visibleOptions.length === 0) {
585
- return false;
586
- }
587
-
588
- if (this.optionGroupLabel) {
589
- for (let optionGroup of this.visibleOptions) {
590
- for (let option of this.getOptionGroupChildren(optionGroup)) {
591
- if (!this.isSelected(option)) {
592
- return false;
593
- }
594
- }
595
- }
596
- }
597
- else {
598
- for (let option of this.visibleOptions) {
599
- if (!this.isSelected(option)) {
600
- return false;
601
- }
602
- }
603
- }
604
-
605
- return true;
606
- }
607
- else {
608
- if (this.modelValue && this.options) {
609
- let optionCount = 0;
610
- if (this.optionGroupLabel)
611
- this.options.forEach(optionGroup => optionCount += this.getOptionGroupChildren(optionGroup).length);
612
- else
613
- optionCount = this.options.length;
614
-
615
- return optionCount > 0 && optionCount === this.modelValue.length;
616
- }
617
-
618
- return false;
619
- }
620
- }
882
+ return (this.selectAll !== null) ? this.selectAll : (utils.ObjectUtils.isNotEmpty(this.visibleOptions) && this.visibleOptions.every(option => this.isOptionGroup(option) || this.isValidSelectedOption(option)));
883
+ },
884
+ hasSelectedOption() {
885
+ return utils.ObjectUtils.isNotEmpty(this.modelValue);
621
886
  },
622
887
  equalityKey() {
623
888
  return this.optionValue ? null : this.dataKey;
@@ -625,20 +890,44 @@ var script = {
625
890
  searchFields() {
626
891
  return this.filterFields || [this.optionLabel];
627
892
  },
893
+ maxSelectionLimitReached() {
894
+ return this.selectionLimit && (this.modelValue && this.modelValue.length === this.selectionLimit);
895
+ },
896
+ filterResultMessageText() {
897
+ return utils.ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
898
+ },
899
+ filterMessageText() {
900
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
901
+ },
628
902
  emptyFilterMessageText() {
629
- return this.emptyFilterMessage || this.$primevue.config.locale.emptyFilterMessage;
903
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
630
904
  },
631
905
  emptyMessageText() {
632
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
906
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
633
907
  },
634
- virtualScrollerDisabled() {
635
- return !this.virtualScrollerOptions;
908
+ selectionMessageText() {
909
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
636
910
  },
637
- maxSelectionLimitReached() {
638
- return this.selectionLimit && (this.modelValue && this.modelValue.length === this.selectionLimit);
911
+ emptySelectionMessageText() {
912
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
639
913
  },
640
- dropdownIconClass() {
641
- return ['p-multiselect-trigger-icon', this.loading ? this.loadingIcon : 'pi pi-chevron-down'];
914
+ selectedMessageText() {
915
+ return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText;
916
+ },
917
+ focusedOptionId() {
918
+ return this.focusedOptionIndex !== -1 ? `${this.id}_${this.focusedOptionIndex}` : null;
919
+ },
920
+ ariaSetSize() {
921
+ return this.visibleOptions.filter(option => !this.isOptionGroup(option)).length;
922
+ },
923
+ toggleAllAriaLabel() {
924
+ return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria[this.allSelected ? 'selectAll' : 'unselectAll'] : undefined;
925
+ },
926
+ closeAriaLabel() {
927
+ return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
928
+ },
929
+ virtualScrollerDisabled() {
930
+ return !this.virtualScrollerOptions;
642
931
  }
643
932
  },
644
933
  directives: {
@@ -651,7 +940,7 @@ var script = {
651
940
  };
652
941
 
653
942
  const _hoisted_1 = { class: "p-hidden-accessible" };
654
- const _hoisted_2 = ["id", "disabled", "tabindex", "aria-expanded", "aria-labelledby"];
943
+ const _hoisted_2 = ["id", "disabled", "placeholder", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant"];
655
944
  const _hoisted_3 = { class: "p-multiselect-label-container" };
656
945
  const _hoisted_4 = { class: "p-multiselect-token-label" };
657
946
  const _hoisted_5 = ["onClick"];
@@ -660,31 +949,49 @@ const _hoisted_7 = {
660
949
  key: 0,
661
950
  class: "p-multiselect-header"
662
951
  };
663
- const _hoisted_8 = ["aria-checked"];
664
- const _hoisted_9 = { class: "p-hidden-accessible" };
665
- const _hoisted_10 = ["aria-checked"];
666
- const _hoisted_11 = {
952
+ const _hoisted_8 = { class: "p-hidden-accessible" };
953
+ const _hoisted_9 = ["checked", "aria-label"];
954
+ const _hoisted_10 = {
667
955
  key: 1,
668
956
  class: "p-multiselect-filter-container"
669
957
  };
670
- const _hoisted_12 = ["placeholder"];
671
- const _hoisted_13 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-multiselect-filter-icon pi pi-search" }, null, -1);
672
- const _hoisted_14 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-multiselect-close-icon pi pi-times" }, null, -1);
673
- const _hoisted_15 = [
674
- _hoisted_14
958
+ const _hoisted_11 = ["value", "placeholder", "aria-owns", "aria-activedescendant"];
959
+ const _hoisted_12 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-multiselect-filter-icon pi pi-search" }, null, -1);
960
+ const _hoisted_13 = {
961
+ key: 2,
962
+ role: "status",
963
+ "aria-live": "polite",
964
+ class: "p-hidden-accessible"
965
+ };
966
+ const _hoisted_14 = ["aria-label"];
967
+ const _hoisted_15 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-multiselect-close-icon pi pi-times" }, null, -1);
968
+ const _hoisted_16 = [
969
+ _hoisted_15
675
970
  ];
676
- const _hoisted_16 = ["aria-selected", "onClick", "onKeydown", "tabindex", "aria-label"];
677
- const _hoisted_17 = { class: "p-checkbox p-component" };
678
- const _hoisted_18 = { class: "p-multiselect-item-group" };
679
- const _hoisted_19 = ["aria-selected", "onClick", "onKeydown", "tabindex", "aria-label"];
971
+ const _hoisted_17 = ["id"];
972
+ const _hoisted_18 = ["id"];
973
+ const _hoisted_19 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove"];
680
974
  const _hoisted_20 = { class: "p-checkbox p-component" };
681
975
  const _hoisted_21 = {
682
- key: 2,
683
- class: "p-multiselect-empty-message"
976
+ key: 0,
977
+ class: "p-multiselect-empty-message",
978
+ role: "option"
684
979
  };
685
980
  const _hoisted_22 = {
686
- key: 3,
687
- class: "p-multiselect-empty-message"
981
+ key: 1,
982
+ class: "p-multiselect-empty-message",
983
+ role: "option"
984
+ };
985
+ const _hoisted_23 = {
986
+ key: 0,
987
+ role: "status",
988
+ "aria-live": "polite",
989
+ class: "p-hidden-accessible"
990
+ };
991
+ const _hoisted_24 = {
992
+ role: "status",
993
+ "aria-live": "polite",
994
+ class: "p-hidden-accessible"
688
995
  };
689
996
 
690
997
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -695,24 +1002,28 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
695
1002
  return (vue.openBlock(), vue.createElementBlock("div", {
696
1003
  ref: "container",
697
1004
  class: vue.normalizeClass($options.containerClass),
698
- onClick: _cache[10] || (_cache[10] = (...args) => ($options.onClick && $options.onClick(...args)))
1005
+ onClick: _cache[15] || (_cache[15] = (...args) => ($options.onContainerClick && $options.onContainerClick(...args)))
699
1006
  }, [
700
1007
  vue.createElementVNode("div", _hoisted_1, [
701
- vue.createElementVNode("input", {
1008
+ vue.createElementVNode("input", vue.mergeProps({
702
1009
  ref: "focusInput",
703
- type: "text",
704
- role: "listbox",
705
1010
  id: $props.inputId,
1011
+ type: "text",
706
1012
  readonly: "",
707
1013
  disabled: $props.disabled,
1014
+ placeholder: $props.placeholder,
1015
+ tabindex: !$props.disabled ? $props.tabindex : -1,
1016
+ role: "combobox",
1017
+ "aria-label": _ctx.ariaLabel,
1018
+ "aria-labelledby": _ctx.ariaLabelledby,
1019
+ "aria-haspopup": "listbox",
1020
+ "aria-expanded": $data.overlayVisible,
1021
+ "aria-controls": $data.id + '_list',
1022
+ "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
708
1023
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
709
1024
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
710
- onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
711
- tabindex: $props.tabindex,
712
- "aria-haspopup": "true",
713
- "aria-expanded": $data.overlayVisible,
714
- "aria-labelledby": $props.ariaLabelledBy
715
- }, null, 40, _hoisted_2)
1025
+ onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args)))
1026
+ }, $props.inputProps), null, 16, _hoisted_2)
716
1027
  ]),
717
1028
  vue.createElementVNode("div", _hoisted_3, [
718
1029
  vue.createElementVNode("div", {
@@ -740,7 +1051,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
740
1051
  ? (vue.openBlock(), vue.createElementBlock("span", {
741
1052
  key: 0,
742
1053
  class: "p-multiselect-token-icon pi pi-times-circle",
743
- onClick: $event => ($options.removeChip(item))
1054
+ onClick: $event => ($options.removeOption($event, item))
744
1055
  }, null, 8, _hoisted_5))
745
1056
  : vue.createCommentVNode("", true)
746
1057
  ]))
@@ -758,7 +1069,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
758
1069
  vue.createElementVNode("div", _hoisted_6, [
759
1070
  vue.renderSlot(_ctx.$slots, "indicator", {}, () => [
760
1071
  vue.createElementVNode("span", {
761
- class: vue.normalizeClass($options.dropdownIconClass)
1072
+ class: vue.normalizeClass($options.dropdownIconClass),
1073
+ "aria-hidden": "true"
762
1074
  }, null, 2)
763
1075
  ])
764
1076
  ]),
@@ -773,12 +1085,22 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
773
1085
  }, {
774
1086
  default: vue.withCtx(() => [
775
1087
  ($data.overlayVisible)
776
- ? (vue.openBlock(), vue.createElementBlock("div", {
1088
+ ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
777
1089
  key: 0,
778
1090
  ref: $options.overlayRef,
779
- class: vue.normalizeClass($options.panelStyleClass),
780
- onClick: _cache[9] || (_cache[9] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
781
- }, [
1091
+ style: $props.panelStyle,
1092
+ class: $options.panelStyleClass,
1093
+ onClick: _cache[13] || (_cache[13] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args))),
1094
+ onKeydown: _cache[14] || (_cache[14] = (...args) => ($options.onOverlayKeyDown && $options.onOverlayKeyDown(...args)))
1095
+ }, $props.panelProps), [
1096
+ vue.createElementVNode("span", {
1097
+ ref: "firstHiddenFocusableElementOnOverlay",
1098
+ role: "presentation",
1099
+ "aria-hidden": "true",
1100
+ class: "p-hidden-accessible p-hidden-focusable",
1101
+ tabindex: 0,
1102
+ onFocus: _cache[3] || (_cache[3] = (...args) => ($options.onFirstHiddenFocus && $options.onFirstHiddenFocus(...args)))
1103
+ }, null, 544),
782
1104
  vue.renderSlot(_ctx.$slots, "header", {
783
1105
  value: $props.modelValue,
784
1106
  options: $options.visibleOptions
@@ -788,51 +1110,57 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
788
1110
  ($props.showToggleAll && $props.selectionLimit == null)
789
1111
  ? (vue.openBlock(), vue.createElementBlock("div", {
790
1112
  key: 0,
791
- class: "p-checkbox p-component",
792
- onClick: _cache[5] || (_cache[5] = (...args) => ($options.onToggleAll && $options.onToggleAll(...args))),
793
- role: "checkbox",
794
- "aria-checked": $options.allSelected
1113
+ class: vue.normalizeClass($options.headerCheckboxClass),
1114
+ onClick: _cache[6] || (_cache[6] = (...args) => ($options.onToggleAll && $options.onToggleAll(...args)))
795
1115
  }, [
796
- vue.createElementVNode("div", _hoisted_9, [
1116
+ vue.createElementVNode("div", _hoisted_8, [
797
1117
  vue.createElementVNode("input", {
798
1118
  type: "checkbox",
799
1119
  readonly: "",
800
- onFocus: _cache[3] || (_cache[3] = (...args) => ($options.onHeaderCheckboxFocus && $options.onHeaderCheckboxFocus(...args))),
801
- onBlur: _cache[4] || (_cache[4] = (...args) => ($options.onHeaderCheckboxBlur && $options.onHeaderCheckboxBlur(...args)))
802
- }, null, 32)
1120
+ checked: $options.allSelected,
1121
+ "aria-label": $options.toggleAllAriaLabel,
1122
+ onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onHeaderCheckboxFocus && $options.onHeaderCheckboxFocus(...args))),
1123
+ onBlur: _cache[5] || (_cache[5] = (...args) => ($options.onHeaderCheckboxBlur && $options.onHeaderCheckboxBlur(...args)))
1124
+ }, null, 40, _hoisted_9)
803
1125
  ]),
804
1126
  vue.createElementVNode("div", {
805
- class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.allSelected, 'p-focus': $data.headerCheckboxFocused}]),
806
- role: "checkbox",
807
- "aria-checked": $options.allSelected
1127
+ class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.allSelected, 'p-focus': $data.headerCheckboxFocused}])
808
1128
  }, [
809
1129
  vue.createElementVNode("span", {
810
1130
  class: vue.normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.allSelected}])
811
1131
  }, null, 2)
812
- ], 10, _hoisted_10)
813
- ], 8, _hoisted_8))
1132
+ ], 2)
1133
+ ], 2))
814
1134
  : vue.createCommentVNode("", true),
815
1135
  ($props.filter)
816
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
817
- vue.withDirectives(vue.createElementVNode("input", {
1136
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
1137
+ vue.createElementVNode("input", vue.mergeProps({
818
1138
  type: "text",
819
1139
  ref: "filterInput",
820
- "onUpdate:modelValue": _cache[6] || (_cache[6] = $event => (($data.filterValue) = $event)),
821
- autoComplete: "on",
1140
+ value: $data.filterValue,
1141
+ onVnodeUpdated: _cache[7] || (_cache[7] = (...args) => ($options.onFilterUpdated && $options.onFilterUpdated(...args))),
822
1142
  class: "p-multiselect-filter p-inputtext p-component",
823
1143
  placeholder: $props.filterPlaceholder,
824
- onInput: _cache[7] || (_cache[7] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
825
- }, null, 40, _hoisted_12), [
826
- [vue.vModelText, $data.filterValue]
827
- ]),
828
- _hoisted_13
1144
+ role: "searchbox",
1145
+ autocomplete: "off",
1146
+ "aria-owns": $data.id + '_list',
1147
+ "aria-activedescendant": $options.focusedOptionId,
1148
+ onKeydown: _cache[8] || (_cache[8] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),
1149
+ onBlur: _cache[9] || (_cache[9] = (...args) => ($options.onFilterBlur && $options.onFilterBlur(...args))),
1150
+ onInput: _cache[10] || (_cache[10] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
1151
+ }, $props.filterInputProps), null, 16, _hoisted_11),
1152
+ _hoisted_12
829
1153
  ]))
830
1154
  : vue.createCommentVNode("", true),
831
- vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
1155
+ ($props.filter)
1156
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_13, vue.toDisplayString($options.filterResultMessageText), 1))
1157
+ : vue.createCommentVNode("", true),
1158
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
832
1159
  class: "p-multiselect-close p-link",
833
- onClick: _cache[8] || (_cache[8] = (...args) => ($options.onCloseClick && $options.onCloseClick(...args))),
1160
+ "aria-label": $options.closeAriaLabel,
1161
+ onClick: _cache[11] || (_cache[11] = (...args) => ($options.onCloseClick && $options.onCloseClick(...args))),
834
1162
  type: "button"
835
- }, _hoisted_15)), [
1163
+ }, $props.closeButtonProps), _hoisted_16, 16, _hoisted_14)), [
836
1164
  [_directive_ripple]
837
1165
  ])
838
1166
  ]))
@@ -844,91 +1172,71 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
844
1172
  vue.createVNode(_component_VirtualScroller, vue.mergeProps({ ref: $options.virtualScrollerRef }, $props.virtualScrollerOptions, {
845
1173
  items: $options.visibleOptions,
846
1174
  style: {'height': $props.scrollHeight},
1175
+ tabindex: -1,
847
1176
  disabled: $options.virtualScrollerDisabled
848
1177
  }), vue.createSlots({
849
- content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle}) => [
1178
+ content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }) => [
850
1179
  vue.createElementVNode("ul", {
851
- ref: contentRef,
1180
+ ref: (el) => $options.listRef(el, contentRef),
1181
+ id: $data.id + '_list',
852
1182
  class: vue.normalizeClass(['p-multiselect-items p-component', styleClass]),
853
1183
  style: vue.normalizeStyle(contentStyle),
854
1184
  role: "listbox",
855
1185
  "aria-multiselectable": "true"
856
1186
  }, [
857
- (!$props.optionGroupLabel)
858
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(items, (option, i) => {
859
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
860
- class: vue.normalizeClass(['p-multiselect-item', {'p-highlight': $options.isSelected(option), 'p-disabled': $options.isOptionDisabled(option)}]),
861
- role: "option",
862
- "aria-selected": $options.isSelected(option),
863
- key: $options.getOptionRenderKey(option),
864
- onClick: $event => ($options.onOptionSelect($event, option)),
865
- onKeydown: $event => ($options.onOptionKeyDown($event, option)),
866
- tabindex: $props.tabindex||'0',
867
- "aria-label": $options.getOptionLabel(option)
868
- }, [
869
- vue.createElementVNode("div", _hoisted_17, [
870
- vue.createElementVNode("div", {
871
- class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.isSelected(option)}])
872
- }, [
873
- vue.createElementVNode("span", {
874
- class: vue.normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.isSelected(option)}])
875
- }, null, 2)
876
- ], 2)
877
- ]),
878
- vue.renderSlot(_ctx.$slots, "option", {
879
- option: option,
880
- index: $options.getOptionIndex(i, getItemOptions)
881
- }, () => [
882
- vue.createElementVNode("span", null, vue.toDisplayString($options.getOptionLabel(option)), 1)
883
- ])
884
- ], 42, _hoisted_16)), [
885
- [_directive_ripple]
886
- ])
887
- }), 128))
888
- : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(items, (optionGroup, i) => {
889
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
890
- key: $options.getOptionGroupRenderKey(optionGroup)
891
- }, [
892
- vue.createElementVNode("li", _hoisted_18, [
1187
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (option, i) => {
1188
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
1189
+ key: $options.getOptionRenderKey(option, $options.getOptionIndex(i, getItemOptions))
1190
+ }, [
1191
+ ($options.isOptionGroup(option))
1192
+ ? (vue.openBlock(), vue.createElementBlock("li", {
1193
+ key: 0,
1194
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1195
+ style: vue.normalizeStyle({height: itemSize ? itemSize + 'px' : undefined}),
1196
+ class: "p-multiselect-item-group",
1197
+ role: "option"
1198
+ }, [
893
1199
  vue.renderSlot(_ctx.$slots, "optiongroup", {
894
- option: optionGroup,
1200
+ option: option.optionGroup,
895
1201
  index: $options.getOptionIndex(i, getItemOptions)
896
1202
  }, () => [
897
- vue.createTextVNode(vue.toDisplayString($options.getOptionGroupLabel(optionGroup)), 1)
1203
+ vue.createTextVNode(vue.toDisplayString($options.getOptionGroupLabel(option.optionGroup)), 1)
898
1204
  ])
899
- ]),
900
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.getOptionGroupChildren(optionGroup), (option, i) => {
901
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
902
- class: vue.normalizeClass(['p-multiselect-item', {'p-highlight': $options.isSelected(option), 'p-disabled': $options.isOptionDisabled(option)}]),
903
- role: "option",
904
- "aria-selected": $options.isSelected(option),
905
- key: $options.getOptionRenderKey(option),
906
- onClick: $event => ($options.onOptionSelect($event, option)),
907
- onKeydown: $event => ($options.onOptionKeyDown($event, option)),
908
- tabindex: $props.tabindex||'0',
909
- "aria-label": $options.getOptionLabel(option)
910
- }, [
911
- vue.createElementVNode("div", _hoisted_20, [
912
- vue.createElementVNode("div", {
913
- class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.isSelected(option)}])
914
- }, [
915
- vue.createElementVNode("span", {
916
- class: vue.normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.isSelected(option)}])
917
- }, null, 2)
918
- ], 2)
919
- ]),
920
- vue.renderSlot(_ctx.$slots, "option", {
921
- option: option,
922
- index: $options.getOptionIndex(i, getItemOptions)
923
- }, () => [
924
- vue.createElementVNode("span", null, vue.toDisplayString($options.getOptionLabel(option)), 1)
925
- ])
926
- ], 42, _hoisted_19)), [
927
- [_directive_ripple]
1205
+ ], 12, _hoisted_18))
1206
+ : vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
1207
+ key: 1,
1208
+ id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),
1209
+ style: vue.normalizeStyle({height: itemSize ? itemSize + 'px' : undefined}),
1210
+ class: vue.normalizeClass(['p-multiselect-item', {'p-highlight': $options.isSelected(option), 'p-focus': $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions), 'p-disabled': $options.isOptionDisabled(option)}]),
1211
+ role: "option",
1212
+ "aria-label": $options.getOptionLabel(option),
1213
+ "aria-selected": $options.isSelected(option),
1214
+ "aria-disabled": $options.isOptionDisabled(option),
1215
+ "aria-setsize": $options.ariaSetSize,
1216
+ "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),
1217
+ onClick: $event => ($options.onOptionSelect($event, option, $options.getOptionIndex(i, getItemOptions), true)),
1218
+ onMousemove: $event => ($options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions)))
1219
+ }, [
1220
+ vue.createElementVNode("div", _hoisted_20, [
1221
+ vue.createElementVNode("div", {
1222
+ class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.isSelected(option)}])
1223
+ }, [
1224
+ vue.createElementVNode("span", {
1225
+ class: vue.normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.isSelected(option)}])
1226
+ }, null, 2)
1227
+ ], 2)
1228
+ ]),
1229
+ vue.renderSlot(_ctx.$slots, "option", {
1230
+ option: option,
1231
+ index: $options.getOptionIndex(i, getItemOptions)
1232
+ }, () => [
1233
+ vue.createElementVNode("span", null, vue.toDisplayString($options.getOptionLabel(option)), 1)
928
1234
  ])
929
- }), 128))
930
- ], 64))
931
- }), 128)),
1235
+ ], 46, _hoisted_19)), [
1236
+ [_directive_ripple]
1237
+ ])
1238
+ ], 64))
1239
+ }), 128)),
932
1240
  ($data.filterValue && (!items || (items && items.length === 0)))
933
1241
  ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_21, [
934
1242
  vue.renderSlot(_ctx.$slots, "emptyfilter", {}, () => [
@@ -942,7 +1250,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
942
1250
  ])
943
1251
  ]))
944
1252
  : vue.createCommentVNode("", true)
945
- ], 6)
1253
+ ], 14, _hoisted_17),
1254
+ ((!$props.options || ($props.options && $props.options.length === 0)))
1255
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_23, vue.toDisplayString($options.emptyMessageText), 1))
1256
+ : vue.createCommentVNode("", true),
1257
+ vue.createElementVNode("span", _hoisted_24, vue.toDisplayString($options.selectedMessageText), 1)
946
1258
  ]),
947
1259
  _: 2
948
1260
  }, [
@@ -959,8 +1271,16 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
959
1271
  vue.renderSlot(_ctx.$slots, "footer", {
960
1272
  value: $props.modelValue,
961
1273
  options: $options.visibleOptions
962
- })
963
- ], 2))
1274
+ }),
1275
+ vue.createElementVNode("span", {
1276
+ ref: "lastHiddenFocusableElementOnOverlay",
1277
+ role: "presentation",
1278
+ "aria-hidden": "true",
1279
+ class: "p-hidden-accessible p-hidden-focusable",
1280
+ tabindex: 0,
1281
+ onFocus: _cache[12] || (_cache[12] = (...args) => ($options.onLastHiddenFocus && $options.onLastHiddenFocus(...args)))
1282
+ }, null, 544)
1283
+ ], 16))
964
1284
  : vue.createCommentVNode("", true)
965
1285
  ]),
966
1286
  _: 3