primereact 7.1.0 → 7.2.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 (667) hide show
  1. package/LICENSE.md +1 -1
  2. package/accordion/accordion.cjs.js +15 -15
  3. package/accordion/accordion.cjs.min.js +1 -1
  4. package/accordion/accordion.esm.js +15 -15
  5. package/accordion/accordion.esm.min.js +1 -1
  6. package/accordion/accordion.js +15 -15
  7. package/accordion/accordion.min.js +1 -1
  8. package/api/api.cjs.js +27 -6
  9. package/api/api.cjs.min.js +1 -1
  10. package/api/api.d.ts +1 -0
  11. package/api/api.esm.js +27 -6
  12. package/api/api.esm.min.js +1 -1
  13. package/api/api.js +27 -6
  14. package/api/api.min.js +1 -1
  15. package/autocomplete/autocomplete.cjs.js +18 -18
  16. package/autocomplete/autocomplete.cjs.min.js +1 -1
  17. package/autocomplete/autocomplete.esm.js +18 -18
  18. package/autocomplete/autocomplete.esm.min.js +1 -1
  19. package/autocomplete/autocomplete.js +18 -18
  20. package/autocomplete/autocomplete.min.js +1 -1
  21. package/avatar/avatar.cjs.js +11 -11
  22. package/avatar/avatar.cjs.min.js +1 -1
  23. package/avatar/avatar.esm.js +11 -11
  24. package/avatar/avatar.esm.min.js +1 -1
  25. package/avatar/avatar.js +11 -11
  26. package/avatar/avatar.min.js +1 -1
  27. package/avatargroup/avatargroup.cjs.js +11 -11
  28. package/avatargroup/avatargroup.cjs.min.js +1 -1
  29. package/avatargroup/avatargroup.esm.js +11 -11
  30. package/avatargroup/avatargroup.esm.min.js +1 -1
  31. package/avatargroup/avatargroup.js +11 -11
  32. package/avatargroup/avatargroup.min.js +1 -1
  33. package/badge/badge.cjs.js +11 -11
  34. package/badge/badge.cjs.min.js +1 -1
  35. package/badge/badge.esm.js +11 -11
  36. package/badge/badge.esm.min.js +1 -1
  37. package/badge/badge.js +11 -11
  38. package/badge/badge.min.js +1 -1
  39. package/blockui/blockui.cjs.js +11 -11
  40. package/blockui/blockui.cjs.min.js +1 -1
  41. package/blockui/blockui.esm.js +11 -11
  42. package/blockui/blockui.esm.min.js +1 -1
  43. package/blockui/blockui.js +11 -11
  44. package/blockui/blockui.min.js +1 -1
  45. package/breadcrumb/breadcrumb.cjs.js +11 -11
  46. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  47. package/breadcrumb/breadcrumb.esm.js +11 -11
  48. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  49. package/breadcrumb/breadcrumb.js +11 -11
  50. package/breadcrumb/breadcrumb.min.js +1 -1
  51. package/button/button.cjs.js +13 -13
  52. package/button/button.cjs.min.js +1 -1
  53. package/button/button.esm.js +13 -13
  54. package/button/button.esm.min.js +1 -1
  55. package/button/button.js +13 -13
  56. package/button/button.min.js +1 -1
  57. package/calendar/calendar.cjs.js +17 -17
  58. package/calendar/calendar.cjs.min.js +1 -1
  59. package/calendar/calendar.esm.js +17 -17
  60. package/calendar/calendar.esm.min.js +1 -1
  61. package/calendar/calendar.js +17 -17
  62. package/calendar/calendar.min.js +1 -1
  63. package/captcha/captcha.cjs.js +11 -11
  64. package/captcha/captcha.cjs.min.js +1 -1
  65. package/captcha/captcha.esm.js +11 -11
  66. package/captcha/captcha.esm.min.js +1 -1
  67. package/captcha/captcha.js +11 -11
  68. package/captcha/captcha.min.js +1 -1
  69. package/card/card.cjs.js +11 -11
  70. package/card/card.cjs.min.js +1 -1
  71. package/card/card.esm.js +11 -11
  72. package/card/card.esm.min.js +1 -1
  73. package/card/card.js +11 -11
  74. package/card/card.min.js +1 -1
  75. package/carousel/carousel.cjs.js +16 -14
  76. package/carousel/carousel.cjs.min.js +1 -1
  77. package/carousel/carousel.esm.js +15 -14
  78. package/carousel/carousel.esm.min.js +1 -1
  79. package/carousel/carousel.js +17 -16
  80. package/carousel/carousel.min.js +1 -1
  81. package/cascadeselect/cascadeselect.cjs.js +14 -14
  82. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  83. package/cascadeselect/cascadeselect.esm.js +14 -14
  84. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  85. package/cascadeselect/cascadeselect.js +14 -14
  86. package/cascadeselect/cascadeselect.min.js +1 -1
  87. package/chart/chart.cjs.js +13 -13
  88. package/chart/chart.cjs.min.js +1 -1
  89. package/chart/chart.esm.js +13 -13
  90. package/chart/chart.esm.min.js +1 -1
  91. package/chart/chart.js +13 -13
  92. package/chart/chart.min.js +1 -1
  93. package/checkbox/checkbox.cjs.js +13 -13
  94. package/checkbox/checkbox.cjs.min.js +1 -1
  95. package/checkbox/checkbox.esm.js +13 -13
  96. package/checkbox/checkbox.esm.min.js +1 -1
  97. package/checkbox/checkbox.js +13 -13
  98. package/checkbox/checkbox.min.js +1 -1
  99. package/chip/chip.cjs.js +11 -11
  100. package/chip/chip.cjs.min.js +1 -1
  101. package/chip/chip.esm.js +11 -11
  102. package/chip/chip.esm.min.js +1 -1
  103. package/chip/chip.js +11 -11
  104. package/chip/chip.min.js +1 -1
  105. package/chips/chips.cjs.js +13 -13
  106. package/chips/chips.cjs.min.js +1 -1
  107. package/chips/chips.esm.js +13 -13
  108. package/chips/chips.esm.min.js +1 -1
  109. package/chips/chips.js +13 -13
  110. package/chips/chips.min.js +1 -1
  111. package/colorpicker/colorpicker.cjs.js +15 -15
  112. package/colorpicker/colorpicker.cjs.min.js +1 -1
  113. package/colorpicker/colorpicker.esm.js +15 -15
  114. package/colorpicker/colorpicker.esm.min.js +1 -1
  115. package/colorpicker/colorpicker.js +15 -15
  116. package/colorpicker/colorpicker.min.js +1 -1
  117. package/column/column.cjs.js +31 -12
  118. package/column/column.cjs.min.js +1 -1
  119. package/column/column.d.ts +4 -0
  120. package/column/column.esm.js +31 -12
  121. package/column/column.esm.min.js +1 -1
  122. package/column/column.js +31 -12
  123. package/column/column.min.js +1 -1
  124. package/columngroup/columngroup.cjs.js +28 -12
  125. package/columngroup/columngroup.cjs.min.js +1 -1
  126. package/columngroup/columngroup.esm.js +28 -12
  127. package/columngroup/columngroup.esm.min.js +1 -1
  128. package/columngroup/columngroup.js +28 -12
  129. package/columngroup/columngroup.min.js +1 -1
  130. package/confirmdialog/confirmdialog.cjs.js +13 -13
  131. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  132. package/confirmdialog/confirmdialog.esm.js +13 -13
  133. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  134. package/confirmdialog/confirmdialog.js +13 -13
  135. package/confirmdialog/confirmdialog.min.js +1 -1
  136. package/confirmpopup/confirmpopup.cjs.js +14 -14
  137. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  138. package/confirmpopup/confirmpopup.esm.js +14 -14
  139. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  140. package/confirmpopup/confirmpopup.js +14 -14
  141. package/confirmpopup/confirmpopup.min.js +1 -1
  142. package/contextmenu/contextmenu.cjs.js +13 -13
  143. package/contextmenu/contextmenu.cjs.min.js +1 -1
  144. package/contextmenu/contextmenu.esm.js +13 -13
  145. package/contextmenu/contextmenu.esm.min.js +1 -1
  146. package/contextmenu/contextmenu.js +13 -13
  147. package/contextmenu/contextmenu.min.js +1 -1
  148. package/core/core.js +326 -276
  149. package/core/core.min.js +18 -18
  150. package/csstransition/csstransition.cjs.js +17 -17
  151. package/csstransition/csstransition.cjs.min.js +1 -1
  152. package/csstransition/csstransition.esm.js +17 -17
  153. package/csstransition/csstransition.esm.min.js +1 -1
  154. package/csstransition/csstransition.js +17 -17
  155. package/csstransition/csstransition.min.js +1 -1
  156. package/datascroller/datascroller.cjs.js +11 -11
  157. package/datascroller/datascroller.cjs.min.js +1 -1
  158. package/datascroller/datascroller.esm.js +11 -11
  159. package/datascroller/datascroller.esm.min.js +1 -1
  160. package/datascroller/datascroller.js +11 -11
  161. package/datascroller/datascroller.min.js +1 -1
  162. package/datatable/datatable.cjs.js +315 -200
  163. package/datatable/datatable.cjs.min.js +1 -1
  164. package/datatable/datatable.d.ts +8 -0
  165. package/datatable/datatable.esm.js +318 -203
  166. package/datatable/datatable.esm.min.js +1 -1
  167. package/datatable/datatable.js +315 -200
  168. package/datatable/datatable.min.css +1 -1
  169. package/datatable/datatable.min.js +1 -1
  170. package/dataview/dataview.cjs.js +11 -11
  171. package/dataview/dataview.cjs.min.js +1 -1
  172. package/dataview/dataview.esm.js +11 -11
  173. package/dataview/dataview.esm.min.js +1 -1
  174. package/dataview/dataview.js +11 -11
  175. package/dataview/dataview.min.js +1 -1
  176. package/deferredcontent/deferredcontent.cjs.js +11 -11
  177. package/deferredcontent/deferredcontent.cjs.min.js +1 -1
  178. package/deferredcontent/deferredcontent.esm.js +11 -11
  179. package/deferredcontent/deferredcontent.esm.min.js +1 -1
  180. package/deferredcontent/deferredcontent.js +11 -11
  181. package/deferredcontent/deferredcontent.min.js +1 -1
  182. package/dialog/dialog.cjs.js +19 -15
  183. package/dialog/dialog.cjs.min.js +1 -1
  184. package/dialog/dialog.esm.js +19 -15
  185. package/dialog/dialog.esm.min.js +1 -1
  186. package/dialog/dialog.js +19 -15
  187. package/dialog/dialog.min.js +1 -1
  188. package/divider/divider.cjs.js +11 -11
  189. package/divider/divider.cjs.min.js +1 -1
  190. package/divider/divider.esm.js +11 -11
  191. package/divider/divider.esm.min.js +1 -1
  192. package/divider/divider.js +11 -11
  193. package/divider/divider.min.js +1 -1
  194. package/dock/dock.cjs.js +11 -11
  195. package/dock/dock.cjs.min.js +1 -1
  196. package/dock/dock.esm.js +11 -11
  197. package/dock/dock.esm.min.js +1 -1
  198. package/dock/dock.js +11 -11
  199. package/dock/dock.min.js +1 -1
  200. package/dropdown/dropdown.cjs.js +21 -21
  201. package/dropdown/dropdown.cjs.min.js +1 -1
  202. package/dropdown/dropdown.esm.js +21 -21
  203. package/dropdown/dropdown.esm.min.js +1 -1
  204. package/dropdown/dropdown.js +21 -21
  205. package/dropdown/dropdown.min.js +1 -1
  206. package/editor/editor.cjs.js +15 -15
  207. package/editor/editor.cjs.min.js +1 -1
  208. package/editor/editor.esm.js +15 -15
  209. package/editor/editor.esm.min.js +1 -1
  210. package/editor/editor.js +15 -15
  211. package/editor/editor.min.js +1 -1
  212. package/fieldset/fieldset.cjs.js +14 -14
  213. package/fieldset/fieldset.cjs.min.js +1 -1
  214. package/fieldset/fieldset.esm.js +14 -14
  215. package/fieldset/fieldset.esm.min.js +1 -1
  216. package/fieldset/fieldset.js +14 -14
  217. package/fieldset/fieldset.min.js +1 -1
  218. package/fileupload/fileupload.cjs.js +16 -13
  219. package/fileupload/fileupload.cjs.min.js +1 -1
  220. package/fileupload/fileupload.d.ts +2 -0
  221. package/fileupload/fileupload.esm.js +16 -13
  222. package/fileupload/fileupload.esm.min.js +1 -1
  223. package/fileupload/fileupload.js +16 -13
  224. package/fileupload/fileupload.min.js +1 -1
  225. package/fullcalendar/fullcalendar.cjs.js +11 -11
  226. package/fullcalendar/fullcalendar.cjs.min.js +1 -1
  227. package/fullcalendar/fullcalendar.esm.js +11 -11
  228. package/fullcalendar/fullcalendar.esm.min.js +1 -1
  229. package/fullcalendar/fullcalendar.js +11 -11
  230. package/fullcalendar/fullcalendar.min.js +1 -1
  231. package/galleria/galleria.cjs.js +16 -16
  232. package/galleria/galleria.cjs.min.js +1 -1
  233. package/galleria/galleria.esm.js +16 -16
  234. package/galleria/galleria.esm.min.js +1 -1
  235. package/galleria/galleria.js +17 -17
  236. package/galleria/galleria.min.js +1 -1
  237. package/gmap/gmap.cjs.js +12 -12
  238. package/gmap/gmap.cjs.min.js +1 -1
  239. package/gmap/gmap.esm.js +12 -12
  240. package/gmap/gmap.esm.min.js +1 -1
  241. package/gmap/gmap.js +12 -12
  242. package/gmap/gmap.min.js +1 -1
  243. package/image/image.cjs.js +39 -18
  244. package/image/image.cjs.min.js +1 -1
  245. package/image/image.d.ts +1 -0
  246. package/image/image.esm.js +40 -19
  247. package/image/image.esm.min.js +1 -1
  248. package/image/image.js +39 -18
  249. package/image/image.min.js +1 -1
  250. package/inplace/inplace.cjs.js +11 -11
  251. package/inplace/inplace.cjs.min.js +1 -1
  252. package/inplace/inplace.esm.js +11 -11
  253. package/inplace/inplace.esm.min.js +1 -1
  254. package/inplace/inplace.js +11 -11
  255. package/inplace/inplace.min.js +1 -1
  256. package/inputmask/inputmask.cjs.js +13 -13
  257. package/inputmask/inputmask.cjs.min.js +1 -1
  258. package/inputmask/inputmask.esm.js +13 -13
  259. package/inputmask/inputmask.esm.min.js +1 -1
  260. package/inputmask/inputmask.js +13 -13
  261. package/inputmask/inputmask.min.js +1 -1
  262. package/inputnumber/inputnumber.cjs.js +32 -29
  263. package/inputnumber/inputnumber.cjs.min.js +1 -1
  264. package/inputnumber/inputnumber.esm.js +32 -29
  265. package/inputnumber/inputnumber.esm.min.js +1 -1
  266. package/inputnumber/inputnumber.js +32 -29
  267. package/inputnumber/inputnumber.min.js +1 -1
  268. package/inputswitch/inputswitch.cjs.js +13 -13
  269. package/inputswitch/inputswitch.cjs.min.js +1 -1
  270. package/inputswitch/inputswitch.esm.js +13 -13
  271. package/inputswitch/inputswitch.esm.min.js +1 -1
  272. package/inputswitch/inputswitch.js +13 -13
  273. package/inputswitch/inputswitch.min.js +1 -1
  274. package/inputtext/inputtext.cjs.js +13 -13
  275. package/inputtext/inputtext.cjs.min.js +1 -1
  276. package/inputtext/inputtext.esm.js +13 -13
  277. package/inputtext/inputtext.esm.min.js +1 -1
  278. package/inputtext/inputtext.js +13 -13
  279. package/inputtext/inputtext.min.js +1 -1
  280. package/inputtextarea/inputtextarea.cjs.js +13 -13
  281. package/inputtextarea/inputtextarea.cjs.min.js +1 -1
  282. package/inputtextarea/inputtextarea.esm.js +13 -13
  283. package/inputtextarea/inputtextarea.esm.min.js +1 -1
  284. package/inputtextarea/inputtextarea.js +13 -13
  285. package/inputtextarea/inputtextarea.min.js +1 -1
  286. package/keyfilter/keyfilter.cjs.js +4 -1
  287. package/keyfilter/keyfilter.cjs.min.js +1 -1
  288. package/keyfilter/keyfilter.esm.js +4 -1
  289. package/keyfilter/keyfilter.esm.min.js +1 -1
  290. package/keyfilter/keyfilter.js +4 -1
  291. package/keyfilter/keyfilter.min.js +1 -1
  292. package/knob/knob.cjs.js +11 -11
  293. package/knob/knob.cjs.min.js +1 -1
  294. package/knob/knob.esm.js +11 -11
  295. package/knob/knob.esm.min.js +1 -1
  296. package/knob/knob.js +11 -11
  297. package/knob/knob.min.js +1 -1
  298. package/listbox/listbox.cjs.js +14 -14
  299. package/listbox/listbox.cjs.min.js +1 -1
  300. package/listbox/listbox.esm.js +14 -14
  301. package/listbox/listbox.esm.min.js +1 -1
  302. package/listbox/listbox.js +14 -14
  303. package/listbox/listbox.min.js +1 -1
  304. package/megamenu/megamenu.cjs.js +11 -11
  305. package/megamenu/megamenu.cjs.min.js +1 -1
  306. package/megamenu/megamenu.esm.js +11 -11
  307. package/megamenu/megamenu.esm.min.js +1 -1
  308. package/megamenu/megamenu.js +11 -11
  309. package/megamenu/megamenu.min.js +1 -1
  310. package/mention/mention.cjs.js +16 -16
  311. package/mention/mention.cjs.min.js +1 -1
  312. package/mention/mention.esm.js +16 -16
  313. package/mention/mention.esm.min.js +1 -1
  314. package/mention/mention.js +16 -16
  315. package/mention/mention.min.js +1 -1
  316. package/menu/menu.cjs.js +12 -12
  317. package/menu/menu.cjs.min.js +1 -1
  318. package/menu/menu.esm.js +12 -12
  319. package/menu/menu.esm.min.js +1 -1
  320. package/menu/menu.js +12 -12
  321. package/menu/menu.min.js +1 -1
  322. package/menubar/menubar.cjs.js +11 -11
  323. package/menubar/menubar.cjs.min.js +1 -1
  324. package/menubar/menubar.esm.js +11 -11
  325. package/menubar/menubar.esm.min.js +1 -1
  326. package/menubar/menubar.js +11 -11
  327. package/menubar/menubar.min.js +1 -1
  328. package/message/message.cjs.js +11 -11
  329. package/message/message.cjs.min.js +1 -1
  330. package/message/message.esm.js +11 -11
  331. package/message/message.esm.min.js +1 -1
  332. package/message/message.js +11 -11
  333. package/message/message.min.js +1 -1
  334. package/messages/messages.cjs.js +11 -11
  335. package/messages/messages.cjs.min.js +1 -1
  336. package/messages/messages.esm.js +11 -11
  337. package/messages/messages.esm.min.js +1 -1
  338. package/messages/messages.js +11 -11
  339. package/messages/messages.min.js +1 -1
  340. package/multiselect/multiselect.cjs.js +20 -20
  341. package/multiselect/multiselect.cjs.min.js +1 -1
  342. package/multiselect/multiselect.esm.js +20 -20
  343. package/multiselect/multiselect.esm.min.js +1 -1
  344. package/multiselect/multiselect.js +20 -20
  345. package/multiselect/multiselect.min.js +1 -1
  346. package/multistatecheckbox/multistatecheckbox.cjs.js +13 -13
  347. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  348. package/multistatecheckbox/multistatecheckbox.esm.js +13 -13
  349. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  350. package/multistatecheckbox/multistatecheckbox.js +13 -13
  351. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  352. package/orderlist/orderlist.cjs.js +11 -11
  353. package/orderlist/orderlist.cjs.min.js +1 -1
  354. package/orderlist/orderlist.esm.js +11 -11
  355. package/orderlist/orderlist.esm.min.js +1 -1
  356. package/orderlist/orderlist.js +11 -11
  357. package/orderlist/orderlist.min.js +1 -1
  358. package/organizationchart/organizationchart.cjs.js +11 -11
  359. package/organizationchart/organizationchart.cjs.min.js +1 -1
  360. package/organizationchart/organizationchart.esm.js +11 -11
  361. package/organizationchart/organizationchart.esm.min.js +1 -1
  362. package/organizationchart/organizationchart.js +11 -11
  363. package/organizationchart/organizationchart.min.js +1 -1
  364. package/overlaypanel/overlaypanel.cjs.js +13 -13
  365. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  366. package/overlaypanel/overlaypanel.esm.js +13 -13
  367. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  368. package/overlaypanel/overlaypanel.js +13 -13
  369. package/overlaypanel/overlaypanel.min.js +1 -1
  370. package/package.json +1 -1
  371. package/paginator/paginator.cjs.js +13 -13
  372. package/paginator/paginator.cjs.min.js +1 -1
  373. package/paginator/paginator.esm.js +13 -13
  374. package/paginator/paginator.esm.min.js +1 -1
  375. package/paginator/paginator.js +13 -13
  376. package/paginator/paginator.min.js +1 -1
  377. package/panel/panel.cjs.js +14 -14
  378. package/panel/panel.cjs.min.js +1 -1
  379. package/panel/panel.esm.js +14 -14
  380. package/panel/panel.esm.min.js +1 -1
  381. package/panel/panel.js +14 -14
  382. package/panel/panel.min.js +1 -1
  383. package/panelmenu/panelmenu.cjs.js +13 -13
  384. package/panelmenu/panelmenu.cjs.min.js +1 -1
  385. package/panelmenu/panelmenu.esm.js +13 -13
  386. package/panelmenu/panelmenu.esm.min.js +1 -1
  387. package/panelmenu/panelmenu.js +13 -13
  388. package/panelmenu/panelmenu.min.js +1 -1
  389. package/password/password.cjs.js +14 -14
  390. package/password/password.cjs.min.js +1 -1
  391. package/password/password.esm.js +14 -14
  392. package/password/password.esm.min.js +1 -1
  393. package/password/password.js +14 -14
  394. package/password/password.min.js +1 -1
  395. package/picklist/picklist.cjs.js +11 -11
  396. package/picklist/picklist.cjs.min.js +1 -1
  397. package/picklist/picklist.esm.js +11 -11
  398. package/picklist/picklist.esm.min.js +1 -1
  399. package/picklist/picklist.js +11 -11
  400. package/picklist/picklist.min.js +1 -1
  401. package/portal/portal.cjs.js +13 -12
  402. package/portal/portal.cjs.min.js +1 -1
  403. package/portal/portal.esm.js +13 -12
  404. package/portal/portal.esm.min.js +1 -1
  405. package/portal/portal.js +13 -12
  406. package/portal/portal.min.js +1 -1
  407. package/primereact.all.cjs.js +642 -424
  408. package/primereact.all.cjs.min.js +1 -1
  409. package/primereact.all.esm.js +642 -424
  410. package/primereact.all.esm.min.js +1 -1
  411. package/primereact.all.js +642 -424
  412. package/primereact.all.min.js +1 -1
  413. package/progressbar/progressbar.cjs.js +11 -11
  414. package/progressbar/progressbar.cjs.min.js +1 -1
  415. package/progressbar/progressbar.esm.js +11 -11
  416. package/progressbar/progressbar.esm.min.js +1 -1
  417. package/progressbar/progressbar.js +11 -11
  418. package/progressbar/progressbar.min.js +1 -1
  419. package/progressspinner/progressspinner.cjs.js +11 -11
  420. package/progressspinner/progressspinner.cjs.min.js +1 -1
  421. package/progressspinner/progressspinner.esm.js +11 -11
  422. package/progressspinner/progressspinner.esm.min.js +1 -1
  423. package/progressspinner/progressspinner.js +11 -11
  424. package/progressspinner/progressspinner.min.js +1 -1
  425. package/radiobutton/radiobutton.cjs.js +13 -13
  426. package/radiobutton/radiobutton.cjs.min.js +1 -1
  427. package/radiobutton/radiobutton.esm.js +13 -13
  428. package/radiobutton/radiobutton.esm.min.js +1 -1
  429. package/radiobutton/radiobutton.js +13 -13
  430. package/radiobutton/radiobutton.min.js +1 -1
  431. package/rating/rating.cjs.js +13 -13
  432. package/rating/rating.cjs.min.js +1 -1
  433. package/rating/rating.esm.js +13 -13
  434. package/rating/rating.esm.min.js +1 -1
  435. package/rating/rating.js +13 -13
  436. package/rating/rating.min.js +1 -1
  437. package/resources/primereact.css +328 -305
  438. package/resources/primereact.min.css +1 -1
  439. package/resources/themes/arya-blue/theme.css +56 -24
  440. package/resources/themes/arya-green/theme.css +56 -24
  441. package/resources/themes/arya-orange/theme.css +56 -24
  442. package/resources/themes/arya-purple/theme.css +56 -24
  443. package/resources/themes/bootstrap4-dark-blue/theme.css +33 -8
  444. package/resources/themes/bootstrap4-dark-purple/theme.css +33 -8
  445. package/resources/themes/bootstrap4-light-blue/theme.css +32 -7
  446. package/resources/themes/bootstrap4-light-purple/theme.css +32 -7
  447. package/resources/themes/fluent-light/theme.css +56 -24
  448. package/resources/themes/lara-dark-blue/theme.css +400 -368
  449. package/resources/themes/lara-dark-indigo/theme.css +400 -368
  450. package/resources/themes/lara-dark-purple/theme.css +400 -368
  451. package/resources/themes/lara-dark-teal/theme.css +400 -368
  452. package/resources/themes/lara-light-blue/theme.css +56 -24
  453. package/resources/themes/lara-light-indigo/theme.css +56 -24
  454. package/resources/themes/lara-light-purple/theme.css +56 -24
  455. package/resources/themes/lara-light-teal/theme.css +56 -24
  456. package/resources/themes/luna-amber/theme.css +49 -24
  457. package/resources/themes/luna-blue/theme.css +49 -24
  458. package/resources/themes/luna-green/theme.css +49 -24
  459. package/resources/themes/luna-pink/theme.css +49 -24
  460. package/resources/themes/md-dark-deeppurple/theme.css +38 -6
  461. package/resources/themes/md-dark-indigo/theme.css +38 -6
  462. package/resources/themes/md-light-deeppurple/theme.css +38 -6
  463. package/resources/themes/md-light-indigo/theme.css +38 -6
  464. package/resources/themes/mdc-dark-deeppurple/theme.css +38 -6
  465. package/resources/themes/mdc-dark-indigo/theme.css +38 -6
  466. package/resources/themes/mdc-light-deeppurple/theme.css +38 -6
  467. package/resources/themes/mdc-light-indigo/theme.css +38 -6
  468. package/resources/themes/nova/theme.css +49 -24
  469. package/resources/themes/nova-accent/theme.css +49 -24
  470. package/resources/themes/nova-alt/theme.css +49 -24
  471. package/resources/themes/rhea/theme.css +49 -24
  472. package/resources/themes/saga-blue/theme.css +39 -7
  473. package/resources/themes/saga-green/theme.css +39 -7
  474. package/resources/themes/saga-orange/theme.css +39 -7
  475. package/resources/themes/saga-purple/theme.css +39 -7
  476. package/resources/themes/tailwind-light/theme.css +59 -27
  477. package/resources/themes/vela-blue/theme.css +56 -24
  478. package/resources/themes/vela-green/theme.css +56 -24
  479. package/resources/themes/vela-orange/theme.css +56 -24
  480. package/resources/themes/vela-purple/theme.css +56 -24
  481. package/ripple/ripple.cjs.js +11 -11
  482. package/ripple/ripple.cjs.min.js +1 -1
  483. package/ripple/ripple.esm.js +11 -11
  484. package/ripple/ripple.esm.min.js +1 -1
  485. package/ripple/ripple.js +11 -11
  486. package/ripple/ripple.min.js +1 -1
  487. package/row/row.cjs.js +11 -11
  488. package/row/row.cjs.min.js +1 -1
  489. package/row/row.esm.js +11 -11
  490. package/row/row.esm.min.js +1 -1
  491. package/row/row.js +11 -11
  492. package/row/row.min.js +1 -1
  493. package/scrollpanel/scrollpanel.cjs.js +11 -11
  494. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  495. package/scrollpanel/scrollpanel.esm.js +11 -11
  496. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  497. package/scrollpanel/scrollpanel.js +11 -11
  498. package/scrollpanel/scrollpanel.min.js +1 -1
  499. package/scrolltop/scrolltop.cjs.js +12 -12
  500. package/scrolltop/scrolltop.cjs.min.js +1 -1
  501. package/scrolltop/scrolltop.esm.js +12 -12
  502. package/scrolltop/scrolltop.esm.min.js +1 -1
  503. package/scrolltop/scrolltop.js +12 -12
  504. package/scrolltop/scrolltop.min.js +1 -1
  505. package/selectbutton/selectbutton.cjs.js +14 -14
  506. package/selectbutton/selectbutton.cjs.min.js +1 -1
  507. package/selectbutton/selectbutton.esm.js +14 -14
  508. package/selectbutton/selectbutton.esm.min.js +1 -1
  509. package/selectbutton/selectbutton.js +14 -14
  510. package/selectbutton/selectbutton.min.js +1 -1
  511. package/sidebar/sidebar.cjs.js +14 -13
  512. package/sidebar/sidebar.cjs.min.js +1 -1
  513. package/sidebar/sidebar.esm.js +14 -13
  514. package/sidebar/sidebar.esm.min.js +1 -1
  515. package/sidebar/sidebar.js +14 -13
  516. package/sidebar/sidebar.min.js +1 -1
  517. package/skeleton/skeleton.cjs.js +11 -11
  518. package/skeleton/skeleton.cjs.min.js +1 -1
  519. package/skeleton/skeleton.esm.js +11 -11
  520. package/skeleton/skeleton.esm.min.js +1 -1
  521. package/skeleton/skeleton.js +11 -11
  522. package/skeleton/skeleton.min.js +1 -1
  523. package/slidemenu/slidemenu.cjs.js +12 -12
  524. package/slidemenu/slidemenu.cjs.min.js +1 -1
  525. package/slidemenu/slidemenu.esm.js +12 -12
  526. package/slidemenu/slidemenu.esm.min.js +1 -1
  527. package/slidemenu/slidemenu.js +12 -12
  528. package/slidemenu/slidemenu.min.js +1 -1
  529. package/slider/slider.cjs.js +11 -11
  530. package/slider/slider.cjs.min.js +1 -1
  531. package/slider/slider.esm.js +11 -11
  532. package/slider/slider.esm.min.js +1 -1
  533. package/slider/slider.js +11 -11
  534. package/slider/slider.min.js +1 -1
  535. package/speeddial/speeddial.cjs.js +13 -13
  536. package/speeddial/speeddial.cjs.min.js +1 -1
  537. package/speeddial/speeddial.esm.js +13 -13
  538. package/speeddial/speeddial.esm.min.js +1 -1
  539. package/speeddial/speeddial.js +13 -13
  540. package/speeddial/speeddial.min.js +1 -1
  541. package/splitbutton/splitbutton.cjs.js +15 -15
  542. package/splitbutton/splitbutton.cjs.min.js +1 -1
  543. package/splitbutton/splitbutton.esm.js +15 -15
  544. package/splitbutton/splitbutton.esm.min.js +1 -1
  545. package/splitbutton/splitbutton.js +15 -15
  546. package/splitbutton/splitbutton.min.js +1 -1
  547. package/splitter/splitter.cjs.js +12 -12
  548. package/splitter/splitter.cjs.min.js +1 -1
  549. package/splitter/splitter.esm.js +12 -12
  550. package/splitter/splitter.esm.min.js +1 -1
  551. package/splitter/splitter.js +12 -12
  552. package/splitter/splitter.min.js +1 -1
  553. package/steps/steps.cjs.js +11 -11
  554. package/steps/steps.cjs.min.js +1 -1
  555. package/steps/steps.esm.js +11 -11
  556. package/steps/steps.esm.min.js +1 -1
  557. package/steps/steps.js +11 -11
  558. package/steps/steps.min.js +1 -1
  559. package/styleclass/styleclass.cjs.js +11 -11
  560. package/styleclass/styleclass.cjs.min.js +1 -1
  561. package/styleclass/styleclass.esm.js +11 -11
  562. package/styleclass/styleclass.esm.min.js +1 -1
  563. package/styleclass/styleclass.js +11 -11
  564. package/styleclass/styleclass.min.js +1 -1
  565. package/tabmenu/tabmenu.cjs.js +11 -11
  566. package/tabmenu/tabmenu.cjs.min.js +1 -1
  567. package/tabmenu/tabmenu.esm.js +11 -11
  568. package/tabmenu/tabmenu.esm.min.js +1 -1
  569. package/tabmenu/tabmenu.js +11 -11
  570. package/tabmenu/tabmenu.min.js +1 -1
  571. package/tabview/tabview.cjs.js +35 -28
  572. package/tabview/tabview.cjs.min.js +1 -1
  573. package/tabview/tabview.esm.js +35 -28
  574. package/tabview/tabview.esm.min.js +1 -1
  575. package/tabview/tabview.js +35 -28
  576. package/tabview/tabview.min.js +1 -1
  577. package/tag/tag.cjs.js +11 -11
  578. package/tag/tag.cjs.min.js +1 -1
  579. package/tag/tag.esm.js +11 -11
  580. package/tag/tag.esm.min.js +1 -1
  581. package/tag/tag.js +11 -11
  582. package/tag/tag.min.js +1 -1
  583. package/terminal/terminal.cjs.js +11 -11
  584. package/terminal/terminal.cjs.min.js +1 -1
  585. package/terminal/terminal.esm.js +11 -11
  586. package/terminal/terminal.esm.min.js +1 -1
  587. package/terminal/terminal.js +11 -11
  588. package/terminal/terminal.min.js +1 -1
  589. package/tieredmenu/tieredmenu.cjs.js +12 -12
  590. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  591. package/tieredmenu/tieredmenu.esm.js +12 -12
  592. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  593. package/tieredmenu/tieredmenu.js +12 -12
  594. package/tieredmenu/tieredmenu.min.js +1 -1
  595. package/timeline/timeline.cjs.js +11 -11
  596. package/timeline/timeline.cjs.min.js +1 -1
  597. package/timeline/timeline.esm.js +11 -11
  598. package/timeline/timeline.esm.min.js +1 -1
  599. package/timeline/timeline.js +11 -11
  600. package/timeline/timeline.min.js +1 -1
  601. package/toast/toast.cjs.js +26 -15
  602. package/toast/toast.cjs.min.js +1 -1
  603. package/toast/toast.d.ts +3 -0
  604. package/toast/toast.esm.js +26 -15
  605. package/toast/toast.esm.min.js +1 -1
  606. package/toast/toast.js +27 -17
  607. package/toast/toast.min.js +1 -1
  608. package/togglebutton/togglebutton.cjs.js +13 -13
  609. package/togglebutton/togglebutton.cjs.min.js +1 -1
  610. package/togglebutton/togglebutton.esm.js +13 -13
  611. package/togglebutton/togglebutton.esm.min.js +1 -1
  612. package/togglebutton/togglebutton.js +13 -13
  613. package/togglebutton/togglebutton.min.js +1 -1
  614. package/toolbar/toolbar.cjs.js +11 -11
  615. package/toolbar/toolbar.cjs.min.js +1 -1
  616. package/toolbar/toolbar.esm.js +11 -11
  617. package/toolbar/toolbar.esm.min.js +1 -1
  618. package/toolbar/toolbar.js +11 -11
  619. package/toolbar/toolbar.min.js +1 -1
  620. package/tooltip/tooltip.cjs.js +13 -13
  621. package/tooltip/tooltip.cjs.min.js +1 -1
  622. package/tooltip/tooltip.esm.js +13 -13
  623. package/tooltip/tooltip.esm.min.js +1 -1
  624. package/tooltip/tooltip.js +13 -13
  625. package/tooltip/tooltip.min.js +1 -1
  626. package/tree/tree.cjs.js +17 -17
  627. package/tree/tree.cjs.min.js +1 -1
  628. package/tree/tree.esm.js +17 -17
  629. package/tree/tree.esm.min.js +1 -1
  630. package/tree/tree.js +17 -17
  631. package/tree/tree.min.js +1 -1
  632. package/treenode/treenode.d.ts +1 -0
  633. package/treeselect/treeselect.cjs.js +16 -16
  634. package/treeselect/treeselect.cjs.min.js +1 -1
  635. package/treeselect/treeselect.esm.js +16 -16
  636. package/treeselect/treeselect.esm.min.js +1 -1
  637. package/treeselect/treeselect.js +16 -16
  638. package/treeselect/treeselect.min.js +1 -1
  639. package/treetable/treetable.cjs.js +60 -48
  640. package/treetable/treetable.cjs.min.js +1 -1
  641. package/treetable/treetable.d.ts +1 -0
  642. package/treetable/treetable.esm.js +60 -48
  643. package/treetable/treetable.esm.min.js +1 -1
  644. package/treetable/treetable.js +60 -48
  645. package/treetable/treetable.min.css +1 -1
  646. package/treetable/treetable.min.js +1 -1
  647. package/tristatecheckbox/tristatecheckbox.cjs.js +13 -13
  648. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  649. package/tristatecheckbox/tristatecheckbox.esm.js +13 -13
  650. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  651. package/tristatecheckbox/tristatecheckbox.js +13 -13
  652. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  653. package/utils/utils.cjs.js +43 -41
  654. package/utils/utils.cjs.min.js +1 -1
  655. package/utils/utils.d.ts +1 -0
  656. package/utils/utils.esm.js +43 -41
  657. package/utils/utils.esm.min.js +1 -1
  658. package/utils/utils.js +43 -41
  659. package/utils/utils.min.js +1 -1
  660. package/virtualscroller/virtualscroller.cjs.js +35 -19
  661. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  662. package/virtualscroller/virtualscroller.esm.js +35 -19
  663. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  664. package/virtualscroller/virtualscroller.js +35 -19
  665. package/virtualscroller/virtualscroller.min.css +1 -1
  666. package/virtualscroller/virtualscroller.min.js +1 -1
  667. package/web-types.json +44 -7
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/utils");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function p(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function f(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?f(Object(o),!0).forEach((function(e){p(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var v=function(o){a(y,t.Component);var l,c,p,f,v,g=(l=y,c=m(),function(){var t,e=h(l);if(c){var o=h(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return u(this,t)});function y(t){var e;r(this,y);var o=(e=g.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(n(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return p=y,f=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.state.numToleratedItems,l=this.props.itemSize,a=this.getContentPosition(),c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},u=function(t,e,o){return t*e+o},h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var p={rows:c(t[0],n[0]),cols:c(t[1],n[1])};p.rows===i.rows&&p.cols===i.cols||(h(u(p.cols,l[1],a.left),u(p.rows,l[0],a.top)),this.setState({first:p}))}else{var f=c(t,n);f!==i&&(r?h(u(f,l,a.left),0):h(0,u(f,l,a.top)),this.setState({first:f}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),l=n.first,a=n.viewport,c=this.props.itemSize,u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o.scrollTo({left:t,top:e,behavior:s})},h="to-start"===e,p="to-end"===e;if(h){if(r)a.first.rows-l.rows>t[0]?u(a.first.cols*c,(a.first.rows-1)*c):a.first.cols-l.cols>t[1]&&u((a.first.cols-1)*c,a.first.rows*c);else if(a.first-l>t){var f=(a.first-1)*c;i?u(f,0):u(0,f)}}else if(p)if(r)a.last.rows-l.rows<=t[0]+1?u(a.first.cols*c,(a.first.rows+1)*c):a.last.cols-l.cols<=t[1]+1&&u((a.first.cols+1)*c,a.first.rows*c);else if(a.last-l<=t+1){var d=(a.first+1)*c;i?u(d,0):u(0,d)}}else this.scrollToIndex(t,s)}},{key:"getRows",value:function(){return this.state.loading?this.props.loaderDisabled?this.state.loaderArr:[]:this.loadedItems()}},{key:"getColumns",value:function(){if(this.props.columns){var t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.state.loading&&this.props.loaderDisabled?t?this.state.loaderArr[0]:this.state.loaderArr:this.props.columns.slice(t?this.state.first.cols:this.state.first,t?this.state.last.cols:this.state.last)}return this.props.columns}},{key:"getRenderedRange",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.state,s=o.first,r=o.last,i=o.numItemsInViewport,n=this.props.itemSize,l=function(t,e){return Math.floor(t/(e||t))},a=s,c=0;if(this.el){var u=this.el.scrollTop,h=this.el.scrollLeft;c=t?{rows:(a={rows:l(u,n[0]),cols:l(h,n[1])}).rows+i.rows,cols:a.cols+i.cols}:(a=l(e?h:u,n))+i}return{first:s,last:r,viewport:{first:a,last:c}}}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isBoth",value:function(){return"both"===this.props.orientation}},{key:"calculateOptions",value:function(){var t=this,e=this.isBoth(),o=this.isHorizontal(),s=this.state.first,r=this.props.itemSize,i=this.getContentPosition(),n=this.el?this.el.offsetWidth-i.left:0,l=this.el?this.el.offsetHeight-i.top:0,a=function(t,e){return Math.ceil(t/(e||t))},c=function(t){return Math.ceil(t/2)},u=e?{rows:a(l,r[0]),cols:a(n,r[1])}:a(o?n:l,r),h=this.state.numToleratedItems||(e?[c(u.rows),c(u.cols)]:c(u)),p=function(e,o,s,r){return t.getLast(e+o+(e<s?2:3)*s,r)},f=e?{rows:p(s.rows,u.rows,h[0]),cols:p(s.cols,u.cols,h[1],!0)}:p(s,u,h),d={numItemsInViewport:u,last:f,numToleratedItems:h};this.props.showLoader&&(d.loaderArr=e?Array.from({length:u.rows}).map((function(){return Array.from({length:u.cols})})):Array.from({length:u})),this.setState(d,(function(){t.props.lazy&&t.props.onLazyLoad&&t.props.onLazyLoad({first:t.state.first,last:t.state.last})}))}},{key:"getLast",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.props.items?Math.min(e?(this.props.columns||this.props.items[0]).length:this.props.items.length,t):0}},{key:"getContentPosition",value:function(){if(this.content){var t=getComputedStyle(this.content),e=parseInt(t.paddingLeft,10)+Math.max(parseInt(t.left,10),0),o=parseInt(t.paddingRight,10)+Math.max(parseInt(t.right,10),0),s=parseInt(t.paddingTop,10)+Math.max(parseInt(t.top,10),0),r=parseInt(t.paddingBottom,10)+Math.max(parseInt(t.bottom,10),0);return{left:e,right:o,top:s,bottom:r,x:e+o,y:s+r}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}}},{key:"setSize",value:function(){var t=this;if(this.el){var e=this.isBoth(),o=this.isHorizontal(),s=this.el.parentElement,r=this.props.scrollWidth||"".concat(this.el.offsetWidth||s.offsetWidth,"px"),i=this.props.scrollHeight||"".concat(this.el.offsetHeight||s.offsetHeight,"px"),n=function(e,o){return t.el.style[e]=o};e||o?(n("height",i),n("width",r)):n("height",i)}}},{key:"setSpacerSize",value:function(){var t=this,e=this.props.items;if(this.spacer&&e){var o=this.isBoth(),s=this.isHorizontal(),r=this.props.itemSize,i=this.getContentPosition(),n=function(e,o,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.spacer.style[e]=(o||[]).length*s+r+"px"};o?(n("height",e,r[0],i.y),n("width",this.props.columns||e[1],r[1],i.x)):s?n("width",this.props.columns||e,r,i.x):n("height",e,r,i.y)}}},{key:"setContentPosition",value:function(t){var e=this;if(this.content){var o=this.isBoth(),s=this.isHorizontal(),r=t?t.first:this.state.first,i=this.props.itemSize,n=function(t,e){return t*e},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.sticky&&(e.sticky.style.top="-".concat(o,"px")),e.content.style.transform="translate3d(".concat(t,"px, ").concat(o,"px, 0)")};if(o)l(n(r.cols,i[1]),n(r.rows,i[0]));else{var a=n(r,i);s?l(a,0):l(0,a)}}}},{key:"onScrollPositionChange",value:function(t){var e=this,o=t.target,s=this.isBoth(),r=this.isHorizontal(),i=this.state,n=i.first,l=i.last,a=i.numItemsInViewport,c=i.numToleratedItems,u=this.props.itemSize,h=this.getContentPosition(),p=function(t,e){return t?t>e?t-e:t:0},f=function(t,e){return Math.floor(t/(e||t))},d=function(t,e,o,s,r,i){return t<=r?r:i?o-s-r:e+r-1},m=function(t,e,o,s,r,i,n){return t<=i?0:Math.max(0,n?t<e?o:t-i:t>e?o:t-2*i)},v=function(t,o,s,r,i,n){var l=o+r+2*i;return t>=i&&(l+=i+1),e.getLast(l,n)},g=p(o.scrollTop,h.top),y=p(o.scrollLeft,h.left),w=0,S=l,b=!1;if(s){var O=this.lastScrollPos.top<=g,I=this.lastScrollPos.left<=y,z={rows:f(g,u[0]),cols:f(y,u[1])},k={rows:d(z.rows,n.rows,l.rows,a.rows,c[0],O),cols:d(z.cols,n.cols,l.cols,a.cols,c[1],I)};w={rows:m(z.rows,k.rows,n.rows,0,0,c[0],O),cols:m(z.cols,k.cols,n.cols,0,0,c[1],I)},S={rows:v(z.rows,w.rows,0,a.rows,c[0]),cols:v(z.cols,w.cols,0,a.cols,c[1],!0)},b=w.rows!==n.rows&&S.rows!==l.rows||w.cols!==n.cols&&S.cols!==l.cols,this.lastScrollPos={top:g,left:y}}else{var P=r?y:g,T=this.lastScrollPos<=P,C=f(P,u);S=v(C,w=m(C,d(C,n,l,a,c,T),n,0,0,c,T),0,a,c),b=w!==n&&S!==l,this.lastScrollPos=P}return{first:w,last:S,isRangeChanged:b}}},{key:"onScrollChange",value:function(t){var e=this,o=this.onScrollPositionChange(t);if(o.isRangeChanged){var s={first:o.first,last:o.last};this.setContentPosition(s),this.setState(s,(function(){e.props.onScrollIndexChange&&e.props.onScrollIndexChange(s),e.props.lazy&&e.props.onLazyLoad&&e.props.onLazyLoad(s)}))}}},{key:"onScroll",value:function(t){var e=this;this.props.onScroll&&this.props.onScroll(t),this.props.delay?(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.state.loading&&this.props.showLoader&&this.onScrollPositionChange(t).isRangeChanged&&this.setState({loading:!0}),this.scrollTimeout=setTimeout((function(){e.onScrollChange(t),e.state.loading&&e.props.showLoader&&!e.props.lazy&&e.setState({loading:!1})}),this.props.delay)):this.onScrollChange(t)}},{key:"getOptions",value:function(t){var e=this.state.first,o=(this.props.items||[]).length,s=this.isBoth()?e.rows+t:e+t;return{index:s,count:o,first:0===s,last:s===o-1,even:s%2==0,odd:s%2!=0,props:this.props}}},{key:"loaderOptions",value:function(t,e){var o=this.state.loaderArr.length;return d({index:t,count:o,first:0===t,last:t===o-1,even:t%2==0,odd:t%2!=0,props:this.props},e)}},{key:"loadedItems",value:function(){var t=this,e=this.props.items;if(e&&!this.state.loading){var o=this.isBoth(),s=this.isHorizontal(),r=this.state,i=r.first,n=r.last;return o?e.slice(i.rows,n.rows).map((function(e){return t.props.columns?e:e.slice(i.cols,n.cols)})):s&&this.props.columns?e:e.slice(i,n)}return[]}},{key:"isPropChanged",value:function(t){var o=this;return["itemSize","scrollHeight"].some((function(s){return!e.ObjectUtils.equals(t[s],o.props[s])}))}},{key:"init",value:function(){this.setSize(),this.calculateOptions(),this.setSpacerSize()}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(t,e){t.items&&t.items.length===(this.props.items||[]).length&&!this.isPropChanged(t)||this.init(),this.props.lazy&&t.loading!==this.props.loading&&this.state.loading!==this.props.loading&&this.setState({loading:this.props.loading}),t.orientation!==this.props.orientation&&(this.lastScrollPos=this.isBoth()?{top:0,left:0}:0)}},{key:"renderLoaderItem",value:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.loaderOptions(t,o),i=e.ObjectUtils.getJSXElement(this.props.loadingTemplate,r);return s.default.createElement(s.default.Fragment,{key:t},i)}},{key:"renderLoader",value:function(){var t=this;if(!this.props.loaderDisabled&&this.props.showLoader&&this.state.loading){var o=e.classNames("p-virtualscroller-loader",{"p-component-overlay":!this.props.loadingTemplate}),r=s.default.createElement("i",{className:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"});if(this.props.loadingTemplate){var i=this.isBoth(),n=this.state.numItemsInViewport;r=this.state.loaderArr.map((function(e,o){return t.renderLoaderItem(o,i&&{numCols:n.cols})}))}return s.default.createElement("div",{className:o},r)}return null}},{key:"renderSpacer",value:function(){var t=this;return this.props.showSpacer?s.default.createElement("div",{ref:function(e){return t.spacer=e},className:"p-virtualscroller-spacer"}):null}},{key:"renderItem",value:function(t,o){var r=this.getOptions(o),i=e.ObjectUtils.getJSXElement(this.props.itemTemplate,t,r);return s.default.createElement(s.default.Fragment,{key:r.index},i)}},{key:"renderItems",value:function(t){var e=this;return t.map((function(t,o){return e.renderItem(t,o)}))}},{key:"renderContent",value:function(){var t=this,o=this.loadedItems(),r=this.renderItems(o),i=e.classNames("p-virtualscroller-content",{"p-virtualscroller-loading":this.state.loading}),n=s.default.createElement("div",{className:i,ref:function(e){return t.content=e}},r);if(this.props.contentTemplate){var l={className:i,contentRef:function(e){return t.content=e},spacerRef:function(e){return t.spacer=e},stickyRef:function(e){return t.sticky=e},items:o,getItemOptions:function(e){return t.getOptions(e)},children:r,element:n,props:this.props,loading:this.state.loading,getLoaderOptions:function(e,o){return t.loaderOptions(e,o)},loadingTemplate:this.props.loadingTemplate,itemSize:this.props.itemSize,rows:this.getRows(),columns:this.getColumns(),vertical:this.isVertical(),horizontal:this.isHorizontal(),both:this.isBoth()};return e.ObjectUtils.getJSXElement(this.props.contentTemplate,l)}return n}},{key:"render",value:function(){var t=this;if(this.props.disabled){var o=e.ObjectUtils.getJSXElement(this.props.contentTemplate,{items:this.props.items,rows:this.props.items,columns:this.props.columns});return s.default.createElement(s.default.Fragment,null,this.props.children,o)}var r=this.isBoth(),i=this.isHorizontal(),n=e.classNames("p-virtualscroller",{"p-both-scroll":r,"p-horizontal-scroll":i},this.props.className),l=this.renderLoader(),a=this.renderContent(),c=this.renderSpacer();return s.default.createElement("div",{ref:function(e){return t.el=e},className:n,tabIndex:0,style:this.props.style,onScroll:this.onScroll},a,c,l)}}],f&&i(p.prototype,f),v&&i(p,v),y}();p(v,"defaultProps",{id:null,style:null,className:null,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",numToleratedItems:null,delay:0,lazy:!1,disabled:!1,loaderDisabled:!1,columns:null,loading:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null}),exports.VirtualScroller=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("primereact/utils");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function p(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function f(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?f(Object(o),!0).forEach((function(e){p(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var v=function(o){a(y,t.Component);var l,c,p,f,v,g=(l=y,c=m(),function(){var t,e=h(l);if(c){var o=h(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return u(this,t)});function y(t){var e;r(this,y);var o=(e=g.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(n(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return p=y,f=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.calculateNumItems(),l=n.numToleratedItems,a=this.props.itemSize,c=this.getContentPosition(),u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},h=function(t,e,o){return t*e+o},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var f={rows:u(t[0],l[0]),cols:u(t[1],l[1])};f.rows===i.rows&&f.cols===i.cols||(p(h(f.cols,a[1],c.left),h(f.rows,a[0],c.top)),this.setState({first:f}))}else{var d=u(t,l);d!==i&&(r?p(h(d,a,c.left),0):p(0,h(d,a,c.top)),this.setState({first:d}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),l=n.first,a=n.viewport,c=this.props.itemSize,u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o.scrollTo({left:t,top:e,behavior:s})},h="to-start"===e,p="to-end"===e;if(h){if(r)a.first.rows-l.rows>t[0]?u(a.first.cols*c,(a.first.rows-1)*c):a.first.cols-l.cols>t[1]&&u((a.first.cols-1)*c,a.first.rows*c);else if(a.first-l>t){var f=(a.first-1)*c;i?u(f,0):u(0,f)}}else if(p)if(r)a.last.rows-l.rows<=t[0]+1?u(a.first.cols*c,(a.first.rows+1)*c):a.last.cols-l.cols<=t[1]+1&&u((a.first.cols+1)*c,a.first.rows*c);else if(a.last-l<=t+1){var d=(a.first+1)*c;i?u(d,0):u(0,d)}}else this.scrollToIndex(t,s)}},{key:"getRows",value:function(){return this.state.loading?this.props.loaderDisabled?this.state.loaderArr:[]:this.loadedItems()}},{key:"getColumns",value:function(){if(this.props.columns){var t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.state.loading&&this.props.loaderDisabled?t?this.state.loaderArr[0]:this.state.loaderArr:this.props.columns.slice(t?this.state.first.cols:this.state.first,t?this.state.last.cols:this.state.last)}return this.props.columns}},{key:"getRenderedRange",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.state,s=o.first,r=o.last,i=o.numItemsInViewport,n=this.props.itemSize,l=function(t,e){return Math.floor(t/(e||t))},a=s,c=0;if(this.el){var u=this.el.scrollTop,h=this.el.scrollLeft;c=t?{rows:(a={rows:l(u,n[0]),cols:l(h,n[1])}).rows+i.rows,cols:a.cols+i.cols}:(a=l(e?h:u,n))+i}return{first:s,last:r,viewport:{first:a,last:c}}}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isBoth",value:function(){return"both"===this.props.orientation}},{key:"calculateNumItems",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.props.itemSize,s=this.getContentPosition(),r=this.el?this.el.offsetWidth-s.left:0,i=this.el?this.el.offsetHeight-s.top:0,n=function(t,e){return Math.ceil(t/(e||t))},l=function(t){return Math.ceil(t/2)},a=t?{rows:n(i,o[0]),cols:n(r,o[1])}:n(e?r:i,o);return{numItemsInViewport:a,numToleratedItems:this.state.numToleratedItems||(t?[l(a.rows),l(a.cols)]:l(a))}}},{key:"calculateOptions",value:function(){var t=this,e=this.isBoth(),o=this.state.first,s=this.calculateNumItems(),r=s.numItemsInViewport,i=s.numToleratedItems,n=function(e,o,s,r){return t.getLast(e+o+(e<s?2:3)*s,r)},l=e?{rows:n(o.rows,r.rows,i[0]),cols:n(o.cols,r.cols,i[1],!0)}:n(o,r,i),a={numItemsInViewport:r,last:l,numToleratedItems:i};this.props.showLoader&&(a.loaderArr=e?Array.from({length:r.rows}).map((function(){return Array.from({length:r.cols})})):Array.from({length:r})),this.setState(a,(function(){t.props.lazy&&t.props.onLazyLoad&&t.props.onLazyLoad({first:t.state.first,last:t.state.last})}))}},{key:"getLast",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.props.items?Math.min(e?(this.props.columns||this.props.items[0]).length:this.props.items.length,t):0}},{key:"getContentPosition",value:function(){if(this.content){var t=getComputedStyle(this.content),e=parseInt(t.paddingLeft,10)+Math.max(parseInt(t.left,10),0),o=parseInt(t.paddingRight,10)+Math.max(parseInt(t.right,10),0),s=parseInt(t.paddingTop,10)+Math.max(parseInt(t.top,10),0),r=parseInt(t.paddingBottom,10)+Math.max(parseInt(t.bottom,10),0);return{left:e,right:o,top:s,bottom:r,x:e+o,y:s+r}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}}},{key:"setSize",value:function(){var t=this;if(this.el){var e=this.isBoth(),o=this.isHorizontal(),s=this.el.parentElement,r=this.props.scrollWidth||"".concat(this.el.offsetWidth||s.offsetWidth,"px"),i=this.props.scrollHeight||"".concat(this.el.offsetHeight||s.offsetHeight,"px"),n=function(e,o){return t.el.style[e]=o};e||o?(n("height",i),n("width",r)):n("height",i)}}},{key:"setSpacerSize",value:function(){var t=this,e=this.props.items;if(this.spacer&&e){var o=this.isBoth(),s=this.isHorizontal(),r=this.props.itemSize,i=this.getContentPosition(),n=function(e,o,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.spacer.style[e]=(o||[]).length*s+r+"px"};o?(n("height",e,r[0],i.y),n("width",this.props.columns||e[1],r[1],i.x)):s?n("width",this.props.columns||e,r,i.x):n("height",e,r,i.y)}}},{key:"setContentPosition",value:function(t){var e=this;if(this.content){var o=this.isBoth(),s=this.isHorizontal(),r=t?t.first:this.state.first,i=this.props.itemSize,n=function(t,e){return t*e},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.sticky&&(e.sticky.style.top="-".concat(o,"px")),e.content.style.transform="translate3d(".concat(t,"px, ").concat(o,"px, 0)")};if(o)l(n(r.cols,i[1]),n(r.rows,i[0]));else{var a=n(r,i);s?l(a,0):l(0,a)}}}},{key:"onScrollPositionChange",value:function(t){var e=this,o=t.target,s=this.isBoth(),r=this.isHorizontal(),i=this.state,n=i.first,l=i.last,a=i.numItemsInViewport,c=i.numToleratedItems,u=this.props.itemSize,h=this.getContentPosition(),p=function(t,e){return t?t>e?t-e:t:0},f=function(t,e){return Math.floor(t/(e||t))},d=function(t,e,o,s,r,i){return t<=r?r:i?o-s-r:e+r-1},m=function(t,e,o,s,r,i,n){return t<=i?0:Math.max(0,n?t<e?o:t-i:t>e?o:t-2*i)},v=function(t,o,s,r,i,n){var l=o+r+2*i;return t>=i&&(l+=i+1),e.getLast(l,n)},g=p(o.scrollTop,h.top),y=p(o.scrollLeft,h.left),w=0,b=l,S=!1;if(s){var I=this.lastScrollPos.top<=g,O=this.lastScrollPos.left<=y,k={rows:f(g,u[0]),cols:f(y,u[1])},z={rows:d(k.rows,n.rows,l.rows,a.rows,c[0],I),cols:d(k.cols,n.cols,l.cols,a.cols,c[1],O)};w={rows:m(k.rows,z.rows,n.rows,0,0,c[0],I),cols:m(k.cols,z.cols,n.cols,0,0,c[1],O)},b={rows:v(k.rows,w.rows,0,a.rows,c[0]),cols:v(k.cols,w.cols,0,a.cols,c[1],!0)},S=w.rows!==n.rows&&b.rows!==l.rows||w.cols!==n.cols&&b.cols!==l.cols,this.lastScrollPos={top:g,left:y}}else{var P=r?y:g,T=this.lastScrollPos<=P,j=f(P,u);b=v(j,w=m(j,d(j,n,l,a,c,T),n,0,0,c,T),0,a,c),S=w!==n&&b!==l,this.lastScrollPos=P}return{first:w,last:b,isRangeChanged:S}}},{key:"onScrollChange",value:function(t){var e=this,o=this.onScrollPositionChange(t);if(o.isRangeChanged){var s={first:o.first,last:o.last};this.setContentPosition(s),this.setState(s,(function(){e.props.onScrollIndexChange&&e.props.onScrollIndexChange(s),e.props.lazy&&e.props.onLazyLoad&&e.props.onLazyLoad(s)}))}}},{key:"onScroll",value:function(t){var e=this;this.props.onScroll&&this.props.onScroll(t),this.props.delay?(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.state.loading&&this.props.showLoader&&this.onScrollPositionChange(t).isRangeChanged&&this.setState({loading:!0}),this.scrollTimeout=setTimeout((function(){e.onScrollChange(t),e.state.loading&&e.props.showLoader&&!e.props.lazy&&e.setState({loading:!1})}),this.props.delay)):this.onScrollChange(t)}},{key:"getOptions",value:function(t){var e=this.state.first,o=(this.props.items||[]).length,s=this.isBoth()?e.rows+t:e+t;return{index:s,count:o,first:0===s,last:s===o-1,even:s%2==0,odd:s%2!=0,props:this.props}}},{key:"loaderOptions",value:function(t,e){var o=this.state.loaderArr.length;return d({index:t,count:o,first:0===t,last:t===o-1,even:t%2==0,odd:t%2!=0,props:this.props},e)}},{key:"loadedItems",value:function(){var t=this,e=this.props.items;if(e&&!this.state.loading){var o=this.isBoth(),s=this.isHorizontal(),r=this.state,i=r.first,n=r.last;return o?e.slice(i.rows,n.rows).map((function(e){return t.props.columns?e:e.slice(i.cols,n.cols)})):s&&this.props.columns?e:e.slice(i,n)}return[]}},{key:"isPropChanged",value:function(t){var o=this;return["itemSize","scrollHeight"].some((function(s){return!e.ObjectUtils.equals(t[s],o.props[s])}))}},{key:"init",value:function(){this.setSize(),this.calculateOptions(),this.setSpacerSize()}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(t,e){t.items&&t.items.length===(this.props.items||[]).length&&!this.isPropChanged(t)||this.init(),this.props.lazy&&t.loading!==this.props.loading&&this.state.loading!==this.props.loading&&this.setState({loading:this.props.loading}),t.orientation!==this.props.orientation&&(this.lastScrollPos=this.isBoth()?{top:0,left:0}:0)}},{key:"renderLoaderItem",value:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.loaderOptions(t,o),i=e.ObjectUtils.getJSXElement(this.props.loadingTemplate,r);return s.default.createElement(s.default.Fragment,{key:t},i)}},{key:"renderLoader",value:function(){var t=this;if(!this.props.loaderDisabled&&this.props.showLoader&&this.state.loading){var o=e.classNames("p-virtualscroller-loader",{"p-component-overlay":!this.props.loadingTemplate}),r=s.default.createElement("i",{className:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"});if(this.props.loadingTemplate){var i=this.isBoth(),n=this.state.numItemsInViewport;r=this.state.loaderArr.map((function(e,o){return t.renderLoaderItem(o,i&&{numCols:n.cols})}))}return s.default.createElement("div",{className:o},r)}return null}},{key:"renderSpacer",value:function(){var t=this;return this.props.showSpacer?s.default.createElement("div",{ref:function(e){return t.spacer=e},className:"p-virtualscroller-spacer"}):null}},{key:"renderItem",value:function(t,o){var r=this.getOptions(o),i=e.ObjectUtils.getJSXElement(this.props.itemTemplate,t,r);return s.default.createElement(s.default.Fragment,{key:r.index},i)}},{key:"renderItems",value:function(t){var e=this;return t.map((function(t,o){return e.renderItem(t,o)}))}},{key:"renderContent",value:function(){var t=this,o=this.loadedItems(),r=this.renderItems(o),i=e.classNames("p-virtualscroller-content",{"p-virtualscroller-loading":this.state.loading}),n=s.default.createElement("div",{className:i,ref:function(e){return t.content=e}},r);if(this.props.contentTemplate){var l={className:i,contentRef:function(e){return t.content=e},spacerRef:function(e){return t.spacer=e},stickyRef:function(e){return t.sticky=e},items:o,getItemOptions:function(e){return t.getOptions(e)},children:r,element:n,props:this.props,loading:this.state.loading,getLoaderOptions:function(e,o){return t.loaderOptions(e,o)},loadingTemplate:this.props.loadingTemplate,itemSize:this.props.itemSize,rows:this.getRows(),columns:this.getColumns(),vertical:this.isVertical(),horizontal:this.isHorizontal(),both:this.isBoth()};return e.ObjectUtils.getJSXElement(this.props.contentTemplate,l)}return n}},{key:"render",value:function(){var t=this;if(this.props.disabled){var o=e.ObjectUtils.getJSXElement(this.props.contentTemplate,{items:this.props.items,rows:this.props.items,columns:this.props.columns});return s.default.createElement(s.default.Fragment,null,this.props.children,o)}var r=this.isBoth(),i=this.isHorizontal(),n=e.classNames("p-virtualscroller",{"p-both-scroll":r,"p-horizontal-scroll":i},this.props.className),l=this.renderLoader(),a=this.renderContent(),c=this.renderSpacer();return s.default.createElement("div",{ref:function(e){return t.el=e},className:n,tabIndex:0,style:this.props.style,onScroll:this.onScroll},a,c,l)}}],f&&i(p.prototype,f),v&&i(p,v),Object.defineProperty(p,"prototype",{writable:!1}),y}();p(v,"defaultProps",{id:null,style:null,className:null,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",numToleratedItems:null,delay:0,lazy:!1,disabled:!1,loaderDisabled:!1,columns:null,loading:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null}),exports.VirtualScroller=v;
@@ -20,6 +20,9 @@ function _defineProperties(target, props) {
20
20
  function _createClass(Constructor, protoProps, staticProps) {
21
21
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
22
22
  if (staticProps) _defineProperties(Constructor, staticProps);
23
+ Object.defineProperty(Constructor, "prototype", {
24
+ writable: false
25
+ });
23
26
  return Constructor;
24
27
  }
25
28
 
@@ -52,23 +55,20 @@ function _inherits(subClass, superClass) {
52
55
  configurable: true
53
56
  }
54
57
  });
58
+ Object.defineProperty(subClass, "prototype", {
59
+ writable: false
60
+ });
55
61
  if (superClass) _setPrototypeOf(subClass, superClass);
56
62
  }
57
63
 
58
64
  function _typeof(obj) {
59
65
  "@babel/helpers - typeof";
60
66
 
61
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
62
- _typeof = function _typeof(obj) {
63
- return typeof obj;
64
- };
65
- } else {
66
- _typeof = function _typeof(obj) {
67
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
68
- };
69
- }
70
-
71
- return _typeof(obj);
67
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
68
+ return typeof obj;
69
+ } : function (obj) {
70
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
71
+ }, _typeof(obj);
72
72
  }
73
73
 
74
74
  function _possibleConstructorReturn(self, call) {
@@ -103,9 +103,9 @@ function _defineProperty(obj, key, value) {
103
103
  return obj;
104
104
  }
105
105
 
106
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
106
+ 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; }
107
107
 
108
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
108
+ 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; }
109
109
 
110
110
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
111
111
 
@@ -163,7 +163,10 @@ var VirtualScroller = /*#__PURE__*/function (_Component) {
163
163
  var isBoth = this.isBoth();
164
164
  var isHorizontal = this.isHorizontal();
165
165
  var first = this.state.first;
166
- var numToleratedItems = this.state.numToleratedItems;
166
+
167
+ var _this$calculateNumIte = this.calculateNumItems(),
168
+ numToleratedItems = _this$calculateNumIte.numToleratedItems;
169
+
167
170
  var itemSize = this.props.itemSize;
168
171
  var contentPos = this.getContentPosition();
169
172
 
@@ -356,13 +359,10 @@ var VirtualScroller = /*#__PURE__*/function (_Component) {
356
359
  return this.props.orientation === 'both';
357
360
  }
358
361
  }, {
359
- key: "calculateOptions",
360
- value: function calculateOptions() {
361
- var _this4 = this;
362
-
362
+ key: "calculateNumItems",
363
+ value: function calculateNumItems() {
363
364
  var isBoth = this.isBoth();
364
365
  var isHorizontal = this.isHorizontal();
365
- var first = this.state.first;
366
366
  var itemSize = this.props.itemSize;
367
367
  var contentPos = this.getContentPosition();
368
368
  var contentWidth = this.el ? this.el.offsetWidth - contentPos.left : 0;
@@ -381,6 +381,22 @@ var VirtualScroller = /*#__PURE__*/function (_Component) {
381
381
  cols: calculateNumItemsInViewport(contentWidth, itemSize[1])
382
382
  } : calculateNumItemsInViewport(isHorizontal ? contentWidth : contentHeight, itemSize);
383
383
  var numToleratedItems = this.state.numToleratedItems || (isBoth ? [calculateNumToleratedItems(numItemsInViewport.rows), calculateNumToleratedItems(numItemsInViewport.cols)] : calculateNumToleratedItems(numItemsInViewport));
384
+ return {
385
+ numItemsInViewport: numItemsInViewport,
386
+ numToleratedItems: numToleratedItems
387
+ };
388
+ }
389
+ }, {
390
+ key: "calculateOptions",
391
+ value: function calculateOptions() {
392
+ var _this4 = this;
393
+
394
+ var isBoth = this.isBoth();
395
+ var first = this.state.first;
396
+
397
+ var _this$calculateNumIte2 = this.calculateNumItems(),
398
+ numItemsInViewport = _this$calculateNumIte2.numItemsInViewport,
399
+ numToleratedItems = _this$calculateNumIte2.numToleratedItems;
384
400
 
385
401
  var calculateLast = function calculateLast(_first, _num, _numT, _isCols) {
386
402
  return _this4.getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);
@@ -1 +1 @@
1
- import t,{Component as e}from"react";import{ObjectUtils as o,classNames as s}from"primereact/utils";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function u(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function f(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?f(Object(o),!0).forEach((function(e){u(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var v=function(l){a(w,e);var c,u,f,v,g,y=(c=w,u=m(),function(){var t,e=p(c);if(u){var o=p(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return h(this,t)});function w(t){var e;r(this,w);var o=(e=y.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(n(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return f=w,v=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.state.numToleratedItems,l=this.props.itemSize,a=this.getContentPosition(),c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},h=function(t,e,o){return t*e+o},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var u={rows:c(t[0],n[0]),cols:c(t[1],n[1])};u.rows===i.rows&&u.cols===i.cols||(p(h(u.cols,l[1],a.left),h(u.rows,l[0],a.top)),this.setState({first:u}))}else{var f=c(t,n);f!==i&&(r?p(h(f,l,a.left),0):p(0,h(f,l,a.top)),this.setState({first:f}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),l=n.first,a=n.viewport,c=this.props.itemSize,h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o.scrollTo({left:t,top:e,behavior:s})},p="to-start"===e,u="to-end"===e;if(p){if(r)a.first.rows-l.rows>t[0]?h(a.first.cols*c,(a.first.rows-1)*c):a.first.cols-l.cols>t[1]&&h((a.first.cols-1)*c,a.first.rows*c);else if(a.first-l>t){var f=(a.first-1)*c;i?h(f,0):h(0,f)}}else if(u)if(r)a.last.rows-l.rows<=t[0]+1?h(a.first.cols*c,(a.first.rows+1)*c):a.last.cols-l.cols<=t[1]+1&&h((a.first.cols+1)*c,a.first.rows*c);else if(a.last-l<=t+1){var d=(a.first+1)*c;i?h(d,0):h(0,d)}}else this.scrollToIndex(t,s)}},{key:"getRows",value:function(){return this.state.loading?this.props.loaderDisabled?this.state.loaderArr:[]:this.loadedItems()}},{key:"getColumns",value:function(){if(this.props.columns){var t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.state.loading&&this.props.loaderDisabled?t?this.state.loaderArr[0]:this.state.loaderArr:this.props.columns.slice(t?this.state.first.cols:this.state.first,t?this.state.last.cols:this.state.last)}return this.props.columns}},{key:"getRenderedRange",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.state,s=o.first,r=o.last,i=o.numItemsInViewport,n=this.props.itemSize,l=function(t,e){return Math.floor(t/(e||t))},a=s,c=0;if(this.el){var h=this.el.scrollTop,p=this.el.scrollLeft;c=t?{rows:(a={rows:l(h,n[0]),cols:l(p,n[1])}).rows+i.rows,cols:a.cols+i.cols}:(a=l(e?p:h,n))+i}return{first:s,last:r,viewport:{first:a,last:c}}}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isBoth",value:function(){return"both"===this.props.orientation}},{key:"calculateOptions",value:function(){var t=this,e=this.isBoth(),o=this.isHorizontal(),s=this.state.first,r=this.props.itemSize,i=this.getContentPosition(),n=this.el?this.el.offsetWidth-i.left:0,l=this.el?this.el.offsetHeight-i.top:0,a=function(t,e){return Math.ceil(t/(e||t))},c=function(t){return Math.ceil(t/2)},h=e?{rows:a(l,r[0]),cols:a(n,r[1])}:a(o?n:l,r),p=this.state.numToleratedItems||(e?[c(h.rows),c(h.cols)]:c(h)),u=function(e,o,s,r){return t.getLast(e+o+(e<s?2:3)*s,r)},f=e?{rows:u(s.rows,h.rows,p[0]),cols:u(s.cols,h.cols,p[1],!0)}:u(s,h,p),d={numItemsInViewport:h,last:f,numToleratedItems:p};this.props.showLoader&&(d.loaderArr=e?Array.from({length:h.rows}).map((function(){return Array.from({length:h.cols})})):Array.from({length:h})),this.setState(d,(function(){t.props.lazy&&t.props.onLazyLoad&&t.props.onLazyLoad({first:t.state.first,last:t.state.last})}))}},{key:"getLast",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.props.items?Math.min(e?(this.props.columns||this.props.items[0]).length:this.props.items.length,t):0}},{key:"getContentPosition",value:function(){if(this.content){var t=getComputedStyle(this.content),e=parseInt(t.paddingLeft,10)+Math.max(parseInt(t.left,10),0),o=parseInt(t.paddingRight,10)+Math.max(parseInt(t.right,10),0),s=parseInt(t.paddingTop,10)+Math.max(parseInt(t.top,10),0),r=parseInt(t.paddingBottom,10)+Math.max(parseInt(t.bottom,10),0);return{left:e,right:o,top:s,bottom:r,x:e+o,y:s+r}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}}},{key:"setSize",value:function(){var t=this;if(this.el){var e=this.isBoth(),o=this.isHorizontal(),s=this.el.parentElement,r=this.props.scrollWidth||"".concat(this.el.offsetWidth||s.offsetWidth,"px"),i=this.props.scrollHeight||"".concat(this.el.offsetHeight||s.offsetHeight,"px"),n=function(e,o){return t.el.style[e]=o};e||o?(n("height",i),n("width",r)):n("height",i)}}},{key:"setSpacerSize",value:function(){var t=this,e=this.props.items;if(this.spacer&&e){var o=this.isBoth(),s=this.isHorizontal(),r=this.props.itemSize,i=this.getContentPosition(),n=function(e,o,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.spacer.style[e]=(o||[]).length*s+r+"px"};o?(n("height",e,r[0],i.y),n("width",this.props.columns||e[1],r[1],i.x)):s?n("width",this.props.columns||e,r,i.x):n("height",e,r,i.y)}}},{key:"setContentPosition",value:function(t){var e=this;if(this.content){var o=this.isBoth(),s=this.isHorizontal(),r=t?t.first:this.state.first,i=this.props.itemSize,n=function(t,e){return t*e},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.sticky&&(e.sticky.style.top="-".concat(o,"px")),e.content.style.transform="translate3d(".concat(t,"px, ").concat(o,"px, 0)")};if(o)l(n(r.cols,i[1]),n(r.rows,i[0]));else{var a=n(r,i);s?l(a,0):l(0,a)}}}},{key:"onScrollPositionChange",value:function(t){var e=this,o=t.target,s=this.isBoth(),r=this.isHorizontal(),i=this.state,n=i.first,l=i.last,a=i.numItemsInViewport,c=i.numToleratedItems,h=this.props.itemSize,p=this.getContentPosition(),u=function(t,e){return t?t>e?t-e:t:0},f=function(t,e){return Math.floor(t/(e||t))},d=function(t,e,o,s,r,i){return t<=r?r:i?o-s-r:e+r-1},m=function(t,e,o,s,r,i,n){return t<=i?0:Math.max(0,n?t<e?o:t-i:t>e?o:t-2*i)},v=function(t,o,s,r,i,n){var l=o+r+2*i;return t>=i&&(l+=i+1),e.getLast(l,n)},g=u(o.scrollTop,p.top),y=u(o.scrollLeft,p.left),w=0,S=l,b=!1;if(s){var I=this.lastScrollPos.top<=g,z=this.lastScrollPos.left<=y,k={rows:f(g,h[0]),cols:f(y,h[1])},O={rows:d(k.rows,n.rows,l.rows,a.rows,c[0],I),cols:d(k.cols,n.cols,l.cols,a.cols,c[1],z)};w={rows:m(k.rows,O.rows,n.rows,0,0,c[0],I),cols:m(k.cols,O.cols,n.cols,0,0,c[1],z)},S={rows:v(k.rows,w.rows,0,a.rows,c[0]),cols:v(k.cols,w.cols,0,a.cols,c[1],!0)},b=w.rows!==n.rows&&S.rows!==l.rows||w.cols!==n.cols&&S.cols!==l.cols,this.lastScrollPos={top:g,left:y}}else{var T=r?y:g,P=this.lastScrollPos<=T,C=f(T,h);S=v(C,w=m(C,d(C,n,l,a,c,P),n,0,0,c,P),0,a,c),b=w!==n&&S!==l,this.lastScrollPos=T}return{first:w,last:S,isRangeChanged:b}}},{key:"onScrollChange",value:function(t){var e=this,o=this.onScrollPositionChange(t);if(o.isRangeChanged){var s={first:o.first,last:o.last};this.setContentPosition(s),this.setState(s,(function(){e.props.onScrollIndexChange&&e.props.onScrollIndexChange(s),e.props.lazy&&e.props.onLazyLoad&&e.props.onLazyLoad(s)}))}}},{key:"onScroll",value:function(t){var e=this;this.props.onScroll&&this.props.onScroll(t),this.props.delay?(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.state.loading&&this.props.showLoader&&this.onScrollPositionChange(t).isRangeChanged&&this.setState({loading:!0}),this.scrollTimeout=setTimeout((function(){e.onScrollChange(t),e.state.loading&&e.props.showLoader&&!e.props.lazy&&e.setState({loading:!1})}),this.props.delay)):this.onScrollChange(t)}},{key:"getOptions",value:function(t){var e=this.state.first,o=(this.props.items||[]).length,s=this.isBoth()?e.rows+t:e+t;return{index:s,count:o,first:0===s,last:s===o-1,even:s%2==0,odd:s%2!=0,props:this.props}}},{key:"loaderOptions",value:function(t,e){var o=this.state.loaderArr.length;return d({index:t,count:o,first:0===t,last:t===o-1,even:t%2==0,odd:t%2!=0,props:this.props},e)}},{key:"loadedItems",value:function(){var t=this,e=this.props.items;if(e&&!this.state.loading){var o=this.isBoth(),s=this.isHorizontal(),r=this.state,i=r.first,n=r.last;return o?e.slice(i.rows,n.rows).map((function(e){return t.props.columns?e:e.slice(i.cols,n.cols)})):s&&this.props.columns?e:e.slice(i,n)}return[]}},{key:"isPropChanged",value:function(t){var e=this;return["itemSize","scrollHeight"].some((function(s){return!o.equals(t[s],e.props[s])}))}},{key:"init",value:function(){this.setSize(),this.calculateOptions(),this.setSpacerSize()}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(t,e){t.items&&t.items.length===(this.props.items||[]).length&&!this.isPropChanged(t)||this.init(),this.props.lazy&&t.loading!==this.props.loading&&this.state.loading!==this.props.loading&&this.setState({loading:this.props.loading}),t.orientation!==this.props.orientation&&(this.lastScrollPos=this.isBoth()?{top:0,left:0}:0)}},{key:"renderLoaderItem",value:function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.loaderOptions(e,s),i=o.getJSXElement(this.props.loadingTemplate,r);return t.createElement(t.Fragment,{key:e},i)}},{key:"renderLoader",value:function(){var e=this;if(!this.props.loaderDisabled&&this.props.showLoader&&this.state.loading){var o=s("p-virtualscroller-loader",{"p-component-overlay":!this.props.loadingTemplate}),r=t.createElement("i",{className:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"});if(this.props.loadingTemplate){var i=this.isBoth(),n=this.state.numItemsInViewport;r=this.state.loaderArr.map((function(t,o){return e.renderLoaderItem(o,i&&{numCols:n.cols})}))}return t.createElement("div",{className:o},r)}return null}},{key:"renderSpacer",value:function(){var e=this;return this.props.showSpacer?t.createElement("div",{ref:function(t){return e.spacer=t},className:"p-virtualscroller-spacer"}):null}},{key:"renderItem",value:function(e,s){var r=this.getOptions(s),i=o.getJSXElement(this.props.itemTemplate,e,r);return t.createElement(t.Fragment,{key:r.index},i)}},{key:"renderItems",value:function(t){var e=this;return t.map((function(t,o){return e.renderItem(t,o)}))}},{key:"renderContent",value:function(){var e=this,r=this.loadedItems(),i=this.renderItems(r),n=s("p-virtualscroller-content",{"p-virtualscroller-loading":this.state.loading}),l=t.createElement("div",{className:n,ref:function(t){return e.content=t}},i);if(this.props.contentTemplate){var a={className:n,contentRef:function(t){return e.content=t},spacerRef:function(t){return e.spacer=t},stickyRef:function(t){return e.sticky=t},items:r,getItemOptions:function(t){return e.getOptions(t)},children:i,element:l,props:this.props,loading:this.state.loading,getLoaderOptions:function(t,o){return e.loaderOptions(t,o)},loadingTemplate:this.props.loadingTemplate,itemSize:this.props.itemSize,rows:this.getRows(),columns:this.getColumns(),vertical:this.isVertical(),horizontal:this.isHorizontal(),both:this.isBoth()};return o.getJSXElement(this.props.contentTemplate,a)}return l}},{key:"render",value:function(){var e=this;if(this.props.disabled){var r=o.getJSXElement(this.props.contentTemplate,{items:this.props.items,rows:this.props.items,columns:this.props.columns});return t.createElement(t.Fragment,null,this.props.children,r)}var i=this.isBoth(),n=this.isHorizontal(),l=s("p-virtualscroller",{"p-both-scroll":i,"p-horizontal-scroll":n},this.props.className),a=this.renderLoader(),c=this.renderContent(),h=this.renderSpacer();return t.createElement("div",{ref:function(t){return e.el=t},className:l,tabIndex:0,style:this.props.style,onScroll:this.onScroll},c,h,a)}}],v&&i(f.prototype,v),g&&i(f,g),w}();u(v,"defaultProps",{id:null,style:null,className:null,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",numToleratedItems:null,delay:0,lazy:!1,disabled:!1,loaderDisabled:!1,columns:null,loading:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null});export{v as VirtualScroller};
1
+ import t,{Component as e}from"react";import{ObjectUtils as o,classNames as s}from"primereact/utils";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function u(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function f(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?f(Object(o),!0).forEach((function(e){u(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var v=function(l){a(w,e);var c,u,f,v,g,y=(c=w,u=m(),function(){var t,e=p(c);if(u){var o=p(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return h(this,t)});function w(t){var e;r(this,w);var o=(e=y.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(n(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return f=w,v=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.calculateNumItems(),l=n.numToleratedItems,a=this.props.itemSize,c=this.getContentPosition(),h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},p=function(t,e,o){return t*e+o},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var f={rows:h(t[0],l[0]),cols:h(t[1],l[1])};f.rows===i.rows&&f.cols===i.cols||(u(p(f.cols,a[1],c.left),p(f.rows,a[0],c.top)),this.setState({first:f}))}else{var d=h(t,l);d!==i&&(r?u(p(d,a,c.left),0):u(0,p(d,a,c.top)),this.setState({first:d}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),l=n.first,a=n.viewport,c=this.props.itemSize,h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o.scrollTo({left:t,top:e,behavior:s})},p="to-start"===e,u="to-end"===e;if(p){if(r)a.first.rows-l.rows>t[0]?h(a.first.cols*c,(a.first.rows-1)*c):a.first.cols-l.cols>t[1]&&h((a.first.cols-1)*c,a.first.rows*c);else if(a.first-l>t){var f=(a.first-1)*c;i?h(f,0):h(0,f)}}else if(u)if(r)a.last.rows-l.rows<=t[0]+1?h(a.first.cols*c,(a.first.rows+1)*c):a.last.cols-l.cols<=t[1]+1&&h((a.first.cols+1)*c,a.first.rows*c);else if(a.last-l<=t+1){var d=(a.first+1)*c;i?h(d,0):h(0,d)}}else this.scrollToIndex(t,s)}},{key:"getRows",value:function(){return this.state.loading?this.props.loaderDisabled?this.state.loaderArr:[]:this.loadedItems()}},{key:"getColumns",value:function(){if(this.props.columns){var t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.state.loading&&this.props.loaderDisabled?t?this.state.loaderArr[0]:this.state.loaderArr:this.props.columns.slice(t?this.state.first.cols:this.state.first,t?this.state.last.cols:this.state.last)}return this.props.columns}},{key:"getRenderedRange",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.state,s=o.first,r=o.last,i=o.numItemsInViewport,n=this.props.itemSize,l=function(t,e){return Math.floor(t/(e||t))},a=s,c=0;if(this.el){var h=this.el.scrollTop,p=this.el.scrollLeft;c=t?{rows:(a={rows:l(h,n[0]),cols:l(p,n[1])}).rows+i.rows,cols:a.cols+i.cols}:(a=l(e?p:h,n))+i}return{first:s,last:r,viewport:{first:a,last:c}}}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isBoth",value:function(){return"both"===this.props.orientation}},{key:"calculateNumItems",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.props.itemSize,s=this.getContentPosition(),r=this.el?this.el.offsetWidth-s.left:0,i=this.el?this.el.offsetHeight-s.top:0,n=function(t,e){return Math.ceil(t/(e||t))},l=function(t){return Math.ceil(t/2)},a=t?{rows:n(i,o[0]),cols:n(r,o[1])}:n(e?r:i,o);return{numItemsInViewport:a,numToleratedItems:this.state.numToleratedItems||(t?[l(a.rows),l(a.cols)]:l(a))}}},{key:"calculateOptions",value:function(){var t=this,e=this.isBoth(),o=this.state.first,s=this.calculateNumItems(),r=s.numItemsInViewport,i=s.numToleratedItems,n=function(e,o,s,r){return t.getLast(e+o+(e<s?2:3)*s,r)},l=e?{rows:n(o.rows,r.rows,i[0]),cols:n(o.cols,r.cols,i[1],!0)}:n(o,r,i),a={numItemsInViewport:r,last:l,numToleratedItems:i};this.props.showLoader&&(a.loaderArr=e?Array.from({length:r.rows}).map((function(){return Array.from({length:r.cols})})):Array.from({length:r})),this.setState(a,(function(){t.props.lazy&&t.props.onLazyLoad&&t.props.onLazyLoad({first:t.state.first,last:t.state.last})}))}},{key:"getLast",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.props.items?Math.min(e?(this.props.columns||this.props.items[0]).length:this.props.items.length,t):0}},{key:"getContentPosition",value:function(){if(this.content){var t=getComputedStyle(this.content),e=parseInt(t.paddingLeft,10)+Math.max(parseInt(t.left,10),0),o=parseInt(t.paddingRight,10)+Math.max(parseInt(t.right,10),0),s=parseInt(t.paddingTop,10)+Math.max(parseInt(t.top,10),0),r=parseInt(t.paddingBottom,10)+Math.max(parseInt(t.bottom,10),0);return{left:e,right:o,top:s,bottom:r,x:e+o,y:s+r}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}}},{key:"setSize",value:function(){var t=this;if(this.el){var e=this.isBoth(),o=this.isHorizontal(),s=this.el.parentElement,r=this.props.scrollWidth||"".concat(this.el.offsetWidth||s.offsetWidth,"px"),i=this.props.scrollHeight||"".concat(this.el.offsetHeight||s.offsetHeight,"px"),n=function(e,o){return t.el.style[e]=o};e||o?(n("height",i),n("width",r)):n("height",i)}}},{key:"setSpacerSize",value:function(){var t=this,e=this.props.items;if(this.spacer&&e){var o=this.isBoth(),s=this.isHorizontal(),r=this.props.itemSize,i=this.getContentPosition(),n=function(e,o,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.spacer.style[e]=(o||[]).length*s+r+"px"};o?(n("height",e,r[0],i.y),n("width",this.props.columns||e[1],r[1],i.x)):s?n("width",this.props.columns||e,r,i.x):n("height",e,r,i.y)}}},{key:"setContentPosition",value:function(t){var e=this;if(this.content){var o=this.isBoth(),s=this.isHorizontal(),r=t?t.first:this.state.first,i=this.props.itemSize,n=function(t,e){return t*e},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.sticky&&(e.sticky.style.top="-".concat(o,"px")),e.content.style.transform="translate3d(".concat(t,"px, ").concat(o,"px, 0)")};if(o)l(n(r.cols,i[1]),n(r.rows,i[0]));else{var a=n(r,i);s?l(a,0):l(0,a)}}}},{key:"onScrollPositionChange",value:function(t){var e=this,o=t.target,s=this.isBoth(),r=this.isHorizontal(),i=this.state,n=i.first,l=i.last,a=i.numItemsInViewport,c=i.numToleratedItems,h=this.props.itemSize,p=this.getContentPosition(),u=function(t,e){return t?t>e?t-e:t:0},f=function(t,e){return Math.floor(t/(e||t))},d=function(t,e,o,s,r,i){return t<=r?r:i?o-s-r:e+r-1},m=function(t,e,o,s,r,i,n){return t<=i?0:Math.max(0,n?t<e?o:t-i:t>e?o:t-2*i)},v=function(t,o,s,r,i,n){var l=o+r+2*i;return t>=i&&(l+=i+1),e.getLast(l,n)},g=u(o.scrollTop,p.top),y=u(o.scrollLeft,p.left),w=0,S=l,b=!1;if(s){var I=this.lastScrollPos.top<=g,k=this.lastScrollPos.left<=y,z={rows:f(g,h[0]),cols:f(y,h[1])},O={rows:d(z.rows,n.rows,l.rows,a.rows,c[0],I),cols:d(z.cols,n.cols,l.cols,a.cols,c[1],k)};w={rows:m(z.rows,O.rows,n.rows,0,0,c[0],I),cols:m(z.cols,O.cols,n.cols,0,0,c[1],k)},S={rows:v(z.rows,w.rows,0,a.rows,c[0]),cols:v(z.cols,w.cols,0,a.cols,c[1],!0)},b=w.rows!==n.rows&&S.rows!==l.rows||w.cols!==n.cols&&S.cols!==l.cols,this.lastScrollPos={top:g,left:y}}else{var T=r?y:g,P=this.lastScrollPos<=T,C=f(T,h);S=v(C,w=m(C,d(C,n,l,a,c,P),n,0,0,c,P),0,a,c),b=w!==n&&S!==l,this.lastScrollPos=T}return{first:w,last:S,isRangeChanged:b}}},{key:"onScrollChange",value:function(t){var e=this,o=this.onScrollPositionChange(t);if(o.isRangeChanged){var s={first:o.first,last:o.last};this.setContentPosition(s),this.setState(s,(function(){e.props.onScrollIndexChange&&e.props.onScrollIndexChange(s),e.props.lazy&&e.props.onLazyLoad&&e.props.onLazyLoad(s)}))}}},{key:"onScroll",value:function(t){var e=this;this.props.onScroll&&this.props.onScroll(t),this.props.delay?(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.state.loading&&this.props.showLoader&&this.onScrollPositionChange(t).isRangeChanged&&this.setState({loading:!0}),this.scrollTimeout=setTimeout((function(){e.onScrollChange(t),e.state.loading&&e.props.showLoader&&!e.props.lazy&&e.setState({loading:!1})}),this.props.delay)):this.onScrollChange(t)}},{key:"getOptions",value:function(t){var e=this.state.first,o=(this.props.items||[]).length,s=this.isBoth()?e.rows+t:e+t;return{index:s,count:o,first:0===s,last:s===o-1,even:s%2==0,odd:s%2!=0,props:this.props}}},{key:"loaderOptions",value:function(t,e){var o=this.state.loaderArr.length;return d({index:t,count:o,first:0===t,last:t===o-1,even:t%2==0,odd:t%2!=0,props:this.props},e)}},{key:"loadedItems",value:function(){var t=this,e=this.props.items;if(e&&!this.state.loading){var o=this.isBoth(),s=this.isHorizontal(),r=this.state,i=r.first,n=r.last;return o?e.slice(i.rows,n.rows).map((function(e){return t.props.columns?e:e.slice(i.cols,n.cols)})):s&&this.props.columns?e:e.slice(i,n)}return[]}},{key:"isPropChanged",value:function(t){var e=this;return["itemSize","scrollHeight"].some((function(s){return!o.equals(t[s],e.props[s])}))}},{key:"init",value:function(){this.setSize(),this.calculateOptions(),this.setSpacerSize()}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(t,e){t.items&&t.items.length===(this.props.items||[]).length&&!this.isPropChanged(t)||this.init(),this.props.lazy&&t.loading!==this.props.loading&&this.state.loading!==this.props.loading&&this.setState({loading:this.props.loading}),t.orientation!==this.props.orientation&&(this.lastScrollPos=this.isBoth()?{top:0,left:0}:0)}},{key:"renderLoaderItem",value:function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.loaderOptions(e,s),i=o.getJSXElement(this.props.loadingTemplate,r);return t.createElement(t.Fragment,{key:e},i)}},{key:"renderLoader",value:function(){var e=this;if(!this.props.loaderDisabled&&this.props.showLoader&&this.state.loading){var o=s("p-virtualscroller-loader",{"p-component-overlay":!this.props.loadingTemplate}),r=t.createElement("i",{className:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"});if(this.props.loadingTemplate){var i=this.isBoth(),n=this.state.numItemsInViewport;r=this.state.loaderArr.map((function(t,o){return e.renderLoaderItem(o,i&&{numCols:n.cols})}))}return t.createElement("div",{className:o},r)}return null}},{key:"renderSpacer",value:function(){var e=this;return this.props.showSpacer?t.createElement("div",{ref:function(t){return e.spacer=t},className:"p-virtualscroller-spacer"}):null}},{key:"renderItem",value:function(e,s){var r=this.getOptions(s),i=o.getJSXElement(this.props.itemTemplate,e,r);return t.createElement(t.Fragment,{key:r.index},i)}},{key:"renderItems",value:function(t){var e=this;return t.map((function(t,o){return e.renderItem(t,o)}))}},{key:"renderContent",value:function(){var e=this,r=this.loadedItems(),i=this.renderItems(r),n=s("p-virtualscroller-content",{"p-virtualscroller-loading":this.state.loading}),l=t.createElement("div",{className:n,ref:function(t){return e.content=t}},i);if(this.props.contentTemplate){var a={className:n,contentRef:function(t){return e.content=t},spacerRef:function(t){return e.spacer=t},stickyRef:function(t){return e.sticky=t},items:r,getItemOptions:function(t){return e.getOptions(t)},children:i,element:l,props:this.props,loading:this.state.loading,getLoaderOptions:function(t,o){return e.loaderOptions(t,o)},loadingTemplate:this.props.loadingTemplate,itemSize:this.props.itemSize,rows:this.getRows(),columns:this.getColumns(),vertical:this.isVertical(),horizontal:this.isHorizontal(),both:this.isBoth()};return o.getJSXElement(this.props.contentTemplate,a)}return l}},{key:"render",value:function(){var e=this;if(this.props.disabled){var r=o.getJSXElement(this.props.contentTemplate,{items:this.props.items,rows:this.props.items,columns:this.props.columns});return t.createElement(t.Fragment,null,this.props.children,r)}var i=this.isBoth(),n=this.isHorizontal(),l=s("p-virtualscroller",{"p-both-scroll":i,"p-horizontal-scroll":n},this.props.className),a=this.renderLoader(),c=this.renderContent(),h=this.renderSpacer();return t.createElement("div",{ref:function(t){return e.el=t},className:l,tabIndex:0,style:this.props.style,onScroll:this.onScroll},c,h,a)}}],v&&i(f.prototype,v),g&&i(f,g),Object.defineProperty(f,"prototype",{writable:!1}),w}();u(v,"defaultProps",{id:null,style:null,className:null,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",numToleratedItems:null,delay:0,lazy:!1,disabled:!1,loaderDisabled:!1,columns:null,loading:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null});export{v as VirtualScroller};
@@ -25,6 +25,9 @@ this.primereact.virtualscroller = (function (exports, React, utils) {
25
25
  function _createClass(Constructor, protoProps, staticProps) {
26
26
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
27
  if (staticProps) _defineProperties(Constructor, staticProps);
28
+ Object.defineProperty(Constructor, "prototype", {
29
+ writable: false
30
+ });
28
31
  return Constructor;
29
32
  }
30
33
 
@@ -57,23 +60,20 @@ this.primereact.virtualscroller = (function (exports, React, utils) {
57
60
  configurable: true
58
61
  }
59
62
  });
63
+ Object.defineProperty(subClass, "prototype", {
64
+ writable: false
65
+ });
60
66
  if (superClass) _setPrototypeOf(subClass, superClass);
61
67
  }
62
68
 
63
69
  function _typeof(obj) {
64
70
  "@babel/helpers - typeof";
65
71
 
66
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
67
- _typeof = function _typeof(obj) {
68
- return typeof obj;
69
- };
70
- } else {
71
- _typeof = function _typeof(obj) {
72
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
73
- };
74
- }
75
-
76
- return _typeof(obj);
72
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
73
+ return typeof obj;
74
+ } : function (obj) {
75
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
76
+ }, _typeof(obj);
77
77
  }
78
78
 
79
79
  function _possibleConstructorReturn(self, call) {
@@ -108,9 +108,9 @@ this.primereact.virtualscroller = (function (exports, React, utils) {
108
108
  return obj;
109
109
  }
110
110
 
111
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
111
+ 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; }
112
112
 
113
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
113
+ 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; }
114
114
 
115
115
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
116
116
 
@@ -168,7 +168,10 @@ this.primereact.virtualscroller = (function (exports, React, utils) {
168
168
  var isBoth = this.isBoth();
169
169
  var isHorizontal = this.isHorizontal();
170
170
  var first = this.state.first;
171
- var numToleratedItems = this.state.numToleratedItems;
171
+
172
+ var _this$calculateNumIte = this.calculateNumItems(),
173
+ numToleratedItems = _this$calculateNumIte.numToleratedItems;
174
+
172
175
  var itemSize = this.props.itemSize;
173
176
  var contentPos = this.getContentPosition();
174
177
 
@@ -361,13 +364,10 @@ this.primereact.virtualscroller = (function (exports, React, utils) {
361
364
  return this.props.orientation === 'both';
362
365
  }
363
366
  }, {
364
- key: "calculateOptions",
365
- value: function calculateOptions() {
366
- var _this4 = this;
367
-
367
+ key: "calculateNumItems",
368
+ value: function calculateNumItems() {
368
369
  var isBoth = this.isBoth();
369
370
  var isHorizontal = this.isHorizontal();
370
- var first = this.state.first;
371
371
  var itemSize = this.props.itemSize;
372
372
  var contentPos = this.getContentPosition();
373
373
  var contentWidth = this.el ? this.el.offsetWidth - contentPos.left : 0;
@@ -386,6 +386,22 @@ this.primereact.virtualscroller = (function (exports, React, utils) {
386
386
  cols: calculateNumItemsInViewport(contentWidth, itemSize[1])
387
387
  } : calculateNumItemsInViewport(isHorizontal ? contentWidth : contentHeight, itemSize);
388
388
  var numToleratedItems = this.state.numToleratedItems || (isBoth ? [calculateNumToleratedItems(numItemsInViewport.rows), calculateNumToleratedItems(numItemsInViewport.cols)] : calculateNumToleratedItems(numItemsInViewport));
389
+ return {
390
+ numItemsInViewport: numItemsInViewport,
391
+ numToleratedItems: numToleratedItems
392
+ };
393
+ }
394
+ }, {
395
+ key: "calculateOptions",
396
+ value: function calculateOptions() {
397
+ var _this4 = this;
398
+
399
+ var isBoth = this.isBoth();
400
+ var first = this.state.first;
401
+
402
+ var _this$calculateNumIte2 = this.calculateNumItems(),
403
+ numItemsInViewport = _this$calculateNumIte2.numItemsInViewport,
404
+ numToleratedItems = _this$calculateNumIte2.numToleratedItems;
389
405
 
390
406
  var calculateLast = function calculateLast(_first, _num, _numT, _isCols) {
391
407
  return _this4.getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);
@@ -1 +1 @@
1
- .p-virtualscroller{position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;outline:0 none}.p-virtualscroller-content{position:absolute;top:0;left:0;contain:content;min-height:100%;min-width:100%;will-change:transform}.p-virtualscroller-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0;pointer-events:none}.p-virtualscroller-loader{position:sticky;top:0;left:0;width:100%;height:100%}.p-virtualscroller-loader.p-component-overlay{display:flex;align-items:center;justify-content:center}
1
+ .p-virtualscroller{position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;outline:0 none}.p-virtualscroller-content{position:absolute;top:0;left:0;min-height:100%;min-width:100%;will-change:transform}.p-virtualscroller-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0;pointer-events:none}.p-virtualscroller-loader{position:sticky;top:0;left:0;width:100%;height:100%}.p-virtualscroller-loader.p-component-overlay{display:flex;align-items:center;justify-content:center}
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.virtualscroller=function(t,e,o){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=s(e);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function u(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function f(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function d(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function m(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?d(Object(o),!0).forEach((function(e){f(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var g=function(t){c(g,t);var e,s,a,h,f,d=(e=g,s=v(),function(){var t,o=p(e);if(s){var r=p(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return u(this,t)});function g(t){var e;i(this,g);var o=(e=d.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(l(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return a=g,h=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.state.numToleratedItems,l=this.props.itemSize,a=this.getContentPosition(),c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},h=function(t,e,o){return t*e+o},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var p={rows:c(t[0],n[0]),cols:c(t[1],n[1])};p.rows===i.rows&&p.cols===i.cols||(u(h(p.cols,l[1],a.left),h(p.rows,l[0],a.top)),this.setState({first:p}))}else{var f=c(t,n);f!==i&&(r?u(h(f,l,a.left),0):u(0,h(f,l,a.top)),this.setState({first:f}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),l=n.first,a=n.viewport,c=this.props.itemSize,h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o.scrollTo({left:t,top:e,behavior:s})},u="to-start"===e,p="to-end"===e;if(u){if(r)a.first.rows-l.rows>t[0]?h(a.first.cols*c,(a.first.rows-1)*c):a.first.cols-l.cols>t[1]&&h((a.first.cols-1)*c,a.first.rows*c);else if(a.first-l>t){var f=(a.first-1)*c;i?h(f,0):h(0,f)}}else if(p)if(r)a.last.rows-l.rows<=t[0]+1?h(a.first.cols*c,(a.first.rows+1)*c):a.last.cols-l.cols<=t[1]+1&&h((a.first.cols+1)*c,a.first.rows*c);else if(a.last-l<=t+1){var d=(a.first+1)*c;i?h(d,0):h(0,d)}}else this.scrollToIndex(t,s)}},{key:"getRows",value:function(){return this.state.loading?this.props.loaderDisabled?this.state.loaderArr:[]:this.loadedItems()}},{key:"getColumns",value:function(){if(this.props.columns){var t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.state.loading&&this.props.loaderDisabled?t?this.state.loaderArr[0]:this.state.loaderArr:this.props.columns.slice(t?this.state.first.cols:this.state.first,t?this.state.last.cols:this.state.last)}return this.props.columns}},{key:"getRenderedRange",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.state,s=o.first,r=o.last,i=o.numItemsInViewport,n=this.props.itemSize,l=function(t,e){return Math.floor(t/(e||t))},a=s,c=0;if(this.el){var h=this.el.scrollTop,u=this.el.scrollLeft;c=t?{rows:(a={rows:l(h,n[0]),cols:l(u,n[1])}).rows+i.rows,cols:a.cols+i.cols}:(a=l(e?u:h,n))+i}return{first:s,last:r,viewport:{first:a,last:c}}}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isBoth",value:function(){return"both"===this.props.orientation}},{key:"calculateOptions",value:function(){var t=this,e=this.isBoth(),o=this.isHorizontal(),s=this.state.first,r=this.props.itemSize,i=this.getContentPosition(),n=this.el?this.el.offsetWidth-i.left:0,l=this.el?this.el.offsetHeight-i.top:0,a=function(t,e){return Math.ceil(t/(e||t))},c=function(t){return Math.ceil(t/2)},h=e?{rows:a(l,r[0]),cols:a(n,r[1])}:a(o?n:l,r),u=this.state.numToleratedItems||(e?[c(h.rows),c(h.cols)]:c(h)),p=function(e,o,s,r){return t.getLast(e+o+(e<s?2:3)*s,r)},f=e?{rows:p(s.rows,h.rows,u[0]),cols:p(s.cols,h.cols,u[1],!0)}:p(s,h,u),d={numItemsInViewport:h,last:f,numToleratedItems:u};this.props.showLoader&&(d.loaderArr=e?Array.from({length:h.rows}).map((function(){return Array.from({length:h.cols})})):Array.from({length:h})),this.setState(d,(function(){t.props.lazy&&t.props.onLazyLoad&&t.props.onLazyLoad({first:t.state.first,last:t.state.last})}))}},{key:"getLast",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.props.items?Math.min(e?(this.props.columns||this.props.items[0]).length:this.props.items.length,t):0}},{key:"getContentPosition",value:function(){if(this.content){var t=getComputedStyle(this.content),e=parseInt(t.paddingLeft,10)+Math.max(parseInt(t.left,10),0),o=parseInt(t.paddingRight,10)+Math.max(parseInt(t.right,10),0),s=parseInt(t.paddingTop,10)+Math.max(parseInt(t.top,10),0),r=parseInt(t.paddingBottom,10)+Math.max(parseInt(t.bottom,10),0);return{left:e,right:o,top:s,bottom:r,x:e+o,y:s+r}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}}},{key:"setSize",value:function(){var t=this;if(this.el){var e=this.isBoth(),o=this.isHorizontal(),s=this.el.parentElement,r=this.props.scrollWidth||"".concat(this.el.offsetWidth||s.offsetWidth,"px"),i=this.props.scrollHeight||"".concat(this.el.offsetHeight||s.offsetHeight,"px"),n=function(e,o){return t.el.style[e]=o};e||o?(n("height",i),n("width",r)):n("height",i)}}},{key:"setSpacerSize",value:function(){var t=this,e=this.props.items;if(this.spacer&&e){var o=this.isBoth(),s=this.isHorizontal(),r=this.props.itemSize,i=this.getContentPosition(),n=function(e,o,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.spacer.style[e]=(o||[]).length*s+r+"px"};o?(n("height",e,r[0],i.y),n("width",this.props.columns||e[1],r[1],i.x)):s?n("width",this.props.columns||e,r,i.x):n("height",e,r,i.y)}}},{key:"setContentPosition",value:function(t){var e=this;if(this.content){var o=this.isBoth(),s=this.isHorizontal(),r=t?t.first:this.state.first,i=this.props.itemSize,n=function(t,e){return t*e},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.sticky&&(e.sticky.style.top="-".concat(o,"px")),e.content.style.transform="translate3d(".concat(t,"px, ").concat(o,"px, 0)")};if(o)l(n(r.cols,i[1]),n(r.rows,i[0]));else{var a=n(r,i);s?l(a,0):l(0,a)}}}},{key:"onScrollPositionChange",value:function(t){var e=this,o=t.target,s=this.isBoth(),r=this.isHorizontal(),i=this.state,n=i.first,l=i.last,a=i.numItemsInViewport,c=i.numToleratedItems,h=this.props.itemSize,u=this.getContentPosition(),p=function(t,e){return t?t>e?t-e:t:0},f=function(t,e){return Math.floor(t/(e||t))},d=function(t,e,o,s,r,i){return t<=r?r:i?o-s-r:e+r-1},m=function(t,e,o,s,r,i,n){return t<=i?0:Math.max(0,n?t<e?o:t-i:t>e?o:t-2*i)},v=function(t,o,s,r,i,n){var l=o+r+2*i;return t>=i&&(l+=i+1),e.getLast(l,n)},g=p(o.scrollTop,u.top),y=p(o.scrollLeft,u.left),w=0,S=l,b=!1;if(s){var O=this.lastScrollPos.top<=g,I=this.lastScrollPos.left<=y,z={rows:f(g,h[0]),cols:f(y,h[1])},k={rows:d(z.rows,n.rows,l.rows,a.rows,c[0],O),cols:d(z.cols,n.cols,l.cols,a.cols,c[1],I)};w={rows:m(z.rows,k.rows,n.rows,0,0,c[0],O),cols:m(z.cols,k.cols,n.cols,0,0,c[1],I)},S={rows:v(z.rows,w.rows,0,a.rows,c[0]),cols:v(z.cols,w.cols,0,a.cols,c[1],!0)},b=w.rows!==n.rows&&S.rows!==l.rows||w.cols!==n.cols&&S.cols!==l.cols,this.lastScrollPos={top:g,left:y}}else{var P=r?y:g,T=this.lastScrollPos<=P,C=f(P,h);S=v(C,w=m(C,d(C,n,l,a,c,T),n,0,0,c,T),0,a,c),b=w!==n&&S!==l,this.lastScrollPos=P}return{first:w,last:S,isRangeChanged:b}}},{key:"onScrollChange",value:function(t){var e=this,o=this.onScrollPositionChange(t);if(o.isRangeChanged){var s={first:o.first,last:o.last};this.setContentPosition(s),this.setState(s,(function(){e.props.onScrollIndexChange&&e.props.onScrollIndexChange(s),e.props.lazy&&e.props.onLazyLoad&&e.props.onLazyLoad(s)}))}}},{key:"onScroll",value:function(t){var e=this;this.props.onScroll&&this.props.onScroll(t),this.props.delay?(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.state.loading&&this.props.showLoader&&this.onScrollPositionChange(t).isRangeChanged&&this.setState({loading:!0}),this.scrollTimeout=setTimeout((function(){e.onScrollChange(t),e.state.loading&&e.props.showLoader&&!e.props.lazy&&e.setState({loading:!1})}),this.props.delay)):this.onScrollChange(t)}},{key:"getOptions",value:function(t){var e=this.state.first,o=(this.props.items||[]).length,s=this.isBoth()?e.rows+t:e+t;return{index:s,count:o,first:0===s,last:s===o-1,even:s%2==0,odd:s%2!=0,props:this.props}}},{key:"loaderOptions",value:function(t,e){var o=this.state.loaderArr.length;return m({index:t,count:o,first:0===t,last:t===o-1,even:t%2==0,odd:t%2!=0,props:this.props},e)}},{key:"loadedItems",value:function(){var t=this,e=this.props.items;if(e&&!this.state.loading){var o=this.isBoth(),s=this.isHorizontal(),r=this.state,i=r.first,n=r.last;return o?e.slice(i.rows,n.rows).map((function(e){return t.props.columns?e:e.slice(i.cols,n.cols)})):s&&this.props.columns?e:e.slice(i,n)}return[]}},{key:"isPropChanged",value:function(t){var e=this;return["itemSize","scrollHeight"].some((function(s){return!o.ObjectUtils.equals(t[s],e.props[s])}))}},{key:"init",value:function(){this.setSize(),this.calculateOptions(),this.setSpacerSize()}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(t,e){t.items&&t.items.length===(this.props.items||[]).length&&!this.isPropChanged(t)||this.init(),this.props.lazy&&t.loading!==this.props.loading&&this.state.loading!==this.props.loading&&this.setState({loading:this.props.loading}),t.orientation!==this.props.orientation&&(this.lastScrollPos=this.isBoth()?{top:0,left:0}:0)}},{key:"renderLoaderItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.loaderOptions(t,e),i=o.ObjectUtils.getJSXElement(this.props.loadingTemplate,s);return r.default.createElement(r.default.Fragment,{key:t},i)}},{key:"renderLoader",value:function(){var t=this;if(!this.props.loaderDisabled&&this.props.showLoader&&this.state.loading){var e=o.classNames("p-virtualscroller-loader",{"p-component-overlay":!this.props.loadingTemplate}),s=r.default.createElement("i",{className:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"});if(this.props.loadingTemplate){var i=this.isBoth(),n=this.state.numItemsInViewport;s=this.state.loaderArr.map((function(e,o){return t.renderLoaderItem(o,i&&{numCols:n.cols})}))}return r.default.createElement("div",{className:e},s)}return null}},{key:"renderSpacer",value:function(){var t=this;return this.props.showSpacer?r.default.createElement("div",{ref:function(e){return t.spacer=e},className:"p-virtualscroller-spacer"}):null}},{key:"renderItem",value:function(t,e){var s=this.getOptions(e),i=o.ObjectUtils.getJSXElement(this.props.itemTemplate,t,s);return r.default.createElement(r.default.Fragment,{key:s.index},i)}},{key:"renderItems",value:function(t){var e=this;return t.map((function(t,o){return e.renderItem(t,o)}))}},{key:"renderContent",value:function(){var t=this,e=this.loadedItems(),s=this.renderItems(e),i=o.classNames("p-virtualscroller-content",{"p-virtualscroller-loading":this.state.loading}),n=r.default.createElement("div",{className:i,ref:function(e){return t.content=e}},s);if(this.props.contentTemplate){var l={className:i,contentRef:function(e){return t.content=e},spacerRef:function(e){return t.spacer=e},stickyRef:function(e){return t.sticky=e},items:e,getItemOptions:function(e){return t.getOptions(e)},children:s,element:n,props:this.props,loading:this.state.loading,getLoaderOptions:function(e,o){return t.loaderOptions(e,o)},loadingTemplate:this.props.loadingTemplate,itemSize:this.props.itemSize,rows:this.getRows(),columns:this.getColumns(),vertical:this.isVertical(),horizontal:this.isHorizontal(),both:this.isBoth()};return o.ObjectUtils.getJSXElement(this.props.contentTemplate,l)}return n}},{key:"render",value:function(){var t=this;if(this.props.disabled){var e=o.ObjectUtils.getJSXElement(this.props.contentTemplate,{items:this.props.items,rows:this.props.items,columns:this.props.columns});return r.default.createElement(r.default.Fragment,null,this.props.children,e)}var s=this.isBoth(),i=this.isHorizontal(),n=o.classNames("p-virtualscroller",{"p-both-scroll":s,"p-horizontal-scroll":i},this.props.className),l=this.renderLoader(),a=this.renderContent(),c=this.renderSpacer();return r.default.createElement("div",{ref:function(e){return t.el=e},className:n,tabIndex:0,style:this.props.style,onScroll:this.onScroll},a,c,l)}}],h&&n(a.prototype,h),f&&n(a,f),g}(e.Component);return f(g,"defaultProps",{id:null,style:null,className:null,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",numToleratedItems:null,delay:0,lazy:!1,disabled:!1,loaderDisabled:!1,columns:null,loading:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null}),t.VirtualScroller=g,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.utils);
1
+ this.primereact=this.primereact||{},this.primereact.virtualscroller=function(t,e,o){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=s(e);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function h(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function f(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function d(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function m(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?d(Object(o),!0).forEach((function(e){f(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}var g=function(t){c(g,t);var e,s,a,u,f,d=(e=g,s=v(),function(){var t,o=p(e);if(s){var r=p(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return h(this,t)});function g(t){var e;i(this,g);var o=(e=d.call(this,t)).isBoth();return e.state={first:o?{rows:0,cols:0}:0,last:o?{rows:0,cols:0}:0,numItemsInViewport:o?{rows:0,cols:0}:0,numToleratedItems:t.numToleratedItems,loading:t.loading,loaderArr:[]},e.onScroll=e.onScroll.bind(l(e)),e.lastScrollPos=o?{top:0,left:0}:0,e}return a=g,u=[{key:"scrollTo",value:function(t){this.el&&this.el.scrollTo(t)}},{key:"scrollToIndex",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",s=this.isBoth(),r=this.isHorizontal(),i=this.state.first,n=this.calculateNumItems(),l=n.numToleratedItems,a=this.props.itemSize,c=this.getContentPosition(),u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return t<=e?0:t},h=function(t,e,o){return t*e+o},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.scrollTo({left:t,top:s,behavior:o})};if(s){var f={rows:u(t[0],l[0]),cols:u(t[1],l[1])};f.rows===i.rows&&f.cols===i.cols||(p(h(f.cols,a[1],c.left),h(f.rows,a[0],c.top)),this.setState({first:f}))}else{var d=u(t,l);d!==i&&(r?p(h(d,a,c.left),0):p(0,h(d,a,c.top)),this.setState({first:d}))}}},{key:"scrollInView",value:function(t,e){var o=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){var r=this.isBoth(),i=this.isHorizontal(),n=this.getRenderedRange(),l=n.first,a=n.viewport,c=this.props.itemSize,u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o.scrollTo({left:t,top:e,behavior:s})},h="to-start"===e,p="to-end"===e;if(h){if(r)a.first.rows-l.rows>t[0]?u(a.first.cols*c,(a.first.rows-1)*c):a.first.cols-l.cols>t[1]&&u((a.first.cols-1)*c,a.first.rows*c);else if(a.first-l>t){var f=(a.first-1)*c;i?u(f,0):u(0,f)}}else if(p)if(r)a.last.rows-l.rows<=t[0]+1?u(a.first.cols*c,(a.first.rows+1)*c):a.last.cols-l.cols<=t[1]+1&&u((a.first.cols+1)*c,a.first.rows*c);else if(a.last-l<=t+1){var d=(a.first+1)*c;i?u(d,0):u(0,d)}}else this.scrollToIndex(t,s)}},{key:"getRows",value:function(){return this.state.loading?this.props.loaderDisabled?this.state.loaderArr:[]:this.loadedItems()}},{key:"getColumns",value:function(){if(this.props.columns){var t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.state.loading&&this.props.loaderDisabled?t?this.state.loaderArr[0]:this.state.loaderArr:this.props.columns.slice(t?this.state.first.cols:this.state.first,t?this.state.last.cols:this.state.last)}return this.props.columns}},{key:"getRenderedRange",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.state,s=o.first,r=o.last,i=o.numItemsInViewport,n=this.props.itemSize,l=function(t,e){return Math.floor(t/(e||t))},a=s,c=0;if(this.el){var u=this.el.scrollTop,h=this.el.scrollLeft;c=t?{rows:(a={rows:l(u,n[0]),cols:l(h,n[1])}).rows+i.rows,cols:a.cols+i.cols}:(a=l(e?h:u,n))+i}return{first:s,last:r,viewport:{first:a,last:c}}}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isBoth",value:function(){return"both"===this.props.orientation}},{key:"calculateNumItems",value:function(){var t=this.isBoth(),e=this.isHorizontal(),o=this.props.itemSize,s=this.getContentPosition(),r=this.el?this.el.offsetWidth-s.left:0,i=this.el?this.el.offsetHeight-s.top:0,n=function(t,e){return Math.ceil(t/(e||t))},l=function(t){return Math.ceil(t/2)},a=t?{rows:n(i,o[0]),cols:n(r,o[1])}:n(e?r:i,o);return{numItemsInViewport:a,numToleratedItems:this.state.numToleratedItems||(t?[l(a.rows),l(a.cols)]:l(a))}}},{key:"calculateOptions",value:function(){var t=this,e=this.isBoth(),o=this.state.first,s=this.calculateNumItems(),r=s.numItemsInViewport,i=s.numToleratedItems,n=function(e,o,s,r){return t.getLast(e+o+(e<s?2:3)*s,r)},l=e?{rows:n(o.rows,r.rows,i[0]),cols:n(o.cols,r.cols,i[1],!0)}:n(o,r,i),a={numItemsInViewport:r,last:l,numToleratedItems:i};this.props.showLoader&&(a.loaderArr=e?Array.from({length:r.rows}).map((function(){return Array.from({length:r.cols})})):Array.from({length:r})),this.setState(a,(function(){t.props.lazy&&t.props.onLazyLoad&&t.props.onLazyLoad({first:t.state.first,last:t.state.last})}))}},{key:"getLast",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return this.props.items?Math.min(e?(this.props.columns||this.props.items[0]).length:this.props.items.length,t):0}},{key:"getContentPosition",value:function(){if(this.content){var t=getComputedStyle(this.content),e=parseInt(t.paddingLeft,10)+Math.max(parseInt(t.left,10),0),o=parseInt(t.paddingRight,10)+Math.max(parseInt(t.right,10),0),s=parseInt(t.paddingTop,10)+Math.max(parseInt(t.top,10),0),r=parseInt(t.paddingBottom,10)+Math.max(parseInt(t.bottom,10),0);return{left:e,right:o,top:s,bottom:r,x:e+o,y:s+r}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}}},{key:"setSize",value:function(){var t=this;if(this.el){var e=this.isBoth(),o=this.isHorizontal(),s=this.el.parentElement,r=this.props.scrollWidth||"".concat(this.el.offsetWidth||s.offsetWidth,"px"),i=this.props.scrollHeight||"".concat(this.el.offsetHeight||s.offsetHeight,"px"),n=function(e,o){return t.el.style[e]=o};e||o?(n("height",i),n("width",r)):n("height",i)}}},{key:"setSpacerSize",value:function(){var t=this,e=this.props.items;if(this.spacer&&e){var o=this.isBoth(),s=this.isHorizontal(),r=this.props.itemSize,i=this.getContentPosition(),n=function(e,o,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.spacer.style[e]=(o||[]).length*s+r+"px"};o?(n("height",e,r[0],i.y),n("width",this.props.columns||e[1],r[1],i.x)):s?n("width",this.props.columns||e,r,i.x):n("height",e,r,i.y)}}},{key:"setContentPosition",value:function(t){var e=this;if(this.content){var o=this.isBoth(),s=this.isHorizontal(),r=t?t.first:this.state.first,i=this.props.itemSize,n=function(t,e){return t*e},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.sticky&&(e.sticky.style.top="-".concat(o,"px")),e.content.style.transform="translate3d(".concat(t,"px, ").concat(o,"px, 0)")};if(o)l(n(r.cols,i[1]),n(r.rows,i[0]));else{var a=n(r,i);s?l(a,0):l(0,a)}}}},{key:"onScrollPositionChange",value:function(t){var e=this,o=t.target,s=this.isBoth(),r=this.isHorizontal(),i=this.state,n=i.first,l=i.last,a=i.numItemsInViewport,c=i.numToleratedItems,u=this.props.itemSize,h=this.getContentPosition(),p=function(t,e){return t?t>e?t-e:t:0},f=function(t,e){return Math.floor(t/(e||t))},d=function(t,e,o,s,r,i){return t<=r?r:i?o-s-r:e+r-1},m=function(t,e,o,s,r,i,n){return t<=i?0:Math.max(0,n?t<e?o:t-i:t>e?o:t-2*i)},v=function(t,o,s,r,i,n){var l=o+r+2*i;return t>=i&&(l+=i+1),e.getLast(l,n)},g=p(o.scrollTop,h.top),y=p(o.scrollLeft,h.left),w=0,b=l,S=!1;if(s){var I=this.lastScrollPos.top<=g,O=this.lastScrollPos.left<=y,k={rows:f(g,u[0]),cols:f(y,u[1])},z={rows:d(k.rows,n.rows,l.rows,a.rows,c[0],I),cols:d(k.cols,n.cols,l.cols,a.cols,c[1],O)};w={rows:m(k.rows,z.rows,n.rows,0,0,c[0],I),cols:m(k.cols,z.cols,n.cols,0,0,c[1],O)},b={rows:v(k.rows,w.rows,0,a.rows,c[0]),cols:v(k.cols,w.cols,0,a.cols,c[1],!0)},S=w.rows!==n.rows&&b.rows!==l.rows||w.cols!==n.cols&&b.cols!==l.cols,this.lastScrollPos={top:g,left:y}}else{var P=r?y:g,T=this.lastScrollPos<=P,j=f(P,u);b=v(j,w=m(j,d(j,n,l,a,c,T),n,0,0,c,T),0,a,c),S=w!==n&&b!==l,this.lastScrollPos=P}return{first:w,last:b,isRangeChanged:S}}},{key:"onScrollChange",value:function(t){var e=this,o=this.onScrollPositionChange(t);if(o.isRangeChanged){var s={first:o.first,last:o.last};this.setContentPosition(s),this.setState(s,(function(){e.props.onScrollIndexChange&&e.props.onScrollIndexChange(s),e.props.lazy&&e.props.onLazyLoad&&e.props.onLazyLoad(s)}))}}},{key:"onScroll",value:function(t){var e=this;this.props.onScroll&&this.props.onScroll(t),this.props.delay?(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.state.loading&&this.props.showLoader&&this.onScrollPositionChange(t).isRangeChanged&&this.setState({loading:!0}),this.scrollTimeout=setTimeout((function(){e.onScrollChange(t),e.state.loading&&e.props.showLoader&&!e.props.lazy&&e.setState({loading:!1})}),this.props.delay)):this.onScrollChange(t)}},{key:"getOptions",value:function(t){var e=this.state.first,o=(this.props.items||[]).length,s=this.isBoth()?e.rows+t:e+t;return{index:s,count:o,first:0===s,last:s===o-1,even:s%2==0,odd:s%2!=0,props:this.props}}},{key:"loaderOptions",value:function(t,e){var o=this.state.loaderArr.length;return m({index:t,count:o,first:0===t,last:t===o-1,even:t%2==0,odd:t%2!=0,props:this.props},e)}},{key:"loadedItems",value:function(){var t=this,e=this.props.items;if(e&&!this.state.loading){var o=this.isBoth(),s=this.isHorizontal(),r=this.state,i=r.first,n=r.last;return o?e.slice(i.rows,n.rows).map((function(e){return t.props.columns?e:e.slice(i.cols,n.cols)})):s&&this.props.columns?e:e.slice(i,n)}return[]}},{key:"isPropChanged",value:function(t){var e=this;return["itemSize","scrollHeight"].some((function(s){return!o.ObjectUtils.equals(t[s],e.props[s])}))}},{key:"init",value:function(){this.setSize(),this.calculateOptions(),this.setSpacerSize()}},{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(t,e){t.items&&t.items.length===(this.props.items||[]).length&&!this.isPropChanged(t)||this.init(),this.props.lazy&&t.loading!==this.props.loading&&this.state.loading!==this.props.loading&&this.setState({loading:this.props.loading}),t.orientation!==this.props.orientation&&(this.lastScrollPos=this.isBoth()?{top:0,left:0}:0)}},{key:"renderLoaderItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.loaderOptions(t,e),i=o.ObjectUtils.getJSXElement(this.props.loadingTemplate,s);return r.default.createElement(r.default.Fragment,{key:t},i)}},{key:"renderLoader",value:function(){var t=this;if(!this.props.loaderDisabled&&this.props.showLoader&&this.state.loading){var e=o.classNames("p-virtualscroller-loader",{"p-component-overlay":!this.props.loadingTemplate}),s=r.default.createElement("i",{className:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"});if(this.props.loadingTemplate){var i=this.isBoth(),n=this.state.numItemsInViewport;s=this.state.loaderArr.map((function(e,o){return t.renderLoaderItem(o,i&&{numCols:n.cols})}))}return r.default.createElement("div",{className:e},s)}return null}},{key:"renderSpacer",value:function(){var t=this;return this.props.showSpacer?r.default.createElement("div",{ref:function(e){return t.spacer=e},className:"p-virtualscroller-spacer"}):null}},{key:"renderItem",value:function(t,e){var s=this.getOptions(e),i=o.ObjectUtils.getJSXElement(this.props.itemTemplate,t,s);return r.default.createElement(r.default.Fragment,{key:s.index},i)}},{key:"renderItems",value:function(t){var e=this;return t.map((function(t,o){return e.renderItem(t,o)}))}},{key:"renderContent",value:function(){var t=this,e=this.loadedItems(),s=this.renderItems(e),i=o.classNames("p-virtualscroller-content",{"p-virtualscroller-loading":this.state.loading}),n=r.default.createElement("div",{className:i,ref:function(e){return t.content=e}},s);if(this.props.contentTemplate){var l={className:i,contentRef:function(e){return t.content=e},spacerRef:function(e){return t.spacer=e},stickyRef:function(e){return t.sticky=e},items:e,getItemOptions:function(e){return t.getOptions(e)},children:s,element:n,props:this.props,loading:this.state.loading,getLoaderOptions:function(e,o){return t.loaderOptions(e,o)},loadingTemplate:this.props.loadingTemplate,itemSize:this.props.itemSize,rows:this.getRows(),columns:this.getColumns(),vertical:this.isVertical(),horizontal:this.isHorizontal(),both:this.isBoth()};return o.ObjectUtils.getJSXElement(this.props.contentTemplate,l)}return n}},{key:"render",value:function(){var t=this;if(this.props.disabled){var e=o.ObjectUtils.getJSXElement(this.props.contentTemplate,{items:this.props.items,rows:this.props.items,columns:this.props.columns});return r.default.createElement(r.default.Fragment,null,this.props.children,e)}var s=this.isBoth(),i=this.isHorizontal(),n=o.classNames("p-virtualscroller",{"p-both-scroll":s,"p-horizontal-scroll":i},this.props.className),l=this.renderLoader(),a=this.renderContent(),c=this.renderSpacer();return r.default.createElement("div",{ref:function(e){return t.el=e},className:n,tabIndex:0,style:this.props.style,onScroll:this.onScroll},a,c,l)}}],u&&n(a.prototype,u),f&&n(a,f),Object.defineProperty(a,"prototype",{writable:!1}),g}(e.Component);return f(g,"defaultProps",{id:null,style:null,className:null,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",numToleratedItems:null,delay:0,lazy:!1,disabled:!1,loaderDisabled:!1,columns:null,loading:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null}),t.VirtualScroller=g,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.utils);
package/web-types.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "framework": "React",
3
3
  "name": "PrimeReact",
4
- "version": "7.1.0",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/primefaces/primereact.git"
8
- },
9
- "license": "MIT",
4
+ "version": "7.2.0",
10
5
  "tags": [
11
6
  {
12
7
  "name": "Accordion",
@@ -2478,6 +2473,12 @@
2478
2473
  "default": "null",
2479
2474
  "description": "Property of a row data used for filtering, defaults to field."
2480
2475
  },
2476
+ {
2477
+ "name": "exportField",
2478
+ "type": "string",
2479
+ "default": "null",
2480
+ "description": "Property of a row data used for exporting, defaults to field."
2481
+ },
2481
2482
  {
2482
2483
  "name": "header",
2483
2484
  "type": "any",
@@ -3539,6 +3540,18 @@
3539
3540
  "default": "true",
3540
3541
  "description": "Determines whether the cell editor will be opened when clicking to select any row on Selection and Cell Edit modes."
3541
3542
  },
3543
+ {
3544
+ "name": "selectionPageOnly",
3545
+ "type": "boolean",
3546
+ "default": "false",
3547
+ "description": "When enabled with paginator and checkbox selection mode, the select all checkbox in the header will select all rows on the current page."
3548
+ },
3549
+ {
3550
+ "name": "selectionAutoFocus",
3551
+ "type": "boolean",
3552
+ "default": "true",
3553
+ "description": "When a selectable row is clicked on RadioButton and Checkbox selection, it automatically decides whether to focus on elements such as checkbox or radio."
3554
+ },
3542
3555
  {
3543
3556
  "name": "headerColumnGroup",
3544
3557
  "type": "ColumnGroup",
@@ -3791,6 +3804,12 @@
3791
3804
  "default": "null",
3792
3805
  "description": "Function that returns a boolean by passing the row data to decide if the row reorder element should be displayed per row."
3793
3806
  },
3807
+ {
3808
+ "name": "isDataSelectable",
3809
+ "type": "function",
3810
+ "default": "null",
3811
+ "description": "Function that returns a boolean to decide whether the data should be selectable."
3812
+ },
3794
3813
  {
3795
3814
  "name": "customSaveState",
3796
3815
  "type": "function",
@@ -6232,6 +6251,12 @@
6232
6251
  "default": "false",
6233
6252
  "description": "Controls the preview functionality."
6234
6253
  },
6254
+ {
6255
+ "name": "downloadable",
6256
+ "type": "boolean",
6257
+ "default": "false",
6258
+ "description": "Adds a download button to the preview control menu."
6259
+ },
6235
6260
  {
6236
6261
  "name": "imageStyle",
6237
6262
  "type": "any",
@@ -9907,7 +9932,7 @@
9907
9932
  "name": "dismissable",
9908
9933
  "type": "boolean",
9909
9934
  "default": "true",
9910
- "description": "Whether clicking outside closes the panel."
9935
+ "description": "Whether to dismiss sidebar on click of the mask."
9911
9936
  },
9912
9937
  {
9913
9938
  "name": "showCloseIcon",
@@ -11254,6 +11279,12 @@
11254
11279
  "type": "object",
11255
11280
  "default": "null",
11256
11281
  "description": "The properties of <a href=\"https://reactcommunity.org/react-transition-group/css-transition\" rel=\"noopener noreferrer\" target=\"_blank\">CSSTransition</a> can be customized, except for \"nodeRef\" and \"in\" properties."
11282
+ },
11283
+ {
11284
+ "name": "appendTo",
11285
+ "type": "DOM element | string",
11286
+ "default": "self",
11287
+ "description": "DOM element instance where the component should be mounted. Valid values are any DOM Element and 'self'. The <i>self</i> value is used to render a component where it is located."
11257
11288
  }
11258
11289
  ],
11259
11290
  "events": [
@@ -12736,6 +12767,12 @@
12736
12767
  "default": "No records found",
12737
12768
  "description": "Text to display when there is no data."
12738
12769
  },
12770
+ {
12771
+ "name": "rowHover",
12772
+ "type": "boolean",
12773
+ "default": "false",
12774
+ "description": "When enabled, background of the rows change on hover.."
12775
+ },
12739
12776
  {
12740
12777
  "name": "showGridlines",
12741
12778
  "type": "boolean",