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
@@ -6,13 +6,29 @@ export interface TriStateCheckboxProps {
6
6
  */
7
7
  modelValue?: Nullable<boolean>;
8
8
  /**
9
- * Inline style of the component.
9
+ * When present, it specifies that the component should be disabled.
10
10
  */
11
- style?: any;
11
+ disabled?: boolean | undefined;
12
12
  /**
13
- * Style class of the component.
13
+ * Index of the element in tabbing order.
14
14
  */
15
- class?: any;
15
+ tabindex?: string | undefined;
16
+ /**
17
+ * Identifier of the underlying input element.
18
+ */
19
+ inputId?: string | undefined;
20
+ /**
21
+ * Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
22
+ */
23
+ inputProps?: HTMLInputElement | undefined;
24
+ /**
25
+ * Establishes relationships between the component and label(s) where its value should be one or more element IDs.
26
+ */
27
+ 'aria-labelledby'?: string | undefined;
28
+ /**
29
+ * Establishes a string value that labels the component.
30
+ */
31
+ 'aria-label'?: string | undefined;
16
32
  }
17
33
 
18
34
  export interface TriStateCheckboxSlots {
@@ -1,9 +1,11 @@
1
1
  <template>
2
- <div :class="containerClass" @click="onClick($event)" :style="style">
2
+ <div :class="containerClass" @click="onClick($event)">
3
3
  <div class="p-hidden-accessible">
4
- <input ref="input" type="checkbox" :checked="modelValue === true" v-bind="$attrs" @focus="onFocus()" @blur="onBlur()">
4
+ <input :id="inputId" ref="input" type="checkbox" :checked="modelValue === true" :tabindex="tabindex" :disabled="disabled" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
5
+ @keydown="onKeyDown($event)" @focus="onFocus($event)" @blur="onBlur($event)" v-bind="inputProps" >
5
6
  </div>
6
- <div ref="box" :class="['p-checkbox-box', {'p-highlight': (modelValue != null), 'p-disabled': $attrs.disabled, 'p-focus': focused}]" role="checkbox" :aria-checked="modelValue === true">
7
+ <span class="p-sr-only" aria-live="polite">{{ariaValueLabel}}</span>
8
+ <div ref="box" :class="['p-checkbox-box', {'p-highlight': (modelValue != null), 'p-disabled': disabled, 'p-focus': focused}]" >
7
9
  <span :class="['p-checkbox-icon', icon]"></span>
8
10
  </div>
9
11
  </div>
@@ -12,12 +14,27 @@
12
14
  <script>
13
15
  export default {
14
16
  name: 'TriStateCheckbox',
15
- inheritAttrs: false,
16
- emits: ['click', 'update:modelValue', 'change'],
17
+ emits: ['click', 'update:modelValue', 'change', 'keydown', 'focus', 'blur'],
17
18
  props: {
18
19
  modelValue: null,
19
- class: null,
20
- style: null
20
+ inputId: null,
21
+ inputProps: null,
22
+ disabled: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ tabindex: {
27
+ type: Number,
28
+ default: 0
29
+ },
30
+ 'aria-labelledby': {
31
+ type: String,
32
+ default: null
33
+ },
34
+ 'aria-label': {
35
+ type: String,
36
+ default: null
37
+ }
21
38
  },
22
39
  data() {
23
40
  return {
@@ -25,8 +42,8 @@ export default {
25
42
  };
26
43
  },
27
44
  methods: {
28
- onClick(event) {
29
- if (!this.$attrs.disabled) {
45
+ updateModel() {
46
+ if (!this.disabled) {
30
47
  let newValue;
31
48
 
32
49
  switch (this.modelValue) {
@@ -43,17 +60,29 @@ export default {
43
60
  break;
44
61
  }
45
62
 
46
- this.$emit('click', event);
47
63
  this.$emit('update:modelValue', newValue);
48
- this.$emit('change', event);
49
- this.$refs.input.focus();
50
64
  }
51
65
  },
52
- onFocus() {
66
+ onClick(event) {
67
+ this.updateModel();
68
+ this.$emit('click', event);
69
+ this.$emit('change', event);
70
+ this.$refs.input.focus();
71
+ },
72
+ onKeyDown(event) {
73
+ if (event.code === 'Enter') {
74
+ this.updateModel();
75
+ this.$emit('keydown', event);
76
+ event.preventDefault();
77
+ }
78
+ },
79
+ onFocus(event) {
53
80
  this.focused = true;
81
+ this.$emit('focus', event);
54
82
  },
55
- onBlur() {
83
+ onBlur(event) {
56
84
  this.focused = false;
85
+ this.$emit('blur', event);
57
86
  }
58
87
  },
59
88
  computed: {
@@ -76,7 +105,15 @@ export default {
76
105
  return icon;
77
106
  },
78
107
  containerClass() {
79
- return ['p-checkbox p-component', this.class, {'p-checkbox-checked': this.modelValue === true, 'p-checkbox-disabled': this.$attrs.disabled, 'p-checkbox-focused': this.focused}];
108
+ return [
109
+ 'p-checkbox p-component', {
110
+ 'p-checkbox-checked': this.modelValue === true,
111
+ 'p-checkbox-disabled': this.disabled,
112
+ 'p-checkbox-focused': this.focused
113
+ }];
114
+ },
115
+ ariaValueLabel() {
116
+ return this.modelValue ? this.$primevue.config.locale.aria.trueLabel : (this.modelValue === false ? this.$primevue.config.locale.aria.falseLabel : this.$primevue.config.locale.aria.nullLabel);
80
117
  }
81
118
  }
82
119
  }
@@ -4,12 +4,27 @@ var vue = require('vue');
4
4
 
5
5
  var script = {
6
6
  name: 'TriStateCheckbox',
7
- inheritAttrs: false,
8
- emits: ['click', 'update:modelValue', 'change'],
7
+ emits: ['click', 'update:modelValue', 'change', 'keydown', 'focus', 'blur'],
9
8
  props: {
10
9
  modelValue: null,
11
- class: null,
12
- style: null
10
+ inputId: null,
11
+ inputProps: null,
12
+ disabled: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ tabindex: {
17
+ type: Number,
18
+ default: 0
19
+ },
20
+ 'aria-labelledby': {
21
+ type: String,
22
+ default: null
23
+ },
24
+ 'aria-label': {
25
+ type: String,
26
+ default: null
27
+ }
13
28
  },
14
29
  data() {
15
30
  return {
@@ -17,8 +32,8 @@ var script = {
17
32
  };
18
33
  },
19
34
  methods: {
20
- onClick(event) {
21
- if (!this.$attrs.disabled) {
35
+ updateModel() {
36
+ if (!this.disabled) {
22
37
  let newValue;
23
38
 
24
39
  switch (this.modelValue) {
@@ -35,17 +50,29 @@ var script = {
35
50
  break;
36
51
  }
37
52
 
38
- this.$emit('click', event);
39
53
  this.$emit('update:modelValue', newValue);
40
- this.$emit('change', event);
41
- this.$refs.input.focus();
42
54
  }
43
55
  },
44
- onFocus() {
56
+ onClick(event) {
57
+ this.updateModel();
58
+ this.$emit('click', event);
59
+ this.$emit('change', event);
60
+ this.$refs.input.focus();
61
+ },
62
+ onKeyDown(event) {
63
+ if (event.code === 'Enter') {
64
+ this.updateModel();
65
+ this.$emit('keydown', event);
66
+ event.preventDefault();
67
+ }
68
+ },
69
+ onFocus(event) {
45
70
  this.focused = true;
71
+ this.$emit('focus', event);
46
72
  },
47
- onBlur() {
73
+ onBlur(event) {
48
74
  this.focused = false;
75
+ this.$emit('blur', event);
49
76
  }
50
77
  },
51
78
  computed: {
@@ -68,42 +95,56 @@ var script = {
68
95
  return icon;
69
96
  },
70
97
  containerClass() {
71
- return ['p-checkbox p-component', this.class, {'p-checkbox-checked': this.modelValue === true, 'p-checkbox-disabled': this.$attrs.disabled, 'p-checkbox-focused': this.focused}];
98
+ return [
99
+ 'p-checkbox p-component', {
100
+ 'p-checkbox-checked': this.modelValue === true,
101
+ 'p-checkbox-disabled': this.disabled,
102
+ 'p-checkbox-focused': this.focused
103
+ }];
104
+ },
105
+ ariaValueLabel() {
106
+ return this.modelValue ? this.$primevue.config.locale.aria.trueLabel : (this.modelValue === false ? this.$primevue.config.locale.aria.falseLabel : this.$primevue.config.locale.aria.nullLabel);
72
107
  }
73
108
  }
74
109
  };
75
110
 
76
111
  const _hoisted_1 = { class: "p-hidden-accessible" };
77
- const _hoisted_2 = ["checked"];
78
- const _hoisted_3 = ["aria-checked"];
112
+ const _hoisted_2 = ["id", "checked", "tabindex", "disabled", "aria-labelledby", "aria-label"];
113
+ const _hoisted_3 = {
114
+ class: "p-sr-only",
115
+ "aria-live": "polite"
116
+ };
79
117
 
80
118
  function render(_ctx, _cache, $props, $setup, $data, $options) {
81
119
  return (vue.openBlock(), vue.createElementBlock("div", {
82
120
  class: vue.normalizeClass($options.containerClass),
83
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
84
- style: vue.normalizeStyle($props.style)
121
+ onClick: _cache[3] || (_cache[3] = $event => ($options.onClick($event)))
85
122
  }, [
86
123
  vue.createElementVNode("div", _hoisted_1, [
87
124
  vue.createElementVNode("input", vue.mergeProps({
125
+ id: $props.inputId,
88
126
  ref: "input",
89
127
  type: "checkbox",
90
- checked: $props.modelValue === true
91
- }, _ctx.$attrs, {
92
- onFocus: _cache[0] || (_cache[0] = $event => ($options.onFocus())),
93
- onBlur: _cache[1] || (_cache[1] = $event => ($options.onBlur()))
94
- }), null, 16, _hoisted_2)
128
+ checked: $props.modelValue === true,
129
+ tabindex: $props.tabindex,
130
+ disabled: $props.disabled,
131
+ "aria-labelledby": _ctx.ariaLabelledby,
132
+ "aria-label": _ctx.ariaLabel,
133
+ onKeydown: _cache[0] || (_cache[0] = $event => ($options.onKeyDown($event))),
134
+ onFocus: _cache[1] || (_cache[1] = $event => ($options.onFocus($event))),
135
+ onBlur: _cache[2] || (_cache[2] = $event => ($options.onBlur($event)))
136
+ }, $props.inputProps), null, 16, _hoisted_2)
95
137
  ]),
138
+ vue.createElementVNode("span", _hoisted_3, vue.toDisplayString($options.ariaValueLabel), 1),
96
139
  vue.createElementVNode("div", {
97
140
  ref: "box",
98
- class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': ($props.modelValue != null), 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
99
- role: "checkbox",
100
- "aria-checked": $props.modelValue === true
141
+ class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': ($props.modelValue != null), 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
101
142
  }, [
102
143
  vue.createElementVNode("span", {
103
144
  class: vue.normalizeClass(['p-checkbox-icon', $options.icon])
104
145
  }, null, 2)
105
- ], 10, _hoisted_3)
106
- ], 6))
146
+ ], 2)
147
+ ], 2))
107
148
  }
108
149
 
109
150
  script.render = render;
@@ -1 +1 @@
1
- "use strict";var e=require("vue"),l={name:"TriStateCheckbox",inheritAttrs:!1,emits:["click","update:modelValue","change"],props:{modelValue:null,class:null,style:null},data:()=>({focused:!1}),methods:{onClick(e){if(!this.$attrs.disabled){let l;switch(this.modelValue){case!0:l=!1;break;case!1:l=null;break;case null:l=!0}this.$emit("click",e),this.$emit("update:modelValue",l),this.$emit("change",e),this.$refs.input.focus()}},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{icon(){let e;switch(this.modelValue){case!0:e="pi pi-check";break;case!1:e="pi pi-times";break;case null:e=null}return e},containerClass(){return["p-checkbox p-component",this.class,{"p-checkbox-checked":!0===this.modelValue,"p-checkbox-disabled":this.$attrs.disabled,"p-checkbox-focused":this.focused}]}}};const c={class:"p-hidden-accessible"},s=["checked"],t=["aria-checked"];l.render=function(l,o,a,i,n,r){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.containerClass),onClick:o[2]||(o[2]=e=>r.onClick(e)),style:e.normalizeStyle(a.style)},[e.createElementVNode("div",c,[e.createElementVNode("input",e.mergeProps({ref:"input",type:"checkbox",checked:!0===a.modelValue},l.$attrs,{onFocus:o[0]||(o[0]=e=>r.onFocus()),onBlur:o[1]||(o[1]=e=>r.onBlur())}),null,16,s)]),e.createElementVNode("div",{ref:"box",class:e.normalizeClass(["p-checkbox-box",{"p-highlight":null!=a.modelValue,"p-disabled":l.$attrs.disabled,"p-focus":n.focused}]),role:"checkbox","aria-checked":!0===a.modelValue},[e.createElementVNode("span",{class:e.normalizeClass(["p-checkbox-icon",r.icon])},null,2)],10,t)],6)},module.exports=l;
1
+ "use strict";var e=require("vue"),l={name:"TriStateCheckbox",emits:["click","update:modelValue","change","keydown","focus","blur"],props:{modelValue:null,inputId:null,inputProps:null,disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{updateModel(){if(!this.disabled){let e;switch(this.modelValue){case!0:e=!1;break;case!1:e=null;break;case null:e=!0}this.$emit("update:modelValue",e)}},onClick(e){this.updateModel(),this.$emit("click",e),this.$emit("change",e),this.$refs.input.focus()},onKeyDown(e){"Enter"===e.code&&(this.updateModel(),this.$emit("keydown",e),e.preventDefault())},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{icon(){let e;switch(this.modelValue){case!0:e="pi pi-check";break;case!1:e="pi pi-times";break;case null:e=null}return e},containerClass(){return["p-checkbox p-component",{"p-checkbox-checked":!0===this.modelValue,"p-checkbox-disabled":this.disabled,"p-checkbox-focused":this.focused}]},ariaValueLabel(){return this.modelValue?this.$primevue.config.locale.aria.trueLabel:!1===this.modelValue?this.$primevue.config.locale.aria.falseLabel:this.$primevue.config.locale.aria.nullLabel}}};const a={class:"p-hidden-accessible"},i=["id","checked","tabindex","disabled","aria-labelledby","aria-label"],t={class:"p-sr-only","aria-live":"polite"};l.render=function(l,o,s,c,n,d){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.containerClass),onClick:o[3]||(o[3]=e=>d.onClick(e))},[e.createElementVNode("div",a,[e.createElementVNode("input",e.mergeProps({id:s.inputId,ref:"input",type:"checkbox",checked:!0===s.modelValue,tabindex:s.tabindex,disabled:s.disabled,"aria-labelledby":l.ariaLabelledby,"aria-label":l.ariaLabel,onKeydown:o[0]||(o[0]=e=>d.onKeyDown(e)),onFocus:o[1]||(o[1]=e=>d.onFocus(e)),onBlur:o[2]||(o[2]=e=>d.onBlur(e))},s.inputProps),null,16,i)]),e.createElementVNode("span",t,e.toDisplayString(d.ariaValueLabel),1),e.createElementVNode("div",{ref:"box",class:e.normalizeClass(["p-checkbox-box",{"p-highlight":null!=s.modelValue,"p-disabled":s.disabled,"p-focus":n.focused}])},[e.createElementVNode("span",{class:e.normalizeClass(["p-checkbox-icon",d.icon])},null,2)],2)],2)},module.exports=l;
@@ -1,13 +1,28 @@
1
- import { openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, mergeProps } from 'vue';
1
+ import { openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps, toDisplayString } from 'vue';
2
2
 
3
3
  var script = {
4
4
  name: 'TriStateCheckbox',
5
- inheritAttrs: false,
6
- emits: ['click', 'update:modelValue', 'change'],
5
+ emits: ['click', 'update:modelValue', 'change', 'keydown', 'focus', 'blur'],
7
6
  props: {
8
7
  modelValue: null,
9
- class: null,
10
- style: null
8
+ inputId: null,
9
+ inputProps: null,
10
+ disabled: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ tabindex: {
15
+ type: Number,
16
+ default: 0
17
+ },
18
+ 'aria-labelledby': {
19
+ type: String,
20
+ default: null
21
+ },
22
+ 'aria-label': {
23
+ type: String,
24
+ default: null
25
+ }
11
26
  },
12
27
  data() {
13
28
  return {
@@ -15,8 +30,8 @@ var script = {
15
30
  };
16
31
  },
17
32
  methods: {
18
- onClick(event) {
19
- if (!this.$attrs.disabled) {
33
+ updateModel() {
34
+ if (!this.disabled) {
20
35
  let newValue;
21
36
 
22
37
  switch (this.modelValue) {
@@ -33,17 +48,29 @@ var script = {
33
48
  break;
34
49
  }
35
50
 
36
- this.$emit('click', event);
37
51
  this.$emit('update:modelValue', newValue);
38
- this.$emit('change', event);
39
- this.$refs.input.focus();
40
52
  }
41
53
  },
42
- onFocus() {
54
+ onClick(event) {
55
+ this.updateModel();
56
+ this.$emit('click', event);
57
+ this.$emit('change', event);
58
+ this.$refs.input.focus();
59
+ },
60
+ onKeyDown(event) {
61
+ if (event.code === 'Enter') {
62
+ this.updateModel();
63
+ this.$emit('keydown', event);
64
+ event.preventDefault();
65
+ }
66
+ },
67
+ onFocus(event) {
43
68
  this.focused = true;
69
+ this.$emit('focus', event);
44
70
  },
45
- onBlur() {
71
+ onBlur(event) {
46
72
  this.focused = false;
73
+ this.$emit('blur', event);
47
74
  }
48
75
  },
49
76
  computed: {
@@ -66,42 +93,56 @@ var script = {
66
93
  return icon;
67
94
  },
68
95
  containerClass() {
69
- return ['p-checkbox p-component', this.class, {'p-checkbox-checked': this.modelValue === true, 'p-checkbox-disabled': this.$attrs.disabled, 'p-checkbox-focused': this.focused}];
96
+ return [
97
+ 'p-checkbox p-component', {
98
+ 'p-checkbox-checked': this.modelValue === true,
99
+ 'p-checkbox-disabled': this.disabled,
100
+ 'p-checkbox-focused': this.focused
101
+ }];
102
+ },
103
+ ariaValueLabel() {
104
+ return this.modelValue ? this.$primevue.config.locale.aria.trueLabel : (this.modelValue === false ? this.$primevue.config.locale.aria.falseLabel : this.$primevue.config.locale.aria.nullLabel);
70
105
  }
71
106
  }
72
107
  };
73
108
 
74
109
  const _hoisted_1 = { class: "p-hidden-accessible" };
75
- const _hoisted_2 = ["checked"];
76
- const _hoisted_3 = ["aria-checked"];
110
+ const _hoisted_2 = ["id", "checked", "tabindex", "disabled", "aria-labelledby", "aria-label"];
111
+ const _hoisted_3 = {
112
+ class: "p-sr-only",
113
+ "aria-live": "polite"
114
+ };
77
115
 
78
116
  function render(_ctx, _cache, $props, $setup, $data, $options) {
79
117
  return (openBlock(), createElementBlock("div", {
80
118
  class: normalizeClass($options.containerClass),
81
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
82
- style: normalizeStyle($props.style)
119
+ onClick: _cache[3] || (_cache[3] = $event => ($options.onClick($event)))
83
120
  }, [
84
121
  createElementVNode("div", _hoisted_1, [
85
122
  createElementVNode("input", mergeProps({
123
+ id: $props.inputId,
86
124
  ref: "input",
87
125
  type: "checkbox",
88
- checked: $props.modelValue === true
89
- }, _ctx.$attrs, {
90
- onFocus: _cache[0] || (_cache[0] = $event => ($options.onFocus())),
91
- onBlur: _cache[1] || (_cache[1] = $event => ($options.onBlur()))
92
- }), null, 16, _hoisted_2)
126
+ checked: $props.modelValue === true,
127
+ tabindex: $props.tabindex,
128
+ disabled: $props.disabled,
129
+ "aria-labelledby": _ctx.ariaLabelledby,
130
+ "aria-label": _ctx.ariaLabel,
131
+ onKeydown: _cache[0] || (_cache[0] = $event => ($options.onKeyDown($event))),
132
+ onFocus: _cache[1] || (_cache[1] = $event => ($options.onFocus($event))),
133
+ onBlur: _cache[2] || (_cache[2] = $event => ($options.onBlur($event)))
134
+ }, $props.inputProps), null, 16, _hoisted_2)
93
135
  ]),
136
+ createElementVNode("span", _hoisted_3, toDisplayString($options.ariaValueLabel), 1),
94
137
  createElementVNode("div", {
95
138
  ref: "box",
96
- class: normalizeClass(['p-checkbox-box', {'p-highlight': ($props.modelValue != null), 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
97
- role: "checkbox",
98
- "aria-checked": $props.modelValue === true
139
+ class: normalizeClass(['p-checkbox-box', {'p-highlight': ($props.modelValue != null), 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
99
140
  }, [
100
141
  createElementVNode("span", {
101
142
  class: normalizeClass(['p-checkbox-icon', $options.icon])
102
143
  }, null, 2)
103
- ], 10, _hoisted_3)
104
- ], 6))
144
+ ], 2)
145
+ ], 2))
105
146
  }
106
147
 
107
148
  script.render = render;
@@ -1 +1 @@
1
- import{openBlock as e,createElementBlock as c,normalizeClass as s,normalizeStyle as l,createElementVNode as t,mergeProps as i}from"vue";var o={name:"TriStateCheckbox",inheritAttrs:!1,emits:["click","update:modelValue","change"],props:{modelValue:null,class:null,style:null},data:()=>({focused:!1}),methods:{onClick(e){if(!this.$attrs.disabled){let c;switch(this.modelValue){case!0:c=!1;break;case!1:c=null;break;case null:c=!0}this.$emit("click",e),this.$emit("update:modelValue",c),this.$emit("change",e),this.$refs.input.focus()}},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{icon(){let e;switch(this.modelValue){case!0:e="pi pi-check";break;case!1:e="pi pi-times";break;case null:e=null}return e},containerClass(){return["p-checkbox p-component",this.class,{"p-checkbox-checked":!0===this.modelValue,"p-checkbox-disabled":this.$attrs.disabled,"p-checkbox-focused":this.focused}]}}};const a={class:"p-hidden-accessible"},u=["checked"],n=["aria-checked"];o.render=function(o,d,h,r,p,k){return e(),c("div",{class:s(k.containerClass),onClick:d[2]||(d[2]=e=>k.onClick(e)),style:l(h.style)},[t("div",a,[t("input",i({ref:"input",type:"checkbox",checked:!0===h.modelValue},o.$attrs,{onFocus:d[0]||(d[0]=e=>k.onFocus()),onBlur:d[1]||(d[1]=e=>k.onBlur())}),null,16,u)]),t("div",{ref:"box",class:s(["p-checkbox-box",{"p-highlight":null!=h.modelValue,"p-disabled":o.$attrs.disabled,"p-focus":p.focused}]),role:"checkbox","aria-checked":!0===h.modelValue},[t("span",{class:s(["p-checkbox-icon",k.icon])},null,2)],10,n)],6)};export{o as default};
1
+ import{openBlock as e,createElementBlock as l,normalizeClass as a,createElementVNode as i,mergeProps as t,toDisplayString as o}from"vue";var s={name:"TriStateCheckbox",emits:["click","update:modelValue","change","keydown","focus","blur"],props:{modelValue:null,inputId:null,inputProps:null,disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{updateModel(){if(!this.disabled){let e;switch(this.modelValue){case!0:e=!1;break;case!1:e=null;break;case null:e=!0}this.$emit("update:modelValue",e)}},onClick(e){this.updateModel(),this.$emit("click",e),this.$emit("change",e),this.$refs.input.focus()},onKeyDown(e){"Enter"===e.code&&(this.updateModel(),this.$emit("keydown",e),e.preventDefault())},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{icon(){let e;switch(this.modelValue){case!0:e="pi pi-check";break;case!1:e="pi pi-times";break;case null:e=null}return e},containerClass(){return["p-checkbox p-component",{"p-checkbox-checked":!0===this.modelValue,"p-checkbox-disabled":this.disabled,"p-checkbox-focused":this.focused}]},ariaValueLabel(){return this.modelValue?this.$primevue.config.locale.aria.trueLabel:!1===this.modelValue?this.$primevue.config.locale.aria.falseLabel:this.$primevue.config.locale.aria.nullLabel}}};const c={class:"p-hidden-accessible"},d=["id","checked","tabindex","disabled","aria-labelledby","aria-label"],n={class:"p-sr-only","aria-live":"polite"};s.render=function(s,u,r,b,p,h){return e(),l("div",{class:a(h.containerClass),onClick:u[3]||(u[3]=e=>h.onClick(e))},[i("div",c,[i("input",t({id:r.inputId,ref:"input",type:"checkbox",checked:!0===r.modelValue,tabindex:r.tabindex,disabled:r.disabled,"aria-labelledby":s.ariaLabelledby,"aria-label":s.ariaLabel,onKeydown:u[0]||(u[0]=e=>h.onKeyDown(e)),onFocus:u[1]||(u[1]=e=>h.onFocus(e)),onBlur:u[2]||(u[2]=e=>h.onBlur(e))},r.inputProps),null,16,d)]),i("span",n,o(h.ariaValueLabel),1),i("div",{ref:"box",class:a(["p-checkbox-box",{"p-highlight":null!=r.modelValue,"p-disabled":r.disabled,"p-focus":p.focused}])},[i("span",{class:a(["p-checkbox-icon",h.icon])},null,2)],2)],2)};export{s as default};
@@ -4,12 +4,27 @@ this.primevue.tristatecheckbox = (function (vue) {
4
4
 
5
5
  var script = {
6
6
  name: 'TriStateCheckbox',
7
- inheritAttrs: false,
8
- emits: ['click', 'update:modelValue', 'change'],
7
+ emits: ['click', 'update:modelValue', 'change', 'keydown', 'focus', 'blur'],
9
8
  props: {
10
9
  modelValue: null,
11
- class: null,
12
- style: null
10
+ inputId: null,
11
+ inputProps: null,
12
+ disabled: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ tabindex: {
17
+ type: Number,
18
+ default: 0
19
+ },
20
+ 'aria-labelledby': {
21
+ type: String,
22
+ default: null
23
+ },
24
+ 'aria-label': {
25
+ type: String,
26
+ default: null
27
+ }
13
28
  },
14
29
  data() {
15
30
  return {
@@ -17,8 +32,8 @@ this.primevue.tristatecheckbox = (function (vue) {
17
32
  };
18
33
  },
19
34
  methods: {
20
- onClick(event) {
21
- if (!this.$attrs.disabled) {
35
+ updateModel() {
36
+ if (!this.disabled) {
22
37
  let newValue;
23
38
 
24
39
  switch (this.modelValue) {
@@ -35,17 +50,29 @@ this.primevue.tristatecheckbox = (function (vue) {
35
50
  break;
36
51
  }
37
52
 
38
- this.$emit('click', event);
39
53
  this.$emit('update:modelValue', newValue);
40
- this.$emit('change', event);
41
- this.$refs.input.focus();
42
54
  }
43
55
  },
44
- onFocus() {
56
+ onClick(event) {
57
+ this.updateModel();
58
+ this.$emit('click', event);
59
+ this.$emit('change', event);
60
+ this.$refs.input.focus();
61
+ },
62
+ onKeyDown(event) {
63
+ if (event.code === 'Enter') {
64
+ this.updateModel();
65
+ this.$emit('keydown', event);
66
+ event.preventDefault();
67
+ }
68
+ },
69
+ onFocus(event) {
45
70
  this.focused = true;
71
+ this.$emit('focus', event);
46
72
  },
47
- onBlur() {
73
+ onBlur(event) {
48
74
  this.focused = false;
75
+ this.$emit('blur', event);
49
76
  }
50
77
  },
51
78
  computed: {
@@ -68,42 +95,56 @@ this.primevue.tristatecheckbox = (function (vue) {
68
95
  return icon;
69
96
  },
70
97
  containerClass() {
71
- return ['p-checkbox p-component', this.class, {'p-checkbox-checked': this.modelValue === true, 'p-checkbox-disabled': this.$attrs.disabled, 'p-checkbox-focused': this.focused}];
98
+ return [
99
+ 'p-checkbox p-component', {
100
+ 'p-checkbox-checked': this.modelValue === true,
101
+ 'p-checkbox-disabled': this.disabled,
102
+ 'p-checkbox-focused': this.focused
103
+ }];
104
+ },
105
+ ariaValueLabel() {
106
+ return this.modelValue ? this.$primevue.config.locale.aria.trueLabel : (this.modelValue === false ? this.$primevue.config.locale.aria.falseLabel : this.$primevue.config.locale.aria.nullLabel);
72
107
  }
73
108
  }
74
109
  };
75
110
 
76
111
  const _hoisted_1 = { class: "p-hidden-accessible" };
77
- const _hoisted_2 = ["checked"];
78
- const _hoisted_3 = ["aria-checked"];
112
+ const _hoisted_2 = ["id", "checked", "tabindex", "disabled", "aria-labelledby", "aria-label"];
113
+ const _hoisted_3 = {
114
+ class: "p-sr-only",
115
+ "aria-live": "polite"
116
+ };
79
117
 
80
118
  function render(_ctx, _cache, $props, $setup, $data, $options) {
81
119
  return (vue.openBlock(), vue.createElementBlock("div", {
82
120
  class: vue.normalizeClass($options.containerClass),
83
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
84
- style: vue.normalizeStyle($props.style)
121
+ onClick: _cache[3] || (_cache[3] = $event => ($options.onClick($event)))
85
122
  }, [
86
123
  vue.createElementVNode("div", _hoisted_1, [
87
124
  vue.createElementVNode("input", vue.mergeProps({
125
+ id: $props.inputId,
88
126
  ref: "input",
89
127
  type: "checkbox",
90
- checked: $props.modelValue === true
91
- }, _ctx.$attrs, {
92
- onFocus: _cache[0] || (_cache[0] = $event => ($options.onFocus())),
93
- onBlur: _cache[1] || (_cache[1] = $event => ($options.onBlur()))
94
- }), null, 16, _hoisted_2)
128
+ checked: $props.modelValue === true,
129
+ tabindex: $props.tabindex,
130
+ disabled: $props.disabled,
131
+ "aria-labelledby": _ctx.ariaLabelledby,
132
+ "aria-label": _ctx.ariaLabel,
133
+ onKeydown: _cache[0] || (_cache[0] = $event => ($options.onKeyDown($event))),
134
+ onFocus: _cache[1] || (_cache[1] = $event => ($options.onFocus($event))),
135
+ onBlur: _cache[2] || (_cache[2] = $event => ($options.onBlur($event)))
136
+ }, $props.inputProps), null, 16, _hoisted_2)
95
137
  ]),
138
+ vue.createElementVNode("span", _hoisted_3, vue.toDisplayString($options.ariaValueLabel), 1),
96
139
  vue.createElementVNode("div", {
97
140
  ref: "box",
98
- class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': ($props.modelValue != null), 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
99
- role: "checkbox",
100
- "aria-checked": $props.modelValue === true
141
+ class: vue.normalizeClass(['p-checkbox-box', {'p-highlight': ($props.modelValue != null), 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
101
142
  }, [
102
143
  vue.createElementVNode("span", {
103
144
  class: vue.normalizeClass(['p-checkbox-icon', $options.icon])
104
145
  }, null, 2)
105
- ], 10, _hoisted_3)
106
- ], 6))
146
+ ], 2)
147
+ ], 2))
107
148
  }
108
149
 
109
150
  script.render = render;
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.tristatecheckbox=function(e){"use strict";var c={name:"TriStateCheckbox",inheritAttrs:!1,emits:["click","update:modelValue","change"],props:{modelValue:null,class:null,style:null},data:()=>({focused:!1}),methods:{onClick(e){if(!this.$attrs.disabled){let c;switch(this.modelValue){case!0:c=!1;break;case!1:c=null;break;case null:c=!0}this.$emit("click",e),this.$emit("update:modelValue",c),this.$emit("change",e),this.$refs.input.focus()}},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{icon(){let e;switch(this.modelValue){case!0:e="pi pi-check";break;case!1:e="pi pi-times";break;case null:e=null}return e},containerClass(){return["p-checkbox p-component",this.class,{"p-checkbox-checked":!0===this.modelValue,"p-checkbox-disabled":this.$attrs.disabled,"p-checkbox-focused":this.focused}]}}};const s={class:"p-hidden-accessible"},l=["checked"],t=["aria-checked"];return c.render=function(c,i,o,a,n,r){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.containerClass),onClick:i[2]||(i[2]=e=>r.onClick(e)),style:e.normalizeStyle(o.style)},[e.createElementVNode("div",s,[e.createElementVNode("input",e.mergeProps({ref:"input",type:"checkbox",checked:!0===o.modelValue},c.$attrs,{onFocus:i[0]||(i[0]=e=>r.onFocus()),onBlur:i[1]||(i[1]=e=>r.onBlur())}),null,16,l)]),e.createElementVNode("div",{ref:"box",class:e.normalizeClass(["p-checkbox-box",{"p-highlight":null!=o.modelValue,"p-disabled":c.$attrs.disabled,"p-focus":n.focused}]),role:"checkbox","aria-checked":!0===o.modelValue},[e.createElementVNode("span",{class:e.normalizeClass(["p-checkbox-icon",r.icon])},null,2)],10,t)],6)},c}(Vue);
1
+ this.primevue=this.primevue||{},this.primevue.tristatecheckbox=function(e){"use strict";var l={name:"TriStateCheckbox",emits:["click","update:modelValue","change","keydown","focus","blur"],props:{modelValue:null,inputId:null,inputProps:null,disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({focused:!1}),methods:{updateModel(){if(!this.disabled){let e;switch(this.modelValue){case!0:e=!1;break;case!1:e=null;break;case null:e=!0}this.$emit("update:modelValue",e)}},onClick(e){this.updateModel(),this.$emit("click",e),this.$emit("change",e),this.$refs.input.focus()},onKeyDown(e){"Enter"===e.code&&(this.updateModel(),this.$emit("keydown",e),e.preventDefault())},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{icon(){let e;switch(this.modelValue){case!0:e="pi pi-check";break;case!1:e="pi pi-times";break;case null:e=null}return e},containerClass(){return["p-checkbox p-component",{"p-checkbox-checked":!0===this.modelValue,"p-checkbox-disabled":this.disabled,"p-checkbox-focused":this.focused}]},ariaValueLabel(){return this.modelValue?this.$primevue.config.locale.aria.trueLabel:!1===this.modelValue?this.$primevue.config.locale.aria.falseLabel:this.$primevue.config.locale.aria.nullLabel}}};const a={class:"p-hidden-accessible"},i=["id","checked","tabindex","disabled","aria-labelledby","aria-label"],t={class:"p-sr-only","aria-live":"polite"};return l.render=function(l,s,o,c,n,d){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.containerClass),onClick:s[3]||(s[3]=e=>d.onClick(e))},[e.createElementVNode("div",a,[e.createElementVNode("input",e.mergeProps({id:o.inputId,ref:"input",type:"checkbox",checked:!0===o.modelValue,tabindex:o.tabindex,disabled:o.disabled,"aria-labelledby":l.ariaLabelledby,"aria-label":l.ariaLabel,onKeydown:s[0]||(s[0]=e=>d.onKeyDown(e)),onFocus:s[1]||(s[1]=e=>d.onFocus(e)),onBlur:s[2]||(s[2]=e=>d.onBlur(e))},o.inputProps),null,16,i)]),e.createElementVNode("span",t,e.toDisplayString(d.ariaValueLabel),1),e.createElementVNode("div",{ref:"box",class:e.normalizeClass(["p-checkbox-box",{"p-highlight":null!=o.modelValue,"p-disabled":o.disabled,"p-focus":n.focused}])},[e.createElementVNode("span",{class:e.normalizeClass(["p-checkbox-icon",d.icon])},null,2)],2)],2)},l}(Vue);
package/utils/Utils.d.ts CHANGED
@@ -43,8 +43,8 @@ export declare class DomHandler {
43
43
  static isVisible(el: HTMLElement): boolean;
44
44
  static invokeElementMethod(el: HTMLElement, methodName: string, args: any): void;
45
45
  static isClient(): boolean;
46
- static getFocusableElements(el: HTMLElement): any[];
47
- static getFirstFocusableElement(el: HTMLElement): any;
46
+ static getFocusableElements(el: HTMLElement, selector?: string): any[];
47
+ static getFirstFocusableElement(el: HTMLElement, selector?: string): any;
48
48
  static isClickable(el: HTMLElement): boolean;
49
49
  static applyStyle(el: HTMLElement, style: any): void;
50
50
  static isIOS(): boolean;
@@ -66,6 +66,7 @@ export declare class ObjectUtils {
66
66
  static removeAccents(str: any): string;
67
67
  static isEmpty(value: any): boolean;
68
68
  static isNotEmpty(value: any): boolean;
69
+ static isPrintableCharacter(char: string): boolean;
69
70
  }
70
71
 
71
72
  export declare namespace ZIndexUtils {