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
@@ -5,13 +5,30 @@ var vue = require('vue');
5
5
 
6
6
  var script = {
7
7
  name: 'RadioButton',
8
- inheritAttrs: false,
9
- emits: ['click', 'update:modelValue', 'change'],
8
+ emits: ['click', 'update:modelValue', 'change', 'focus', 'blur'],
10
9
  props: {
11
10
  value: null,
12
11
  modelValue: null,
13
- class: null,
14
- style: null
12
+ name: {
13
+ type: String,
14
+ default: null
15
+ },
16
+ disabled: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ inputId: null,
21
+ inputClass: null,
22
+ inputStyle: null,
23
+ inputProps: null,
24
+ 'aria-labelledby': {
25
+ type: String,
26
+ default: null
27
+ },
28
+ 'aria-label': {
29
+ type: String,
30
+ default: null
31
+ }
15
32
  },
16
33
  data() {
17
34
  return {
@@ -20,7 +37,7 @@ var script = {
20
37
  },
21
38
  methods: {
22
39
  onClick(event) {
23
- if (!this.$attrs.disabled) {
40
+ if (!this.disabled) {
24
41
  this.$emit('click', event);
25
42
  this.$emit('update:modelValue', this.value);
26
43
  this.$refs.input.focus();
@@ -30,11 +47,13 @@ var script = {
30
47
  }
31
48
  }
32
49
  },
33
- onFocus() {
50
+ onFocus(event) {
34
51
  this.focused = true;
52
+ this.$emit('focus', event);
35
53
  },
36
- onBlur() {
54
+ onBlur(event) {
37
55
  this.focused = false;
56
+ this.$emit('blur', event);
38
57
  }
39
58
  },
40
59
  computed: {
@@ -42,43 +61,50 @@ var script = {
42
61
  return this.modelValue != null && utils.ObjectUtils.equals(this.modelValue, this.value);
43
62
  },
44
63
  containerClass() {
45
- return ['p-radiobutton p-component', this.class, {'p-radiobutton-checked': this.checked, 'p-radiobutton-disabled': this.$attrs.disabled, 'p-radiobutton-focused': this.focused}];
64
+ return [
65
+ 'p-radiobutton p-component', {
66
+ 'p-radiobutton-checked': this.checked,
67
+ 'p-radiobutton-disabled': this.disabled,
68
+ 'p-radiobutton-focused': this.focused
69
+ }];
46
70
  }
47
71
  }
48
72
  };
49
73
 
50
74
  const _hoisted_1 = { class: "p-hidden-accessible" };
51
- const _hoisted_2 = ["checked", "value"];
52
- const _hoisted_3 = ["aria-checked"];
53
- const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
54
- const _hoisted_5 = [
55
- _hoisted_4
75
+ const _hoisted_2 = ["id", "name", "checked", "disabled", "value", "aria-labelledby", "aria-label"];
76
+ const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
77
+ const _hoisted_4 = [
78
+ _hoisted_3
56
79
  ];
57
80
 
58
81
  function render(_ctx, _cache, $props, $setup, $data, $options) {
59
82
  return (vue.openBlock(), vue.createElementBlock("div", {
60
83
  class: vue.normalizeClass($options.containerClass),
61
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
62
- style: vue.normalizeStyle($props.style)
84
+ onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
63
85
  }, [
64
86
  vue.createElementVNode("div", _hoisted_1, [
65
87
  vue.createElementVNode("input", vue.mergeProps({
66
88
  ref: "input",
67
89
  type: "radio",
90
+ id: $props.inputId,
91
+ class: $props.inputClass,
92
+ style: $props.inputStyle,
93
+ name: $props.name,
68
94
  checked: $options.checked,
69
- value: $props.value
70
- }, _ctx.$attrs, {
95
+ disabled: $props.disabled,
96
+ value: $props.value,
97
+ "aria-labelledby": _ctx.ariaLabelledby,
98
+ "aria-label": _ctx.ariaLabel,
71
99
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
72
100
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
73
- }), null, 16, _hoisted_2)
101
+ }, $props.inputProps), null, 16, _hoisted_2)
74
102
  ]),
75
103
  vue.createElementVNode("div", {
76
104
  ref: "box",
77
- class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
78
- role: "radio",
79
- "aria-checked": $options.checked
80
- }, _hoisted_5, 10, _hoisted_3)
81
- ], 6))
105
+ class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
106
+ }, _hoisted_4, 2)
107
+ ], 2))
82
108
  }
83
109
 
84
110
  script.render = render;
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/utils"),t=require("vue"),l={name:"RadioButton",inheritAttrs:!1,emits:["click","update:modelValue","change"],props:{value:null,modelValue:null,class:null,style:null},data:()=>({focused:!1}),methods:{onClick(e){this.$attrs.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{checked(){return null!=this.modelValue&&e.ObjectUtils.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",this.class,{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.$attrs.disabled,"p-radiobutton-focused":this.focused}]}}};const s={class:"p-hidden-accessible"},o=["checked","value"],c=["aria-checked"],i=[t.createElementVNode("div",{class:"p-radiobutton-icon"},null,-1)];l.render=function(e,l,a,u,d,n){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(n.containerClass),onClick:l[2]||(l[2]=e=>n.onClick(e)),style:t.normalizeStyle(a.style)},[t.createElementVNode("div",s,[t.createElementVNode("input",t.mergeProps({ref:"input",type:"radio",checked:n.checked,value:a.value},e.$attrs,{onFocus:l[0]||(l[0]=(...e)=>n.onFocus&&n.onFocus(...e)),onBlur:l[1]||(l[1]=(...e)=>n.onBlur&&n.onBlur(...e))}),null,16,o)]),t.createElementVNode("div",{ref:"box",class:t.normalizeClass(["p-radiobutton-box",{"p-highlight":n.checked,"p-disabled":e.$attrs.disabled,"p-focus":d.focused}]),role:"radio","aria-checked":n.checked},i,10,c)],6)},module.exports=l;
1
+ "use strict";var e=require("primevue/utils"),l=require("vue"),t={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},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(e){this.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return null!=this.modelValue&&e.ObjectUtils.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.disabled,"p-radiobutton-focused":this.focused}]}}};const a={class:"p-hidden-accessible"},i=["id","name","checked","disabled","value","aria-labelledby","aria-label"],u=[l.createElementVNode("div",{class:"p-radiobutton-icon"},null,-1)];t.render=function(e,t,s,n,d,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(o.containerClass),onClick:t[2]||(t[2]=e=>o.onClick(e))},[l.createElementVNode("div",a,[l.createElementVNode("input",l.mergeProps({ref:"input",type:"radio",id:s.inputId,class:s.inputClass,style:s.inputStyle,name:s.name,checked:o.checked,disabled:s.disabled,value:s.value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e))},s.inputProps),null,16,i)]),l.createElementVNode("div",{ref:"box",class:l.normalizeClass(["p-radiobutton-box",{"p-highlight":o.checked,"p-disabled":s.disabled,"p-focus":d.focused}])},u,2)],2)},module.exports=t;
@@ -1,15 +1,32 @@
1
1
  import { ObjectUtils } from 'primevue/utils';
2
- import { openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, mergeProps } from 'vue';
2
+ import { openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps } from 'vue';
3
3
 
4
4
  var script = {
5
5
  name: 'RadioButton',
6
- inheritAttrs: false,
7
- emits: ['click', 'update:modelValue', 'change'],
6
+ emits: ['click', 'update:modelValue', 'change', 'focus', 'blur'],
8
7
  props: {
9
8
  value: null,
10
9
  modelValue: null,
11
- class: null,
12
- style: null
10
+ name: {
11
+ type: String,
12
+ default: null
13
+ },
14
+ disabled: {
15
+ type: Boolean,
16
+ default: false
17
+ },
18
+ inputId: null,
19
+ inputClass: null,
20
+ inputStyle: null,
21
+ inputProps: null,
22
+ 'aria-labelledby': {
23
+ type: String,
24
+ default: null
25
+ },
26
+ 'aria-label': {
27
+ type: String,
28
+ default: null
29
+ }
13
30
  },
14
31
  data() {
15
32
  return {
@@ -18,7 +35,7 @@ var script = {
18
35
  },
19
36
  methods: {
20
37
  onClick(event) {
21
- if (!this.$attrs.disabled) {
38
+ if (!this.disabled) {
22
39
  this.$emit('click', event);
23
40
  this.$emit('update:modelValue', this.value);
24
41
  this.$refs.input.focus();
@@ -28,11 +45,13 @@ var script = {
28
45
  }
29
46
  }
30
47
  },
31
- onFocus() {
48
+ onFocus(event) {
32
49
  this.focused = true;
50
+ this.$emit('focus', event);
33
51
  },
34
- onBlur() {
52
+ onBlur(event) {
35
53
  this.focused = false;
54
+ this.$emit('blur', event);
36
55
  }
37
56
  },
38
57
  computed: {
@@ -40,43 +59,50 @@ var script = {
40
59
  return this.modelValue != null && ObjectUtils.equals(this.modelValue, this.value);
41
60
  },
42
61
  containerClass() {
43
- return ['p-radiobutton p-component', this.class, {'p-radiobutton-checked': this.checked, 'p-radiobutton-disabled': this.$attrs.disabled, 'p-radiobutton-focused': this.focused}];
62
+ return [
63
+ 'p-radiobutton p-component', {
64
+ 'p-radiobutton-checked': this.checked,
65
+ 'p-radiobutton-disabled': this.disabled,
66
+ 'p-radiobutton-focused': this.focused
67
+ }];
44
68
  }
45
69
  }
46
70
  };
47
71
 
48
72
  const _hoisted_1 = { class: "p-hidden-accessible" };
49
- const _hoisted_2 = ["checked", "value"];
50
- const _hoisted_3 = ["aria-checked"];
51
- const _hoisted_4 = /*#__PURE__*/createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
52
- const _hoisted_5 = [
53
- _hoisted_4
73
+ const _hoisted_2 = ["id", "name", "checked", "disabled", "value", "aria-labelledby", "aria-label"];
74
+ const _hoisted_3 = /*#__PURE__*/createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
75
+ const _hoisted_4 = [
76
+ _hoisted_3
54
77
  ];
55
78
 
56
79
  function render(_ctx, _cache, $props, $setup, $data, $options) {
57
80
  return (openBlock(), createElementBlock("div", {
58
81
  class: normalizeClass($options.containerClass),
59
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
60
- style: normalizeStyle($props.style)
82
+ onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
61
83
  }, [
62
84
  createElementVNode("div", _hoisted_1, [
63
85
  createElementVNode("input", mergeProps({
64
86
  ref: "input",
65
87
  type: "radio",
88
+ id: $props.inputId,
89
+ class: $props.inputClass,
90
+ style: $props.inputStyle,
91
+ name: $props.name,
66
92
  checked: $options.checked,
67
- value: $props.value
68
- }, _ctx.$attrs, {
93
+ disabled: $props.disabled,
94
+ value: $props.value,
95
+ "aria-labelledby": _ctx.ariaLabelledby,
96
+ "aria-label": _ctx.ariaLabel,
69
97
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
70
98
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
71
- }), null, 16, _hoisted_2)
99
+ }, $props.inputProps), null, 16, _hoisted_2)
72
100
  ]),
73
101
  createElementVNode("div", {
74
102
  ref: "box",
75
- class: normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
76
- role: "radio",
77
- "aria-checked": $options.checked
78
- }, _hoisted_5, 10, _hoisted_3)
79
- ], 6))
103
+ class: normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
104
+ }, _hoisted_4, 2)
105
+ ], 2))
80
106
  }
81
107
 
82
108
  script.render = render;
@@ -1 +1 @@
1
- import{ObjectUtils as e}from"primevue/utils";import{openBlock as t,createElementBlock as s,normalizeClass as i,normalizeStyle as o,createElementVNode as l,mergeProps as c}from"vue";var u={name:"RadioButton",inheritAttrs:!1,emits:["click","update:modelValue","change"],props:{value:null,modelValue:null,class:null,style:null},data:()=>({focused:!1}),methods:{onClick(e){this.$attrs.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{checked(){return null!=this.modelValue&&e.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",this.class,{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.$attrs.disabled,"p-radiobutton-focused":this.focused}]}}};const a={class:"p-hidden-accessible"},d=["checked","value"],n=["aria-checked"],r=[l("div",{class:"p-radiobutton-icon"},null,-1)];u.render=function(e,u,h,p,m,k){return t(),s("div",{class:i(k.containerClass),onClick:u[2]||(u[2]=e=>k.onClick(e)),style:o(h.style)},[l("div",a,[l("input",c({ref:"input",type:"radio",checked:k.checked,value:h.value},e.$attrs,{onFocus:u[0]||(u[0]=(...e)=>k.onFocus&&k.onFocus(...e)),onBlur:u[1]||(u[1]=(...e)=>k.onBlur&&k.onBlur(...e))}),null,16,d)]),l("div",{ref:"box",class:i(["p-radiobutton-box",{"p-highlight":k.checked,"p-disabled":e.$attrs.disabled,"p-focus":m.focused}]),role:"radio","aria-checked":k.checked},r,10,n)],6)};export{u as default};
1
+ import{ObjectUtils as e}from"primevue/utils";import{openBlock as l,createElementBlock as i,normalizeClass as a,createElementVNode as t,mergeProps as u}from"vue";var s={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},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(e){this.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return null!=this.modelValue&&e.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.disabled,"p-radiobutton-focused":this.focused}]}}};const d={class:"p-hidden-accessible"},n=["id","name","checked","disabled","value","aria-labelledby","aria-label"],o=[t("div",{class:"p-radiobutton-icon"},null,-1)];s.render=function(e,s,c,r,p,b){return l(),i("div",{class:a(b.containerClass),onClick:s[2]||(s[2]=e=>b.onClick(e))},[t("div",d,[t("input",u({ref:"input",type:"radio",id:c.inputId,class:c.inputClass,style:c.inputStyle,name:c.name,checked:b.checked,disabled:c.disabled,value:c.value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:s[0]||(s[0]=(...e)=>b.onFocus&&b.onFocus(...e)),onBlur:s[1]||(s[1]=(...e)=>b.onBlur&&b.onBlur(...e))},c.inputProps),null,16,n)]),t("div",{ref:"box",class:a(["p-radiobutton-box",{"p-highlight":b.checked,"p-disabled":c.disabled,"p-focus":p.focused}])},o,2)],2)};export{s as default};
@@ -4,13 +4,30 @@ this.primevue.radiobutton = (function (utils, vue) {
4
4
 
5
5
  var script = {
6
6
  name: 'RadioButton',
7
- inheritAttrs: false,
8
- emits: ['click', 'update:modelValue', 'change'],
7
+ emits: ['click', 'update:modelValue', 'change', 'focus', 'blur'],
9
8
  props: {
10
9
  value: null,
11
10
  modelValue: null,
12
- class: null,
13
- style: null
11
+ name: {
12
+ type: String,
13
+ default: null
14
+ },
15
+ disabled: {
16
+ type: Boolean,
17
+ default: false
18
+ },
19
+ inputId: null,
20
+ inputClass: null,
21
+ inputStyle: null,
22
+ inputProps: null,
23
+ 'aria-labelledby': {
24
+ type: String,
25
+ default: null
26
+ },
27
+ 'aria-label': {
28
+ type: String,
29
+ default: null
30
+ }
14
31
  },
15
32
  data() {
16
33
  return {
@@ -19,7 +36,7 @@ this.primevue.radiobutton = (function (utils, vue) {
19
36
  },
20
37
  methods: {
21
38
  onClick(event) {
22
- if (!this.$attrs.disabled) {
39
+ if (!this.disabled) {
23
40
  this.$emit('click', event);
24
41
  this.$emit('update:modelValue', this.value);
25
42
  this.$refs.input.focus();
@@ -29,11 +46,13 @@ this.primevue.radiobutton = (function (utils, vue) {
29
46
  }
30
47
  }
31
48
  },
32
- onFocus() {
49
+ onFocus(event) {
33
50
  this.focused = true;
51
+ this.$emit('focus', event);
34
52
  },
35
- onBlur() {
53
+ onBlur(event) {
36
54
  this.focused = false;
55
+ this.$emit('blur', event);
37
56
  }
38
57
  },
39
58
  computed: {
@@ -41,43 +60,50 @@ this.primevue.radiobutton = (function (utils, vue) {
41
60
  return this.modelValue != null && utils.ObjectUtils.equals(this.modelValue, this.value);
42
61
  },
43
62
  containerClass() {
44
- return ['p-radiobutton p-component', this.class, {'p-radiobutton-checked': this.checked, 'p-radiobutton-disabled': this.$attrs.disabled, 'p-radiobutton-focused': this.focused}];
63
+ return [
64
+ 'p-radiobutton p-component', {
65
+ 'p-radiobutton-checked': this.checked,
66
+ 'p-radiobutton-disabled': this.disabled,
67
+ 'p-radiobutton-focused': this.focused
68
+ }];
45
69
  }
46
70
  }
47
71
  };
48
72
 
49
73
  const _hoisted_1 = { class: "p-hidden-accessible" };
50
- const _hoisted_2 = ["checked", "value"];
51
- const _hoisted_3 = ["aria-checked"];
52
- const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
53
- const _hoisted_5 = [
54
- _hoisted_4
74
+ const _hoisted_2 = ["id", "name", "checked", "disabled", "value", "aria-labelledby", "aria-label"];
75
+ const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("div", { class: "p-radiobutton-icon" }, null, -1);
76
+ const _hoisted_4 = [
77
+ _hoisted_3
55
78
  ];
56
79
 
57
80
  function render(_ctx, _cache, $props, $setup, $data, $options) {
58
81
  return (vue.openBlock(), vue.createElementBlock("div", {
59
82
  class: vue.normalizeClass($options.containerClass),
60
- onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event))),
61
- style: vue.normalizeStyle($props.style)
83
+ onClick: _cache[2] || (_cache[2] = $event => ($options.onClick($event)))
62
84
  }, [
63
85
  vue.createElementVNode("div", _hoisted_1, [
64
86
  vue.createElementVNode("input", vue.mergeProps({
65
87
  ref: "input",
66
88
  type: "radio",
89
+ id: $props.inputId,
90
+ class: $props.inputClass,
91
+ style: $props.inputStyle,
92
+ name: $props.name,
67
93
  checked: $options.checked,
68
- value: $props.value
69
- }, _ctx.$attrs, {
94
+ disabled: $props.disabled,
95
+ value: $props.value,
96
+ "aria-labelledby": _ctx.ariaLabelledby,
97
+ "aria-label": _ctx.ariaLabel,
70
98
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
71
99
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args)))
72
- }), null, 16, _hoisted_2)
100
+ }, $props.inputProps), null, 16, _hoisted_2)
73
101
  ]),
74
102
  vue.createElementVNode("div", {
75
103
  ref: "box",
76
- class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': _ctx.$attrs.disabled, 'p-focus': $data.focused}]),
77
- role: "radio",
78
- "aria-checked": $options.checked
79
- }, _hoisted_5, 10, _hoisted_3)
80
- ], 6))
104
+ class: vue.normalizeClass(['p-radiobutton-box', {'p-highlight': $options.checked, 'p-disabled': $props.disabled, 'p-focus': $data.focused}])
105
+ }, _hoisted_4, 2)
106
+ ], 2))
81
107
  }
82
108
 
83
109
  script.render = render;
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.radiobutton=function(e,t){"use strict";var s={name:"RadioButton",inheritAttrs:!1,emits:["click","update:modelValue","change"],props:{value:null,modelValue:null,class:null,style:null},data:()=>({focused:!1}),methods:{onClick(e){this.$attrs.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{checked(){return null!=this.modelValue&&e.ObjectUtils.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",this.class,{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.$attrs.disabled,"p-radiobutton-focused":this.focused}]}}};const l={class:"p-hidden-accessible"},i=["checked","value"],o=["aria-checked"],c=[t.createElementVNode("div",{class:"p-radiobutton-icon"},null,-1)];return s.render=function(e,s,a,u,n,d){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(d.containerClass),onClick:s[2]||(s[2]=e=>d.onClick(e)),style:t.normalizeStyle(a.style)},[t.createElementVNode("div",l,[t.createElementVNode("input",t.mergeProps({ref:"input",type:"radio",checked:d.checked,value:a.value},e.$attrs,{onFocus:s[0]||(s[0]=(...e)=>d.onFocus&&d.onFocus(...e)),onBlur:s[1]||(s[1]=(...e)=>d.onBlur&&d.onBlur(...e))}),null,16,i)]),t.createElementVNode("div",{ref:"box",class:t.normalizeClass(["p-radiobutton-box",{"p-highlight":d.checked,"p-disabled":e.$attrs.disabled,"p-focus":n.focused}]),role:"radio","aria-checked":d.checked},c,10,o)],6)},s}(primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.radiobutton=function(e,l){"use strict";var t={name:"RadioButton",emits:["click","update:modelValue","change","focus","blur"],props:{value:null,modelValue:null,name:{type:String,default:null},disabled:{type:Boolean,default:!1},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(e){this.disabled||(this.$emit("click",e),this.$emit("update:modelValue",this.value),this.$refs.input.focus(),this.checked||this.$emit("change",e))},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.$emit("blur",e)}},computed:{checked(){return null!=this.modelValue&&e.ObjectUtils.equals(this.modelValue,this.value)},containerClass(){return["p-radiobutton p-component",{"p-radiobutton-checked":this.checked,"p-radiobutton-disabled":this.disabled,"p-radiobutton-focused":this.focused}]}}};const i={class:"p-hidden-accessible"},a=["id","name","checked","disabled","value","aria-labelledby","aria-label"],u=[l.createElementVNode("div",{class:"p-radiobutton-icon"},null,-1)];return t.render=function(e,t,s,n,d,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(o.containerClass),onClick:t[2]||(t[2]=e=>o.onClick(e))},[l.createElementVNode("div",i,[l.createElementVNode("input",l.mergeProps({ref:"input",type:"radio",id:s.inputId,class:s.inputClass,style:s.inputStyle,name:s.name,checked:o.checked,disabled:s.disabled,value:s.value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e))},s.inputProps),null,16,a)]),l.createElementVNode("div",{ref:"box",class:l.normalizeClass(["p-radiobutton-box",{"p-highlight":o.checked,"p-disabled":s.disabled,"p-focus":d.focused}])},u,2)],2)},t}(primevue.utils,Vue);
@@ -16,6 +16,10 @@ export interface RatingProps {
16
16
  * Value of the rating.
17
17
  */
18
18
  modelValue?: number | undefined;
19
+ /**
20
+ * Name of the element.
21
+ */
22
+ name?: string | undefined;
19
23
  /**
20
24
  * When present, it specifies that the element should be disabled.
21
25
  */
package/rating/Rating.vue CHANGED
@@ -1,19 +1,32 @@
1
1
  <template>
2
2
  <div :class="containerClass">
3
- <span class="p-rating-icon p-rating-cancel pi pi-ban" :tabindex="focusIndex" v-if="cancel" @click="onCancelClick"></span>
4
- <span :key="i" v-for="i in stars" @click="onStarClick($event,i)" :tabindex="focusIndex" @keydown.enter.prevent="onStarClick($event,i)"
5
- :class="['p-rating-icon', {'pi pi-star': (i > modelValue), 'pi pi-star-fill': (i <= modelValue)}]"></span>
3
+ <span :class="['p-rating-icon p-rating-cancel pi pi-ban', {'p-focus': focusIndex === 0}]" v-if="cancel" @click="onCancelClick" @keydown="onKeyDown">
4
+ <span class="p-hidden-accessible" v-if="cancel">
5
+ <input type="radio" value="0" :name="name" :checked="modelValue === 0" :disabled="disabled" :readonly="readonly" :aria-label="$primevue.config.locale.clear" @focus="onFocus($event, 0)" @blur="onBlur" @keydown="onKeyDown($event, 0)">
6
+ </span>
7
+ </span>
8
+ <template :key="i" v-for="i in stars">
9
+ <span :class="['p-rating-icon', {'pi pi-star': (i > modelValue), 'pi pi-star-fill': (i <= modelValue), 'p-focus': i === focusIndex}]" @click="onStarClick($event,i)">
10
+ <span class="p-hidden-accessible">
11
+ <input type="radio" :value="i" :name="name" :checked="modelValue === i" :disabled="disabled" :readonly="readonly" :aria-label="ariaLabelTemplate(i)" @focus="onFocus($event, i)" @blur="onBlur" @keydown="onKeyDown($event,i)">
12
+ </span>
13
+ </span>
14
+ </template>
6
15
  </div>
7
16
  </template>
8
17
 
9
18
  <script>
10
19
  export default {
11
20
  name: 'Rating',
12
- emits: ['update:modelValue', 'change'],
21
+ emits: ['update:modelValue', 'change', 'focus', 'blur'],
13
22
  props: {
14
23
  modelValue: {
15
24
  type: Number,
16
25
  default: null
26
+ },
27
+ name: {
28
+ type: String,
29
+ default: null
17
30
  },
18
31
  disabled: {
19
32
  type: Boolean,
@@ -32,12 +45,46 @@ export default {
32
45
  default: true
33
46
  }
34
47
  },
48
+ data() {
49
+ return {
50
+ focusIndex: null
51
+ };
52
+ },
35
53
  methods: {
36
54
  onStarClick(event, value) {
37
55
  if (!this.readonly && !this.disabled) {
38
56
  this.updateModel(event, value);
57
+ this.focusIndex = value;
58
+ }
59
+ },
60
+ onKeyDown(event, value) {
61
+ if (event.code === 'Space') {
62
+ this.updateModel(event, value);
63
+ }
64
+ if (event.code === 'Tab') {
65
+ this.focusIndex = null;
66
+ }
67
+ },
68
+ onFocus(event, index) {
69
+ if (!this.readonly) {
70
+ if (this.modelValue === null && this.focusIndex === null) {
71
+ this.cancel ? this.focusIndex = 0 : this.focusIndex = 1;
72
+ }
73
+ else if (this.modelValue !== null && this.focusIndex === null) {
74
+ this.focusIndex = this.modelValue;
75
+ this.updateModel(event, this.modelValue);
76
+ }
77
+ else {
78
+ this.focusIndex = index;
79
+ this.updateModel(event, index);
80
+ }
81
+
82
+ this.$emit('focus', event);
39
83
  }
40
84
  },
85
+ onBlur(event) {
86
+ this.$emit('blur', event);
87
+ },
41
88
  onCancelClick(event) {
42
89
  if (!this.readonly && !this.disabled) {
43
90
  this.updateModel(event, null);
@@ -49,6 +96,9 @@ export default {
49
96
  originalEvent: event,
50
97
  value: value
51
98
  });
99
+ },
100
+ ariaLabelTemplate(index) {
101
+ return index === 1 ? this.$primevue.config.locale.aria.star : this.$primevue.config.locale.aria.stars.replace(/{star}/g, index);
52
102
  }
53
103
  },
54
104
  computed: {
@@ -60,9 +110,6 @@ export default {
60
110
  'p-disabled': this.disabled
61
111
  }
62
112
  ];
63
- },
64
- focusIndex() {
65
- return (this.disabled || this.readonly) ? null : '0';
66
113
  }
67
114
  }
68
115
  }
@@ -76,4 +123,11 @@ export default {
76
123
  .p-rating.p-rating-readonly .p-rating-icon {
77
124
  cursor: default;
78
125
  }
126
+
127
+ .p-rating:not(.p-disabled) .p-rating-icon.p-focus {
128
+ outline: 0 none;
129
+ outline-offset: 0;
130
+ box-shadow: 0 0 0 0.2rem #BFDBFE;
131
+ border-color: #3B82F6;
132
+ }
79
133
  </style>