primereact 8.7.3 → 9.0.0-beta.1

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 (450) hide show
  1. package/accordion/accordion.d.ts +168 -25
  2. package/api/api.cjs.js +1 -1
  3. package/api/api.cjs.min.js +1 -1
  4. package/api/api.d.ts +11 -3
  5. package/api/api.esm.js +1 -1
  6. package/api/api.esm.min.js +1 -1
  7. package/api/api.js +1 -1
  8. package/api/api.min.js +1 -1
  9. package/autocomplete/autocomplete.cjs.js +18 -3
  10. package/autocomplete/autocomplete.cjs.min.js +1 -1
  11. package/autocomplete/autocomplete.d.ts +385 -80
  12. package/autocomplete/autocomplete.esm.js +18 -3
  13. package/autocomplete/autocomplete.esm.min.js +1 -1
  14. package/autocomplete/autocomplete.js +18 -3
  15. package/autocomplete/autocomplete.min.js +1 -1
  16. package/avatar/avatar.d.ts +77 -15
  17. package/avatargroup/avatargroup.d.ts +33 -1
  18. package/badge/badge.d.ts +48 -8
  19. package/blockui/blockui.d.ts +71 -10
  20. package/breadcrumb/breadcrumb.d.ts +41 -3
  21. package/button/button.d.ts +67 -15
  22. package/calendar/calendar.cjs.js +18 -5
  23. package/calendar/calendar.cjs.min.js +1 -1
  24. package/calendar/calendar.d.ts +585 -112
  25. package/calendar/calendar.esm.js +18 -5
  26. package/calendar/calendar.esm.min.js +1 -1
  27. package/calendar/calendar.js +18 -5
  28. package/calendar/calendar.min.js +1 -1
  29. package/captcha/captcha.cjs.js +7 -6
  30. package/captcha/captcha.cjs.min.js +1 -1
  31. package/captcha/captcha.d.ts +77 -7
  32. package/captcha/captcha.esm.js +7 -6
  33. package/captcha/captcha.esm.min.js +1 -1
  34. package/captcha/captcha.js +7 -6
  35. package/captcha/captcha.min.js +1 -1
  36. package/card/card.d.ts +45 -7
  37. package/carousel/carousel.d.ts +138 -22
  38. package/cascadeselect/cascadeselect.cjs.js +7 -1
  39. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  40. package/cascadeselect/cascadeselect.d.ts +177 -29
  41. package/cascadeselect/cascadeselect.esm.js +7 -1
  42. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  43. package/cascadeselect/cascadeselect.js +7 -1
  44. package/cascadeselect/cascadeselect.min.js +1 -1
  45. package/chart/chart.d.ts +88 -10
  46. package/checkbox/checkbox.cjs.js +5 -1
  47. package/checkbox/checkbox.cjs.min.js +1 -1
  48. package/checkbox/checkbox.d.ts +137 -33
  49. package/checkbox/checkbox.esm.js +6 -2
  50. package/checkbox/checkbox.esm.min.js +1 -1
  51. package/checkbox/checkbox.js +5 -1
  52. package/checkbox/checkbox.min.js +1 -1
  53. package/chip/chip.d.ts +75 -7
  54. package/chips/chips.cjs.js +11 -8
  55. package/chips/chips.cjs.min.js +1 -1
  56. package/chips/chips.d.ts +188 -36
  57. package/chips/chips.esm.js +11 -8
  58. package/chips/chips.esm.min.js +1 -1
  59. package/chips/chips.js +11 -8
  60. package/chips/chips.min.js +1 -1
  61. package/colorpicker/colorpicker.cjs.js +6 -1
  62. package/colorpicker/colorpicker.cjs.min.js +1 -1
  63. package/colorpicker/colorpicker.d.ts +148 -31
  64. package/colorpicker/colorpicker.esm.js +6 -1
  65. package/colorpicker/colorpicker.esm.min.js +1 -1
  66. package/colorpicker/colorpicker.js +6 -1
  67. package/colorpicker/colorpicker.min.js +1 -1
  68. package/column/column.d.ts +736 -134
  69. package/columngroup/columngroup.d.ts +30 -1
  70. package/confirmdialog/confirmdialog.d.ts +142 -18
  71. package/confirmpopup/confirmpopup.cjs.js +5 -2
  72. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  73. package/confirmpopup/confirmpopup.d.ts +165 -22
  74. package/confirmpopup/confirmpopup.esm.js +5 -2
  75. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  76. package/confirmpopup/confirmpopup.js +5 -2
  77. package/confirmpopup/confirmpopup.min.js +1 -1
  78. package/contextmenu/contextmenu.cjs.js +4 -1
  79. package/contextmenu/contextmenu.cjs.min.js +1 -1
  80. package/contextmenu/contextmenu.d.ts +79 -11
  81. package/contextmenu/contextmenu.esm.js +4 -1
  82. package/contextmenu/contextmenu.esm.min.js +1 -1
  83. package/contextmenu/contextmenu.js +4 -1
  84. package/contextmenu/contextmenu.min.js +1 -1
  85. package/core/core.js +85 -78
  86. package/core/core.min.js +7 -7
  87. package/csstransition/csstransition.d.ts +31 -1
  88. package/datascroller/datascroller.d.ts +102 -16
  89. package/datatable/datatable.cjs.js +27 -15
  90. package/datatable/datatable.cjs.min.js +1 -1
  91. package/datatable/datatable.d.ts +1257 -229
  92. package/datatable/datatable.esm.js +27 -15
  93. package/datatable/datatable.esm.min.js +1 -1
  94. package/datatable/datatable.js +27 -15
  95. package/datatable/datatable.min.js +1 -1
  96. package/dataview/dataview.d.ts +222 -43
  97. package/deferredcontent/deferredcontent.d.ts +37 -1
  98. package/dialog/dialog.cjs.js +13 -19
  99. package/dialog/dialog.cjs.min.js +1 -1
  100. package/dialog/dialog.d.ts +282 -51
  101. package/dialog/dialog.esm.js +14 -20
  102. package/dialog/dialog.esm.min.js +1 -1
  103. package/dialog/dialog.js +13 -19
  104. package/dialog/dialog.min.css +1 -1
  105. package/dialog/dialog.min.js +1 -1
  106. package/divider/divider.d.ts +47 -10
  107. package/dock/dock.d.ts +68 -12
  108. package/dropdown/dropdown.cjs.js +27 -11
  109. package/dropdown/dropdown.cjs.min.js +1 -1
  110. package/dropdown/dropdown.d.ts +337 -83
  111. package/dropdown/dropdown.esm.js +28 -12
  112. package/dropdown/dropdown.esm.min.js +1 -1
  113. package/dropdown/dropdown.js +27 -11
  114. package/dropdown/dropdown.min.js +1 -1
  115. package/editor/editor.d.ts +129 -12
  116. package/fieldset/fieldset.d.ts +85 -7
  117. package/fileupload/fileupload.cjs.js +4 -0
  118. package/fileupload/fileupload.cjs.min.js +1 -1
  119. package/fileupload/fileupload.d.ts +425 -62
  120. package/fileupload/fileupload.esm.js +4 -0
  121. package/fileupload/fileupload.esm.min.js +1 -1
  122. package/fileupload/fileupload.js +4 -0
  123. package/fileupload/fileupload.min.js +1 -1
  124. package/galleria/galleria.cjs.js +3 -1
  125. package/galleria/galleria.cjs.min.js +1 -1
  126. package/galleria/galleria.d.ts +198 -30
  127. package/galleria/galleria.esm.js +3 -1
  128. package/galleria/galleria.esm.min.js +1 -1
  129. package/galleria/galleria.js +3 -1
  130. package/galleria/galleria.min.js +1 -1
  131. package/gmap/gmap.d.ts +91 -5
  132. package/hooks/hooks.cjs.js +1 -2
  133. package/hooks/hooks.cjs.min.js +1 -1
  134. package/hooks/hooks.d.ts +114 -7
  135. package/hooks/hooks.esm.js +1 -2
  136. package/hooks/hooks.esm.min.js +1 -1
  137. package/hooks/hooks.js +1 -2
  138. package/hooks/hooks.min.js +1 -1
  139. package/image/image.d.ts +91 -11
  140. package/inplace/inplace.d.ts +101 -9
  141. package/inputmask/inputmask.cjs.js +6 -5
  142. package/inputmask/inputmask.cjs.min.js +1 -1
  143. package/inputmask/inputmask.d.ts +119 -27
  144. package/inputmask/inputmask.esm.js +7 -6
  145. package/inputmask/inputmask.esm.min.js +1 -1
  146. package/inputmask/inputmask.js +6 -5
  147. package/inputmask/inputmask.min.js +1 -1
  148. package/inputnumber/inputnumber.cjs.js +11 -33
  149. package/inputnumber/inputnumber.cjs.min.js +1 -1
  150. package/inputnumber/inputnumber.d.ts +265 -57
  151. package/inputnumber/inputnumber.esm.js +12 -34
  152. package/inputnumber/inputnumber.esm.min.js +1 -1
  153. package/inputnumber/inputnumber.js +11 -33
  154. package/inputnumber/inputnumber.min.js +1 -1
  155. package/inputswitch/inputswitch.cjs.js +4 -1
  156. package/inputswitch/inputswitch.cjs.min.js +1 -1
  157. package/inputswitch/inputswitch.d.ts +118 -27
  158. package/inputswitch/inputswitch.esm.js +5 -2
  159. package/inputswitch/inputswitch.esm.min.js +1 -1
  160. package/inputswitch/inputswitch.js +4 -1
  161. package/inputswitch/inputswitch.min.js +1 -1
  162. package/inputtext/inputtext.d.ts +57 -6
  163. package/inputtextarea/inputtextarea.d.ts +52 -6
  164. package/keyfilter/keyfilteroptions.d.ts +15 -0
  165. package/knob/knob.d.ts +127 -20
  166. package/listbox/listbox.cjs.js +3 -0
  167. package/listbox/listbox.cjs.min.js +1 -1
  168. package/listbox/listbox.d.ts +270 -48
  169. package/listbox/listbox.esm.js +3 -0
  170. package/listbox/listbox.esm.min.js +1 -1
  171. package/listbox/listbox.js +3 -0
  172. package/listbox/listbox.min.js +1 -1
  173. package/megamenu/megamenu.d.ts +50 -11
  174. package/mention/mention.cjs.js +3 -0
  175. package/mention/mention.cjs.min.js +1 -1
  176. package/mention/mention.d.ts +186 -32
  177. package/mention/mention.esm.js +3 -0
  178. package/mention/mention.esm.min.js +1 -1
  179. package/mention/mention.js +3 -0
  180. package/mention/mention.min.js +1 -1
  181. package/menu/menu.cjs.js +3 -1
  182. package/menu/menu.cjs.min.js +1 -1
  183. package/menu/menu.d.ts +89 -12
  184. package/menu/menu.esm.js +3 -1
  185. package/menu/menu.esm.min.js +1 -1
  186. package/menu/menu.js +3 -1
  187. package/menu/menu.min.js +1 -1
  188. package/menubar/menubar.d.ts +53 -8
  189. package/menuitem/menuitem.d.ts +114 -19
  190. package/message/message.d.ts +50 -11
  191. package/messages/messages.d.ts +91 -11
  192. package/multiselect/multiselect.cjs.js +11 -2
  193. package/multiselect/multiselect.cjs.min.js +1 -1
  194. package/multiselect/multiselect.d.ts +429 -82
  195. package/multiselect/multiselect.esm.js +12 -3
  196. package/multiselect/multiselect.esm.min.js +1 -1
  197. package/multiselect/multiselect.js +11 -2
  198. package/multiselect/multiselect.min.js +1 -1
  199. package/multistatecheckbox/multistatecheckbox.cjs.js +3 -0
  200. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  201. package/multistatecheckbox/multistatecheckbox.d.ts +157 -22
  202. package/multistatecheckbox/multistatecheckbox.esm.js +4 -1
  203. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  204. package/multistatecheckbox/multistatecheckbox.js +3 -0
  205. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  206. package/orderlist/orderlist.d.ts +113 -16
  207. package/organizationchart/organizationchart.d.ts +107 -16
  208. package/overlaypanel/overlaypanel.cjs.js +4 -1
  209. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  210. package/overlaypanel/overlaypanel.d.ts +89 -15
  211. package/overlaypanel/overlaypanel.esm.js +4 -1
  212. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  213. package/overlaypanel/overlaypanel.js +4 -1
  214. package/overlaypanel/overlaypanel.min.js +1 -1
  215. package/overlayservice/overlayservice.d.ts +52 -7
  216. package/package.json +2 -2
  217. package/paginator/paginator.d.ts +409 -44
  218. package/panel/panel.d.ts +142 -16
  219. package/panelmenu/panelmenu.d.ts +46 -4
  220. package/password/password.cjs.js +7 -1
  221. package/password/password.cjs.min.js +1 -1
  222. package/password/password.d.ts +176 -36
  223. package/password/password.esm.js +7 -1
  224. package/password/password.esm.min.js +1 -1
  225. package/password/password.js +7 -1
  226. package/password/password.min.css +1 -1
  227. package/password/password.min.js +1 -1
  228. package/picklist/picklist.d.ts +272 -46
  229. package/primereact.all.cjs.js +305 -158
  230. package/primereact.all.cjs.min.js +1 -1
  231. package/primereact.all.esm.js +305 -158
  232. package/primereact.all.esm.min.js +1 -1
  233. package/primereact.all.js +305 -158
  234. package/primereact.all.min.js +1 -1
  235. package/progressbar/progressbar.d.ts +60 -11
  236. package/progressspinner/progressspinner.d.ts +47 -4
  237. package/radiobutton/radiobutton.cjs.js +5 -1
  238. package/radiobutton/radiobutton.cjs.min.js +1 -1
  239. package/radiobutton/radiobutton.d.ts +99 -29
  240. package/radiobutton/radiobutton.esm.js +5 -1
  241. package/radiobutton/radiobutton.esm.min.js +1 -1
  242. package/radiobutton/radiobutton.js +5 -1
  243. package/radiobutton/radiobutton.min.js +1 -1
  244. package/rating/rating.d.ts +101 -24
  245. package/resources/primereact.css +74 -63
  246. package/resources/primereact.min.css +1 -1
  247. package/resources/themes/arya-blue/theme.css +5 -9
  248. package/resources/themes/arya-green/theme.css +4 -10
  249. package/resources/themes/arya-orange/theme.css +4 -9
  250. package/resources/themes/arya-purple/theme.css +4 -9
  251. package/resources/themes/bootstrap4-dark-blue/theme.css +4 -9
  252. package/resources/themes/bootstrap4-dark-purple/theme.css +4 -9
  253. package/resources/themes/bootstrap4-light-blue/theme.css +4 -9
  254. package/resources/themes/bootstrap4-light-purple/theme.css +4 -10
  255. package/resources/themes/fluent-light/theme.css +4 -10
  256. package/resources/themes/lara-dark-blue/theme.css +4 -9
  257. package/resources/themes/lara-dark-indigo/theme.css +4 -10
  258. package/resources/themes/lara-dark-purple/theme.css +4 -9
  259. package/resources/themes/lara-dark-teal/theme.css +4 -10
  260. package/resources/themes/lara-light-blue/theme.css +4 -9
  261. package/resources/themes/lara-light-indigo/theme.css +4 -9
  262. package/resources/themes/lara-light-purple/theme.css +4 -9
  263. package/resources/themes/lara-light-teal/theme.css +4 -9
  264. package/resources/themes/luna-amber/theme.css +5 -9
  265. package/resources/themes/luna-blue/theme.css +4 -9
  266. package/resources/themes/luna-green/theme.css +5 -9
  267. package/resources/themes/luna-pink/theme.css +4 -9
  268. package/resources/themes/md-dark-deeppurple/theme.css +4 -9
  269. package/resources/themes/md-dark-indigo/theme.css +5 -9
  270. package/resources/themes/md-light-deeppurple/theme.css +5 -9
  271. package/resources/themes/md-light-indigo/theme.css +5 -9
  272. package/resources/themes/mdc-dark-deeppurple/theme.css +5 -9
  273. package/resources/themes/mdc-dark-indigo/theme.css +4 -9
  274. package/resources/themes/mdc-light-deeppurple/theme.css +5 -9
  275. package/resources/themes/mdc-light-indigo/theme.css +4 -9
  276. package/resources/themes/mira/fonts/Inter-Bold.woff +0 -0
  277. package/resources/themes/mira/fonts/Inter-Bold.woff2 +0 -0
  278. package/resources/themes/mira/fonts/Inter-Medium.woff +0 -0
  279. package/resources/themes/mira/fonts/Inter-Medium.woff2 +0 -0
  280. package/resources/themes/mira/fonts/Inter-Regular.woff +0 -0
  281. package/resources/themes/mira/fonts/Inter-Regular.woff2 +0 -0
  282. package/resources/themes/mira/fonts/Inter-SemiBold.woff +0 -0
  283. package/resources/themes/mira/fonts/Inter-SemiBold.woff2 +0 -0
  284. package/resources/themes/mira/theme.css +6237 -0
  285. package/resources/themes/nano/theme.css +6009 -0
  286. package/resources/themes/nova/theme.css +4 -9
  287. package/resources/themes/nova-accent/theme.css +5 -9
  288. package/resources/themes/nova-alt/theme.css +4 -9
  289. package/resources/themes/rhea/theme.css +5 -9
  290. package/resources/themes/saga-blue/theme.css +4 -9
  291. package/resources/themes/saga-green/theme.css +5 -9
  292. package/resources/themes/saga-orange/theme.css +5 -9
  293. package/resources/themes/saga-purple/theme.css +5 -9
  294. package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
  295. package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
  296. package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
  297. package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
  298. package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
  299. package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
  300. package/resources/themes/soho-dark/theme.css +6002 -0
  301. package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
  302. package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
  303. package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
  304. package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
  305. package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
  306. package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
  307. package/resources/themes/soho-light/theme.css +6056 -0
  308. package/resources/themes/vela-blue/theme.css +4 -9
  309. package/resources/themes/vela-green/theme.css +4 -9
  310. package/resources/themes/vela-orange/theme.css +4 -9
  311. package/resources/themes/vela-purple/theme.css +5 -9
  312. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
  313. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
  314. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
  315. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
  316. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
  317. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
  318. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
  319. package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
  320. package/resources/themes/viva-dark/theme.css +6164 -0
  321. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
  322. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
  323. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
  324. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
  325. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
  326. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
  327. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
  328. package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
  329. package/resources/themes/viva-light/theme.css +6164 -0
  330. package/ripple/ripple.d.ts +29 -1
  331. package/row/row.d.ts +37 -3
  332. package/scrollpanel/scrollpanel.d.ts +45 -1
  333. package/scrolltop/scrolltop.d.ts +70 -10
  334. package/selectbutton/selectbutton.cjs.js +3 -0
  335. package/selectbutton/selectbutton.cjs.min.js +1 -1
  336. package/selectbutton/selectbutton.d.ts +111 -32
  337. package/selectbutton/selectbutton.esm.js +4 -1
  338. package/selectbutton/selectbutton.esm.min.js +1 -1
  339. package/selectbutton/selectbutton.js +3 -0
  340. package/selectbutton/selectbutton.min.js +1 -1
  341. package/selectitem/selectitem.d.ts +34 -0
  342. package/sidebar/sidebar.cjs.js +13 -1
  343. package/sidebar/sidebar.cjs.min.js +1 -1
  344. package/sidebar/sidebar.d.ts +120 -22
  345. package/sidebar/sidebar.esm.js +13 -1
  346. package/sidebar/sidebar.esm.min.js +1 -1
  347. package/sidebar/sidebar.js +13 -1
  348. package/sidebar/sidebar.min.js +1 -1
  349. package/skeleton/skeleton.d.ts +61 -11
  350. package/slidemenu/slidemenu.d.ts +132 -18
  351. package/slider/slider.d.ts +101 -18
  352. package/speeddial/speeddial.d.ts +149 -20
  353. package/splitbutton/splitbutton.cjs.js +3 -2
  354. package/splitbutton/splitbutton.cjs.min.js +1 -1
  355. package/splitbutton/splitbutton.d.ts +131 -23
  356. package/splitbutton/splitbutton.esm.js +3 -2
  357. package/splitbutton/splitbutton.esm.min.js +1 -1
  358. package/splitbutton/splitbutton.js +3 -2
  359. package/splitbutton/splitbutton.min.js +1 -1
  360. package/splitter/splitter.d.ts +98 -12
  361. package/steps/steps.d.ts +67 -6
  362. package/styleclass/styleclass.d.ts +77 -12
  363. package/tabmenu/tabmenu.d.ts +62 -5
  364. package/tabview/tabview.cjs.js +1 -1
  365. package/tabview/tabview.cjs.min.js +1 -1
  366. package/tabview/tabview.d.ts +213 -27
  367. package/tabview/tabview.esm.js +1 -1
  368. package/tabview/tabview.esm.min.js +1 -1
  369. package/tabview/tabview.js +1 -1
  370. package/tabview/tabview.min.js +1 -1
  371. package/tag/tag.d.ts +50 -6
  372. package/terminal/terminal.cjs.js +3 -0
  373. package/terminal/terminal.cjs.min.js +1 -1
  374. package/terminal/terminal.d.ts +45 -3
  375. package/terminal/terminal.esm.js +4 -1
  376. package/terminal/terminal.esm.min.js +1 -1
  377. package/terminal/terminal.js +3 -0
  378. package/terminal/terminal.min.js +1 -1
  379. package/terminalservice/terminalservice.d.ts +42 -4
  380. package/tieredmenu/tieredmenu.cjs.js +3 -1
  381. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  382. package/tieredmenu/tieredmenu.d.ts +77 -12
  383. package/tieredmenu/tieredmenu.esm.js +3 -1
  384. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  385. package/tieredmenu/tieredmenu.js +3 -1
  386. package/tieredmenu/tieredmenu.min.js +1 -1
  387. package/timeline/timeline.cjs.js +6 -10
  388. package/timeline/timeline.cjs.min.js +1 -1
  389. package/timeline/timeline.d.ts +62 -13
  390. package/timeline/timeline.esm.js +6 -10
  391. package/timeline/timeline.esm.min.js +1 -1
  392. package/timeline/timeline.js +6 -10
  393. package/timeline/timeline.min.js +1 -1
  394. package/toast/toast.cjs.js +4 -1
  395. package/toast/toast.cjs.min.js +1 -1
  396. package/toast/toast.d.ts +134 -27
  397. package/toast/toast.esm.js +4 -1
  398. package/toast/toast.esm.min.js +1 -1
  399. package/toast/toast.js +4 -1
  400. package/toast/toast.min.js +1 -1
  401. package/togglebutton/togglebutton.cjs.js +4 -1
  402. package/togglebutton/togglebutton.cjs.min.js +1 -1
  403. package/togglebutton/togglebutton.d.ts +122 -15
  404. package/togglebutton/togglebutton.esm.js +5 -2
  405. package/togglebutton/togglebutton.esm.min.js +1 -1
  406. package/togglebutton/togglebutton.js +4 -1
  407. package/togglebutton/togglebutton.min.js +1 -1
  408. package/toolbar/toolbar.cjs.js +13 -7
  409. package/toolbar/toolbar.cjs.min.js +1 -1
  410. package/toolbar/toolbar.d.ts +55 -5
  411. package/toolbar/toolbar.esm.js +13 -7
  412. package/toolbar/toolbar.esm.min.js +1 -1
  413. package/toolbar/toolbar.js +13 -7
  414. package/toolbar/toolbar.min.css +1 -1
  415. package/toolbar/toolbar.min.js +1 -1
  416. package/tooltip/tooltip.d.ts +73 -9
  417. package/tooltip/tooltipoptions.d.ts +350 -31
  418. package/tree/tree.d.ts +435 -71
  419. package/treenode/treenode.d.ts +62 -13
  420. package/treeselect/treeselect.cjs.js +7 -1
  421. package/treeselect/treeselect.cjs.min.js +1 -1
  422. package/treeselect/treeselect.d.ts +326 -77
  423. package/treeselect/treeselect.esm.js +8 -2
  424. package/treeselect/treeselect.esm.min.js +1 -1
  425. package/treeselect/treeselect.js +7 -1
  426. package/treeselect/treeselect.min.js +1 -1
  427. package/treetable/treetable.cjs.js +3 -1
  428. package/treetable/treetable.cjs.min.js +1 -1
  429. package/treetable/treetable.d.ts +501 -112
  430. package/treetable/treetable.esm.js +3 -1
  431. package/treetable/treetable.esm.min.js +1 -1
  432. package/treetable/treetable.js +3 -1
  433. package/treetable/treetable.min.js +1 -1
  434. package/tristatecheckbox/tristatecheckbox.cjs.js +3 -0
  435. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  436. package/tristatecheckbox/tristatecheckbox.d.ts +72 -20
  437. package/tristatecheckbox/tristatecheckbox.esm.js +4 -1
  438. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  439. package/tristatecheckbox/tristatecheckbox.js +3 -0
  440. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  441. package/ts-helpers.d.ts +24 -0
  442. package/utils/utils.cjs.js +27 -11
  443. package/utils/utils.cjs.min.js +1 -1
  444. package/utils/utils.d.ts +8 -1
  445. package/utils/utils.esm.js +27 -11
  446. package/utils/utils.esm.min.js +1 -1
  447. package/utils/utils.js +27 -11
  448. package/utils/utils.min.js +1 -1
  449. package/virtualscroller/virtualscroller.d.ts +351 -59
  450. package/web-types.json +22 -4
package/chart/chart.d.ts CHANGED
@@ -1,23 +1,101 @@
1
+ /**
2
+ *
3
+ * Chart components are based on Chart.js, an open source HTML5 based charting library.
4
+ *
5
+ * [Live Demo](https://www.primefaces.org/primereact/chart)
6
+ *
7
+ * @module chart
8
+ *
9
+ */
1
10
  import * as React from 'react';
2
11
 
12
+ /**
13
+ * Defines valid properties in Chart component.
14
+ * @group Properties
15
+ */
3
16
  export interface ChartProps {
4
- id?: string;
5
- type?: string;
6
- data?: object;
7
- options?: object;
8
- plugins?: any[];
9
- width?: string;
10
- height?: string;
11
- style?: React.CSSProperties;
12
- className?: string;
13
- children?: React.ReactNode;
17
+ /**
18
+ * Unique identifier of the element.
19
+ */
20
+ id?: string | undefined;
21
+ /**
22
+ * Type of the chart.
23
+ */
24
+ type?: string | undefined;
25
+ /**
26
+ * Data to display.
27
+ */
28
+ data?: object | undefined;
29
+ /**
30
+ * Options to customize the chart.
31
+ */
32
+ options?: object | undefined;
33
+ /**
34
+ * Used to custom plugins of the chart.
35
+ */
36
+ plugins?: any[] | undefined;
37
+ /**
38
+ * Width of the chart in non-responsive mode.
39
+ */
40
+ width?: string | undefined;
41
+ /**
42
+ * Height of the chart in non-responsive mode.
43
+ */
44
+ height?: string | undefined;
45
+ /**
46
+ * Inline style of the element.
47
+ */
48
+ style?: React.CSSProperties | undefined;
49
+ /**
50
+ * Style class of the element.
51
+ */
52
+ className?: string | undefined;
53
+ /**
54
+ * Used to get the child elements of the component.
55
+ * @readonly
56
+ */
57
+ children?: React.ReactNode | undefined;
14
58
  }
15
59
 
60
+ /**
61
+ * **PrimeReact - Chart**
62
+ *
63
+ * _Chart components are based on Chart.js, an open source HTML5 based charting library._
64
+ *
65
+ * [Live Demo](https://www.primefaces.org/primereact/chart/)
66
+ * --- ---
67
+ * ![PrimeReact](https://www.primefaces.org/primereact/images/logo-100.png)
68
+ *
69
+ * @group Component
70
+ */
16
71
  export declare class Chart extends React.Component<ChartProps, any> {
72
+ /**
73
+ * Used to get canvas element.
74
+ * @return {HTMLCanvasElement} Canvas element
75
+ */
17
76
  public getCanvas(): HTMLCanvasElement;
77
+ /**
78
+ * Used to get chart instance.
79
+ * @return {*} Chart instance
80
+ */
18
81
  public getChart(): any;
82
+ /**
83
+ * Used to get base64 image.
84
+ * @return {*} base64 image
85
+ */
19
86
  public getBase64Image(): any;
87
+ /**
88
+ * Used to generate legend.
89
+ * @return {string} Generated legend
90
+ */
20
91
  public generateLegend(): string;
92
+ /**
93
+ * Redraws the graph.
94
+ */
21
95
  public refresh(): void;
96
+ /**
97
+ * Used to get container element.
98
+ * @return {HTMLDivElement} Container element
99
+ */
22
100
  public getElement(): HTMLDivElement;
23
101
  }
@@ -142,7 +142,8 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
142
142
  setFocusedState(false);
143
143
  };
144
144
  var onKeyDown = function onKeyDown(event) {
145
- if (event.code === 'Space') {
145
+ if (event.code === 'Space' || event.key === ' ') {
146
+ // event.key is for Android support
146
147
  onClick(event);
147
148
  }
148
149
  };
@@ -152,6 +153,9 @@ var Checkbox = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
152
153
  React__namespace.useImperativeHandle(ref, function () {
153
154
  return {
154
155
  props: props,
156
+ focus: function focus() {
157
+ return utils.DomHandler.focus(inputRef.current);
158
+ },
155
159
  getElement: function getElement() {
156
160
  return elementRef.current;
157
161
  },
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),n=require("primereact/tooltip"),r=require("primereact/utils");function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=o(e);function a(){return a=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},a.apply(this,arguments)}function c(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,a,c=[],u=!0,i=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=l.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(i)throw o}}return c}}function i(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 s(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function f(){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 d=l.memo(l.forwardRef((function(e,o){var i,p,b=l.useState(!1),m=(p=2,c(i=b)||u(i,p)||s(i,p)||f()),h=m[0],y=m[1],v=l.useRef(null),g=l.useRef(e.inputRef),O=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=k(),o=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||o&&t.target.checked!==n){var l=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:l,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:l}})}r.DomHandler.focus(g.current),t.preventDefault()}},k=function(){return e.checked===e.trueValue};l.useImperativeHandle(o,(function(){return{props:e,getElement:function(){return v.current},getInput:function(){return g.current}}})),l.useEffect((function(){r.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),t.useUpdateEffect((function(){g.current.checked=k()}),[e.checked,e.trueValue]);var x=k(),j=r.ObjectUtils.isNotEmpty(e.tooltip),E=r.ObjectUtils.findDiffKeys(e,d.defaultProps),I=r.ObjectUtils.reduceKeys(E,r.DomHandler.ARIA_PROPS),C=r.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),w=r.classNames("p-checkbox-box",{"p-highlight":x,"p-disabled":e.disabled,"p-focus":h}),D=r.IconUtils.getJSXIcon(x?e.icon:"",{className:"p-checkbox-icon p-c"},{props:e,checked:x});return l.createElement(l.Fragment,null,l.createElement("div",a({ref:v,id:e.id,className:C,style:e.style},E,{onClick:O,onContextMenu:e.onContextMenu,onMouseDown:e.onMouseDown}),l.createElement("div",{className:"p-hidden-accessible"},l.createElement("input",a({ref:g,type:"checkbox",id:e.inputId,name:e.name,tabIndex:e.tabIndex,defaultChecked:x,onFocus:function(){y(!0)},onBlur:function(){y(!1)},onKeyDown:function(e){"Space"===e.code&&O(e)},disabled:e.disabled,readOnly:e.readOnly,required:e.required},I))),l.createElement("div",{className:w},D)),j&&l.createElement(n.Tooltip,a({target:v,content:e.tooltip},e.tooltipOptions)))})));d.displayName="Checkbox",d.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null},exports.Checkbox=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/hooks"),n=require("primereact/tooltip"),r=require("primereact/utils");function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=o(e);function l(){return l=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},l.apply(this,arguments)}function a(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c,l,a=[],u=!0,i=!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){i=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(i)throw o}}return a}}function i(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 s(e,t){if(e){if("string"==typeof e)return i(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)?i(e,t):void 0}}function f(){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 d=c.memo(c.forwardRef((function(e,o){var i,p,b=c.useState(!1),m=(p=2,a(i=b)||u(i,p)||s(i,p)||f()),h=m[0],y=m[1],v=c.useRef(null),g=c.useRef(e.inputRef),k=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=O(),o=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||o&&t.target.checked!==n){var c=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:c,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:c}})}r.DomHandler.focus(g.current),t.preventDefault()}},O=function(){return e.checked===e.trueValue};c.useImperativeHandle(o,(function(){return{props:e,focus:function(){return r.DomHandler.focus(g.current)},getElement:function(){return v.current},getInput:function(){return g.current}}})),c.useEffect((function(){r.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),t.useUpdateEffect((function(){g.current.checked=O()}),[e.checked,e.trueValue]);var x=O(),j=r.ObjectUtils.isNotEmpty(e.tooltip),E=r.ObjectUtils.findDiffKeys(e,d.defaultProps),I=r.ObjectUtils.reduceKeys(E,r.DomHandler.ARIA_PROPS),C=r.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),D=r.classNames("p-checkbox-box",{"p-highlight":x,"p-disabled":e.disabled,"p-focus":h}),w=r.IconUtils.getJSXIcon(x?e.icon:"",{className:"p-checkbox-icon p-c"},{props:e,checked:x});return c.createElement(c.Fragment,null,c.createElement("div",l({ref:v,id:e.id,className:C,style:e.style},E,{onClick:k,onContextMenu:e.onContextMenu,onMouseDown:e.onMouseDown}),c.createElement("div",{className:"p-hidden-accessible"},c.createElement("input",l({ref:g,type:"checkbox",id:e.inputId,name:e.name,tabIndex:e.tabIndex,defaultChecked:x,onFocus:function(){y(!0)},onBlur:function(){y(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||k(e)},disabled:e.disabled,readOnly:e.readOnly,required:e.required},I))),c.createElement("div",{className:D},w)),j&&c.createElement(n.Tooltip,l({target:v,content:e.tooltip},e.tooltipOptions)))})));d.displayName="Checkbox",d.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null},exports.Checkbox=d;
@@ -1,49 +1,153 @@
1
+ /**
2
+ *
3
+ * Checkbox is an extension to standard checkbox element with skinning capabilities.
4
+ *
5
+ * [Live Demo](https://www.primefaces.org/primereact/checkbox/)
6
+ *
7
+ * @module checkbox
8
+ *
9
+ */
1
10
  import * as React from 'react';
2
- import TooltipOptions from '../tooltip/tooltipoptions';
11
+ import { TooltipOptions } from '../tooltip/tooltipoptions';
12
+ import { FormEvent } from '../ts-helpers';
3
13
  import { IconType } from '../utils';
4
14
 
5
- interface CheckboxChangeTargetOptions {
6
- type: string;
7
- name: string;
8
- id: string;
9
- value: any;
10
- checked: boolean;
11
- }
12
-
13
- interface CheckboxChangeParams {
14
- originalEvent: React.SyntheticEvent;
15
- value: any;
16
- checked: boolean;
17
- stopPropagation(): void;
18
- preventDefault(): void;
19
- target: CheckboxChangeTargetOptions;
20
- }
15
+ /**
16
+ * Custom change event.
17
+ * @see {@link CheckboxProps.onChange}
18
+ * @extends {FormEvent}
19
+ * @event
20
+ */
21
+ interface CheckboxChangeEvent extends FormEvent {}
21
22
 
23
+ /**
24
+ * Defines valid properties in Checkbox component. In addition to these, all properties of HTMLDivElement can be used in this component.
25
+ * @group Properties
26
+ */
22
27
  export interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange' | 'ref'> {
23
- id?: string;
24
- inputRef?: React.Ref<HTMLInputElement>;
25
- inputId?: string;
28
+ /**
29
+ * Unique identifier of the element.
30
+ */
31
+ id?: string | undefined;
32
+ /**
33
+ * Reference of the input element.
34
+ */
35
+ inputRef?: React.Ref<HTMLInputElement> | undefined;
36
+ /**
37
+ * Identifier of the input element.
38
+ */
39
+ inputId?: string | undefined;
40
+ /**
41
+ * Value of the component.
42
+ */
26
43
  value?: any;
27
- name?: string;
28
- checked?: any;
44
+ /**
45
+ * Name of the checkbox element .
46
+ */
47
+ name?: string | undefined;
48
+ /**
49
+ * Specifies whether a checkbox should be checked or not.
50
+ * @defaultValue false
51
+ */
52
+ checked?: boolean | undefined;
53
+ /**
54
+ * Value in checked state.
55
+ * @defaultValue true
56
+ */
29
57
  trueValue?: any;
58
+ /**
59
+ * Value in unchecked state.
60
+ * @defaultValue false
61
+ */
30
62
  falseValue?: any;
31
- style?: React.CSSProperties;
32
- className?: string;
33
- disabled?: boolean;
34
- required?: boolean;
35
- readOnly?: boolean;
36
- tabIndex?: number;
37
- icon?: IconType<CheckboxProps>;
38
- tooltip?: string;
39
- tooltipOptions?: TooltipOptions;
40
- onChange?(e: CheckboxChangeParams): void;
63
+ /**
64
+ * Inline style of the element.
65
+ */
66
+ style?: React.CSSProperties | undefined;
67
+ /**
68
+ * Style class of the element.
69
+ */
70
+ className?: string | undefined;
71
+ /**
72
+ * When present, it specifies that the element value cannot be altered.
73
+ * @defaultValue false
74
+ */
75
+ disabled?: boolean | undefined;
76
+ /**
77
+ * When present, it specifies that an input field must be filled out before submitting the form.
78
+ * @defaultValue false
79
+ */
80
+ required?: boolean | undefined;
81
+ /**
82
+ * When present, it specifies that the value cannot be changed.
83
+ * @defaultValue false
84
+ */
85
+ readOnly?: boolean | undefined;
86
+ /**
87
+ * Index of the element in tabbing order.
88
+ * @defaultValue false
89
+ */
90
+ tabIndex?: number | undefined;
91
+ /**
92
+ * Icon class of the checkbox icon.
93
+ * @defaultValue pi pi-check
94
+ */
95
+ icon?: IconType<CheckboxProps> | undefined;
96
+ /**
97
+ * Content of the tooltip.
98
+ */
99
+ tooltip?: string | undefined;
100
+ /**
101
+ * Configuration of the tooltip, refer to the tooltip documentation for more information.
102
+ * @type {TooltipOptions}
103
+ */
104
+ tooltipOptions?: TooltipOptions | undefined;
105
+ /**
106
+ * Callback to invoke on value change
107
+ * @param {CheckboxChangeEvent} event - Custom change event
108
+ */
109
+ onChange?(event: CheckboxChangeEvent): void;
110
+ /**
111
+ * Callback to invoke to when a mouse button is pressed.
112
+ * @param {React.MouseEvent<HTMLElement>} event - Browser event
113
+ */
41
114
  onMouseDown?(event: React.MouseEvent<HTMLElement>): void;
115
+ /**
116
+ * Callback to invoke on right-click.
117
+ * @param {React.MouseEvent<HTMLElement>} event - Browser event
118
+ */
42
119
  onContextMenu?(event: React.MouseEvent<HTMLElement>): void;
43
- children?: React.ReactNode;
120
+ /**
121
+ * Used to get the child elements of the component.
122
+ * @readonly
123
+ */
124
+ children?: React.ReactNode | undefined;
44
125
  }
45
126
 
127
+ /**
128
+ * **PrimeReact - Checkbox**
129
+ *
130
+ * _Checkbox is an extension to standard checkbox element with skinning capabilities._
131
+ *
132
+ * [Live Demo](https://www.primefaces.org/primereact/checkbox/)
133
+ * --- ---
134
+ * ![PrimeReact](https://www.primefaces.org/primereact/images/logo-100.png)
135
+ *
136
+ * @group Component
137
+ */
46
138
  export declare class Checkbox extends React.Component<CheckboxProps, any> {
139
+ /**
140
+ * Used to focus the component.
141
+ */
142
+ public focus(): void;
143
+ /**
144
+ * Used to get container element.
145
+ * @return {HTMLDivElement} Container element
146
+ */
47
147
  public getElement(): HTMLDivElement;
148
+ /**
149
+ * Used to get input element.
150
+ * @return {HTMLInputElement} Input element
151
+ */
48
152
  public getInput(): HTMLInputElement;
49
153
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useUpdateEffect } from 'primereact/hooks';
3
3
  import { Tooltip } from 'primereact/tooltip';
4
- import { ObjectUtils, DomHandler, classNames, IconUtils } from 'primereact/utils';
4
+ import { DomHandler, ObjectUtils, classNames, IconUtils } from 'primereact/utils';
5
5
 
6
6
  function _extends() {
7
7
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -118,7 +118,8 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
118
118
  setFocusedState(false);
119
119
  };
120
120
  var onKeyDown = function onKeyDown(event) {
121
- if (event.code === 'Space') {
121
+ if (event.code === 'Space' || event.key === ' ') {
122
+ // event.key is for Android support
122
123
  onClick(event);
123
124
  }
124
125
  };
@@ -128,6 +129,9 @@ var Checkbox = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
128
129
  React.useImperativeHandle(ref, function () {
129
130
  return {
130
131
  props: props,
132
+ focus: function focus() {
133
+ return DomHandler.focus(inputRef.current);
134
+ },
131
135
  getElement: function getElement() {
132
136
  return elementRef.current;
133
137
  },
@@ -1 +1 @@
1
- import*as e from"react";import{useUpdateEffect as t}from"primereact/hooks";import{Tooltip as n}from"primereact/tooltip";import{ObjectUtils as r,DomHandler as o,classNames as a,IconUtils as l}from"primereact/utils";function c(){return c=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},c.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,l,c=[],u=!0,i=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(i)throw o}}return c}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){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 p=e.memo(e.forwardRef((function(s,m){var h,b,y=e.useState(!1),v=(b=2,u(h=y)||i(h,b)||f(h,b)||d()),g=v[0],k=v[1],x=e.useRef(null),O=e.useRef(s.inputRef),E=function(e){if(!s.disabled&&!s.readOnly&&s.onChange){var t=I(),n=e.target instanceof HTMLDivElement||e.target instanceof HTMLSpanElement;if(e.target===O.current||n&&e.target.checked!==t){var r=t?s.falseValue:s.trueValue;s.onChange({originalEvent:e,value:s.value,checked:r,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:s.name,id:s.id,value:s.value,checked:r}})}o.focus(O.current),e.preventDefault()}},I=function(){return s.checked===s.trueValue};e.useImperativeHandle(m,(function(){return{props:s,getElement:function(){return x.current},getInput:function(){return O.current}}})),e.useEffect((function(){r.combinedRefs(O,s.inputRef)}),[O,s.inputRef]),t((function(){O.current.checked=I()}),[s.checked,s.trueValue]);var C=I(),w=r.isNotEmpty(s.tooltip),R=r.findDiffKeys(s,p.defaultProps),S=r.reduceKeys(R,o.ARIA_PROPS),M=a("p-checkbox p-component",{"p-checkbox-checked":C,"p-checkbox-disabled":s.disabled,"p-checkbox-focused":g},s.className),j=a("p-checkbox-box",{"p-highlight":C,"p-disabled":s.disabled,"p-focus":g}),A=l.getJSXIcon(C?s.icon:"",{className:"p-checkbox-icon p-c"},{props:s,checked:C});return e.createElement(e.Fragment,null,e.createElement("div",c({ref:x,id:s.id,className:M,style:s.style},R,{onClick:E,onContextMenu:s.onContextMenu,onMouseDown:s.onMouseDown}),e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",c({ref:O,type:"checkbox",id:s.inputId,name:s.name,tabIndex:s.tabIndex,defaultChecked:C,onFocus:function(){k(!0)},onBlur:function(){k(!1)},onKeyDown:function(e){"Space"===e.code&&E(e)},disabled:s.disabled,readOnly:s.readOnly,required:s.required},S))),e.createElement("div",{className:j},A)),w&&e.createElement(n,c({target:x,content:s.tooltip},s.tooltipOptions)))})));p.displayName="Checkbox",p.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null};export{p as Checkbox};
1
+ import*as e from"react";import{useUpdateEffect as t}from"primereact/hooks";import{Tooltip as n}from"primereact/tooltip";import{DomHandler as r,ObjectUtils as o,classNames as a,IconUtils as l}from"primereact/utils";function c(){return c=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},c.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,l,c=[],u=!0,i=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(i)throw o}}return c}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){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 p=e.memo(e.forwardRef((function(s,m){var h,b,y=e.useState(!1),v=(b=2,u(h=y)||i(h,b)||f(h,b)||d()),g=v[0],k=v[1],x=e.useRef(null),O=e.useRef(s.inputRef),E=function(e){if(!s.disabled&&!s.readOnly&&s.onChange){var t=I(),n=e.target instanceof HTMLDivElement||e.target instanceof HTMLSpanElement;if(e.target===O.current||n&&e.target.checked!==t){var o=t?s.falseValue:s.trueValue;s.onChange({originalEvent:e,value:s.value,checked:o,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:s.name,id:s.id,value:s.value,checked:o}})}r.focus(O.current),e.preventDefault()}},I=function(){return s.checked===s.trueValue};e.useImperativeHandle(m,(function(){return{props:s,focus:function(){return r.focus(O.current)},getElement:function(){return x.current},getInput:function(){return O.current}}})),e.useEffect((function(){o.combinedRefs(O,s.inputRef)}),[O,s.inputRef]),t((function(){O.current.checked=I()}),[s.checked,s.trueValue]);var C=I(),w=o.isNotEmpty(s.tooltip),R=o.findDiffKeys(s,p.defaultProps),S=o.reduceKeys(R,r.ARIA_PROPS),M=a("p-checkbox p-component",{"p-checkbox-checked":C,"p-checkbox-disabled":s.disabled,"p-checkbox-focused":g},s.className),j=a("p-checkbox-box",{"p-highlight":C,"p-disabled":s.disabled,"p-focus":g}),A=l.getJSXIcon(C?s.icon:"",{className:"p-checkbox-icon p-c"},{props:s,checked:C});return e.createElement(e.Fragment,null,e.createElement("div",c({ref:x,id:s.id,className:M,style:s.style},R,{onClick:E,onContextMenu:s.onContextMenu,onMouseDown:s.onMouseDown}),e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",c({ref:O,type:"checkbox",id:s.inputId,name:s.name,tabIndex:s.tabIndex,defaultChecked:C,onFocus:function(){k(!0)},onBlur:function(){k(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||E(e)},disabled:s.disabled,readOnly:s.readOnly,required:s.required},S))),e.createElement("div",{className:j},A)),w&&e.createElement(n,c({target:x,content:s.tooltip},s.tooltipOptions)))})));p.displayName="Checkbox",p.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null};export{p as Checkbox};
@@ -137,7 +137,8 @@ this.primereact.checkbox = (function (exports, React, hooks, tooltip, utils) {
137
137
  setFocusedState(false);
138
138
  };
139
139
  var onKeyDown = function onKeyDown(event) {
140
- if (event.code === 'Space') {
140
+ if (event.code === 'Space' || event.key === ' ') {
141
+ // event.key is for Android support
141
142
  onClick(event);
142
143
  }
143
144
  };
@@ -147,6 +148,9 @@ this.primereact.checkbox = (function (exports, React, hooks, tooltip, utils) {
147
148
  React__namespace.useImperativeHandle(ref, function () {
148
149
  return {
149
150
  props: props,
151
+ focus: function focus() {
152
+ return utils.DomHandler.focus(inputRef.current);
153
+ },
150
154
  getElement: function getElement() {
151
155
  return elementRef.current;
152
156
  },
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.checkbox=function(e,t,n,r,c){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=o(t);function l(){return l=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},l.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,c,o,a,l=[],u=!0,i=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){i=!0,c=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(i)throw c}}return l}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){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 p=a.memo(a.forwardRef((function(e,t){var o,s,b=a.useState(!1),m=(s=2,u(o=b)||i(o,s)||f(o,s)||d()),h=m[0],y=m[1],v=a.useRef(null),g=a.useRef(e.inputRef),k=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=O(),r=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||r&&t.target.checked!==n){var o=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:o,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:o}})}c.DomHandler.focus(g.current),t.preventDefault()}},O=function(){return e.checked===e.trueValue};a.useImperativeHandle(t,(function(){return{props:e,getElement:function(){return v.current},getInput:function(){return g.current}}})),a.useEffect((function(){c.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),n.useUpdateEffect((function(){g.current.checked=O()}),[e.checked,e.trueValue]);var x=O(),j=c.ObjectUtils.isNotEmpty(e.tooltip),E=c.ObjectUtils.findDiffKeys(e,p.defaultProps),I=c.ObjectUtils.reduceKeys(E,c.DomHandler.ARIA_PROPS),C=c.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),w=c.classNames("p-checkbox-box",{"p-highlight":x,"p-disabled":e.disabled,"p-focus":h}),D=c.IconUtils.getJSXIcon(x?e.icon:"",{className:"p-checkbox-icon p-c"},{props:e,checked:x});return a.createElement(a.Fragment,null,a.createElement("div",l({ref:v,id:e.id,className:C,style:e.style},E,{onClick:k,onContextMenu:e.onContextMenu,onMouseDown:e.onMouseDown}),a.createElement("div",{className:"p-hidden-accessible"},a.createElement("input",l({ref:g,type:"checkbox",id:e.inputId,name:e.name,tabIndex:e.tabIndex,defaultChecked:x,onFocus:function(){y(!0)},onBlur:function(){y(!1)},onKeyDown:function(e){"Space"===e.code&&k(e)},disabled:e.disabled,readOnly:e.readOnly,required:e.required},I))),a.createElement("div",{className:w},D)),j&&a.createElement(r.Tooltip,l({target:v,content:e.tooltip},e.tooltipOptions)))})));return p.displayName="Checkbox",p.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null},e.Checkbox=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.hooks,primereact.tooltip,primereact.utils);
1
+ this.primereact=this.primereact||{},this.primereact.checkbox=function(e,t,n,r,c){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=o(t);function l(){return l=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},l.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,c,o,a,l=[],u=!0,i=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){i=!0,c=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(i)throw c}}return l}}function s(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 f(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}function d(){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 p=a.memo(a.forwardRef((function(e,t){var o,s,b=a.useState(!1),m=(s=2,u(o=b)||i(o,s)||f(o,s)||d()),h=m[0],y=m[1],v=a.useRef(null),g=a.useRef(e.inputRef),k=function(t){if(!e.disabled&&!e.readOnly&&e.onChange){var n=O(),r=t.target instanceof HTMLDivElement||t.target instanceof HTMLSpanElement;if(t.target===g.current||r&&t.target.checked!==n){var o=n?e.falseValue:e.trueValue;e.onChange({originalEvent:t,value:e.value,checked:o,stopPropagation:function(){},preventDefault:function(){},target:{type:"checkbox",name:e.name,id:e.id,value:e.value,checked:o}})}c.DomHandler.focus(g.current),t.preventDefault()}},O=function(){return e.checked===e.trueValue};a.useImperativeHandle(t,(function(){return{props:e,focus:function(){return c.DomHandler.focus(g.current)},getElement:function(){return v.current},getInput:function(){return g.current}}})),a.useEffect((function(){c.ObjectUtils.combinedRefs(g,e.inputRef)}),[g,e.inputRef]),n.useUpdateEffect((function(){g.current.checked=O()}),[e.checked,e.trueValue]);var x=O(),j=c.ObjectUtils.isNotEmpty(e.tooltip),E=c.ObjectUtils.findDiffKeys(e,p.defaultProps),I=c.ObjectUtils.reduceKeys(E,c.DomHandler.ARIA_PROPS),C=c.classNames("p-checkbox p-component",{"p-checkbox-checked":x,"p-checkbox-disabled":e.disabled,"p-checkbox-focused":h},e.className),D=c.classNames("p-checkbox-box",{"p-highlight":x,"p-disabled":e.disabled,"p-focus":h}),w=c.IconUtils.getJSXIcon(x?e.icon:"",{className:"p-checkbox-icon p-c"},{props:e,checked:x});return a.createElement(a.Fragment,null,a.createElement("div",l({ref:v,id:e.id,className:C,style:e.style},E,{onClick:k,onContextMenu:e.onContextMenu,onMouseDown:e.onMouseDown}),a.createElement("div",{className:"p-hidden-accessible"},a.createElement("input",l({ref:g,type:"checkbox",id:e.inputId,name:e.name,tabIndex:e.tabIndex,defaultChecked:x,onFocus:function(){y(!0)},onBlur:function(){y(!1)},onKeyDown:function(e){"Space"!==e.code&&" "!==e.key||k(e)},disabled:e.disabled,readOnly:e.readOnly,required:e.required},I))),a.createElement("div",{className:D},w)),j&&a.createElement(r.Tooltip,l({target:v,content:e.tooltip},e.tooltipOptions)))})));return p.displayName="Checkbox",p.defaultProps={__TYPE:"Checkbox",id:null,inputRef:null,inputId:null,value:null,name:null,checked:!1,trueValue:!0,falseValue:!1,style:null,className:null,disabled:!1,required:!1,readOnly:!1,tabIndex:null,icon:"pi pi-check",tooltip:null,tooltipOptions:null,onChange:null,onMouseDown:null,onContextMenu:null},e.Checkbox=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.hooks,primereact.tooltip,primereact.utils);
package/chip/chip.d.ts CHANGED
@@ -1,19 +1,87 @@
1
+ /**
2
+ *
3
+ * Chip represents people using icons, labels and images.
4
+ *
5
+ * [Live Demo](https://www.primefaces.org/primereact/chip)
6
+ *
7
+ * @module chip
8
+ *
9
+ */
1
10
  import * as React from 'react';
2
11
  import { IconType, TemplateType } from '../utils';
3
12
 
13
+ /**
14
+ * Defines valid properties in Chip component. In addition to these, all properties of HTMLDivElement can be used in this component.
15
+ * @group Properties
16
+ */
4
17
  export interface ChipProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
18
+ /**
19
+ * Defines the text to display.
20
+ *
21
+ */
5
22
  label?: string;
6
- icon?: IconType<ChipProps>;
7
- image?: string;
8
- removable?: boolean;
9
- removeIcon?: string;
10
- template?: TemplateType<ChipProps>;
11
- imageAlt?: string;
23
+ /**
24
+ * Defines the icon to display.
25
+ *
26
+ */
27
+ icon?: IconType<ChipProps> | undefined;
28
+ /**
29
+ * Defines the image to display.
30
+ *
31
+ */
32
+ image?: string | undefined;
33
+ /**
34
+ * Whether to display a remove icon.
35
+ * @defaultValue false
36
+ */
37
+ removable?: boolean | undefined;
38
+ /**
39
+ * Icon of the remove element.
40
+ * @defaultValue pi pi-times-circle
41
+ */
42
+ removeIcon?: string | undefined;
43
+ /**
44
+ * Template of an item.
45
+ *
46
+ */
47
+ template?: TemplateType<ChipProps> | undefined;
48
+ /**
49
+ * It specifies an alternate text for an image, if the image cannot be displayed.
50
+ *
51
+ */
52
+ imageAlt?: string | undefined;
53
+ /**
54
+ * This event is triggered if an error occurs while loading an image file.
55
+ * @param {React.SyntheticEvent} event - Browser event.
56
+ */
12
57
  onImageError?(event: React.SyntheticEvent): void;
58
+ /**
59
+ * Callback to invoke when a chip is removed.
60
+ * @param {React.MouseEvent} event - Browser event.
61
+ */
13
62
  onRemove?(event: React.MouseEvent<HTMLElement>): void;
14
- children?: React.ReactNode;
63
+ /**
64
+ * Used to get the child elements of the component.
65
+ * @readonly
66
+ */
67
+ children?: React.ReactNode | undefined;
15
68
  }
16
69
 
70
+ /**
71
+ * **PrimeReact - Chip**
72
+ *
73
+ * _Chip represents people using icons, labels and images._
74
+ *
75
+ * [Live Demo](https://www.primefaces.org/primereact/chip/)
76
+ * --- ---
77
+ * ![PrimeReact](https://www.primefaces.org/primereact/images/logo-100.png)
78
+ *
79
+ * @group Component
80
+ */
17
81
  export declare class Chip extends React.Component<ChipProps, any> {
82
+ /**
83
+ * Used to get container element.
84
+ * @return {HTMLDivElement} Container element
85
+ */
18
86
  public getElement(): HTMLDivElement;
19
87
  }
@@ -184,16 +184,13 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
184
184
  if (event.defaultPrevented) {
185
185
  return;
186
186
  }
187
- switch (event.which) {
188
- //backspace
189
- case 8:
187
+ switch (event.key) {
188
+ case 'Backspace':
190
189
  if (inputRef.current.value.length === 0 && values.length > 0) {
191
190
  removeItem(event, values.length - 1);
192
191
  }
193
192
  break;
194
-
195
- //enter
196
- case 13:
193
+ case 'Enter':
197
194
  if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
198
195
  addItem(event, inputValue, true);
199
196
  }
@@ -204,8 +201,11 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
204
201
  }
205
202
  if (isMaxedOut()) {
206
203
  event.preventDefault();
207
- } else if (props.separator === ',' && event.which === 188) {
208
- addItem(event, inputValue, true);
204
+ } else if (props.separator === ',') {
205
+ // GitHub #3885 Android Opera gives strange code 229 for comma
206
+ if (event.key === props.separator || utils.DomHandler.isAndroid() && event.which === 229) {
207
+ addItem(event, inputValue, true);
208
+ }
209
209
  }
210
210
  break;
211
211
  }
@@ -276,6 +276,9 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
276
276
  React__namespace.useImperativeHandle(ref, function () {
277
277
  return {
278
278
  props: props,
279
+ focus: function focus() {
280
+ return utils.DomHandler.focus(inputRef.current);
281
+ },
279
282
  getElement: function getElement() {
280
283
  return elementRef.current;
281
284
  },
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/keyfilter"),n=require("primereact/tooltip"),r=require("primereact/utils");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=l(e);function i(){return i=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},i.apply(this,arguments)}function u(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 o(e){if(Array.isArray(e))return u(e)}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e){return o(e)||c(e)||s(e)||p()}function d(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,l,a,i,u=[],o=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;o=!1}else for(;!(o=(r=a.call(n)).done)&&(u.push(r.value),u.length!==t);o=!0);}catch(e){c=!0,l=e}finally{try{if(!o&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw l}}return u}}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 y=a.memo(a.forwardRef((function(e,l){var u,o,c=a.useState(!1),p=(o=2,d(u=c)||m(u,o)||s(u,o)||v()),b=p[0],h=p[1],g=a.useRef(null),O=a.useRef(null),w=a.useRef(e.inputRef),j=function(t,n){if(!e.disabled||!e.readOnly){var r=f(e.value),l=r.splice(n,1);S(l,n)&&(e.onRemove&&e.onRemove({originalEvent:t,value:l}),e.onChange&&e.onChange({originalEvent:t,value:r,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:r}}))}},E=function(t,n,r){if(n&&n.trim().length){var l=e.value?f(e.value):[];if(e.allowDuplicate||-1===l.indexOf(n)){var a=!0;e.onAdd&&(a=e.onAdd({originalEvent:t,value:n})),!1!==a&&l.push(n)}x(t,l,r)}},D=function(){r.DomHandler.focus(w.current)},k=function(n){var r=n.target.value,l=e.value||[];if(e.onKeyDown&&e.onKeyDown(n),!n.defaultPrevented)switch(n.which){case 8:0===w.current.value.length&&l.length>0&&j(n,l.length-1);break;case 13:r&&r.trim().length&&(!e.max||e.max>l.length)&&E(n,r,!0);break;default:e.keyfilter&&t.KeyFilter.onKeyPress(n,e.keyfilter),R()?n.preventDefault():","===e.separator&&188===n.which&&E(n,r,!0)}},x=function(t,n,r){e.onChange&&e.onChange({originalEvent:t,value:n,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:n}}),w.current.value="",r&&t.preventDefault()},P=function(n){if(e.separator){var r=(n.clipboardData||window.clipboardData).getData("Text");if(e.keyfilter&&t.KeyFilter.onPaste(n,e.keyfilter),r){var l=e.value||[],a=r.split(e.separator);a=a.filter((function(t){return(e.allowDuplicate||-1===l.indexOf(t))&&t.trim().length})),l=[].concat(f(l),f(a)),x(n,l,!0)}}},A=function(t){h(!0),e.onFocus&&e.onFocus(t)},N=function(t){if(e.addOnBlur){var n=t.target.value,r=e.value||[];n&&n.trim().length&&(!e.max||e.max>r.length)&&E(t,n,!0)}h(!1),e.onBlur&&e.onBlur(t)},R=function(){return e.max&&e.value&&e.max===e.value.length},C=w.current&&w.current.value,I=a.useMemo((function(){return r.ObjectUtils.isNotEmpty(e.value)||r.ObjectUtils.isNotEmpty(C)}),[e.value,C]),S=function(t,n){return r.ObjectUtils.getPropValue(e.removable,{value:t,index:n,props:e})};a.useImperativeHandle(l,(function(){return{props:e,getElement:function(){return g.current},getInput:function(){return w.current}}})),a.useEffect((function(){r.ObjectUtils.combinedRefs(w,e.inputRef)}),[w,e.inputRef]);var K=function(t,n){return e.disabled||e.readOnly||!S(t,n)?null:a.createElement("span",{className:"p-chips-token-icon pi pi-times-circle",onClick:function(e){return j(e,n)}})},T=function(t,n){var r=e.itemTemplate?e.itemTemplate(t):t,l=a.createElement("span",{className:"p-chips-token-label"},r),i=K(t,n);return a.createElement("li",{key:n,className:"p-chips-token p-highlight"},l,i)},U=r.ObjectUtils.isNotEmpty(e.tooltip),B=r.ObjectUtils.findDiffKeys(e,y.defaultProps),F=r.ObjectUtils.reduceKeys(B,r.DomHandler.ARIA_PROPS),_=r.classNames("p-chips p-component p-inputwrapper",{"p-inputwrapper-filled":I,"p-inputwrapper-focus":b},e.className),q=function(){var t=r.classNames("p-inputtext p-chips-multiple-container",{"p-disabled":e.disabled,"p-focus":b}),n=e.value?e.value.map(T):null,l=a.createElement("li",{className:"p-chips-input-token"},a.createElement("input",i({ref:w,id:e.inputId,placeholder:e.placeholder,type:"text",name:e.name,disabled:e.disabled||R(),onKeyDown:k,onPaste:P,onFocus:A,onBlur:N,readOnly:e.readOnly},F)));return a.createElement("ul",{ref:O,className:t,onClick:D},n,l)}();return a.createElement(a.Fragment,null,a.createElement("div",i({ref:g,id:e.id,className:_,style:e.style},B),q),U&&a.createElement(n.Tooltip,i({target:w,content:e.tooltip},e.tooltipOptions)))})));y.displayName="Chips",y.defaultProps={__TYPE:"Chips",id:null,inputRef:null,inputId:null,name:null,placeholder:null,value:null,max:null,disabled:null,readOnly:!1,removable:!0,style:null,className:null,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,separator:null,allowDuplicate:!0,itemTemplate:null,keyfilter:null,addOnBlur:null,onAdd:null,onRemove:null,onChange:null,onFocus:null,onBlur:null,onKeyDown:null},exports.Chips=y;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/keyfilter"),n=require("primereact/tooltip"),r=require("primereact/utils");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=l(e);function i(){return i=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},i.apply(this,arguments)}function o(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 u(e){if(Array.isArray(e))return o(e)}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return o(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)?o(e,t):void 0}}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e){return u(e)||c(e)||s(e)||p()}function d(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,l,a,i,o=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw l}}return o}}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 y=a.memo(a.forwardRef((function(e,l){var o,u,c=a.useState(!1),p=(u=2,d(o=c)||m(o,u)||s(o,u)||v()),b=p[0],h=p[1],g=a.useRef(null),O=a.useRef(null),w=a.useRef(e.inputRef),E=function(t,n){if(!e.disabled||!e.readOnly){var r=f(e.value),l=r.splice(n,1);S(l,n)&&(e.onRemove&&e.onRemove({originalEvent:t,value:l}),e.onChange&&e.onChange({originalEvent:t,value:r,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:r}}))}},j=function(t,n,r){if(n&&n.trim().length){var l=e.value?f(e.value):[];if(e.allowDuplicate||-1===l.indexOf(n)){var a=!0;e.onAdd&&(a=e.onAdd({originalEvent:t,value:n})),!1!==a&&l.push(n)}x(t,l,r)}},D=function(){r.DomHandler.focus(w.current)},k=function(n){var l=n.target.value,a=e.value||[];if(e.onKeyDown&&e.onKeyDown(n),!n.defaultPrevented)switch(n.key){case"Backspace":0===w.current.value.length&&a.length>0&&E(n,a.length-1);break;case"Enter":l&&l.trim().length&&(!e.max||e.max>a.length)&&j(n,l,!0);break;default:e.keyfilter&&t.KeyFilter.onKeyPress(n,e.keyfilter),R()?n.preventDefault():","===e.separator&&(n.key===e.separator||r.DomHandler.isAndroid()&&229===n.which)&&j(n,l,!0)}},x=function(t,n,r){e.onChange&&e.onChange({originalEvent:t,value:n,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:n}}),w.current.value="",r&&t.preventDefault()},P=function(n){if(e.separator){var r=(n.clipboardData||window.clipboardData).getData("Text");if(e.keyfilter&&t.KeyFilter.onPaste(n,e.keyfilter),r){var l=e.value||[],a=r.split(e.separator);a=a.filter((function(t){return(e.allowDuplicate||-1===l.indexOf(t))&&t.trim().length})),l=[].concat(f(l),f(a)),x(n,l,!0)}}},A=function(t){h(!0),e.onFocus&&e.onFocus(t)},N=function(t){if(e.addOnBlur){var n=t.target.value,r=e.value||[];n&&n.trim().length&&(!e.max||e.max>r.length)&&j(t,n,!0)}h(!1),e.onBlur&&e.onBlur(t)},R=function(){return e.max&&e.value&&e.max===e.value.length},C=w.current&&w.current.value,I=a.useMemo((function(){return r.ObjectUtils.isNotEmpty(e.value)||r.ObjectUtils.isNotEmpty(C)}),[e.value,C]),S=function(t,n){return r.ObjectUtils.getPropValue(e.removable,{value:t,index:n,props:e})};a.useImperativeHandle(l,(function(){return{props:e,focus:function(){return r.DomHandler.focus(w.current)},getElement:function(){return g.current},getInput:function(){return w.current}}})),a.useEffect((function(){r.ObjectUtils.combinedRefs(w,e.inputRef)}),[w,e.inputRef]);var K=function(t,n){return e.disabled||e.readOnly||!S(t,n)?null:a.createElement("span",{className:"p-chips-token-icon pi pi-times-circle",onClick:function(e){return E(e,n)}})},B=function(t,n){var r=e.itemTemplate?e.itemTemplate(t):t,l=a.createElement("span",{className:"p-chips-token-label"},r),i=K(t,n);return a.createElement("li",{key:n,className:"p-chips-token p-highlight"},l,i)},T=r.ObjectUtils.isNotEmpty(e.tooltip),U=r.ObjectUtils.findDiffKeys(e,y.defaultProps),F=r.ObjectUtils.reduceKeys(U,r.DomHandler.ARIA_PROPS),_=r.classNames("p-chips p-component p-inputwrapper",{"p-inputwrapper-filled":I,"p-inputwrapper-focus":b},e.className),H=function(){var t=r.classNames("p-inputtext p-chips-multiple-container",{"p-disabled":e.disabled,"p-focus":b}),n=e.value?e.value.map(B):null,l=a.createElement("li",{className:"p-chips-input-token"},a.createElement("input",i({ref:w,id:e.inputId,placeholder:e.placeholder,type:"text",name:e.name,disabled:e.disabled||R(),onKeyDown:k,onPaste:P,onFocus:A,onBlur:N,readOnly:e.readOnly},F)));return a.createElement("ul",{ref:O,className:t,onClick:D},n,l)}();return a.createElement(a.Fragment,null,a.createElement("div",i({ref:g,id:e.id,className:_,style:e.style},U),H),T&&a.createElement(n.Tooltip,i({target:w,content:e.tooltip},e.tooltipOptions)))})));y.displayName="Chips",y.defaultProps={__TYPE:"Chips",id:null,inputRef:null,inputId:null,name:null,placeholder:null,value:null,max:null,disabled:null,readOnly:!1,removable:!0,style:null,className:null,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,separator:null,allowDuplicate:!0,itemTemplate:null,keyfilter:null,addOnBlur:null,onAdd:null,onRemove:null,onChange:null,onFocus:null,onBlur:null,onKeyDown:null},exports.Chips=y;