primereact 6.5.0 → 7.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (686) hide show
  1. package/accordion/accordion.cjs.js +2 -0
  2. package/accordion/accordion.cjs.min.js +1 -1
  3. package/accordion/accordion.esm.js +2 -0
  4. package/accordion/accordion.esm.min.js +1 -1
  5. package/accordion/accordion.js +2 -0
  6. package/accordion/accordion.min.js +1 -1
  7. package/api/api.cjs.js +308 -10
  8. package/api/api.cjs.min.js +1 -1
  9. package/api/api.d.ts +61 -1
  10. package/api/api.esm.js +305 -11
  11. package/api/api.esm.min.js +1 -1
  12. package/api/api.js +308 -12
  13. package/api/api.min.js +1 -1
  14. package/autocomplete/autocomplete.cjs.js +3 -1
  15. package/autocomplete/autocomplete.cjs.min.js +1 -1
  16. package/autocomplete/autocomplete.esm.js +3 -1
  17. package/autocomplete/autocomplete.esm.min.js +1 -1
  18. package/autocomplete/autocomplete.js +3 -1
  19. package/autocomplete/autocomplete.min.js +1 -1
  20. package/avatar/avatar.cjs.js +2 -0
  21. package/avatar/avatar.cjs.min.js +1 -1
  22. package/avatar/avatar.esm.js +2 -0
  23. package/avatar/avatar.esm.min.js +1 -1
  24. package/avatar/avatar.js +2 -0
  25. package/avatar/avatar.min.js +1 -1
  26. package/avatargroup/avatargroup.cjs.js +2 -0
  27. package/avatargroup/avatargroup.cjs.min.js +1 -1
  28. package/avatargroup/avatargroup.esm.js +2 -0
  29. package/avatargroup/avatargroup.esm.min.js +1 -1
  30. package/avatargroup/avatargroup.js +2 -0
  31. package/avatargroup/avatargroup.min.js +1 -1
  32. package/badge/badge.cjs.js +2 -0
  33. package/badge/badge.cjs.min.js +1 -1
  34. package/badge/badge.esm.js +2 -0
  35. package/badge/badge.esm.min.js +1 -1
  36. package/badge/badge.js +2 -0
  37. package/badge/badge.min.js +1 -1
  38. package/blockui/blockui.cjs.js +9 -15
  39. package/blockui/blockui.cjs.min.js +1 -1
  40. package/blockui/blockui.esm.js +9 -15
  41. package/blockui/blockui.esm.min.js +1 -1
  42. package/blockui/blockui.js +9 -15
  43. package/blockui/blockui.min.css +1 -1
  44. package/blockui/blockui.min.js +1 -1
  45. package/breadcrumb/breadcrumb.cjs.js +2 -0
  46. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  47. package/breadcrumb/breadcrumb.esm.js +2 -0
  48. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  49. package/breadcrumb/breadcrumb.js +2 -0
  50. package/breadcrumb/breadcrumb.min.css +1 -1
  51. package/breadcrumb/breadcrumb.min.js +1 -1
  52. package/button/button.cjs.js +2 -0
  53. package/button/button.cjs.min.js +1 -1
  54. package/button/button.esm.js +2 -0
  55. package/button/button.esm.min.js +1 -1
  56. package/button/button.js +2 -0
  57. package/button/button.min.js +1 -1
  58. package/calendar/calendar.cjs.js +85 -67
  59. package/calendar/calendar.cjs.min.js +1 -1
  60. package/calendar/calendar.esm.js +85 -67
  61. package/calendar/calendar.esm.min.js +1 -1
  62. package/calendar/calendar.js +85 -67
  63. package/calendar/calendar.min.js +1 -1
  64. package/captcha/captcha.cjs.js +2 -0
  65. package/captcha/captcha.cjs.min.js +1 -1
  66. package/captcha/captcha.esm.js +2 -0
  67. package/captcha/captcha.esm.min.js +1 -1
  68. package/captcha/captcha.js +2 -0
  69. package/captcha/captcha.min.js +1 -1
  70. package/card/card.cjs.js +2 -0
  71. package/card/card.cjs.min.js +1 -1
  72. package/card/card.esm.js +2 -0
  73. package/card/card.esm.min.js +1 -1
  74. package/card/card.js +2 -0
  75. package/card/card.min.js +1 -1
  76. package/carousel/carousel.cjs.js +2 -0
  77. package/carousel/carousel.cjs.min.js +1 -1
  78. package/carousel/carousel.esm.js +3 -1
  79. package/carousel/carousel.esm.min.js +1 -1
  80. package/carousel/carousel.js +2 -0
  81. package/carousel/carousel.min.js +1 -1
  82. package/cascadeselect/cascadeselect.cjs.js +2 -0
  83. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  84. package/cascadeselect/cascadeselect.esm.js +2 -0
  85. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  86. package/cascadeselect/cascadeselect.js +2 -0
  87. package/cascadeselect/cascadeselect.min.js +1 -1
  88. package/chart/chart.cjs.js +2 -0
  89. package/chart/chart.cjs.min.js +1 -1
  90. package/chart/chart.esm.js +2 -0
  91. package/chart/chart.esm.min.js +1 -1
  92. package/chart/chart.js +2 -0
  93. package/chart/chart.min.js +1 -1
  94. package/checkbox/checkbox.cjs.js +19 -9
  95. package/checkbox/checkbox.cjs.min.js +1 -1
  96. package/checkbox/checkbox.d.ts +3 -1
  97. package/checkbox/checkbox.esm.js +19 -9
  98. package/checkbox/checkbox.esm.min.js +1 -1
  99. package/checkbox/checkbox.js +19 -9
  100. package/checkbox/checkbox.min.css +1 -1
  101. package/checkbox/checkbox.min.js +1 -1
  102. package/chip/chip.cjs.js +2 -0
  103. package/chip/chip.cjs.min.js +1 -1
  104. package/chip/chip.esm.js +2 -0
  105. package/chip/chip.esm.min.js +1 -1
  106. package/chip/chip.js +2 -0
  107. package/chip/chip.min.js +1 -1
  108. package/chips/chips.cjs.js +2 -0
  109. package/chips/chips.cjs.min.js +1 -1
  110. package/chips/chips.esm.js +2 -0
  111. package/chips/chips.esm.min.js +1 -1
  112. package/chips/chips.js +2 -0
  113. package/chips/chips.min.js +1 -1
  114. package/colorpicker/colorpicker.cjs.js +2 -0
  115. package/colorpicker/colorpicker.cjs.min.js +1 -1
  116. package/colorpicker/colorpicker.esm.js +2 -0
  117. package/colorpicker/colorpicker.esm.min.js +1 -1
  118. package/colorpicker/colorpicker.js +2 -0
  119. package/colorpicker/colorpicker.min.js +1 -1
  120. package/column/column.cjs.js +34 -9
  121. package/column/column.cjs.min.js +1 -1
  122. package/column/column.d.ts +146 -13
  123. package/column/column.esm.js +34 -9
  124. package/column/column.esm.min.js +1 -1
  125. package/column/column.js +34 -9
  126. package/column/column.min.js +1 -1
  127. package/columngroup/columngroup.cjs.js +2 -0
  128. package/columngroup/columngroup.cjs.min.js +1 -1
  129. package/columngroup/columngroup.esm.js +2 -0
  130. package/columngroup/columngroup.esm.min.js +1 -1
  131. package/columngroup/columngroup.js +2 -0
  132. package/columngroup/columngroup.min.js +1 -1
  133. package/common/common.min.css +1 -1
  134. package/confirmdialog/confirmdialog.cjs.js +2 -0
  135. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  136. package/confirmdialog/confirmdialog.esm.js +2 -0
  137. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  138. package/confirmdialog/confirmdialog.js +2 -0
  139. package/confirmdialog/confirmdialog.min.js +1 -1
  140. package/confirmpopup/confirmpopup.cjs.js +2 -0
  141. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  142. package/confirmpopup/confirmpopup.esm.js +2 -0
  143. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  144. package/confirmpopup/confirmpopup.js +2 -0
  145. package/confirmpopup/confirmpopup.min.js +1 -1
  146. package/contextmenu/contextmenu.cjs.js +2 -0
  147. package/contextmenu/contextmenu.cjs.min.js +1 -1
  148. package/contextmenu/contextmenu.esm.js +3 -1
  149. package/contextmenu/contextmenu.esm.min.js +1 -1
  150. package/contextmenu/contextmenu.js +2 -0
  151. package/contextmenu/contextmenu.min.js +1 -1
  152. package/core/core.cjs.js +351 -669
  153. package/core/core.cjs.min.js +1 -1
  154. package/core/core.esm.js +347 -665
  155. package/core/core.esm.min.js +1 -1
  156. package/core/core.js +352 -671
  157. package/core/core.min.js +1 -1
  158. package/csstransition/csstransition.cjs.js +2 -0
  159. package/csstransition/csstransition.cjs.min.js +1 -1
  160. package/csstransition/csstransition.esm.js +2 -0
  161. package/csstransition/csstransition.esm.min.js +1 -1
  162. package/csstransition/csstransition.js +2 -0
  163. package/csstransition/csstransition.min.js +1 -1
  164. package/datascroller/datascroller.cjs.js +8 -1
  165. package/datascroller/datascroller.cjs.min.js +1 -1
  166. package/datascroller/datascroller.esm.js +8 -1
  167. package/datascroller/datascroller.esm.min.js +1 -1
  168. package/datascroller/datascroller.js +8 -1
  169. package/datascroller/datascroller.min.js +1 -1
  170. package/datatable/datatable.cjs.js +4803 -3320
  171. package/datatable/datatable.cjs.min.js +1 -1
  172. package/datatable/datatable.d.ts +97 -28
  173. package/datatable/datatable.esm.js +4803 -3321
  174. package/datatable/datatable.esm.min.js +1 -1
  175. package/datatable/datatable.js +4801 -3322
  176. package/datatable/datatable.min.css +1 -1
  177. package/datatable/datatable.min.js +1 -1
  178. package/dataview/dataview.cjs.js +4 -2
  179. package/dataview/dataview.cjs.min.js +1 -1
  180. package/dataview/dataview.esm.js +4 -2
  181. package/dataview/dataview.esm.min.js +1 -1
  182. package/dataview/dataview.js +4 -2
  183. package/dataview/dataview.min.js +1 -1
  184. package/deferredcontent/deferredcontent.cjs.js +2 -0
  185. package/deferredcontent/deferredcontent.cjs.min.js +1 -1
  186. package/deferredcontent/deferredcontent.esm.js +2 -0
  187. package/deferredcontent/deferredcontent.esm.min.js +1 -1
  188. package/deferredcontent/deferredcontent.js +2 -0
  189. package/deferredcontent/deferredcontent.min.js +1 -1
  190. package/dialog/dialog.cjs.js +12 -1
  191. package/dialog/dialog.cjs.min.js +1 -1
  192. package/dialog/dialog.esm.js +12 -1
  193. package/dialog/dialog.esm.min.js +1 -1
  194. package/dialog/dialog.js +12 -1
  195. package/dialog/dialog.min.js +1 -1
  196. package/divider/divider.cjs.js +2 -0
  197. package/divider/divider.cjs.min.js +1 -1
  198. package/divider/divider.esm.js +2 -0
  199. package/divider/divider.esm.min.js +1 -1
  200. package/divider/divider.js +2 -0
  201. package/divider/divider.min.js +1 -1
  202. package/dock/dock.cjs.js +5 -1
  203. package/dock/dock.cjs.min.js +1 -1
  204. package/dock/dock.esm.js +5 -1
  205. package/dock/dock.esm.min.js +1 -1
  206. package/dock/dock.js +5 -1
  207. package/dock/dock.min.css +1 -1
  208. package/dock/dock.min.js +1 -1
  209. package/dropdown/dropdown.cjs.js +15 -11
  210. package/dropdown/dropdown.cjs.min.js +1 -1
  211. package/dropdown/dropdown.esm.js +17 -13
  212. package/dropdown/dropdown.esm.min.js +1 -1
  213. package/dropdown/dropdown.js +15 -11
  214. package/dropdown/dropdown.min.js +1 -1
  215. package/editor/editor.cjs.js +2 -0
  216. package/editor/editor.cjs.min.js +1 -1
  217. package/editor/editor.esm.js +2 -0
  218. package/editor/editor.esm.min.js +1 -1
  219. package/editor/editor.js +2 -0
  220. package/editor/editor.min.js +1 -1
  221. package/fieldset/fieldset.cjs.js +2 -0
  222. package/fieldset/fieldset.cjs.min.js +1 -1
  223. package/fieldset/fieldset.esm.js +2 -0
  224. package/fieldset/fieldset.esm.min.js +1 -1
  225. package/fieldset/fieldset.js +2 -0
  226. package/fieldset/fieldset.min.js +1 -1
  227. package/fileupload/fileupload.cjs.js +2 -0
  228. package/fileupload/fileupload.cjs.min.js +1 -1
  229. package/fileupload/fileupload.esm.js +2 -0
  230. package/fileupload/fileupload.esm.min.js +1 -1
  231. package/fileupload/fileupload.js +2 -0
  232. package/fileupload/fileupload.min.js +1 -1
  233. package/fullcalendar/fullcalendar.cjs.js +2 -0
  234. package/fullcalendar/fullcalendar.cjs.min.js +1 -1
  235. package/fullcalendar/fullcalendar.esm.js +2 -0
  236. package/fullcalendar/fullcalendar.esm.min.js +1 -1
  237. package/fullcalendar/fullcalendar.js +2 -0
  238. package/fullcalendar/fullcalendar.min.js +1 -1
  239. package/galleria/galleria.cjs.js +25 -5
  240. package/galleria/galleria.cjs.min.js +1 -1
  241. package/galleria/galleria.esm.js +25 -5
  242. package/galleria/galleria.esm.min.js +1 -1
  243. package/galleria/galleria.js +25 -5
  244. package/galleria/galleria.min.css +1 -1
  245. package/galleria/galleria.min.js +1 -1
  246. package/gmap/gmap.cjs.js +2 -0
  247. package/gmap/gmap.cjs.min.js +1 -1
  248. package/gmap/gmap.esm.js +2 -0
  249. package/gmap/gmap.esm.min.js +1 -1
  250. package/gmap/gmap.js +2 -0
  251. package/gmap/gmap.min.js +1 -1
  252. package/image/image.cjs.js +397 -0
  253. package/image/image.cjs.min.js +1 -0
  254. package/image/image.d.ts +18 -0
  255. package/image/image.esm.js +389 -0
  256. package/image/image.esm.min.js +1 -0
  257. package/image/image.js +400 -0
  258. package/image/image.min.css +1 -0
  259. package/image/image.min.js +1 -0
  260. package/image/package.json +6 -0
  261. package/inplace/inplace.cjs.js +2 -0
  262. package/inplace/inplace.cjs.min.js +1 -1
  263. package/inplace/inplace.esm.js +2 -0
  264. package/inplace/inplace.esm.min.js +1 -1
  265. package/inplace/inplace.js +2 -0
  266. package/inplace/inplace.min.js +1 -1
  267. package/inputmask/inputmask.cjs.js +2 -0
  268. package/inputmask/inputmask.cjs.min.js +1 -1
  269. package/inputmask/inputmask.esm.js +2 -0
  270. package/inputmask/inputmask.esm.min.js +1 -1
  271. package/inputmask/inputmask.js +2 -0
  272. package/inputmask/inputmask.min.js +1 -1
  273. package/inputnumber/inputnumber.cjs.js +177 -62
  274. package/inputnumber/inputnumber.cjs.min.js +1 -1
  275. package/inputnumber/inputnumber.d.ts +1 -0
  276. package/inputnumber/inputnumber.esm.js +177 -62
  277. package/inputnumber/inputnumber.esm.min.js +1 -1
  278. package/inputnumber/inputnumber.js +177 -62
  279. package/inputnumber/inputnumber.min.js +1 -1
  280. package/inputswitch/inputswitch.cjs.js +16 -6
  281. package/inputswitch/inputswitch.cjs.min.js +1 -1
  282. package/inputswitch/inputswitch.d.ts +3 -1
  283. package/inputswitch/inputswitch.esm.js +16 -6
  284. package/inputswitch/inputswitch.esm.min.js +1 -1
  285. package/inputswitch/inputswitch.js +16 -6
  286. package/inputswitch/inputswitch.min.js +1 -1
  287. package/inputtext/inputtext.cjs.js +2 -0
  288. package/inputtext/inputtext.cjs.min.js +1 -1
  289. package/inputtext/inputtext.esm.js +2 -0
  290. package/inputtext/inputtext.esm.min.js +1 -1
  291. package/inputtext/inputtext.js +2 -0
  292. package/inputtext/inputtext.min.js +1 -1
  293. package/inputtextarea/inputtextarea.cjs.js +2 -0
  294. package/inputtextarea/inputtextarea.cjs.min.js +1 -1
  295. package/inputtextarea/inputtextarea.esm.js +2 -0
  296. package/inputtextarea/inputtextarea.esm.min.js +1 -1
  297. package/inputtextarea/inputtextarea.js +2 -0
  298. package/inputtextarea/inputtextarea.min.js +1 -1
  299. package/knob/knob.cjs.js +2 -0
  300. package/knob/knob.cjs.min.js +1 -1
  301. package/knob/knob.esm.js +2 -0
  302. package/knob/knob.esm.min.js +1 -1
  303. package/knob/knob.js +2 -0
  304. package/knob/knob.min.js +1 -1
  305. package/listbox/listbox.cjs.js +6 -3
  306. package/listbox/listbox.cjs.min.js +1 -1
  307. package/listbox/listbox.esm.js +7 -4
  308. package/listbox/listbox.esm.min.js +1 -1
  309. package/listbox/listbox.js +7 -5
  310. package/listbox/listbox.min.js +1 -1
  311. package/megamenu/megamenu.cjs.js +2 -0
  312. package/megamenu/megamenu.cjs.min.js +1 -1
  313. package/megamenu/megamenu.esm.js +2 -0
  314. package/megamenu/megamenu.esm.min.js +1 -1
  315. package/megamenu/megamenu.js +2 -0
  316. package/megamenu/megamenu.min.js +1 -1
  317. package/mention/mention.cjs.js +2 -0
  318. package/mention/mention.cjs.min.js +1 -1
  319. package/mention/mention.esm.js +2 -0
  320. package/mention/mention.esm.min.js +1 -1
  321. package/mention/mention.js +2 -0
  322. package/mention/mention.min.js +1 -1
  323. package/menu/menu.cjs.js +2 -0
  324. package/menu/menu.cjs.min.js +1 -1
  325. package/menu/menu.d.ts +1 -1
  326. package/menu/menu.esm.js +2 -0
  327. package/menu/menu.esm.min.js +1 -1
  328. package/menu/menu.js +2 -0
  329. package/menu/menu.min.js +1 -1
  330. package/menubar/menubar.cjs.js +2 -0
  331. package/menubar/menubar.cjs.min.js +1 -1
  332. package/menubar/menubar.esm.js +2 -0
  333. package/menubar/menubar.esm.min.js +1 -1
  334. package/menubar/menubar.js +2 -0
  335. package/menubar/menubar.min.js +1 -1
  336. package/message/message.cjs.js +2 -0
  337. package/message/message.cjs.min.js +1 -1
  338. package/message/message.esm.js +2 -0
  339. package/message/message.esm.min.js +1 -1
  340. package/message/message.js +2 -0
  341. package/message/message.min.js +1 -1
  342. package/messages/messages.cjs.js +2 -0
  343. package/messages/messages.cjs.min.js +1 -1
  344. package/messages/messages.esm.js +2 -0
  345. package/messages/messages.esm.min.js +1 -1
  346. package/messages/messages.js +2 -0
  347. package/messages/messages.min.js +1 -1
  348. package/multiselect/multiselect.cjs.js +22 -12
  349. package/multiselect/multiselect.cjs.min.js +1 -1
  350. package/multiselect/multiselect.d.ts +3 -1
  351. package/multiselect/multiselect.esm.js +24 -14
  352. package/multiselect/multiselect.esm.min.js +1 -1
  353. package/multiselect/multiselect.js +22 -12
  354. package/multiselect/multiselect.min.js +1 -1
  355. package/multistatecheckbox/multistatecheckbox.cjs.js +2 -0
  356. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  357. package/multistatecheckbox/multistatecheckbox.esm.js +2 -0
  358. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  359. package/multistatecheckbox/multistatecheckbox.js +2 -0
  360. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  361. package/orderlist/orderlist.cjs.js +2 -0
  362. package/orderlist/orderlist.cjs.min.js +1 -1
  363. package/orderlist/orderlist.esm.js +2 -0
  364. package/orderlist/orderlist.esm.min.js +1 -1
  365. package/orderlist/orderlist.js +2 -0
  366. package/orderlist/orderlist.min.js +1 -1
  367. package/organizationchart/organizationchart.cjs.js +2 -0
  368. package/organizationchart/organizationchart.cjs.min.js +1 -1
  369. package/organizationchart/organizationchart.esm.js +2 -0
  370. package/organizationchart/organizationchart.esm.min.js +1 -1
  371. package/organizationchart/organizationchart.js +2 -0
  372. package/organizationchart/organizationchart.min.js +1 -1
  373. package/overlaypanel/overlaypanel.cjs.js +10 -1
  374. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  375. package/overlaypanel/overlaypanel.esm.js +10 -1
  376. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  377. package/overlaypanel/overlaypanel.js +10 -1
  378. package/overlaypanel/overlaypanel.min.js +1 -1
  379. package/package.json +1 -1
  380. package/paginator/paginator.cjs.js +120 -30
  381. package/paginator/paginator.cjs.min.js +1 -1
  382. package/paginator/paginator.d.ts +13 -0
  383. package/paginator/paginator.esm.js +120 -30
  384. package/paginator/paginator.esm.min.js +1 -1
  385. package/paginator/paginator.js +121 -32
  386. package/paginator/paginator.min.js +1 -1
  387. package/panel/panel.cjs.js +2 -0
  388. package/panel/panel.cjs.min.js +1 -1
  389. package/panel/panel.esm.js +2 -0
  390. package/panel/panel.esm.min.js +1 -1
  391. package/panel/panel.js +2 -0
  392. package/panel/panel.min.js +1 -1
  393. package/panelmenu/panelmenu.cjs.js +2 -0
  394. package/panelmenu/panelmenu.cjs.min.js +1 -1
  395. package/panelmenu/panelmenu.esm.js +3 -1
  396. package/panelmenu/panelmenu.esm.min.js +1 -1
  397. package/panelmenu/panelmenu.js +2 -0
  398. package/panelmenu/panelmenu.min.js +1 -1
  399. package/password/password.cjs.js +2 -0
  400. package/password/password.cjs.min.js +1 -1
  401. package/password/password.esm.js +2 -0
  402. package/password/password.esm.min.js +1 -1
  403. package/password/password.js +2 -0
  404. package/password/password.min.js +1 -1
  405. package/picklist/picklist.cjs.js +2 -0
  406. package/picklist/picklist.cjs.min.js +1 -1
  407. package/picklist/picklist.esm.js +2 -0
  408. package/picklist/picklist.esm.min.js +1 -1
  409. package/picklist/picklist.js +2 -0
  410. package/picklist/picklist.min.js +1 -1
  411. package/portal/portal.cjs.js +6 -2
  412. package/portal/portal.cjs.min.js +1 -1
  413. package/portal/portal.esm.js +6 -2
  414. package/portal/portal.esm.min.js +1 -1
  415. package/portal/portal.js +6 -2
  416. package/portal/portal.min.js +1 -1
  417. package/primereact.all.cjs.js +12344 -9903
  418. package/primereact.all.cjs.min.js +1 -1
  419. package/primereact.all.esm.js +12340 -9903
  420. package/primereact.all.esm.min.js +1 -1
  421. package/primereact.all.js +12344 -9903
  422. package/primereact.all.min.js +1 -1
  423. package/progressbar/progressbar.cjs.js +2 -0
  424. package/progressbar/progressbar.cjs.min.js +1 -1
  425. package/progressbar/progressbar.esm.js +2 -0
  426. package/progressbar/progressbar.esm.min.js +1 -1
  427. package/progressbar/progressbar.js +2 -0
  428. package/progressbar/progressbar.min.js +1 -1
  429. package/progressspinner/progressspinner.cjs.js +2 -0
  430. package/progressspinner/progressspinner.cjs.min.js +1 -1
  431. package/progressspinner/progressspinner.esm.js +2 -0
  432. package/progressspinner/progressspinner.esm.min.js +1 -1
  433. package/progressspinner/progressspinner.js +2 -0
  434. package/progressspinner/progressspinner.min.js +1 -1
  435. package/radiobutton/radiobutton.cjs.js +2 -0
  436. package/radiobutton/radiobutton.cjs.min.js +1 -1
  437. package/radiobutton/radiobutton.esm.js +2 -0
  438. package/radiobutton/radiobutton.esm.min.js +1 -1
  439. package/radiobutton/radiobutton.js +2 -0
  440. package/radiobutton/radiobutton.min.js +1 -1
  441. package/rating/rating.cjs.js +2 -0
  442. package/rating/rating.cjs.min.js +1 -1
  443. package/rating/rating.esm.js +2 -0
  444. package/rating/rating.esm.min.js +1 -1
  445. package/rating/rating.js +2 -0
  446. package/rating/rating.min.js +1 -1
  447. package/resources/primereact.css +340 -84
  448. package/resources/primereact.min.css +1 -1
  449. package/resources/themes/arya-blue/theme.css +4600 -3838
  450. package/resources/themes/arya-green/theme.css +4600 -3838
  451. package/resources/themes/arya-orange/theme.css +4600 -3838
  452. package/resources/themes/arya-purple/theme.css +4600 -3838
  453. package/resources/themes/bootstrap4-dark-blue/theme.css +4601 -3837
  454. package/resources/themes/bootstrap4-dark-purple/theme.css +4601 -3837
  455. package/resources/themes/bootstrap4-light-blue/theme.css +4579 -3815
  456. package/resources/themes/bootstrap4-light-purple/theme.css +4579 -3815
  457. package/resources/themes/fluent-light/theme.css +4690 -3897
  458. package/resources/themes/luna-amber/theme.css +4555 -3807
  459. package/resources/themes/luna-blue/theme.css +4551 -3803
  460. package/resources/themes/luna-green/theme.css +4551 -3803
  461. package/resources/themes/luna-pink/theme.css +4555 -3807
  462. package/resources/themes/md-dark-deeppurple/theme.css +5580 -4689
  463. package/resources/themes/md-dark-indigo/theme.css +5578 -4687
  464. package/resources/themes/md-light-deeppurple/theme.css +5569 -4678
  465. package/resources/themes/md-light-indigo/theme.css +5569 -4678
  466. package/resources/themes/mdc-dark-deeppurple/theme.css +5575 -4684
  467. package/resources/themes/mdc-dark-indigo/theme.css +5583 -4692
  468. package/resources/themes/mdc-light-deeppurple/theme.css +5579 -4688
  469. package/resources/themes/mdc-light-indigo/theme.css +5579 -4688
  470. package/resources/themes/nova/theme.css +4554 -3802
  471. package/resources/themes/nova-accent/theme.css +4571 -3818
  472. package/resources/themes/nova-alt/theme.css +4560 -3806
  473. package/resources/themes/rhea/theme.css +4562 -3813
  474. package/resources/themes/saga-blue/theme.css +4608 -3847
  475. package/resources/themes/saga-green/theme.css +4608 -3847
  476. package/resources/themes/saga-orange/theme.css +4608 -3847
  477. package/resources/themes/saga-purple/theme.css +4607 -3846
  478. package/resources/themes/tailwind-light/fonts/Inter-Bold.woff +0 -0
  479. package/resources/themes/tailwind-light/fonts/Inter-Bold.woff2 +0 -0
  480. package/resources/themes/tailwind-light/fonts/Inter-Light.woff +0 -0
  481. package/resources/themes/tailwind-light/fonts/Inter-Light.woff2 +0 -0
  482. package/resources/themes/tailwind-light/fonts/Inter-Medium.woff +0 -0
  483. package/resources/themes/tailwind-light/fonts/Inter-Medium.woff2 +0 -0
  484. package/resources/themes/tailwind-light/fonts/Inter-Regular.woff +0 -0
  485. package/resources/themes/tailwind-light/fonts/Inter-Regular.woff2 +0 -0
  486. package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff +0 -0
  487. package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff2 +0 -0
  488. package/resources/themes/tailwind-light/theme.css +5722 -0
  489. package/resources/themes/vela-blue/theme.css +4602 -3840
  490. package/resources/themes/vela-green/theme.css +4602 -3840
  491. package/resources/themes/vela-orange/theme.css +4602 -3840
  492. package/resources/themes/vela-purple/theme.css +4602 -3840
  493. package/ripple/ripple.cjs.js +2 -0
  494. package/ripple/ripple.cjs.min.js +1 -1
  495. package/ripple/ripple.esm.js +2 -0
  496. package/ripple/ripple.esm.min.js +1 -1
  497. package/ripple/ripple.js +2 -0
  498. package/ripple/ripple.min.js +1 -1
  499. package/row/row.cjs.js +2 -0
  500. package/row/row.cjs.min.js +1 -1
  501. package/row/row.esm.js +2 -0
  502. package/row/row.esm.min.js +1 -1
  503. package/row/row.js +2 -0
  504. package/row/row.min.js +1 -1
  505. package/scrollpanel/scrollpanel.cjs.js +2 -0
  506. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  507. package/scrollpanel/scrollpanel.esm.js +2 -0
  508. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  509. package/scrollpanel/scrollpanel.js +2 -0
  510. package/scrollpanel/scrollpanel.min.js +1 -1
  511. package/scrolltop/scrolltop.cjs.js +2 -0
  512. package/scrolltop/scrolltop.cjs.min.js +1 -1
  513. package/scrolltop/scrolltop.esm.js +2 -0
  514. package/scrolltop/scrolltop.esm.min.js +1 -1
  515. package/scrolltop/scrolltop.js +2 -0
  516. package/scrolltop/scrolltop.min.js +1 -1
  517. package/selectbutton/selectbutton.cjs.js +2 -0
  518. package/selectbutton/selectbutton.cjs.min.js +1 -1
  519. package/selectbutton/selectbutton.esm.js +2 -0
  520. package/selectbutton/selectbutton.esm.min.js +1 -1
  521. package/selectbutton/selectbutton.js +2 -0
  522. package/selectbutton/selectbutton.min.js +1 -1
  523. package/sidebar/sidebar.cjs.js +23 -27
  524. package/sidebar/sidebar.cjs.min.js +1 -1
  525. package/sidebar/sidebar.esm.js +23 -27
  526. package/sidebar/sidebar.esm.min.js +1 -1
  527. package/sidebar/sidebar.js +23 -27
  528. package/sidebar/sidebar.min.css +1 -1
  529. package/sidebar/sidebar.min.js +1 -1
  530. package/skeleton/skeleton.cjs.js +2 -0
  531. package/skeleton/skeleton.cjs.min.js +1 -1
  532. package/skeleton/skeleton.esm.js +2 -0
  533. package/skeleton/skeleton.esm.min.js +1 -1
  534. package/skeleton/skeleton.js +2 -0
  535. package/skeleton/skeleton.min.js +1 -1
  536. package/slidemenu/slidemenu.cjs.js +2 -0
  537. package/slidemenu/slidemenu.cjs.min.js +1 -1
  538. package/slidemenu/slidemenu.esm.js +2 -0
  539. package/slidemenu/slidemenu.esm.min.js +1 -1
  540. package/slidemenu/slidemenu.js +2 -0
  541. package/slidemenu/slidemenu.min.js +1 -1
  542. package/slider/slider.cjs.js +14 -7
  543. package/slider/slider.cjs.min.js +1 -1
  544. package/slider/slider.esm.js +14 -7
  545. package/slider/slider.esm.min.js +1 -1
  546. package/slider/slider.js +14 -7
  547. package/slider/slider.min.js +1 -1
  548. package/speeddial/speeddial.cjs.js +2 -0
  549. package/speeddial/speeddial.cjs.min.js +1 -1
  550. package/speeddial/speeddial.esm.js +2 -0
  551. package/speeddial/speeddial.esm.min.js +1 -1
  552. package/speeddial/speeddial.js +2 -0
  553. package/speeddial/speeddial.min.css +1 -1
  554. package/speeddial/speeddial.min.js +1 -1
  555. package/splitbutton/splitbutton.cjs.js +2 -0
  556. package/splitbutton/splitbutton.cjs.min.js +1 -1
  557. package/splitbutton/splitbutton.esm.js +2 -0
  558. package/splitbutton/splitbutton.esm.min.js +1 -1
  559. package/splitbutton/splitbutton.js +2 -0
  560. package/splitbutton/splitbutton.min.js +1 -1
  561. package/splitter/splitter.cjs.js +2 -0
  562. package/splitter/splitter.cjs.min.js +1 -1
  563. package/splitter/splitter.esm.js +2 -0
  564. package/splitter/splitter.esm.min.js +1 -1
  565. package/splitter/splitter.js +2 -0
  566. package/splitter/splitter.min.js +1 -1
  567. package/steps/steps.cjs.js +2 -0
  568. package/steps/steps.cjs.min.js +1 -1
  569. package/steps/steps.esm.js +2 -0
  570. package/steps/steps.esm.min.js +1 -1
  571. package/steps/steps.js +2 -0
  572. package/steps/steps.min.js +1 -1
  573. package/styleclass/package.json +6 -0
  574. package/styleclass/styleclass.cjs.js +355 -0
  575. package/styleclass/styleclass.cjs.min.js +1 -0
  576. package/styleclass/styleclass.d.ts +18 -0
  577. package/styleclass/styleclass.esm.js +351 -0
  578. package/styleclass/styleclass.esm.min.js +1 -0
  579. package/styleclass/styleclass.js +358 -0
  580. package/styleclass/styleclass.min.js +1 -0
  581. package/tabmenu/tabmenu.cjs.js +2 -0
  582. package/tabmenu/tabmenu.cjs.min.js +1 -1
  583. package/tabmenu/tabmenu.esm.js +2 -0
  584. package/tabmenu/tabmenu.esm.min.js +1 -1
  585. package/tabmenu/tabmenu.js +2 -0
  586. package/tabmenu/tabmenu.min.css +1 -1
  587. package/tabmenu/tabmenu.min.js +1 -1
  588. package/tabview/tabview.cjs.js +135 -18
  589. package/tabview/tabview.cjs.min.js +1 -1
  590. package/tabview/tabview.d.ts +1 -0
  591. package/tabview/tabview.esm.js +135 -18
  592. package/tabview/tabview.esm.min.js +1 -1
  593. package/tabview/tabview.js +135 -18
  594. package/tabview/tabview.min.css +1 -1
  595. package/tabview/tabview.min.js +1 -1
  596. package/tag/tag.cjs.js +2 -0
  597. package/tag/tag.cjs.min.js +1 -1
  598. package/tag/tag.esm.js +2 -0
  599. package/tag/tag.esm.min.js +1 -1
  600. package/tag/tag.js +2 -0
  601. package/tag/tag.min.js +1 -1
  602. package/terminal/terminal.cjs.js +2 -0
  603. package/terminal/terminal.cjs.min.js +1 -1
  604. package/terminal/terminal.esm.js +2 -0
  605. package/terminal/terminal.esm.min.js +1 -1
  606. package/terminal/terminal.js +2 -0
  607. package/terminal/terminal.min.js +1 -1
  608. package/tieredmenu/tieredmenu.cjs.js +2 -0
  609. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  610. package/tieredmenu/tieredmenu.d.ts +1 -1
  611. package/tieredmenu/tieredmenu.esm.js +2 -0
  612. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  613. package/tieredmenu/tieredmenu.js +2 -0
  614. package/tieredmenu/tieredmenu.min.js +1 -1
  615. package/timeline/timeline.cjs.js +2 -0
  616. package/timeline/timeline.cjs.min.js +1 -1
  617. package/timeline/timeline.esm.js +2 -0
  618. package/timeline/timeline.esm.min.js +1 -1
  619. package/timeline/timeline.js +2 -0
  620. package/timeline/timeline.min.js +1 -1
  621. package/toast/toast.cjs.js +9 -2
  622. package/toast/toast.cjs.min.js +1 -1
  623. package/toast/toast.d.ts +4 -0
  624. package/toast/toast.esm.js +9 -2
  625. package/toast/toast.esm.min.js +1 -1
  626. package/toast/toast.js +9 -2
  627. package/toast/toast.min.js +1 -1
  628. package/togglebutton/togglebutton.cjs.js +2 -0
  629. package/togglebutton/togglebutton.cjs.min.js +1 -1
  630. package/togglebutton/togglebutton.esm.js +2 -0
  631. package/togglebutton/togglebutton.esm.min.js +1 -1
  632. package/togglebutton/togglebutton.js +2 -0
  633. package/togglebutton/togglebutton.min.js +1 -1
  634. package/toolbar/toolbar.cjs.js +2 -0
  635. package/toolbar/toolbar.cjs.min.js +1 -1
  636. package/toolbar/toolbar.esm.js +2 -0
  637. package/toolbar/toolbar.esm.min.js +1 -1
  638. package/toolbar/toolbar.js +2 -0
  639. package/toolbar/toolbar.min.js +1 -1
  640. package/tooltip/tooltip.cjs.js +2 -0
  641. package/tooltip/tooltip.cjs.min.js +1 -1
  642. package/tooltip/tooltip.esm.js +2 -0
  643. package/tooltip/tooltip.esm.min.js +1 -1
  644. package/tooltip/tooltip.js +2 -0
  645. package/tooltip/tooltip.min.css +1 -1
  646. package/tooltip/tooltip.min.js +1 -1
  647. package/tree/tree.cjs.js +2 -0
  648. package/tree/tree.cjs.min.js +1 -1
  649. package/tree/tree.esm.js +2 -0
  650. package/tree/tree.esm.min.js +1 -1
  651. package/tree/tree.js +2 -0
  652. package/tree/tree.min.js +1 -1
  653. package/treenode/treenode.d.ts +1 -1
  654. package/treeselect/treeselect.cjs.js +2 -0
  655. package/treeselect/treeselect.cjs.min.js +1 -1
  656. package/treeselect/treeselect.esm.js +2 -0
  657. package/treeselect/treeselect.esm.min.js +1 -1
  658. package/treeselect/treeselect.js +2 -0
  659. package/treeselect/treeselect.min.js +1 -1
  660. package/treetable/treetable.cjs.js +22 -8
  661. package/treetable/treetable.cjs.min.js +1 -1
  662. package/treetable/treetable.esm.js +23 -9
  663. package/treetable/treetable.esm.min.js +1 -1
  664. package/treetable/treetable.js +23 -10
  665. package/treetable/treetable.min.js +1 -1
  666. package/tristatecheckbox/tristatecheckbox.cjs.js +2 -0
  667. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  668. package/tristatecheckbox/tristatecheckbox.esm.js +2 -0
  669. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  670. package/tristatecheckbox/tristatecheckbox.js +2 -0
  671. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  672. package/utils/utils.cjs.js +404 -496
  673. package/utils/utils.cjs.min.js +1 -1
  674. package/utils/utils.d.ts +20 -26
  675. package/utils/utils.esm.js +405 -496
  676. package/utils/utils.esm.min.js +1 -1
  677. package/utils/utils.js +404 -496
  678. package/utils/utils.min.js +1 -1
  679. package/virtualscroller/virtualscroller.cjs.js +277 -160
  680. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  681. package/virtualscroller/virtualscroller.d.ts +21 -9
  682. package/virtualscroller/virtualscroller.esm.js +277 -160
  683. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  684. package/virtualscroller/virtualscroller.js +277 -160
  685. package/virtualscroller/virtualscroller.min.js +1 -1
  686. package/web-types.json +168 -29
@@ -1 +1 @@
1
- import e,{Component as t}from"react";import r from"react-dom";import{DomHandler as n,classNames as o,ObjectUtils as c,Portal as i}from"primereact/core";import{Dialog as a}from"primereact/dialog";import{Button as s}from"primereact/button";import{localeOption as l}from"primereact/api";function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?b(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(){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(e){return!1}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){j(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(t){var o=t.appendTo||document.body,c=document.createDocumentFragment();n.appendChild(c,o),t=w(w({},t),{visible:void 0===t.visible||t.visible});var i=e.createElement(P,t);r.render(i,c);var a=function(n){t=w(w({},t),n),r.render(e.cloneElement(i,t),c)};return{_destroy:function(){r.unmountComponentAtNode(c)},show:function(){a({visible:!0,onHide:function(){a({visible:!1})}})},hide:function(){a({visible:!1})},update:function(e){a(e)}}}var P=function(r){h(E,t);var n,m,y,j,g,w=(n=E,m=O(),function(){var e,t=v(n);if(m){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return d(this,e)});function E(e){var t;return u(this,E),(t=w.call(this,e)).state={visible:e.visible},t.reject=t.reject.bind(b(t)),t.accept=t.accept.bind(b(t)),t.hide=t.hide.bind(b(t)),t}return y=E,(j=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||l("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||l("reject")}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(e)}))}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"renderFooter",value:function(){var t=o("p-confirm-dialog-accept",this.props.acceptClassName),r=o("p-confirm-dialog-reject",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),n=e.createElement(e.Fragment,null,e.createElement(s,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:r,onClick:this.reject}),e.createElement(s,{label:this.acceptLabel(),icon:this.props.acceptIcon,className:t,onClick:this.accept,autoFocus:!0}));if(this.props.footer){var i={accept:this.accept,reject:this.reject,acceptClassName:t,rejectClassName:r,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:n,props:this.props};return c.getJSXElement(this.props.footer,i)}return n}},{key:"renderElement",value:function(){var t=o("p-confirm-dialog",this.props.className),r=o("p-confirm-dialog-icon",this.props.icon),n=c.findDiffKeys(this.props,E.defaultProps),i=c.getJSXElement(this.props.message,this.props),s=this.renderFooter();return e.createElement(a,p({visible:this.state.visible},n,{className:t,footer:s,onHide:this.hide,breakpoints:this.props.breakpoints}),e.createElement("i",{className:r}),e.createElement("span",{className:"p-confirm-dialog-message"},i))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(i,{element:t,appendTo:this.props.appendTo})}}])&&f(y.prototype,j),g&&f(y,g),E}();j(P,"defaultProps",{visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,appendTo:null,footer:null,breakpoints:null,onHide:null,accept:null,reject:null});export{P as ConfirmDialog,E as confirmDialog};
1
+ import e,{Component as t}from"react";import r from"react-dom";import{DomHandler as n,classNames as o,ObjectUtils as i,Portal as c}from"primereact/core";import{Dialog as a}from"primereact/dialog";import{Button as s}from"primereact/button";import{localeOption as l}from"primereact/api";function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(){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(e){return!1}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){j(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(t){var o=t.appendTo||document.body,i=document.createDocumentFragment();n.appendChild(i,o),t=w(w({},t),{visible:void 0===t.visible||t.visible});var c=e.createElement(P,t);r.render(c,i);var a=function(n){t=w(w({},t),n),r.render(e.cloneElement(c,t),i)};return{_destroy:function(){r.unmountComponentAtNode(i)},show:function(){a({visible:!0,onHide:function(){a({visible:!1})}})},hide:function(){a({visible:!1})},update:function(e){a(e)}}}var P=function(r){h(E,t);var n,m,y,j,g,w=(n=E,m=O(),function(){var e,t=v(n);if(m){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return d(this,e)});function E(e){var t;return u(this,E),(t=w.call(this,e)).state={visible:e.visible},t.reject=t.reject.bind(b(t)),t.accept=t.accept.bind(b(t)),t.hide=t.hide.bind(b(t)),t}return y=E,(j=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||l("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||l("reject")}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(e)}))}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"renderFooter",value:function(){var t=o("p-confirm-dialog-accept",this.props.acceptClassName),r=o("p-confirm-dialog-reject",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),n=e.createElement(e.Fragment,null,e.createElement(s,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:r,onClick:this.reject}),e.createElement(s,{label:this.acceptLabel(),icon:this.props.acceptIcon,className:t,onClick:this.accept,autoFocus:!0}));if(this.props.footer){var c={accept:this.accept,reject:this.reject,acceptClassName:t,rejectClassName:r,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:n,props:this.props};return i.getJSXElement(this.props.footer,c)}return n}},{key:"renderElement",value:function(){var t=o("p-confirm-dialog",this.props.className),r=o("p-confirm-dialog-icon",this.props.icon),n=i.findDiffKeys(this.props,E.defaultProps),c=i.getJSXElement(this.props.message,this.props),s=this.renderFooter();return e.createElement(a,p({visible:this.state.visible},n,{className:t,footer:s,onHide:this.hide,breakpoints:this.props.breakpoints}),e.createElement("i",{className:r}),e.createElement("span",{className:"p-confirm-dialog-message"},c))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(c,{element:t,appendTo:this.props.appendTo})}}])&&f(y.prototype,j),g&&f(y,g),E}();j(P,"defaultProps",{visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,appendTo:null,footer:null,breakpoints:null,onHide:null,accept:null,reject:null});export{P as ConfirmDialog,E as confirmDialog};
@@ -98,6 +98,8 @@ this.primereact.confirmdialog = (function (exports, React, ReactDOM, core, dialo
98
98
  function _possibleConstructorReturn(self, call) {
99
99
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
100
100
  return call;
101
+ } else if (call !== void 0) {
102
+ throw new TypeError("Derived constructors may only return object or undefined");
101
103
  }
102
104
 
103
105
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.confirmdialog=function(e,t,r,n,o,c,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t),s=a(r);function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?b(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(){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(e){return!1}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){j(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(e){m(j,e);var t,r,a,s,h,d=(t=j,r=O(),function(){var e,n=v(t);if(r){var o=v(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return y(this,e)});function j(e){var t;return u(this,j),(t=d.call(this,e)).state={visible:e.visible},t.reject=t.reject.bind(b(t)),t.accept=t.accept.bind(b(t)),t.hide=t.hide.bind(b(t)),t}return a=j,(s=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||i.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||i.localeOption("reject")}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(e)}))}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-dialog-accept",this.props.acceptClassName),t=n.classNames("p-confirm-dialog-reject",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),r=l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),l.default.createElement(c.Button,{label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept,autoFocus:!0}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:r,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return r}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-dialog",this.props.className),t=n.classNames("p-confirm-dialog-icon",this.props.icon),r=n.ObjectUtils.findDiffKeys(this.props,j.defaultProps),c=n.ObjectUtils.getJSXElement(this.props.message,this.props),i=this.renderFooter();return l.default.createElement(o.Dialog,p({visible:this.state.visible},r,{className:e,footer:i,onHide:this.hide,breakpoints:this.props.breakpoints}),l.default.createElement("i",{className:t}),l.default.createElement("span",{className:"p-confirm-dialog-message"},c))}},{key:"render",value:function(){var e=this.renderElement();return l.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo})}}])&&f(a.prototype,s),h&&f(a,h),j}(t.Component);return j(N,"defaultProps",{visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,appendTo:null,footer:null,breakpoints:null,onHide:null,accept:null,reject:null}),e.ConfirmDialog=N,e.confirmDialog=function(e){var t=e.appendTo||document.body,r=document.createDocumentFragment();n.DomHandler.appendChild(r,t),e=P(P({},e),{visible:void 0===e.visible||e.visible});var o=l.default.createElement(N,e);s.default.render(o,r);var c=function(t){e=P(P({},e),t),s.default.render(l.default.cloneElement(o,e),r)};return{_destroy:function(){s.default.unmountComponentAtNode(r)},show:function(){c({visible:!0,onHide:function(){c({visible:!1})}})},hide:function(){c({visible:!1})},update:function(e){c(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.core,primereact.dialog,primereact.button,primereact.api);
1
+ this.primereact=this.primereact||{},this.primereact.confirmdialog=function(e,t,r,n,o,c,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t),s=a(r);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(){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(e){return!1}}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){j(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P=function(e){h(j,e);var t,r,a,s,d,m=(t=j,r=O(),function(){var e,n=v(t);if(r){var o=v(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return y(this,e)});function j(e){var t;return p(this,j),(t=m.call(this,e)).state={visible:e.visible},t.reject=t.reject.bind(b(t)),t.accept=t.accept.bind(b(t)),t.hide=t.hide.bind(b(t)),t}return a=j,(s=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||i.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||i.localeOption("reject")}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(e)}))}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-dialog-accept",this.props.acceptClassName),t=n.classNames("p-confirm-dialog-reject",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),r=l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),l.default.createElement(c.Button,{label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept,autoFocus:!0}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:r,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return r}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-dialog",this.props.className),t=n.classNames("p-confirm-dialog-icon",this.props.icon),r=n.ObjectUtils.findDiffKeys(this.props,j.defaultProps),c=n.ObjectUtils.getJSXElement(this.props.message,this.props),i=this.renderFooter();return l.default.createElement(o.Dialog,u({visible:this.state.visible},r,{className:e,footer:i,onHide:this.hide,breakpoints:this.props.breakpoints}),l.default.createElement("i",{className:t}),l.default.createElement("span",{className:"p-confirm-dialog-message"},c))}},{key:"render",value:function(){var e=this.renderElement();return l.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo})}}])&&f(a.prototype,s),d&&f(a,d),j}(t.Component);return j(P,"defaultProps",{visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,appendTo:null,footer:null,breakpoints:null,onHide:null,accept:null,reject:null}),e.ConfirmDialog=P,e.confirmDialog=function(e){var t=e.appendTo||document.body,r=document.createDocumentFragment();n.DomHandler.appendChild(r,t),e=w(w({},e),{visible:void 0===e.visible||e.visible});var o=l.default.createElement(P,e);s.default.render(o,r);var c=function(t){e=w(w({},e),t),s.default.render(l.default.cloneElement(o,e),r)};return{_destroy:function(){s.default.unmountComponentAtNode(r)},show:function(){c({visible:!0,onHide:function(){c({visible:!1})}})},hide:function(){c({visible:!1})},update:function(e){c(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.core,primereact.dialog,primereact.button,primereact.api);
@@ -86,6 +86,8 @@ function _typeof(obj) {
86
86
  function _possibleConstructorReturn(self, call) {
87
87
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
88
88
  return call;
89
+ } else if (call !== void 0) {
90
+ throw new TypeError("Derived constructors may only return object or undefined");
89
91
  }
90
92
 
91
93
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("primereact/core"),i=require("primereact/button"),r=require("primereact/api");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),l=o(t);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?u(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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(e){return!1}}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=function(t){f(k,e.Component);var o,l,p,d,y,b=(o=k,l=m(),function(){var e,t=v(o);if(l){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function k(e){var t;return c(this,k),(t=b.call(this,e)).state={visible:!1},t.reject=t.reject.bind(u(t)),t.accept=t.accept.bind(u(t)),t.hide=t.hide.bind(u(t)),t.onCloseClick=t.onCloseClick.bind(u(t)),t.onPanelClick=t.onPanelClick.bind(u(t)),t.onEnter=t.onEnter.bind(u(t)),t.onEntered=t.onEntered.bind(u(t)),t.onExit=t.onExit.bind(u(t)),t.onExited=t.onExited.bind(u(t)),t.overlayRef=s.default.createRef(),t.acceptBtnRef=s.default.createRef(),t}return p=k,(d=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||r.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||r.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},n.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){n.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){n.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=n.DomHandler.getOffset(this.overlayRef.current),t=n.DomHandler.getOffset(this.props.target),i=0;e.left<t.left&&(i=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(i,"px")),e.top<t.top&&n.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(n.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=n.classNames("p-confirm-popup-icon",this.props.icon),t=n.ObjectUtils.getJSXElement(this.props.message,this.props);return s.default.createElement("div",{className:"p-confirm-popup-content"},s.default.createElement("i",{className:e}),s.default.createElement("span",{className:"p-confirm-popup-message"},t))}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=n.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),r=s.default.createElement("div",{className:"p-confirm-popup-footer"},s.default.createElement(i.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),s.default.createElement(i.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:r,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return r}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),i=this.renderFooter();return s.default.createElement(n.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},s.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,i))}},{key:"render",value:function(){var e=this.renderElement();return s.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}}])&&a(p.prototype,d),y&&a(p,y),k}();y(E,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),exports.ConfirmPopup=E,exports.confirmPopup=function(e){var t=e.appendTo||document.body,i=document.createDocumentFragment();n.DomHandler.appendChild(i,t),e=k(k({},e),{visible:void 0===e.visible||e.visible});var r=s.default.createElement(E,e);l.default.render(r,i);var o=function(t){e=k(k({},e),t),l.default.render(s.default.cloneElement(r,e),i)};return{_destroy:function(){l.default.unmountComponentAtNode(i)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("primereact/core"),r=require("primereact/button"),i=require("primereact/api");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),l=o(t);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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(e){return!1}}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=function(t){f(k,e.Component);var o,l,p,d,y,b=(o=k,l=m(),function(){var e,t=v(o);if(l){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function k(e){var t;return c(this,k),(t=b.call(this,e)).state={visible:!1},t.reject=t.reject.bind(u(t)),t.accept=t.accept.bind(u(t)),t.hide=t.hide.bind(u(t)),t.onCloseClick=t.onCloseClick.bind(u(t)),t.onPanelClick=t.onPanelClick.bind(u(t)),t.onEnter=t.onEnter.bind(u(t)),t.onEntered=t.onEntered.bind(u(t)),t.onExit=t.onExit.bind(u(t)),t.onExited=t.onExited.bind(u(t)),t.overlayRef=s.default.createRef(),t.acceptBtnRef=s.default.createRef(),t}return p=k,(d=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||i.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||i.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},n.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){n.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){n.ZIndexUtils.set("overlay",this.overlayRef.current),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){n.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=n.DomHandler.getOffset(this.overlayRef.current),t=n.DomHandler.getOffset(this.props.target),r=0;e.left<t.left&&(r=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(r,"px")),e.top<t.top&&n.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(n.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),n.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=n.classNames("p-confirm-popup-icon",this.props.icon),t=n.ObjectUtils.getJSXElement(this.props.message,this.props);return s.default.createElement("div",{className:"p-confirm-popup-content"},s.default.createElement("i",{className:e}),s.default.createElement("span",{className:"p-confirm-popup-message"},t))}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=n.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),i=s.default.createElement("div",{className:"p-confirm-popup-footer"},s.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),s.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:i,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return i}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),r=this.renderFooter();return s.default.createElement(n.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},s.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,r))}},{key:"render",value:function(){var e=this.renderElement();return s.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}}])&&a(p.prototype,d),y&&a(p,y),k}();y(E,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),exports.ConfirmPopup=E,exports.confirmPopup=function(e){var t=e.appendTo||document.body,r=document.createDocumentFragment();n.DomHandler.appendChild(r,t),e=k(k({},e),{visible:void 0===e.visible||e.visible});var i=s.default.createElement(E,e);l.default.render(i,r);var o=function(t){e=k(k({},e),t),l.default.render(s.default.cloneElement(i,e),r)};return{_destroy:function(){l.default.unmountComponentAtNode(r)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}};
@@ -77,6 +77,8 @@ function _typeof(obj) {
77
77
  function _possibleConstructorReturn(self, call) {
78
78
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
79
79
  return call;
80
+ } else if (call !== void 0) {
81
+ throw new TypeError("Derived constructors may only return object or undefined");
80
82
  }
81
83
 
82
84
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- import e,{Component as t}from"react";import n from"react-dom";import{DomHandler as i,ConnectedOverlayScrollHandler as r,OverlayService as o,ZIndexUtils as s,classNames as c,ObjectUtils as l,CSSTransition as a,Portal as u}from"primereact/core";import{Button as p}from"primereact/button";import{localeOption as f}from"primereact/api";function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?v(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(){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(e){return!1}}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(t){var r=t.appendTo||document.body,o=document.createDocumentFragment();i.appendChild(o,r),t=O(O({},t),{visible:void 0===t.visible||t.visible});var s=e.createElement(R,t);n.render(s,o);var c=function(i){t=O(O({},t),i),n.render(e.cloneElement(s,t),o)};return{_destroy:function(){n.unmountComponentAtNode(o)},show:function(){c({visible:!0,onHide:function(){c({visible:!1})}})},hide:function(){c({visible:!1})},update:function(e){c(e)}}}var R=function(n){b(R,t);var m,y,L,j,O,g=(m=R,y=C(),function(){var e,t=E(m);if(y){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function R(t){var n;return h(this,R),(n=g.call(this,t)).state={visible:!1},n.reject=n.reject.bind(v(n)),n.accept=n.accept.bind(v(n)),n.hide=n.hide.bind(v(n)),n.onCloseClick=n.onCloseClick.bind(v(n)),n.onPanelClick=n.onPanelClick.bind(v(n)),n.onEnter=n.onEnter.bind(v(n)),n.onEntered=n.onEntered.bind(v(n)),n.onExit=n.onExit.bind(v(n)),n.onExited=n.onExited.bind(v(n)),n.overlayRef=e.createRef(),n.acceptBtnRef=e.createRef(),n}return L=R,(j=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||f("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||f("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new r(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,o.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},o.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){o.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){s.set("overlay",this.overlayRef.current),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){s.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.absolutePosition(this.overlayRef.current,this.props.target);var e=i.getOffset(this.overlayRef.current),t=i.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(o.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),s.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var t=c("p-confirm-popup-icon",this.props.icon),n=l.getJSXElement(this.props.message,this.props);return e.createElement("div",{className:"p-confirm-popup-content"},e.createElement("i",{className:t}),e.createElement("span",{className:"p-confirm-popup-message"},n))}},{key:"renderFooter",value:function(){var t=c("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),n=c("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),i=e.createElement("div",{className:"p-confirm-popup-footer"},e.createElement(p,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:n,onClick:this.reject}),e.createElement(p,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:t,onClick:this.accept}));if(this.props.footer){var r={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:t,rejectClassName:n,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:i,props:this.props};return l.getJSXElement(this.props.footer,r)}return i}},{key:"renderElement",value:function(){var t=c("p-confirm-popup p-component",this.props.className),n=this.renderContent(),i=this.renderFooter();return e.createElement(a,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.overlayRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},n,i))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(u,{element:t,appendTo:this.props.appendTo,visible:!0})}}])&&d(L.prototype,j),O&&d(L,O),R}();L(R,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null});export{R as ConfirmPopup,g as confirmPopup};
1
+ import e,{Component as t}from"react";import n from"react-dom";import{DomHandler as i,ConnectedOverlayScrollHandler as r,OverlayService as o,ZIndexUtils as s,classNames as c,ObjectUtils as l,CSSTransition as a,Portal as u}from"primereact/core";import{Button as p}from"primereact/button";import{localeOption as f}from"primereact/api";function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){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(e){return!1}}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(t){var r=t.appendTo||document.body,o=document.createDocumentFragment();i.appendChild(o,r),t=O(O({},t),{visible:void 0===t.visible||t.visible});var s=e.createElement(R,t);n.render(s,o);var c=function(i){t=O(O({},t),i),n.render(e.cloneElement(s,t),o)};return{_destroy:function(){n.unmountComponentAtNode(o)},show:function(){c({visible:!0,onHide:function(){c({visible:!1})}})},hide:function(){c({visible:!1})},update:function(e){c(e)}}}var R=function(n){y(R,t);var m,b,L,C,O,g=(m=R,b=j(),function(){var e,t=E(m);if(b){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function R(t){var n;return h(this,R),(n=g.call(this,t)).state={visible:!1},n.reject=n.reject.bind(v(n)),n.accept=n.accept.bind(v(n)),n.hide=n.hide.bind(v(n)),n.onCloseClick=n.onCloseClick.bind(v(n)),n.onPanelClick=n.onPanelClick.bind(v(n)),n.onEnter=n.onEnter.bind(v(n)),n.onEntered=n.onEntered.bind(v(n)),n.onExit=n.onExit.bind(v(n)),n.onExited=n.onExited.bind(v(n)),n.overlayRef=e.createRef(),n.acceptBtnRef=e.createRef(),n}return L=R,(C=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||f("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||f("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new r(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,o.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},o.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){o.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){s.set("overlay",this.overlayRef.current),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){s.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.absolutePosition(this.overlayRef.current,this.props.target);var e=i.getOffset(this.overlayRef.current),t=i.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(o.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),s.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var t=c("p-confirm-popup-icon",this.props.icon),n=l.getJSXElement(this.props.message,this.props);return e.createElement("div",{className:"p-confirm-popup-content"},e.createElement("i",{className:t}),e.createElement("span",{className:"p-confirm-popup-message"},n))}},{key:"renderFooter",value:function(){var t=c("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),n=c("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),i=e.createElement("div",{className:"p-confirm-popup-footer"},e.createElement(p,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:n,onClick:this.reject}),e.createElement(p,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:t,onClick:this.accept}));if(this.props.footer){var r={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:t,rejectClassName:n,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:i,props:this.props};return l.getJSXElement(this.props.footer,r)}return i}},{key:"renderElement",value:function(){var t=c("p-confirm-popup p-component",this.props.className),n=this.renderContent(),i=this.renderFooter();return e.createElement(a,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.overlayRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},n,i))}},{key:"render",value:function(){var t=this.renderElement();return e.createElement(u,{element:t,appendTo:this.props.appendTo,visible:!0})}}])&&d(L.prototype,C),O&&d(L,O),R}();L(R,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null});export{R as ConfirmPopup,g as confirmPopup};
@@ -80,6 +80,8 @@ this.primereact.confirmpopup = (function (exports, React, ReactDOM, core, button
80
80
  function _possibleConstructorReturn(self, call) {
81
81
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
82
82
  return call;
83
+ } else if (call !== void 0) {
84
+ throw new TypeError("Derived constructors may only return object or undefined");
83
85
  }
84
86
 
85
87
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.confirmpopup=function(e,t,n,i,r,o){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(t),c=s(n);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?p(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){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(e){return!1}}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=function(e){d(y,e);var t,n,s,c,f,h=(t=y,n=b(),function(){var e,i=m(t);if(n){var r=m(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return v(this,e)});function y(e){var t;return a(this,y),(t=h.call(this,e)).state={visible:!1},t.reject=t.reject.bind(p(t)),t.accept=t.accept.bind(p(t)),t.hide=t.hide.bind(p(t)),t.onCloseClick=t.onCloseClick.bind(p(t)),t.onPanelClick=t.onPanelClick.bind(p(t)),t.onEnter=t.onEnter.bind(p(t)),t.onEntered=t.onEntered.bind(p(t)),t.onExit=t.onExit.bind(p(t)),t.onExited=t.onExited.bind(p(t)),t.overlayRef=l.default.createRef(),t.acceptBtnRef=l.default.createRef(),t}return s=y,(c=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||o.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||o.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,i.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},i.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){i.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){i.ZIndexUtils.set("overlay",this.overlayRef.current),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=i.DomHandler.getOffset(this.overlayRef.current),t=i.DomHandler.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(i.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=i.classNames("p-confirm-popup-icon",this.props.icon),t=i.ObjectUtils.getJSXElement(this.props.message,this.props);return l.default.createElement("div",{className:"p-confirm-popup-content"},l.default.createElement("i",{className:e}),l.default.createElement("span",{className:"p-confirm-popup-message"},t))}},{key:"renderFooter",value:function(){var e=i.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=i.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),n=l.default.createElement("div",{className:"p-confirm-popup-footer"},l.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),l.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:n,props:this.props};return i.ObjectUtils.getJSXElement(this.props.footer,o)}return n}},{key:"renderElement",value:function(){var e=i.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),n=this.renderFooter();return l.default.createElement(i.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},l.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,n))}},{key:"render",value:function(){var e=this.renderElement();return l.default.createElement(i.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}}])&&u(s.prototype,c),f&&u(s,f),y}(t.Component);return y(L,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),e.ConfirmPopup=L,e.confirmPopup=function(e){var t=e.appendTo||document.body,n=document.createDocumentFragment();i.DomHandler.appendChild(n,t),e=E(E({},e),{visible:void 0===e.visible||e.visible});var r=l.default.createElement(L,e);c.default.render(r,n);var o=function(t){e=E(E({},e),t),c.default.render(l.default.cloneElement(r,e),n)};return{_destroy:function(){c.default.unmountComponentAtNode(n)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.core,primereact.button,primereact.api);
1
+ this.primereact=this.primereact||{},this.primereact.confirmpopup=function(e,t,n,i,r,o){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(t),l=s(n);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){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(e){return!1}}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=function(e){d(y,e);var t,n,s,l,f,h=(t=y,n=b(),function(){var e,i=m(t);if(n){var r=m(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return v(this,e)});function y(e){var t;return a(this,y),(t=h.call(this,e)).state={visible:!1},t.reject=t.reject.bind(p(t)),t.accept=t.accept.bind(p(t)),t.hide=t.hide.bind(p(t)),t.onCloseClick=t.onCloseClick.bind(p(t)),t.onPanelClick=t.onPanelClick.bind(p(t)),t.onEnter=t.onEnter.bind(p(t)),t.onEntered=t.onEntered.bind(p(t)),t.onExit=t.onExit.bind(p(t)),t.onExited=t.onExited.bind(p(t)),t.overlayRef=c.default.createRef(),t.acceptBtnRef=c.default.createRef(),t}return s=y,(l=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||o.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||o.localeOption("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.props.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!i.DomHandler.isAndroid()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,i.OverlayService.emit("overlay-click",{originalEvent:e,target:this.props.target})}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){var e=this;this.setState({visible:!0},(function(){e.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.isPanelClicked=!0)},i.OverlayService.on("overlay-click",e.overlayEventListener)}))}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){i.OverlayService.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null,t.props.onHide&&t.props.onHide(e)}))}},{key:"onEnter",value:function(){i.ZIndexUtils.set("overlay",this.overlayRef.current),this.align()}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.acceptBtnRef&&this.acceptBtnRef.current&&this.acceptBtnRef.current.focus(),this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){this.unbindDocumentClickListener(),this.unbindScrollListener(),this.unbindResizeListener()}},{key:"onExited",value:function(){i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"align",value:function(){if(this.props.target){i.DomHandler.absolutePosition(this.overlayRef.current,this.props.target);var e=i.DomHandler.getOffset(this.overlayRef.current),t=i.DomHandler.getOffset(this.props.target),n=0;e.left<t.left&&(n=t.left-e.left),this.overlayRef.current.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&i.DomHandler.addClass(this.overlayRef.current,"p-confirm-popup-flipped")}}},{key:"componentDidMount",value:function(){this.props.visible&&this.setState({visible:!0})}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEventListener&&(i.OverlayService.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),i.ZIndexUtils.clear(this.overlayRef.current)}},{key:"renderContent",value:function(){var e=i.classNames("p-confirm-popup-icon",this.props.icon),t=i.ObjectUtils.getJSXElement(this.props.message,this.props);return c.default.createElement("div",{className:"p-confirm-popup-content"},c.default.createElement("i",{className:e}),c.default.createElement("span",{className:"p-confirm-popup-message"},t))}},{key:"renderFooter",value:function(){var e=i.classNames("p-confirm-popup-accept p-button-sm",this.props.acceptClassName),t=i.classNames("p-confirm-popup-reject p-button-sm",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),n=c.default.createElement("div",{className:"p-confirm-popup-footer"},c.default.createElement(r.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),c.default.createElement(r.Button,{ref:this.acceptBtnRef,label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,className:"p-confirm-popup-footer",acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:n,props:this.props};return i.ObjectUtils.getJSXElement(this.props.footer,o)}return n}},{key:"renderElement",value:function(){var e=i.classNames("p-confirm-popup p-component",this.props.className),t=this.renderContent(),n=this.renderFooter();return c.default.createElement(i.CSSTransition,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.visible,timeout:{enter:120,exit:100},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},c.default.createElement("div",{ref:this.overlayRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onPanelClick},t,n))}},{key:"render",value:function(){var e=this.renderElement();return c.default.createElement(i.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}}])&&u(s.prototype,l),f&&u(s,f),y}(t.Component);return y(L,"defaultProps",{target:null,visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,style:null,appendTo:null,dismissable:!0,footer:null,onShow:null,onHide:null,accept:null,reject:null,transitionOptions:null}),e.ConfirmPopup=L,e.confirmPopup=function(e){var t=e.appendTo||document.body,n=document.createDocumentFragment();i.DomHandler.appendChild(n,t),e=E(E({},e),{visible:void 0===e.visible||e.visible});var r=c.default.createElement(L,e);l.default.render(r,n);var o=function(t){e=E(E({},e),t),l.default.render(c.default.cloneElement(r,e),n)};return{_destroy:function(){l.default.unmountComponentAtNode(n)},show:function(){o({visible:!0,onHide:function(){o({visible:!1})}})},hide:function(){o({visible:!1})},update:function(e){o(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.core,primereact.button,primereact.api);
@@ -82,6 +82,8 @@ function _typeof(obj) {
82
82
  function _possibleConstructorReturn(self, call) {
83
83
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
84
84
  return call;
85
+ } else if (call !== void 0) {
86
+ throw new TypeError("Derived constructors may only return object or undefined");
85
87
  }
86
88
 
87
89
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e);function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?u(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=h();return function(){var n,i=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m(this,n)}}function h(){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(e){return!1}}var v=function(n){a(l,e.Component);var o=p(l);function l(e){var t;return r(this,l),(t=o.call(this,e)).state={activeItem:null},t.onEnter=t.onEnter.bind(u(t)),t.submenuRef=i.default.createRef(),t}return s(l,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,n=t.DomHandler.getOffset(this.submenuRef.current.parentElement),i=t.DomHandler.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.submenuRef.current),o=t.DomHandler.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(n.left,10)+o+r>i.width-t.DomHandler.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(e){return i.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(e){return e.items?i.default.createElement(l,{model:e.items,resetMenu:e!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,o=this.state.activeItem===e,s=t.classNames("p-menuitem",{"p-menuitem-active":o},e.className),u=t.classNames("p-menuitem-link",{"p-disabled":e.disabled}),l=t.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-angle-right",c=e.icon&&i.default.createElement("span",{className:l}),m=e.label&&i.default.createElement("span",{className:"p-menuitem-text"},e.label),f=e.items&&i.default.createElement("span",{className:a}),d=this.renderSubmenu(e),p=i.default.createElement("a",{href:e.url||"#",className:u,target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},role:"menuitem","aria-haspopup":null!=e.items,"aria-disabled":e.disabled},c,m,f,i.default.createElement(t.Ripple,null));e.template&&(p=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:u,labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:p,props:this.props,active:o}));return i.default.createElement("li",{key:e.label+"_"+n,role:"none",className:s,style:e.style,onMouseEnter:function(t){return r.onItemMouseEnter(t,e)}},p,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=t.classNames({"p-submenu-list":!this.props.root}),n=this.renderMenu(),r=this.isActive();return i.default.createElement(t.CSSTransition,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},i.default.createElement("ul",{ref:this.submenuRef,className:e},n))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),l}();d(v,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var b=function(n){a(l,e.Component);var o=p(l);function l(e){var t;return r(this,l),(t=o.call(this,e)).state={visible:!1,reshow:!1,resetMenu:!1},t.onMenuClick=t.onMenuClick.bind(u(t)),t.onLeafClick=t.onLeafClick.bind(u(t)),t.onMenuMouseEnter=t.onMenuMouseEnter.bind(u(t)),t.onEnter=t.onEnter.bind(u(t)),t.onEntered=t.onEntered.bind(u(t)),t.onExit=t.onExit.bind(u(t)),t.onExited=t.onExited.bind(u(t)),t.menuRef=i.default.createRef(),t}return s(l,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&t.reshow!==this.state.reshow){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var n=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:t.DomHandler.getHiddenElementOuterHeight(this.menuRef.current),s=t.DomHandler.getViewport();n+r-document.body.scrollLeft>s.width&&(n-=r),i+o-document.body.scrollTop>s.height&&(i-=o),n<document.body.scrollLeft&&(n=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=n+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(n){e.state.visible&&!t.DomHandler.isAndroid()&&e.hide(n)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var e=t.classNames("p-contextmenu p-component",this.props.className);return i.default.createElement(t.CSSTransition,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},i.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},i.default.createElement(v,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var e=this.renderContextMenu();return i.default.createElement(t.Portal,{element:e,appendTo:this.props.appendTo})}}]),l}();d(b,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.ContextMenu=b;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e);function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=h();return function(){var n,i=f(e);if(t){var r=f(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return m(this,n)}}function h(){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(e){return!1}}var v=function(n){a(l,e.Component);var o=p(l);function l(e){var t;return r(this,l),(t=o.call(this,e)).state={activeItem:null},t.onEnter=t.onEnter.bind(u(t)),t.submenuRef=i.default.createRef(),t}return s(l,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,n=t.DomHandler.getOffset(this.submenuRef.current.parentElement),i=t.DomHandler.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.submenuRef.current),o=t.DomHandler.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(n.left,10)+o+r>i.width-t.DomHandler.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(e){return i.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(e){return e.items?i.default.createElement(l,{model:e.items,resetMenu:e!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,o=this.state.activeItem===e,s=t.classNames("p-menuitem",{"p-menuitem-active":o},e.className),u=t.classNames("p-menuitem-link",{"p-disabled":e.disabled}),l=t.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-angle-right",c=e.icon&&i.default.createElement("span",{className:l}),m=e.label&&i.default.createElement("span",{className:"p-menuitem-text"},e.label),f=e.items&&i.default.createElement("span",{className:a}),d=this.renderSubmenu(e),p=i.default.createElement("a",{href:e.url||"#",className:u,target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},role:"menuitem","aria-haspopup":null!=e.items,"aria-disabled":e.disabled},c,m,f,i.default.createElement(t.Ripple,null));e.template&&(p=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:u,labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:p,props:this.props,active:o}));return i.default.createElement("li",{key:e.label+"_"+n,role:"none",className:s,style:e.style,onMouseEnter:function(t){return r.onItemMouseEnter(t,e)}},p,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=t.classNames({"p-submenu-list":!this.props.root}),n=this.renderMenu(),r=this.isActive();return i.default.createElement(t.CSSTransition,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},i.default.createElement("ul",{ref:this.submenuRef,className:e},n))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),l}();d(v,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var b=function(n){a(l,e.Component);var o=p(l);function l(e){var t;return r(this,l),(t=o.call(this,e)).state={visible:!1,reshow:!1,resetMenu:!1},t.onMenuClick=t.onMenuClick.bind(u(t)),t.onLeafClick=t.onLeafClick.bind(u(t)),t.onMenuMouseEnter=t.onMenuMouseEnter.bind(u(t)),t.onEnter=t.onEnter.bind(u(t)),t.onEntered=t.onEntered.bind(u(t)),t.onExit=t.onExit.bind(u(t)),t.onExited=t.onExited.bind(u(t)),t.menuRef=i.default.createRef(),t}return s(l,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&t.reshow!==this.state.reshow){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var n=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:t.DomHandler.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:t.DomHandler.getHiddenElementOuterHeight(this.menuRef.current),s=t.DomHandler.getViewport();n+r-document.body.scrollLeft>s.width&&(n-=r),i+o-document.body.scrollTop>s.height&&(i-=o),n<document.body.scrollLeft&&(n=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=n+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(n){e.state.visible&&!t.DomHandler.isAndroid()&&e.hide(n)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var e=t.classNames("p-contextmenu p-component",this.props.className);return i.default.createElement(t.CSSTransition,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},i.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},i.default.createElement(v,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var e=this.renderContextMenu();return i.default.createElement(t.Portal,{element:e,appendTo:this.props.appendTo})}}]),l}();d(b,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.ContextMenu=b;
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from 'react';
2
- import { ZIndexUtils, DomHandler, classNames, CSSTransition, Portal, Ripple, ObjectUtils } from 'primereact/core';
2
+ import { DomHandler, classNames, Ripple, ObjectUtils, CSSTransition, ZIndexUtils, Portal } from 'primereact/core';
3
3
 
4
4
  function _classCallCheck(instance, Constructor) {
5
5
  if (!(instance instanceof Constructor)) {
@@ -74,6 +74,8 @@ function _typeof(obj) {
74
74
  function _possibleConstructorReturn(self, call) {
75
75
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
76
76
  return call;
77
+ } else if (call !== void 0) {
78
+ throw new TypeError("Derived constructors may only return object or undefined");
77
79
  }
78
80
 
79
81
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- import e,{Component as t}from"react";import{ZIndexUtils as n,DomHandler as i,classNames as r,CSSTransition as o,Portal as s,Ripple as u,ObjectUtils as c}from"primereact/core";function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?f(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){var t=E();return function(){var n,i=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return v(this,n)}}function E(){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(e){return!1}}var L=function(n){h(a,t);var s=k(a);function a(t){var n;return l(this,a),(n=s.call(this,t)).state={activeItem:null},n.onEnter=n.onEnter.bind(f(n)),n.submenuRef=e.createRef(),n}return m(a,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,t=i.getOffset(this.submenuRef.current.parentElement),n=i.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:i.getHiddenElementOuterWidth(this.submenuRef.current),o=i.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(t.left,10)+o+r>n.width-i.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(a,{model:t.items,resetMenu:t!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(t,n){var i=this,o=this.state.activeItem===t,s=r("p-menuitem",{"p-menuitem-active":o},t.className),l=r("p-menuitem-link",{"p-disabled":t.disabled}),a=r("p-menuitem-icon",t.icon),m="p-submenu-icon pi pi-angle-right",f=t.icon&&e.createElement("span",{className:a}),d=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),h=t.items&&e.createElement("span",{className:m}),p=this.renderSubmenu(t),v=e.createElement("a",{href:t.url||"#",className:l,target:t.target,onClick:function(e){return i.onItemClick(e,t,n)},role:"menuitem","aria-haspopup":null!=t.items,"aria-disabled":t.disabled},f,d,h,e.createElement(u,null));t.template&&(v=c.getJSXElement(t.template,t,{onClick:function(e){return i.onItemClick(e,t,n)},className:l,labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:m,element:v,props:this.props,active:o}));return e.createElement("li",{key:t.label+"_"+n,role:"none",className:s,style:t.style,onMouseEnter:function(e){return i.onItemMouseEnter(e,t)}},v,p)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var t=r({"p-submenu-list":!this.props.root}),n=this.renderMenu(),i=this.isActive();return e.createElement(o,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:i,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},e.createElement("ul",{ref:this.submenuRef,className:t},n))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),a}();y(L,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var R=function(u){h(a,t);var c=k(a);function a(t){var n;return l(this,a),(n=c.call(this,t)).state={visible:!1,reshow:!1,resetMenu:!1},n.onMenuClick=n.onMenuClick.bind(f(n)),n.onLeafClick=n.onLeafClick.bind(f(n)),n.onMenuMouseEnter=n.onMenuMouseEnter.bind(f(n)),n.onEnter=n.onEnter.bind(f(n)),n.onEntered=n.onEntered.bind(f(n)),n.onExit=n.onExit.bind(f(n)),n.onExited=n.onExited.bind(f(n)),n.menuRef=e.createRef(),n}return m(a,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&t.reshow!==this.state.reshow){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.set("menu",this.menuRef.current,this.props.baseZIndex),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){n.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var t=e.pageX+1,n=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:i.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:i.getHiddenElementOuterHeight(this.menuRef.current),s=i.getViewport();t+r-document.body.scrollLeft>s.width&&(t-=r),n+o-document.body.scrollTop>s.height&&(n-=o),t<document.body.scrollLeft&&(t=document.body.scrollLeft),n<document.body.scrollTop&&(n=document.body.scrollTop),this.menuRef.current.style.left=t+"px",this.menuRef.current.style.top=n+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!i.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),n.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var t=r("p-contextmenu p-component",this.props.className);return e.createElement(o,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},e.createElement(L,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var t=this.renderContextMenu();return e.createElement(s,{element:t,appendTo:this.props.appendTo})}}]),a}();y(R,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{R as ContextMenu};
1
+ import e,{Component as t}from"react";import{DomHandler as n,classNames as i,Ripple as r,ObjectUtils as o,CSSTransition as s,ZIndexUtils as u,Portal as c}from"primereact/core";function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=k();return function(){var n,i=b(e);if(t){var r=b(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return v(this,n)}}function k(){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(e){return!1}}var L=function(u){h(a,t);var c=E(a);function a(t){var n;return l(this,a),(n=c.call(this,t)).state={activeItem:null},n.onEnter=n.onEnter.bind(f(n)),n.submenuRef=e.createRef(),n}return m(a,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,t=n.getOffset(this.submenuRef.current.parentElement),i=n.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:n.getHiddenElementOuterWidth(this.submenuRef.current),o=n.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(t.left,10)+o+r>i.width-n.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(a,{model:t.items,resetMenu:t!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(t,n){var s=this,u=this.state.activeItem===t,c=i("p-menuitem",{"p-menuitem-active":u},t.className),l=i("p-menuitem-link",{"p-disabled":t.disabled}),a=i("p-menuitem-icon",t.icon),m="p-submenu-icon pi pi-angle-right",f=t.icon&&e.createElement("span",{className:a}),d=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),h=t.items&&e.createElement("span",{className:m}),p=this.renderSubmenu(t),v=e.createElement("a",{href:t.url||"#",className:l,target:t.target,onClick:function(e){return s.onItemClick(e,t,n)},role:"menuitem","aria-haspopup":null!=t.items,"aria-disabled":t.disabled},f,d,h,e.createElement(r,null));t.template&&(v=o.getJSXElement(t.template,t,{onClick:function(e){return s.onItemClick(e,t,n)},className:l,labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:m,element:v,props:this.props,active:u}));return e.createElement("li",{key:t.label+"_"+n,role:"none",className:c,style:t.style,onMouseEnter:function(e){return s.onItemMouseEnter(e,t)}},v,p)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var t=i({"p-submenu-list":!this.props.root}),n=this.renderMenu(),r=this.isActive();return e.createElement(s,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:r,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},e.createElement("ul",{ref:this.submenuRef,className:t},n))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),a}();y(L,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var R=function(r){h(a,t);var o=E(a);function a(t){var n;return l(this,a),(n=o.call(this,t)).state={visible:!1,reshow:!1,resetMenu:!1},n.onMenuClick=n.onMenuClick.bind(f(n)),n.onLeafClick=n.onLeafClick.bind(f(n)),n.onMenuMouseEnter=n.onMenuMouseEnter.bind(f(n)),n.onEnter=n.onEnter.bind(f(n)),n.onEntered=n.onEntered.bind(f(n)),n.onExit=n.onExit.bind(f(n)),n.onExited=n.onExited.bind(f(n)),n.menuRef=e.createRef(),n}return m(a,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&t.reshow!==this.state.reshow){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&u.set("menu",this.menuRef.current,this.props.baseZIndex),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){u.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var t=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:n.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:n.getHiddenElementOuterHeight(this.menuRef.current),s=n.getViewport();t+r-document.body.scrollLeft>s.width&&(t-=r),i+o-document.body.scrollTop>s.height&&(i-=o),t<document.body.scrollLeft&&(t=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=t+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),u.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var t=i("p-contextmenu p-component",this.props.className);return e.createElement(s,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},e.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},e.createElement(L,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var t=this.renderContextMenu();return e.createElement(c,{element:t,appendTo:this.props.appendTo})}}]),a}();y(R,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{R as ContextMenu};
@@ -79,6 +79,8 @@ this.primereact.contextmenu = (function (exports, React, core) {
79
79
  function _possibleConstructorReturn(self, call) {
80
80
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
81
81
  return call;
82
+ } else if (call !== void 0) {
83
+ throw new TypeError("Derived constructors may only return object or undefined");
82
84
  }
83
85
 
84
86
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.contextmenu=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(t);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?l(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){var t=v();return function(){var n,i=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f(this,n)}}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(e){return!1}}var b=function(e){c(i,e);var t=h(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={activeItem:null},n.onEnter=n.onEnter.bind(l(n)),n.submenuRef=r.default.createRef(),n}return u(i,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,t=n.DomHandler.getOffset(this.submenuRef.current.parentElement),i=n.DomHandler.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:n.DomHandler.getHiddenElementOuterWidth(this.submenuRef.current),o=n.DomHandler.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(t.left,10)+o+r>i.width-n.DomHandler.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(e){return r.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(e){return e.items?r.default.createElement(i,{model:e.items,resetMenu:e!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,o=this.state.activeItem===e,s=n.classNames("p-menuitem",{"p-menuitem-active":o},e.className),u=n.classNames("p-menuitem-link",{"p-disabled":e.disabled}),l=n.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-angle-right",c=e.icon&&r.default.createElement("span",{className:l}),m=e.label&&r.default.createElement("span",{className:"p-menuitem-text"},e.label),f=e.items&&r.default.createElement("span",{className:a}),d=this.renderSubmenu(e),p=r.default.createElement("a",{href:e.url||"#",className:u,target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},role:"menuitem","aria-haspopup":null!=e.items,"aria-disabled":e.disabled},c,m,f,r.default.createElement(n.Ripple,null));e.template&&(p=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:u,labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:p,props:this.props,active:o}));return r.default.createElement("li",{key:e.label+"_"+t,role:"none",className:s,style:e.style,onMouseEnter:function(t){return i.onItemMouseEnter(t,e)}},p,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=n.classNames({"p-submenu-list":!this.props.root}),t=this.renderMenu(),i=this.isActive();return r.default.createElement(n.CSSTransition,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:i,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},r.default.createElement("ul",{ref:this.submenuRef,className:e},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),i}(t.Component);p(b,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var y=function(e){c(i,e);var t=h(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={visible:!1,reshow:!1,resetMenu:!1},n.onMenuClick=n.onMenuClick.bind(l(n)),n.onLeafClick=n.onLeafClick.bind(l(n)),n.onMenuMouseEnter=n.onMenuMouseEnter.bind(l(n)),n.onEnter=n.onEnter.bind(l(n)),n.onEntered=n.onEntered.bind(l(n)),n.onExit=n.onExit.bind(l(n)),n.onExited=n.onExited.bind(l(n)),n.menuRef=r.default.createRef(),n}return u(i,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&t.reshow!==this.state.reshow){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var t=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:n.DomHandler.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:n.DomHandler.getHiddenElementOuterHeight(this.menuRef.current),s=n.DomHandler.getViewport();t+r-document.body.scrollLeft>s.width&&(t-=r),i+o-document.body.scrollTop>s.height&&(i-=o),t<document.body.scrollLeft&&(t=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=t+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),n.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var e=n.classNames("p-contextmenu p-component",this.props.className);return r.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},r.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},r.default.createElement(b,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var e=this.renderContextMenu();return r.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo})}}]),i}(t.Component);return p(y,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),e.ContextMenu=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
1
+ this.primereact=this.primereact||{},this.primereact.contextmenu=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(t);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){var t=v();return function(){var n,i=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f(this,n)}}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(e){return!1}}var b=function(e){a(i,e);var t=h(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={activeItem:null},n.onEnter=n.onEnter.bind(l(n)),n.submenuRef=r.default.createRef(),n}return u(i,[{key:"onItemMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.setState({activeItem:t})}},{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items||this.props.onLeafClick(e))}},{key:"position",value:function(){var e=this.submenuRef.current.parentElement,t=n.DomHandler.getOffset(this.submenuRef.current.parentElement),i=n.DomHandler.getViewport(),r=this.submenuRef.current.offsetParent?this.submenuRef.current.offsetWidth:n.DomHandler.getHiddenElementOuterWidth(this.submenuRef.current),o=n.DomHandler.getOuterWidth(e.children[0]);this.submenuRef.current.style.top="0px",this.submenuRef.current.style.left=parseInt(t.left,10)+o+r>i.width-n.DomHandler.calculateScrollbarWidth()?-1*r+"px":o+"px"}},{key:"onEnter",value:function(){this.position()}},{key:"isActive",value:function(){return this.props.root||!this.props.resetMenu}},{key:"componentDidUpdate",value:function(){this.isActive()&&this.position()}},{key:"renderSeparator",value:function(e){return r.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator",role:"separator"})}},{key:"renderSubmenu",value:function(e){return e.items?r.default.createElement(i,{model:e.items,resetMenu:e!==this.state.activeItem,onLeafClick:this.props.onLeafClick}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,o=this.state.activeItem===e,s=n.classNames("p-menuitem",{"p-menuitem-active":o},e.className),u=n.classNames("p-menuitem-link",{"p-disabled":e.disabled}),l=n.classNames("p-menuitem-icon",e.icon),c="p-submenu-icon pi pi-angle-right",a=e.icon&&r.default.createElement("span",{className:l}),m=e.label&&r.default.createElement("span",{className:"p-menuitem-text"},e.label),f=e.items&&r.default.createElement("span",{className:c}),d=this.renderSubmenu(e),p=r.default.createElement("a",{href:e.url||"#",className:u,target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},role:"menuitem","aria-haspopup":null!=e.items,"aria-disabled":e.disabled},a,m,f,r.default.createElement(n.Ripple,null));e.template&&(p=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:u,labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:c,element:p,props:this.props,active:o}));return r.default.createElement("li",{key:e.label+"_"+t,role:"none",className:s,style:e.style,onMouseEnter:function(t){return i.onItemMouseEnter(t,e)}},p,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderMenu",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"render",value:function(){var e=n.classNames({"p-submenu-list":!this.props.root}),t=this.renderMenu(),i=this.isActive();return r.default.createElement(n.CSSTransition,{nodeRef:this.submenuRef,classNames:"p-contextmenusub",in:i,timeout:{enter:0,exit:0},unmountOnExit:!0,onEnter:this.onEnter},r.default.createElement("ul",{ref:this.submenuRef,className:e},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!0===e.resetMenu?{activeItem:null}:null}}]),i}(t.Component);p(b,"defaultProps",{model:null,root:!1,className:null,resetMenu:!1,onLeafClick:null});var y=function(e){a(i,e);var t=h(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={visible:!1,reshow:!1,resetMenu:!1},n.onMenuClick=n.onMenuClick.bind(l(n)),n.onLeafClick=n.onLeafClick.bind(l(n)),n.onMenuMouseEnter=n.onMenuMouseEnter.bind(l(n)),n.onEnter=n.onEnter.bind(l(n)),n.onEntered=n.onEntered.bind(l(n)),n.onExit=n.onExit.bind(l(n)),n.onExited=n.onExited.bind(l(n)),n.menuRef=r.default.createRef(),n}return u(i,[{key:"onMenuClick",value:function(){this.setState({resetMenu:!1})}},{key:"onMenuMouseEnter",value:function(){this.setState({resetMenu:!1})}},{key:"show",value:function(e){var t=this;e instanceof Event||e.persist(),e.stopPropagation(),e.preventDefault(),this.currentEvent=e,this.state.visible?this.setState({reshow:!0}):this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(t.currentEvent)}))}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(this.state.visible&&t.reshow!==this.state.reshow){var i=this.currentEvent;this.setState({visible:!1,reshow:!1,rePosition:!1,resetMenu:!0},(function(){return n.show(i)}))}}},{key:"hide",value:function(e){var t=this;e instanceof Event||e.persist(),this.currentEvent=e,this.setState({visible:!1,reshow:!1},(function(){t.props.onHide&&t.props.onHide(t.currentEvent)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),this.position(this.currentEvent)}},{key:"onEntered",value:function(){this.bindDocumentListeners()}},{key:"onExit",value:function(){this.currentEvent=null,this.unbindDocumentListeners()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.menuRef.current)}},{key:"position",value:function(e){if(e){var t=e.pageX+1,i=e.pageY+1,r=this.menuRef.current.offsetParent?this.menuRef.current.offsetWidth:n.DomHandler.getHiddenElementOuterWidth(this.menuRef.current),o=this.menuRef.current.offsetParent?this.menuRef.current.offsetHeight:n.DomHandler.getHiddenElementOuterHeight(this.menuRef.current),s=n.DomHandler.getViewport();t+r-document.body.scrollLeft>s.width&&(t-=r),i+o-document.body.scrollTop>s.height&&(i-=o),t<document.body.scrollLeft&&(t=document.body.scrollLeft),i<document.body.scrollTop&&(i=document.body.scrollTop),this.menuRef.current.style.left=t+"px",this.menuRef.current.style.top=i+"px"}}},{key:"onLeafClick",value:function(e){this.setState({resetMenu:!0}),this.hide(e),e.stopPropagation()}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentListeners",value:function(){this.bindDocumentResizeListener(),this.bindDocumentClickListener()}},{key:"unbindDocumentListeners",value:function(){this.unbindDocumentResizeListener(),this.unbindDocumentClickListener()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isOutsideClicked(t)&&2!==t.button&&(e.hide(t),e.setState({resetMenu:!0}))},document.addEventListener("click",this.documentClickListener))}},{key:"bindDocumentContextMenuListener",value:function(){var e=this;this.documentContextMenuListener||(this.documentContextMenuListener=function(t){e.show(t)},document.addEventListener("contextmenu",this.documentContextMenuListener))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!n.DomHandler.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentContextMenuListener",value:function(){this.documentContextMenuListener&&(document.removeEventListener("contextmenu",this.documentContextMenuListener),this.documentContextMenuListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.props.global&&this.bindDocumentContextMenuListener()}},{key:"componentWillUnmount",value:function(){this.unbindDocumentListeners(),this.unbindDocumentContextMenuListener(),n.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderContextMenu",value:function(){var e=n.classNames("p-contextmenu p-component",this.props.className);return r.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-contextmenu",in:this.state.visible,timeout:{enter:250,exit:0},options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExit:this.onExit,onExited:this.onExited},r.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:e,style:this.props.style,onClick:this.onMenuClick,onMouseEnter:this.onMenuMouseEnter},r.default.createElement(b,{model:this.props.model,root:!0,resetMenu:this.state.resetMenu,onLeafClick:this.onLeafClick})))}},{key:"render",value:function(){var e=this.renderContextMenu();return r.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo})}}]),i}(t.Component);return p(y,"defaultProps",{id:null,model:null,style:null,className:null,global:!1,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),e.ContextMenu=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);