primereact 6.5.0 → 7.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (686) hide show
  1. package/accordion/accordion.cjs.js +2 -0
  2. package/accordion/accordion.cjs.min.js +1 -1
  3. package/accordion/accordion.esm.js +2 -0
  4. package/accordion/accordion.esm.min.js +1 -1
  5. package/accordion/accordion.js +2 -0
  6. package/accordion/accordion.min.js +1 -1
  7. package/api/api.cjs.js +308 -10
  8. package/api/api.cjs.min.js +1 -1
  9. package/api/api.d.ts +61 -1
  10. package/api/api.esm.js +305 -11
  11. package/api/api.esm.min.js +1 -1
  12. package/api/api.js +308 -12
  13. package/api/api.min.js +1 -1
  14. package/autocomplete/autocomplete.cjs.js +3 -1
  15. package/autocomplete/autocomplete.cjs.min.js +1 -1
  16. package/autocomplete/autocomplete.esm.js +3 -1
  17. package/autocomplete/autocomplete.esm.min.js +1 -1
  18. package/autocomplete/autocomplete.js +3 -1
  19. package/autocomplete/autocomplete.min.js +1 -1
  20. package/avatar/avatar.cjs.js +2 -0
  21. package/avatar/avatar.cjs.min.js +1 -1
  22. package/avatar/avatar.esm.js +2 -0
  23. package/avatar/avatar.esm.min.js +1 -1
  24. package/avatar/avatar.js +2 -0
  25. package/avatar/avatar.min.js +1 -1
  26. package/avatargroup/avatargroup.cjs.js +2 -0
  27. package/avatargroup/avatargroup.cjs.min.js +1 -1
  28. package/avatargroup/avatargroup.esm.js +2 -0
  29. package/avatargroup/avatargroup.esm.min.js +1 -1
  30. package/avatargroup/avatargroup.js +2 -0
  31. package/avatargroup/avatargroup.min.js +1 -1
  32. package/badge/badge.cjs.js +2 -0
  33. package/badge/badge.cjs.min.js +1 -1
  34. package/badge/badge.esm.js +2 -0
  35. package/badge/badge.esm.min.js +1 -1
  36. package/badge/badge.js +2 -0
  37. package/badge/badge.min.js +1 -1
  38. package/blockui/blockui.cjs.js +9 -15
  39. package/blockui/blockui.cjs.min.js +1 -1
  40. package/blockui/blockui.esm.js +9 -15
  41. package/blockui/blockui.esm.min.js +1 -1
  42. package/blockui/blockui.js +9 -15
  43. package/blockui/blockui.min.css +1 -1
  44. package/blockui/blockui.min.js +1 -1
  45. package/breadcrumb/breadcrumb.cjs.js +2 -0
  46. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  47. package/breadcrumb/breadcrumb.esm.js +2 -0
  48. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  49. package/breadcrumb/breadcrumb.js +2 -0
  50. package/breadcrumb/breadcrumb.min.css +1 -1
  51. package/breadcrumb/breadcrumb.min.js +1 -1
  52. package/button/button.cjs.js +2 -0
  53. package/button/button.cjs.min.js +1 -1
  54. package/button/button.esm.js +2 -0
  55. package/button/button.esm.min.js +1 -1
  56. package/button/button.js +2 -0
  57. package/button/button.min.js +1 -1
  58. package/calendar/calendar.cjs.js +85 -67
  59. package/calendar/calendar.cjs.min.js +1 -1
  60. package/calendar/calendar.esm.js +85 -67
  61. package/calendar/calendar.esm.min.js +1 -1
  62. package/calendar/calendar.js +85 -67
  63. package/calendar/calendar.min.js +1 -1
  64. package/captcha/captcha.cjs.js +2 -0
  65. package/captcha/captcha.cjs.min.js +1 -1
  66. package/captcha/captcha.esm.js +2 -0
  67. package/captcha/captcha.esm.min.js +1 -1
  68. package/captcha/captcha.js +2 -0
  69. package/captcha/captcha.min.js +1 -1
  70. package/card/card.cjs.js +2 -0
  71. package/card/card.cjs.min.js +1 -1
  72. package/card/card.esm.js +2 -0
  73. package/card/card.esm.min.js +1 -1
  74. package/card/card.js +2 -0
  75. package/card/card.min.js +1 -1
  76. package/carousel/carousel.cjs.js +2 -0
  77. package/carousel/carousel.cjs.min.js +1 -1
  78. package/carousel/carousel.esm.js +3 -1
  79. package/carousel/carousel.esm.min.js +1 -1
  80. package/carousel/carousel.js +2 -0
  81. package/carousel/carousel.min.js +1 -1
  82. package/cascadeselect/cascadeselect.cjs.js +2 -0
  83. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  84. package/cascadeselect/cascadeselect.esm.js +2 -0
  85. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  86. package/cascadeselect/cascadeselect.js +2 -0
  87. package/cascadeselect/cascadeselect.min.js +1 -1
  88. package/chart/chart.cjs.js +2 -0
  89. package/chart/chart.cjs.min.js +1 -1
  90. package/chart/chart.esm.js +2 -0
  91. package/chart/chart.esm.min.js +1 -1
  92. package/chart/chart.js +2 -0
  93. package/chart/chart.min.js +1 -1
  94. package/checkbox/checkbox.cjs.js +19 -9
  95. package/checkbox/checkbox.cjs.min.js +1 -1
  96. package/checkbox/checkbox.d.ts +3 -1
  97. package/checkbox/checkbox.esm.js +19 -9
  98. package/checkbox/checkbox.esm.min.js +1 -1
  99. package/checkbox/checkbox.js +19 -9
  100. package/checkbox/checkbox.min.css +1 -1
  101. package/checkbox/checkbox.min.js +1 -1
  102. package/chip/chip.cjs.js +2 -0
  103. package/chip/chip.cjs.min.js +1 -1
  104. package/chip/chip.esm.js +2 -0
  105. package/chip/chip.esm.min.js +1 -1
  106. package/chip/chip.js +2 -0
  107. package/chip/chip.min.js +1 -1
  108. package/chips/chips.cjs.js +2 -0
  109. package/chips/chips.cjs.min.js +1 -1
  110. package/chips/chips.esm.js +2 -0
  111. package/chips/chips.esm.min.js +1 -1
  112. package/chips/chips.js +2 -0
  113. package/chips/chips.min.js +1 -1
  114. package/colorpicker/colorpicker.cjs.js +2 -0
  115. package/colorpicker/colorpicker.cjs.min.js +1 -1
  116. package/colorpicker/colorpicker.esm.js +2 -0
  117. package/colorpicker/colorpicker.esm.min.js +1 -1
  118. package/colorpicker/colorpicker.js +2 -0
  119. package/colorpicker/colorpicker.min.js +1 -1
  120. package/column/column.cjs.js +34 -9
  121. package/column/column.cjs.min.js +1 -1
  122. package/column/column.d.ts +146 -13
  123. package/column/column.esm.js +34 -9
  124. package/column/column.esm.min.js +1 -1
  125. package/column/column.js +34 -9
  126. package/column/column.min.js +1 -1
  127. package/columngroup/columngroup.cjs.js +2 -0
  128. package/columngroup/columngroup.cjs.min.js +1 -1
  129. package/columngroup/columngroup.esm.js +2 -0
  130. package/columngroup/columngroup.esm.min.js +1 -1
  131. package/columngroup/columngroup.js +2 -0
  132. package/columngroup/columngroup.min.js +1 -1
  133. package/common/common.min.css +1 -1
  134. package/confirmdialog/confirmdialog.cjs.js +2 -0
  135. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  136. package/confirmdialog/confirmdialog.esm.js +2 -0
  137. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  138. package/confirmdialog/confirmdialog.js +2 -0
  139. package/confirmdialog/confirmdialog.min.js +1 -1
  140. package/confirmpopup/confirmpopup.cjs.js +2 -0
  141. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  142. package/confirmpopup/confirmpopup.esm.js +2 -0
  143. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  144. package/confirmpopup/confirmpopup.js +2 -0
  145. package/confirmpopup/confirmpopup.min.js +1 -1
  146. package/contextmenu/contextmenu.cjs.js +2 -0
  147. package/contextmenu/contextmenu.cjs.min.js +1 -1
  148. package/contextmenu/contextmenu.esm.js +3 -1
  149. package/contextmenu/contextmenu.esm.min.js +1 -1
  150. package/contextmenu/contextmenu.js +2 -0
  151. package/contextmenu/contextmenu.min.js +1 -1
  152. package/core/core.cjs.js +351 -669
  153. package/core/core.cjs.min.js +1 -1
  154. package/core/core.esm.js +347 -665
  155. package/core/core.esm.min.js +1 -1
  156. package/core/core.js +352 -671
  157. package/core/core.min.js +1 -1
  158. package/csstransition/csstransition.cjs.js +2 -0
  159. package/csstransition/csstransition.cjs.min.js +1 -1
  160. package/csstransition/csstransition.esm.js +2 -0
  161. package/csstransition/csstransition.esm.min.js +1 -1
  162. package/csstransition/csstransition.js +2 -0
  163. package/csstransition/csstransition.min.js +1 -1
  164. package/datascroller/datascroller.cjs.js +8 -1
  165. package/datascroller/datascroller.cjs.min.js +1 -1
  166. package/datascroller/datascroller.esm.js +8 -1
  167. package/datascroller/datascroller.esm.min.js +1 -1
  168. package/datascroller/datascroller.js +8 -1
  169. package/datascroller/datascroller.min.js +1 -1
  170. package/datatable/datatable.cjs.js +4803 -3320
  171. package/datatable/datatable.cjs.min.js +1 -1
  172. package/datatable/datatable.d.ts +97 -28
  173. package/datatable/datatable.esm.js +4803 -3321
  174. package/datatable/datatable.esm.min.js +1 -1
  175. package/datatable/datatable.js +4801 -3322
  176. package/datatable/datatable.min.css +1 -1
  177. package/datatable/datatable.min.js +1 -1
  178. package/dataview/dataview.cjs.js +4 -2
  179. package/dataview/dataview.cjs.min.js +1 -1
  180. package/dataview/dataview.esm.js +4 -2
  181. package/dataview/dataview.esm.min.js +1 -1
  182. package/dataview/dataview.js +4 -2
  183. package/dataview/dataview.min.js +1 -1
  184. package/deferredcontent/deferredcontent.cjs.js +2 -0
  185. package/deferredcontent/deferredcontent.cjs.min.js +1 -1
  186. package/deferredcontent/deferredcontent.esm.js +2 -0
  187. package/deferredcontent/deferredcontent.esm.min.js +1 -1
  188. package/deferredcontent/deferredcontent.js +2 -0
  189. package/deferredcontent/deferredcontent.min.js +1 -1
  190. package/dialog/dialog.cjs.js +12 -1
  191. package/dialog/dialog.cjs.min.js +1 -1
  192. package/dialog/dialog.esm.js +12 -1
  193. package/dialog/dialog.esm.min.js +1 -1
  194. package/dialog/dialog.js +12 -1
  195. package/dialog/dialog.min.js +1 -1
  196. package/divider/divider.cjs.js +2 -0
  197. package/divider/divider.cjs.min.js +1 -1
  198. package/divider/divider.esm.js +2 -0
  199. package/divider/divider.esm.min.js +1 -1
  200. package/divider/divider.js +2 -0
  201. package/divider/divider.min.js +1 -1
  202. package/dock/dock.cjs.js +5 -1
  203. package/dock/dock.cjs.min.js +1 -1
  204. package/dock/dock.esm.js +5 -1
  205. package/dock/dock.esm.min.js +1 -1
  206. package/dock/dock.js +5 -1
  207. package/dock/dock.min.css +1 -1
  208. package/dock/dock.min.js +1 -1
  209. package/dropdown/dropdown.cjs.js +15 -11
  210. package/dropdown/dropdown.cjs.min.js +1 -1
  211. package/dropdown/dropdown.esm.js +17 -13
  212. package/dropdown/dropdown.esm.min.js +1 -1
  213. package/dropdown/dropdown.js +15 -11
  214. package/dropdown/dropdown.min.js +1 -1
  215. package/editor/editor.cjs.js +2 -0
  216. package/editor/editor.cjs.min.js +1 -1
  217. package/editor/editor.esm.js +2 -0
  218. package/editor/editor.esm.min.js +1 -1
  219. package/editor/editor.js +2 -0
  220. package/editor/editor.min.js +1 -1
  221. package/fieldset/fieldset.cjs.js +2 -0
  222. package/fieldset/fieldset.cjs.min.js +1 -1
  223. package/fieldset/fieldset.esm.js +2 -0
  224. package/fieldset/fieldset.esm.min.js +1 -1
  225. package/fieldset/fieldset.js +2 -0
  226. package/fieldset/fieldset.min.js +1 -1
  227. package/fileupload/fileupload.cjs.js +2 -0
  228. package/fileupload/fileupload.cjs.min.js +1 -1
  229. package/fileupload/fileupload.esm.js +2 -0
  230. package/fileupload/fileupload.esm.min.js +1 -1
  231. package/fileupload/fileupload.js +2 -0
  232. package/fileupload/fileupload.min.js +1 -1
  233. package/fullcalendar/fullcalendar.cjs.js +2 -0
  234. package/fullcalendar/fullcalendar.cjs.min.js +1 -1
  235. package/fullcalendar/fullcalendar.esm.js +2 -0
  236. package/fullcalendar/fullcalendar.esm.min.js +1 -1
  237. package/fullcalendar/fullcalendar.js +2 -0
  238. package/fullcalendar/fullcalendar.min.js +1 -1
  239. package/galleria/galleria.cjs.js +25 -5
  240. package/galleria/galleria.cjs.min.js +1 -1
  241. package/galleria/galleria.esm.js +25 -5
  242. package/galleria/galleria.esm.min.js +1 -1
  243. package/galleria/galleria.js +25 -5
  244. package/galleria/galleria.min.css +1 -1
  245. package/galleria/galleria.min.js +1 -1
  246. package/gmap/gmap.cjs.js +2 -0
  247. package/gmap/gmap.cjs.min.js +1 -1
  248. package/gmap/gmap.esm.js +2 -0
  249. package/gmap/gmap.esm.min.js +1 -1
  250. package/gmap/gmap.js +2 -0
  251. package/gmap/gmap.min.js +1 -1
  252. package/image/image.cjs.js +397 -0
  253. package/image/image.cjs.min.js +1 -0
  254. package/image/image.d.ts +18 -0
  255. package/image/image.esm.js +389 -0
  256. package/image/image.esm.min.js +1 -0
  257. package/image/image.js +400 -0
  258. package/image/image.min.css +1 -0
  259. package/image/image.min.js +1 -0
  260. package/image/package.json +6 -0
  261. package/inplace/inplace.cjs.js +2 -0
  262. package/inplace/inplace.cjs.min.js +1 -1
  263. package/inplace/inplace.esm.js +2 -0
  264. package/inplace/inplace.esm.min.js +1 -1
  265. package/inplace/inplace.js +2 -0
  266. package/inplace/inplace.min.js +1 -1
  267. package/inputmask/inputmask.cjs.js +2 -0
  268. package/inputmask/inputmask.cjs.min.js +1 -1
  269. package/inputmask/inputmask.esm.js +2 -0
  270. package/inputmask/inputmask.esm.min.js +1 -1
  271. package/inputmask/inputmask.js +2 -0
  272. package/inputmask/inputmask.min.js +1 -1
  273. package/inputnumber/inputnumber.cjs.js +177 -62
  274. package/inputnumber/inputnumber.cjs.min.js +1 -1
  275. package/inputnumber/inputnumber.d.ts +1 -0
  276. package/inputnumber/inputnumber.esm.js +177 -62
  277. package/inputnumber/inputnumber.esm.min.js +1 -1
  278. package/inputnumber/inputnumber.js +177 -62
  279. package/inputnumber/inputnumber.min.js +1 -1
  280. package/inputswitch/inputswitch.cjs.js +16 -6
  281. package/inputswitch/inputswitch.cjs.min.js +1 -1
  282. package/inputswitch/inputswitch.d.ts +3 -1
  283. package/inputswitch/inputswitch.esm.js +16 -6
  284. package/inputswitch/inputswitch.esm.min.js +1 -1
  285. package/inputswitch/inputswitch.js +16 -6
  286. package/inputswitch/inputswitch.min.js +1 -1
  287. package/inputtext/inputtext.cjs.js +2 -0
  288. package/inputtext/inputtext.cjs.min.js +1 -1
  289. package/inputtext/inputtext.esm.js +2 -0
  290. package/inputtext/inputtext.esm.min.js +1 -1
  291. package/inputtext/inputtext.js +2 -0
  292. package/inputtext/inputtext.min.js +1 -1
  293. package/inputtextarea/inputtextarea.cjs.js +2 -0
  294. package/inputtextarea/inputtextarea.cjs.min.js +1 -1
  295. package/inputtextarea/inputtextarea.esm.js +2 -0
  296. package/inputtextarea/inputtextarea.esm.min.js +1 -1
  297. package/inputtextarea/inputtextarea.js +2 -0
  298. package/inputtextarea/inputtextarea.min.js +1 -1
  299. package/knob/knob.cjs.js +2 -0
  300. package/knob/knob.cjs.min.js +1 -1
  301. package/knob/knob.esm.js +2 -0
  302. package/knob/knob.esm.min.js +1 -1
  303. package/knob/knob.js +2 -0
  304. package/knob/knob.min.js +1 -1
  305. package/listbox/listbox.cjs.js +6 -3
  306. package/listbox/listbox.cjs.min.js +1 -1
  307. package/listbox/listbox.esm.js +7 -4
  308. package/listbox/listbox.esm.min.js +1 -1
  309. package/listbox/listbox.js +7 -5
  310. package/listbox/listbox.min.js +1 -1
  311. package/megamenu/megamenu.cjs.js +2 -0
  312. package/megamenu/megamenu.cjs.min.js +1 -1
  313. package/megamenu/megamenu.esm.js +2 -0
  314. package/megamenu/megamenu.esm.min.js +1 -1
  315. package/megamenu/megamenu.js +2 -0
  316. package/megamenu/megamenu.min.js +1 -1
  317. package/mention/mention.cjs.js +2 -0
  318. package/mention/mention.cjs.min.js +1 -1
  319. package/mention/mention.esm.js +2 -0
  320. package/mention/mention.esm.min.js +1 -1
  321. package/mention/mention.js +2 -0
  322. package/mention/mention.min.js +1 -1
  323. package/menu/menu.cjs.js +2 -0
  324. package/menu/menu.cjs.min.js +1 -1
  325. package/menu/menu.d.ts +1 -1
  326. package/menu/menu.esm.js +2 -0
  327. package/menu/menu.esm.min.js +1 -1
  328. package/menu/menu.js +2 -0
  329. package/menu/menu.min.js +1 -1
  330. package/menubar/menubar.cjs.js +2 -0
  331. package/menubar/menubar.cjs.min.js +1 -1
  332. package/menubar/menubar.esm.js +2 -0
  333. package/menubar/menubar.esm.min.js +1 -1
  334. package/menubar/menubar.js +2 -0
  335. package/menubar/menubar.min.js +1 -1
  336. package/message/message.cjs.js +2 -0
  337. package/message/message.cjs.min.js +1 -1
  338. package/message/message.esm.js +2 -0
  339. package/message/message.esm.min.js +1 -1
  340. package/message/message.js +2 -0
  341. package/message/message.min.js +1 -1
  342. package/messages/messages.cjs.js +2 -0
  343. package/messages/messages.cjs.min.js +1 -1
  344. package/messages/messages.esm.js +2 -0
  345. package/messages/messages.esm.min.js +1 -1
  346. package/messages/messages.js +2 -0
  347. package/messages/messages.min.js +1 -1
  348. package/multiselect/multiselect.cjs.js +22 -12
  349. package/multiselect/multiselect.cjs.min.js +1 -1
  350. package/multiselect/multiselect.d.ts +3 -1
  351. package/multiselect/multiselect.esm.js +24 -14
  352. package/multiselect/multiselect.esm.min.js +1 -1
  353. package/multiselect/multiselect.js +22 -12
  354. package/multiselect/multiselect.min.js +1 -1
  355. package/multistatecheckbox/multistatecheckbox.cjs.js +2 -0
  356. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  357. package/multistatecheckbox/multistatecheckbox.esm.js +2 -0
  358. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  359. package/multistatecheckbox/multistatecheckbox.js +2 -0
  360. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  361. package/orderlist/orderlist.cjs.js +2 -0
  362. package/orderlist/orderlist.cjs.min.js +1 -1
  363. package/orderlist/orderlist.esm.js +2 -0
  364. package/orderlist/orderlist.esm.min.js +1 -1
  365. package/orderlist/orderlist.js +2 -0
  366. package/orderlist/orderlist.min.js +1 -1
  367. package/organizationchart/organizationchart.cjs.js +2 -0
  368. package/organizationchart/organizationchart.cjs.min.js +1 -1
  369. package/organizationchart/organizationchart.esm.js +2 -0
  370. package/organizationchart/organizationchart.esm.min.js +1 -1
  371. package/organizationchart/organizationchart.js +2 -0
  372. package/organizationchart/organizationchart.min.js +1 -1
  373. package/overlaypanel/overlaypanel.cjs.js +10 -1
  374. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  375. package/overlaypanel/overlaypanel.esm.js +10 -1
  376. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  377. package/overlaypanel/overlaypanel.js +10 -1
  378. package/overlaypanel/overlaypanel.min.js +1 -1
  379. package/package.json +1 -1
  380. package/paginator/paginator.cjs.js +120 -30
  381. package/paginator/paginator.cjs.min.js +1 -1
  382. package/paginator/paginator.d.ts +13 -0
  383. package/paginator/paginator.esm.js +120 -30
  384. package/paginator/paginator.esm.min.js +1 -1
  385. package/paginator/paginator.js +121 -32
  386. package/paginator/paginator.min.js +1 -1
  387. package/panel/panel.cjs.js +2 -0
  388. package/panel/panel.cjs.min.js +1 -1
  389. package/panel/panel.esm.js +2 -0
  390. package/panel/panel.esm.min.js +1 -1
  391. package/panel/panel.js +2 -0
  392. package/panel/panel.min.js +1 -1
  393. package/panelmenu/panelmenu.cjs.js +2 -0
  394. package/panelmenu/panelmenu.cjs.min.js +1 -1
  395. package/panelmenu/panelmenu.esm.js +3 -1
  396. package/panelmenu/panelmenu.esm.min.js +1 -1
  397. package/panelmenu/panelmenu.js +2 -0
  398. package/panelmenu/panelmenu.min.js +1 -1
  399. package/password/password.cjs.js +2 -0
  400. package/password/password.cjs.min.js +1 -1
  401. package/password/password.esm.js +2 -0
  402. package/password/password.esm.min.js +1 -1
  403. package/password/password.js +2 -0
  404. package/password/password.min.js +1 -1
  405. package/picklist/picklist.cjs.js +2 -0
  406. package/picklist/picklist.cjs.min.js +1 -1
  407. package/picklist/picklist.esm.js +2 -0
  408. package/picklist/picklist.esm.min.js +1 -1
  409. package/picklist/picklist.js +2 -0
  410. package/picklist/picklist.min.js +1 -1
  411. package/portal/portal.cjs.js +6 -2
  412. package/portal/portal.cjs.min.js +1 -1
  413. package/portal/portal.esm.js +6 -2
  414. package/portal/portal.esm.min.js +1 -1
  415. package/portal/portal.js +6 -2
  416. package/portal/portal.min.js +1 -1
  417. package/primereact.all.cjs.js +12344 -9903
  418. package/primereact.all.cjs.min.js +1 -1
  419. package/primereact.all.esm.js +12340 -9903
  420. package/primereact.all.esm.min.js +1 -1
  421. package/primereact.all.js +12344 -9903
  422. package/primereact.all.min.js +1 -1
  423. package/progressbar/progressbar.cjs.js +2 -0
  424. package/progressbar/progressbar.cjs.min.js +1 -1
  425. package/progressbar/progressbar.esm.js +2 -0
  426. package/progressbar/progressbar.esm.min.js +1 -1
  427. package/progressbar/progressbar.js +2 -0
  428. package/progressbar/progressbar.min.js +1 -1
  429. package/progressspinner/progressspinner.cjs.js +2 -0
  430. package/progressspinner/progressspinner.cjs.min.js +1 -1
  431. package/progressspinner/progressspinner.esm.js +2 -0
  432. package/progressspinner/progressspinner.esm.min.js +1 -1
  433. package/progressspinner/progressspinner.js +2 -0
  434. package/progressspinner/progressspinner.min.js +1 -1
  435. package/radiobutton/radiobutton.cjs.js +2 -0
  436. package/radiobutton/radiobutton.cjs.min.js +1 -1
  437. package/radiobutton/radiobutton.esm.js +2 -0
  438. package/radiobutton/radiobutton.esm.min.js +1 -1
  439. package/radiobutton/radiobutton.js +2 -0
  440. package/radiobutton/radiobutton.min.js +1 -1
  441. package/rating/rating.cjs.js +2 -0
  442. package/rating/rating.cjs.min.js +1 -1
  443. package/rating/rating.esm.js +2 -0
  444. package/rating/rating.esm.min.js +1 -1
  445. package/rating/rating.js +2 -0
  446. package/rating/rating.min.js +1 -1
  447. package/resources/primereact.css +340 -84
  448. package/resources/primereact.min.css +1 -1
  449. package/resources/themes/arya-blue/theme.css +4600 -3838
  450. package/resources/themes/arya-green/theme.css +4600 -3838
  451. package/resources/themes/arya-orange/theme.css +4600 -3838
  452. package/resources/themes/arya-purple/theme.css +4600 -3838
  453. package/resources/themes/bootstrap4-dark-blue/theme.css +4601 -3837
  454. package/resources/themes/bootstrap4-dark-purple/theme.css +4601 -3837
  455. package/resources/themes/bootstrap4-light-blue/theme.css +4579 -3815
  456. package/resources/themes/bootstrap4-light-purple/theme.css +4579 -3815
  457. package/resources/themes/fluent-light/theme.css +4690 -3897
  458. package/resources/themes/luna-amber/theme.css +4555 -3807
  459. package/resources/themes/luna-blue/theme.css +4551 -3803
  460. package/resources/themes/luna-green/theme.css +4551 -3803
  461. package/resources/themes/luna-pink/theme.css +4555 -3807
  462. package/resources/themes/md-dark-deeppurple/theme.css +5580 -4689
  463. package/resources/themes/md-dark-indigo/theme.css +5578 -4687
  464. package/resources/themes/md-light-deeppurple/theme.css +5569 -4678
  465. package/resources/themes/md-light-indigo/theme.css +5569 -4678
  466. package/resources/themes/mdc-dark-deeppurple/theme.css +5575 -4684
  467. package/resources/themes/mdc-dark-indigo/theme.css +5583 -4692
  468. package/resources/themes/mdc-light-deeppurple/theme.css +5579 -4688
  469. package/resources/themes/mdc-light-indigo/theme.css +5579 -4688
  470. package/resources/themes/nova/theme.css +4554 -3802
  471. package/resources/themes/nova-accent/theme.css +4571 -3818
  472. package/resources/themes/nova-alt/theme.css +4560 -3806
  473. package/resources/themes/rhea/theme.css +4562 -3813
  474. package/resources/themes/saga-blue/theme.css +4608 -3847
  475. package/resources/themes/saga-green/theme.css +4608 -3847
  476. package/resources/themes/saga-orange/theme.css +4608 -3847
  477. package/resources/themes/saga-purple/theme.css +4607 -3846
  478. package/resources/themes/tailwind-light/fonts/Inter-Bold.woff +0 -0
  479. package/resources/themes/tailwind-light/fonts/Inter-Bold.woff2 +0 -0
  480. package/resources/themes/tailwind-light/fonts/Inter-Light.woff +0 -0
  481. package/resources/themes/tailwind-light/fonts/Inter-Light.woff2 +0 -0
  482. package/resources/themes/tailwind-light/fonts/Inter-Medium.woff +0 -0
  483. package/resources/themes/tailwind-light/fonts/Inter-Medium.woff2 +0 -0
  484. package/resources/themes/tailwind-light/fonts/Inter-Regular.woff +0 -0
  485. package/resources/themes/tailwind-light/fonts/Inter-Regular.woff2 +0 -0
  486. package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff +0 -0
  487. package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff2 +0 -0
  488. package/resources/themes/tailwind-light/theme.css +5722 -0
  489. package/resources/themes/vela-blue/theme.css +4602 -3840
  490. package/resources/themes/vela-green/theme.css +4602 -3840
  491. package/resources/themes/vela-orange/theme.css +4602 -3840
  492. package/resources/themes/vela-purple/theme.css +4602 -3840
  493. package/ripple/ripple.cjs.js +2 -0
  494. package/ripple/ripple.cjs.min.js +1 -1
  495. package/ripple/ripple.esm.js +2 -0
  496. package/ripple/ripple.esm.min.js +1 -1
  497. package/ripple/ripple.js +2 -0
  498. package/ripple/ripple.min.js +1 -1
  499. package/row/row.cjs.js +2 -0
  500. package/row/row.cjs.min.js +1 -1
  501. package/row/row.esm.js +2 -0
  502. package/row/row.esm.min.js +1 -1
  503. package/row/row.js +2 -0
  504. package/row/row.min.js +1 -1
  505. package/scrollpanel/scrollpanel.cjs.js +2 -0
  506. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  507. package/scrollpanel/scrollpanel.esm.js +2 -0
  508. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  509. package/scrollpanel/scrollpanel.js +2 -0
  510. package/scrollpanel/scrollpanel.min.js +1 -1
  511. package/scrolltop/scrolltop.cjs.js +2 -0
  512. package/scrolltop/scrolltop.cjs.min.js +1 -1
  513. package/scrolltop/scrolltop.esm.js +2 -0
  514. package/scrolltop/scrolltop.esm.min.js +1 -1
  515. package/scrolltop/scrolltop.js +2 -0
  516. package/scrolltop/scrolltop.min.js +1 -1
  517. package/selectbutton/selectbutton.cjs.js +2 -0
  518. package/selectbutton/selectbutton.cjs.min.js +1 -1
  519. package/selectbutton/selectbutton.esm.js +2 -0
  520. package/selectbutton/selectbutton.esm.min.js +1 -1
  521. package/selectbutton/selectbutton.js +2 -0
  522. package/selectbutton/selectbutton.min.js +1 -1
  523. package/sidebar/sidebar.cjs.js +23 -27
  524. package/sidebar/sidebar.cjs.min.js +1 -1
  525. package/sidebar/sidebar.esm.js +23 -27
  526. package/sidebar/sidebar.esm.min.js +1 -1
  527. package/sidebar/sidebar.js +23 -27
  528. package/sidebar/sidebar.min.css +1 -1
  529. package/sidebar/sidebar.min.js +1 -1
  530. package/skeleton/skeleton.cjs.js +2 -0
  531. package/skeleton/skeleton.cjs.min.js +1 -1
  532. package/skeleton/skeleton.esm.js +2 -0
  533. package/skeleton/skeleton.esm.min.js +1 -1
  534. package/skeleton/skeleton.js +2 -0
  535. package/skeleton/skeleton.min.js +1 -1
  536. package/slidemenu/slidemenu.cjs.js +2 -0
  537. package/slidemenu/slidemenu.cjs.min.js +1 -1
  538. package/slidemenu/slidemenu.esm.js +2 -0
  539. package/slidemenu/slidemenu.esm.min.js +1 -1
  540. package/slidemenu/slidemenu.js +2 -0
  541. package/slidemenu/slidemenu.min.js +1 -1
  542. package/slider/slider.cjs.js +14 -7
  543. package/slider/slider.cjs.min.js +1 -1
  544. package/slider/slider.esm.js +14 -7
  545. package/slider/slider.esm.min.js +1 -1
  546. package/slider/slider.js +14 -7
  547. package/slider/slider.min.js +1 -1
  548. package/speeddial/speeddial.cjs.js +2 -0
  549. package/speeddial/speeddial.cjs.min.js +1 -1
  550. package/speeddial/speeddial.esm.js +2 -0
  551. package/speeddial/speeddial.esm.min.js +1 -1
  552. package/speeddial/speeddial.js +2 -0
  553. package/speeddial/speeddial.min.css +1 -1
  554. package/speeddial/speeddial.min.js +1 -1
  555. package/splitbutton/splitbutton.cjs.js +2 -0
  556. package/splitbutton/splitbutton.cjs.min.js +1 -1
  557. package/splitbutton/splitbutton.esm.js +2 -0
  558. package/splitbutton/splitbutton.esm.min.js +1 -1
  559. package/splitbutton/splitbutton.js +2 -0
  560. package/splitbutton/splitbutton.min.js +1 -1
  561. package/splitter/splitter.cjs.js +2 -0
  562. package/splitter/splitter.cjs.min.js +1 -1
  563. package/splitter/splitter.esm.js +2 -0
  564. package/splitter/splitter.esm.min.js +1 -1
  565. package/splitter/splitter.js +2 -0
  566. package/splitter/splitter.min.js +1 -1
  567. package/steps/steps.cjs.js +2 -0
  568. package/steps/steps.cjs.min.js +1 -1
  569. package/steps/steps.esm.js +2 -0
  570. package/steps/steps.esm.min.js +1 -1
  571. package/steps/steps.js +2 -0
  572. package/steps/steps.min.js +1 -1
  573. package/styleclass/package.json +6 -0
  574. package/styleclass/styleclass.cjs.js +355 -0
  575. package/styleclass/styleclass.cjs.min.js +1 -0
  576. package/styleclass/styleclass.d.ts +18 -0
  577. package/styleclass/styleclass.esm.js +351 -0
  578. package/styleclass/styleclass.esm.min.js +1 -0
  579. package/styleclass/styleclass.js +358 -0
  580. package/styleclass/styleclass.min.js +1 -0
  581. package/tabmenu/tabmenu.cjs.js +2 -0
  582. package/tabmenu/tabmenu.cjs.min.js +1 -1
  583. package/tabmenu/tabmenu.esm.js +2 -0
  584. package/tabmenu/tabmenu.esm.min.js +1 -1
  585. package/tabmenu/tabmenu.js +2 -0
  586. package/tabmenu/tabmenu.min.css +1 -1
  587. package/tabmenu/tabmenu.min.js +1 -1
  588. package/tabview/tabview.cjs.js +135 -18
  589. package/tabview/tabview.cjs.min.js +1 -1
  590. package/tabview/tabview.d.ts +1 -0
  591. package/tabview/tabview.esm.js +135 -18
  592. package/tabview/tabview.esm.min.js +1 -1
  593. package/tabview/tabview.js +135 -18
  594. package/tabview/tabview.min.css +1 -1
  595. package/tabview/tabview.min.js +1 -1
  596. package/tag/tag.cjs.js +2 -0
  597. package/tag/tag.cjs.min.js +1 -1
  598. package/tag/tag.esm.js +2 -0
  599. package/tag/tag.esm.min.js +1 -1
  600. package/tag/tag.js +2 -0
  601. package/tag/tag.min.js +1 -1
  602. package/terminal/terminal.cjs.js +2 -0
  603. package/terminal/terminal.cjs.min.js +1 -1
  604. package/terminal/terminal.esm.js +2 -0
  605. package/terminal/terminal.esm.min.js +1 -1
  606. package/terminal/terminal.js +2 -0
  607. package/terminal/terminal.min.js +1 -1
  608. package/tieredmenu/tieredmenu.cjs.js +2 -0
  609. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  610. package/tieredmenu/tieredmenu.d.ts +1 -1
  611. package/tieredmenu/tieredmenu.esm.js +2 -0
  612. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  613. package/tieredmenu/tieredmenu.js +2 -0
  614. package/tieredmenu/tieredmenu.min.js +1 -1
  615. package/timeline/timeline.cjs.js +2 -0
  616. package/timeline/timeline.cjs.min.js +1 -1
  617. package/timeline/timeline.esm.js +2 -0
  618. package/timeline/timeline.esm.min.js +1 -1
  619. package/timeline/timeline.js +2 -0
  620. package/timeline/timeline.min.js +1 -1
  621. package/toast/toast.cjs.js +9 -2
  622. package/toast/toast.cjs.min.js +1 -1
  623. package/toast/toast.d.ts +4 -0
  624. package/toast/toast.esm.js +9 -2
  625. package/toast/toast.esm.min.js +1 -1
  626. package/toast/toast.js +9 -2
  627. package/toast/toast.min.js +1 -1
  628. package/togglebutton/togglebutton.cjs.js +2 -0
  629. package/togglebutton/togglebutton.cjs.min.js +1 -1
  630. package/togglebutton/togglebutton.esm.js +2 -0
  631. package/togglebutton/togglebutton.esm.min.js +1 -1
  632. package/togglebutton/togglebutton.js +2 -0
  633. package/togglebutton/togglebutton.min.js +1 -1
  634. package/toolbar/toolbar.cjs.js +2 -0
  635. package/toolbar/toolbar.cjs.min.js +1 -1
  636. package/toolbar/toolbar.esm.js +2 -0
  637. package/toolbar/toolbar.esm.min.js +1 -1
  638. package/toolbar/toolbar.js +2 -0
  639. package/toolbar/toolbar.min.js +1 -1
  640. package/tooltip/tooltip.cjs.js +2 -0
  641. package/tooltip/tooltip.cjs.min.js +1 -1
  642. package/tooltip/tooltip.esm.js +2 -0
  643. package/tooltip/tooltip.esm.min.js +1 -1
  644. package/tooltip/tooltip.js +2 -0
  645. package/tooltip/tooltip.min.css +1 -1
  646. package/tooltip/tooltip.min.js +1 -1
  647. package/tree/tree.cjs.js +2 -0
  648. package/tree/tree.cjs.min.js +1 -1
  649. package/tree/tree.esm.js +2 -0
  650. package/tree/tree.esm.min.js +1 -1
  651. package/tree/tree.js +2 -0
  652. package/tree/tree.min.js +1 -1
  653. package/treenode/treenode.d.ts +1 -1
  654. package/treeselect/treeselect.cjs.js +2 -0
  655. package/treeselect/treeselect.cjs.min.js +1 -1
  656. package/treeselect/treeselect.esm.js +2 -0
  657. package/treeselect/treeselect.esm.min.js +1 -1
  658. package/treeselect/treeselect.js +2 -0
  659. package/treeselect/treeselect.min.js +1 -1
  660. package/treetable/treetable.cjs.js +22 -8
  661. package/treetable/treetable.cjs.min.js +1 -1
  662. package/treetable/treetable.esm.js +23 -9
  663. package/treetable/treetable.esm.min.js +1 -1
  664. package/treetable/treetable.js +23 -10
  665. package/treetable/treetable.min.js +1 -1
  666. package/tristatecheckbox/tristatecheckbox.cjs.js +2 -0
  667. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  668. package/tristatecheckbox/tristatecheckbox.esm.js +2 -0
  669. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  670. package/tristatecheckbox/tristatecheckbox.js +2 -0
  671. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  672. package/utils/utils.cjs.js +404 -496
  673. package/utils/utils.cjs.min.js +1 -1
  674. package/utils/utils.d.ts +20 -26
  675. package/utils/utils.esm.js +405 -496
  676. package/utils/utils.esm.min.js +1 -1
  677. package/utils/utils.js +404 -496
  678. package/utils/utils.min.js +1 -1
  679. package/virtualscroller/virtualscroller.cjs.js +277 -160
  680. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  681. package/virtualscroller/virtualscroller.d.ts +21 -9
  682. package/virtualscroller/virtualscroller.esm.js +277 -160
  683. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  684. package/virtualscroller/virtualscroller.js +277 -160
  685. package/virtualscroller/virtualscroller.min.js +1 -1
  686. package/web-types.json +168 -29
@@ -1 +1 @@
1
- import t,{createRef as e,Component as i}from"react";import{DomHandler as n,tip as s,classNames as r}from"primereact/core";import{InputText as o}from"primereact/inputtext";function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?l(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function y(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?y(Object(i),!0).forEach((function(e){v(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}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(t){return!1}}var m=function(h){p(P,i);var f,v,y,m,k,R=(f=P,v=g(),function(){var t,e=d(f);if(v){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return c(this,t)});function P(t){var i;return u(this,P),(i=R.call(this,t)).onFocus=i.onFocus.bind(l(i)),i.onBlur=i.onBlur.bind(l(i)),i.onKeyDown=i.onKeyDown.bind(l(i)),i.onKeyPress=i.onKeyPress.bind(l(i)),i.onInput=i.onInput.bind(l(i)),i.handleInputChange=i.handleInputChange.bind(l(i)),i.inputRef=e(i.props.inputRef),i}return y=P,(m=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var e,i,s,r=t.which||t.keyCode,o=/iphone/i.test(n.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(e=this.caret()).end)-(i=e.begin)==0&&(i=46!==r?this.seekPrev(i):s=this.seekNext(i-1),s=46===r?this.seekNext(s):s),this.clearBuffer(i,s),this.shiftL(i,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var e=this;if(!this.props.readOnly){var i,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(i=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[i].test(s))&&(this.shiftR(i),this.buffer[i]=s,this.writeBuffer(),r=this.seekNext(i),/android/i.test(n.getUserAgent())?setTimeout((function(){e.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?n.addClass(this.inputRef.current,"p-filled"):n.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=n.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var e=this.props.mask.split(""),i=0;i<e.length;i++){var s=e[i];"?"===s?(this.len--,this.partialPosition=i):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),i<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<e.length;r++){var o=e[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(b({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=s({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var e=r("p-inputmask",this.props.className);return t.createElement(o,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:e,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&a(y.prototype,m),k&&a(y,k),P}();v(m,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null});export{m as InputMask};
1
+ import t,{createRef as e,Component as i}from"react";import{DomHandler as n,tip as s,classNames as r}from"primereact/core";import{InputText as o}from"primereact/inputtext";function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function y(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?y(Object(i),!0).forEach((function(e){v(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}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(t){return!1}}var m=function(h){p(P,i);var f,v,y,m,k,R=(f=P,v=g(),function(){var t,e=d(f);if(v){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return c(this,t)});function P(t){var i;return u(this,P),(i=R.call(this,t)).onFocus=i.onFocus.bind(l(i)),i.onBlur=i.onBlur.bind(l(i)),i.onKeyDown=i.onKeyDown.bind(l(i)),i.onKeyPress=i.onKeyPress.bind(l(i)),i.onInput=i.onInput.bind(l(i)),i.handleInputChange=i.handleInputChange.bind(l(i)),i.inputRef=e(i.props.inputRef),i}return y=P,(m=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var e,i,s,r=t.which||t.keyCode,o=/iphone/i.test(n.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(e=this.caret()).end)-(i=e.begin)==0&&(i=46!==r?this.seekPrev(i):s=this.seekNext(i-1),s=46===r?this.seekNext(s):s),this.clearBuffer(i,s),this.shiftL(i,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var e=this;if(!this.props.readOnly){var i,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(i=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[i].test(s))&&(this.shiftR(i),this.buffer[i]=s,this.writeBuffer(),r=this.seekNext(i),/android/i.test(n.getUserAgent())?setTimeout((function(){e.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?n.addClass(this.inputRef.current,"p-filled"):n.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=n.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var e=this.props.mask.split(""),i=0;i<e.length;i++){var s=e[i];"?"===s?(this.len--,this.partialPosition=i):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),i<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<e.length;r++){var o=e[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(b({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=s({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var e=r("p-inputmask",this.props.className);return t.createElement(o,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:e,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&a(y.prototype,m),k&&a(y,k),P}();v(m,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null});export{m as InputMask};
@@ -79,6 +79,8 @@ this.primereact.inputmask = (function (exports, React, core, inputtext) {
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.inputmask=function(t,e,i,n){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=s(e);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?a(t):e}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function v(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?v(Object(i),!0).forEach((function(e){d(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}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(t){return!1}}var g=function(t){h(m,t);var s,l,p,d,v,g=(s=m,l=b(),function(){var t,e=c(s);if(l){var i=c(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function m(t){var i;return o(this,m),(i=g.call(this,t)).onFocus=i.onFocus.bind(a(i)),i.onBlur=i.onBlur.bind(a(i)),i.onKeyDown=i.onKeyDown.bind(a(i)),i.onKeyPress=i.onKeyPress.bind(a(i)),i.onInput=i.onInput.bind(a(i)),i.handleInputChange=i.handleInputChange.bind(a(i)),i.inputRef=e.createRef(i.props.inputRef),i}return p=m,(d=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var e,n,s,r=t.which||t.keyCode,o=/iphone/i.test(i.DomHandler.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(e=this.caret()).end)-(n=e.begin)==0&&(n=46!==r?this.seekPrev(n):s=this.seekNext(n-1),s=46===r?this.seekNext(s):s),this.clearBuffer(n,s),this.shiftL(n,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var e=this;if(!this.props.readOnly){var n,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(n=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[n].test(s))&&(this.shiftR(n),this.buffer[n]=s,this.writeBuffer(),r=this.seekNext(n),/android/i.test(i.DomHandler.getUserAgent())?setTimeout((function(){e.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?i.DomHandler.addClass(this.inputRef.current,"p-filled"):i.DomHandler.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=i.DomHandler.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var e=this.props.mask.split(""),n=0;n<e.length;n++){var s=e[n];"?"===s?(this.len--,this.partialPosition=n):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),n<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<e.length;r++){var o=e[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(y({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=i.tip({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var t=i.classNames("p-inputmask",this.props.className);return r.default.createElement(n.InputText,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:t,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&u(p.prototype,d),v&&u(p,v),m}(e.Component);return d(g,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null}),t.InputMask=g,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.core,primereact.inputtext);
1
+ this.primereact=this.primereact||{},this.primereact.inputmask=function(t,e,i,n){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=s(e);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return a(t)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function v(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?v(Object(i),!0).forEach((function(e){d(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}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(t){return!1}}var g=function(t){h(m,t);var s,l,p,d,v,g=(s=m,l=b(),function(){var t,e=c(s);if(l){var i=c(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function m(t){var i;return o(this,m),(i=g.call(this,t)).onFocus=i.onFocus.bind(a(i)),i.onBlur=i.onBlur.bind(a(i)),i.onKeyDown=i.onKeyDown.bind(a(i)),i.onKeyPress=i.onKeyPress.bind(a(i)),i.onInput=i.onInput.bind(a(i)),i.handleInputChange=i.handleInputChange.bind(a(i)),i.inputRef=e.createRef(i.props.inputRef),i}return p=m,(d=[{key:"caret",value:function(t,e){var i,n,s,r=this.inputRef&&this.inputRef.current;if(r&&r.offsetParent&&r===document.activeElement)return"number"!=typeof t?(r.setSelectionRange?(n=r.selectionStart,s=r.selectionEnd):document.selection&&document.selection.createRange&&(s=(n=0-(i=document.selection.createRange()).duplicate().moveStart("character",-1e5))+i.text.length),{begin:n,end:s}):(n=t,s="number"==typeof e?e:n,void(r.setSelectionRange?r.setSelectionRange(n,s):r.createTextRange&&((i=r.createTextRange()).collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i.select())))}},{key:"isCompleted",value:function(){for(var t=this.firstNonMaskPos;t<=this.lastRequiredNonMaskPos;t++)if(this.tests[t]&&this.buffer[t]===this.getPlaceholder(t))return!1;return!0}},{key:"getPlaceholder",value:function(t){return this.props.slotChar.charAt(t<this.props.slotChar.length?t:0)}},{key:"getValue",value:function(){return this.props.unmask?this.getUnmaskedValue():this.inputRef&&this.inputRef.current&&this.inputRef.current.value}},{key:"seekNext",value:function(t){for(;++t<this.len&&!this.tests[t];);return t}},{key:"seekPrev",value:function(t){for(;--t>=0&&!this.tests[t];);return t}},{key:"shiftL",value:function(t,e){var i,n;if(!(t<0)){for(i=t,n=this.seekNext(e);i<this.len;i++)if(this.tests[i]){if(!(n<this.len&&this.tests[i].test(this.buffer[n])))break;this.buffer[i]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n),n=this.seekNext(n)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t))}}},{key:"shiftR",value:function(t){var e,i,n,s;for(e=t,i=this.getPlaceholder(t);e<this.len;e++)if(this.tests[e]){if(n=this.seekNext(e),s=this.buffer[e],this.buffer[e]=i,!(n<this.len&&this.tests[n].test(s)))break;i=s}}},{key:"handleAndroidInput",value:function(t){var e=this.inputRef.current.value,i=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>e.length){for(this.checkVal(!0);i.begin>0&&!this.tests[i.begin-1];)i.begin--;if(0===i.begin)for(;i.begin<this.firstNonMaskPos&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}else{for(this.checkVal(!0);i.begin<this.len&&!this.tests[i.begin];)i.begin++;this.caret(i.begin,i.begin)}this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}},{key:"onBlur",value:function(t){if(this.focus=!1,this.checkVal(),this.updateModel(t),this.updateFilledState(),this.props.onBlur&&this.props.onBlur(t),this.inputRef.current.value!==this.focusText){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.inputRef.current.dispatchEvent(e)}}},{key:"onKeyDown",value:function(t){if(!this.props.readOnly){var e,n,s,r=t.which||t.keyCode,o=/iphone/i.test(i.DomHandler.getUserAgent());this.oldVal=this.inputRef.current.value,8===r||46===r||o&&127===r?((s=(e=this.caret()).end)-(n=e.begin)==0&&(n=46!==r?this.seekPrev(n):s=this.seekNext(n-1),s=46===r?this.seekNext(s):s),this.clearBuffer(n,s),this.shiftL(n,s-1),this.updateModel(t),t.preventDefault()):13===r?(this.onBlur(t),this.updateModel(t)):27===r&&(this.inputRef.current.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault())}}},{key:"onKeyPress",value:function(t){var e=this;if(!this.props.readOnly){var n,s,r,o,u=t.which||t.keyCode,a=this.caret();t.ctrlKey||t.altKey||t.metaKey||u<32||(u&&13!==u&&(a.end-a.begin!=0&&(this.clearBuffer(a.begin,a.end),this.shiftL(a.begin,a.end-1)),(n=this.seekNext(a.begin-1))<this.len&&(s=String.fromCharCode(u),this.tests[n].test(s))&&(this.shiftR(n),this.buffer[n]=s,this.writeBuffer(),r=this.seekNext(n),/android/i.test(i.DomHandler.getUserAgent())?setTimeout((function(){e.caret(r)}),0):this.caret(r),a.begin<=this.lastRequiredNonMaskPos&&(o=this.isCompleted())),t.preventDefault()),this.updateModel(t),this.props.onComplete&&o&&this.props.onComplete({originalEvent:t,value:this.getValue()}))}}},{key:"clearBuffer",value:function(t,e){var i;for(i=t;i<e&&i<this.len;i++)this.tests[i]&&(this.buffer[i]=this.getPlaceholder(i))}},{key:"writeBuffer",value:function(){this.inputRef.current.value=this.buffer.join("")}},{key:"checkVal",value:function(t){this.isValueChecked=!0;var e,i,n,s=this.inputRef.current.value,r=-1;for(e=0,n=0;e<this.len;e++)if(this.tests[e]){for(this.buffer[e]=this.getPlaceholder(e);n++<s.length;)if(i=s.charAt(n-1),this.tests[e].test(i)){this.buffer[e]=i,r=e;break}if(n>s.length){this.clearBuffer(e+1,this.len);break}}else this.buffer[e]===s.charAt(n)&&n++,e<this.partialPosition&&(r=e);return t?this.writeBuffer():r+1<this.partialPosition?this.props.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputRef.current.value&&(this.inputRef.current.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputRef.current.value=this.inputRef.current.value.substring(0,r+1)),this.partialPosition?e:this.firstNonMaskPos}},{key:"onFocus",value:function(t){var e,i=this;this.props.readOnly||(this.focus=!0,clearTimeout(this.caretTimeoutId),this.focusText=this.inputRef.current.value,e=this.checkVal(),this.caretTimeoutId=setTimeout((function(){i.inputRef.current===document.activeElement&&(i.writeBuffer(),e===i.props.mask.replace("?","").length?i.caret(0,e):i.caret(e),i.updateFilledState())}),10),this.props.onFocus&&this.props.onFocus(t))}},{key:"onInput",value:function(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t)}},{key:"handleInputChange",value:function(t){if(!this.props.readOnly){var e=this.checkVal(!0);this.caret(e),this.updateModel(t),this.props.onComplete&&this.isCompleted()&&this.props.onComplete({originalEvent:t,value:this.getValue()})}}},{key:"getUnmaskedValue",value:function(){for(var t=[],e=0;e<this.buffer.length;e++){var i=this.buffer[e];this.tests[e]&&i!==this.getPlaceholder(e)&&t.push(i)}return t.join("")}},{key:"updateModel",value:function(t){if(this.props.onChange){var e=this.props.unmask?this.getUnmaskedValue():t&&t.target.value;this.props.onChange({originalEvent:t,value:this.defaultBuffer!==e?e:"",stopPropagation:function(){},preventDefault:function(){},target:{name:this.props.name,id:this.props.id,value:this.defaultBuffer!==e?e:""}})}}},{key:"updateFilledState",value:function(){this.inputRef&&this.inputRef.current&&this.inputRef.current.value&&this.inputRef.current.value.length>0?i.DomHandler.addClass(this.inputRef.current,"p-filled"):i.DomHandler.removeClass(this.inputRef.current,"p-filled")}},{key:"updateValue",value:function(t){var e,i=this;return this.inputRef&&this.inputRef.current&&(null==this.props.value?this.inputRef.current.value="":(this.inputRef.current.value=this.props.value,e=this.checkVal(t),setTimeout((function(){if(i.inputRef&&i.inputRef.current)return i.writeBuffer(),i.checkVal(t)}),10)),this.focusText=this.inputRef.current.value),this.updateFilledState(),e}},{key:"isValueUpdated",value:function(){return this.props.unmask?this.props.value!==this.getUnmaskedValue():this.defaultBuffer!==this.inputRef.current.value&&this.inputRef.current.value!==this.props.value}},{key:"init",value:function(){if(this.props.mask){this.tests=[],this.partialPosition=this.props.mask.length,this.len=this.props.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};var t=i.DomHandler.getUserAgent();this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);for(var e=this.props.mask.split(""),n=0;n<e.length;n++){var s=e[n];"?"===s?(this.len--,this.partialPosition=n):this.defs[s]?(this.tests.push(new RegExp(this.defs[s])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1),n<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null)}this.buffer=[];for(var r=0;r<e.length;r++){var o=e[r];"?"!==o&&this.buffer.push(this.defs[o]?this.getPlaceholder(r):o)}this.defaultBuffer=this.buffer.join("")}}},{key:"updateInputRef",value:function(){var t=this.props.inputRef;t&&("function"==typeof t?t(this.inputRef.current):t.current=this.inputRef.current)}},{key:"componentDidMount",value:function(){this.updateInputRef(),this.init(),this.updateValue(),this.props.tooltip&&this.renderTooltip()}},{key:"componentDidUpdate",value:function(t){t.tooltip===this.props.tooltip&&t.tooltipOptions===this.props.tooltipOptions||(this.tooltip?this.tooltip.update(y({content:this.props.tooltip},this.props.tooltipOptions||{})):this.renderTooltip()),this.isValueUpdated()&&this.updateValue(),t.mask!==this.props.mask&&(this.init(),this.caret(this.updateValue(!0)),this.updateModel())}},{key:"componentWillUnmount",value:function(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null)}},{key:"renderTooltip",value:function(){this.tooltip=i.tip({target:this.inputRef.current,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"render",value:function(){var t=i.classNames("p-inputmask",this.props.className);return r.default.createElement(n.InputText,{id:this.props.id,ref:this.inputRef,type:this.props.type,name:this.props.name,style:this.props.style,className:t,placeholder:this.props.placeholder,size:this.props.size,maxLength:this.props.maxlength,tabIndex:this.props.tabIndex,disabled:this.props.disabled,readOnly:this.props.readOnly,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onInput:this.onInput,onPaste:this.handleInputChange,required:this.props.required,"aria-labelledby":this.props.ariaLabelledBy})}}])&&u(p.prototype,d),v&&u(p,v),m}(e.Component);return d(g,"defaultProps",{id:null,inputRef:null,value:null,type:"text",mask:null,slotChar:"_",autoClear:!0,unmask:!1,style:null,className:null,placeholder:null,size:null,maxlength:null,tabIndex:null,disabled:!1,readOnly:!1,name:null,required:!1,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onComplete:null,onChange:null,onFocus:null,onBlur:null}),t.InputMask=g,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.core,primereact.inputtext);
@@ -118,6 +118,8 @@ function _typeof(obj) {
118
118
  function _possibleConstructorReturn(self, call) {
119
119
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
120
120
  return call;
121
+ } else if (call !== void 0) {
122
+ throw new TypeError("Derived constructors may only return object or undefined");
121
123
  }
122
124
 
123
125
  return _assertThisInitialized(self);
@@ -216,10 +218,10 @@ var InputNumber = /*#__PURE__*/function (_Component) {
216
218
  return [d, i];
217
219
  }));
218
220
  this._numeral = new RegExp("[".concat(numerals.join(''), "]"), 'g');
219
- this._decimal = this.getDecimalExpression();
220
221
  this._group = this.getGroupingExpression();
221
222
  this._minusSign = this.getMinusSignExpression();
222
223
  this._currency = this.getCurrencyExpression();
224
+ this._decimal = this.getDecimalExpression();
223
225
  this._suffix = this.getSuffixExpression();
224
226
  this._prefix = this.getPrefixExpression();
225
227
 
@@ -235,10 +237,10 @@ var InputNumber = /*#__PURE__*/function (_Component) {
235
237
  }, {
236
238
  key: "getDecimalExpression",
237
239
  value: function getDecimalExpression() {
238
- var formatter = new Intl.NumberFormat(this.props.locale, {
240
+ var formatter = new Intl.NumberFormat(this.props.locale, _objectSpread(_objectSpread({}, this.getOptions()), {}, {
239
241
  useGrouping: false
240
- });
241
- return new RegExp("[".concat(formatter.format(1.1).trim().replace(this._numeral, ''), "]"), 'g');
242
+ }));
243
+ return new RegExp("[".concat(formatter.format(1.1).replace(this._currency, '').trim().replace(this._numeral, ''), "]"), 'g');
242
244
  }
243
245
  }, {
244
246
  key: "getGroupingExpression",
@@ -264,12 +266,14 @@ var InputNumber = /*#__PURE__*/function (_Component) {
264
266
  var formatter = new Intl.NumberFormat(this.props.locale, {
265
267
  style: 'currency',
266
268
  currency: this.props.currency,
267
- currencyDisplay: this.props.currencyDisplay
269
+ currencyDisplay: this.props.currencyDisplay,
270
+ minimumFractionDigits: 0,
271
+ maximumFractionDigits: 0
268
272
  });
269
- return new RegExp("[".concat(formatter.format(1).replace(/\s/g, '').replace(this._numeral, '').replace(this._decimal, '').replace(this._group, ''), "]"), 'g');
270
- } else {
271
- return new RegExp("[]", 'g');
273
+ return new RegExp("[".concat(formatter.format(1).replace(/\s/g, '').replace(this._numeral, '').replace(this._group, ''), "]"), 'g');
272
274
  }
275
+
276
+ return new RegExp("[]", 'g');
273
277
  }
274
278
  }, {
275
279
  key: "getPrefixExpression",
@@ -363,12 +367,14 @@ var InputNumber = /*#__PURE__*/function (_Component) {
363
367
  }, {
364
368
  key: "spin",
365
369
  value: function spin(event, dir) {
366
- var step = this.props.step * dir;
367
- var currentValue = this.parseValue(this.inputRef.current.value) || 0;
368
- var newValue = this.validateValue(currentValue + step);
369
- this.updateInput(newValue, null, 'spin');
370
- this.updateModel(event, newValue);
371
- this.handleOnChange(event, currentValue, newValue);
370
+ if (this.inputRef && this.inputRef.current) {
371
+ var step = this.props.step * dir;
372
+ var currentValue = this.parseValue(this.inputRef.current.value) || 0;
373
+ var newValue = this.validateValue(currentValue + step);
374
+ this.updateInput(newValue, null, 'spin');
375
+ this.updateModel(event, newValue);
376
+ this.handleOnChange(event, currentValue, newValue);
377
+ }
372
378
  }
373
379
  }, {
374
380
  key: "onUpButtonMouseDown",
@@ -409,7 +415,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
409
415
  }
410
416
  }, {
411
417
  key: "onDownButtonMouseDown",
412
- value: function onDownButtonMouseDown(event, focusInput) {
418
+ value: function onDownButtonMouseDown(event) {
413
419
  if (!this.props.disabled) {
414
420
  this.inputRef.current.focus();
415
421
  this.repeat(event, null, -1);
@@ -487,9 +493,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
487
493
  //left
488
494
 
489
495
  case 37:
490
- var prevChar = inputValue.charAt(selectionStart - 1);
491
-
492
- if (!this.isNumeralChar(prevChar)) {
496
+ if (!this.isNumeralChar(inputValue.charAt(selectionStart - 1))) {
493
497
  event.preventDefault();
494
498
  }
495
499
 
@@ -497,9 +501,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
497
501
  //right
498
502
 
499
503
  case 39:
500
- var currentChar = inputValue.charAt(selectionStart);
501
-
502
- if (!this.isNumeralChar(currentChar)) {
504
+ if (!this.isNumeralChar(inputValue.charAt(selectionStart))) {
503
505
  event.preventDefault();
504
506
  }
505
507
 
@@ -519,19 +521,29 @@ var InputNumber = /*#__PURE__*/function (_Component) {
519
521
 
520
522
  if (selectionStart === selectionEnd) {
521
523
  var deleteChar = inputValue.charAt(selectionStart - 1);
522
- var decimalCharIndex = inputValue.search(this._decimal);
523
- this._decimal.lastIndex = 0;
524
+
525
+ var _this$getDecimalCharI = this.getDecimalCharIndexes(inputValue),
526
+ decimalCharIndex = _this$getDecimalCharI.decimalCharIndex,
527
+ decimalCharIndexWithoutPrefix = _this$getDecimalCharI.decimalCharIndexWithoutPrefix;
524
528
 
525
529
  if (this.isNumeralChar(deleteChar)) {
530
+ var decimalLength = this.getDecimalLength(inputValue);
531
+
526
532
  if (this._group.test(deleteChar)) {
527
533
  this._group.lastIndex = 0;
528
534
  newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
529
535
  } else if (this._decimal.test(deleteChar)) {
530
536
  this._decimal.lastIndex = 0;
531
- this.inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
537
+
538
+ if (decimalLength) {
539
+ this.inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
540
+ } else {
541
+ newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
542
+ }
532
543
  } else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
533
- newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart);
534
- } else if (decimalCharIndex > 0 && decimalCharIndex === 1) {
544
+ var insertedText = this.isDecimalMode() && (this.props.minFractionDigits || 0) < decimalLength ? '' : '0';
545
+ newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);
546
+ } else if (decimalCharIndexWithoutPrefix === 1) {
535
547
  newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart);
536
548
  newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';
537
549
  } else {
@@ -554,20 +566,29 @@ var InputNumber = /*#__PURE__*/function (_Component) {
554
566
  if (selectionStart === selectionEnd) {
555
567
  var _deleteChar = inputValue.charAt(selectionStart);
556
568
 
557
- var _decimalCharIndex = inputValue.search(this._decimal);
558
-
559
- this._decimal.lastIndex = 0;
569
+ var _this$getDecimalCharI2 = this.getDecimalCharIndexes(inputValue),
570
+ _decimalCharIndex = _this$getDecimalCharI2.decimalCharIndex,
571
+ _decimalCharIndexWithoutPrefix = _this$getDecimalCharI2.decimalCharIndexWithoutPrefix;
560
572
 
561
573
  if (this.isNumeralChar(_deleteChar)) {
574
+ var _decimalLength = this.getDecimalLength(inputValue);
575
+
562
576
  if (this._group.test(_deleteChar)) {
563
577
  this._group.lastIndex = 0;
564
578
  newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
565
579
  } else if (this._decimal.test(_deleteChar)) {
566
580
  this._decimal.lastIndex = 0;
567
- this.inputRef.current.setSelectionRange(selectionStart + 1, selectionStart + 1);
581
+
582
+ if (_decimalLength) {
583
+ this.$refs.input.$el.setSelectionRange(selectionStart + 1, selectionStart + 1);
584
+ } else {
585
+ newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
586
+ }
568
587
  } else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
569
- newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
570
- } else if (_decimalCharIndex > 0 && _decimalCharIndex === 1) {
588
+ var _insertedText = this.isDecimalMode() && (this.props.minFractionDigits || 0) < _decimalLength ? '' : '0';
589
+
590
+ newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
591
+ } else if (_decimalCharIndexWithoutPrefix === 1) {
571
592
  newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
572
593
  newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';
573
594
  } else {
@@ -626,7 +647,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
626
647
  }, {
627
648
  key: "isMinusSign",
628
649
  value: function isMinusSign(char) {
629
- if (this._minusSign.test(char)) {
650
+ if (this._minusSign.test(char) || char === '-') {
630
651
  this._minusSign.lastIndex = 0;
631
652
  return true;
632
653
  }
@@ -643,6 +664,42 @@ var InputNumber = /*#__PURE__*/function (_Component) {
643
664
 
644
665
  return false;
645
666
  }
667
+ }, {
668
+ key: "isDecimalMode",
669
+ value: function isDecimalMode() {
670
+ return this.props.mode === 'decimal';
671
+ }
672
+ }, {
673
+ key: "getDecimalCharIndexes",
674
+ value: function getDecimalCharIndexes(val) {
675
+ var decimalCharIndex = val.search(this._decimal);
676
+ this._decimal.lastIndex = 0;
677
+ var filteredVal = val.replace(this._prefix, '').trim().replace(/\s/g, '').replace(this._currency, '');
678
+ var decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal);
679
+ this._decimal.lastIndex = 0;
680
+ return {
681
+ decimalCharIndex: decimalCharIndex,
682
+ decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix
683
+ };
684
+ }
685
+ }, {
686
+ key: "getCharIndexes",
687
+ value: function getCharIndexes(val) {
688
+ var decimalCharIndex = val.search(this._decimal);
689
+ this._decimal.lastIndex = 0;
690
+ var minusCharIndex = val.search(this._minusSign);
691
+ this._minusSign.lastIndex = 0;
692
+ var suffixCharIndex = val.search(this._suffix);
693
+ this._suffix.lastIndex = 0;
694
+ var currencyCharIndex = val.search(this._currency);
695
+ this._currency.lastIndex = 0;
696
+ return {
697
+ decimalCharIndex: decimalCharIndex,
698
+ minusCharIndex: minusCharIndex,
699
+ suffixCharIndex: suffixCharIndex,
700
+ currencyCharIndex: currencyCharIndex
701
+ };
702
+ }
646
703
  }, {
647
704
  key: "insert",
648
705
  value: function insert(event, text) {
@@ -660,10 +717,13 @@ var InputNumber = /*#__PURE__*/function (_Component) {
660
717
  var selectionStart = this.inputRef.current.selectionStart;
661
718
  var selectionEnd = this.inputRef.current.selectionEnd;
662
719
  var inputValue = this.inputRef.current.value.trim();
663
- var decimalCharIndex = inputValue.search(this._decimal);
664
- this._decimal.lastIndex = 0;
665
- var minusCharIndex = inputValue.search(this._minusSign);
666
- this._minusSign.lastIndex = 0;
720
+
721
+ var _this$getCharIndexes = this.getCharIndexes(inputValue),
722
+ decimalCharIndex = _this$getCharIndexes.decimalCharIndex,
723
+ minusCharIndex = _this$getCharIndexes.minusCharIndex,
724
+ suffixCharIndex = _this$getCharIndexes.suffixCharIndex,
725
+ currencyCharIndex = _this$getCharIndexes.currencyCharIndex;
726
+
667
727
  var newValueStr;
668
728
 
669
729
  if (sign.isMinusSign) {
@@ -682,6 +742,9 @@ var InputNumber = /*#__PURE__*/function (_Component) {
682
742
  } else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) {
683
743
  newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
684
744
  this.updateValue(event, newValueStr, text, 'insert');
745
+ } else if (decimalCharIndex === -1 && this.props.maxFractionDigits) {
746
+ newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);
747
+ this.updateValue(event, newValueStr, text, 'insert');
685
748
  }
686
749
  } else {
687
750
  var maxFractionDigits = this.numberFormat.resolvedOptions().maximumFractionDigits;
@@ -689,7 +752,8 @@ var InputNumber = /*#__PURE__*/function (_Component) {
689
752
 
690
753
  if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
691
754
  if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {
692
- newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length);
755
+ var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
756
+ newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex);
693
757
  this.updateValue(event, newValueStr, text, operation);
694
758
  }
695
759
  } else {
@@ -701,7 +765,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
701
765
  }, {
702
766
  key: "insertText",
703
767
  value: function insertText(value, text, start, end) {
704
- var textSplit = text.split('.');
768
+ var textSplit = text === '.' ? text : text.split('.');
705
769
 
706
770
  if (textSplit.length === 2) {
707
771
  var decimalCharIndex = value.slice(start, end).search(this._decimal);
@@ -730,11 +794,15 @@ var InputNumber = /*#__PURE__*/function (_Component) {
730
794
  var selectionStart = this.inputRef.current.selectionStart;
731
795
  var inputValue = this.inputRef.current.value;
732
796
  var valueLength = inputValue.length;
733
- var index = null;
797
+ var index = null; // remove prefix
798
+
799
+ var prefixLength = (this.prefixChar || '').length;
800
+ inputValue = inputValue.replace(this._prefix, '');
801
+ selectionStart = selectionStart - prefixLength;
734
802
  var char = inputValue.charAt(selectionStart);
735
803
 
736
804
  if (this.isNumeralChar(char)) {
737
- return;
805
+ return selectionStart + prefixLength;
738
806
  } //left
739
807
 
740
808
 
@@ -744,7 +812,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
744
812
  char = inputValue.charAt(i);
745
813
 
746
814
  if (this.isNumeralChar(char)) {
747
- index = i;
815
+ index = i + prefixLength;
748
816
  break;
749
817
  } else {
750
818
  i--;
@@ -754,13 +822,13 @@ var InputNumber = /*#__PURE__*/function (_Component) {
754
822
  if (index !== null) {
755
823
  this.inputRef.current.setSelectionRange(index + 1, index + 1);
756
824
  } else {
757
- i = selectionStart + 1;
825
+ i = selectionStart;
758
826
 
759
827
  while (i < valueLength) {
760
828
  char = inputValue.charAt(i);
761
829
 
762
830
  if (this.isNumeralChar(char)) {
763
- index = i;
831
+ index = i + prefixLength;
764
832
  break;
765
833
  } else {
766
834
  i++;
@@ -771,6 +839,8 @@ var InputNumber = /*#__PURE__*/function (_Component) {
771
839
  this.inputRef.current.setSelectionRange(index, index);
772
840
  }
773
841
  }
842
+
843
+ return index || 0;
774
844
  }
775
845
  }, {
776
846
  key: "onInputClick",
@@ -803,10 +873,10 @@ var InputNumber = /*#__PURE__*/function (_Component) {
803
873
 
804
874
  if (valueStr != null) {
805
875
  newValue = this.parseValue(valueStr);
806
- this.updateInput(newValue, insertedValueStr, operation);
876
+ newValue = !newValue && !this.props.allowEmpty ? 0 : newValue;
877
+ this.updateInput(newValue, insertedValueStr, operation, valueStr);
878
+ this.handleOnChange(event, currentValue, newValue);
807
879
  }
808
-
809
- this.handleOnChange(event, currentValue, newValue);
810
880
  }
811
881
  }, {
812
882
  key: "handleOnChange",
@@ -835,6 +905,10 @@ var InputNumber = /*#__PURE__*/function (_Component) {
835
905
  }, {
836
906
  key: "validateValue",
837
907
  value: function validateValue(value) {
908
+ if (value === '-' || value == null) {
909
+ return null;
910
+ }
911
+
838
912
  if (this.props.min !== null && value < this.props.min) {
839
913
  return this.props.min;
840
914
  }
@@ -843,28 +917,26 @@ var InputNumber = /*#__PURE__*/function (_Component) {
843
917
  return this.props.max;
844
918
  }
845
919
 
846
- if (value === '-') {
847
- // Minus sign
848
- return null;
849
- }
850
-
851
920
  return value;
852
921
  }
853
922
  }, {
854
923
  key: "updateInput",
855
- value: function updateInput(value, insertedValueStr, operation) {
924
+ value: function updateInput(value, insertedValueStr, operation, valueStr) {
856
925
  insertedValueStr = insertedValueStr || '';
857
926
  var inputEl = this.inputRef.current;
858
927
  var inputValue = inputEl.value;
859
928
  var newValue = this.formatValue(value);
860
929
  var currentLength = inputValue.length;
861
930
 
931
+ if (newValue !== valueStr) {
932
+ newValue = this.concatValues(newValue, valueStr);
933
+ }
934
+
862
935
  if (currentLength === 0) {
863
936
  inputEl.value = newValue;
864
937
  inputEl.setSelectionRange(0, 0);
865
- this.initCursor();
866
- var prefixLength = (this.prefixChar || '').length;
867
- var selectionEnd = prefixLength + insertedValueStr.length;
938
+ var index = this.initCursor();
939
+ var selectionEnd = index + insertedValueStr.length;
868
940
  inputEl.setSelectionRange(selectionEnd, selectionEnd);
869
941
  } else {
870
942
  var selectionStart = inputEl.selectionStart;
@@ -901,7 +973,13 @@ var InputNumber = /*#__PURE__*/function (_Component) {
901
973
  this._group.lastIndex = 0;
902
974
  inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
903
975
  } else if (inputValue === '-' && operation === 'insert') {
904
- inputEl.setSelectionRange(_selectionEnd + 1, _selectionEnd + 1);
976
+ inputEl.setSelectionRange(0, 0);
977
+
978
+ var _index = this.initCursor();
979
+
980
+ var _selectionEnd2 = _index + insertedValueStr.length + 1;
981
+
982
+ inputEl.setSelectionRange(_selectionEnd2, _selectionEnd2);
905
983
  } else {
906
984
  _selectionEnd = _selectionEnd + (newLength - currentLength);
907
985
  inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
@@ -913,15 +991,46 @@ var InputNumber = /*#__PURE__*/function (_Component) {
913
991
  }, {
914
992
  key: "updateInputValue",
915
993
  value: function updateInputValue(newValue) {
994
+ newValue = !newValue && !this.props.allowEmpty ? 0 : newValue;
916
995
  var inputEl = this.inputRef.current;
917
996
  var value = inputEl.value;
918
- var formattedValue = this.formatValue(newValue);
997
+ var formattedValue = this.formattedValue(newValue);
919
998
 
920
999
  if (value !== formattedValue) {
921
1000
  inputEl.value = formattedValue;
922
1001
  inputEl.setAttribute('aria-valuenow', newValue);
923
1002
  }
924
1003
  }
1004
+ }, {
1005
+ key: "formattedValue",
1006
+ value: function formattedValue(val) {
1007
+ var newVal = !val && !this.props.allowEmpty ? 0 : val;
1008
+ return this.formatValue(newVal);
1009
+ }
1010
+ }, {
1011
+ key: "concatValues",
1012
+ value: function concatValues(val1, val2) {
1013
+ if (val1 && val2) {
1014
+ var decimalCharIndex = val2.search(this._decimal);
1015
+ this._decimal.lastIndex = 0;
1016
+ return decimalCharIndex !== -1 ? val1.split(this._decimal)[0] + val2.slice(decimalCharIndex) : val1;
1017
+ }
1018
+
1019
+ return val1;
1020
+ }
1021
+ }, {
1022
+ key: "getDecimalLength",
1023
+ value: function getDecimalLength(value) {
1024
+ if (value) {
1025
+ var valueSplit = value.split(this._decimal);
1026
+
1027
+ if (valueSplit.length === 2) {
1028
+ return valueSplit[1].replace(this._suffix, '').trim().replace(/\s/g, '').replace(this._currency, '').length;
1029
+ }
1030
+ }
1031
+
1032
+ return 0;
1033
+ }
925
1034
  }, {
926
1035
  key: "updateModel",
927
1036
  value: function updateModel(event, value) {
@@ -1004,6 +1113,11 @@ var InputNumber = /*#__PURE__*/function (_Component) {
1004
1113
  value: function getInputMode() {
1005
1114
  return this.props.inputMode || (this.props.mode === 'decimal' && !this.props.minFractionDigits ? 'numeric' : 'decimal');
1006
1115
  }
1116
+ }, {
1117
+ key: "getFormatter",
1118
+ value: function getFormatter() {
1119
+ return this.numberFormat;
1120
+ }
1007
1121
  }, {
1008
1122
  key: "updateInputRef",
1009
1123
  value: function updateInputRef() {
@@ -1028,7 +1142,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
1028
1142
 
1029
1143
  var newValue = this.validateValue(this.props.value);
1030
1144
 
1031
- if (this.props.value !== newValue) {
1145
+ if (this.props.value !== null && this.props.value !== newValue) {
1032
1146
  this.updateModel(null, newValue);
1033
1147
  }
1034
1148
  }
@@ -1051,7 +1165,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
1051
1165
  var newValue = this.validateValue(this.props.value);
1052
1166
  this.updateInputValue(newValue);
1053
1167
 
1054
- if (this.props.value !== newValue) {
1168
+ if (this.props.value !== null && this.props.value !== newValue) {
1055
1169
  this.updateModel(null, newValue);
1056
1170
  }
1057
1171
  }
@@ -1087,7 +1201,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
1087
1201
  key: "renderInputElement",
1088
1202
  value: function renderInputElement() {
1089
1203
  var className = core.classNames('p-inputnumber-input', this.props.inputClassName);
1090
- var valueToRender = this.formatValue(this.props.value);
1204
+ var valueToRender = this.formattedValue(this.props.value);
1091
1205
  return /*#__PURE__*/React__default['default'].createElement(inputtext.InputText, {
1092
1206
  ref: this.inputRef,
1093
1207
  id: this.props.inputId,
@@ -1183,7 +1297,7 @@ var InputNumber = /*#__PURE__*/function (_Component) {
1183
1297
  value: function render() {
1184
1298
  var _this6 = this;
1185
1299
 
1186
- var className = core.classNames('p-inputnumber p-component', this.props.className, {
1300
+ var className = core.classNames('p-inputnumber p-component p-inputwrapper', this.props.className, {
1187
1301
  'p-inputwrapper-filled': this.props.value != null && this.props.value.toString().length > 0,
1188
1302
  'p-inputwrapper-focus': this.state.focused,
1189
1303
  'p-inputnumber-buttons-stacked': this.isStacked(),
@@ -1229,6 +1343,7 @@ _defineProperty(InputNumber, "defaultProps", {
1229
1343
  id: null,
1230
1344
  name: null,
1231
1345
  type: 'text',
1346
+ allowEmpty: true,
1232
1347
  step: 1,
1233
1348
  min: null,
1234
1349
  max: null,