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
- "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){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(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 l(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(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 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 p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?r(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=h();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 p(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){u(o,e.Component);var r=f(o);function o(e){var t;return s(this,o),(t=r.call(this,e)).state={activeItem:null},t}return l(o,[{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.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return i.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?i.default.createElement(o,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,s=this.state.activeItem===e,o=t.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=t.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&i.default.createElement("span",{className:l}),c=e.label&&i.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&i.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=i.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return i.default.createElement("li",{key:e.label+"_"+n,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",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-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),n={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},r=this.renderItems();return i.default.createElement("ul",{className:e,style:n},r)}}]),o}();m(v,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var b=function(n){u(a,e.Component);var o=f(a);function a(e){var t;return s(this,a),(t=o.call(this,e)).state={level:0,visible:!1},t.navigateBack=t.navigateBack.bind(r(t)),t.navigateForward=t.navigateForward.bind(r(t)),t.onEnter=t.onEnter.bind(r(t)),t.onEntered=t.onEntered.bind(r(t)),t.onExit=t.onExit.bind(r(t)),t.onExited=t.onExited.bind(r(t)),t.onPanelClick=t.onPanelClick.bind(r(t)),t.menuRef=i.default.createRef(),t}return l(a,[{key:"onPanelClick",value:function(e){this.props.popup&&t.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,n=t.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return i.default.createElement("div",{ref:function(t){return e.backward=t},className:n,onClick:this.navigateBack},i.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),i.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),t.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{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:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new t.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,n=t.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),r=this.renderBackward();return i.default.createElement(t.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||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},i.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:n,style:this.props.style,onClick:this.onPanelClick},i.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},i.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},i.default.createElement(v,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),r)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?i.default.createElement(t.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),a}();m(b,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.SlideMenu=b,exports.SlideMenuSub=v;
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){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(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 l(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(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 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 p(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 r(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=h();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 p(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){u(o,e.Component);var r=f(o);function o(e){var t;return s(this,o),(t=r.call(this,e)).state={activeItem:null},t}return l(o,[{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.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return i.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?i.default.createElement(o,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,n){var r=this,s=this.state.activeItem===e,o=t.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=t.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&i.default.createElement("span",{className:l}),c=e.label&&i.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&i.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=i.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(t){return r.onItemClick(t,e,n)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=t.ObjectUtils.getJSXElement(e.template,e,{onClick:function(t){return r.onItemClick(t,e,n)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return i.default.createElement("li",{key:e.label+"_"+n,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",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-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),n={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},r=this.renderItems();return i.default.createElement("ul",{className:e,style:n},r)}}]),o}();m(v,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var b=function(n){u(a,e.Component);var o=f(a);function a(e){var t;return s(this,a),(t=o.call(this,e)).state={level:0,visible:!1},t.navigateBack=t.navigateBack.bind(r(t)),t.navigateForward=t.navigateForward.bind(r(t)),t.onEnter=t.onEnter.bind(r(t)),t.onEntered=t.onEntered.bind(r(t)),t.onExit=t.onExit.bind(r(t)),t.onExited=t.onExited.bind(r(t)),t.onPanelClick=t.onPanelClick.bind(r(t)),t.menuRef=i.default.createRef(),t}return l(a,[{key:"onPanelClick",value:function(e){this.props.popup&&t.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,n=t.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return i.default.createElement("div",{ref:function(t){return e.backward=t},className:n,onClick:this.navigateBack},i.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),i.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&t.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),t.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){t.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{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:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new t.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),t.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,n=t.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),r=this.renderBackward();return i.default.createElement(t.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||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},i.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:n,style:this.props.style,onClick:this.onPanelClick},i.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},i.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},i.default.createElement(v,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),r)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?i.default.createElement(t.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),a}();m(b,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),exports.SlideMenu=b,exports.SlideMenuSub=v;
@@ -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{classNames as n,ObjectUtils as i,OverlayService as r,ZIndexUtils as s,DomHandler as o,ConnectedOverlayScrollHandler as l,CSSTransition as a,Portal as u}from"primereact/core";function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(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 m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function h(e,t){return(h=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&&h(e,t)}function v(e){return(v="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 b(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?c(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(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=g();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}function g(){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 w=function(r){f(o,t);var s=E(o);function o(e){var t;return p(this,o),(t=s.call(this,e)).state={activeItem:null},t}return m(o,[{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.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(o,{model:t.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:t===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(t,r){var s=this,o=this.state.activeItem===t,l=n("p-menuitem",{"p-menuitem-active":o,"p-disabled":t.disabled},t.className),a=n("p-menuitem-icon",t.icon),u="p-submenu-icon pi pi-fw pi-angle-right",c=t.icon&&e.createElement("span",{className:a}),p=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),d=t.items&&e.createElement("span",{className:u}),m=this.renderSubmenu(t),h=e.createElement("a",{href:t.url||"#",className:"p-menuitem-link",target:t.target,onClick:function(e){return s.onItemClick(e,t,r)},"aria-disabled":t.disabled},c,p,d);t.template&&(h=i.getJSXElement(t.template,t,{onClick:function(e){return s.onItemClick(e,t,r)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:u,element:h,props:this.props,active:o}));return e.createElement("li",{key:t.label+"_"+r,className:l,style:t.style},h,m)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",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=n({"p-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),i={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},r=this.renderItems();return e.createElement("ul",{className:t,style:i},r)}}]),o}();k(w,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var L=function(i){f(h,t);var d=E(h);function h(t){var n;return p(this,h),(n=d.call(this,t)).state={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(c(n)),n.navigateForward=n.navigateForward.bind(c(n)),n.onEnter=n.onEnter.bind(c(n)),n.onEntered=n.onEntered.bind(c(n)),n.onExit=n.onExit.bind(c(n)),n.onExited=n.onExited.bind(c(n)),n.onPanelClick=n.onPanelClick.bind(c(n)),n.menuRef=e.createRef(),n}return m(h,[{key:"onPanelClick",value:function(e){this.props.popup&&r.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var t=this,i=n("p-slidemenu-backward",{"p-hidden":0===this.state.level});return e.createElement("div",{ref:function(e){return t.backward=e},className:i,onClick:this.navigateBack},e.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),e.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&s.set("menu",this.menuRef.current,this.props.baseZIndex),o.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){s.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!o.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new l(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),s.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var t=this,i=n("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),r=this.renderBackward();return e.createElement(a,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||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.menuRef,id:this.props.id,className:i,style:this.props.style,onClick:this.onPanelClick},e.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},e.createElement("div",{className:"p-slidemenu-content",ref:function(e){return t.slideMenuContent=e}},e.createElement(w,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),r)))}},{key:"render",value:function(){var t=this.renderElement();return this.props.popup?e.createElement(u,{element:t,appendTo:this.props.appendTo}):t}}]),h}();k(L,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{L as SlideMenu,w as SlideMenuSub};
1
+ import e,{Component as t}from"react";import{classNames as n,ObjectUtils as i,OverlayService as r,ZIndexUtils as o,DomHandler as s,ConnectedOverlayScrollHandler as l,CSSTransition as a,Portal as u}from"primereact/core";function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(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 m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function h(e,t){return(h=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&&h(e,t)}function v(e){return(v="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 b(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(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=w();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}function w(){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 g=function(r){f(s,t);var o=E(s);function s(e){var t;return p(this,s),(t=o.call(this,e)).state={activeItem:null},t}return m(s,[{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.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(s,{model:t.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:t===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(t,r){var o=this,s=this.state.activeItem===t,l=n("p-menuitem",{"p-menuitem-active":s,"p-disabled":t.disabled},t.className),a=n("p-menuitem-icon",t.icon),u="p-submenu-icon pi pi-fw pi-angle-right",c=t.icon&&e.createElement("span",{className:a}),p=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),d=t.items&&e.createElement("span",{className:u}),m=this.renderSubmenu(t),h=e.createElement("a",{href:t.url||"#",className:"p-menuitem-link",target:t.target,onClick:function(e){return o.onItemClick(e,t,r)},"aria-disabled":t.disabled},c,p,d);t.template&&(h=i.getJSXElement(t.template,t,{onClick:function(e){return o.onItemClick(e,t,r)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:a,submenuIconClassName:u,element:h,props:this.props,active:s}));return e.createElement("li",{key:t.label+"_"+r,className:l,style:t.style},h,m)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",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=n({"p-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),i={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},r=this.renderItems();return e.createElement("ul",{className:t,style:i},r)}}]),s}();k(g,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var L=function(i){f(h,t);var d=E(h);function h(t){var n;return p(this,h),(n=d.call(this,t)).state={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(c(n)),n.navigateForward=n.navigateForward.bind(c(n)),n.onEnter=n.onEnter.bind(c(n)),n.onEntered=n.onEntered.bind(c(n)),n.onExit=n.onExit.bind(c(n)),n.onExited=n.onExited.bind(c(n)),n.onPanelClick=n.onPanelClick.bind(c(n)),n.menuRef=e.createRef(),n}return m(h,[{key:"onPanelClick",value:function(e){this.props.popup&&r.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var t=this,i=n("p-slidemenu-backward",{"p-hidden":0===this.state.level});return e.createElement("div",{ref:function(e){return t.backward=e},className:i,onClick:this.navigateBack},e.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),e.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&o.set("menu",this.menuRef.current,this.props.baseZIndex),s.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){o.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{key:"bindDocumentResizeListener",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(t){e.state.visible&&!s.isAndroid()&&e.hide(t)},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new l(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),o.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var t=this,i=n("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),r=this.renderBackward();return e.createElement(a,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||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.menuRef,id:this.props.id,className:i,style:this.props.style,onClick:this.onPanelClick},e.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},e.createElement("div",{className:"p-slidemenu-content",ref:function(e){return t.slideMenuContent=e}},e.createElement(g,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),r)))}},{key:"render",value:function(){var t=this.renderElement();return this.props.popup?e.createElement(u,{element:t,appendTo:this.props.appendTo}):t}}]),h}();k(L,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null});export{L as SlideMenu,g as SlideMenuSub};
@@ -79,6 +79,8 @@ this.primereact.slidemenu = (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.slidemenu=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 s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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 a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function u(e,t){return(u=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&&u(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 d(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?s(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=v();return function(){var n,i=m(e);if(t){var r=m(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(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=f(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={activeItem:null},n}return a(i,[{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.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return r.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?r.default.createElement(i,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,s=this.state.activeItem===e,o=n.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=n.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&r.default.createElement("span",{className:l}),c=e.label&&r.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&r.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=r.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return r.default.createElement("li",{key:e.label+"_"+t,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",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-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),t={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},i=this.renderItems();return r.default.createElement("ul",{className:e,style:t},i)}}]),i}(t.Component);h(b,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward:null});var y=function(e){c(i,e);var t=f(i);function i(e){var n;return o(this,i),(n=t.call(this,e)).state={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(s(n)),n.navigateForward=n.navigateForward.bind(s(n)),n.onEnter=n.onEnter.bind(s(n)),n.onEntered=n.onEntered.bind(s(n)),n.onExit=n.onExit.bind(s(n)),n.onExited=n.onExited.bind(s(n)),n.onPanelClick=n.onPanelClick.bind(s(n)),n.menuRef=r.default.createRef(),n}return a(i,[{key:"onPanelClick",value:function(e){this.props.popup&&n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,t=n.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return r.default.createElement("div",{ref:function(t){return e.backward=t},className:t,onClick:this.navigateBack},r.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),r.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),n.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{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:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,t=n.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),i=this.renderBackward();return r.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||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},r.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},r.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},r.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},r.default.createElement(b,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),i)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?r.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),i}(t.Component);return h(y,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),e.SlideMenu=y,e.SlideMenuSub=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
1
+ this.primereact=this.primereact||{},this.primereact.slidemenu=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 s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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 a(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function u(e,t){return(u=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&&u(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 d(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 s(e)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(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=m(e);if(t){var r=m(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(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}return a(i,[{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.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(e){return r.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?r.default.createElement(i,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,s=this.state.activeItem===e,o=n.classNames("p-menuitem",{"p-menuitem-active":s,"p-disabled":e.disabled},e.className),l=n.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&r.default.createElement("span",{className:l}),c=e.label&&r.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&r.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=r.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:a,element:m,props:this.props,active:s}));return r.default.createElement("li",{key:e.label+"_"+t,className:o,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",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-slidemenu-rootlist":this.props.root,"p-submenu-list":!this.props.root,"p-active-submenu":this.props.parentActive}),t={width:this.props.menuWidth+"px",left:this.props.root?-1*this.props.level*this.props.menuWidth+"px":this.props.menuWidth+"px",transitionProperty:this.props.root?"left":"none",transitionDuration:this.props.effectDuration+"ms",transitionTimingFunction:this.props.easing},i=this.renderItems();return r.default.createElement("ul",{className:e,style:t},i)}}]),i}(t.Component);f(b,"defaultProps",{model:null,level:0,easing:"ease-out",effectDuration:250,menuWidth:190,parentActive:!1,onForward: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={level:0,visible:!1},n.navigateBack=n.navigateBack.bind(s(n)),n.navigateForward=n.navigateForward.bind(s(n)),n.onEnter=n.onEnter.bind(s(n)),n.onEntered=n.onEntered.bind(s(n)),n.onExit=n.onExit.bind(s(n)),n.onExited=n.onExited.bind(s(n)),n.onPanelClick=n.onPanelClick.bind(s(n)),n.menuRef=r.default.createRef(),n}return a(i,[{key:"onPanelClick",value:function(e){this.props.popup&&n.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"navigateForward",value:function(){this.setState({level:this.state.level+1})}},{key:"navigateBack",value:function(){this.setState({level:this.state.level-1})}},{key:"renderBackward",value:function(){var e=this,t=n.classNames("p-slidemenu-backward",{"p-hidden":0===this.state.level});return r.default.createElement("div",{ref:function(t){return e.backward=t},className:t,onClick:this.navigateBack},r.default.createElement("span",{className:"p-slidemenu-backward-icon pi pi-fw pi-chevron-left"}),r.default.createElement("span",null,this.props.backLabel))}},{key:"toggle",value:function(e){this.props.popup&&(this.state.visible?this.hide(e):this.show(e))}},{key:"show",value:function(e){var t=this;this.target=e.currentTarget;var n=e;this.setState({visible:!0},(function(){t.props.onShow&&t.props.onShow(n)}))}},{key:"hide",value:function(e){var t=this,n=e;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(n)}))}},{key:"onEnter",value:function(){this.props.autoZIndex&&n.ZIndexUtils.set("menu",this.menuRef.current,this.props.baseZIndex),n.DomHandler.absolutePosition(this.menuRef.current,this.target)}},{key:"onEntered",value:function(){this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener()}},{key:"onExit",value:function(){this.target=null,this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}},{key:"onExited",value:function(){n.ZIndexUtils.clear(this.menuRef.current),this.setState({level:0})}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.state.visible&&e.isOutsideClicked(t)&&e.hide(t)},document.addEventListener("click",this.documentClickListener))}},{key:"isOutsideClicked",value:function(e){return this.menuRef&&this.menuRef.current&&!(this.menuRef.current.isSameNode(e.target)||this.menuRef.current.contains(e.target))}},{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:"unbindDocumentResizeListener",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.target,(function(t){e.state.visible&&e.hide(t)}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"componentDidUpdate",value:function(e,t){this.props.model!==e.model&&this.setState({level:0})}},{key:"componentWillUnmount",value:function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),n.ZIndexUtils.clear(this.menuRef.current)}},{key:"renderElement",value:function(){var e=this,t=n.classNames("p-slidemenu p-component",{"p-slidemenu-overlay":this.props.popup},this.props.className),i=this.renderBackward();return r.default.createElement(n.CSSTransition,{nodeRef:this.menuRef,classNames:"p-connected-overlay",in:!this.props.popup||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},r.default.createElement("div",{ref:this.menuRef,id:this.props.id,className:t,style:this.props.style,onClick:this.onPanelClick},r.default.createElement("div",{className:"p-slidemenu-wrapper",style:{height:this.props.viewportHeight+"px"}},r.default.createElement("div",{className:"p-slidemenu-content",ref:function(t){return e.slideMenuContent=t}},r.default.createElement(b,{model:this.props.model,root:!0,index:0,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,level:this.state.level,parentActive:0===this.state.level,onForward:this.navigateForward})),i)))}},{key:"render",value:function(){var e=this.renderElement();return this.props.popup?r.default.createElement(n.Portal,{element:e,appendTo:this.props.appendTo}):e}}]),i}(t.Component);return f(y,"defaultProps",{id:null,model:null,popup:!1,style:null,className:null,easing:"ease-out",effectDuration:250,backLabel:"Back",menuWidth:190,viewportHeight:175,autoZIndex:!0,baseZIndex:0,appendTo:null,transitionOptions:null,onShow:null,onHide:null}),e.SlideMenu=y,e.SlideMenuSub=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
@@ -117,6 +117,8 @@ function _typeof(obj) {
117
117
  function _possibleConstructorReturn(self, call) {
118
118
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
119
119
  return call;
120
+ } else if (call !== void 0) {
121
+ throw new TypeError("Derived constructors may only return object or undefined");
120
122
  }
121
123
 
122
124
  return _assertThisInitialized(self);
@@ -165,9 +167,14 @@ var Slider = /*#__PURE__*/function (_Component) {
165
167
  }
166
168
 
167
169
  _createClass(Slider, [{
170
+ key: "value",
171
+ get: function get() {
172
+ return this.props.range ? this.props.value || [0, 100] : this.props.value || 0;
173
+ }
174
+ }, {
168
175
  key: "spin",
169
176
  value: function spin(event, dir) {
170
- var value = (this.props.range ? this.props.value[this.handleIndex] : this.props.value) || 0;
177
+ var value = this.props.range ? this.value[this.handleIndex] : this.value;
171
178
  var step = (this.props.step || 1) * dir;
172
179
  this.updateValue(event, value + step);
173
180
  event.preventDefault();
@@ -322,7 +329,7 @@ var Slider = /*#__PURE__*/function (_Component) {
322
329
  var newValue = (this.props.max - this.props.min) * (handleValue / 100) + this.props.min;
323
330
 
324
331
  if (this.props.step) {
325
- var oldValue = this.props.range ? this.props.value[this.handleIndex] : this.props.value;
332
+ var oldValue = this.props.range ? this.value[this.handleIndex] : this.value;
326
333
  var diff = newValue - oldValue;
327
334
  if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.props.step - oldValue / this.props.step) * this.props.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.props.step - oldValue / this.props.step) * this.props.step;
328
335
  } else {
@@ -338,12 +345,12 @@ var Slider = /*#__PURE__*/function (_Component) {
338
345
 
339
346
  if (this.props.range) {
340
347
  if (this.handleIndex === 0) {
341
- if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.props.value[1]) newValue = this.props.value[1];
348
+ if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.value[1]) newValue = this.value[1];
342
349
  } else {
343
- if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.props.value[0]) newValue = this.props.value[0];
350
+ if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.value[0]) newValue = this.value[0];
344
351
  }
345
352
 
346
- var newValues = _toConsumableArray(this.props.value);
353
+ var newValues = _toConsumableArray(this.value);
347
354
 
348
355
  newValues[this.handleIndex] = newValue;
349
356
 
@@ -407,7 +414,7 @@ var Slider = /*#__PURE__*/function (_Component) {
407
414
  }, {
408
415
  key: "renderRangeSlider",
409
416
  value: function renderRangeSlider() {
410
- var values = this.props.value || [0, 0];
417
+ var values = this.value;
411
418
  var horizontal = this.props.orientation === 'horizontal';
412
419
  var handleValueStart = (values[0] < this.props.min ? 0 : values[0] - this.props.min) * 100 / (this.props.max - this.props.min);
413
420
  var handleValueEnd = (values[1] > this.props.max ? 100 : values[1] - this.props.min) * 100 / (this.props.max - this.props.min);
@@ -428,7 +435,7 @@ var Slider = /*#__PURE__*/function (_Component) {
428
435
  }, {
429
436
  key: "renderSingleSlider",
430
437
  value: function renderSingleSlider() {
431
- var value = this.props.value || 0;
438
+ var value = this.value;
432
439
  var handleValue;
433
440
  if (value < this.props.min) handleValue = 0;else if (value > this.props.max) handleValue = 100;else handleValue = (value - this.props.min) * 100 / (this.props.max - this.props.min);
434
441
  var rangeStyle = this.props.orientation === 'horizontal' ? {
@@ -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 r=n(e);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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 h(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 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&&d(e,t)}function f(e){return(f="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"!==f(t)&&"function"!=typeof t?h(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}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 y,b,L,E=function(n){c(E,e.Component);var i,d,f,y,b,L=(i=E,d=v(),function(){var e,t=g(i);if(d){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function E(e){var t;return u(this,E),(t=L.call(this,e)).onBarClick=t.onBarClick.bind(h(t)),t.onKeyDown=t.onKeyDown.bind(h(t)),t.handleIndex=0,t}return f=E,(y=[{key:"spin",value:function(e,t){this.updateValue(e,((this.props.range?this.props.value[this.handleIndex]:this.props.value)||0)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+t.DomHandler.getWindowScrollLeft(),this.initY=e.top+t.DomHandler.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.props.value[this.handleIndex]:this.props.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.props.value[1]&&(r=this.props.value[1]):r>this.props.max?r=this.props.max:r<this.props.value[0]&&(r=this.props.value[0]);var i=s(n=this.props.value)||o(n)||a(n)||l();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,n,i){var s=this,o=t.classNames("p-slider-handle",{"p-slider-handle-start":0===i,"p-slider-handle-end":1===i,"p-slider-handle-active":this.handleIndex===i});return r.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,i)},onTouchStart:function(e){return s.onTouchStart(e,i)},onKeyDown:function(e){return s.onKeyDown(e,i)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:n&&n+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||n,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.props.value||[0,0],t="horizontal"===this.props.orientation,n=100*(e[0]<this.props.min?0:e[0]-this.props.min)/(this.props.max-this.props.min),i=100*(e[1]>this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(i,null,1):this.renderHandle(null,i,1);return r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:i-n+"%"}:{bottom:n+"%",height:i-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.props.value||0;e=t<this.props.min?0:t>this.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},i="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{className:"p-slider-range",style:n}),i)}},{key:"render",value:function(){var e=this,n=t.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),i=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return r.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:n,onClick:this.onBarClick},i)}}])&&p(f.prototype,y),b&&p(f,b),E}();L={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(b="defaultProps")in(y=E)?Object.defineProperty(y,b,{value:L,enumerable:!0,configurable:!0,writable:!0}):y[b]=L,exports.Slider=E;
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 r=n(e);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(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 p(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 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&&d(e,t)}function f(e){return(f="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 g(e,t){if(t&&("object"===f(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 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 y,b,L,E=function(n){c(E,e.Component);var i,d,f,y,b,L=(i=E,d=v(),function(){var e,t=m(i);if(d){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function E(e){var t;return u(this,E),(t=L.call(this,e)).onBarClick=t.onBarClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t.handleIndex=0,t}return f=E,(y=[{key:"value",get:function(){return this.props.range?this.props.value||[0,100]:this.props.value||0}},{key:"spin",value:function(e,t){this.updateValue(e,(this.props.range?this.value[this.handleIndex]:this.value)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+t.DomHandler.getWindowScrollLeft(),this.initY=e.top+t.DomHandler.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.value[this.handleIndex]:this.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:r<this.value[0]&&(r=this.value[0]);var i=s(n=this.value)||o(n)||a(n)||l();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,n,i){var s=this,o=t.classNames("p-slider-handle",{"p-slider-handle-start":0===i,"p-slider-handle-end":1===i,"p-slider-handle-active":this.handleIndex===i});return r.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,i)},onTouchStart:function(e){return s.onTouchStart(e,i)},onKeyDown:function(e){return s.onKeyDown(e,i)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:n&&n+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||n,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.value,t="horizontal"===this.props.orientation,n=100*(e[0]<this.props.min?0:e[0]-this.props.min)/(this.props.max-this.props.min),i=100*(e[1]>this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(i,null,1):this.renderHandle(null,i,1);return r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:i-n+"%"}:{bottom:n+"%",height:i-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.value;e=t<this.props.min?0:t>this.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},i="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{className:"p-slider-range",style:n}),i)}},{key:"render",value:function(){var e=this,n=t.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),i=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return r.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:n,onClick:this.onBarClick},i)}}])&&h(f.prototype,y),b&&h(f,b),E}();L={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(b="defaultProps")in(y=E)?Object.defineProperty(y,b,{value:L,enumerable:!0,configurable:!0,writable:!0}):y[b]=L,exports.Slider=E;
@@ -109,6 +109,8 @@ function _typeof(obj) {
109
109
  function _possibleConstructorReturn(self, call) {
110
110
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
111
111
  return call;
112
+ } else if (call !== void 0) {
113
+ throw new TypeError("Derived constructors may only return object or undefined");
112
114
  }
113
115
 
114
116
  return _assertThisInitialized(self);
@@ -157,9 +159,14 @@ var Slider = /*#__PURE__*/function (_Component) {
157
159
  }
158
160
 
159
161
  _createClass(Slider, [{
162
+ key: "value",
163
+ get: function get() {
164
+ return this.props.range ? this.props.value || [0, 100] : this.props.value || 0;
165
+ }
166
+ }, {
160
167
  key: "spin",
161
168
  value: function spin(event, dir) {
162
- var value = (this.props.range ? this.props.value[this.handleIndex] : this.props.value) || 0;
169
+ var value = this.props.range ? this.value[this.handleIndex] : this.value;
163
170
  var step = (this.props.step || 1) * dir;
164
171
  this.updateValue(event, value + step);
165
172
  event.preventDefault();
@@ -314,7 +321,7 @@ var Slider = /*#__PURE__*/function (_Component) {
314
321
  var newValue = (this.props.max - this.props.min) * (handleValue / 100) + this.props.min;
315
322
 
316
323
  if (this.props.step) {
317
- var oldValue = this.props.range ? this.props.value[this.handleIndex] : this.props.value;
324
+ var oldValue = this.props.range ? this.value[this.handleIndex] : this.value;
318
325
  var diff = newValue - oldValue;
319
326
  if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.props.step - oldValue / this.props.step) * this.props.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.props.step - oldValue / this.props.step) * this.props.step;
320
327
  } else {
@@ -330,12 +337,12 @@ var Slider = /*#__PURE__*/function (_Component) {
330
337
 
331
338
  if (this.props.range) {
332
339
  if (this.handleIndex === 0) {
333
- if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.props.value[1]) newValue = this.props.value[1];
340
+ if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.value[1]) newValue = this.value[1];
334
341
  } else {
335
- if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.props.value[0]) newValue = this.props.value[0];
342
+ if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.value[0]) newValue = this.value[0];
336
343
  }
337
344
 
338
- var newValues = _toConsumableArray(this.props.value);
345
+ var newValues = _toConsumableArray(this.value);
339
346
 
340
347
  newValues[this.handleIndex] = newValue;
341
348
 
@@ -399,7 +406,7 @@ var Slider = /*#__PURE__*/function (_Component) {
399
406
  }, {
400
407
  key: "renderRangeSlider",
401
408
  value: function renderRangeSlider() {
402
- var values = this.props.value || [0, 0];
409
+ var values = this.value;
403
410
  var horizontal = this.props.orientation === 'horizontal';
404
411
  var handleValueStart = (values[0] < this.props.min ? 0 : values[0] - this.props.min) * 100 / (this.props.max - this.props.min);
405
412
  var handleValueEnd = (values[1] > this.props.max ? 100 : values[1] - this.props.min) * 100 / (this.props.max - this.props.min);
@@ -420,7 +427,7 @@ var Slider = /*#__PURE__*/function (_Component) {
420
427
  }, {
421
428
  key: "renderSingleSlider",
422
429
  value: function renderSingleSlider() {
423
- var value = this.props.value || 0;
430
+ var value = this.value;
424
431
  var handleValue;
425
432
  if (value < this.props.min) handleValue = 0;else if (value > this.props.max) handleValue = 100;else handleValue = (value - this.props.min) * 100 / (this.props.max - this.props.min);
426
433
  var rangeStyle = this.props.orientation === 'horizontal' ? {
@@ -1 +1 @@
1
- import e,{Component as t}from"react";import{DomHandler as n,classNames as r}from"primereact/core";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(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 d(e,t){return(d=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&&d(e,t)}function f(e){return(f="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 g(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?u(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}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 y,b,L,E=function(i){c(D,t);var d,f,y,b,L,E=(d=D,f=v(),function(){var e,t=m(d);if(f){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function D(e){var t;return p(this,D),(t=E.call(this,e)).onBarClick=t.onBarClick.bind(u(t)),t.onKeyDown=t.onKeyDown.bind(u(t)),t.handleIndex=0,t}return y=D,(b=[{key:"spin",value:function(e,t){this.updateValue(e,((this.props.range?this.props.value[this.handleIndex]:this.props.value)||0)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+n.getWindowScrollLeft(),this.initY=e.top+n.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.props.value[this.handleIndex]:this.props.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.props.value[1]&&(r=this.props.value[1]):r>this.props.max?r=this.props.max:r<this.props.value[0]&&(r=this.props.value[0]);var i=s(n=this.props.value)||o(n)||a(n)||l();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(t,n,i){var s=this,o=r("p-slider-handle",{"p-slider-handle-start":0===i,"p-slider-handle-end":1===i,"p-slider-handle-active":this.handleIndex===i});return e.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,i)},onTouchStart:function(e){return s.onTouchStart(e,i)},onKeyDown:function(e){return s.onKeyDown(e,i)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==t&&t+"%",bottom:n&&n+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":t||n,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var t=this.props.value||[0,0],n="horizontal"===this.props.orientation,r=100*(t[0]<this.props.min?0:t[0]-this.props.min)/(this.props.max-this.props.min),i=100*(t[1]>this.props.max?100:t[1]-this.props.min)/(this.props.max-this.props.min),s=n?this.renderHandle(r,null,0):this.renderHandle(null,r,0),o=n?this.renderHandle(i,null,1):this.renderHandle(null,i,1);return e.createElement(e.Fragment,null,e.createElement("span",{className:"p-slider-range",style:n?{left:r+"%",width:i-r+"%"}:{bottom:r+"%",height:i-r+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var t,n=this.props.value||0;t=n<this.props.min?0:n>this.props.max?100:100*(n-this.props.min)/(this.props.max-this.props.min);var r="horizontal"===this.props.orientation?{width:t+"%"}:{height:t+"%"},i="horizontal"===this.props.orientation?this.renderHandle(t,null,null):this.renderHandle(null,t,null);return e.createElement(e.Fragment,null,e.createElement("span",{className:"p-slider-range",style:r}),i)}},{key:"render",value:function(){var t=this,n=r("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),i=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return e.createElement("div",{id:this.props.id,ref:function(e){return t.el=e},style:this.props.style,className:n,onClick:this.onBarClick},i)}}])&&h(y.prototype,b),L&&h(y,L),D}();L={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(b="defaultProps")in(y=E)?Object.defineProperty(y,b,{value:L,enumerable:!0,configurable:!0,writable:!0}):y[b]=L;export{E as Slider};
1
+ import e,{Component as t}from"react";import{DomHandler as n,classNames as r}from"primereact/core";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return i(e)}function o(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(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 p(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 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&&d(e,t)}function f(e){return(f="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 g(e,t){if(t&&("object"===f(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 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 y,b,L,E=function(i){c(w,t);var d,f,y,b,L,E=(d=w,f=v(),function(){var e,t=m(d);if(f){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function w(e){var t;return u(this,w),(t=E.call(this,e)).onBarClick=t.onBarClick.bind(p(t)),t.onKeyDown=t.onKeyDown.bind(p(t)),t.handleIndex=0,t}return y=w,(b=[{key:"value",get:function(){return this.props.range?this.props.value||[0,100]:this.props.value||0}},{key:"spin",value:function(e,t){this.updateValue(e,(this.props.range?this.value[this.handleIndex]:this.value)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+n.getWindowScrollLeft(),this.initY=e.top+n.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.value[this.handleIndex]:this.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:r<this.value[0]&&(r=this.value[0]);var i=s(n=this.value)||o(n)||a(n)||l();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(t,n,i){var s=this,o=r("p-slider-handle",{"p-slider-handle-start":0===i,"p-slider-handle-end":1===i,"p-slider-handle-active":this.handleIndex===i});return e.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,i)},onTouchStart:function(e){return s.onTouchStart(e,i)},onKeyDown:function(e){return s.onKeyDown(e,i)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==t&&t+"%",bottom:n&&n+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":t||n,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var t=this.value,n="horizontal"===this.props.orientation,r=100*(t[0]<this.props.min?0:t[0]-this.props.min)/(this.props.max-this.props.min),i=100*(t[1]>this.props.max?100:t[1]-this.props.min)/(this.props.max-this.props.min),s=n?this.renderHandle(r,null,0):this.renderHandle(null,r,0),o=n?this.renderHandle(i,null,1):this.renderHandle(null,i,1);return e.createElement(e.Fragment,null,e.createElement("span",{className:"p-slider-range",style:n?{left:r+"%",width:i-r+"%"}:{bottom:r+"%",height:i-r+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var t,n=this.value;t=n<this.props.min?0:n>this.props.max?100:100*(n-this.props.min)/(this.props.max-this.props.min);var r="horizontal"===this.props.orientation?{width:t+"%"}:{height:t+"%"},i="horizontal"===this.props.orientation?this.renderHandle(t,null,null):this.renderHandle(null,t,null);return e.createElement(e.Fragment,null,e.createElement("span",{className:"p-slider-range",style:r}),i)}},{key:"render",value:function(){var t=this,n=r("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),i=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return e.createElement("div",{id:this.props.id,ref:function(e){return t.el=e},style:this.props.style,className:n,onClick:this.onBarClick},i)}}])&&h(y.prototype,b),L&&h(y,L),w}();L={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(b="defaultProps")in(y=E)?Object.defineProperty(y,b,{value:L,enumerable:!0,configurable:!0,writable:!0}):y[b]=L;export{E as Slider};
package/slider/slider.js CHANGED
@@ -114,6 +114,8 @@ this.primereact.slider = (function (exports, React, core) {
114
114
  function _possibleConstructorReturn(self, call) {
115
115
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
116
116
  return call;
117
+ } else if (call !== void 0) {
118
+ throw new TypeError("Derived constructors may only return object or undefined");
117
119
  }
118
120
 
119
121
  return _assertThisInitialized(self);
@@ -162,9 +164,14 @@ this.primereact.slider = (function (exports, React, core) {
162
164
  }
163
165
 
164
166
  _createClass(Slider, [{
167
+ key: "value",
168
+ get: function get() {
169
+ return this.props.range ? this.props.value || [0, 100] : this.props.value || 0;
170
+ }
171
+ }, {
165
172
  key: "spin",
166
173
  value: function spin(event, dir) {
167
- var value = (this.props.range ? this.props.value[this.handleIndex] : this.props.value) || 0;
174
+ var value = this.props.range ? this.value[this.handleIndex] : this.value;
168
175
  var step = (this.props.step || 1) * dir;
169
176
  this.updateValue(event, value + step);
170
177
  event.preventDefault();
@@ -319,7 +326,7 @@ this.primereact.slider = (function (exports, React, core) {
319
326
  var newValue = (this.props.max - this.props.min) * (handleValue / 100) + this.props.min;
320
327
 
321
328
  if (this.props.step) {
322
- var oldValue = this.props.range ? this.props.value[this.handleIndex] : this.props.value;
329
+ var oldValue = this.props.range ? this.value[this.handleIndex] : this.value;
323
330
  var diff = newValue - oldValue;
324
331
  if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.props.step - oldValue / this.props.step) * this.props.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.props.step - oldValue / this.props.step) * this.props.step;
325
332
  } else {
@@ -335,12 +342,12 @@ this.primereact.slider = (function (exports, React, core) {
335
342
 
336
343
  if (this.props.range) {
337
344
  if (this.handleIndex === 0) {
338
- if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.props.value[1]) newValue = this.props.value[1];
345
+ if (newValue < this.props.min) newValue = this.props.min;else if (newValue > this.value[1]) newValue = this.value[1];
339
346
  } else {
340
- if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.props.value[0]) newValue = this.props.value[0];
347
+ if (newValue > this.props.max) newValue = this.props.max;else if (newValue < this.value[0]) newValue = this.value[0];
341
348
  }
342
349
 
343
- var newValues = _toConsumableArray(this.props.value);
350
+ var newValues = _toConsumableArray(this.value);
344
351
 
345
352
  newValues[this.handleIndex] = newValue;
346
353
 
@@ -404,7 +411,7 @@ this.primereact.slider = (function (exports, React, core) {
404
411
  }, {
405
412
  key: "renderRangeSlider",
406
413
  value: function renderRangeSlider() {
407
- var values = this.props.value || [0, 0];
414
+ var values = this.value;
408
415
  var horizontal = this.props.orientation === 'horizontal';
409
416
  var handleValueStart = (values[0] < this.props.min ? 0 : values[0] - this.props.min) * 100 / (this.props.max - this.props.min);
410
417
  var handleValueEnd = (values[1] > this.props.max ? 100 : values[1] - this.props.min) * 100 / (this.props.max - this.props.min);
@@ -425,7 +432,7 @@ this.primereact.slider = (function (exports, React, core) {
425
432
  }, {
426
433
  key: "renderSingleSlider",
427
434
  value: function renderSingleSlider() {
428
- var value = this.props.value || 0;
435
+ var value = this.value;
429
436
  var handleValue;
430
437
  if (value < this.props.min) handleValue = 0;else if (value > this.props.max) handleValue = 100;else handleValue = (value - this.props.min) * 100 / (this.props.max - this.props.min);
431
438
  var rangeStyle = this.props.orientation === 'horizontal' ? {
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.slider=function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){if(Array.isArray(e))return s(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(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 d(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 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&&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 g(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?d(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(){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,L,E,D=function(e){f(L,e);var t,r,s,c,m,b=(t=L,r=y(),function(){var e,n=v(t);if(r){var i=v(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return g(this,e)});function L(e){var t;return p(this,L),(t=b.call(this,e)).onBarClick=t.onBarClick.bind(d(t)),t.onKeyDown=t.onKeyDown.bind(d(t)),t.handleIndex=0,t}return s=L,(c=[{key:"spin",value:function(e,t){this.updateValue(e,((this.props.range?this.props.value[this.handleIndex]:this.props.value)||0)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+n.DomHandler.getWindowScrollLeft(),this.initY=e.top+n.DomHandler.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.props.value[this.handleIndex]:this.props.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.props.value[1]&&(r=this.props.value[1]):r>this.props.max?r=this.props.max:r<this.props.value[0]&&(r=this.props.value[0]);var i=o(n=this.props.value)||a(n)||l(n)||u();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,t,r){var s=this,o=n.classNames("p-slider-handle",{"p-slider-handle-start":0===r,"p-slider-handle-end":1===r,"p-slider-handle-active":this.handleIndex===r});return i.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,r)},onTouchStart:function(e){return s.onTouchStart(e,r)},onKeyDown:function(e){return s.onKeyDown(e,r)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:t&&t+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||t,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.props.value||[0,0],t="horizontal"===this.props.orientation,n=100*(e[0]<this.props.min?0:e[0]-this.props.min)/(this.props.max-this.props.min),r=100*(e[1]>this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(r,null,1):this.renderHandle(null,r,1);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:r-n+"%"}:{bottom:n+"%",height:r-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.props.value||0;e=t<this.props.min?0:t>this.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},r="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:n}),r)}},{key:"render",value:function(){var e=this,t=n.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),r=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return i.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:t,onClick:this.onBarClick},r)}}])&&h(s.prototype,c),m&&h(s,m),L}(t.Component);return E={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(L="defaultProps")in(b=D)?Object.defineProperty(b,L,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[L]=E,e.Slider=D,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
1
+ this.primereact=this.primereact||{},this.primereact.slider=function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){if(Array.isArray(e))return s(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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 d(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 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&&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 g(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 d(e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(){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,L,E,D=function(e){f(L,e);var t,r,s,c,m,b=(t=L,r=y(),function(){var e,n=v(t);if(r){var i=v(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return g(this,e)});function L(e){var t;return h(this,L),(t=b.call(this,e)).onBarClick=t.onBarClick.bind(d(t)),t.onKeyDown=t.onKeyDown.bind(d(t)),t.handleIndex=0,t}return s=L,(c=[{key:"value",get:function(){return this.props.range?this.props.value||[0,100]:this.props.value||0}},{key:"spin",value:function(e,t){this.updateValue(e,(this.props.range?this.value[this.handleIndex]:this.value)+(this.props.step||1)*t),e.preventDefault()}},{key:"onDragStart",value:function(e,t){this.props.disabled||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.handleIndex=t)}},{key:"onMouseDown",value:function(e,t){this.bindDragListeners(),this.onDragStart(e,t)}},{key:"onTouchStart",value:function(e,t){this.bindTouchListeners(),this.onDragStart(e,t)}},{key:"onKeyDown",value:function(e,t){if(!this.props.disabled){this.handleIndex=t;var n=e.key;"ArrowRight"===n||"ArrowUp"===n?this.spin(e,1):"ArrowLeft"!==n&&"ArrowDown"!==n||this.spin(e,-1)}}},{key:"onBarClick",value:function(e){this.props.disabled||(this.sliderHandleClick||(this.updateDomData(),this.setValue(e)),this.sliderHandleClick=!1)}},{key:"onDrag",value:function(e){this.dragging&&(this.setValue(e),e.preventDefault())}},{key:"onDragEnd",value:function(e){this.dragging&&(this.dragging=!1,this.props.onSlideEnd&&this.props.onSlideEnd({originalEvent:e,value:this.props.value}),this.unbindDragListeners(),this.unbindTouchListeners())}},{key:"bindDragListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))}},{key:"unbindDragListeners",value:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},{key:"bindTouchListeners",value:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("touchmove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("touchend",this.dragEndListener))}},{key:"unbindTouchListeners",value:function(){this.dragListener&&(document.removeEventListener("touchmove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("touchend",this.dragEndListener),this.dragEndListener=null)}},{key:"updateDomData",value:function(){var e=this.el.getBoundingClientRect();this.initX=e.left+n.DomHandler.getWindowScrollLeft(),this.initY=e.top+n.DomHandler.getWindowScrollTop(),this.barWidth=this.el.offsetWidth,this.barHeight=this.el.offsetHeight}},{key:"setValue",value:function(e){var t=("horizontal"===this.props.orientation?100*((e.touches?e.touches[0].pageX:e.pageX)-this.initX)/this.barWidth:100*(this.initY+this.barHeight-(e.touches?e.touches[0].pageY:e.pageY))/this.barHeight)/100*(this.props.max-this.props.min)+this.props.min;if(this.props.step){var n=this.props.range?this.value[this.handleIndex]:this.value,r=t-n;r<0?t=n+Math.ceil(t/this.props.step-n/this.props.step)*this.props.step:r>0&&(t=n+Math.floor(t/this.props.step-n/this.props.step)*this.props.step)}else t=Math.floor(t);this.updateValue(e,t)}},{key:"updateValue",value:function(e,t){var n,r=parseFloat(t.toFixed(10));if(this.props.range){0===this.handleIndex?r<this.props.min?r=this.props.min:r>this.value[1]&&(r=this.value[1]):r>this.props.max?r=this.props.max:r<this.value[0]&&(r=this.value[0]);var i=o(n=this.value)||a(n)||l(n)||u();i[this.handleIndex]=r,this.props.onChange&&this.props.onChange({originalEvent:e,value:i})}else r<this.props.min?r=this.props.min:r>this.props.max&&(r=this.props.max),this.props.onChange&&this.props.onChange({originalEvent:e,value:r})}},{key:"componentWillUnmount",value:function(){this.unbindDragListeners(),this.unbindTouchListeners()}},{key:"renderHandle",value:function(e,t,r){var s=this,o=n.classNames("p-slider-handle",{"p-slider-handle-start":0===r,"p-slider-handle-end":1===r,"p-slider-handle-active":this.handleIndex===r});return i.default.createElement("span",{onMouseDown:function(e){return s.onMouseDown(e,r)},onTouchStart:function(e){return s.onTouchStart(e,r)},onKeyDown:function(e){return s.onKeyDown(e,r)},tabIndex:this.props.tabIndex,className:o,style:{transition:this.dragging?"none":null,left:null!==e&&e+"%",bottom:t&&t+"%"},role:"slider","aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuenow":e||t,"aria-labelledby":this.props.ariaLabelledBy})}},{key:"renderRangeSlider",value:function(){var e=this.value,t="horizontal"===this.props.orientation,n=100*(e[0]<this.props.min?0:e[0]-this.props.min)/(this.props.max-this.props.min),r=100*(e[1]>this.props.max?100:e[1]-this.props.min)/(this.props.max-this.props.min),s=t?this.renderHandle(n,null,0):this.renderHandle(null,n,0),o=t?this.renderHandle(r,null,1):this.renderHandle(null,r,1);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:t?{left:n+"%",width:r-n+"%"}:{bottom:n+"%",height:r-n+"%"}}),s,o)}},{key:"renderSingleSlider",value:function(){var e,t=this.value;e=t<this.props.min?0:t>this.props.max?100:100*(t-this.props.min)/(this.props.max-this.props.min);var n="horizontal"===this.props.orientation?{width:e+"%"}:{height:e+"%"},r="horizontal"===this.props.orientation?this.renderHandle(e,null,null):this.renderHandle(null,e,null);return i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{className:"p-slider-range",style:n}),r)}},{key:"render",value:function(){var e=this,t=n.classNames("p-slider p-component",this.props.className,{"p-disabled":this.props.disabled,"p-slider-horizontal":"horizontal"===this.props.orientation,"p-slider-vertical":"vertical"===this.props.orientation}),r=this.props.range?this.renderRangeSlider():this.renderSingleSlider();return i.default.createElement("div",{id:this.props.id,ref:function(t){return e.el=t},style:this.props.style,className:t,onClick:this.onBarClick},r)}}])&&p(s.prototype,c),m&&p(s,m),L}(t.Component);return E={id:null,value:null,min:0,max:100,orientation:"horizontal",step:null,range:!1,style:null,className:null,disabled:!1,tabIndex:0,ariaLabelledBy:null,onChange:null,onSlideEnd:null},(L="defaultProps")in(b=D)?Object.defineProperty(b,L,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[L]=E,e.Slider=D,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.core);
@@ -83,6 +83,8 @@ function _typeof(obj) {
83
83
  function _possibleConstructorReturn(self, call) {
84
84
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
85
85
  return call;
86
+ } else if (call !== void 0) {
87
+ throw new TypeError("Derived constructors may only return object or undefined");
86
88
  }
87
89
 
88
90
  return _assertThisInitialized(self);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/button"),i=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}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 u(e){return(u="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 p(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?l(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function m(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach((function(t){d(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return 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}}var y=function(n){c(C,e.Component);var a,u,h,y,v,k=(a=C,u=b(),function(){var e,t=f(a);if(u){var i=f(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return p(this,e)});function C(e){var t;return s(this,C),(t=k.call(this,e)).state={visible:!1},t.onClick=t.onClick.bind(l(t)),t.onItemClick=t.onItemClick.bind(l(t)),t}return h=C,(y=[{key:"isVisible",value:function(){return this.props.onVisibleChange?this.props.visible:this.state.visible}},{key:"show",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!0):this.setState({visible:!0}),this.props.onShow&&this.props.onShow()}},{key:"hide",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!1):this.setState({visible:!1}),this.props.onHide&&this.props.onHide()}},{key:"onClick",value:function(e){this.isVisible()?this.hide():this.show(),this.props.onClick&&this.props.onClick(e),this.isItemClicked=!0}},{key:"onItemClick",value:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isVisible()&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)}},{key:"calculateTransitionDelay",value:function(e){var t=this.props.model.length;return(this.isVisible()?e:t-e-1)*this.props.transitionDelay}},{key:"calculatePointStyle",value:function(e){var t=this.props.type;if("linear"!==t){var i=this.props.model.length,n=this.props.radius||20*i;if("circle"===t){var r=2*Math.PI/i;return{left:"calc(".concat(n*Math.cos(r*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(n*Math.sin(r*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var s=this.props.direction,o=Math.PI/(i-1),l="calc(".concat(n*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),a="calc(".concat(n*Math.sin(o*e),"px + var(--item-diff-y, 0px))");if("up"===s)return{left:l,bottom:a};if("down"===s)return{left:l,top:a};if("left"===s)return{right:a,top:l};if("right"===s)return{left:a,top:l}}else if("quarter-circle"===t){var c=this.props.direction,u=Math.PI/(2*(i-1)),p="calc(".concat(n*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(n*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===c)return{right:p,bottom:f};if("up-right"===c)return{left:p,bottom:f};if("down-left"===c)return{right:f,top:p};if("down-right"===c)return{left:f,top:p}}}return{}}},{key:"getItemStyle",value:function(e){var t=this.calculateTransitionDelay(e),i=this.calculatePointStyle(e);return m({transitionDelay:"".concat(t,"ms")},i)}},{key:"componentDidMount",value:function(){if("linear"!==this.props.type){var e=i.DomHandler.findSingle(this.container,".p-speeddial-button"),t=i.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),r=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(r/2,"px"))}}this.props.hideOnClickOutside&&this.bindDocumentClickListener()}},{key:"componentWillUnmount",value:function(){this.props.hideOnClickOutside&&this.unbindDocumentClickListener()}},{key:"renderItem",value:function(e,t){var n=this,s=this.getItemStyle(t),o=e.icon,l=e.label,a=e.template,c=e.url,u=e.target,p=i.classNames("p-speeddial-action",{"p-disabled":e.disabled}),f=i.classNames("p-speeddial-action-icon",o),d=r.default.createElement("a",{href:c||"#",role:"menuitem",className:p,target:u,"data-pr-tooltip":l,onClick:function(t){return n.onItemClick(t,e)}},o&&r.default.createElement("span",{className:f}),r.default.createElement(i.Ripple,null));if(a){var h={onClick:function(t){return n.onItemClick(t,e)},className:p,iconClassName:f,element:d,props:this.props,visible:this.isVisible()};d=i.ObjectUtils.getJSXElement(a,e,h)}return r.default.createElement("li",{key:t,className:"p-speeddial-item",style:s,role:"none"},d)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,i){return e.renderItem(t,i)})):null}},{key:"renderList",value:function(){var e=this,t=this.renderItems();return r.default.createElement("ul",{ref:function(t){return e.list=t},className:"p-speeddial-list",role:"menu"},t)}},{key:"renderButton",value:function(){var e,n=this,s=this.isVisible(),o=i.classNames("p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.props.rotateAnimation&&!this.props.hideIcon},this.props.buttonClassName),l=i.classNames((d(e={},"".concat(this.props.showIcon),!s&&!!this.props.showIcon||!this.props.hideIcon),d(e,"".concat(this.props.hideIcon),s&&!!this.props.hideIcon),e)),a=r.default.createElement(t.Button,{type:"button",style:this.props.buttonStyle,className:o,icon:l,onClick:this.onClick,disabled:this.props.disabled});return this.props.buttonTemplate?i.ObjectUtils.getJSXElement(this.props.buttonTemplate,{onClick:function(e){return n.onClick(e)},className:o,iconClassName:l,element:a,props:this.props,visible:s}):a}},{key:"renderMask",value:function(){if(this.props.mask){var e=this.isVisible(),t=i.classNames("p-speeddial-mask",{"p-speeddial-mask-visible":e},this.props.maskClassName);return r.default.createElement("div",{className:t,style:this.props.maskStyle})}return null}},{key:"render",value:function(){var e,t=this,n=i.classNames("p-speeddial p-component p-speeddial-".concat(this.props.type),(d(e={},"p-speeddial-direction-".concat(this.props.direction),"circle"!==this.props.type),d(e,"p-speeddial-opened",this.isVisible()),d(e,"p-disabled",this.props.disabled),e),this.props.className),s=this.renderButton(),o=this.renderList(),l=this.renderMask();return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{ref:function(e){return t.container=e},id:this.props.id,className:n,style:this.props.style},s,o),l)}}])&&o(h.prototype,y),v&&o(h,v),C}();d(y,"defaultProps",{id:null,model:null,visible:!1,style:null,className:null,direction:"up",transitionDelay:30,type:"linear",radius:0,mask:!1,disabled:!1,hideOnClickOutside:!0,buttonStyle:null,buttonClassName:null,buttonTemplate:null,maskStyle:null,maskClassName:null,showIcon:"pi pi-plus",hideIcon:null,rotateAnimation:!0,onVisibleChange:null,onClick:null,onShow:null,onHide:null}),exports.SpeedDial=y;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/button"),i=require("primereact/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}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 u(e){return(u="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 p(e,t){if(t&&("object"===u(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 f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function m(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach((function(t){d(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function y(){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(n){c(C,e.Component);var a,u,h,b,v,k=(a=C,u=y(),function(){var e,t=f(a);if(u){var i=f(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return p(this,e)});function C(e){var t;return s(this,C),(t=k.call(this,e)).state={visible:!1},t.onClick=t.onClick.bind(l(t)),t.onItemClick=t.onItemClick.bind(l(t)),t}return h=C,(b=[{key:"isVisible",value:function(){return this.props.onVisibleChange?this.props.visible:this.state.visible}},{key:"show",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!0):this.setState({visible:!0}),this.props.onShow&&this.props.onShow()}},{key:"hide",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!1):this.setState({visible:!1}),this.props.onHide&&this.props.onHide()}},{key:"onClick",value:function(e){this.isVisible()?this.hide():this.show(),this.props.onClick&&this.props.onClick(e),this.isItemClicked=!0}},{key:"onItemClick",value:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isVisible()&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)}},{key:"calculateTransitionDelay",value:function(e){var t=this.props.model.length;return(this.isVisible()?e:t-e-1)*this.props.transitionDelay}},{key:"calculatePointStyle",value:function(e){var t=this.props.type;if("linear"!==t){var i=this.props.model.length,n=this.props.radius||20*i;if("circle"===t){var r=2*Math.PI/i;return{left:"calc(".concat(n*Math.cos(r*e),"px + var(--item-diff-x, 0px))"),top:"calc(".concat(n*Math.sin(r*e),"px + var(--item-diff-y, 0px))")}}if("semi-circle"===t){var s=this.props.direction,o=Math.PI/(i-1),l="calc(".concat(n*Math.cos(o*e),"px + var(--item-diff-x, 0px))"),a="calc(".concat(n*Math.sin(o*e),"px + var(--item-diff-y, 0px))");if("up"===s)return{left:l,bottom:a};if("down"===s)return{left:l,top:a};if("left"===s)return{right:a,top:l};if("right"===s)return{left:a,top:l}}else if("quarter-circle"===t){var c=this.props.direction,u=Math.PI/(2*(i-1)),p="calc(".concat(n*Math.cos(u*e),"px + var(--item-diff-x, 0px))"),f="calc(".concat(n*Math.sin(u*e),"px + var(--item-diff-y, 0px))");if("up-left"===c)return{right:p,bottom:f};if("up-right"===c)return{left:p,bottom:f};if("down-left"===c)return{right:f,top:p};if("down-right"===c)return{left:f,top:p}}}return{}}},{key:"getItemStyle",value:function(e){var t=this.calculateTransitionDelay(e),i=this.calculatePointStyle(e);return m({transitionDelay:"".concat(t,"ms")},i)}},{key:"componentDidMount",value:function(){if("linear"!==this.props.type){var e=i.DomHandler.findSingle(this.container,".p-speeddial-button"),t=i.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){var n=Math.abs(e.offsetWidth-t.offsetWidth),r=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x","".concat(n/2,"px")),this.list.style.setProperty("--item-diff-y","".concat(r/2,"px"))}}this.props.hideOnClickOutside&&this.bindDocumentClickListener()}},{key:"componentWillUnmount",value:function(){this.props.hideOnClickOutside&&this.unbindDocumentClickListener()}},{key:"renderItem",value:function(e,t){var n=this,s=this.getItemStyle(t),o=e.icon,l=e.label,a=e.template,c=e.url,u=e.target,p=i.classNames("p-speeddial-action",{"p-disabled":e.disabled}),f=i.classNames("p-speeddial-action-icon",o),d=r.default.createElement("a",{href:c||"#",role:"menuitem",className:p,target:u,"data-pr-tooltip":l,onClick:function(t){return n.onItemClick(t,e)}},o&&r.default.createElement("span",{className:f}),r.default.createElement(i.Ripple,null));if(a){var h={onClick:function(t){return n.onItemClick(t,e)},className:p,iconClassName:f,element:d,props:this.props,visible:this.isVisible()};d=i.ObjectUtils.getJSXElement(a,e,h)}return r.default.createElement("li",{key:t,className:"p-speeddial-item",style:s,role:"none"},d)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,i){return e.renderItem(t,i)})):null}},{key:"renderList",value:function(){var e=this,t=this.renderItems();return r.default.createElement("ul",{ref:function(t){return e.list=t},className:"p-speeddial-list",role:"menu"},t)}},{key:"renderButton",value:function(){var e,n=this,s=this.isVisible(),o=i.classNames("p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.props.rotateAnimation&&!this.props.hideIcon},this.props.buttonClassName),l=i.classNames((d(e={},"".concat(this.props.showIcon),!s&&!!this.props.showIcon||!this.props.hideIcon),d(e,"".concat(this.props.hideIcon),s&&!!this.props.hideIcon),e)),a=r.default.createElement(t.Button,{type:"button",style:this.props.buttonStyle,className:o,icon:l,onClick:this.onClick,disabled:this.props.disabled});return this.props.buttonTemplate?i.ObjectUtils.getJSXElement(this.props.buttonTemplate,{onClick:function(e){return n.onClick(e)},className:o,iconClassName:l,element:a,props:this.props,visible:s}):a}},{key:"renderMask",value:function(){if(this.props.mask){var e=this.isVisible(),t=i.classNames("p-speeddial-mask",{"p-speeddial-mask-visible":e},this.props.maskClassName);return r.default.createElement("div",{className:t,style:this.props.maskStyle})}return null}},{key:"render",value:function(){var e,t=this,n=i.classNames("p-speeddial p-component p-speeddial-".concat(this.props.type),(d(e={},"p-speeddial-direction-".concat(this.props.direction),"circle"!==this.props.type),d(e,"p-speeddial-opened",this.isVisible()),d(e,"p-disabled",this.props.disabled),e),this.props.className),s=this.renderButton(),o=this.renderList(),l=this.renderMask();return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{ref:function(e){return t.container=e},id:this.props.id,className:n,style:this.props.style},s,o),l)}}])&&o(h.prototype,b),v&&o(h,v),C}();d(b,"defaultProps",{id:null,model:null,visible:!1,style:null,className:null,direction:"up",transitionDelay:30,type:"linear",radius:0,mask:!1,disabled:!1,hideOnClickOutside:!0,buttonStyle:null,buttonClassName:null,buttonTemplate:null,maskStyle:null,maskClassName:null,showIcon:"pi pi-plus",hideIcon:null,rotateAnimation:!0,onVisibleChange:null,onClick:null,onShow:null,onHide:null}),exports.SpeedDial=b;