primereact 10.5.1 → 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 (430) 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 +229 -11
  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 +89 -45
  9. package/autocomplete/autocomplete.cjs.min.js +1 -1
  10. package/autocomplete/autocomplete.d.ts +6 -1
  11. package/autocomplete/autocomplete.esm.js +89 -45
  12. package/autocomplete/autocomplete.esm.min.js +1 -1
  13. package/autocomplete/autocomplete.js +89 -45
  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/calendar/calendar.cjs.js +30 -11
  22. package/calendar/calendar.cjs.min.js +1 -1
  23. package/calendar/calendar.d.ts +9 -0
  24. package/calendar/calendar.esm.js +30 -11
  25. package/calendar/calendar.esm.min.js +1 -1
  26. package/calendar/calendar.js +30 -11
  27. package/calendar/calendar.min.js +1 -1
  28. package/carousel/carousel.cjs.js +17 -15
  29. package/carousel/carousel.cjs.min.js +1 -1
  30. package/carousel/carousel.esm.js +4 -2
  31. package/carousel/carousel.esm.min.js +1 -1
  32. package/carousel/carousel.js +17 -15
  33. package/carousel/carousel.min.js +1 -1
  34. package/cascadeselect/cascadeselect.cjs.js +28 -14
  35. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  36. package/cascadeselect/cascadeselect.d.ts +5 -0
  37. package/cascadeselect/cascadeselect.esm.js +28 -14
  38. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  39. package/cascadeselect/cascadeselect.js +28 -14
  40. package/cascadeselect/cascadeselect.min.js +1 -1
  41. package/checkbox/checkbox.cjs.js +70 -153
  42. package/checkbox/checkbox.cjs.min.js +1 -1
  43. package/checkbox/checkbox.d.ts +10 -34
  44. package/checkbox/checkbox.esm.js +70 -153
  45. package/checkbox/checkbox.esm.min.js +1 -1
  46. package/checkbox/checkbox.js +70 -153
  47. package/checkbox/checkbox.min.js +1 -1
  48. package/chips/chips.cjs.js +23 -9
  49. package/chips/chips.cjs.min.js +1 -1
  50. package/chips/chips.d.ts +6 -1
  51. package/chips/chips.esm.js +23 -9
  52. package/chips/chips.esm.min.js +1 -1
  53. package/chips/chips.js +23 -9
  54. package/chips/chips.min.js +1 -1
  55. package/colorpicker/colorpicker.cjs.js +3 -2
  56. package/colorpicker/colorpicker.cjs.min.js +1 -1
  57. package/colorpicker/colorpicker.esm.js +2 -1
  58. package/colorpicker/colorpicker.esm.min.js +1 -1
  59. package/colorpicker/colorpicker.js +3 -2
  60. package/colorpicker/colorpicker.min.js +1 -1
  61. package/componentbase/componentbase.cjs.js +4 -6
  62. package/componentbase/componentbase.cjs.min.js +1 -1
  63. package/componentbase/componentbase.esm.js +5 -7
  64. package/componentbase/componentbase.esm.min.js +1 -1
  65. package/componentbase/componentbase.js +4 -6
  66. package/componentbase/componentbase.min.js +1 -1
  67. package/confirmdialog/confirmdialog.cjs.js +1 -0
  68. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  69. package/confirmdialog/confirmdialog.esm.js +1 -0
  70. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  71. package/confirmdialog/confirmdialog.js +1 -0
  72. package/confirmdialog/confirmdialog.min.js +1 -1
  73. package/confirmpopup/confirmpopup.cjs.js +5 -5
  74. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  75. package/confirmpopup/confirmpopup.esm.js +5 -5
  76. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  77. package/confirmpopup/confirmpopup.js +5 -5
  78. package/confirmpopup/confirmpopup.min.js +1 -1
  79. package/core/core.js +639 -603
  80. package/core/core.min.js +13 -13
  81. package/datatable/datatable.cjs.js +128 -110
  82. package/datatable/datatable.cjs.min.js +1 -1
  83. package/datatable/datatable.d.ts +1 -1
  84. package/datatable/datatable.esm.js +128 -110
  85. package/datatable/datatable.esm.min.js +1 -1
  86. package/datatable/datatable.js +128 -110
  87. package/datatable/datatable.min.js +1 -1
  88. package/dataview/dataview.cjs.js +16 -13
  89. package/dataview/dataview.cjs.min.js +1 -1
  90. package/dataview/dataview.esm.js +4 -1
  91. package/dataview/dataview.esm.min.js +1 -1
  92. package/dataview/dataview.js +17 -15
  93. package/dataview/dataview.min.js +1 -1
  94. package/dialog/dialog.cjs.js +6 -6
  95. package/dialog/dialog.cjs.min.js +1 -1
  96. package/dialog/dialog.esm.js +6 -6
  97. package/dialog/dialog.esm.min.js +1 -1
  98. package/dialog/dialog.js +6 -6
  99. package/dialog/dialog.min.js +1 -1
  100. package/dropdown/dropdown.cjs.js +98 -29
  101. package/dropdown/dropdown.cjs.min.js +1 -1
  102. package/dropdown/dropdown.d.ts +41 -0
  103. package/dropdown/dropdown.esm.js +98 -29
  104. package/dropdown/dropdown.esm.min.js +1 -1
  105. package/dropdown/dropdown.js +98 -31
  106. package/dropdown/dropdown.min.js +1 -1
  107. package/editor/editor.cjs.js +125 -54
  108. package/editor/editor.cjs.min.js +1 -1
  109. package/editor/editor.esm.js +125 -54
  110. package/editor/editor.esm.min.js +1 -1
  111. package/editor/editor.js +125 -54
  112. package/editor/editor.min.js +1 -1
  113. package/galleria/galleria.cjs.js +22 -19
  114. package/galleria/galleria.cjs.min.js +1 -1
  115. package/galleria/galleria.esm.js +4 -1
  116. package/galleria/galleria.esm.min.js +1 -1
  117. package/galleria/galleria.js +23 -20
  118. package/galleria/galleria.min.js +1 -1
  119. package/hooks/hooks.cjs.js +115 -72
  120. package/hooks/hooks.cjs.min.js +1 -1
  121. package/hooks/hooks.esm.js +116 -73
  122. package/hooks/hooks.esm.min.js +1 -1
  123. package/hooks/hooks.js +115 -72
  124. package/hooks/hooks.min.js +1 -1
  125. package/image/image.cjs.js +11 -9
  126. package/image/image.cjs.min.js +1 -1
  127. package/image/image.esm.js +11 -9
  128. package/image/image.esm.min.js +1 -1
  129. package/image/image.js +11 -9
  130. package/image/image.min.js +1 -1
  131. package/inputnumber/inputnumber.cjs.js +20 -36
  132. package/inputnumber/inputnumber.cjs.min.js +1 -1
  133. package/inputnumber/inputnumber.d.ts +5 -5
  134. package/inputnumber/inputnumber.esm.js +20 -36
  135. package/inputnumber/inputnumber.esm.min.js +1 -1
  136. package/inputnumber/inputnumber.js +20 -36
  137. package/inputnumber/inputnumber.min.js +1 -1
  138. package/inputswitch/inputswitch.cjs.js +18 -93
  139. package/inputswitch/inputswitch.cjs.min.js +1 -1
  140. package/inputswitch/inputswitch.d.ts +9 -20
  141. package/inputswitch/inputswitch.esm.js +18 -93
  142. package/inputswitch/inputswitch.esm.min.js +1 -1
  143. package/inputswitch/inputswitch.js +18 -93
  144. package/inputswitch/inputswitch.min.js +1 -1
  145. package/inputtext/inputtext.cjs.js +5 -3
  146. package/inputtext/inputtext.cjs.min.js +1 -1
  147. package/inputtext/inputtext.d.ts +5 -0
  148. package/inputtext/inputtext.esm.js +5 -3
  149. package/inputtext/inputtext.esm.min.js +1 -1
  150. package/inputtext/inputtext.js +5 -3
  151. package/inputtext/inputtext.min.js +1 -1
  152. package/inputtextarea/inputtextarea.cjs.js +3 -1
  153. package/inputtextarea/inputtextarea.cjs.min.js +1 -1
  154. package/inputtextarea/inputtextarea.d.ts +5 -0
  155. package/inputtextarea/inputtextarea.esm.js +3 -1
  156. package/inputtextarea/inputtextarea.esm.min.js +1 -1
  157. package/inputtextarea/inputtextarea.js +3 -1
  158. package/inputtextarea/inputtextarea.min.js +1 -1
  159. package/listbox/listbox.cjs.js +14 -10
  160. package/listbox/listbox.cjs.min.js +1 -1
  161. package/listbox/listbox.d.ts +15 -0
  162. package/listbox/listbox.esm.js +15 -11
  163. package/listbox/listbox.esm.min.js +1 -1
  164. package/listbox/listbox.js +14 -10
  165. package/listbox/listbox.min.js +1 -1
  166. package/mention/mention.cjs.js +3 -1
  167. package/mention/mention.cjs.min.js +1 -1
  168. package/mention/mention.esm.js +3 -1
  169. package/mention/mention.esm.min.js +1 -1
  170. package/mention/mention.js +3 -1
  171. package/mention/mention.min.js +1 -1
  172. package/menu/menu.cjs.js +3 -2
  173. package/menu/menu.cjs.min.js +1 -1
  174. package/menu/menu.esm.js +3 -2
  175. package/menu/menu.esm.min.js +1 -1
  176. package/menu/menu.js +3 -2
  177. package/menu/menu.min.js +1 -1
  178. package/menubar/menubar.cjs.js +1 -1
  179. package/menubar/menubar.cjs.min.js +1 -1
  180. package/menubar/menubar.esm.js +1 -1
  181. package/menubar/menubar.esm.min.js +1 -1
  182. package/menubar/menubar.js +1 -1
  183. package/menubar/menubar.min.js +1 -1
  184. package/message/message.cjs.js +2 -8
  185. package/message/message.cjs.min.js +1 -1
  186. package/message/message.d.ts +1 -1
  187. package/message/message.esm.js +2 -8
  188. package/message/message.esm.min.js +1 -1
  189. package/message/message.js +2 -8
  190. package/message/message.min.js +1 -1
  191. package/messages/messages.cjs.js +1 -1
  192. package/messages/messages.cjs.min.js +1 -1
  193. package/messages/messages.d.ts +1 -1
  194. package/messages/messages.esm.js +1 -1
  195. package/messages/messages.esm.min.js +1 -1
  196. package/messages/messages.js +1 -1
  197. package/messages/messages.min.js +1 -1
  198. package/metergroup/metergroup.cjs.js +237 -0
  199. package/metergroup/metergroup.cjs.min.js +1 -0
  200. package/metergroup/metergroup.d.ts +183 -0
  201. package/metergroup/metergroup.esm.js +233 -0
  202. package/metergroup/metergroup.esm.min.js +1 -0
  203. package/metergroup/metergroup.js +236 -0
  204. package/metergroup/metergroup.min.js +1 -0
  205. package/multiselect/multiselect.cjs.js +94 -123
  206. package/multiselect/multiselect.cjs.min.js +1 -1
  207. package/multiselect/multiselect.d.ts +25 -1
  208. package/multiselect/multiselect.esm.js +94 -123
  209. package/multiselect/multiselect.esm.min.js +1 -1
  210. package/multiselect/multiselect.js +94 -123
  211. package/multiselect/multiselect.min.js +1 -1
  212. package/multistatecheckbox/multistatecheckbox.cjs.js +1 -1
  213. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  214. package/multistatecheckbox/multistatecheckbox.esm.js +1 -1
  215. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  216. package/multistatecheckbox/multistatecheckbox.js +1 -1
  217. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  218. package/orderlist/orderlist.cjs.js +35 -11
  219. package/orderlist/orderlist.cjs.min.js +1 -1
  220. package/orderlist/orderlist.d.ts +5 -0
  221. package/orderlist/orderlist.esm.js +35 -11
  222. package/orderlist/orderlist.esm.min.js +1 -1
  223. package/orderlist/orderlist.js +35 -11
  224. package/orderlist/orderlist.min.js +1 -1
  225. package/overlaypanel/overlaypanel.cjs.js +3 -2
  226. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  227. package/overlaypanel/overlaypanel.esm.js +3 -2
  228. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  229. package/overlaypanel/overlaypanel.js +3 -2
  230. package/overlaypanel/overlaypanel.min.js +1 -1
  231. package/package.json +1 -1
  232. package/paginator/paginator.cjs.js +125 -108
  233. package/paginator/paginator.cjs.min.js +1 -1
  234. package/paginator/paginator.d.ts +88 -0
  235. package/paginator/paginator.esm.js +125 -108
  236. package/paginator/paginator.esm.min.js +1 -1
  237. package/paginator/paginator.js +125 -108
  238. package/paginator/paginator.min.js +1 -1
  239. package/panelmenu/panelmenu.cjs.js +13 -5
  240. package/panelmenu/panelmenu.cjs.min.js +1 -1
  241. package/panelmenu/panelmenu.esm.js +13 -5
  242. package/panelmenu/panelmenu.esm.min.js +1 -1
  243. package/panelmenu/panelmenu.js +13 -5
  244. package/panelmenu/panelmenu.min.js +1 -1
  245. package/passthrough/index.d.ts +12 -0
  246. package/passthrough/tailwind/index.cjs.js +268 -172
  247. package/passthrough/tailwind/index.cjs.min.js +1 -1
  248. package/passthrough/tailwind/index.esm.js +268 -172
  249. package/passthrough/tailwind/index.esm.min.js +1 -1
  250. package/passthrough/tailwind/index.js +268 -172
  251. package/passthrough/tailwind/index.min.js +1 -1
  252. package/password/password.cjs.js +70 -39
  253. package/password/password.cjs.min.js +1 -1
  254. package/password/password.d.ts +5 -0
  255. package/password/password.esm.js +72 -41
  256. package/password/password.esm.min.js +1 -1
  257. package/password/password.js +70 -39
  258. package/password/password.min.js +1 -1
  259. package/picklist/picklist.cjs.js +126 -101
  260. package/picklist/picklist.cjs.min.js +1 -1
  261. package/picklist/picklist.d.ts +5 -0
  262. package/picklist/picklist.esm.js +126 -101
  263. package/picklist/picklist.esm.min.js +1 -1
  264. package/picklist/picklist.js +126 -101
  265. package/picklist/picklist.min.js +1 -1
  266. package/primereact.all.cjs.js +1774 -1431
  267. package/primereact.all.cjs.min.js +1 -1
  268. package/primereact.all.esm.js +1775 -1431
  269. package/primereact.all.esm.min.js +1 -1
  270. package/primereact.all.js +1774 -1431
  271. package/primereact.all.min.js +1 -1
  272. package/radiobutton/radiobutton.cjs.js +67 -142
  273. package/radiobutton/radiobutton.cjs.min.js +1 -1
  274. package/radiobutton/radiobutton.d.ts +17 -35
  275. package/radiobutton/radiobutton.esm.js +68 -143
  276. package/radiobutton/radiobutton.esm.min.js +1 -1
  277. package/radiobutton/radiobutton.js +67 -142
  278. package/radiobutton/radiobutton.min.js +1 -1
  279. package/resources/themes/arya-blue/theme.css +344 -67
  280. package/resources/themes/arya-green/theme.css +344 -67
  281. package/resources/themes/arya-orange/theme.css +344 -67
  282. package/resources/themes/bootstrap4-dark-blue/theme.css +389 -64
  283. package/resources/themes/bootstrap4-light-blue/theme.css +389 -64
  284. package/resources/themes/fluent-light/theme.css +341 -64
  285. package/resources/themes/lara-dark-amber/theme.css +470 -67
  286. package/resources/themes/lara-dark-blue/theme.css +470 -67
  287. package/resources/themes/lara-dark-cyan/theme.css +470 -67
  288. package/resources/themes/lara-dark-green/theme.css +470 -67
  289. package/resources/themes/lara-dark-indigo/theme.css +470 -67
  290. package/resources/themes/lara-dark-pink/theme.css +470 -67
  291. package/resources/themes/lara-dark-teal/theme.css +470 -67
  292. package/resources/themes/lara-light-amber/theme.css +470 -67
  293. package/resources/themes/lara-light-blue/theme.css +470 -67
  294. package/resources/themes/lara-light-cyan/theme.css +470 -67
  295. package/resources/themes/lara-light-green/theme.css +470 -67
  296. package/resources/themes/lara-light-indigo/theme.css +470 -67
  297. package/resources/themes/lara-light-pink/theme.css +470 -67
  298. package/resources/themes/lara-light-teal/theme.css +470 -67
  299. package/resources/themes/luna-amber/theme.css +344 -67
  300. package/resources/themes/luna-blue/theme.css +344 -67
  301. package/resources/themes/luna-green/theme.css +344 -67
  302. package/resources/themes/luna-pink/theme.css +344 -67
  303. package/resources/themes/md-dark-deeppurple/theme.css +995 -289
  304. package/resources/themes/md-dark-indigo/theme.css +684 -232
  305. package/resources/themes/md-light-deeppurple/theme.css +868 -162
  306. package/resources/themes/md-light-indigo/theme.css +566 -101
  307. package/resources/themes/mdc-dark-deeppurple/theme.css +995 -289
  308. package/resources/themes/mdc-dark-indigo/theme.css +697 -232
  309. package/resources/themes/mdc-light-deeppurple/theme.css +868 -162
  310. package/resources/themes/mdc-light-indigo/theme.css +566 -101
  311. package/resources/themes/mira/theme.css +344 -67
  312. package/resources/themes/nano/theme.css +344 -67
  313. package/resources/themes/nova/theme.css +344 -67
  314. package/resources/themes/nova-accent/theme.css +344 -67
  315. package/resources/themes/nova-alt/theme.css +344 -67
  316. package/resources/themes/rhea/theme.css +343 -66
  317. package/resources/themes/saga-blue/theme.css +344 -67
  318. package/resources/themes/saga-green/theme.css +344 -67
  319. package/resources/themes/saga-orange/theme.css +344 -67
  320. package/resources/themes/soho-dark/theme.css +413 -88
  321. package/resources/themes/soho-light/theme.css +392 -67
  322. package/resources/themes/tailwind-light/theme.css +344 -67
  323. package/resources/themes/vela-blue/theme.css +344 -67
  324. package/resources/themes/vela-green/theme.css +344 -67
  325. package/resources/themes/vela-orange/theme.css +344 -67
  326. package/resources/themes/viva-dark/theme.css +392 -67
  327. package/resources/themes/viva-light/theme.css +392 -67
  328. package/selectbutton/selectbutton.cjs.js +12 -4
  329. package/selectbutton/selectbutton.cjs.min.js +1 -1
  330. package/selectbutton/selectbutton.d.ts +5 -0
  331. package/selectbutton/selectbutton.esm.js +12 -4
  332. package/selectbutton/selectbutton.esm.min.js +1 -1
  333. package/selectbutton/selectbutton.js +13 -5
  334. package/selectbutton/selectbutton.min.js +1 -1
  335. package/sidebar/sidebar.cjs.js +4 -3
  336. package/sidebar/sidebar.cjs.min.js +1 -1
  337. package/sidebar/sidebar.d.ts +4 -4
  338. package/sidebar/sidebar.esm.js +4 -3
  339. package/sidebar/sidebar.esm.min.js +1 -1
  340. package/sidebar/sidebar.js +4 -3
  341. package/sidebar/sidebar.min.js +1 -1
  342. package/slidemenu/slidemenu.cjs.js +3 -2
  343. package/slidemenu/slidemenu.cjs.min.js +1 -1
  344. package/slidemenu/slidemenu.esm.js +3 -2
  345. package/slidemenu/slidemenu.esm.min.js +1 -1
  346. package/slidemenu/slidemenu.js +3 -2
  347. package/slidemenu/slidemenu.min.js +1 -1
  348. package/slider/slider.cjs.js +18 -2
  349. package/slider/slider.cjs.min.js +1 -1
  350. package/slider/slider.esm.js +18 -2
  351. package/slider/slider.esm.min.js +1 -1
  352. package/slider/slider.js +18 -2
  353. package/slider/slider.min.js +1 -1
  354. package/splitbutton/splitbutton.d.ts +2 -2
  355. package/splitter/splitter.cjs.js +7 -7
  356. package/splitter/splitter.cjs.min.js +1 -1
  357. package/splitter/splitter.d.ts +5 -5
  358. package/splitter/splitter.esm.js +7 -7
  359. package/splitter/splitter.esm.min.js +1 -1
  360. package/splitter/splitter.js +7 -7
  361. package/splitter/splitter.min.js +1 -1
  362. package/styleclass/styleclass.cjs.js +21 -1
  363. package/styleclass/styleclass.cjs.min.js +1 -1
  364. package/styleclass/styleclass.d.ts +10 -0
  365. package/styleclass/styleclass.esm.js +21 -1
  366. package/styleclass/styleclass.esm.min.js +1 -1
  367. package/styleclass/styleclass.js +22 -2
  368. package/styleclass/styleclass.min.js +1 -1
  369. package/tabmenu/tabmenu.cjs.js +1 -1
  370. package/tabmenu/tabmenu.cjs.min.js +1 -1
  371. package/tabmenu/tabmenu.esm.js +1 -1
  372. package/tabmenu/tabmenu.esm.min.js +1 -1
  373. package/tabmenu/tabmenu.js +1 -1
  374. package/tabmenu/tabmenu.min.js +1 -1
  375. package/toast/toast.cjs.js +93 -92
  376. package/toast/toast.cjs.min.js +1 -1
  377. package/toast/toast.d.ts +1 -1
  378. package/toast/toast.esm.js +93 -92
  379. package/toast/toast.esm.min.js +1 -1
  380. package/toast/toast.js +93 -92
  381. package/toast/toast.min.js +1 -1
  382. package/togglebutton/togglebutton.cjs.js +54 -92
  383. package/togglebutton/togglebutton.cjs.min.js +1 -1
  384. package/togglebutton/togglebutton.d.ts +24 -0
  385. package/togglebutton/togglebutton.esm.js +53 -91
  386. package/togglebutton/togglebutton.esm.min.js +1 -1
  387. package/togglebutton/togglebutton.js +54 -92
  388. package/togglebutton/togglebutton.min.js +1 -1
  389. package/tooltip/tooltip.d.ts +3 -3
  390. package/tooltip/tooltipoptions.d.ts +5 -0
  391. package/tree/tree.cjs.js +20 -8
  392. package/tree/tree.cjs.min.js +1 -1
  393. package/tree/tree.esm.js +20 -8
  394. package/tree/tree.esm.min.js +1 -1
  395. package/tree/tree.js +20 -8
  396. package/tree/tree.min.js +1 -1
  397. package/treeselect/treeselect.cjs.js +2 -0
  398. package/treeselect/treeselect.cjs.min.js +1 -1
  399. package/treeselect/treeselect.d.ts +5 -0
  400. package/treeselect/treeselect.esm.js +2 -0
  401. package/treeselect/treeselect.esm.min.js +1 -1
  402. package/treeselect/treeselect.js +2 -0
  403. package/treeselect/treeselect.min.js +1 -1
  404. package/treetable/treetable.cjs.js +17 -14
  405. package/treetable/treetable.cjs.min.js +1 -1
  406. package/treetable/treetable.esm.js +17 -14
  407. package/treetable/treetable.esm.min.js +1 -1
  408. package/treetable/treetable.js +17 -14
  409. package/treetable/treetable.min.js +1 -1
  410. package/tristatecheckbox/tristatecheckbox.cjs.js +33 -90
  411. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  412. package/tristatecheckbox/tristatecheckbox.d.ts +12 -13
  413. package/tristatecheckbox/tristatecheckbox.esm.js +34 -91
  414. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  415. package/tristatecheckbox/tristatecheckbox.js +33 -90
  416. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  417. package/utils/utils.cjs.js +64 -72
  418. package/utils/utils.cjs.min.js +1 -1
  419. package/utils/utils.d.ts +11 -2
  420. package/utils/utils.esm.js +65 -72
  421. package/utils/utils.esm.min.js +1 -1
  422. package/utils/utils.js +64 -72
  423. package/utils/utils.min.js +1 -1
  424. package/virtualscroller/virtualscroller.cjs.js +17 -15
  425. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  426. package/virtualscroller/virtualscroller.esm.js +14 -12
  427. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  428. package/virtualscroller/virtualscroller.js +17 -15
  429. package/virtualscroller/virtualscroller.min.js +1 -1
  430. package/web-types.json +455 -39
@@ -63,85 +63,21 @@ function _defineProperty(obj, key, value) {
63
63
  return obj;
64
64
  }
65
65
 
66
- function _arrayWithHoles(arr) {
67
- if (Array.isArray(arr)) return arr;
68
- }
69
-
70
- function _iterableToArrayLimit(r, l) {
71
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
72
- if (null != t) {
73
- var e,
74
- n,
75
- i,
76
- u,
77
- a = [],
78
- f = !0,
79
- o = !1;
80
- try {
81
- if (i = (t = t.call(r)).next, 0 === l) {
82
- if (Object(t) !== t) return;
83
- f = !1;
84
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
85
- } catch (r) {
86
- o = !0, n = r;
87
- } finally {
88
- try {
89
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
90
- } finally {
91
- if (o) throw n;
92
- }
93
- }
94
- return a;
95
- }
96
- }
97
-
98
- function _arrayLikeToArray(arr, len) {
99
- if (len == null || len > arr.length) len = arr.length;
100
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
101
- return arr2;
102
- }
103
-
104
- function _unsupportedIterableToArray(o, minLen) {
105
- if (!o) return;
106
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
107
- var n = Object.prototype.toString.call(o).slice(8, -1);
108
- if (n === "Object" && o.constructor) n = o.constructor.name;
109
- if (n === "Map" || n === "Set") return Array.from(o);
110
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
111
- }
112
-
113
- function _nonIterableRest() {
114
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
115
- }
116
-
117
- function _slicedToArray(arr, i) {
118
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
119
- }
120
-
121
66
  var classes = {
122
- icon: 'p-checkbox-icon p-c',
123
- input: function input(_ref) {
67
+ box: 'p-checkbox-box',
68
+ input: 'p-checkbox-input',
69
+ icon: 'p-checkbox-icon',
70
+ root: function root(_ref) {
124
71
  var props = _ref.props,
125
- checked = _ref.checked,
126
- focusedState = _ref.focusedState;
127
- return classNames('p-checkbox-box', {
72
+ checked = _ref.checked;
73
+ return classNames('p-checkbox p-component', {
128
74
  'p-highlight': checked,
129
75
  'p-disabled': props.disabled,
130
- 'p-focus': focusedState
131
- });
132
- },
133
- root: function root(_ref2) {
134
- var props = _ref2.props,
135
- checked = _ref2.checked,
136
- focusedState = _ref2.focusedState;
137
- return classNames('p-checkbox p-component', {
138
- 'p-checkbox-checked': checked,
139
- 'p-checkbox-disabled': props.disabled,
140
- 'p-checkbox-focused': focusedState
76
+ 'p-invalid': props.invalid,
77
+ 'p-variant-filled': props.variant === 'filled'
141
78
  });
142
79
  }
143
80
  };
144
- var styles = "\n.p-checkbox {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n position: relative;\n}\n\n.p-checkbox.p-checkbox-disabled {\n cursor: auto;\n}\n\n.p-checkbox-box {\n display: flex;\n justify-content: center;\n align-items: center;\n} \n";
145
81
  var CheckboxBase = ComponentBase.extend({
146
82
  defaultProps: {
147
83
  __TYPE: 'Checkbox',
@@ -154,6 +90,7 @@ var CheckboxBase = ComponentBase.extend({
154
90
  id: null,
155
91
  inputId: null,
156
92
  inputRef: null,
93
+ invalid: false,
157
94
  name: null,
158
95
  onChange: null,
159
96
  onClick: null,
@@ -170,8 +107,7 @@ var CheckboxBase = ComponentBase.extend({
170
107
  children: undefined
171
108
  },
172
109
  css: {
173
- classes: classes,
174
- styles: styles
110
+ classes: classes
175
111
  }
176
112
  });
177
113
 
@@ -181,15 +117,8 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
181
117
  var mergeProps = useMergeProps();
182
118
  var context = React.useContext(PrimeReactContext);
183
119
  var props = CheckboxBase.getProps(inProps, context);
184
- var _React$useState = React.useState(false),
185
- _React$useState2 = _slicedToArray(_React$useState, 2),
186
- focusedState = _React$useState2[0],
187
- setFocusedState = _React$useState2[1];
188
120
  var _CheckboxBase$setMeta = CheckboxBase.setMetaData({
189
121
  props: props,
190
- state: {
191
- focused: focusedState
192
- },
193
122
  context: {
194
123
  checked: props.checked === props.trueValue,
195
124
  disabled: props.disabled
@@ -199,20 +128,19 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
199
128
  cx = _CheckboxBase$setMeta.cx,
200
129
  isUnstyled = _CheckboxBase$setMeta.isUnstyled;
201
130
  useHandleStyle(CheckboxBase.css.styles, isUnstyled, {
202
- name: 'checkbox',
203
- styled: true
131
+ name: 'checkbox'
204
132
  });
205
133
  var elementRef = React.useRef(null);
206
134
  var inputRef = React.useRef(props.inputRef);
207
- var _onClick = function onClick(event) {
208
- if (props.disabled || props.readOnly) {
135
+ var isChecked = function isChecked() {
136
+ return props.checked === props.trueValue;
137
+ };
138
+ var _onChange = function onChange(event) {
139
+ if (props.disabled || props.readonly) {
209
140
  return;
210
141
  }
211
- if (props.onChange || props.onClick) {
142
+ if (props.onChange) {
212
143
  var _checked = isChecked();
213
- var checkboxClicked = event.target instanceof HTMLDivElement || event.target instanceof HTMLSpanElement || event.target instanceof Object;
214
- var isInputToggled = event.target === inputRef.current;
215
- var isCheckboxToggled = checkboxClicked && event.target.checked !== _checked;
216
144
  var value = _checked ? props.falseValue : props.trueValue;
217
145
  var eventData = {
218
146
  originalEvent: event,
@@ -232,33 +160,22 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
232
160
  checked: value
233
161
  }
234
162
  };
235
- props.onClick && props.onClick(eventData);
163
+ props.onChange && props.onChange(eventData);
236
164
 
237
165
  // do not continue if the user defined click wants to prevent
238
166
  if (event.defaultPrevented) {
239
167
  return;
240
168
  }
241
- if (isInputToggled || isCheckboxToggled) {
242
- props.onChange && props.onChange(eventData);
243
- }
244
169
  DomHandler.focus(inputRef.current);
245
- event.preventDefault();
246
170
  }
247
171
  };
248
172
  var _onFocus = function onFocus() {
249
- setFocusedState(true);
173
+ var _props$onFocus;
174
+ props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props);
250
175
  };
251
176
  var _onBlur = function onBlur() {
252
- setFocusedState(false);
253
- };
254
- var _onKeyDown = function onKeyDown(event) {
255
- if (event.code === 'Space' || event.key === ' ') {
256
- // event.key is for Android support
257
- _onClick(event);
258
- }
259
- };
260
- var isChecked = function isChecked() {
261
- return props.checked === props.trueValue;
177
+ var _props$onBlur;
178
+ props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props);
262
179
  };
263
180
  React.useImperativeHandle(ref, function () {
264
181
  return {
@@ -288,66 +205,66 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
288
205
  var checked = isChecked();
289
206
  var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
290
207
  var otherProps = CheckboxBase.getOtherProps(props);
291
- var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
292
- var iconProps = mergeProps({
293
- className: cx('icon')
294
- }, ptm('icon'));
295
- var icon = checked ? props.icon || /*#__PURE__*/React.createElement(CheckIcon, iconProps) : null;
296
- var checkboxIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
297
- props: props,
298
- checked: checked
299
- });
300
208
  var rootProps = mergeProps({
301
209
  id: props.id,
302
210
  className: classNames(props.className, cx('root', {
303
- checked: checked,
304
- focusedState: focusedState
211
+ checked: checked
305
212
  })),
306
213
  style: props.style,
307
- onClick: function onClick(e) {
308
- return _onClick(e);
309
- },
310
214
  'data-p-highlight': checked,
311
215
  'data-p-disabled': props.disabled,
312
216
  onContextMenu: props.onContextMenu,
313
217
  onMouseDown: props.onMouseDown
314
218
  }, otherProps, ptm('root'));
315
- var hiddenInputWrapperProps = mergeProps({
316
- className: 'p-hidden-accessible'
317
- }, ptm('hiddenInputWrapper'));
318
- var hiddenInputProps = mergeProps(_objectSpread({
319
- id: props.inputId,
320
- type: 'checkbox',
321
- name: props.name,
322
- tabIndex: props.tabIndex,
323
- defaultChecked: checked,
324
- onFocus: function onFocus(e) {
325
- return _onFocus();
326
- },
327
- onBlur: function onBlur(e) {
328
- return _onBlur();
329
- },
330
- onKeyDown: function onKeyDown(e) {
331
- return _onKeyDown(e);
332
- },
333
- disabled: props.disabled,
334
- readOnly: props.readOnly,
335
- required: props.required
336
- }, ariaProps), ptm('hiddenInput'));
337
- var inputProps = mergeProps({
338
- className: cx('input', {
339
- checked: checked,
340
- focusedState: focusedState
341
- }),
342
- 'data-p-highlight': checked,
343
- 'data-p-disabled': props.disabled,
344
- 'data-p-focus': focusedState
345
- }, ptm('input'));
219
+ var createInputElement = function createInputElement() {
220
+ var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
221
+ var inputProps = mergeProps(_objectSpread({
222
+ id: props.inputId,
223
+ type: 'checkbox',
224
+ className: cx('input'),
225
+ name: props.name,
226
+ tabIndex: props.tabIndex,
227
+ defaultChecked: checked,
228
+ onFocus: function onFocus(e) {
229
+ return _onFocus();
230
+ },
231
+ onBlur: function onBlur(e) {
232
+ return _onBlur();
233
+ },
234
+ onChange: function onChange(e) {
235
+ return _onChange(e);
236
+ },
237
+ disabled: props.disabled,
238
+ readOnly: props.readOnly,
239
+ required: props.required,
240
+ 'aria-invalid': props.invalid,
241
+ checked: isChecked()
242
+ }, ariaProps), ptm('input'));
243
+ return /*#__PURE__*/React.createElement("input", _extends({
244
+ ref: inputRef
245
+ }, inputProps));
246
+ };
247
+ var createBoxElement = function createBoxElement() {
248
+ var iconProps = mergeProps({
249
+ className: cx('icon')
250
+ }, ptm('icon'));
251
+ var boxProps = mergeProps({
252
+ className: cx('box', {
253
+ checked: checked
254
+ }),
255
+ 'data-p-highlight': checked,
256
+ 'data-p-disabled': props.disabled
257
+ }, ptm('box'));
258
+ var icon = checked ? props.icon || /*#__PURE__*/React.createElement(CheckIcon, iconProps) : null;
259
+ var checkboxIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
260
+ props: props,
261
+ checked: checked
262
+ });
263
+ return /*#__PURE__*/React.createElement("div", boxProps, checkboxIcon);
264
+ };
346
265
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
347
266
  ref: elementRef
348
- }, rootProps), /*#__PURE__*/React.createElement("div", hiddenInputWrapperProps, /*#__PURE__*/React.createElement("input", _extends({
349
- ref: inputRef
350
- }, hiddenInputProps))), /*#__PURE__*/React.createElement("div", inputProps, checkboxIcon)), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
267
+ }, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
351
268
  target: elementRef,
352
269
  content: props.tooltip,
353
270
  pt: ptm('tooltip')
@@ -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,useUpdateEffect as c,useMountEffect as i}from"primereact/hooks";import{CheckIcon as a}from"primereact/icons/check";import{Tooltip as u}from"primereact/tooltip";import{classNames as l,DomHandler as s,ObjectUtils as p,IconUtils as f}from"primereact/utils";function d(){return d=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},d.apply(this,arguments)}function b(e){return b="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},b(e)}function m(e,t){if("object"!==b(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function y(e){var t=m(e,"string");return"symbol"===b(t)?t:String(t)}function h(e){if(Array.isArray(e))return e}function v(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c,i,a=[],u=!0,l=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=c.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&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return a}}function g(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 k(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function O(){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 x=n.extend({defaultProps:{__TYPE:"Checkbox",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,icon:null,id:null,inputId:null,inputRef:null,name:null,onChange:null,onClick:null,onContextMenu:null,onMouseDown:null,readOnly:!1,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,value:null,children:void 0},css:{classes:{icon:"p-checkbox-icon p-c",input:function(e){return l("p-checkbox-box",{"p-highlight":e.checked,"p-disabled":e.props.disabled,"p-focus":e.focusedState})},root:function(e){return l("p-checkbox p-component",{"p-checkbox-checked":e.checked,"p-checkbox-disabled":e.props.disabled,"p-checkbox-focused":e.focusedState})}},styles:"\n.p-checkbox {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n position: relative;\n}\n\n.p-checkbox.p-checkbox-disabled {\n cursor: auto;\n}\n\n.p-checkbox-box {\n display: flex;\n justify-content: center;\n align-items: center;\n} \n"}});function j(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 S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){var r,o,c;r=e,c=n[t],(o=y(o=t))in r?Object.defineProperty(r,o,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[o]=c})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=e.memo(e.forwardRef((function(n,b){var m,y,g=o(),j=e.useContext(t),P=x.getProps(n,j),w=e.useState(!1),E=(y=2,h(m=w)||v(m,y)||k(m,y)||O()),C=E[0],I=E[1],D=x.setMetaData({props:P,state:{focused:C},context:{checked:P.checked===P.trueValue,disabled:P.disabled}}),M=D.ptm,R=D.cx;r(x.css.styles,D.isUnstyled,{name:"checkbox",styled:!0});var N=e.useRef(null),A=e.useRef(P.inputRef),V=function(e){if(!P.disabled&&!P.readOnly&&(P.onChange||P.onClick)){var t=F(),n=e.target instanceof HTMLDivElement||e.target instanceof HTMLSpanElement||e.target instanceof Object,r=e.target===A.current,o=n&&e.target.checked!==t,c=t?P.falseValue:P.trueValue,i={originalEvent:e,value:P.value,checked:c,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{type:"checkbox",name:P.name,id:P.id,value:P.value,checked:c}};if(P.onClick&&P.onClick(i),e.defaultPrevented)return;(r||o)&&P.onChange&&P.onChange(i),s.focus(A.current),e.preventDefault()}},F=function(){return P.checked===P.trueValue};e.useImperativeHandle(b,(function(){return{props:P,focus:function(){return s.focus(A.current)},getElement:function(){return N.current},getInput:function(){return A.current}}})),e.useEffect((function(){p.combinedRefs(A,P.inputRef)}),[A,P.inputRef]),c((function(){A.current.checked=F()}),[P.checked,P.trueValue]),i((function(){P.autoFocus&&s.focus(A.current,P.autoFocus)}));var T=F(),q=p.isNotEmpty(P.tooltip),H=x.getOtherProps(P),_=p.reduceKeys(H,s.ARIA_PROPS),K=g({className:R("icon")},M("icon")),L=f.getJSXIcon(T?P.icon||e.createElement(a,K):null,S({},K),{props:P,checked:T}),U=g({id:P.id,className:l(P.className,R("root",{checked:T,focusedState:C})),style:P.style,onClick:function(e){return V(e)},"data-p-highlight":T,"data-p-disabled":P.disabled,onContextMenu:P.onContextMenu,onMouseDown:P.onMouseDown},H,M("root")),B=g({className:"p-hidden-accessible"},M("hiddenInputWrapper")),J=g(S({id:P.inputId,type:"checkbox",name:P.name,tabIndex:P.tabIndex,defaultChecked:T,onFocus:function(e){I(!0)},onBlur:function(e){I(!1)},onKeyDown:function(e){var t;"Space"!==(t=e).code&&" "!==t.key||V(t)},disabled:P.disabled,readOnly:P.readOnly,required:P.required},_),M("hiddenInput")),W=g({className:R("input",{checked:T,focusedState:C}),"data-p-highlight":T,"data-p-disabled":P.disabled,"data-p-focus":C},M("input"));return e.createElement(e.Fragment,null,e.createElement("div",d({ref:N},U),e.createElement("div",B,e.createElement("input",d({ref:A},J))),e.createElement("div",W,L)),q&&e.createElement(u,d({target:N,content:P.tooltip,pt:M("tooltip")},P.tooltipOptions)))})));P.displayName="Checkbox";export{P as Checkbox};
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,useUpdateEffect as i,useMountEffect as c}from"primereact/hooks";import{CheckIcon as l}from"primereact/icons/check";import{Tooltip as a}from"primereact/tooltip";import{classNames as u,DomHandler as p,ObjectUtils as s,IconUtils as d}from"primereact/utils";function f(){return f=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},f.apply(this,arguments)}function m(e){return m="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},m(e)}function b(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function h(e){var t=b(e,"string");return"symbol"===m(t)?t:String(t)}var v=n.extend({defaultProps:{__TYPE:"Checkbox",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,icon:null,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onChange:null,onClick:null,onContextMenu:null,onMouseDown:null,readOnly:!1,required:!1,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,value:null,children:void 0},css:{classes:{box:"p-checkbox-box",input:"p-checkbox-input",icon:"p-checkbox-icon",root:function(e){var t=e.props;return u("p-checkbox p-component",{"p-highlight":e.checked,"p-disabled":t.disabled,"p-invalid":t.invalid,"p-variant-filled":"filled"===t.variant})}}}});function y(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){var r,o,i;r=e,i=n[t],(o=h(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)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=e.memo(e.forwardRef((function(n,m){var b=o(),h=e.useContext(t),y=v.getProps(n,h),O=v.setMetaData({props:y,context:{checked:y.checked===y.trueValue,disabled:y.disabled}}),k=O.ptm,x=O.cx;r(v.css.styles,O.isUnstyled,{name:"checkbox"});var P=e.useRef(null),j=e.useRef(y.inputRef),w=function(){return y.checked===y.trueValue},E=function(e){if(!y.disabled&&!y.readonly&&y.onChange){var t=w()?y.falseValue:y.trueValue;if(y.onChange&&y.onChange({originalEvent:e,value:y.value,checked:t,stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},target:{type:"checkbox",name:y.name,id:y.id,value:y.value,checked:t}}),e.defaultPrevented)return;p.focus(j.current)}};e.useImperativeHandle(m,(function(){return{props:y,focus:function(){return p.focus(j.current)},getElement:function(){return P.current},getInput:function(){return j.current}}})),e.useEffect((function(){s.combinedRefs(j,y.inputRef)}),[j,y.inputRef]),i((function(){j.current.checked=w()}),[y.checked,y.trueValue]),c((function(){y.autoFocus&&p.focus(j.current,y.autoFocus)}));var C,S,D,R,I,N=w(),M=s.isNotEmpty(y.tooltip),V=v.getOtherProps(y),F=b({id:y.id,className:u(y.className,x("root",{checked:N})),style:y.style,"data-p-highlight":N,"data-p-disabled":y.disabled,onContextMenu:y.onContextMenu,onMouseDown:y.onMouseDown},V,k("root"));return e.createElement(e.Fragment,null,e.createElement("div",f({ref:P},F),(R=s.reduceKeys(V,p.ARIA_PROPS),I=b(g({id:y.inputId,type:"checkbox",className:x("input"),name:y.name,tabIndex:y.tabIndex,defaultChecked:N,onFocus:function(e){var t;null==y||null===(t=y.onFocus)||void 0===t||t.call(y)},onBlur:function(e){var t;null==y||null===(t=y.onBlur)||void 0===t||t.call(y)},onChange:function(e){return E(e)},disabled:y.disabled,readOnly:y.readOnly,required:y.required,"aria-invalid":y.invalid,checked:w()},R),k("input")),e.createElement("input",f({ref:j},I))),(C=b({className:x("icon")},k("icon")),S=b({className:x("box",{checked:N}),"data-p-highlight":N,"data-p-disabled":y.disabled},k("box")),D=d.getJSXIcon(N?y.icon||e.createElement(l,C):null,g({},C),{props:y,checked:N}),e.createElement("div",S,D))),M&&e.createElement(a,f({target:P,content:y.tooltip,pt:k("tooltip")},y.tooltipOptions)))})));O.displayName="Checkbox";export{O as Checkbox};
@@ -78,85 +78,21 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
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
- icon: 'p-checkbox-icon p-c',
138
- input: function input(_ref) {
82
+ box: 'p-checkbox-box',
83
+ input: 'p-checkbox-input',
84
+ icon: 'p-checkbox-icon',
85
+ root: function root(_ref) {
139
86
  var props = _ref.props,
140
- checked = _ref.checked,
141
- focusedState = _ref.focusedState;
142
- return utils.classNames('p-checkbox-box', {
87
+ checked = _ref.checked;
88
+ return utils.classNames('p-checkbox p-component', {
143
89
  'p-highlight': checked,
144
90
  'p-disabled': props.disabled,
145
- 'p-focus': focusedState
146
- });
147
- },
148
- root: function root(_ref2) {
149
- var props = _ref2.props,
150
- checked = _ref2.checked,
151
- focusedState = _ref2.focusedState;
152
- return utils.classNames('p-checkbox p-component', {
153
- 'p-checkbox-checked': checked,
154
- 'p-checkbox-disabled': props.disabled,
155
- 'p-checkbox-focused': focusedState
91
+ 'p-invalid': props.invalid,
92
+ 'p-variant-filled': props.variant === 'filled'
156
93
  });
157
94
  }
158
95
  };
159
- var styles = "\n.p-checkbox {\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n vertical-align: bottom;\n position: relative;\n}\n\n.p-checkbox.p-checkbox-disabled {\n cursor: auto;\n}\n\n.p-checkbox-box {\n display: flex;\n justify-content: center;\n align-items: center;\n} \n";
160
96
  var CheckboxBase = componentbase.ComponentBase.extend({
161
97
  defaultProps: {
162
98
  __TYPE: 'Checkbox',
@@ -169,6 +105,7 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
169
105
  id: null,
170
106
  inputId: null,
171
107
  inputRef: null,
108
+ invalid: false,
172
109
  name: null,
173
110
  onChange: null,
174
111
  onClick: null,
@@ -185,8 +122,7 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
185
122
  children: undefined
186
123
  },
187
124
  css: {
188
- classes: classes,
189
- styles: styles
125
+ classes: classes
190
126
  }
191
127
  });
192
128
 
@@ -196,15 +132,8 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
196
132
  var mergeProps = hooks.useMergeProps();
197
133
  var context = React__namespace.useContext(api.PrimeReactContext);
198
134
  var props = CheckboxBase.getProps(inProps, context);
199
- var _React$useState = React__namespace.useState(false),
200
- _React$useState2 = _slicedToArray(_React$useState, 2),
201
- focusedState = _React$useState2[0],
202
- setFocusedState = _React$useState2[1];
203
135
  var _CheckboxBase$setMeta = CheckboxBase.setMetaData({
204
136
  props: props,
205
- state: {
206
- focused: focusedState
207
- },
208
137
  context: {
209
138
  checked: props.checked === props.trueValue,
210
139
  disabled: props.disabled
@@ -214,20 +143,19 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
214
143
  cx = _CheckboxBase$setMeta.cx,
215
144
  isUnstyled = _CheckboxBase$setMeta.isUnstyled;
216
145
  componentbase.useHandleStyle(CheckboxBase.css.styles, isUnstyled, {
217
- name: 'checkbox',
218
- styled: true
146
+ name: 'checkbox'
219
147
  });
220
148
  var elementRef = React__namespace.useRef(null);
221
149
  var inputRef = React__namespace.useRef(props.inputRef);
222
- var _onClick = function onClick(event) {
223
- if (props.disabled || props.readOnly) {
150
+ var isChecked = function isChecked() {
151
+ return props.checked === props.trueValue;
152
+ };
153
+ var _onChange = function onChange(event) {
154
+ if (props.disabled || props.readonly) {
224
155
  return;
225
156
  }
226
- if (props.onChange || props.onClick) {
157
+ if (props.onChange) {
227
158
  var _checked = isChecked();
228
- var checkboxClicked = event.target instanceof HTMLDivElement || event.target instanceof HTMLSpanElement || event.target instanceof Object;
229
- var isInputToggled = event.target === inputRef.current;
230
- var isCheckboxToggled = checkboxClicked && event.target.checked !== _checked;
231
159
  var value = _checked ? props.falseValue : props.trueValue;
232
160
  var eventData = {
233
161
  originalEvent: event,
@@ -247,33 +175,22 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
247
175
  checked: value
248
176
  }
249
177
  };
250
- props.onClick && props.onClick(eventData);
178
+ props.onChange && props.onChange(eventData);
251
179
 
252
180
  // do not continue if the user defined click wants to prevent
253
181
  if (event.defaultPrevented) {
254
182
  return;
255
183
  }
256
- if (isInputToggled || isCheckboxToggled) {
257
- props.onChange && props.onChange(eventData);
258
- }
259
184
  utils.DomHandler.focus(inputRef.current);
260
- event.preventDefault();
261
185
  }
262
186
  };
263
187
  var _onFocus = function onFocus() {
264
- setFocusedState(true);
188
+ var _props$onFocus;
189
+ props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props);
265
190
  };
266
191
  var _onBlur = function onBlur() {
267
- setFocusedState(false);
268
- };
269
- var _onKeyDown = function onKeyDown(event) {
270
- if (event.code === 'Space' || event.key === ' ') {
271
- // event.key is for Android support
272
- _onClick(event);
273
- }
274
- };
275
- var isChecked = function isChecked() {
276
- return props.checked === props.trueValue;
192
+ var _props$onBlur;
193
+ props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props);
277
194
  };
278
195
  React__namespace.useImperativeHandle(ref, function () {
279
196
  return {
@@ -303,66 +220,66 @@ this.primereact.checkbox = (function (exports, React, api, componentbase, hooks,
303
220
  var checked = isChecked();
304
221
  var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);
305
222
  var otherProps = CheckboxBase.getOtherProps(props);
306
- var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
307
- var iconProps = mergeProps({
308
- className: cx('icon')
309
- }, ptm('icon'));
310
- var icon = checked ? props.icon || /*#__PURE__*/React__namespace.createElement(check.CheckIcon, iconProps) : null;
311
- var checkboxIcon = utils.IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
312
- props: props,
313
- checked: checked
314
- });
315
223
  var rootProps = mergeProps({
316
224
  id: props.id,
317
225
  className: utils.classNames(props.className, cx('root', {
318
- checked: checked,
319
- focusedState: focusedState
226
+ checked: checked
320
227
  })),
321
228
  style: props.style,
322
- onClick: function onClick(e) {
323
- return _onClick(e);
324
- },
325
229
  'data-p-highlight': checked,
326
230
  'data-p-disabled': props.disabled,
327
231
  onContextMenu: props.onContextMenu,
328
232
  onMouseDown: props.onMouseDown
329
233
  }, otherProps, ptm('root'));
330
- var hiddenInputWrapperProps = mergeProps({
331
- className: 'p-hidden-accessible'
332
- }, ptm('hiddenInputWrapper'));
333
- var hiddenInputProps = mergeProps(_objectSpread({
334
- id: props.inputId,
335
- type: 'checkbox',
336
- name: props.name,
337
- tabIndex: props.tabIndex,
338
- defaultChecked: checked,
339
- onFocus: function onFocus(e) {
340
- return _onFocus();
341
- },
342
- onBlur: function onBlur(e) {
343
- return _onBlur();
344
- },
345
- onKeyDown: function onKeyDown(e) {
346
- return _onKeyDown(e);
347
- },
348
- disabled: props.disabled,
349
- readOnly: props.readOnly,
350
- required: props.required
351
- }, ariaProps), ptm('hiddenInput'));
352
- var inputProps = mergeProps({
353
- className: cx('input', {
354
- checked: checked,
355
- focusedState: focusedState
356
- }),
357
- 'data-p-highlight': checked,
358
- 'data-p-disabled': props.disabled,
359
- 'data-p-focus': focusedState
360
- }, ptm('input'));
234
+ var createInputElement = function createInputElement() {
235
+ var ariaProps = utils.ObjectUtils.reduceKeys(otherProps, utils.DomHandler.ARIA_PROPS);
236
+ var inputProps = mergeProps(_objectSpread({
237
+ id: props.inputId,
238
+ type: 'checkbox',
239
+ className: cx('input'),
240
+ name: props.name,
241
+ tabIndex: props.tabIndex,
242
+ defaultChecked: checked,
243
+ onFocus: function onFocus(e) {
244
+ return _onFocus();
245
+ },
246
+ onBlur: function onBlur(e) {
247
+ return _onBlur();
248
+ },
249
+ onChange: function onChange(e) {
250
+ return _onChange(e);
251
+ },
252
+ disabled: props.disabled,
253
+ readOnly: props.readOnly,
254
+ required: props.required,
255
+ 'aria-invalid': props.invalid,
256
+ checked: isChecked()
257
+ }, ariaProps), ptm('input'));
258
+ return /*#__PURE__*/React__namespace.createElement("input", _extends({
259
+ ref: inputRef
260
+ }, inputProps));
261
+ };
262
+ var createBoxElement = function createBoxElement() {
263
+ var iconProps = mergeProps({
264
+ className: cx('icon')
265
+ }, ptm('icon'));
266
+ var boxProps = mergeProps({
267
+ className: cx('box', {
268
+ checked: checked
269
+ }),
270
+ 'data-p-highlight': checked,
271
+ 'data-p-disabled': props.disabled
272
+ }, ptm('box'));
273
+ var icon = checked ? props.icon || /*#__PURE__*/React__namespace.createElement(check.CheckIcon, iconProps) : null;
274
+ var checkboxIcon = utils.IconUtils.getJSXIcon(icon, _objectSpread({}, iconProps), {
275
+ props: props,
276
+ checked: checked
277
+ });
278
+ return /*#__PURE__*/React__namespace.createElement("div", boxProps, checkboxIcon);
279
+ };
361
280
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", _extends({
362
281
  ref: elementRef
363
- }, rootProps), /*#__PURE__*/React__namespace.createElement("div", hiddenInputWrapperProps, /*#__PURE__*/React__namespace.createElement("input", _extends({
364
- ref: inputRef
365
- }, hiddenInputProps))), /*#__PURE__*/React__namespace.createElement("div", inputProps, checkboxIcon)), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
282
+ }, rootProps), createInputElement(), createBoxElement()), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({
366
283
  target: elementRef,
367
284
  content: props.tooltip,
368
285
  pt: ptm('tooltip')