primereact 8.1.0 → 8.3.0

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 (691) hide show
  1. package/README.md +6 -0
  2. package/accordion/accordion.cjs.js +9 -0
  3. package/accordion/accordion.cjs.min.js +1 -1
  4. package/accordion/accordion.d.ts +4 -5
  5. package/accordion/accordion.esm.js +9 -0
  6. package/accordion/accordion.esm.min.js +1 -1
  7. package/accordion/accordion.js +9 -0
  8. package/accordion/accordion.min.js +1 -1
  9. package/autocomplete/autocomplete.cjs.js +65 -36
  10. package/autocomplete/autocomplete.cjs.min.js +1 -1
  11. package/autocomplete/autocomplete.d.ts +5 -1
  12. package/autocomplete/autocomplete.esm.js +66 -37
  13. package/autocomplete/autocomplete.esm.min.js +1 -1
  14. package/autocomplete/autocomplete.js +65 -36
  15. package/autocomplete/autocomplete.min.js +1 -1
  16. package/avatar/avatar.cjs.js +35 -7
  17. package/avatar/avatar.cjs.min.js +1 -1
  18. package/avatar/avatar.d.ts +4 -4
  19. package/avatar/avatar.esm.js +35 -7
  20. package/avatar/avatar.esm.min.js +1 -1
  21. package/avatar/avatar.js +35 -7
  22. package/avatar/avatar.min.js +1 -1
  23. package/avatargroup/avatargroup.cjs.js +27 -0
  24. package/avatargroup/avatargroup.cjs.min.js +1 -1
  25. package/avatargroup/avatargroup.d.ts +4 -4
  26. package/avatargroup/avatargroup.esm.js +27 -0
  27. package/avatargroup/avatargroup.esm.min.js +1 -1
  28. package/avatargroup/avatargroup.js +27 -0
  29. package/avatargroup/avatargroup.min.js +1 -1
  30. package/badge/badge.cjs.js +14 -2
  31. package/badge/badge.cjs.min.js +1 -1
  32. package/badge/badge.d.ts +5 -5
  33. package/badge/badge.esm.js +14 -2
  34. package/badge/badge.esm.min.js +1 -1
  35. package/badge/badge.js +14 -2
  36. package/badge/badge.min.js +1 -1
  37. package/blockui/blockui.cjs.js +26 -3
  38. package/blockui/blockui.cjs.min.js +1 -1
  39. package/blockui/blockui.d.ts +2 -4
  40. package/blockui/blockui.esm.js +26 -3
  41. package/blockui/blockui.esm.min.js +1 -1
  42. package/blockui/blockui.js +26 -3
  43. package/blockui/blockui.min.js +1 -1
  44. package/breadcrumb/breadcrumb.cjs.js +28 -0
  45. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  46. package/breadcrumb/breadcrumb.d.ts +4 -5
  47. package/breadcrumb/breadcrumb.esm.js +28 -0
  48. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  49. package/breadcrumb/breadcrumb.js +28 -0
  50. package/breadcrumb/breadcrumb.min.js +1 -1
  51. package/button/button.d.ts +3 -1
  52. package/calendar/calendar.cjs.js +138 -46
  53. package/calendar/calendar.cjs.min.js +1 -1
  54. package/calendar/calendar.d.ts +4 -0
  55. package/calendar/calendar.esm.js +138 -46
  56. package/calendar/calendar.esm.min.js +1 -1
  57. package/calendar/calendar.js +138 -46
  58. package/calendar/calendar.min.js +1 -1
  59. package/captcha/captcha.cjs.js +24 -3
  60. package/captcha/captcha.cjs.min.js +1 -1
  61. package/captcha/captcha.d.ts +2 -3
  62. package/captcha/captcha.esm.js +24 -3
  63. package/captcha/captcha.esm.min.js +1 -1
  64. package/captcha/captcha.js +24 -3
  65. package/captcha/captcha.min.js +1 -1
  66. package/card/card.d.ts +1 -4
  67. package/carousel/carousel.cjs.js +25 -0
  68. package/carousel/carousel.cjs.min.js +1 -1
  69. package/carousel/carousel.d.ts +4 -5
  70. package/carousel/carousel.esm.js +25 -0
  71. package/carousel/carousel.esm.min.js +1 -1
  72. package/carousel/carousel.js +25 -0
  73. package/carousel/carousel.min.js +1 -1
  74. package/cascadeselect/cascadeselect.cjs.js +38 -3
  75. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  76. package/cascadeselect/cascadeselect.d.ts +7 -2
  77. package/cascadeselect/cascadeselect.esm.js +38 -3
  78. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  79. package/cascadeselect/cascadeselect.js +38 -3
  80. package/cascadeselect/cascadeselect.min.js +1 -1
  81. package/chart/chart.cjs.js +72 -25
  82. package/chart/chart.cjs.min.js +1 -1
  83. package/chart/chart.d.ts +1 -0
  84. package/chart/chart.esm.js +72 -25
  85. package/chart/chart.esm.min.js +1 -1
  86. package/chart/chart.js +72 -25
  87. package/chart/chart.min.js +1 -1
  88. package/checkbox/checkbox.cjs.js +30 -1
  89. package/checkbox/checkbox.cjs.min.js +1 -1
  90. package/checkbox/checkbox.d.ts +4 -1
  91. package/checkbox/checkbox.esm.js +31 -2
  92. package/checkbox/checkbox.esm.min.js +1 -1
  93. package/checkbox/checkbox.js +30 -1
  94. package/checkbox/checkbox.min.js +1 -1
  95. package/chip/chip.cjs.js +28 -0
  96. package/chip/chip.cjs.min.js +1 -1
  97. package/chip/chip.d.ts +4 -4
  98. package/chip/chip.esm.js +28 -0
  99. package/chip/chip.esm.min.js +1 -1
  100. package/chip/chip.js +28 -0
  101. package/chip/chip.min.js +1 -1
  102. package/chips/chips.cjs.js +56 -2
  103. package/chips/chips.cjs.min.js +1 -1
  104. package/chips/chips.d.ts +9 -5
  105. package/chips/chips.esm.js +57 -3
  106. package/chips/chips.esm.min.js +1 -1
  107. package/chips/chips.js +57 -4
  108. package/chips/chips.min.js +1 -1
  109. package/colorpicker/colorpicker.cjs.js +33 -0
  110. package/colorpicker/colorpicker.cjs.min.js +1 -1
  111. package/colorpicker/colorpicker.d.ts +7 -1
  112. package/colorpicker/colorpicker.esm.js +33 -0
  113. package/colorpicker/colorpicker.esm.min.js +1 -1
  114. package/colorpicker/colorpicker.js +33 -0
  115. package/colorpicker/colorpicker.min.js +1 -1
  116. package/column/column.d.ts +1 -0
  117. package/confirmdialog/confirmdialog.cjs.js +3 -3
  118. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  119. package/confirmdialog/confirmdialog.d.ts +1 -6
  120. package/confirmdialog/confirmdialog.esm.js +3 -3
  121. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  122. package/confirmdialog/confirmdialog.js +3 -3
  123. package/confirmdialog/confirmdialog.min.js +1 -1
  124. package/confirmpopup/confirmpopup.cjs.js +2 -2
  125. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  126. package/confirmpopup/confirmpopup.esm.js +2 -2
  127. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  128. package/confirmpopup/confirmpopup.js +2 -2
  129. package/confirmpopup/confirmpopup.min.js +1 -1
  130. package/contextmenu/contextmenu.cjs.js +25 -3
  131. package/contextmenu/contextmenu.cjs.min.js +1 -1
  132. package/contextmenu/contextmenu.d.ts +2 -4
  133. package/contextmenu/contextmenu.esm.js +25 -3
  134. package/contextmenu/contextmenu.esm.min.js +1 -1
  135. package/contextmenu/contextmenu.js +25 -3
  136. package/contextmenu/contextmenu.min.js +1 -1
  137. package/core/core.js +599 -180
  138. package/core/core.min.js +12 -12
  139. package/datascroller/datascroller.cjs.js +29 -3
  140. package/datascroller/datascroller.cjs.min.js +1 -1
  141. package/datascroller/datascroller.d.ts +2 -4
  142. package/datascroller/datascroller.esm.js +29 -3
  143. package/datascroller/datascroller.esm.min.js +1 -1
  144. package/datascroller/datascroller.js +29 -3
  145. package/datascroller/datascroller.min.js +1 -1
  146. package/datatable/datatable.cjs.js +92 -30
  147. package/datatable/datatable.cjs.min.js +1 -1
  148. package/datatable/datatable.d.ts +5 -1
  149. package/datatable/datatable.esm.js +93 -31
  150. package/datatable/datatable.esm.min.js +1 -1
  151. package/datatable/datatable.js +92 -30
  152. package/datatable/datatable.min.js +1 -1
  153. package/dataview/dataview.cjs.js +12 -0
  154. package/dataview/dataview.cjs.min.js +1 -1
  155. package/dataview/dataview.d.ts +4 -5
  156. package/dataview/dataview.esm.js +12 -0
  157. package/dataview/dataview.esm.min.js +1 -1
  158. package/dataview/dataview.js +12 -0
  159. package/dataview/dataview.min.js +1 -1
  160. package/deferredcontent/deferredcontent.cjs.js +25 -0
  161. package/deferredcontent/deferredcontent.cjs.min.js +1 -1
  162. package/deferredcontent/deferredcontent.d.ts +4 -2
  163. package/deferredcontent/deferredcontent.esm.js +25 -0
  164. package/deferredcontent/deferredcontent.esm.min.js +1 -1
  165. package/deferredcontent/deferredcontent.js +25 -0
  166. package/deferredcontent/deferredcontent.min.js +1 -1
  167. package/dialog/dialog.cjs.js +46 -6
  168. package/dialog/dialog.cjs.min.js +1 -1
  169. package/dialog/dialog.d.ts +8 -0
  170. package/dialog/dialog.esm.js +46 -6
  171. package/dialog/dialog.esm.min.js +1 -1
  172. package/dialog/dialog.js +46 -6
  173. package/dialog/dialog.min.js +1 -1
  174. package/divider/divider.cjs.js +27 -0
  175. package/divider/divider.cjs.min.js +1 -1
  176. package/divider/divider.d.ts +4 -4
  177. package/divider/divider.esm.js +27 -0
  178. package/divider/divider.esm.min.js +1 -1
  179. package/divider/divider.js +27 -0
  180. package/divider/divider.min.js +1 -1
  181. package/dock/dock.cjs.js +28 -0
  182. package/dock/dock.cjs.min.js +1 -1
  183. package/dock/dock.d.ts +4 -5
  184. package/dock/dock.esm.js +28 -0
  185. package/dock/dock.esm.min.js +1 -1
  186. package/dock/dock.js +28 -0
  187. package/dock/dock.min.js +1 -1
  188. package/dropdown/dropdown.cjs.js +85 -23
  189. package/dropdown/dropdown.cjs.min.js +1 -1
  190. package/dropdown/dropdown.d.ts +15 -2
  191. package/dropdown/dropdown.esm.js +85 -23
  192. package/dropdown/dropdown.esm.min.js +1 -1
  193. package/dropdown/dropdown.js +85 -23
  194. package/dropdown/dropdown.min.js +1 -1
  195. package/editor/editor.cjs.js +27 -11
  196. package/editor/editor.cjs.min.js +1 -1
  197. package/editor/editor.d.ts +3 -0
  198. package/editor/editor.esm.js +27 -11
  199. package/editor/editor.esm.min.js +1 -1
  200. package/editor/editor.js +27 -11
  201. package/editor/editor.min.js +1 -1
  202. package/fieldset/fieldset.cjs.js +30 -0
  203. package/fieldset/fieldset.cjs.min.js +1 -1
  204. package/fieldset/fieldset.d.ts +5 -5
  205. package/fieldset/fieldset.esm.js +30 -0
  206. package/fieldset/fieldset.esm.min.js +1 -1
  207. package/fieldset/fieldset.js +30 -0
  208. package/fieldset/fieldset.min.js +1 -1
  209. package/fileupload/fileupload.cjs.js +28 -3
  210. package/fileupload/fileupload.cjs.min.js +1 -1
  211. package/fileupload/fileupload.d.ts +2 -0
  212. package/fileupload/fileupload.esm.js +28 -3
  213. package/fileupload/fileupload.esm.min.js +1 -1
  214. package/fileupload/fileupload.js +28 -3
  215. package/fileupload/fileupload.min.js +1 -1
  216. package/fullcalendar/fullcalendar.cjs.js +25 -0
  217. package/fullcalendar/fullcalendar.cjs.min.js +1 -1
  218. package/fullcalendar/fullcalendar.d.ts +3 -1
  219. package/fullcalendar/fullcalendar.esm.js +25 -0
  220. package/fullcalendar/fullcalendar.esm.min.js +1 -1
  221. package/fullcalendar/fullcalendar.js +25 -0
  222. package/fullcalendar/fullcalendar.min.js +1 -1
  223. package/galleria/galleria.cjs.js +27 -3
  224. package/galleria/galleria.cjs.min.js +1 -1
  225. package/galleria/galleria.d.ts +2 -4
  226. package/galleria/galleria.esm.js +27 -3
  227. package/galleria/galleria.esm.min.js +1 -1
  228. package/galleria/galleria.js +27 -3
  229. package/galleria/galleria.min.js +1 -1
  230. package/gmap/gmap.cjs.js +25 -3
  231. package/gmap/gmap.cjs.min.js +1 -1
  232. package/gmap/gmap.d.ts +5 -4
  233. package/gmap/gmap.esm.js +25 -3
  234. package/gmap/gmap.esm.min.js +1 -1
  235. package/gmap/gmap.js +25 -3
  236. package/gmap/gmap.min.js +1 -1
  237. package/hooks/hooks.cjs.js +48 -2
  238. package/hooks/hooks.cjs.min.js +1 -1
  239. package/hooks/hooks.d.ts +3 -1
  240. package/hooks/hooks.esm.js +47 -3
  241. package/hooks/hooks.esm.min.js +1 -1
  242. package/hooks/hooks.js +48 -2
  243. package/hooks/hooks.min.js +1 -1
  244. package/image/image.cjs.js +35 -5
  245. package/image/image.cjs.min.js +1 -1
  246. package/image/image.d.ts +5 -4
  247. package/image/image.esm.js +35 -5
  248. package/image/image.esm.min.js +1 -1
  249. package/image/image.js +35 -5
  250. package/image/image.min.css +1 -1
  251. package/image/image.min.js +1 -1
  252. package/inplace/inplace.cjs.js +28 -1
  253. package/inplace/inplace.cjs.min.js +1 -1
  254. package/inplace/inplace.d.ts +4 -5
  255. package/inplace/inplace.esm.js +28 -1
  256. package/inplace/inplace.esm.min.js +1 -1
  257. package/inplace/inplace.js +28 -1
  258. package/inplace/inplace.min.js +1 -1
  259. package/inputmask/inputmask.cjs.js +32 -5
  260. package/inputmask/inputmask.cjs.min.js +1 -1
  261. package/inputmask/inputmask.d.ts +5 -13
  262. package/inputmask/inputmask.esm.js +32 -5
  263. package/inputmask/inputmask.esm.min.js +1 -1
  264. package/inputmask/inputmask.js +32 -5
  265. package/inputmask/inputmask.min.js +1 -1
  266. package/inputnumber/inputnumber.cjs.js +11 -5
  267. package/inputnumber/inputnumber.cjs.min.js +1 -1
  268. package/inputnumber/inputnumber.d.ts +4 -4
  269. package/inputnumber/inputnumber.esm.js +11 -5
  270. package/inputnumber/inputnumber.esm.min.js +1 -1
  271. package/inputnumber/inputnumber.js +11 -5
  272. package/inputnumber/inputnumber.min.js +1 -1
  273. package/inputswitch/inputswitch.cjs.js +29 -1
  274. package/inputswitch/inputswitch.cjs.min.js +1 -1
  275. package/inputswitch/inputswitch.d.ts +4 -1
  276. package/inputswitch/inputswitch.esm.js +30 -2
  277. package/inputswitch/inputswitch.esm.min.js +1 -1
  278. package/inputswitch/inputswitch.js +29 -1
  279. package/inputswitch/inputswitch.min.css +1 -1
  280. package/inputswitch/inputswitch.min.js +1 -1
  281. package/inputtext/inputtext.d.ts +4 -1
  282. package/inputtext/inputtext.min.css +1 -1
  283. package/inputtextarea/inputtextarea.d.ts +4 -1
  284. package/knob/knob.cjs.js +25 -0
  285. package/knob/knob.cjs.min.js +1 -1
  286. package/knob/knob.d.ts +3 -1
  287. package/knob/knob.esm.js +25 -0
  288. package/knob/knob.esm.min.js +1 -1
  289. package/knob/knob.js +25 -0
  290. package/knob/knob.min.js +1 -1
  291. package/listbox/listbox.cjs.js +128 -20
  292. package/listbox/listbox.cjs.min.js +1 -1
  293. package/listbox/listbox.d.ts +14 -7
  294. package/listbox/listbox.esm.js +129 -21
  295. package/listbox/listbox.esm.min.js +1 -1
  296. package/listbox/listbox.js +129 -22
  297. package/listbox/listbox.min.js +1 -1
  298. package/megamenu/megamenu.cjs.js +57 -12
  299. package/megamenu/megamenu.cjs.min.js +1 -1
  300. package/megamenu/megamenu.d.ts +11 -5
  301. package/megamenu/megamenu.esm.js +57 -12
  302. package/megamenu/megamenu.esm.min.js +1 -1
  303. package/megamenu/megamenu.js +57 -12
  304. package/megamenu/megamenu.min.css +1 -1
  305. package/megamenu/megamenu.min.js +1 -1
  306. package/mention/mention.cjs.js +16 -1
  307. package/mention/mention.cjs.min.js +1 -1
  308. package/mention/mention.d.ts +7 -5
  309. package/mention/mention.esm.js +16 -1
  310. package/mention/mention.esm.min.js +1 -1
  311. package/mention/mention.js +16 -1
  312. package/mention/mention.min.js +1 -1
  313. package/menu/menu.cjs.js +27 -3
  314. package/menu/menu.cjs.min.js +1 -1
  315. package/menu/menu.d.ts +3 -4
  316. package/menu/menu.esm.js +27 -3
  317. package/menu/menu.esm.min.js +1 -1
  318. package/menu/menu.js +27 -3
  319. package/menu/menu.min.js +1 -1
  320. package/menubar/menubar.cjs.js +32 -3
  321. package/menubar/menubar.cjs.min.js +1 -1
  322. package/menubar/menubar.d.ts +6 -5
  323. package/menubar/menubar.esm.js +32 -3
  324. package/menubar/menubar.esm.min.js +1 -1
  325. package/menubar/menubar.js +32 -3
  326. package/menubar/menubar.min.js +1 -1
  327. package/menuitem/menuitem.d.ts +2 -0
  328. package/message/message.cjs.js +28 -0
  329. package/message/message.cjs.min.js +1 -1
  330. package/message/message.d.ts +5 -6
  331. package/message/message.esm.js +28 -0
  332. package/message/message.esm.min.js +1 -1
  333. package/message/message.js +28 -0
  334. package/message/message.min.js +1 -1
  335. package/messages/messages.cjs.js +30 -5
  336. package/messages/messages.cjs.min.js +1 -1
  337. package/messages/messages.d.ts +3 -5
  338. package/messages/messages.esm.js +30 -5
  339. package/messages/messages.esm.min.js +1 -1
  340. package/messages/messages.js +30 -5
  341. package/messages/messages.min.js +1 -1
  342. package/multiselect/multiselect.cjs.js +78 -12
  343. package/multiselect/multiselect.cjs.min.js +1 -1
  344. package/multiselect/multiselect.d.ts +16 -2
  345. package/multiselect/multiselect.esm.js +78 -12
  346. package/multiselect/multiselect.esm.min.js +1 -1
  347. package/multiselect/multiselect.js +78 -12
  348. package/multiselect/multiselect.min.js +1 -1
  349. package/multistatecheckbox/multistatecheckbox.cjs.js +10 -0
  350. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  351. package/multistatecheckbox/multistatecheckbox.d.ts +4 -6
  352. package/multistatecheckbox/multistatecheckbox.esm.js +10 -0
  353. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  354. package/multistatecheckbox/multistatecheckbox.js +10 -0
  355. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  356. package/orderlist/orderlist.cjs.js +145 -4
  357. package/orderlist/orderlist.cjs.min.js +1 -1
  358. package/orderlist/orderlist.d.ts +17 -6
  359. package/orderlist/orderlist.esm.js +145 -4
  360. package/orderlist/orderlist.esm.min.js +1 -1
  361. package/orderlist/orderlist.js +146 -6
  362. package/orderlist/orderlist.min.css +1 -1
  363. package/orderlist/orderlist.min.js +1 -1
  364. package/organizationchart/organizationchart.cjs.js +27 -0
  365. package/organizationchart/organizationchart.cjs.min.js +1 -1
  366. package/organizationchart/organizationchart.d.ts +4 -5
  367. package/organizationchart/organizationchart.esm.js +27 -0
  368. package/organizationchart/organizationchart.esm.min.js +1 -1
  369. package/organizationchart/organizationchart.js +27 -0
  370. package/organizationchart/organizationchart.min.js +1 -1
  371. package/overlaypanel/overlaypanel.cjs.js +25 -4
  372. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  373. package/overlaypanel/overlaypanel.d.ts +2 -4
  374. package/overlaypanel/overlaypanel.esm.js +25 -4
  375. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  376. package/overlaypanel/overlaypanel.js +25 -4
  377. package/overlaypanel/overlaypanel.min.js +1 -1
  378. package/package.json +1 -1
  379. package/paginator/paginator.cjs.js +15 -3
  380. package/paginator/paginator.cjs.min.js +1 -1
  381. package/paginator/paginator.d.ts +4 -4
  382. package/paginator/paginator.esm.js +15 -3
  383. package/paginator/paginator.esm.min.js +1 -1
  384. package/paginator/paginator.js +15 -3
  385. package/paginator/paginator.min.js +1 -1
  386. package/panel/panel.cjs.js +28 -0
  387. package/panel/panel.cjs.min.js +1 -1
  388. package/panel/panel.d.ts +5 -5
  389. package/panel/panel.esm.js +28 -0
  390. package/panel/panel.esm.min.js +1 -1
  391. package/panel/panel.js +28 -0
  392. package/panel/panel.min.js +1 -1
  393. package/panelmenu/panelmenu.cjs.js +28 -0
  394. package/panelmenu/panelmenu.cjs.min.js +1 -1
  395. package/panelmenu/panelmenu.d.ts +4 -5
  396. package/panelmenu/panelmenu.esm.js +28 -0
  397. package/panelmenu/panelmenu.esm.min.js +1 -1
  398. package/panelmenu/panelmenu.js +28 -0
  399. package/panelmenu/panelmenu.min.js +1 -1
  400. package/password/password.cjs.js +31 -0
  401. package/password/password.cjs.min.js +1 -1
  402. package/password/password.d.ts +6 -4
  403. package/password/password.esm.js +31 -0
  404. package/password/password.esm.min.js +1 -1
  405. package/password/password.js +31 -0
  406. package/password/password.min.js +1 -1
  407. package/picklist/picklist.cjs.js +196 -14
  408. package/picklist/picklist.cjs.min.js +1 -1
  409. package/picklist/picklist.d.ts +32 -1
  410. package/picklist/picklist.esm.js +196 -14
  411. package/picklist/picklist.esm.min.js +1 -1
  412. package/picklist/picklist.js +197 -16
  413. package/picklist/picklist.min.css +1 -1
  414. package/picklist/picklist.min.js +1 -1
  415. package/primereact.all.cjs.js +2483 -655
  416. package/primereact.all.cjs.min.js +1 -1
  417. package/primereact.all.esm.js +2481 -655
  418. package/primereact.all.esm.min.js +1 -1
  419. package/primereact.all.js +2483 -655
  420. package/primereact.all.min.js +1 -1
  421. package/progressbar/progressbar.cjs.js +29 -0
  422. package/progressbar/progressbar.cjs.min.js +1 -1
  423. package/progressbar/progressbar.d.ts +4 -5
  424. package/progressbar/progressbar.esm.js +29 -0
  425. package/progressbar/progressbar.esm.min.js +1 -1
  426. package/progressbar/progressbar.js +29 -0
  427. package/progressbar/progressbar.min.js +1 -1
  428. package/progressspinner/progressspinner.cjs.js +27 -0
  429. package/progressspinner/progressspinner.cjs.min.js +1 -1
  430. package/progressspinner/progressspinner.d.ts +4 -5
  431. package/progressspinner/progressspinner.esm.js +27 -0
  432. package/progressspinner/progressspinner.esm.min.js +1 -1
  433. package/progressspinner/progressspinner.js +27 -0
  434. package/progressspinner/progressspinner.min.js +1 -1
  435. package/radiobutton/radiobutton.cjs.js +29 -4
  436. package/radiobutton/radiobutton.cjs.min.js +1 -1
  437. package/radiobutton/radiobutton.d.ts +2 -4
  438. package/radiobutton/radiobutton.esm.js +30 -5
  439. package/radiobutton/radiobutton.esm.min.js +1 -1
  440. package/radiobutton/radiobutton.js +29 -4
  441. package/radiobutton/radiobutton.min.js +1 -1
  442. package/rating/rating.cjs.js +25 -0
  443. package/rating/rating.cjs.min.js +1 -1
  444. package/rating/rating.d.ts +3 -4
  445. package/rating/rating.esm.js +25 -0
  446. package/rating/rating.esm.min.js +1 -1
  447. package/rating/rating.js +25 -0
  448. package/rating/rating.min.js +1 -1
  449. package/resources/primereact.css +213 -145
  450. package/resources/primereact.min.css +1 -1
  451. package/resources/themes/arya-blue/theme.css +39 -6
  452. package/resources/themes/arya-green/theme.css +39 -6
  453. package/resources/themes/arya-orange/theme.css +39 -6
  454. package/resources/themes/arya-purple/theme.css +39 -6
  455. package/resources/themes/bootstrap4-dark-blue/theme.css +39 -6
  456. package/resources/themes/bootstrap4-dark-purple/theme.css +39 -6
  457. package/resources/themes/bootstrap4-light-blue/theme.css +38 -5
  458. package/resources/themes/bootstrap4-light-purple/theme.css +38 -5
  459. package/resources/themes/fluent-light/theme.css +39 -6
  460. package/resources/themes/lara-dark-blue/theme.css +39 -6
  461. package/resources/themes/lara-dark-indigo/theme.css +39 -6
  462. package/resources/themes/lara-dark-purple/theme.css +39 -6
  463. package/resources/themes/lara-dark-teal/theme.css +39 -6
  464. package/resources/themes/lara-light-blue/theme.css +39 -6
  465. package/resources/themes/lara-light-indigo/theme.css +39 -6
  466. package/resources/themes/lara-light-purple/theme.css +39 -6
  467. package/resources/themes/lara-light-teal/theme.css +39 -6
  468. package/resources/themes/luna-amber/theme.css +39 -6
  469. package/resources/themes/luna-blue/theme.css +39 -6
  470. package/resources/themes/luna-green/theme.css +39 -6
  471. package/resources/themes/luna-pink/theme.css +39 -6
  472. package/resources/themes/md-dark-deeppurple/theme.css +39 -6
  473. package/resources/themes/md-dark-indigo/theme.css +39 -6
  474. package/resources/themes/md-light-deeppurple/theme.css +39 -6
  475. package/resources/themes/md-light-indigo/theme.css +39 -6
  476. package/resources/themes/mdc-dark-deeppurple/theme.css +39 -6
  477. package/resources/themes/mdc-dark-indigo/theme.css +39 -6
  478. package/resources/themes/mdc-light-deeppurple/theme.css +39 -6
  479. package/resources/themes/mdc-light-indigo/theme.css +39 -6
  480. package/resources/themes/nova/theme.css +39 -6
  481. package/resources/themes/nova-accent/theme.css +39 -6
  482. package/resources/themes/nova-alt/theme.css +39 -6
  483. package/resources/themes/rhea/theme.css +39 -6
  484. package/resources/themes/saga-blue/theme.css +39 -6
  485. package/resources/themes/saga-green/theme.css +39 -6
  486. package/resources/themes/saga-orange/theme.css +39 -6
  487. package/resources/themes/saga-purple/theme.css +39 -6
  488. package/resources/themes/tailwind-light/theme.css +39 -6
  489. package/resources/themes/vela-blue/theme.css +39 -6
  490. package/resources/themes/vela-green/theme.css +39 -6
  491. package/resources/themes/vela-orange/theme.css +39 -6
  492. package/resources/themes/vela-purple/theme.css +39 -6
  493. package/scrollpanel/scrollpanel.cjs.js +33 -3
  494. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  495. package/scrollpanel/scrollpanel.d.ts +7 -5
  496. package/scrollpanel/scrollpanel.esm.js +33 -3
  497. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  498. package/scrollpanel/scrollpanel.js +33 -3
  499. package/scrollpanel/scrollpanel.min.js +1 -1
  500. package/scrolltop/scrolltop.cjs.js +25 -0
  501. package/scrolltop/scrolltop.cjs.min.js +1 -1
  502. package/scrolltop/scrolltop.d.ts +3 -1
  503. package/scrolltop/scrolltop.esm.js +25 -0
  504. package/scrolltop/scrolltop.esm.min.js +1 -1
  505. package/scrolltop/scrolltop.js +25 -0
  506. package/scrolltop/scrolltop.min.js +1 -1
  507. package/selectbutton/selectbutton.cjs.js +25 -0
  508. package/selectbutton/selectbutton.cjs.min.js +1 -1
  509. package/selectbutton/selectbutton.d.ts +4 -5
  510. package/selectbutton/selectbutton.esm.js +25 -0
  511. package/selectbutton/selectbutton.esm.min.js +1 -1
  512. package/selectbutton/selectbutton.js +25 -0
  513. package/selectbutton/selectbutton.min.js +1 -1
  514. package/sidebar/sidebar.cjs.js +31 -0
  515. package/sidebar/sidebar.cjs.min.js +1 -1
  516. package/sidebar/sidebar.d.ts +6 -5
  517. package/sidebar/sidebar.esm.js +31 -0
  518. package/sidebar/sidebar.esm.min.js +1 -1
  519. package/sidebar/sidebar.js +31 -0
  520. package/sidebar/sidebar.min.js +1 -1
  521. package/skeleton/skeleton.cjs.js +27 -0
  522. package/skeleton/skeleton.cjs.min.js +1 -1
  523. package/skeleton/skeleton.d.ts +4 -4
  524. package/skeleton/skeleton.esm.js +27 -0
  525. package/skeleton/skeleton.esm.min.js +1 -1
  526. package/skeleton/skeleton.js +27 -0
  527. package/skeleton/skeleton.min.js +1 -1
  528. package/slidemenu/slidemenu.cjs.js +28 -21
  529. package/slidemenu/slidemenu.cjs.min.js +1 -1
  530. package/slidemenu/slidemenu.d.ts +2 -4
  531. package/slidemenu/slidemenu.esm.js +28 -21
  532. package/slidemenu/slidemenu.esm.min.js +1 -1
  533. package/slidemenu/slidemenu.js +28 -21
  534. package/slidemenu/slidemenu.min.js +1 -1
  535. package/slider/slider.cjs.js +25 -0
  536. package/slider/slider.cjs.min.js +1 -1
  537. package/slider/slider.d.ts +4 -6
  538. package/slider/slider.esm.js +25 -0
  539. package/slider/slider.esm.min.js +1 -1
  540. package/slider/slider.js +25 -0
  541. package/slider/slider.min.js +1 -1
  542. package/speeddial/speeddial.cjs.js +6 -3
  543. package/speeddial/speeddial.cjs.min.js +1 -1
  544. package/speeddial/speeddial.d.ts +2 -4
  545. package/speeddial/speeddial.esm.js +6 -3
  546. package/speeddial/speeddial.esm.min.js +1 -1
  547. package/speeddial/speeddial.js +6 -3
  548. package/speeddial/speeddial.min.js +1 -1
  549. package/splitbutton/splitbutton.cjs.js +28 -3
  550. package/splitbutton/splitbutton.cjs.min.js +1 -1
  551. package/splitbutton/splitbutton.d.ts +4 -5
  552. package/splitbutton/splitbutton.esm.js +28 -3
  553. package/splitbutton/splitbutton.esm.min.js +1 -1
  554. package/splitbutton/splitbutton.js +28 -3
  555. package/splitbutton/splitbutton.min.js +1 -1
  556. package/splitter/splitter.cjs.js +34 -5
  557. package/splitter/splitter.cjs.min.js +1 -1
  558. package/splitter/splitter.d.ts +4 -5
  559. package/splitter/splitter.esm.js +35 -6
  560. package/splitter/splitter.esm.min.js +1 -1
  561. package/splitter/splitter.js +34 -5
  562. package/splitter/splitter.min.js +1 -1
  563. package/steps/steps.cjs.js +29 -0
  564. package/steps/steps.cjs.min.js +1 -1
  565. package/steps/steps.d.ts +4 -5
  566. package/steps/steps.esm.js +29 -0
  567. package/steps/steps.esm.min.js +1 -1
  568. package/steps/steps.js +29 -0
  569. package/steps/steps.min.js +1 -1
  570. package/styleclass/styleclass.cjs.js +40 -17
  571. package/styleclass/styleclass.cjs.min.js +1 -1
  572. package/styleclass/styleclass.d.ts +5 -2
  573. package/styleclass/styleclass.esm.js +40 -17
  574. package/styleclass/styleclass.esm.min.js +1 -1
  575. package/styleclass/styleclass.js +40 -17
  576. package/styleclass/styleclass.min.js +1 -1
  577. package/tabmenu/tabmenu.cjs.js +27 -0
  578. package/tabmenu/tabmenu.cjs.min.js +1 -1
  579. package/tabmenu/tabmenu.d.ts +4 -5
  580. package/tabmenu/tabmenu.esm.js +27 -0
  581. package/tabmenu/tabmenu.esm.min.js +1 -1
  582. package/tabmenu/tabmenu.js +27 -0
  583. package/tabmenu/tabmenu.min.js +1 -1
  584. package/tabview/tabview.cjs.js +8 -3
  585. package/tabview/tabview.cjs.min.js +1 -1
  586. package/tabview/tabview.d.ts +2 -4
  587. package/tabview/tabview.esm.js +8 -3
  588. package/tabview/tabview.esm.min.js +1 -1
  589. package/tabview/tabview.js +8 -3
  590. package/tabview/tabview.min.js +1 -1
  591. package/tag/tag.cjs.js +12 -0
  592. package/tag/tag.cjs.min.js +1 -1
  593. package/tag/tag.d.ts +5 -5
  594. package/tag/tag.esm.js +12 -0
  595. package/tag/tag.esm.min.js +1 -1
  596. package/tag/tag.js +12 -0
  597. package/tag/tag.min.js +1 -1
  598. package/terminal/terminal.cjs.js +26 -1
  599. package/terminal/terminal.cjs.min.js +1 -1
  600. package/terminal/terminal.d.ts +4 -5
  601. package/terminal/terminal.esm.js +27 -2
  602. package/terminal/terminal.esm.min.js +1 -1
  603. package/terminal/terminal.js +26 -1
  604. package/terminal/terminal.min.js +1 -1
  605. package/tieredmenu/tieredmenu.cjs.js +27 -4
  606. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  607. package/tieredmenu/tieredmenu.d.ts +2 -4
  608. package/tieredmenu/tieredmenu.esm.js +27 -4
  609. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  610. package/tieredmenu/tieredmenu.js +27 -4
  611. package/tieredmenu/tieredmenu.min.js +1 -1
  612. package/timeline/timeline.cjs.js +13 -0
  613. package/timeline/timeline.cjs.min.js +1 -1
  614. package/timeline/timeline.d.ts +4 -5
  615. package/timeline/timeline.esm.js +13 -0
  616. package/timeline/timeline.esm.min.js +1 -1
  617. package/timeline/timeline.js +13 -0
  618. package/timeline/timeline.min.js +1 -1
  619. package/toast/toast.cjs.js +18 -17
  620. package/toast/toast.cjs.min.js +1 -1
  621. package/toast/toast.d.ts +4 -5
  622. package/toast/toast.esm.js +18 -17
  623. package/toast/toast.esm.min.js +1 -1
  624. package/toast/toast.js +18 -17
  625. package/toast/toast.min.css +1 -1
  626. package/toast/toast.min.js +1 -1
  627. package/togglebutton/togglebutton.cjs.js +25 -0
  628. package/togglebutton/togglebutton.cjs.min.js +1 -1
  629. package/togglebutton/togglebutton.d.ts +4 -6
  630. package/togglebutton/togglebutton.esm.js +25 -0
  631. package/togglebutton/togglebutton.esm.min.js +1 -1
  632. package/togglebutton/togglebutton.js +25 -0
  633. package/togglebutton/togglebutton.min.js +1 -1
  634. package/toolbar/toolbar.cjs.js +27 -0
  635. package/toolbar/toolbar.cjs.min.js +1 -1
  636. package/toolbar/toolbar.d.ts +4 -5
  637. package/toolbar/toolbar.esm.js +27 -0
  638. package/toolbar/toolbar.esm.min.js +1 -1
  639. package/toolbar/toolbar.js +27 -0
  640. package/toolbar/toolbar.min.js +1 -1
  641. package/tooltip/tooltip.cjs.js +76 -53
  642. package/tooltip/tooltip.cjs.min.js +1 -1
  643. package/tooltip/tooltip.d.ts +2 -0
  644. package/tooltip/tooltip.esm.js +76 -53
  645. package/tooltip/tooltip.esm.min.js +1 -1
  646. package/tooltip/tooltip.js +76 -53
  647. package/tooltip/tooltip.min.js +1 -1
  648. package/tree/tree.cjs.js +51 -9
  649. package/tree/tree.cjs.min.js +1 -1
  650. package/tree/tree.d.ts +9 -0
  651. package/tree/tree.esm.js +51 -9
  652. package/tree/tree.esm.min.js +1 -1
  653. package/tree/tree.js +51 -9
  654. package/tree/tree.min.js +1 -1
  655. package/treeselect/treeselect.cjs.js +34 -5
  656. package/treeselect/treeselect.cjs.min.js +1 -1
  657. package/treeselect/treeselect.d.ts +11 -5
  658. package/treeselect/treeselect.esm.js +34 -5
  659. package/treeselect/treeselect.esm.min.js +1 -1
  660. package/treeselect/treeselect.js +34 -5
  661. package/treeselect/treeselect.min.js +1 -1
  662. package/treetable/treetable.cjs.js +12 -8
  663. package/treetable/treetable.cjs.min.js +1 -1
  664. package/treetable/treetable.d.ts +4 -3
  665. package/treetable/treetable.esm.js +12 -8
  666. package/treetable/treetable.esm.min.js +1 -1
  667. package/treetable/treetable.js +12 -8
  668. package/treetable/treetable.min.js +1 -1
  669. package/tristatecheckbox/tristatecheckbox.cjs.js +25 -0
  670. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  671. package/tristatecheckbox/tristatecheckbox.d.ts +3 -5
  672. package/tristatecheckbox/tristatecheckbox.esm.js +25 -0
  673. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  674. package/tristatecheckbox/tristatecheckbox.js +25 -0
  675. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  676. package/utils/utils.cjs.js +21 -5
  677. package/utils/utils.cjs.min.js +1 -1
  678. package/utils/utils.d.ts +1 -0
  679. package/utils/utils.esm.js +21 -5
  680. package/utils/utils.esm.min.js +1 -1
  681. package/utils/utils.js +21 -5
  682. package/utils/utils.min.js +1 -1
  683. package/virtualscroller/virtualscroller.cjs.js +157 -68
  684. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  685. package/virtualscroller/virtualscroller.d.ts +12 -0
  686. package/virtualscroller/virtualscroller.esm.js +159 -70
  687. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  688. package/virtualscroller/virtualscroller.js +157 -68
  689. package/virtualscroller/virtualscroller.min.css +1 -1
  690. package/virtualscroller/virtualscroller.min.js +1 -1
  691. package/web-types.json +301 -5
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { FilterService } from 'primereact/api';
2
3
  import { useUpdateEffect } from 'primereact/hooks';
3
4
  import { classNames, ObjectUtils, DomHandler } from 'primereact/utils';
4
5
  import { Button } from 'primereact/button';
@@ -22,6 +23,21 @@ function _extends() {
22
23
  return _extends.apply(this, arguments);
23
24
  }
24
25
 
26
+ function _defineProperty(obj, key, value) {
27
+ if (key in obj) {
28
+ Object.defineProperty(obj, key, {
29
+ value: value,
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true
33
+ });
34
+ } else {
35
+ obj[key] = value;
36
+ }
37
+
38
+ return obj;
39
+ }
40
+
25
41
  function _arrayWithHoles(arr) {
26
42
  if (Array.isArray(arr)) return arr;
27
43
  }
@@ -357,6 +373,23 @@ var PickListSubList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
357
373
  return ObjectUtils.findIndexInList(item, props.selection, props.dataKey) !== -1;
358
374
  };
359
375
 
376
+ var onFilter = function onFilter(event) {
377
+ if (props.onFilter) {
378
+ props.onFilter({
379
+ originalEvent: event,
380
+ value: event.target.value,
381
+ type: props.type
382
+ });
383
+ }
384
+ };
385
+
386
+ var onFilterInputKeyDown = function onFilterInputKeyDown(event) {
387
+ //enter
388
+ if (event.which === 13) {
389
+ event.preventDefault();
390
+ }
391
+ };
392
+
360
393
  React.useImperativeHandle(ref, function () {
361
394
  return {
362
395
  listElementRef: listElementRef
@@ -393,6 +426,44 @@ var PickListSubList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
393
426
  return null;
394
427
  };
395
428
 
429
+ var createFilter = function createFilter() {
430
+ if (props.showFilter) {
431
+ var content = /*#__PURE__*/React.createElement("div", {
432
+ className: "p-picklist-filter"
433
+ }, /*#__PURE__*/React.createElement("input", {
434
+ type: "text",
435
+ value: props.filterValue,
436
+ onChange: onFilter,
437
+ onKeyDown: onFilterInputKeyDown,
438
+ placeholder: props.placeholder,
439
+ className: "p-picklist-filter-input p-inputtext p-component"
440
+ }), /*#__PURE__*/React.createElement("span", {
441
+ className: "p-picklist-filter-icon pi pi-search"
442
+ }));
443
+
444
+ if (props.filterTemplate) {
445
+ var defaultContentOptions = {
446
+ className: 'p-picklist-filter',
447
+ inputProps: {
448
+ className: 'p-picklist-filter-input p-inputtext p-component',
449
+ onChange: onFilter,
450
+ onKeyDown: onFilterInputKeyDown
451
+ },
452
+ iconClassName: 'p-picklist-filter-icon pi pi-search',
453
+ element: content,
454
+ props: props
455
+ };
456
+ content = ObjectUtils.getJSXElement(props.filterTemplate, defaultContentOptions);
457
+ }
458
+
459
+ return /*#__PURE__*/React.createElement("div", {
460
+ className: "p-picklist-filter-container"
461
+ }, content);
462
+ }
463
+
464
+ return null;
465
+ };
466
+
396
467
  var createList = function createList() {
397
468
  var items = createItems();
398
469
  var className = classNames('p-picklist-list', props.listClassName);
@@ -406,19 +477,20 @@ var PickListSubList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(fun
406
477
 
407
478
  var className = classNames('p-picklist-list-wrapper', props.className);
408
479
  var header = createHeader();
480
+ var filter = createFilter();
409
481
  var list = createList();
410
482
  return /*#__PURE__*/React.createElement("div", {
411
483
  ref: listElementRef,
412
484
  className: className
413
- }, header, list);
485
+ }, header, filter, list);
414
486
  }));
415
487
  PickListSubList.displayName = 'PickListSubList';
416
488
 
417
489
  var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
418
- var moveRightDisabled = ObjectUtils.isEmpty(props.sourceSelection);
419
- var moveLeftDisabled = ObjectUtils.isEmpty(props.targetSelection);
420
- var moveAllRightDisabled = ObjectUtils.isEmpty(props.source);
421
- var moveAllLeftDisabled = ObjectUtils.isEmpty(props.target);
490
+ var moveRightDisabled = ObjectUtils.isEmpty(props.sourceSelection) || ObjectUtils.isEmpty(props.visibleSourceList);
491
+ var moveLeftDisabled = ObjectUtils.isEmpty(props.targetSelection) || ObjectUtils.isEmpty(props.visibleTargetList);
492
+ var moveAllRightDisabled = ObjectUtils.isEmpty(props.visibleSourceList);
493
+ var moveAllLeftDisabled = ObjectUtils.isEmpty(props.visibleTargetList);
422
494
 
423
495
  var moveRight = function moveRight(event) {
424
496
  var selection = props.sourceSelection;
@@ -449,8 +521,12 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
449
521
 
450
522
  var moveAllRight = function moveAllRight(event) {
451
523
  if (props.source) {
452
- var targetList = [].concat(_toConsumableArray(props.target), _toConsumableArray(props.source));
453
- var sourceList = [];
524
+ var targetList = [].concat(_toConsumableArray(props.target), _toConsumableArray(props.visibleSourceList));
525
+ var sourceList = props.source.filter(function (s) {
526
+ return !props.visibleSourceList.some(function (vs) {
527
+ return vs === s;
528
+ });
529
+ });
454
530
 
455
531
  if (props.onTransfer) {
456
532
  props.onTransfer({
@@ -492,8 +568,12 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
492
568
 
493
569
  var moveAllLeft = function moveAllLeft(event) {
494
570
  if (props.source) {
495
- var sourceList = [].concat(_toConsumableArray(props.source), _toConsumableArray(props.target));
496
- var targetList = [];
571
+ var sourceList = [].concat(_toConsumableArray(props.source), _toConsumableArray(props.visibleTargetList));
572
+ var targetList = props.target.filter(function (t) {
573
+ return !props.visibleTargetList.some(function (vt) {
574
+ return vt === t;
575
+ });
576
+ });
497
577
 
498
578
  if (props.onTransfer) {
499
579
  props.onTransfer({
@@ -533,6 +613,9 @@ var PickListTransferControls = /*#__PURE__*/React.memo(function (props) {
533
613
  });
534
614
  PickListTransferControls.displayName = 'PickListTransferControls';
535
615
 
616
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
617
+
618
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
536
619
  var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {
537
620
  var _React$useState = React.useState([]),
538
621
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -544,12 +627,28 @@ var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
544
627
  targetSelectionState = _React$useState4[0],
545
628
  setTargetSelectionState = _React$useState4[1];
546
629
 
630
+ var _React$useState5 = React.useState(''),
631
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
632
+ sourceFilterValueState = _React$useState6[0],
633
+ setSourceFilterValueState = _React$useState6[1];
634
+
635
+ var _React$useState7 = React.useState(''),
636
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
637
+ targetFilterValueState = _React$useState8[0],
638
+ setTargetFilterValueState = _React$useState8[1];
639
+
640
+ var elementRef = React.useRef(null);
547
641
  var sourceListElementRef = React.useRef(null);
548
642
  var targetListElementRef = React.useRef(null);
549
643
  var reorderedListElementRef = React.useRef(null);
550
644
  var reorderDirection = React.useRef(null);
551
645
  var sourceSelection = props.onSourceSelectionChange ? props.sourceSelection : sourceSelectionState;
552
646
  var targetSelection = props.onTargetSelectionChange ? props.targetSelection : targetSelectionState;
647
+ var sourceFilteredValue = props.onSourceFilterChange ? props.sourceFilterValue : sourceFilterValueState;
648
+ var targetFilteredValue = props.onTargetFilterChange ? props.targetFilterValue : targetFilterValueState;
649
+ var hasFilterBy = ObjectUtils.isNotEmpty(props.filterBy);
650
+ var showSourceFilter = hasFilterBy && props.showSourceFilter;
651
+ var showTargetFilter = hasFilterBy && props.showTargetFilter;
553
652
 
554
653
  var onSourceReorder = function onSourceReorder(event) {
555
654
  handleChange(event, event.value, props.target);
@@ -684,6 +783,59 @@ var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
684
783
  }
685
784
  };
686
785
 
786
+ var onFilter = function onFilter(event) {
787
+ var originalEvent = event.originalEvent,
788
+ value = event.value,
789
+ type = event.type;
790
+
791
+ var _ref = type === 'source' ? [setSourceFilterValueState, props.onSourceFilterChange] : [setTargetFilterValueState, props.onTargetFilterChange],
792
+ _ref2 = _slicedToArray(_ref, 2),
793
+ setFilterState = _ref2[0],
794
+ onFilterChange = _ref2[1];
795
+
796
+ if (onFilterChange) {
797
+ onFilterChange({
798
+ originalEvent: originalEvent,
799
+ value: value
800
+ });
801
+ } else {
802
+ setFilterState(value);
803
+ }
804
+ };
805
+
806
+ var getVisibleList = function getVisibleList(list, type) {
807
+ var _ref3 = type === 'source' ? [sourceFilteredValue, filterSource] : [targetFilteredValue, filterTarget],
808
+ _ref4 = _slicedToArray(_ref3, 2),
809
+ filteredValue = _ref4[0],
810
+ filterCallback = _ref4[1];
811
+
812
+ return hasFilterBy && ObjectUtils.isNotEmpty(filteredValue) ? filterCallback(filteredValue) : list;
813
+ };
814
+
815
+ var filterSource = function filterSource() {
816
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
817
+ var filteredValue = value.trim().toLocaleLowerCase(props.filterLocale);
818
+ return filter(props.source, filteredValue);
819
+ };
820
+
821
+ var filterTarget = function filterTarget() {
822
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
823
+ var filteredValue = value.trim().toLocaleLowerCase(props.filterLocale);
824
+ return filter(props.target, filteredValue);
825
+ };
826
+
827
+ var filter = function filter(list, filterValue) {
828
+ var searchFields = hasFilterBy ? props.filterBy.split(',') : [];
829
+ return FilterService.filter(list, searchFields, filterValue, props.filterMatchMode, props.filterLocale);
830
+ };
831
+
832
+ React.useImperativeHandle(ref, function () {
833
+ return _objectSpread({
834
+ getElement: function getElement() {
835
+ return elementRef.current;
836
+ }
837
+ }, props);
838
+ });
687
839
  useUpdateEffect(function () {
688
840
  if (reorderedListElementRef.current) {
689
841
  handleScrollPosition(reorderedListElementRef.current, reorderDirection.current);
@@ -695,8 +847,11 @@ var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
695
847
  var className = classNames('p-picklist p-component', props.className);
696
848
  var sourceItemTemplate = props.sourceItemTemplate ? props.sourceItemTemplate : props.itemTemplate;
697
849
  var targetItemTemplate = props.targetItemTemplate ? props.targetItemTemplate : props.itemTemplate;
850
+ var sourceList = getVisibleList(props.source, 'source');
851
+ var targetList = getVisibleList(props.target, 'target');
698
852
  return /*#__PURE__*/React.createElement("div", _extends({
699
853
  id: props.id,
854
+ ref: elementRef,
700
855
  className: className,
701
856
  style: props.style
702
857
  }, otherProps), props.showSourceControls && /*#__PURE__*/React.createElement(PickListControls, {
@@ -707,7 +862,8 @@ var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
707
862
  dataKey: props.dataKey
708
863
  }), /*#__PURE__*/React.createElement(PickListSubList, {
709
864
  ref: sourceListElementRef,
710
- list: props.source,
865
+ type: "source",
866
+ list: sourceList,
711
867
  selection: sourceSelection,
712
868
  onSelectionChange: function onSelectionChange(e) {
713
869
  return _onSelectionChange(e, 'sourceSelection', props.onSourceSelectionChange);
@@ -719,17 +875,25 @@ var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
719
875
  listClassName: "p-picklist-source",
720
876
  metaKeySelection: props.metaKeySelection,
721
877
  tabIndex: props.tabIndex,
722
- dataKey: props.dataKey
878
+ dataKey: props.dataKey,
879
+ filterValue: sourceFilteredValue,
880
+ onFilter: onFilter,
881
+ showFilter: showSourceFilter,
882
+ placeholder: props.sourceFilterPlaceholder,
883
+ template: props.sourceFilterTemplate
723
884
  }), /*#__PURE__*/React.createElement(PickListTransferControls, {
724
885
  onTransfer: onTransfer,
725
886
  source: props.source,
887
+ visibleSourceList: sourceList,
726
888
  target: props.target,
889
+ visibleTargetList: targetList,
727
890
  sourceSelection: sourceSelection,
728
891
  targetSelection: targetSelection,
729
892
  dataKey: props.dataKey
730
893
  }), /*#__PURE__*/React.createElement(PickListSubList, {
731
894
  ref: targetListElementRef,
732
- list: props.target,
895
+ type: "target",
896
+ list: targetList,
733
897
  selection: targetSelection,
734
898
  onSelectionChange: function onSelectionChange(e) {
735
899
  return _onSelectionChange(e, 'targetSelection', props.onTargetSelectionChange);
@@ -741,7 +905,12 @@ var PickList = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
741
905
  listClassName: "p-picklist-target",
742
906
  metaKeySelection: props.metaKeySelection,
743
907
  tabIndex: props.tabIndex,
744
- dataKey: props.dataKey
908
+ dataKey: props.dataKey,
909
+ filterValue: targetFilteredValue,
910
+ onFilter: onFilter,
911
+ showFilter: showTargetFilter,
912
+ placeholder: props.targetFilterPlaceholder,
913
+ template: props.targetFilterTemplate
745
914
  }), props.showTargetControls && /*#__PURE__*/React.createElement(PickListControls, {
746
915
  list: props.target,
747
916
  selection: targetSelection,
@@ -767,6 +936,17 @@ PickList.defaultProps = {
767
936
  showSourceControls: true,
768
937
  showTargetControls: true,
769
938
  metaKeySelection: true,
939
+ filterBy: null,
940
+ filterMatchMode: 'contains',
941
+ filterLocale: undefined,
942
+ sourceFilterValue: null,
943
+ targetFilterValue: null,
944
+ showSourceFilter: true,
945
+ showTargetFilter: true,
946
+ sourceFilterPlaceholder: null,
947
+ targetFilterPlaceholder: null,
948
+ sourceFilterTemplate: null,
949
+ targetFilterTemplate: null,
770
950
  tabIndex: 0,
771
951
  dataKey: null,
772
952
  itemTemplate: null,
@@ -778,7 +958,9 @@ PickList.defaultProps = {
778
958
  onMoveToTarget: null,
779
959
  onMoveAllToTarget: null,
780
960
  onSourceSelectionChange: null,
781
- onTargetSelectionChange: null
961
+ onTargetSelectionChange: null,
962
+ onSourceFilterChange: null,
963
+ onTargetFilterChange: null
782
964
  };
783
965
 
784
966
  export { PickList };
@@ -1 +1 @@
1
- import*as e from"react";import{useUpdateEffect as t}from"primereact/hooks";import{classNames as n,ObjectUtils as r,DomHandler as a}from"primereact/utils";import{Button as o}from"primereact/button";import{Ripple as l}from"primereact/ripple";function i(){return i=Object.assign||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 c(e){if(Array.isArray(e))return e}function s(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==n.return||n.return()}finally{if(i)throw a}}return o}}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 p(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 m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return c(e)||s(e,t)||p(e,t)||m()}function f(e){if(Array.isArray(e))return u(e)}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function v(){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 y(e){return f(e)||g(e)||p(e)||v()}var h=e.memo((function(t){var a=!t.selection.length,l=n("p-picklist-buttons",t.className);return e.createElement("div",{className:l},e.createElement(o,{disabled:a,type:"button",icon:"pi pi-angle-up",onClick:function(e){var n=t.selection;if(n&&n.length){for(var a=y(t.list),o=0;o<n.length;o++){var l=r.findIndexInList(n[o],a,t.dataKey);if(0===l)break;var i=a[l-1];a[l-1]=a[l],a[l]=i}t.onReorder&&t.onReorder({originalEvent:e,value:a,direction:"up"})}}}),e.createElement(o,{disabled:a,type:"button",icon:"pi pi-angle-double-up",onClick:function(e){var n=t.selection;if(n&&n.length){for(var a=y(t.list),o=0;o<n.length;o++){var l=r.findIndexInList(n[o],a,t.dataKey);if(0===l)break;var i=a.splice(l,1)[0];a.unshift(i)}t.onReorder&&t.onReorder({originalEvent:e,value:a,direction:"top"})}}}),e.createElement(o,{disabled:a,type:"button",icon:"pi pi-angle-down",onClick:function(e){var n=t.selection;if(n&&n.length){for(var a=y(t.list),o=n.length-1;o>=0;o--){var l=r.findIndexInList(n[o],a,t.dataKey);if(l===a.length-1)break;var i=a[l+1];a[l+1]=a[l],a[l]=i}t.onReorder&&t.onReorder({originalEvent:e,value:a,direction:"down"})}}}),e.createElement(o,{disabled:a,type:"button",icon:"pi pi-angle-double-down",onClick:function(e){var n=t.selection;if(n&&n.length){for(var a=y(t.list),o=n.length-1;o>=0;o--){var l=r.findIndexInList(n[o],a,t.dataKey);if(l===a.length-1)break;var i=a.splice(l,1)[0];a.push(i)}t.onReorder&&t.onReorder({originalEvent:e,value:a,direction:"bottom"})}}}))}));h.displayName="PickListControls";var S=e.memo((function(t){var r=t.template?t.template(t.value):t.value,a=n("p-picklist-item",{"p-highlight":t.selected},t.className);return e.createElement("li",{className:a,onClick:function(e){t.onClick&&t.onClick({originalEvent:e,value:t.value})},onKeyDown:function(e){t.onKeyDown&&t.onKeyDown({originalEvent:e,value:t.value})},tabIndex:t.tabIndex,role:"option","aria-selected":t.selected},r,e.createElement(l,null))}));S.displayName="PickListItem";var b=e.memo(e.forwardRef((function(t,o){var l=e.useRef(null),i=function(e){var n=e.originalEvent,a=e.value,o=y(t.selection),l=r.findIndexInList(a,o,t.dataKey),i=-1!==l;if(t.metaKeySelection){var c=n.metaKey||n.ctrlKey;i&&c?o.splice(l,1):(c||(o.length=0),o.push(a))}else i?o.splice(l,1):o.push(a);t.onSelectionChange&&t.onSelectionChange({event:n,value:o})},c=function(e){var t=e.originalEvent,n=t.currentTarget;switch(t.which){case 40:var r=s(n);r&&r.focus(),t.preventDefault();break;case 38:var a=u(n);a&&a.focus(),t.preventDefault();break;case 13:i(e),t.preventDefault()}},s=function e(t){var n=t.nextElementSibling;return n?a.hasClass(n,"p-picklist-item")?n:e(n):null},u=function e(t){var n=t.previousElementSibling;return n?a.hasClass(n,"p-picklist-item")?n:e(n):null},p=function(e){return-1!==r.findIndexInList(e,t.selection,t.dataKey)};e.useImperativeHandle(o,(function(){return{listElementRef:l}}));var m=n("p-picklist-list-wrapper",t.className),d=t.header?e.createElement("div",{className:"p-picklist-header"},r.getJSXElement(t.header,t)):null,f=function(){var r=t.list?t.list.map((function(n){var r=JSON.stringify(n),a=p(n);return e.createElement(S,{key:r,value:n,template:t.itemTemplate,selected:a,onClick:i,onKeyDown:c,tabIndex:t.tabIndex})})):null,a=n("p-picklist-list",t.listClassName);return e.createElement("ul",{className:a,style:t.style,role:"listbox","aria-multiselectable":!0},r)}();return e.createElement("div",{ref:l,className:m},d,f)})));b.displayName="PickListSubList";var E=e.memo((function(t){var a=r.isEmpty(t.sourceSelection),l=r.isEmpty(t.targetSelection),i=r.isEmpty(t.source),c=r.isEmpty(t.target),s=n("p-picklist-buttons p-picklist-transfer-buttons",t.className);return e.createElement("div",{className:s},e.createElement(o,{disabled:a,type:"button",icon:"pi pi-angle-right",onClick:function(e){var n=t.sourceSelection;if(r.isNotEmpty(n)){for(var a=y(t.target),o=y(t.source),l=0;l<n.length;l++){var i=n[l];-1===r.findIndexInList(i,a,t.dataKey)&&a.push(o.splice(r.findIndexInList(i,o,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:o,target:a,direction:"toTarget"})}}}),e.createElement(o,{disabled:i,type:"button",icon:"pi pi-angle-double-right",onClick:function(e){if(t.source){var n=[].concat(y(t.target),y(t.source));t.onTransfer&&t.onTransfer({originalEvent:e,source:[],target:n,direction:"allToTarget"})}}}),e.createElement(o,{disabled:l,type:"button",icon:"pi pi-angle-left",onClick:function(e){var n=t.targetSelection;if(r.isNotEmpty(n)){for(var a=y(t.target),o=y(t.source),l=0;l<n.length;l++){var i=n[l];-1===r.findIndexInList(i,o,t.dataKey)&&o.push(a.splice(r.findIndexInList(i,a,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:o,target:a,direction:"toSource"})}}}),e.createElement(o,{disabled:c,type:"button",icon:"pi pi-angle-double-left",onClick:function(e){if(t.source){var n=[].concat(y(t.source),y(t.target));t.onTransfer&&t.onTransfer({originalEvent:e,source:n,target:[],direction:"allToSource"})}}}))}));E.displayName="PickListTransferControls";var T=e.memo(e.forwardRef((function(o,l){var c=d(e.useState([]),2),s=c[0],u=c[1],p=d(e.useState([]),2),m=p[0],f=p[1],g=e.useRef(null),v=e.useRef(null),y=e.useRef(null),S=e.useRef(null),k=o.onSourceSelectionChange?o.sourceSelection:s,I=o.onTargetSelectionChange?o.targetSelection:m,C=function(e,t){if(e){var n=a.findSingle(e,".p-picklist-list");switch(t){case"up":N(n,-1);break;case"top":n.scrollTop=0;break;case"down":N(n,1);break;case"bottom":setTimeout((function(){return n.scrollTop=n.scrollHeight}),100)}}},K=function(e,t,n){o.onChange&&o.onChange({originalEvent:e.originalEvent,source:t,target:n})},N=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.getElementsByClassName("p-highlight");r.isNotEmpty(n)&&a.scrollInView(e,-1===t?n[0]:n[n.length-1])},w=function(e,t,n){n?n(e):"sourceSelection"===t?u(e.value):f(e.value),r.isNotEmpty(k)&&"targetSelection"===t?u([]):r.isNotEmpty(I)&&"sourceSelection"===t&&f([])};t((function(){y.current&&(C(y.current,S.current),y.current=null,S.current=null)}));var x=r.findDiffKeys(o,T.defaultProps),R=n("p-picklist p-component",o.className),L=o.sourceItemTemplate?o.sourceItemTemplate:o.itemTemplate,A=o.targetItemTemplate?o.targetItemTemplate:o.itemTemplate;return e.createElement("div",i({id:o.id,className:R,style:o.style},x),o.showSourceControls&&e.createElement(h,{list:o.source,selection:k,onReorder:function(e){K(e,e.value,o.target),y.current=g.current.listElementRef.current,S.current=e.direction},className:"p-picklist-source-controls",dataKey:o.dataKey}),e.createElement(b,{ref:g,list:o.source,selection:k,onSelectionChange:function(e){return w(e,"sourceSelection",o.onSourceSelectionChange)},itemTemplate:L,header:o.sourceHeader,style:o.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:o.metaKeySelection,tabIndex:o.tabIndex,dataKey:o.dataKey}),e.createElement(E,{onTransfer:function(e){var t=e.originalEvent,n=e.source,r=e.target;switch(e.direction){case"toTarget":o.onMoveToTarget&&o.onMoveToTarget({originalEvent:t,value:k});break;case"allToTarget":o.onMoveAllToTarget&&o.onMoveAllToTarget({originalEvent:t,value:o.source});break;case"toSource":o.onMoveToSource&&o.onMoveToSource({originalEvent:t,value:I});break;case"allToSource":o.onMoveAllToSource&&o.onMoveAllToSource({originalEvent:t,value:o.target})}w({originalEvent:t,value:[]},"sourceSelection",o.onSourceSelectionChange),w({originalEvent:t,value:[]},"targetSelection",o.onTargetSelectionChange),K(e,n,r)},source:o.source,target:o.target,sourceSelection:k,targetSelection:I,dataKey:o.dataKey}),e.createElement(b,{ref:v,list:o.target,selection:I,onSelectionChange:function(e){return w(e,"targetSelection",o.onTargetSelectionChange)},itemTemplate:A,header:o.targetHeader,style:o.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:o.metaKeySelection,tabIndex:o.tabIndex,dataKey:o.dataKey}),o.showTargetControls&&e.createElement(h,{list:o.target,selection:I,onReorder:function(e){K(e,o.source,e.value),y.current=v.current.listElementRef.current,S.current=e.direction},className:"p-picklist-target-controls",dataKey:o.dataKey}))})));T.displayName="PickList",T.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null};export{T as PickList};
1
+ import*as e from"react";import{FilterService as t}from"primereact/api";import{useUpdateEffect as r}from"primereact/hooks";import{classNames as n,ObjectUtils as l,DomHandler as i}from"primereact/utils";import{Button as a}from"primereact/button";import{Ripple as o}from"primereact/ripple";function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){if(Array.isArray(e))return e}function p(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,l,i=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){o=!0,l=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw l}}return i}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function m(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){return u(e)||p(e,t)||m(e,t)||g()}function d(e){if(Array.isArray(e))return f(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(){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 b(e){return d(e)||y(e)||m(e)||h()}var S=e.memo((function(t){var r=!t.selection.length,i=n("p-picklist-buttons",t.className);return e.createElement("div",{className:i},e.createElement(a,{disabled:r,type:"button",icon:"pi pi-angle-up",onClick:function(e){var r=t.selection;if(r&&r.length){for(var n=b(t.list),i=0;i<r.length;i++){var a=l.findIndexInList(r[i],n,t.dataKey);if(0===a)break;var o=n[a-1];n[a-1]=n[a],n[a]=o}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"up"})}}}),e.createElement(a,{disabled:r,type:"button",icon:"pi pi-angle-double-up",onClick:function(e){var r=t.selection;if(r&&r.length){for(var n=b(t.list),i=0;i<r.length;i++){var a=l.findIndexInList(r[i],n,t.dataKey);if(0===a)break;var o=n.splice(a,1)[0];n.unshift(o)}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"top"})}}}),e.createElement(a,{disabled:r,type:"button",icon:"pi pi-angle-down",onClick:function(e){var r=t.selection;if(r&&r.length){for(var n=b(t.list),i=r.length-1;i>=0;i--){var a=l.findIndexInList(r[i],n,t.dataKey);if(a===n.length-1)break;var o=n[a+1];n[a+1]=n[a],n[a]=o}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"down"})}}}),e.createElement(a,{disabled:r,type:"button",icon:"pi pi-angle-double-down",onClick:function(e){var r=t.selection;if(r&&r.length){for(var n=b(t.list),i=r.length-1;i>=0;i--){var a=l.findIndexInList(r[i],n,t.dataKey);if(a===n.length-1)break;var o=n.splice(a,1)[0];n.push(o)}t.onReorder&&t.onReorder({originalEvent:e,value:n,direction:"bottom"})}}}))}));S.displayName="PickListControls";var E=e.memo((function(t){var r=t.template?t.template(t.value):t.value,l=n("p-picklist-item",{"p-highlight":t.selected},t.className);return e.createElement("li",{className:l,onClick:function(e){t.onClick&&t.onClick({originalEvent:e,value:t.value})},onKeyDown:function(e){t.onKeyDown&&t.onKeyDown({originalEvent:e,value:t.value})},tabIndex:t.tabIndex,role:"option","aria-selected":t.selected},r,e.createElement(o,null))}));E.displayName="PickListItem";var T=e.memo(e.forwardRef((function(t,r){var a=e.useRef(null),o=function(e){var r=e.originalEvent,n=e.value,i=b(t.selection),a=l.findIndexInList(n,i,t.dataKey),o=-1!==a;if(t.metaKeySelection){var c=r.metaKey||r.ctrlKey;o&&c?i.splice(a,1):(c||(i.length=0),i.push(n))}else o?i.splice(a,1):i.push(n);t.onSelectionChange&&t.onSelectionChange({event:r,value:i})},c=function(e){var t=e.originalEvent,r=t.currentTarget;switch(t.which){case 40:var n=s(r);n&&n.focus(),t.preventDefault();break;case 38:var l=u(r);l&&l.focus(),t.preventDefault();break;case 13:o(e),t.preventDefault()}},s=function e(t){var r=t.nextElementSibling;return r?i.hasClass(r,"p-picklist-item")?r:e(r):null},u=function e(t){var r=t.previousElementSibling;return r?i.hasClass(r,"p-picklist-item")?r:e(r):null},p=function(e){return-1!==l.findIndexInList(e,t.selection,t.dataKey)},f=function(e){t.onFilter&&t.onFilter({originalEvent:e,value:e.target.value,type:t.type})},m=function(e){13===e.which&&e.preventDefault()};e.useImperativeHandle(r,(function(){return{listElementRef:a}}));var g=n("p-picklist-list-wrapper",t.className),v=t.header?e.createElement("div",{className:"p-picklist-header"},l.getJSXElement(t.header,t)):null,d=function(){if(t.showFilter){var r=e.createElement("div",{className:"p-picklist-filter"},e.createElement("input",{type:"text",value:t.filterValue,onChange:f,onKeyDown:m,placeholder:t.placeholder,className:"p-picklist-filter-input p-inputtext p-component"}),e.createElement("span",{className:"p-picklist-filter-icon pi pi-search"}));if(t.filterTemplate)r=l.getJSXElement(t.filterTemplate,{className:"p-picklist-filter",inputProps:{className:"p-picklist-filter-input p-inputtext p-component",onChange:f,onKeyDown:m},iconClassName:"p-picklist-filter-icon pi pi-search",element:r,props:t});return e.createElement("div",{className:"p-picklist-filter-container"},r)}return null}(),y=function(){var r=t.list?t.list.map((function(r){var n=JSON.stringify(r),l=p(r);return e.createElement(E,{key:n,value:r,template:t.itemTemplate,selected:l,onClick:o,onKeyDown:c,tabIndex:t.tabIndex})})):null,l=n("p-picklist-list",t.listClassName);return e.createElement("ul",{className:l,style:t.style,role:"listbox","aria-multiselectable":!0},r)}();return e.createElement("div",{ref:a,className:g},v,d,y)})));T.displayName="PickListSubList";var k=e.memo((function(t){var r=l.isEmpty(t.sourceSelection)||l.isEmpty(t.visibleSourceList),i=l.isEmpty(t.targetSelection)||l.isEmpty(t.visibleTargetList),o=l.isEmpty(t.visibleSourceList),c=l.isEmpty(t.visibleTargetList),s=n("p-picklist-buttons p-picklist-transfer-buttons",t.className);return e.createElement("div",{className:s},e.createElement(a,{disabled:r,type:"button",icon:"pi pi-angle-right",onClick:function(e){var r=t.sourceSelection;if(l.isNotEmpty(r)){for(var n=b(t.target),i=b(t.source),a=0;a<r.length;a++){var o=r[a];-1===l.findIndexInList(o,n,t.dataKey)&&n.push(i.splice(l.findIndexInList(o,i,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:i,target:n,direction:"toTarget"})}}}),e.createElement(a,{disabled:o,type:"button",icon:"pi pi-angle-double-right",onClick:function(e){if(t.source){var r=[].concat(b(t.target),b(t.visibleSourceList)),n=t.source.filter((function(e){return!t.visibleSourceList.some((function(t){return t===e}))}));t.onTransfer&&t.onTransfer({originalEvent:e,source:n,target:r,direction:"allToTarget"})}}}),e.createElement(a,{disabled:i,type:"button",icon:"pi pi-angle-left",onClick:function(e){var r=t.targetSelection;if(l.isNotEmpty(r)){for(var n=b(t.target),i=b(t.source),a=0;a<r.length;a++){var o=r[a];-1===l.findIndexInList(o,i,t.dataKey)&&i.push(n.splice(l.findIndexInList(o,n,t.dataKey),1)[0])}t.onTransfer&&t.onTransfer({originalEvent:e,source:i,target:n,direction:"toSource"})}}}),e.createElement(a,{disabled:c,type:"button",icon:"pi pi-angle-double-left",onClick:function(e){if(t.source){var r=[].concat(b(t.source),b(t.visibleTargetList)),n=t.target.filter((function(e){return!t.visibleTargetList.some((function(t){return t===e}))}));t.onTransfer&&t.onTransfer({originalEvent:e,source:r,target:n,direction:"allToSource"})}}}))}));function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}k.displayName="PickListTransferControls";var I=e.memo(e.forwardRef((function(a,o){var s=v(e.useState([]),2),u=s[0],p=s[1],f=v(e.useState([]),2),m=f[0],g=f[1],d=v(e.useState(""),2),y=d[0],h=d[1],b=v(e.useState(""),2),E=b[0],C=b[1],N=e.useRef(null),K=e.useRef(null),L=e.useRef(null),F=e.useRef(null),x=e.useRef(null),O=a.onSourceSelectionChange?a.sourceSelection:u,P=a.onTargetSelectionChange?a.targetSelection:m,R=a.onSourceFilterChange?a.sourceFilterValue:y,j=a.onTargetFilterChange?a.targetFilterValue:E,M=l.isNotEmpty(a.filterBy),A=M&&a.showSourceFilter,D=M&&a.showTargetFilter,V=function(e,t){if(e){var r=i.findSingle(e,".p-picklist-list");switch(t){case"up":B(r,-1);break;case"top":r.scrollTop=0;break;case"down":B(r,1);break;case"bottom":setTimeout((function(){return r.scrollTop=r.scrollHeight}),100)}}},H=function(e,t,r){a.onChange&&a.onChange({originalEvent:e.originalEvent,source:t,target:r})},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e.getElementsByClassName("p-highlight");l.isNotEmpty(r)&&i.scrollInView(e,-1===t?r[0]:r[r.length-1])},J=function(e,t,r){r?r(e):"sourceSelection"===t?p(e.value):g(e.value),l.isNotEmpty(O)&&"targetSelection"===t?p([]):l.isNotEmpty(P)&&"sourceSelection"===t&&g([])},X=function(e){var t=e.originalEvent,r=e.value,n=v("source"===e.type?[h,a.onSourceFilterChange]:[C,a.onTargetFilterChange],2),l=n[0],i=n[1];i?i({originalEvent:t,value:r}):l(r)},_=function(e,t){var r=v("source"===t?[R,U]:[j,Y],2),n=r[0],i=r[1];return M&&l.isNotEmpty(n)?i(n):e},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim().toLocaleLowerCase(a.filterLocale);return $(a.source,t)},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.trim().toLocaleLowerCase(a.filterLocale);return $(a.target,t)},$=function(e,r){var n=M?a.filterBy.split(","):[];return t.filter(e,n,r,a.filterMatchMode,a.filterLocale)};e.useImperativeHandle(o,(function(){return w({getElement:function(){return N.current}},a)})),r((function(){F.current&&(V(F.current,x.current),F.current=null,x.current=null)}));var q=l.findDiffKeys(a,I.defaultProps),z=n("p-picklist p-component",a.className),G=a.sourceItemTemplate?a.sourceItemTemplate:a.itemTemplate,Q=a.targetItemTemplate?a.targetItemTemplate:a.itemTemplate,W=_(a.source,"source"),Z=_(a.target,"target");return e.createElement("div",c({id:a.id,ref:N,className:z,style:a.style},q),a.showSourceControls&&e.createElement(S,{list:a.source,selection:O,onReorder:function(e){H(e,e.value,a.target),F.current=K.current.listElementRef.current,x.current=e.direction},className:"p-picklist-source-controls",dataKey:a.dataKey}),e.createElement(T,{ref:K,type:"source",list:W,selection:O,onSelectionChange:function(e){return J(e,"sourceSelection",a.onSourceSelectionChange)},itemTemplate:G,header:a.sourceHeader,style:a.sourceStyle,className:"p-picklist-source-wrapper",listClassName:"p-picklist-source",metaKeySelection:a.metaKeySelection,tabIndex:a.tabIndex,dataKey:a.dataKey,filterValue:R,onFilter:X,showFilter:A,placeholder:a.sourceFilterPlaceholder,template:a.sourceFilterTemplate}),e.createElement(k,{onTransfer:function(e){var t=e.originalEvent,r=e.source,n=e.target;switch(e.direction){case"toTarget":a.onMoveToTarget&&a.onMoveToTarget({originalEvent:t,value:O});break;case"allToTarget":a.onMoveAllToTarget&&a.onMoveAllToTarget({originalEvent:t,value:a.source});break;case"toSource":a.onMoveToSource&&a.onMoveToSource({originalEvent:t,value:P});break;case"allToSource":a.onMoveAllToSource&&a.onMoveAllToSource({originalEvent:t,value:a.target})}J({originalEvent:t,value:[]},"sourceSelection",a.onSourceSelectionChange),J({originalEvent:t,value:[]},"targetSelection",a.onTargetSelectionChange),H(e,r,n)},source:a.source,visibleSourceList:W,target:a.target,visibleTargetList:Z,sourceSelection:O,targetSelection:P,dataKey:a.dataKey}),e.createElement(T,{ref:L,type:"target",list:Z,selection:P,onSelectionChange:function(e){return J(e,"targetSelection",a.onTargetSelectionChange)},itemTemplate:Q,header:a.targetHeader,style:a.targetStyle,className:"p-picklist-target-wrapper",listClassName:"p-picklist-target",metaKeySelection:a.metaKeySelection,tabIndex:a.tabIndex,dataKey:a.dataKey,filterValue:j,onFilter:X,showFilter:D,placeholder:a.targetFilterPlaceholder,template:a.targetFilterTemplate}),a.showTargetControls&&e.createElement(S,{list:a.target,selection:P,onReorder:function(e){H(e,a.source,e.value),F.current=L.current.listElementRef.current,x.current=e.direction},className:"p-picklist-target-controls",dataKey:a.dataKey}))})));I.displayName="PickList",I.defaultProps={__TYPE:"PickList",id:null,source:null,target:null,sourceHeader:null,targetHeader:null,style:null,className:null,sourceStyle:null,targetStyle:null,sourceSelection:null,targetSelection:null,showSourceControls:!0,showTargetControls:!0,metaKeySelection:!0,filterBy:null,filterMatchMode:"contains",filterLocale:void 0,sourceFilterValue:null,targetFilterValue:null,showSourceFilter:!0,showTargetFilter:!0,sourceFilterPlaceholder:null,targetFilterPlaceholder:null,sourceFilterTemplate:null,targetFilterTemplate:null,tabIndex:0,dataKey:null,itemTemplate:null,sourceItemTemplate:null,targetItemTemplate:null,onChange:null,onMoveToSource:null,onMoveAllToSource:null,onMoveToTarget:null,onMoveAllToTarget:null,onSourceSelectionChange:null,onTargetSelectionChange:null,onSourceFilterChange:null,onTargetFilterChange:null};export{I as PickList};