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
@@ -4,14 +4,15 @@ this.primevue.checkbox = (function (utils, vue) {
4
4
 
5
5
  var script = {
6
6
  name: 'Checkbox',
7
- inheritAttrs: false,
8
- emits: ['click', 'update:modelValue', 'change', 'input'],
7
+ emits: ['click', 'update:modelValue', 'change', 'input', 'focus', 'blur'],
9
8
  props: {
10
9
  value: null,
11
10
  modelValue: null,
12
11
  binary: Boolean,
13
- class: null,
14
- style: null,
12
+ name: {
13
+ type: String,
14
+ default: null
15
+ },
15
16
  trueValue: {
16
17
  type: null,
17
18
  default: true
@@ -19,16 +20,44 @@ this.primevue.checkbox = (function (utils, vue) {
19
20
  falseValue: {
20
21
  type: null,
21
22
  default: false
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ readonly: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ required: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ tabindex: {
37
+ type: Number,
38
+ default: null
39
+ },
40
+ inputId: null,
41
+ inputClass: null,
42
+ inputStyle: null,
43
+ inputProps: null,
44
+ 'aria-labelledby': {
45
+ type: String,
46
+ default: null
47
+ },
48
+ 'aria-label': {
49
+ type: String,
50
+ default: null
22
51
  }
23
52
  },
24
53
  data() {
25
54
  return {
26
55
  focused: false
27
- };
56
+ }
28
57
  },
29
58
  methods: {
30
59
  onClick(event) {
31
- if (!this.$attrs.disabled) {
60
+ if (!this.disabled) {
32
61
  let newModelValue;
33
62
 
34
63
  if (this.binary) {
@@ -48,11 +77,13 @@ this.primevue.checkbox = (function (utils, vue) {
48
77
  this.$refs.input.focus();
49
78
  }
50
79
  },
51
- onFocus() {
80
+ onFocus(event) {
52
81
  this.focused = true;
82
+ this.$emit('focus', event);
53
83
  },
54
- onBlur() {
84
+ onBlur(event) {
55
85
  this.focused = false;
86
+ this.$emit('blur', event);
56
87
  }
57
88
  },
58
89
  computed: {
@@ -60,43 +91,53 @@ this.primevue.checkbox = (function (utils, vue) {
60
91
  return this.binary ? this.modelValue === this.trueValue : utils.ObjectUtils.contains(this.value, this.modelValue);
61
92
  },
62
93
  containerClass() {
63
- return ['p-checkbox p-component', this.class, {'p-checkbox-checked': this.checked, 'p-checkbox-disabled': this.$attrs.disabled, 'p-checkbox-focused': this.focused}];
94
+ return [
95
+ 'p-checkbox p-component', {
96
+ 'p-checkbox-checked': this.checked,
97
+ 'p-checkbox-disabled': this.disabled,
98
+ 'p-checkbox-focused': this.focused
99
+ }];
64
100
  }
65
101
  }
66
102
  };
67
103
 
68
104
  const _hoisted_1 = { class: "p-hidden-accessible" };
69
- const _hoisted_2 = ["checked", "value"];
70
- const _hoisted_3 = ["aria-checked"];
105
+ const _hoisted_2 = ["id", "value", "name", "checked", "tabindex", "disabled", "readonly", "required", "aria-labelledby", "aria-label"];
71
106
 
72
107
  function render(_ctx, _cache, $props, $setup, $data, $options) {
73
108
  return (vue.openBlock(), vue.createElementBlock("div", {
74
109
  class: vue.normalizeClass($options.containerClass),
75
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
76
- style: vue.normalizeStyle($props.style)
110
+ onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
77
111
  }, [
78
112
  vue.createElementVNode("div", _hoisted_1, [
79
113
  vue.createElementVNode("input", vue.mergeProps({
114
+ id: $props.inputId,
80
115
  ref: "input",
81
116
  type: "checkbox",
117
+ value: $props.value,
118
+ class: $props.inputClass,
119
+ style: $props.inputStyle,
120
+ name: $props.name,
82
121
  checked: $options.checked,
83
- value: $props.value
84
- }, _ctx.$attrs, {
85
- onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
86
- onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
87
- }), null, 16, _hoisted_2)
122
+ tabindex: $props.tabindex,
123
+ disabled: $props.disabled,
124
+ readonly: $props.readonly,
125
+ required: $props.required,
126
+ "aria-labelledby": _ctx.ariaLabelledby,
127
+ "aria-label": _ctx.ariaLabel,
128
+ onFocus: _cache[0] || (_cache[0] = $event => ($options.onFocus($event))),
129
+ onBlur: _cache[1] || (_cache[1] = $event => ($options.onBlur($event)))
130
+ }, $props.inputProps), null, 16, _hoisted_2)
88
131
  ]),
89
132
  vue.createElementVNode("div", {
90
133
  ref: "box",
91
- class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.checked, 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
92
- role: "checkbox",
93
- "aria-checked": $options.checked
134
+ class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
94
135
  }, [
95
136
  vue.createElementVNode("span", {
96
137
  class: vue.normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.checked}])
97
138
  }, null, 2)
98
- ], 10, _hoisted_3)
99
- ], 6))
139
+ ], 2)
140
+ ], 2))
100
141
  }
101
142
 
102
143
  script.render = render;
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.checkbox=function(e,t){"use strict";var l={name:"Checkbox",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{value:null,modelValue:null,binary:Boolean,class:null,style:null,trueValue:{type:null,default:!0},falseValue:{type:null,default:!1}},data:()=>({focused:!1}),methods:{onClick(t){if(!this.$attrs.disabled){let l;l=this.binary?this.checked?this.falseValue:this.trueValue:this.checked?this.modelValue.filter((t=>!e.ObjectUtils.equals(t,this.value))):this.modelValue?[...this.modelValue,this.value]:[this.value],this.$emit("click",t),this.$emit("update:modelValue",l),this.$emit("change",t),this.$emit("input",l),this.$refs.input.focus()}},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{checked(){return this.binary?this.modelValue===this.trueValue:e.ObjectUtils.contains(this.value,this.modelValue)},containerClass(){return["p-checkbox p-component",this.class,{"p-checkbox-checked":this.checked,"p-checkbox-disabled":this.$attrs.disabled,"p-checkbox-focused":this.focused}]}}};const s={class:"p-hidden-accessible"},c=["checked","value"],i=["aria-checked"];return l.render=function(e,l,a,u,o,h){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(h.containerClass),onClick:l[2]||(l[2]=e=>h.onClick(e)),style:t.normalizeStyle(a.style)},[t.createElementVNode("div",s,[t.createElementVNode("input",t.mergeProps({ref:"input",type:"checkbox",checked:h.checked,value:a.value},e.$attrs,{onFocus:l[0]||(l[0]=(...e)=>h.onFocus&&h.onFocus(...e)),onBlur:l[1]||(l[1]=(...e)=>h.onBlur&&h.onBlur(...e))}),null,16,c)]),t.createElementVNode("div",{ref:"box",class:t.normalizeClass(["p-checkbox-box",{"p-highlight":h.checked,"p-disabled":e.$attrs.disabled,"p-focus":o.focused}]),role:"checkbox","aria-checked":h.checked},[t.createElementVNode("span",{class:t.normalizeClass(["p-checkbox-icon",{"pi pi-check":h.checked}])},null,2)],10,i)],6)},l}(primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.checkbox=function(e,l){"use strict";var t={name:"Checkbox",emits:["click","update:modelValue","change","input","focus","blur"],props:{value:null,modelValue:null,binary:Boolean,name:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:null,inputClass:null,inputStyle:null,inputProps:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{onClick(l){if(!this.disabled){let t;t=this.binary?this.checked?this.falseValue:this.trueValue:this.checked?this.modelValue.filter((l=>!e.ObjectUtils.equals(l,this.value))):this.modelValue?[...this.modelValue,this.value]:[this.value],this.$emit("click",l),this.$emit("update:modelValue",t),this.$emit("change",l),this.$emit("input",t),this.$refs.input.focus()}},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return this.binary?this.modelValue===this.trueValue:e.ObjectUtils.contains(this.value,this.modelValue)},containerClass(){return["p-checkbox p-component",{"p-checkbox-checked":this.checked,"p-checkbox-disabled":this.disabled,"p-checkbox-focused":this.focused}]}}};const a={class:"p-hidden-accessible"},i=["id","value","name","checked","tabindex","disabled","readonly","required","aria-labelledby","aria-label"];return t.render=function(e,t,u,s,n,c){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(c.containerClass),onClick:t[2]||(t[2]=e=>c.onClick(e))},[l.createElementVNode("div",a,[l.createElementVNode("input",l.mergeProps({id:u.inputId,ref:"input",type:"checkbox",value:u.value,class:u.inputClass,style:u.inputStyle,name:u.name,checked:c.checked,tabindex:u.tabindex,disabled:u.disabled,readonly:u.readonly,required:u.required,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:t[0]||(t[0]=e=>c.onFocus(e)),onBlur:t[1]||(t[1]=e=>c.onBlur(e))},u.inputProps),null,16,i)]),l.createElementVNode("div",{ref:"box",class:l.normalizeClass(["p-checkbox-box",{"p-highlight":c.checked,"p-disabled":u.disabled,"p-focus":n.focused}])},[l.createElementVNode("span",{class:l.normalizeClass(["p-checkbox-icon",{"pi pi-check":c.checked}])},null,2)],2)],2)},t}(primevue.utils,Vue);
package/chips/Chips.d.ts CHANGED
@@ -40,13 +40,37 @@ export interface ChipsProps {
40
40
  */
41
41
  separator?: string | undefined;
42
42
  /**
43
- * Style class of the component input field.
43
+ * Identifier of the focus input to match a label defined for the chips.
44
44
  */
45
- class?: any;
45
+ inputId?: string | undefined;
46
46
  /**
47
- * Inline style of the component.
47
+ * Style class of the input field.
48
48
  */
49
- style?: any;
49
+ inputClass?: any | undefined;
50
+ /**
51
+ * Inline style of the input field.
52
+ */
53
+ inputStyle?: any | undefined;
54
+ /**
55
+ * Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
56
+ */
57
+ inputProps?: HTMLInputElement | undefined;
58
+ /**
59
+ * When present, it specifies that the element should be disabled.
60
+ */
61
+ disabled?: boolean | undefined;
62
+ /**
63
+ * Placeholder text for the input.
64
+ */
65
+ placeholder?: string | undefined;
66
+ /**
67
+ * Establishes relationships between the component and label(s) where its value should be one or more element IDs.
68
+ */
69
+ 'aria-labelledby'?: string | undefined;
70
+ /**
71
+ * Establishes a string value that labels the component.
72
+ */
73
+ 'aria-label'?: string | undefined;
50
74
  }
51
75
 
52
76
  export interface ChipsSlots {
@@ -68,15 +92,15 @@ export declare type ChipsEmits = {
68
92
  * @param {*} value - New value.
69
93
  */
70
94
  'update:modelValue': (value: any[]) => void;
71
- /**
72
- * Callback to invoke when a chip is added.
73
- * @param {ChipsAddEvent} event - Custom add event.
74
- */
95
+ /**
96
+ * Callback to invoke when a chip is added.
97
+ * @param {ChipsAddEvent} event - Custom add event.
98
+ */
75
99
  'add': (event: ChipsAddEvent) => void;
76
- /**
77
- * Callback to invoke when a chip is removed.
78
- * @param {ChipsRemoveEvent} event - Custom remove event.
79
- */
100
+ /**
101
+ * Callback to invoke when a chip is removed.
102
+ * @param {ChipsRemoveEvent} event - Custom remove event.
103
+ */
80
104
  'remove': (event: ChipsRemoveEvent) => void;
81
105
  }
82
106
 
package/chips/Chips.vue CHANGED
@@ -1,25 +1,28 @@
1
1
  <template>
2
- <div :class="containerClass" :style="style">
3
- <ul :class="['p-inputtext p-chips-multiple-container', {'p-disabled': $attrs.disabled, 'p-focus': focused}]" @click="onWrapperClick()">
4
- <li v-for="(val,i) of modelValue" :key="`${i}_${val}`" class="p-chips-token">
2
+ <div :class="containerClass">
3
+ <ul ref="container" class="p-inputtext p-chips-multiple-container" tabindex="-1" role="listbox" aria-orientation="horizontal" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" :aria-activedescendant="focused ? focusedOptionId : undefined"
4
+ @click="onWrapperClick()" @focus="onContainerFocus" @blur="onContainerBlur" @keydown="onContainerKeyDown">
5
+ <li v-for="(val,i) of modelValue" :key="`${i}_${val}`" :id="id + '_chips_item_' + i" role="option" :class="['p-chips-token', {'p-focus': focusedIndex === i}]"
6
+ :aria-label="val" :aria-selected="true" :aria-setsize="modelValue.length" :aria-posinset="i + 1">
5
7
  <slot name="chip" :value="val">
6
8
  <span class="p-chips-token-label">{{val}}</span>
7
9
  </slot>
8
- <span class="p-chips-token-icon pi pi-times-circle" @click="removeItem($event, i)"></span>
10
+ <span class="p-chips-token-icon pi pi-times-circle" @click="removeItem($event, i)" aria-hidden="true"></span>
9
11
  </li>
10
- <li class="p-chips-input-token">
11
- <input ref="input" type="text" v-bind="$attrs" @focus="onFocus" @blur="onBlur($event)" @input="onInput" @keydown="onKeyDown($event)" @paste="onPaste($event)"
12
- :disabled="$attrs.disabled || maxedOut">
12
+ <li class="p-chips-input-token" role="option">
13
+ <input ref="input" type="text" :id="inputId" :class="inputClass" :style="inputStyle" :disabled="disabled || maxedOut" :placeholder="placeholder"
14
+ @focus="onFocus($event)" @blur="onBlur($event)" @input="onInput" @keydown="onKeyDown($event)" @paste="onPaste($event)" v-bind="inputProps">
13
15
  </li>
14
16
  </ul>
15
17
  </div>
16
18
  </template>
17
19
 
18
20
  <script>
21
+ import {UniqueComponentId} from 'primevue/utils';
22
+
19
23
  export default {
20
24
  name: 'Chips',
21
- inheritAttrs: false,
22
- emits: ['update:modelValue', 'add', 'remove'],
25
+ emits: ['update:modelValue', 'add', 'remove', 'focus', 'blur'],
23
26
  props: {
24
27
  modelValue: {
25
28
  type: Array,
@@ -41,13 +44,33 @@ export default {
41
44
  type: Boolean,
42
45
  default: true
43
46
  },
44
- class: null,
45
- style: null
47
+ placeholder: {
48
+ type: String,
49
+ default: null
50
+ },
51
+ inputId: null,
52
+ inputClass: null,
53
+ inputStyle: null,
54
+ inputProps: null,
55
+ disabled: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ 'aria-labelledby': {
60
+ type: String,
61
+ default: null
62
+ },
63
+ 'aria-label': {
64
+ type: String,
65
+ default: null
66
+ }
46
67
  },
47
68
  data() {
48
69
  return {
70
+ id: UniqueComponentId(),
49
71
  inputValue: null,
50
- focused: false
72
+ focused: false,
73
+ focusedIndex: null
51
74
  };
52
75
  },
53
76
  methods: {
@@ -56,37 +79,53 @@ export default {
56
79
  },
57
80
  onInput(event) {
58
81
  this.inputValue = event.target.value;
82
+ this.focusedIndex = null;
59
83
  },
60
- onFocus() {
84
+ onFocus(event) {
61
85
  this.focused = true;
86
+ this.focusedIndex = null;
87
+ this.$emit('focus', event);
62
88
  },
63
89
  onBlur(event) {
64
90
  this.focused = false;
91
+ this.focusedIndex = null;
65
92
  if (this.addOnBlur) {
66
93
  this.addItem(event, event.target.value, false);
67
94
  }
95
+ this.$emit('blur', event);
68
96
  },
69
97
  onKeyDown(event) {
70
98
  const inputValue = event.target.value;
71
99
 
72
- switch(event.which) {
73
- //backspace
74
- case 8:
100
+ switch(event.code) {
101
+ case 'Backspace':
75
102
  if (inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
76
- this.removeItem(event, this.modelValue.length - 1);
103
+ if (this.focusedIndex !== null) {
104
+ this.removeItem(event, this.focusedIndex);
105
+ }
106
+ else this.removeItem(event, this.modelValue.length - 1);
77
107
  }
78
108
  break;
79
109
 
80
- //enter
81
- case 13:
110
+ case 'Enter':
82
111
  if (inputValue && inputValue.trim().length && !this.maxedOut) {
83
112
  this.addItem(event, inputValue, true);
84
113
  }
85
114
  break;
86
115
 
116
+ case 'ArrowLeft':
117
+ if (inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
118
+ this.$refs.container.focus();
119
+ }
120
+ break;
121
+
122
+ case 'ArrowRight':
123
+ event.stopPropagation();
124
+ break;
125
+
87
126
  default:
88
127
  if (this.separator) {
89
- if (this.separator === ',' && (event.which === 188 || event.which === 110)) {
128
+ if (this.separator === ',' && event.key === ',') {
90
129
  this.addItem(event, inputValue, true);
91
130
  }
92
131
  }
@@ -105,6 +144,54 @@ export default {
105
144
  }
106
145
  }
107
146
  },
147
+ onContainerFocus() {
148
+ this.focused = true;
149
+ },
150
+ onContainerBlur() {
151
+ this.focusedIndex = -1;
152
+ this.focused = false;
153
+ },
154
+ onContainerKeyDown(event) {
155
+ switch (event.code) {
156
+ case 'ArrowLeft':
157
+ this.onArrowLeftKeyOn(event);
158
+ break;
159
+
160
+ case 'ArrowRight':
161
+ this.onArrowRightKeyOn(event);
162
+ break;
163
+
164
+ case 'Backspace':
165
+ this.onBackspaceKeyOn(event);
166
+ break;
167
+
168
+ default:
169
+ break;
170
+ }
171
+ },
172
+ onArrowLeftKeyOn() {
173
+ if (this.inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
174
+ this.focusedIndex = this.focusedIndex === null ? this.modelValue.length - 1 : this.focusedIndex - 1;
175
+ if (this.focusedIndex < 0) this.focusedIndex = 0;
176
+ }
177
+ },
178
+ onArrowRightKeyOn() {
179
+ if (this.inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
180
+
181
+ if (this.focusedIndex === this.modelValue.length - 1) {
182
+ this.focusedIndex = null;
183
+ this.$refs.input.focus();
184
+ }
185
+ else {
186
+ this.focusedIndex++;
187
+ }
188
+ }
189
+ },
190
+ onBackspaceKeyOn(event) {
191
+ if (this.focusedIndex !== null) {
192
+ this.removeItem(event, this.focusedIndex);
193
+ }
194
+ },
108
195
  updateModel(event, value, preventDefault) {
109
196
  this.$emit('update:modelValue', value);
110
197
  this.$emit('add', {
@@ -128,12 +215,14 @@ export default {
128
215
  }
129
216
  },
130
217
  removeItem(event, index) {
131
- if (this.$attrs.disabled) {
218
+ if (this.disabled) {
132
219
  return;
133
220
  }
134
221
 
135
222
  let values = [...this.modelValue];
136
223
  const removedItem = values.splice(index, 1);
224
+ this.focusedIndex = null;
225
+ this.$refs.input.focus();
137
226
  this.$emit('update:modelValue', values);
138
227
  this.$emit('remove', {
139
228
  originalEvent: event,
@@ -146,10 +235,15 @@ export default {
146
235
  return this.max && this.modelValue && this.max === this.modelValue.length;
147
236
  },
148
237
  containerClass() {
149
- return ['p-chips p-component p-inputwrapper', this.class, {
238
+ return ['p-chips p-component p-inputwrapper', {
239
+ 'p-disabled': this.disabled,
240
+ 'p-focus': this.focused,
150
241
  'p-inputwrapper-filled': ((this.modelValue && this.modelValue.length) || (this.inputValue && this.inputValue.length)),
151
242
  'p-inputwrapper-focus': this.focused
152
243
  }];
244
+ },
245
+ focusedOptionId() {
246
+ return this.focusedIndex !== null ? `${this.id}_chips_item_${this.focusedIndex}` : null;
153
247
  }
154
248
  }
155
249
  }