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