primevue 3.15.0 → 3.16.2

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