primereact 10.5.0 → 10.5.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 (656) hide show
  1. package/api/api.cjs.js +94 -92
  2. package/api/api.cjs.min.js +1 -1
  3. package/api/api.d.ts +231 -13
  4. package/api/api.esm.js +94 -92
  5. package/api/api.esm.min.js +1 -1
  6. package/api/api.js +94 -92
  7. package/api/api.min.js +1 -1
  8. package/autocomplete/autocomplete.cjs.js +91 -48
  9. package/autocomplete/autocomplete.cjs.min.js +1 -1
  10. package/autocomplete/autocomplete.d.ts +6 -1
  11. package/autocomplete/autocomplete.esm.js +91 -48
  12. package/autocomplete/autocomplete.esm.min.js +1 -1
  13. package/autocomplete/autocomplete.js +91 -48
  14. package/autocomplete/autocomplete.min.js +1 -1
  15. package/blockui/blockui.cjs.js +13 -13
  16. package/blockui/blockui.cjs.min.js +1 -1
  17. package/blockui/blockui.esm.js +13 -13
  18. package/blockui/blockui.esm.min.js +1 -1
  19. package/blockui/blockui.js +13 -13
  20. package/blockui/blockui.min.js +1 -1
  21. package/breadcrumb/breadcrumb.cjs.js +4 -3
  22. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  23. package/breadcrumb/breadcrumb.esm.js +4 -3
  24. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  25. package/breadcrumb/breadcrumb.js +4 -3
  26. package/breadcrumb/breadcrumb.min.js +1 -1
  27. package/button/button.cjs.js +2 -3
  28. package/button/button.cjs.min.js +1 -1
  29. package/button/button.esm.js +2 -3
  30. package/button/button.esm.min.js +1 -1
  31. package/button/button.js +2 -3
  32. package/button/button.min.js +1 -1
  33. package/calendar/calendar.cjs.js +30 -11
  34. package/calendar/calendar.cjs.min.js +1 -1
  35. package/calendar/calendar.d.ts +9 -0
  36. package/calendar/calendar.esm.js +30 -11
  37. package/calendar/calendar.esm.min.js +1 -1
  38. package/calendar/calendar.js +30 -11
  39. package/calendar/calendar.min.js +1 -1
  40. package/carousel/carousel.cjs.js +17 -15
  41. package/carousel/carousel.cjs.min.js +1 -1
  42. package/carousel/carousel.esm.js +4 -2
  43. package/carousel/carousel.esm.min.js +1 -1
  44. package/carousel/carousel.js +17 -15
  45. package/carousel/carousel.min.js +1 -1
  46. package/cascadeselect/cascadeselect.cjs.js +28 -14
  47. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  48. package/cascadeselect/cascadeselect.d.ts +5 -0
  49. package/cascadeselect/cascadeselect.esm.js +28 -14
  50. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  51. package/cascadeselect/cascadeselect.js +28 -14
  52. package/cascadeselect/cascadeselect.min.js +1 -1
  53. package/checkbox/checkbox.cjs.js +72 -156
  54. package/checkbox/checkbox.cjs.min.js +1 -1
  55. package/checkbox/checkbox.d.ts +10 -34
  56. package/checkbox/checkbox.esm.js +72 -156
  57. package/checkbox/checkbox.esm.min.js +1 -1
  58. package/checkbox/checkbox.js +72 -156
  59. package/checkbox/checkbox.min.js +1 -1
  60. package/chips/chips.cjs.js +25 -12
  61. package/chips/chips.cjs.min.js +1 -1
  62. package/chips/chips.d.ts +6 -1
  63. package/chips/chips.esm.js +25 -12
  64. package/chips/chips.esm.min.js +1 -1
  65. package/chips/chips.js +25 -12
  66. package/chips/chips.min.js +1 -1
  67. package/colorpicker/colorpicker.cjs.js +5 -5
  68. package/colorpicker/colorpicker.cjs.min.js +1 -1
  69. package/colorpicker/colorpicker.esm.js +4 -4
  70. package/colorpicker/colorpicker.esm.min.js +1 -1
  71. package/colorpicker/colorpicker.js +5 -5
  72. package/colorpicker/colorpicker.min.js +1 -1
  73. package/componentbase/componentbase.cjs.js +4 -6
  74. package/componentbase/componentbase.cjs.min.js +1 -1
  75. package/componentbase/componentbase.esm.js +5 -7
  76. package/componentbase/componentbase.esm.min.js +1 -1
  77. package/componentbase/componentbase.js +4 -6
  78. package/componentbase/componentbase.min.js +1 -1
  79. package/confirmdialog/confirmdialog.cjs.js +7 -2
  80. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  81. package/confirmdialog/confirmdialog.esm.js +7 -2
  82. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  83. package/confirmdialog/confirmdialog.js +8 -3
  84. package/confirmdialog/confirmdialog.min.js +1 -1
  85. package/confirmpopup/confirmpopup.cjs.js +5 -5
  86. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  87. package/confirmpopup/confirmpopup.esm.js +5 -5
  88. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  89. package/confirmpopup/confirmpopup.js +5 -5
  90. package/confirmpopup/confirmpopup.min.js +1 -1
  91. package/contextmenu/contextmenu.cjs.js +4 -3
  92. package/contextmenu/contextmenu.cjs.min.js +1 -1
  93. package/contextmenu/contextmenu.esm.js +4 -3
  94. package/contextmenu/contextmenu.esm.min.js +1 -1
  95. package/contextmenu/contextmenu.js +4 -3
  96. package/contextmenu/contextmenu.min.js +1 -1
  97. package/core/core.js +2773 -20019
  98. package/core/core.min.js +41 -41
  99. package/datatable/datatable.cjs.js +134 -115
  100. package/datatable/datatable.cjs.min.js +1 -1
  101. package/datatable/datatable.d.ts +11 -3
  102. package/datatable/datatable.esm.js +134 -115
  103. package/datatable/datatable.esm.min.js +1 -1
  104. package/datatable/datatable.js +134 -115
  105. package/datatable/datatable.min.js +1 -1
  106. package/dataview/dataview.cjs.js +16 -13
  107. package/dataview/dataview.cjs.min.js +1 -1
  108. package/dataview/dataview.esm.js +4 -1
  109. package/dataview/dataview.esm.min.js +1 -1
  110. package/dataview/dataview.js +17 -15
  111. package/dataview/dataview.min.js +1 -1
  112. package/dialog/dialog.cjs.js +6 -6
  113. package/dialog/dialog.cjs.min.js +1 -1
  114. package/dialog/dialog.esm.js +6 -6
  115. package/dialog/dialog.esm.min.js +1 -1
  116. package/dialog/dialog.js +6 -6
  117. package/dialog/dialog.min.js +1 -1
  118. package/dropdown/dropdown.cjs.js +123 -53
  119. package/dropdown/dropdown.cjs.min.js +1 -1
  120. package/dropdown/dropdown.d.ts +41 -0
  121. package/dropdown/dropdown.esm.js +123 -53
  122. package/dropdown/dropdown.esm.min.js +1 -1
  123. package/dropdown/dropdown.js +123 -55
  124. package/dropdown/dropdown.min.js +1 -1
  125. package/editor/editor.cjs.js +125 -54
  126. package/editor/editor.cjs.min.js +1 -1
  127. package/editor/editor.esm.js +125 -54
  128. package/editor/editor.esm.min.js +1 -1
  129. package/editor/editor.js +125 -54
  130. package/editor/editor.min.js +1 -1
  131. package/galleria/galleria.cjs.js +22 -19
  132. package/galleria/galleria.cjs.min.js +1 -1
  133. package/galleria/galleria.esm.js +4 -1
  134. package/galleria/galleria.esm.min.js +1 -1
  135. package/galleria/galleria.js +23 -20
  136. package/galleria/galleria.min.js +1 -1
  137. package/hooks/hooks.cjs.js +115 -72
  138. package/hooks/hooks.cjs.min.js +1 -1
  139. package/hooks/hooks.esm.js +116 -73
  140. package/hooks/hooks.esm.min.js +1 -1
  141. package/hooks/hooks.js +115 -72
  142. package/hooks/hooks.min.js +1 -1
  143. package/icons/arrowdown/index.cjs.js +2 -642
  144. package/icons/arrowdown/index.cjs.min.js +1 -1
  145. package/icons/arrowdown/index.esm.js +2 -642
  146. package/icons/arrowdown/index.esm.min.js +1 -1
  147. package/icons/arrowdown/index.js +2 -642
  148. package/icons/arrowdown/index.min.js +1 -1
  149. package/icons/arrowup/index.cjs.js +2 -642
  150. package/icons/arrowup/index.cjs.min.js +1 -1
  151. package/icons/arrowup/index.esm.js +2 -642
  152. package/icons/arrowup/index.esm.min.js +1 -1
  153. package/icons/arrowup/index.js +2 -642
  154. package/icons/arrowup/index.min.js +1 -1
  155. package/icons/ban/index.cjs.js +2 -642
  156. package/icons/ban/index.cjs.min.js +1 -1
  157. package/icons/ban/index.esm.js +2 -642
  158. package/icons/ban/index.esm.min.js +1 -1
  159. package/icons/ban/index.js +2 -642
  160. package/icons/ban/index.min.js +1 -1
  161. package/icons/blank/index.cjs.js +62 -0
  162. package/icons/blank/index.cjs.min.js +1 -0
  163. package/icons/blank/index.d.ts +19 -0
  164. package/icons/blank/index.esm.js +38 -0
  165. package/icons/blank/index.esm.min.js +1 -0
  166. package/icons/blank/index.js +65 -0
  167. package/icons/blank/index.min.js +1 -0
  168. package/icons/blank/package.json +7 -0
  169. package/icons/download/index.cjs.js +2 -642
  170. package/icons/download/index.cjs.min.js +1 -1
  171. package/icons/download/index.esm.js +2 -642
  172. package/icons/download/index.esm.min.js +1 -1
  173. package/icons/download/index.js +2 -642
  174. package/icons/download/index.min.js +1 -1
  175. package/icons/exclamationtriangle/index.cjs.js +2 -642
  176. package/icons/exclamationtriangle/index.cjs.min.js +1 -1
  177. package/icons/exclamationtriangle/index.esm.js +2 -642
  178. package/icons/exclamationtriangle/index.esm.min.js +1 -1
  179. package/icons/exclamationtriangle/index.js +2 -642
  180. package/icons/exclamationtriangle/index.min.js +1 -1
  181. package/icons/eyeslash/index.cjs.js +2 -642
  182. package/icons/eyeslash/index.cjs.min.js +1 -1
  183. package/icons/eyeslash/index.esm.js +2 -642
  184. package/icons/eyeslash/index.esm.min.js +1 -1
  185. package/icons/eyeslash/index.js +2 -642
  186. package/icons/eyeslash/index.min.js +1 -1
  187. package/icons/filter/index.cjs.js +2 -642
  188. package/icons/filter/index.cjs.min.js +1 -1
  189. package/icons/filter/index.esm.js +2 -642
  190. package/icons/filter/index.esm.min.js +1 -1
  191. package/icons/filter/index.js +2 -642
  192. package/icons/filter/index.min.js +1 -1
  193. package/icons/filterslash/index.cjs.js +2 -642
  194. package/icons/filterslash/index.cjs.min.js +1 -1
  195. package/icons/filterslash/index.esm.js +2 -642
  196. package/icons/filterslash/index.esm.min.js +1 -1
  197. package/icons/filterslash/index.js +2 -642
  198. package/icons/filterslash/index.min.js +1 -1
  199. package/icons/infocircle/index.cjs.js +2 -642
  200. package/icons/infocircle/index.cjs.min.js +1 -1
  201. package/icons/infocircle/index.esm.js +2 -642
  202. package/icons/infocircle/index.esm.min.js +1 -1
  203. package/icons/infocircle/index.js +2 -642
  204. package/icons/infocircle/index.min.js +1 -1
  205. package/icons/pencil/index.cjs.js +2 -642
  206. package/icons/pencil/index.cjs.min.js +1 -1
  207. package/icons/pencil/index.esm.js +2 -642
  208. package/icons/pencil/index.esm.min.js +1 -1
  209. package/icons/pencil/index.js +2 -642
  210. package/icons/pencil/index.min.js +1 -1
  211. package/icons/plus/index.cjs.js +2 -642
  212. package/icons/plus/index.cjs.min.js +1 -1
  213. package/icons/plus/index.esm.js +2 -642
  214. package/icons/plus/index.esm.min.js +1 -1
  215. package/icons/plus/index.js +2 -642
  216. package/icons/plus/index.min.js +1 -1
  217. package/icons/refresh/index.cjs.js +2 -642
  218. package/icons/refresh/index.cjs.min.js +1 -1
  219. package/icons/refresh/index.esm.js +2 -642
  220. package/icons/refresh/index.esm.min.js +1 -1
  221. package/icons/refresh/index.js +2 -642
  222. package/icons/refresh/index.min.js +1 -1
  223. package/icons/search/index.cjs.js +2 -642
  224. package/icons/search/index.cjs.min.js +1 -1
  225. package/icons/search/index.esm.js +2 -642
  226. package/icons/search/index.esm.min.js +1 -1
  227. package/icons/search/index.js +2 -642
  228. package/icons/search/index.min.js +1 -1
  229. package/icons/searchminus/index.cjs.js +2 -642
  230. package/icons/searchminus/index.cjs.min.js +1 -1
  231. package/icons/searchminus/index.esm.js +2 -642
  232. package/icons/searchminus/index.esm.min.js +1 -1
  233. package/icons/searchminus/index.js +2 -642
  234. package/icons/searchminus/index.min.js +1 -1
  235. package/icons/searchplus/index.cjs.js +2 -642
  236. package/icons/searchplus/index.cjs.min.js +1 -1
  237. package/icons/searchplus/index.esm.js +2 -642
  238. package/icons/searchplus/index.esm.min.js +1 -1
  239. package/icons/searchplus/index.js +2 -642
  240. package/icons/searchplus/index.min.js +1 -1
  241. package/icons/sortalt/index.cjs.js +2 -642
  242. package/icons/sortalt/index.cjs.min.js +1 -1
  243. package/icons/sortalt/index.esm.js +2 -642
  244. package/icons/sortalt/index.esm.min.js +1 -1
  245. package/icons/sortalt/index.js +2 -642
  246. package/icons/sortalt/index.min.js +1 -1
  247. package/icons/sortamountdown/index.cjs.js +2 -642
  248. package/icons/sortamountdown/index.cjs.min.js +1 -1
  249. package/icons/sortamountdown/index.esm.js +2 -642
  250. package/icons/sortamountdown/index.esm.min.js +1 -1
  251. package/icons/sortamountdown/index.js +2 -642
  252. package/icons/sortamountdown/index.min.js +1 -1
  253. package/icons/sortamountupalt/index.cjs.js +2 -642
  254. package/icons/sortamountupalt/index.cjs.min.js +1 -1
  255. package/icons/sortamountupalt/index.esm.js +2 -642
  256. package/icons/sortamountupalt/index.esm.min.js +1 -1
  257. package/icons/sortamountupalt/index.js +2 -642
  258. package/icons/sortamountupalt/index.min.js +1 -1
  259. package/icons/spinner/index.cjs.js +2 -642
  260. package/icons/spinner/index.cjs.min.js +1 -1
  261. package/icons/spinner/index.esm.js +2 -642
  262. package/icons/spinner/index.esm.min.js +1 -1
  263. package/icons/spinner/index.js +2 -642
  264. package/icons/spinner/index.min.js +1 -1
  265. package/icons/star/index.cjs.js +2 -642
  266. package/icons/star/index.cjs.min.js +1 -1
  267. package/icons/star/index.esm.js +2 -642
  268. package/icons/star/index.esm.min.js +1 -1
  269. package/icons/star/index.js +2 -642
  270. package/icons/star/index.min.js +1 -1
  271. package/icons/starfill/index.cjs.js +2 -642
  272. package/icons/starfill/index.cjs.min.js +1 -1
  273. package/icons/starfill/index.esm.js +2 -642
  274. package/icons/starfill/index.esm.min.js +1 -1
  275. package/icons/starfill/index.js +2 -642
  276. package/icons/starfill/index.min.js +1 -1
  277. package/icons/thlarge/index.cjs.js +2 -642
  278. package/icons/thlarge/index.cjs.min.js +1 -1
  279. package/icons/thlarge/index.esm.js +2 -642
  280. package/icons/thlarge/index.esm.min.js +1 -1
  281. package/icons/thlarge/index.js +2 -642
  282. package/icons/thlarge/index.min.js +1 -1
  283. package/icons/timescircle/index.cjs.js +2 -642
  284. package/icons/timescircle/index.cjs.min.js +1 -1
  285. package/icons/timescircle/index.esm.js +2 -642
  286. package/icons/timescircle/index.esm.min.js +1 -1
  287. package/icons/timescircle/index.js +2 -642
  288. package/icons/timescircle/index.min.js +1 -1
  289. package/icons/trash/index.cjs.js +2 -642
  290. package/icons/trash/index.cjs.min.js +1 -1
  291. package/icons/trash/index.esm.js +2 -642
  292. package/icons/trash/index.esm.min.js +1 -1
  293. package/icons/trash/index.js +2 -642
  294. package/icons/trash/index.min.js +1 -1
  295. package/icons/undo/index.cjs.js +2 -642
  296. package/icons/undo/index.cjs.min.js +1 -1
  297. package/icons/undo/index.esm.js +2 -642
  298. package/icons/undo/index.esm.min.js +1 -1
  299. package/icons/undo/index.js +2 -642
  300. package/icons/undo/index.min.js +1 -1
  301. package/icons/upload/index.cjs.js +2 -642
  302. package/icons/upload/index.cjs.min.js +1 -1
  303. package/icons/upload/index.esm.js +2 -642
  304. package/icons/upload/index.esm.min.js +1 -1
  305. package/icons/upload/index.js +2 -642
  306. package/icons/upload/index.min.js +1 -1
  307. package/icons/windowmaximize/index.cjs.js +2 -642
  308. package/icons/windowmaximize/index.cjs.min.js +1 -1
  309. package/icons/windowmaximize/index.esm.js +2 -642
  310. package/icons/windowmaximize/index.esm.min.js +1 -1
  311. package/icons/windowmaximize/index.js +2 -642
  312. package/icons/windowmaximize/index.min.js +1 -1
  313. package/icons/windowminimize/index.cjs.js +2 -642
  314. package/icons/windowminimize/index.cjs.min.js +1 -1
  315. package/icons/windowminimize/index.esm.js +2 -642
  316. package/icons/windowminimize/index.esm.min.js +1 -1
  317. package/icons/windowminimize/index.js +2 -642
  318. package/icons/windowminimize/index.min.js +1 -1
  319. package/image/image.cjs.js +18 -575
  320. package/image/image.cjs.min.js +1 -1
  321. package/image/image.esm.js +20 -577
  322. package/image/image.esm.min.js +1 -1
  323. package/image/image.js +18 -575
  324. package/image/image.min.js +1 -1
  325. package/inputnumber/inputnumber.cjs.js +22 -39
  326. package/inputnumber/inputnumber.cjs.min.js +1 -1
  327. package/inputnumber/inputnumber.d.ts +5 -5
  328. package/inputnumber/inputnumber.esm.js +22 -39
  329. package/inputnumber/inputnumber.esm.min.js +1 -1
  330. package/inputnumber/inputnumber.js +22 -39
  331. package/inputnumber/inputnumber.min.js +1 -1
  332. package/inputswitch/inputswitch.cjs.js +20 -96
  333. package/inputswitch/inputswitch.cjs.min.js +1 -1
  334. package/inputswitch/inputswitch.d.ts +9 -20
  335. package/inputswitch/inputswitch.esm.js +20 -96
  336. package/inputswitch/inputswitch.esm.min.js +1 -1
  337. package/inputswitch/inputswitch.js +20 -96
  338. package/inputswitch/inputswitch.min.js +1 -1
  339. package/inputtext/inputtext.cjs.js +7 -6
  340. package/inputtext/inputtext.cjs.min.js +1 -1
  341. package/inputtext/inputtext.d.ts +5 -0
  342. package/inputtext/inputtext.esm.js +7 -6
  343. package/inputtext/inputtext.esm.min.js +1 -1
  344. package/inputtext/inputtext.js +7 -6
  345. package/inputtext/inputtext.min.js +1 -1
  346. package/inputtextarea/inputtextarea.cjs.js +5 -4
  347. package/inputtextarea/inputtextarea.cjs.min.js +1 -1
  348. package/inputtextarea/inputtextarea.d.ts +5 -0
  349. package/inputtextarea/inputtextarea.esm.js +5 -4
  350. package/inputtextarea/inputtextarea.esm.min.js +1 -1
  351. package/inputtextarea/inputtextarea.js +5 -4
  352. package/inputtextarea/inputtextarea.min.js +1 -1
  353. package/listbox/listbox.cjs.js +17 -14
  354. package/listbox/listbox.cjs.min.js +1 -1
  355. package/listbox/listbox.d.ts +15 -0
  356. package/listbox/listbox.esm.js +18 -15
  357. package/listbox/listbox.esm.min.js +1 -1
  358. package/listbox/listbox.js +17 -14
  359. package/listbox/listbox.min.js +1 -1
  360. package/megamenu/megamenu.cjs.js +3 -3
  361. package/megamenu/megamenu.cjs.min.js +1 -1
  362. package/megamenu/megamenu.esm.js +3 -3
  363. package/megamenu/megamenu.esm.min.js +1 -1
  364. package/megamenu/megamenu.js +3 -3
  365. package/megamenu/megamenu.min.js +1 -1
  366. package/mention/mention.cjs.js +5 -4
  367. package/mention/mention.cjs.min.js +1 -1
  368. package/mention/mention.esm.js +5 -4
  369. package/mention/mention.esm.min.js +1 -1
  370. package/mention/mention.js +5 -4
  371. package/mention/mention.min.js +1 -1
  372. package/menu/menu.cjs.js +3 -2
  373. package/menu/menu.cjs.min.js +1 -1
  374. package/menu/menu.esm.js +3 -2
  375. package/menu/menu.esm.min.js +1 -1
  376. package/menu/menu.js +3 -2
  377. package/menu/menu.min.js +1 -1
  378. package/menubar/menubar.cjs.js +18 -14
  379. package/menubar/menubar.cjs.min.js +1 -1
  380. package/menubar/menubar.esm.js +18 -14
  381. package/menubar/menubar.esm.min.js +1 -1
  382. package/menubar/menubar.js +18 -14
  383. package/menubar/menubar.min.js +1 -1
  384. package/message/message.cjs.js +2 -8
  385. package/message/message.cjs.min.js +1 -1
  386. package/message/message.d.ts +1 -1
  387. package/message/message.esm.js +2 -8
  388. package/message/message.esm.min.js +1 -1
  389. package/message/message.js +2 -8
  390. package/message/message.min.js +1 -1
  391. package/messages/messages.cjs.js +1 -1
  392. package/messages/messages.cjs.min.js +1 -1
  393. package/messages/messages.d.ts +1 -1
  394. package/messages/messages.esm.js +1 -1
  395. package/messages/messages.esm.min.js +1 -1
  396. package/messages/messages.js +1 -1
  397. package/messages/messages.min.js +1 -1
  398. package/metergroup/metergroup.cjs.js +237 -0
  399. package/metergroup/metergroup.cjs.min.js +1 -0
  400. package/metergroup/metergroup.d.ts +183 -0
  401. package/metergroup/metergroup.esm.js +233 -0
  402. package/metergroup/metergroup.esm.min.js +1 -0
  403. package/metergroup/metergroup.js +236 -0
  404. package/metergroup/metergroup.min.js +1 -0
  405. package/multiselect/multiselect.cjs.js +157 -160
  406. package/multiselect/multiselect.cjs.min.js +1 -1
  407. package/multiselect/multiselect.d.ts +25 -1
  408. package/multiselect/multiselect.esm.js +157 -160
  409. package/multiselect/multiselect.esm.min.js +1 -1
  410. package/multiselect/multiselect.js +157 -160
  411. package/multiselect/multiselect.min.js +1 -1
  412. package/multistatecheckbox/multistatecheckbox.cjs.js +3 -4
  413. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  414. package/multistatecheckbox/multistatecheckbox.esm.js +3 -4
  415. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  416. package/multistatecheckbox/multistatecheckbox.js +3 -4
  417. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  418. package/orderlist/orderlist.cjs.js +35 -11
  419. package/orderlist/orderlist.cjs.min.js +1 -1
  420. package/orderlist/orderlist.d.ts +5 -0
  421. package/orderlist/orderlist.esm.js +35 -11
  422. package/orderlist/orderlist.esm.min.js +1 -1
  423. package/orderlist/orderlist.js +35 -11
  424. package/orderlist/orderlist.min.js +1 -1
  425. package/overlaypanel/overlaypanel.cjs.js +3 -2
  426. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  427. package/overlaypanel/overlaypanel.esm.js +3 -2
  428. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  429. package/overlaypanel/overlaypanel.js +3 -2
  430. package/overlaypanel/overlaypanel.min.js +1 -1
  431. package/package.json +1 -1
  432. package/paginator/paginator.cjs.js +125 -108
  433. package/paginator/paginator.cjs.min.js +1 -1
  434. package/paginator/paginator.d.ts +88 -0
  435. package/paginator/paginator.esm.js +125 -108
  436. package/paginator/paginator.esm.min.js +1 -1
  437. package/paginator/paginator.js +125 -108
  438. package/paginator/paginator.min.js +1 -1
  439. package/panelmenu/panelmenu.cjs.js +19 -14
  440. package/panelmenu/panelmenu.cjs.min.js +1 -1
  441. package/panelmenu/panelmenu.d.ts +18 -0
  442. package/panelmenu/panelmenu.esm.js +19 -14
  443. package/panelmenu/panelmenu.esm.min.js +1 -1
  444. package/panelmenu/panelmenu.js +19 -14
  445. package/panelmenu/panelmenu.min.js +1 -1
  446. package/passthrough/index.d.ts +12 -0
  447. package/passthrough/tailwind/index.cjs.js +279 -173
  448. package/passthrough/tailwind/index.cjs.min.js +1 -1
  449. package/passthrough/tailwind/index.esm.js +279 -173
  450. package/passthrough/tailwind/index.esm.min.js +1 -1
  451. package/passthrough/tailwind/index.js +279 -173
  452. package/passthrough/tailwind/index.min.js +1 -1
  453. package/password/password.cjs.js +98 -57
  454. package/password/password.cjs.min.js +1 -1
  455. package/password/password.d.ts +5 -0
  456. package/password/password.esm.js +100 -59
  457. package/password/password.esm.min.js +1 -1
  458. package/password/password.js +98 -57
  459. package/password/password.min.js +1 -1
  460. package/picklist/picklist.cjs.js +127 -102
  461. package/picklist/picklist.cjs.min.js +1 -1
  462. package/picklist/picklist.d.ts +5 -0
  463. package/picklist/picklist.esm.js +127 -102
  464. package/picklist/picklist.esm.min.js +1 -1
  465. package/picklist/picklist.js +127 -102
  466. package/picklist/picklist.min.js +1 -1
  467. package/primereact.all.cjs.js +2075 -2180
  468. package/primereact.all.cjs.min.js +1 -1
  469. package/primereact.all.esm.js +2076 -2180
  470. package/primereact.all.esm.min.js +1 -1
  471. package/primereact.all.js +2075 -2180
  472. package/primereact.all.min.js +1 -1
  473. package/radiobutton/radiobutton.cjs.js +69 -146
  474. package/radiobutton/radiobutton.cjs.min.js +1 -1
  475. package/radiobutton/radiobutton.d.ts +17 -35
  476. package/radiobutton/radiobutton.esm.js +70 -147
  477. package/radiobutton/radiobutton.esm.min.js +1 -1
  478. package/radiobutton/radiobutton.js +69 -146
  479. package/radiobutton/radiobutton.min.js +1 -1
  480. package/rating/rating.cjs.js +2 -3
  481. package/rating/rating.cjs.min.js +1 -1
  482. package/rating/rating.esm.js +2 -3
  483. package/rating/rating.esm.min.js +1 -1
  484. package/rating/rating.js +2 -3
  485. package/rating/rating.min.js +1 -1
  486. package/resources/themes/arya-blue/theme.css +344 -67
  487. package/resources/themes/arya-green/theme.css +344 -67
  488. package/resources/themes/arya-orange/theme.css +344 -67
  489. package/resources/themes/bootstrap4-dark-blue/theme.css +389 -64
  490. package/resources/themes/bootstrap4-light-blue/theme.css +389 -64
  491. package/resources/themes/fluent-light/theme.css +341 -64
  492. package/resources/themes/lara-dark-amber/theme.css +470 -67
  493. package/resources/themes/lara-dark-blue/theme.css +470 -67
  494. package/resources/themes/lara-dark-cyan/theme.css +470 -67
  495. package/resources/themes/lara-dark-green/theme.css +470 -67
  496. package/resources/themes/lara-dark-indigo/theme.css +470 -67
  497. package/resources/themes/lara-dark-pink/theme.css +470 -67
  498. package/resources/themes/lara-dark-teal/theme.css +470 -67
  499. package/resources/themes/lara-light-amber/theme.css +470 -67
  500. package/resources/themes/lara-light-blue/theme.css +470 -67
  501. package/resources/themes/lara-light-cyan/theme.css +470 -67
  502. package/resources/themes/lara-light-green/theme.css +470 -67
  503. package/resources/themes/lara-light-indigo/theme.css +470 -67
  504. package/resources/themes/lara-light-pink/theme.css +470 -67
  505. package/resources/themes/lara-light-teal/theme.css +470 -67
  506. package/resources/themes/luna-amber/theme.css +344 -67
  507. package/resources/themes/luna-blue/theme.css +344 -67
  508. package/resources/themes/luna-green/theme.css +344 -67
  509. package/resources/themes/luna-pink/theme.css +344 -67
  510. package/resources/themes/md-dark-deeppurple/theme.css +995 -289
  511. package/resources/themes/md-dark-indigo/theme.css +684 -232
  512. package/resources/themes/md-light-deeppurple/theme.css +868 -162
  513. package/resources/themes/md-light-indigo/theme.css +566 -101
  514. package/resources/themes/mdc-dark-deeppurple/theme.css +995 -289
  515. package/resources/themes/mdc-dark-indigo/theme.css +697 -232
  516. package/resources/themes/mdc-light-deeppurple/theme.css +868 -162
  517. package/resources/themes/mdc-light-indigo/theme.css +566 -101
  518. package/resources/themes/mira/theme.css +344 -67
  519. package/resources/themes/nano/theme.css +344 -67
  520. package/resources/themes/nova/theme.css +344 -67
  521. package/resources/themes/nova-accent/theme.css +344 -67
  522. package/resources/themes/nova-alt/theme.css +344 -67
  523. package/resources/themes/rhea/theme.css +343 -66
  524. package/resources/themes/saga-blue/theme.css +344 -67
  525. package/resources/themes/saga-green/theme.css +344 -67
  526. package/resources/themes/saga-orange/theme.css +344 -67
  527. package/resources/themes/soho-dark/theme.css +413 -88
  528. package/resources/themes/soho-light/theme.css +392 -67
  529. package/resources/themes/tailwind-light/theme.css +344 -67
  530. package/resources/themes/vela-blue/theme.css +344 -67
  531. package/resources/themes/vela-green/theme.css +344 -67
  532. package/resources/themes/vela-orange/theme.css +344 -67
  533. package/resources/themes/viva-dark/theme.css +392 -67
  534. package/resources/themes/viva-light/theme.css +392 -67
  535. package/selectbutton/selectbutton.cjs.js +15 -8
  536. package/selectbutton/selectbutton.cjs.min.js +1 -1
  537. package/selectbutton/selectbutton.d.ts +5 -0
  538. package/selectbutton/selectbutton.esm.js +15 -8
  539. package/selectbutton/selectbutton.esm.min.js +1 -1
  540. package/selectbutton/selectbutton.js +16 -9
  541. package/selectbutton/selectbutton.min.js +1 -1
  542. package/sidebar/sidebar.cjs.js +4 -3
  543. package/sidebar/sidebar.cjs.min.js +1 -1
  544. package/sidebar/sidebar.d.ts +4 -4
  545. package/sidebar/sidebar.esm.js +4 -3
  546. package/sidebar/sidebar.esm.min.js +1 -1
  547. package/sidebar/sidebar.js +4 -3
  548. package/sidebar/sidebar.min.js +1 -1
  549. package/slidemenu/slidemenu.cjs.js +7 -5
  550. package/slidemenu/slidemenu.cjs.min.js +1 -1
  551. package/slidemenu/slidemenu.esm.js +7 -5
  552. package/slidemenu/slidemenu.esm.min.js +1 -1
  553. package/slidemenu/slidemenu.js +7 -5
  554. package/slidemenu/slidemenu.min.js +1 -1
  555. package/slider/slider.cjs.js +18 -2
  556. package/slider/slider.cjs.min.js +1 -1
  557. package/slider/slider.esm.js +18 -2
  558. package/slider/slider.esm.min.js +1 -1
  559. package/slider/slider.js +18 -2
  560. package/slider/slider.min.js +1 -1
  561. package/splitbutton/splitbutton.cjs.js +9 -12
  562. package/splitbutton/splitbutton.cjs.min.js +1 -1
  563. package/splitbutton/splitbutton.d.ts +2 -2
  564. package/splitbutton/splitbutton.esm.js +9 -12
  565. package/splitbutton/splitbutton.esm.min.js +1 -1
  566. package/splitbutton/splitbutton.js +9 -12
  567. package/splitbutton/splitbutton.min.js +1 -1
  568. package/splitter/splitter.cjs.js +16 -21
  569. package/splitter/splitter.cjs.min.js +1 -1
  570. package/splitter/splitter.d.ts +5 -5
  571. package/splitter/splitter.esm.js +16 -21
  572. package/splitter/splitter.esm.min.js +1 -1
  573. package/splitter/splitter.js +16 -21
  574. package/splitter/splitter.min.js +1 -1
  575. package/steps/steps.cjs.js +4 -3
  576. package/steps/steps.cjs.min.js +1 -1
  577. package/steps/steps.esm.js +4 -3
  578. package/steps/steps.esm.min.js +1 -1
  579. package/steps/steps.js +4 -3
  580. package/steps/steps.min.js +1 -1
  581. package/styleclass/styleclass.cjs.js +21 -1
  582. package/styleclass/styleclass.cjs.min.js +1 -1
  583. package/styleclass/styleclass.d.ts +10 -0
  584. package/styleclass/styleclass.esm.js +21 -1
  585. package/styleclass/styleclass.esm.min.js +1 -1
  586. package/styleclass/styleclass.js +22 -2
  587. package/styleclass/styleclass.min.js +1 -1
  588. package/tabmenu/tabmenu.cjs.js +5 -4
  589. package/tabmenu/tabmenu.cjs.min.js +1 -1
  590. package/tabmenu/tabmenu.esm.js +5 -4
  591. package/tabmenu/tabmenu.esm.min.js +1 -1
  592. package/tabmenu/tabmenu.js +5 -4
  593. package/tabmenu/tabmenu.min.js +1 -1
  594. package/tieredmenu/tieredmenu.cjs.js +6 -8
  595. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  596. package/tieredmenu/tieredmenu.esm.js +6 -8
  597. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  598. package/tieredmenu/tieredmenu.js +6 -8
  599. package/tieredmenu/tieredmenu.min.js +1 -1
  600. package/toast/toast.cjs.js +93 -92
  601. package/toast/toast.cjs.min.js +1 -1
  602. package/toast/toast.d.ts +1 -1
  603. package/toast/toast.esm.js +93 -92
  604. package/toast/toast.esm.min.js +1 -1
  605. package/toast/toast.js +93 -92
  606. package/toast/toast.min.js +1 -1
  607. package/togglebutton/togglebutton.cjs.js +56 -95
  608. package/togglebutton/togglebutton.cjs.min.js +1 -1
  609. package/togglebutton/togglebutton.d.ts +24 -0
  610. package/togglebutton/togglebutton.esm.js +55 -94
  611. package/togglebutton/togglebutton.esm.min.js +1 -1
  612. package/togglebutton/togglebutton.js +56 -95
  613. package/togglebutton/togglebutton.min.js +1 -1
  614. package/tooltip/tooltip.d.ts +3 -3
  615. package/tooltip/tooltipoptions.d.ts +5 -0
  616. package/tree/tree.cjs.js +52 -39
  617. package/tree/tree.cjs.min.js +1 -1
  618. package/tree/tree.d.ts +5 -0
  619. package/tree/tree.esm.js +52 -39
  620. package/tree/tree.esm.min.js +1 -1
  621. package/tree/tree.js +52 -39
  622. package/tree/tree.min.js +1 -1
  623. package/treeselect/treeselect.cjs.js +5 -4
  624. package/treeselect/treeselect.cjs.min.js +1 -1
  625. package/treeselect/treeselect.d.ts +5 -0
  626. package/treeselect/treeselect.esm.js +5 -4
  627. package/treeselect/treeselect.esm.min.js +1 -1
  628. package/treeselect/treeselect.js +5 -4
  629. package/treeselect/treeselect.min.js +1 -1
  630. package/treetable/treetable.cjs.js +18 -15
  631. package/treetable/treetable.cjs.min.js +1 -1
  632. package/treetable/treetable.esm.js +18 -15
  633. package/treetable/treetable.esm.min.js +1 -1
  634. package/treetable/treetable.js +18 -15
  635. package/treetable/treetable.min.js +1 -1
  636. package/tristatecheckbox/tristatecheckbox.cjs.js +36 -94
  637. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  638. package/tristatecheckbox/tristatecheckbox.d.ts +12 -13
  639. package/tristatecheckbox/tristatecheckbox.esm.js +37 -95
  640. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  641. package/tristatecheckbox/tristatecheckbox.js +36 -94
  642. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  643. package/utils/utils.cjs.js +64 -72
  644. package/utils/utils.cjs.min.js +1 -1
  645. package/utils/utils.d.ts +11 -2
  646. package/utils/utils.esm.js +65 -72
  647. package/utils/utils.esm.min.js +1 -1
  648. package/utils/utils.js +64 -72
  649. package/utils/utils.min.js +1 -1
  650. package/virtualscroller/virtualscroller.cjs.js +17 -15
  651. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  652. package/virtualscroller/virtualscroller.esm.js +14 -12
  653. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  654. package/virtualscroller/virtualscroller.js +17 -15
  655. package/virtualscroller/virtualscroller.min.js +1 -1
  656. package/web-types.json +519 -39
@@ -4,7 +4,7 @@ import { PrimeReactContext } from 'primereact/api';
4
4
  import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
5
5
  import { useMergeProps, useMountEffect } from 'primereact/hooks';
6
6
  import { Tooltip } from 'primereact/tooltip';
7
- import { classNames, ObjectUtils, DomHandler } from 'primereact/utils';
7
+ import { classNames, DomHandler, ObjectUtils } from 'primereact/utils';
8
8
 
9
9
  function _extends() {
10
10
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -62,83 +62,19 @@ function _defineProperty(obj, key, value) {
62
62
  return obj;
63
63
  }
64
64
 
65
- function _arrayWithHoles(arr) {
66
- if (Array.isArray(arr)) return arr;
67
- }
68
-
69
- function _iterableToArrayLimit(r, l) {
70
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
71
- if (null != t) {
72
- var e,
73
- n,
74
- i,
75
- u,
76
- a = [],
77
- f = !0,
78
- o = !1;
79
- try {
80
- if (i = (t = t.call(r)).next, 0 === l) {
81
- if (Object(t) !== t) return;
82
- f = !1;
83
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
84
- } catch (r) {
85
- o = !0, n = r;
86
- } finally {
87
- try {
88
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
89
- } finally {
90
- if (o) throw n;
91
- }
92
- }
93
- return a;
94
- }
95
- }
96
-
97
- function _arrayLikeToArray(arr, len) {
98
- if (len == null || len > arr.length) len = arr.length;
99
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
100
- return arr2;
101
- }
102
-
103
- function _unsupportedIterableToArray(o, minLen) {
104
- if (!o) return;
105
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
106
- var n = Object.prototype.toString.call(o).slice(8, -1);
107
- if (n === "Object" && o.constructor) n = o.constructor.name;
108
- if (n === "Map" || n === "Set") return Array.from(o);
109
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
110
- }
111
-
112
- function _nonIterableRest() {
113
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
114
- }
115
-
116
- function _slicedToArray(arr, i) {
117
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
118
- }
119
-
120
65
  var classes = {
121
66
  root: function root(_ref) {
122
- var props = _ref.props,
123
- focusedState = _ref.focusedState;
67
+ var props = _ref.props;
124
68
  return classNames('p-radiobutton p-component', {
125
- 'p-radiobutton-checked': props.checked,
126
- 'p-radiobutton-disabled': props.disabled,
127
- 'p-radiobutton-focused': focusedState
128
- });
129
- },
130
- input: function input(_ref2) {
131
- var props = _ref2.props,
132
- focusedState = _ref2.focusedState;
133
- return classNames('p-radiobutton-box', {
134
69
  'p-highlight': props.checked,
135
70
  'p-disabled': props.disabled,
136
- 'p-focus': focusedState
71
+ 'p-invalid': props.invalid
137
72
  });
138
73
  },
74
+ box: 'p-radiobutton-box',
75
+ input: 'p-radiobutton-input',
139
76
  icon: 'p-radiobutton-icon'
140
77
  };
141
- var styles = "\n@layer primereact {\n .p-radiobutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n }\n \n .p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-radiobutton-icon {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n transform: translateZ(0) scale(.1);\n border-radius: 50%;\n visibility: hidden;\n }\n \n .p-radiobutton-box.p-highlight .p-radiobutton-icon {\n transform: translateZ(0) scale(1.0, 1.0);\n visibility: visible;\n }\n}\n";
142
78
  var RadioButtonBase = ComponentBase.extend({
143
79
  defaultProps: {
144
80
  __TYPE: 'RadioButton',
@@ -149,6 +85,7 @@ var RadioButtonBase = ComponentBase.extend({
149
85
  id: null,
150
86
  inputId: null,
151
87
  inputRef: null,
88
+ invalid: false,
152
89
  name: null,
153
90
  onChange: null,
154
91
  onClick: null,
@@ -161,8 +98,7 @@ var RadioButtonBase = ComponentBase.extend({
161
98
  children: undefined
162
99
  },
163
100
  css: {
164
- classes: classes,
165
- styles: styles
101
+ classes: classes
166
102
  }
167
103
  });
168
104
 
@@ -172,33 +108,26 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
172
108
  var mergeProps = useMergeProps();
173
109
  var context = React.useContext(PrimeReactContext);
174
110
  var props = RadioButtonBase.getProps(inProps, context);
175
- var _React$useState = React.useState(false),
176
- _React$useState2 = _slicedToArray(_React$useState, 2),
177
- focusedState = _React$useState2[0],
178
- setFocusedState = _React$useState2[1];
179
111
  var elementRef = React.useRef(null);
180
112
  var inputRef = React.useRef(props.inputRef);
181
113
  var _RadioButtonBase$setM = RadioButtonBase.setMetaData({
182
- props: props,
183
- state: {
184
- focused: focusedState
185
- }
114
+ props: props
186
115
  }),
187
116
  ptm = _RadioButtonBase$setM.ptm,
188
117
  cx = _RadioButtonBase$setM.cx,
189
118
  isUnstyled = _RadioButtonBase$setM.isUnstyled;
190
119
  useHandleStyle(RadioButtonBase.css.styles, isUnstyled, {
191
- name: 'radiobutton',
192
- styled: true
120
+ name: 'radiobutton'
193
121
  });
194
122
  var select = function select(event) {
195
- onClick(event);
123
+ onChange(event);
196
124
  };
197
- var onClick = function onClick(event) {
198
- if (props.disabled) {
125
+ var onChange = function onChange(event) {
126
+ if (props.disabled || props.readonly) {
199
127
  return;
200
128
  }
201
- if (props.onChange || props.onClick) {
129
+ if (props.onChange) {
130
+ var _props$onChange;
202
131
  var checked = props.checked;
203
132
  var radioClicked = event.target instanceof HTMLDivElement;
204
133
  var inputClicked = event.target === inputRef.current;
@@ -223,47 +152,30 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
223
152
  checked: value
224
153
  }
225
154
  };
226
- props.onClick && props.onClick(eventData);
155
+ props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
227
156
 
228
157
  // do not continue if the user defined click wants to prevent
229
158
  if (event.defaultPrevented) {
230
159
  return;
231
160
  }
232
161
  if (isInputToggled || isRadioToggled) {
233
- props.onChange && props.onChange(eventData);
162
+ var _props$onChange2;
163
+ props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, eventData);
234
164
  if (isRadioToggled) {
235
165
  inputRef.current.checked = value;
236
166
  }
237
167
  }
238
168
  DomHandler.focus(inputRef.current);
239
- event.preventDefault();
240
169
  }
241
170
  };
242
- var onFocus = function onFocus() {
243
- setFocusedState(true);
171
+ var onFocus = function onFocus(event) {
172
+ var _props$onFocus;
173
+ props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
244
174
  };
245
- var onBlur = function onBlur() {
246
- setFocusedState(false);
175
+ var onBlur = function onBlur(event) {
176
+ var _props$onBlur;
177
+ props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
247
178
  };
248
- var onKeyDown = function onKeyDown(event) {
249
- if (event.code === 'Space' || event.key === ' ') {
250
- // event.key is for Android support
251
- onClick(event);
252
- }
253
- };
254
- React.useEffect(function () {
255
- if (inputRef.current) {
256
- inputRef.current.checked = props.checked;
257
- }
258
- }, [props.checked]);
259
- React.useEffect(function () {
260
- ObjectUtils.combinedRefs(inputRef, props.inputRef);
261
- }, [inputRef, props.inputRef]);
262
- useMountEffect(function () {
263
- if (props.autoFocus) {
264
- DomHandler.focus(inputRef.current, props.autoFocus);
265
- }
266
- });
267
179
  React.useImperativeHandle(ref, function () {
268
180
  return {
269
181
  props: props,
@@ -279,52 +191,63 @@ var RadioButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functio
279
191
  }
280
192
  };
281
193
  });
194
+ React.useEffect(function () {
195
+ if (inputRef.current) {
196
+ inputRef.current.checked = props.checked;
197
+ }
198
+ }, [props.checked]);
199
+ React.useEffect(function () {
200
+ ObjectUtils.combinedRefs(inputRef, props.inputRef);
201
+ }, [inputRef, props.inputRef]);
202
+ useMountEffect(function () {
203
+ if (props.autoFocus) {
204
+ DomHandler.focus(inputRef.current, props.autoFocus);
205
+ }
206
+ });
282
207
  var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
283
208
  var otherProps = RadioButtonBase.getOtherProps(props);
284
- var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
285
209
  var rootProps = mergeProps({
286
- className: classNames(props.className, cx('root', {
287
- focusedState: focusedState
288
- })),
210
+ id: props.id,
211
+ className: classNames(props.className, cx('root')),
289
212
  style: props.style,
290
- onClick: onClick,
291
213
  'data-p-checked': props.checked
292
214
  }, RadioButtonBase.getOtherProps(props), ptm('root'));
293
- var hiddenInputWrapperProps = mergeProps({
294
- className: 'p-hidden-accessible'
295
- }, ptm('hiddenInputWrapper'));
296
- var hiddenInputProps = mergeProps(_objectSpread({
297
- type: 'radio',
298
- name: props.name,
299
- defaultChecked: props.checked,
300
- onFocus: onFocus,
301
- onBlur: onBlur,
302
- onKeyDown: onKeyDown,
303
- checked: props.checked,
304
- disabled: props.disabled,
305
- required: props.required,
306
- tabIndex: props.tabIndex
307
- }, ariaProps), ptm('hiddenInput'));
308
- var inputProps = mergeProps({
309
- className: cx('input', {
310
- focusedState: focusedState
311
- })
312
- }, ptm('input'));
313
- var iconProps = mergeProps({
314
- className: cx('icon')
315
- }, ptm('icon'));
215
+ var createInputElement = function createInputElement() {
216
+ var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
217
+ var inputProps = mergeProps(_objectSpread({
218
+ id: props.inputId,
219
+ type: 'radio',
220
+ name: props.name,
221
+ defaultChecked: props.checked,
222
+ onFocus: onFocus,
223
+ onBlur: onBlur,
224
+ onChange: onChange,
225
+ disabled: props.disabled,
226
+ readonly: props.readonly,
227
+ required: props.required,
228
+ tabIndex: props.tabIndex,
229
+ className: cx('input')
230
+ }, ariaProps), ptm('input'));
231
+ return /*#__PURE__*/React.createElement("input", _extends({
232
+ ref: inputRef
233
+ }, inputProps));
234
+ };
235
+ var createBoxElement = function createBoxElement() {
236
+ var boxProps = mergeProps({
237
+ className: cx('box')
238
+ }, ptm('box'));
239
+ var iconProps = mergeProps({
240
+ className: cx('icon')
241
+ }, ptm('icon'));
242
+ return /*#__PURE__*/React.createElement("div", boxProps, /*#__PURE__*/React.createElement("div", iconProps));
243
+ };
316
244
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
317
- id: props.id,
318
245
  ref: elementRef
319
- }, rootProps), /*#__PURE__*/React.createElement("div", hiddenInputWrapperProps, /*#__PURE__*/React.createElement("input", _extends({
320
- id: props.inputId,
321
- ref: inputRef
322
- }, hiddenInputProps))), /*#__PURE__*/React.createElement("div", inputProps, /*#__PURE__*/React.createElement("div", iconProps))), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
246
+ }, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
323
247
  target: elementRef,
324
- content: props.tooltip
325
- }, props.tooltipOptions, {
248
+ content: props.tooltip,
326
249
  pt: ptm('tooltip')
327
- })));
250
+ }, props.tooltipOptions)));
328
251
  }));
329
252
  RadioButton.displayName = 'RadioButton';
330
253
 
@@ -1 +1 @@
1
- import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{useMergeProps as o,useMountEffect as i}from"primereact/hooks";import{Tooltip as c}from"primereact/tooltip";import{classNames as a,ObjectUtils as u,DomHandler as l}from"primereact/utils";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function d(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e){var t=d(e,"string");return"symbol"===p(t)?t:String(t)}function b(e){if(Array.isArray(e))return e}function m(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,c,a=[],u=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(l)throw o}}return a}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=n.extend({defaultProps:{__TYPE:"RadioButton",autoFocus:!1,checked:!1,className:null,disabled:!1,id:null,inputId:null,inputRef:null,name:null,onChange:null,onClick:null,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,value:null,children:void 0},css:{classes:{root:function(e){var t=e.props;return a("p-radiobutton p-component",{"p-radiobutton-checked":t.checked,"p-radiobutton-disabled":t.disabled,"p-radiobutton-focused":e.focusedState})},input:function(e){var t=e.props;return a("p-radiobutton-box",{"p-highlight":t.checked,"p-disabled":t.disabled,"p-focus":e.focusedState})},icon:"p-radiobutton-icon"},styles:"\n@layer primereact {\n .p-radiobutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n }\n \n .p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-radiobutton-icon {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n transform: translateZ(0) scale(.1);\n border-radius: 50%;\n visibility: hidden;\n }\n \n .p-radiobutton-box.p-highlight .p-radiobutton-icon {\n transform: translateZ(0) scale(1.0, 1.0);\n visibility: visible;\n }\n}\n"}});function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){var r,o,i;r=e,i=n[t],(o=f(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=e.memo(e.forwardRef((function(n,p){var d,f,y=o(),O=e.useContext(t),j=g.getProps(n,O),P=e.useState(!1),S=(f=2,b(d=P)||m(d,f)||h(d,f)||v()),E=S[0],w=S[1],x=e.useRef(null),C=e.useRef(j.inputRef),I=g.setMetaData({props:j,state:{focused:E}}),R=I.ptm,D=I.cx;r(g.css.styles,I.isUnstyled,{name:"radiobutton",styled:!0});var N=function(e){A(e)},A=function(e){if(!j.disabled&&(j.onChange||j.onClick)){var t=j.checked,n=e.target instanceof HTMLDivElement,r=e.target===C.current&&e.target.checked!==t,o=n&&l.hasClass(x.current,"p-radiobutton-checked")===t&&!t,i=!t,c={originalEvent:e,value:j.value,checked:i,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{type:"radio",name:j.name,id:j.id,value:j.value,checked:i}};if(j.onClick&&j.onClick(c),e.defaultPrevented)return;(r||o)&&(j.onChange&&j.onChange(c),o&&(C.current.checked=i)),l.focus(C.current),e.preventDefault()}};e.useEffect((function(){C.current&&(C.current.checked=j.checked)}),[j.checked]),e.useEffect((function(){u.combinedRefs(C,j.inputRef)}),[C,j.inputRef]),i((function(){j.autoFocus&&l.focus(C.current,j.autoFocus)})),e.useImperativeHandle(p,(function(){return{props:j,select:N,focus:function(){return l.focus(C.current)},getElement:function(){return x.current},getInput:function(){return C.current}}}));var F=u.isNotEmpty(j.tooltip),T=g.getOtherProps(j),q=u.reduceKeys(T,l.ARIA_PROPS),B=y({className:a(j.className,D("root",{focusedState:E})),style:j.style,onClick:A,"data-p-checked":j.checked},g.getOtherProps(j),R("root")),M=y({className:"p-hidden-accessible"},R("hiddenInputWrapper")),_=y(k({type:"radio",name:j.name,defaultChecked:j.checked,onFocus:function(){w(!0)},onBlur:function(){w(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||A(e)},checked:j.checked,disabled:j.disabled,required:j.required,tabIndex:j.tabIndex},q),R("hiddenInput")),H=y({className:D("input",{focusedState:E})},R("input")),K=y({className:D("icon")},R("icon"));return e.createElement(e.Fragment,null,e.createElement("div",s({id:j.id,ref:x},B),e.createElement("div",M,e.createElement("input",s({id:j.inputId,ref:C},_))),e.createElement("div",H,e.createElement("div",K))),F&&e.createElement(c,s({target:x,content:j.tooltip},j.tooltipOptions,{pt:R("tooltip")})))})));j.displayName="RadioButton";export{j as RadioButton};
1
+ import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{useMergeProps as o,useMountEffect as i}from"primereact/hooks";import{Tooltip as u}from"primereact/tooltip";import{classNames as c,DomHandler as a,ObjectUtils as l}from"primereact/utils";function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function d(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e){var t=d(e,"string");return"symbol"===s(t)?t:String(t)}var m=n.extend({defaultProps:{__TYPE:"RadioButton",autoFocus:!1,checked:!1,className:null,disabled:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onChange:null,onClick:null,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,value:null,children:void 0},css:{classes:{root:function(e){var t=e.props;return c("p-radiobutton p-component",{"p-highlight":t.checked,"p-disabled":t.disabled,"p-invalid":t.invalid})},box:"p-radiobutton-box",input:"p-radiobutton-input",icon:"p-radiobutton-icon"}}});function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){var r,o,i;r=e,i=n[t],(o=f(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=e.memo(e.forwardRef((function(n,s){var d=o(),f=e.useContext(t),b=m.getProps(n,f),y=e.useRef(null),g=e.useRef(b.inputRef),h=m.setMetaData({props:b}),O=h.ptm,P=h.cx;r(m.css.styles,h.isUnstyled,{name:"radiobutton"});var k=function(e){j(e)},j=function(e){if(!b.disabled&&!b.readonly&&b.onChange){var t,n,r=b.checked,o=e.target instanceof HTMLDivElement,i=e.target===g.current&&e.target.checked!==r,u=o&&a.hasClass(y.current,"p-radiobutton-checked")===r&&!r,c=!r,l={originalEvent:e,value:b.value,checked:c,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{type:"radio",name:b.name,id:b.id,value:b.value,checked:c}};if(null==b||null===(t=b.onChange)||void 0===t||t.call(b,l),e.defaultPrevented)return;if(i||u)null==b||null===(n=b.onChange)||void 0===n||n.call(b,l),u&&(g.current.checked=c);a.focus(g.current)}},E=function(e){var t;null==b||null===(t=b.onFocus)||void 0===t||t.call(b,e)},R=function(e){var t;null==b||null===(t=b.onBlur)||void 0===t||t.call(b,e)};e.useImperativeHandle(s,(function(){return{props:b,select:k,focus:function(){return a.focus(g.current)},getElement:function(){return y.current},getInput:function(){return g.current}}})),e.useEffect((function(){g.current&&(g.current.checked=b.checked)}),[b.checked]),e.useEffect((function(){l.combinedRefs(g,b.inputRef)}),[g,b.inputRef]),i((function(){b.autoFocus&&a.focus(g.current,b.autoFocus)}));var w,x,S,C,N=l.isNotEmpty(b.tooltip),D=m.getOtherProps(b),I=d({id:b.id,className:c(b.className,P("root")),style:b.style,"data-p-checked":b.checked},m.getOtherProps(b),O("root"));return e.createElement(e.Fragment,null,e.createElement("div",p({ref:y},I),(S=l.reduceKeys(D,a.ARIA_PROPS),C=d(v({id:b.inputId,type:"radio",name:b.name,defaultChecked:b.checked,onFocus:E,onBlur:R,onChange:j,disabled:b.disabled,readonly:b.readonly,required:b.required,tabIndex:b.tabIndex,className:P("input")},S),O("input")),e.createElement("input",p({ref:g},C))),(w=d({className:P("box")},O("box")),x=d({className:P("icon")},O("icon")),e.createElement("div",w,e.createElement("div",x)))),N&&e.createElement(u,p({target:y,content:b.tooltip,pt:O("tooltip")},b.tooltipOptions)))})));y.displayName="RadioButton";export{y as RadioButton};
@@ -78,83 +78,19 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
78
78
  return obj;
79
79
  }
80
80
 
81
- function _arrayWithHoles(arr) {
82
- if (Array.isArray(arr)) return arr;
83
- }
84
-
85
- function _iterableToArrayLimit(r, l) {
86
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
87
- if (null != t) {
88
- var e,
89
- n,
90
- i,
91
- u,
92
- a = [],
93
- f = !0,
94
- o = !1;
95
- try {
96
- if (i = (t = t.call(r)).next, 0 === l) {
97
- if (Object(t) !== t) return;
98
- f = !1;
99
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
100
- } catch (r) {
101
- o = !0, n = r;
102
- } finally {
103
- try {
104
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
105
- } finally {
106
- if (o) throw n;
107
- }
108
- }
109
- return a;
110
- }
111
- }
112
-
113
- function _arrayLikeToArray(arr, len) {
114
- if (len == null || len > arr.length) len = arr.length;
115
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
116
- return arr2;
117
- }
118
-
119
- function _unsupportedIterableToArray(o, minLen) {
120
- if (!o) return;
121
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
122
- var n = Object.prototype.toString.call(o).slice(8, -1);
123
- if (n === "Object" && o.constructor) n = o.constructor.name;
124
- if (n === "Map" || n === "Set") return Array.from(o);
125
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
126
- }
127
-
128
- function _nonIterableRest() {
129
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
130
- }
131
-
132
- function _slicedToArray(arr, i) {
133
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
134
- }
135
-
136
81
  var classes = {
137
82
  root: function root(_ref) {
138
- var props = _ref.props,
139
- focusedState = _ref.focusedState;
83
+ var props = _ref.props;
140
84
  return utils.classNames('p-radiobutton p-component', {
141
- 'p-radiobutton-checked': props.checked,
142
- 'p-radiobutton-disabled': props.disabled,
143
- 'p-radiobutton-focused': focusedState
144
- });
145
- },
146
- input: function input(_ref2) {
147
- var props = _ref2.props,
148
- focusedState = _ref2.focusedState;
149
- return utils.classNames('p-radiobutton-box', {
150
85
  'p-highlight': props.checked,
151
86
  'p-disabled': props.disabled,
152
- 'p-focus': focusedState
87
+ 'p-invalid': props.invalid
153
88
  });
154
89
  },
90
+ box: 'p-radiobutton-box',
91
+ input: 'p-radiobutton-input',
155
92
  icon: 'p-radiobutton-icon'
156
93
  };
157
- var styles = "\n@layer primereact {\n .p-radiobutton {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n }\n \n .p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n \n .p-radiobutton-icon {\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n transform: translateZ(0) scale(.1);\n border-radius: 50%;\n visibility: hidden;\n }\n \n .p-radiobutton-box.p-highlight .p-radiobutton-icon {\n transform: translateZ(0) scale(1.0, 1.0);\n visibility: visible;\n }\n}\n";
158
94
  var RadioButtonBase = componentbase.ComponentBase.extend({
159
95
  defaultProps: {
160
96
  __TYPE: 'RadioButton',
@@ -165,6 +101,7 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
165
101
  id: null,
166
102
  inputId: null,
167
103
  inputRef: null,
104
+ invalid: false,
168
105
  name: null,
169
106
  onChange: null,
170
107
  onClick: null,
@@ -177,8 +114,7 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
177
114
  children: undefined
178
115
  },
179
116
  css: {
180
- classes: classes,
181
- styles: styles
117
+ classes: classes
182
118
  }
183
119
  });
184
120
 
@@ -188,33 +124,26 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
188
124
  var mergeProps = hooks.useMergeProps();
189
125
  var context = React__namespace.useContext(api.PrimeReactContext);
190
126
  var props = RadioButtonBase.getProps(inProps, context);
191
- var _React$useState = React__namespace.useState(false),
192
- _React$useState2 = _slicedToArray(_React$useState, 2),
193
- focusedState = _React$useState2[0],
194
- setFocusedState = _React$useState2[1];
195
127
  var elementRef = React__namespace.useRef(null);
196
128
  var inputRef = React__namespace.useRef(props.inputRef);
197
129
  var _RadioButtonBase$setM = RadioButtonBase.setMetaData({
198
- props: props,
199
- state: {
200
- focused: focusedState
201
- }
130
+ props: props
202
131
  }),
203
132
  ptm = _RadioButtonBase$setM.ptm,
204
133
  cx = _RadioButtonBase$setM.cx,
205
134
  isUnstyled = _RadioButtonBase$setM.isUnstyled;
206
135
  componentbase.useHandleStyle(RadioButtonBase.css.styles, isUnstyled, {
207
- name: 'radiobutton',
208
- styled: true
136
+ name: 'radiobutton'
209
137
  });
210
138
  var select = function select(event) {
211
- onClick(event);
139
+ onChange(event);
212
140
  };
213
- var onClick = function onClick(event) {
214
- if (props.disabled) {
141
+ var onChange = function onChange(event) {
142
+ if (props.disabled || props.readonly) {
215
143
  return;
216
144
  }
217
- if (props.onChange || props.onClick) {
145
+ if (props.onChange) {
146
+ var _props$onChange;
218
147
  var checked = props.checked;
219
148
  var radioClicked = event.target instanceof HTMLDivElement;
220
149
  var inputClicked = event.target === inputRef.current;
@@ -239,47 +168,30 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
239
168
  checked: value
240
169
  }
241
170
  };
242
- props.onClick && props.onClick(eventData);
171
+ props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, eventData);
243
172
 
244
173
  // do not continue if the user defined click wants to prevent
245
174
  if (event.defaultPrevented) {
246
175
  return;
247
176
  }
248
177
  if (isInputToggled || isRadioToggled) {
249
- props.onChange && props.onChange(eventData);
178
+ var _props$onChange2;
179
+ props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, eventData);
250
180
  if (isRadioToggled) {
251
181
  inputRef.current.checked = value;
252
182
  }
253
183
  }
254
184
  utils.DomHandler.focus(inputRef.current);
255
- event.preventDefault();
256
185
  }
257
186
  };
258
- var onFocus = function onFocus() {
259
- setFocusedState(true);
187
+ var onFocus = function onFocus(event) {
188
+ var _props$onFocus;
189
+ props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event);
260
190
  };
261
- var onBlur = function onBlur() {
262
- setFocusedState(false);
191
+ var onBlur = function onBlur(event) {
192
+ var _props$onBlur;
193
+ props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event);
263
194
  };
264
- var onKeyDown = function onKeyDown(event) {
265
- if (event.code === 'Space' || event.key === ' ') {
266
- // event.key is for Android support
267
- onClick(event);
268
- }
269
- };
270
- React__namespace.useEffect(function () {
271
- if (inputRef.current) {
272
- inputRef.current.checked = props.checked;
273
- }
274
- }, [props.checked]);
275
- React__namespace.useEffect(function () {
276
- utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
277
- }, [inputRef, props.inputRef]);
278
- hooks.useMountEffect(function () {
279
- if (props.autoFocus) {
280
- utils.DomHandler.focus(inputRef.current, props.autoFocus);
281
- }
282
- });
283
195
  React__namespace.useImperativeHandle(ref, function () {
284
196
  return {
285
197
  props: props,
@@ -295,52 +207,63 @@ this.primereact.radiobutton = (function (exports, React, api, componentbase, hoo
295
207
  }
296
208
  };
297
209
  });
210
+ React__namespace.useEffect(function () {
211
+ if (inputRef.current) {
212
+ inputRef.current.checked = props.checked;
213
+ }
214
+ }, [props.checked]);
215
+ React__namespace.useEffect(function () {
216
+ utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);
217
+ }, [inputRef, props.inputRef]);
218
+ hooks.useMountEffect(function () {
219
+ if (props.autoFocus) {
220
+ utils.DomHandler.focus(inputRef.current, props.autoFocus);
221
+ }
222
+ });
298
223
  var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
299
224
  var otherProps = RadioButtonBase.getOtherProps(props);
300
- var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
301
225
  var rootProps = mergeProps({
302
- className: utils.classNames(props.className, cx('root', {
303
- focusedState: focusedState
304
- })),
226
+ id: props.id,
227
+ className: utils.classNames(props.className, cx('root')),
305
228
  style: props.style,
306
- onClick: onClick,
307
229
  'data-p-checked': props.checked
308
230
  }, RadioButtonBase.getOtherProps(props), ptm('root'));
309
- var hiddenInputWrapperProps = mergeProps({
310
- className: 'p-hidden-accessible'
311
- }, ptm('hiddenInputWrapper'));
312
- var hiddenInputProps = mergeProps(_objectSpread({
313
- type: 'radio',
314
- name: props.name,
315
- defaultChecked: props.checked,
316
- onFocus: onFocus,
317
- onBlur: onBlur,
318
- onKeyDown: onKeyDown,
319
- checked: props.checked,
320
- disabled: props.disabled,
321
- required: props.required,
322
- tabIndex: props.tabIndex
323
- }, ariaProps), ptm('hiddenInput'));
324
- var inputProps = mergeProps({
325
- className: cx('input', {
326
- focusedState: focusedState
327
- })
328
- }, ptm('input'));
329
- var iconProps = mergeProps({
330
- className: cx('icon')
331
- }, ptm('icon'));
231
+ var createInputElement = function createInputElement() {
232
+ var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
233
+ var inputProps = mergeProps(_objectSpread({
234
+ id: props.inputId,
235
+ type: 'radio',
236
+ name: props.name,
237
+ defaultChecked: props.checked,
238
+ onFocus: onFocus,
239
+ onBlur: onBlur,
240
+ onChange: onChange,
241
+ disabled: props.disabled,
242
+ readonly: props.readonly,
243
+ required: props.required,
244
+ tabIndex: props.tabIndex,
245
+ className: cx('input')
246
+ }, ariaProps), ptm('input'));
247
+ return /*#__PURE__*/React__namespace.createElement("input", _extends({
248
+ ref: inputRef
249
+ }, inputProps));
250
+ };
251
+ var createBoxElement = function createBoxElement() {
252
+ var boxProps = mergeProps({
253
+ className: cx('box')
254
+ }, ptm('box'));
255
+ var iconProps = mergeProps({
256
+ className: cx('icon')
257
+ }, ptm('icon'));
258
+ return /*#__PURE__*/React__namespace.createElement("div", boxProps, /*#__PURE__*/React__namespace.createElement("div", iconProps));
259
+ };
332
260
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", _extends({
333
- id: props.id,
334
261
  ref: elementRef
335
- }, rootProps), /*#__PURE__*/React__namespace.createElement("div", hiddenInputWrapperProps, /*#__PURE__*/React__namespace.createElement("input", _extends({
336
- id: props.inputId,
337
- ref: inputRef
338
- }, hiddenInputProps))), /*#__PURE__*/React__namespace.createElement("div", inputProps, /*#__PURE__*/React__namespace.createElement("div", iconProps))), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
262
+ }, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
339
263
  target: elementRef,
340
- content: props.tooltip
341
- }, props.tooltipOptions, {
264
+ content: props.tooltip,
342
265
  pt: ptm('tooltip')
343
- })));
266
+ }, props.tooltipOptions)));
344
267
  }));
345
268
  RadioButton.displayName = 'RadioButton';
346
269