primereact 10.0.0 → 10.0.2

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 (483) hide show
  1. package/README.md +1 -1
  2. package/accordion/accordion.esm.js +0 -1
  3. package/api/api.esm.js +0 -1
  4. package/autocomplete/autocomplete.esm.js +8 -7
  5. package/autocomplete/autocomplete.esm.min.js +1 -1
  6. package/avatar/avatar.esm.js +0 -1
  7. package/avatargroup/avatargroup.esm.js +0 -1
  8. package/badge/badge.esm.js +0 -1
  9. package/blockui/blockui.esm.js +3 -1
  10. package/blockui/blockui.esm.min.js +1 -1
  11. package/breadcrumb/breadcrumb.esm.js +0 -1
  12. package/button/button.esm.js +0 -1
  13. package/calendar/calendar.esm.js +2 -1
  14. package/calendar/calendar.esm.min.js +1 -1
  15. package/card/card.esm.js +0 -1
  16. package/carousel/carousel.esm.js +7 -8
  17. package/carousel/carousel.esm.min.js +1 -1
  18. package/cascadeselect/cascadeselect.esm.js +0 -1
  19. package/chart/chart.esm.js +0 -1
  20. package/checkbox/checkbox.esm.js +0 -1
  21. package/chip/chip.esm.js +0 -1
  22. package/chips/chips.esm.js +0 -1
  23. package/colorpicker/colorpicker.esm.js +0 -1
  24. package/column/column.esm.js +0 -1
  25. package/columngroup/columngroup.esm.js +0 -1
  26. package/componentbase/componentbase.cjs.js +12 -7
  27. package/componentbase/componentbase.cjs.min.js +1 -1
  28. package/componentbase/componentbase.esm.js +23 -13
  29. package/componentbase/componentbase.esm.min.js +1 -1
  30. package/componentbase/componentbase.js +12 -7
  31. package/componentbase/componentbase.min.js +1 -1
  32. package/confirmdialog/confirmdialog.esm.js +0 -1
  33. package/confirmpopup/confirmpopup.esm.js +0 -1
  34. package/contextmenu/contextmenu.esm.js +0 -1
  35. package/core/core.js +12 -7
  36. package/core/core.min.js +1 -1
  37. package/csstransition/csstransition.esm.js +0 -1
  38. package/datascroller/datascroller.esm.js +0 -1
  39. package/datatable/datatable.esm.js +0 -1
  40. package/dataview/dataview.esm.js +0 -1
  41. package/deferredcontent/deferredcontent.esm.js +0 -1
  42. package/dialog/dialog.esm.js +2 -1
  43. package/dialog/dialog.esm.min.js +1 -1
  44. package/divider/divider.esm.js +0 -1
  45. package/dock/dock.esm.js +0 -1
  46. package/dropdown/dropdown.esm.js +0 -1
  47. package/editor/editor.esm.js +0 -1
  48. package/fieldset/fieldset.esm.js +0 -1
  49. package/fileupload/fileupload.esm.js +0 -1
  50. package/galleria/galleria.esm.js +11 -7
  51. package/galleria/galleria.esm.min.js +1 -1
  52. package/hooks/hooks.esm.js +0 -6
  53. package/iconbase/iconbase.esm.js +0 -1
  54. package/icons/angledoubledown/index.esm.js +0 -1
  55. package/icons/angledoubleleft/index.esm.js +0 -1
  56. package/icons/angledoubleright/index.esm.js +0 -1
  57. package/icons/angledoubleup/index.esm.js +0 -1
  58. package/icons/angledown/index.esm.js +0 -1
  59. package/icons/angleleft/index.esm.js +0 -1
  60. package/icons/angleright/index.esm.js +0 -1
  61. package/icons/angleup/index.esm.js +0 -1
  62. package/icons/arrowdown/index.esm.js +0 -1
  63. package/icons/arrowup/index.esm.js +0 -1
  64. package/icons/ban/index.esm.js +0 -1
  65. package/icons/bars/index.esm.js +0 -1
  66. package/icons/calendar/index.esm.js +0 -1
  67. package/icons/check/index.esm.js +0 -1
  68. package/icons/chevrondown/index.esm.js +0 -1
  69. package/icons/chevronleft/index.esm.js +0 -1
  70. package/icons/chevronright/index.esm.js +0 -1
  71. package/icons/chevronup/index.esm.js +0 -1
  72. package/icons/download/index.esm.js +0 -1
  73. package/icons/exclamationtriangle/index.esm.js +0 -1
  74. package/icons/eye/index.esm.js +0 -1
  75. package/icons/eyeslash/index.esm.js +0 -1
  76. package/icons/filter/index.esm.js +0 -1
  77. package/icons/filterslash/index.esm.js +0 -1
  78. package/icons/infocircle/index.esm.js +0 -1
  79. package/icons/minus/index.esm.js +0 -1
  80. package/icons/pencil/index.esm.js +0 -1
  81. package/icons/plus/index.esm.js +0 -1
  82. package/icons/refresh/index.esm.js +0 -1
  83. package/icons/search/index.esm.js +0 -1
  84. package/icons/searchminus/index.esm.js +0 -1
  85. package/icons/searchplus/index.esm.js +0 -1
  86. package/icons/sortalt/index.esm.js +0 -1
  87. package/icons/sortamountdown/index.esm.js +0 -1
  88. package/icons/sortamountupalt/index.esm.js +0 -1
  89. package/icons/spinner/index.esm.js +0 -1
  90. package/icons/star/index.esm.js +0 -1
  91. package/icons/starfill/index.esm.js +0 -1
  92. package/icons/thlarge/index.esm.js +0 -1
  93. package/icons/times/index.esm.js +0 -1
  94. package/icons/timescircle/index.esm.js +0 -1
  95. package/icons/trash/index.esm.js +0 -1
  96. package/icons/undo/index.esm.js +0 -1
  97. package/icons/upload/index.esm.js +0 -1
  98. package/icons/windowmaximize/index.esm.js +0 -1
  99. package/icons/windowminimize/index.esm.js +0 -1
  100. package/image/image.esm.js +2 -1
  101. package/image/image.esm.min.js +1 -1
  102. package/inplace/inplace.esm.js +0 -1
  103. package/inputmask/inputmask.esm.js +0 -1
  104. package/inputnumber/inputnumber.esm.js +0 -1
  105. package/inputswitch/inputswitch.esm.js +0 -1
  106. package/inputtext/inputtext.esm.js +0 -1
  107. package/inputtextarea/inputtextarea.esm.js +0 -1
  108. package/keyfilter/keyfilter.esm.js +0 -1
  109. package/knob/knob.esm.js +0 -1
  110. package/listbox/listbox.esm.js +0 -1
  111. package/megamenu/megamenu.esm.js +0 -1
  112. package/mention/mention.esm.js +0 -1
  113. package/menu/menu.esm.js +0 -1
  114. package/menubar/menubar.esm.js +0 -1
  115. package/message/message.esm.js +0 -1
  116. package/messages/messages.esm.js +1 -2
  117. package/messages/messages.esm.min.js +1 -1
  118. package/multiselect/multiselect.esm.js +0 -1
  119. package/multistatecheckbox/multistatecheckbox.esm.js +0 -1
  120. package/orderlist/orderlist.esm.js +9 -5
  121. package/orderlist/orderlist.esm.min.js +1 -1
  122. package/organizationchart/organizationchart.esm.js +0 -1
  123. package/overlaypanel/overlaypanel.esm.js +0 -1
  124. package/overlayservice/overlayservice.esm.js +0 -1
  125. package/package.json +2 -2
  126. package/paginator/paginator.esm.js +0 -1
  127. package/panel/panel.esm.js +0 -1
  128. package/panelmenu/panelmenu.esm.js +0 -1
  129. package/passthrough/index.esm.js +0 -1
  130. package/passthrough/tailwind/index.cjs.js +2 -4
  131. package/passthrough/tailwind/index.cjs.min.js +1 -1
  132. package/passthrough/tailwind/index.esm.js +149 -148
  133. package/passthrough/tailwind/index.esm.min.js +1 -1
  134. package/passthrough/tailwind/index.js +2 -4
  135. package/passthrough/tailwind/index.min.js +1 -1
  136. package/password/password.esm.js +0 -1
  137. package/picklist/picklist.esm.js +0 -1
  138. package/portal/portal.esm.js +0 -1
  139. package/primereact.all.cjs.js +12 -7
  140. package/primereact.all.cjs.min.js +1 -1
  141. package/primereact.all.esm.js +70 -42
  142. package/primereact.all.esm.min.js +1 -1
  143. package/primereact.all.js +12 -7
  144. package/primereact.all.min.js +1 -1
  145. package/progressbar/progressbar.esm.js +0 -1
  146. package/progressspinner/progressspinner.esm.js +0 -1
  147. package/radiobutton/radiobutton.esm.js +0 -1
  148. package/rating/rating.esm.js +0 -1
  149. package/ripple/ripple.esm.js +0 -1
  150. package/row/row.esm.js +0 -1
  151. package/scrollpanel/scrollpanel.esm.js +0 -1
  152. package/scrolltop/scrolltop.esm.js +0 -1
  153. package/selectbutton/selectbutton.esm.js +0 -1
  154. package/sidebar/sidebar.esm.js +2 -1
  155. package/sidebar/sidebar.esm.min.js +1 -1
  156. package/skeleton/skeleton.esm.js +0 -1
  157. package/slidemenu/slidemenu.esm.js +0 -1
  158. package/slider/slider.esm.js +0 -1
  159. package/speeddial/speeddial.esm.js +0 -1
  160. package/splitbutton/splitbutton.esm.js +0 -1
  161. package/splitter/splitter.esm.js +0 -1
  162. package/steps/steps.esm.js +0 -1
  163. package/styleclass/styleclass.esm.js +0 -1
  164. package/tabmenu/tabmenu.esm.js +0 -1
  165. package/tabview/tabview.esm.js +0 -1
  166. package/tag/tag.esm.js +0 -1
  167. package/terminal/terminal.esm.js +0 -1
  168. package/terminalservice/terminalservice.esm.js +0 -1
  169. package/tieredmenu/tieredmenu.esm.js +0 -1
  170. package/timeline/timeline.esm.js +0 -1
  171. package/toast/toast.esm.js +0 -1
  172. package/togglebutton/togglebutton.esm.js +0 -1
  173. package/toolbar/toolbar.esm.js +0 -1
  174. package/tooltip/tooltip.esm.js +0 -1
  175. package/tree/tree.esm.js +0 -1
  176. package/treeselect/treeselect.esm.js +0 -1
  177. package/treetable/treetable.esm.js +0 -1
  178. package/tristatecheckbox/tristatecheckbox.esm.js +0 -1
  179. package/utils/utils.esm.js +0 -1
  180. package/virtualscroller/virtualscroller.esm.js +0 -1
  181. package/web-types.json +1 -1
  182. package/accordion/accordion.esm.min.mjs +0 -1
  183. package/accordion/accordion.esm.mjs +0 -420
  184. package/api/api.esm.min.mjs +0 -1
  185. package/api/api.esm.mjs +0 -943
  186. package/autocomplete/autocomplete.esm.min.mjs +0 -1
  187. package/autocomplete/autocomplete.esm.mjs +0 -1128
  188. package/avatar/avatar.esm.min.mjs +0 -1
  189. package/avatar/avatar.esm.mjs +0 -244
  190. package/avatargroup/avatargroup.esm.min.mjs +0 -1
  191. package/avatargroup/avatargroup.esm.mjs +0 -54
  192. package/badge/badge.esm.min.mjs +0 -1
  193. package/badge/badge.esm.mjs +0 -109
  194. package/blockui/blockui.esm.min.mjs +0 -1
  195. package/blockui/blockui.esm.mjs +0 -267
  196. package/breadcrumb/breadcrumb.esm.min.mjs +0 -1
  197. package/breadcrumb/breadcrumb.esm.mjs +0 -350
  198. package/button/button.esm.min.mjs +0 -1
  199. package/button/button.esm.mjs +0 -294
  200. package/calendar/calendar.esm.min.mjs +0 -1
  201. package/calendar/calendar.esm.mjs +0 -3474
  202. package/card/card.esm.min.mjs +0 -1
  203. package/card/card.esm.mjs +0 -97
  204. package/carousel/carousel.esm.min.mjs +0 -1
  205. package/carousel/carousel.esm.mjs +0 -800
  206. package/cascadeselect/cascadeselect.esm.min.mjs +0 -1
  207. package/cascadeselect/cascadeselect.esm.mjs +0 -818
  208. package/chart/chart.esm.min.mjs +0 -1
  209. package/chart/chart.esm.mjs +0 -154
  210. package/checkbox/checkbox.esm.min.mjs +0 -1
  211. package/checkbox/checkbox.esm.mjs +0 -356
  212. package/chip/chip.esm.min.mjs +0 -1
  213. package/chip/chip.esm.mjs +0 -247
  214. package/chips/chips.esm.min.mjs +0 -1
  215. package/chips/chips.esm.mjs +0 -500
  216. package/colorpicker/colorpicker.esm.min.mjs +0 -1
  217. package/colorpicker/colorpicker.esm.mjs +0 -787
  218. package/column/column.esm.min.mjs +0 -1
  219. package/column/column.esm.mjs +0 -7
  220. package/columngroup/columngroup.esm.min.mjs +0 -1
  221. package/columngroup/columngroup.esm.mjs +0 -5
  222. package/componentbase/componentbase.esm.min.mjs +0 -1
  223. package/componentbase/componentbase.esm.mjs +0 -328
  224. package/confirmdialog/confirmdialog.esm.min.mjs +0 -1
  225. package/confirmdialog/confirmdialog.esm.mjs +0 -375
  226. package/confirmpopup/confirmpopup.esm.min.mjs +0 -1
  227. package/confirmpopup/confirmpopup.esm.mjs +0 -609
  228. package/contextmenu/contextmenu.esm.min.mjs +0 -1
  229. package/contextmenu/contextmenu.esm.mjs +0 -663
  230. package/csstransition/csstransition.esm.min.mjs +0 -1
  231. package/csstransition/csstransition.esm.mjs +0 -137
  232. package/datascroller/datascroller.esm.min.mjs +0 -1
  233. package/datascroller/datascroller.esm.mjs +0 -319
  234. package/datatable/datatable.esm.min.mjs +0 -1
  235. package/datatable/datatable.esm.mjs +0 -6635
  236. package/dataview/dataview.esm.min.mjs +0 -1
  237. package/dataview/dataview.esm.mjs +0 -505
  238. package/deferredcontent/deferredcontent.esm.min.mjs +0 -1
  239. package/deferredcontent/deferredcontent.esm.mjs +0 -132
  240. package/dialog/dialog.esm.min.mjs +0 -1
  241. package/dialog/dialog.esm.mjs +0 -984
  242. package/divider/divider.esm.min.mjs +0 -1
  243. package/divider/divider.esm.mjs +0 -78
  244. package/dock/dock.esm.min.mjs +0 -1
  245. package/dock/dock.esm.mjs +0 -347
  246. package/dropdown/dropdown.esm.min.mjs +0 -1
  247. package/dropdown/dropdown.esm.mjs +0 -1379
  248. package/editor/editor.esm.min.mjs +0 -1
  249. package/editor/editor.esm.mjs +0 -337
  250. package/fieldset/fieldset.esm.min.mjs +0 -1
  251. package/fieldset/fieldset.esm.mjs +0 -269
  252. package/fileupload/fileupload.esm.min.mjs +0 -1
  253. package/fileupload/fileupload.esm.mjs +0 -1004
  254. package/galleria/galleria.esm.min.mjs +0 -1
  255. package/galleria/galleria.esm.mjs +0 -1094
  256. package/hooks/hooks.esm.min.mjs +0 -1
  257. package/hooks/hooks.esm.mjs +0 -1036
  258. package/iconbase/iconbase.esm.min.mjs +0 -1
  259. package/iconbase/iconbase.esm.mjs +0 -32
  260. package/icons/angledoubledown/index.esm.min.mjs +0 -1
  261. package/icons/angledoubledown/index.esm.mjs +0 -38
  262. package/icons/angledoubleleft/index.esm.min.mjs +0 -1
  263. package/icons/angledoubleleft/index.esm.mjs +0 -38
  264. package/icons/angledoubleright/index.esm.min.mjs +0 -1
  265. package/icons/angledoubleright/index.esm.mjs +0 -38
  266. package/icons/angledoubleup/index.esm.min.mjs +0 -1
  267. package/icons/angledoubleup/index.esm.mjs +0 -38
  268. package/icons/angledown/index.esm.min.mjs +0 -1
  269. package/icons/angledown/index.esm.mjs +0 -36
  270. package/icons/angleleft/index.esm.min.mjs +0 -1
  271. package/icons/angleleft/index.esm.mjs +0 -36
  272. package/icons/angleright/index.esm.min.mjs +0 -1
  273. package/icons/angleright/index.esm.mjs +0 -36
  274. package/icons/angleup/index.esm.min.mjs +0 -1
  275. package/icons/angleup/index.esm.mjs +0 -36
  276. package/icons/arrowdown/index.esm.min.mjs +0 -1
  277. package/icons/arrowdown/index.esm.mjs +0 -660
  278. package/icons/arrowup/index.esm.min.mjs +0 -1
  279. package/icons/arrowup/index.esm.mjs +0 -660
  280. package/icons/ban/index.esm.min.mjs +0 -1
  281. package/icons/ban/index.esm.mjs +0 -658
  282. package/icons/bars/index.esm.min.mjs +0 -1
  283. package/icons/bars/index.esm.mjs +0 -38
  284. package/icons/calendar/index.esm.min.mjs +0 -1
  285. package/icons/calendar/index.esm.mjs +0 -36
  286. package/icons/check/index.esm.min.mjs +0 -1
  287. package/icons/check/index.esm.mjs +0 -36
  288. package/icons/chevrondown/index.esm.min.mjs +0 -1
  289. package/icons/chevrondown/index.esm.mjs +0 -36
  290. package/icons/chevronleft/index.esm.min.mjs +0 -1
  291. package/icons/chevronleft/index.esm.mjs +0 -36
  292. package/icons/chevronright/index.esm.min.mjs +0 -1
  293. package/icons/chevronright/index.esm.mjs +0 -36
  294. package/icons/chevronup/index.esm.min.mjs +0 -1
  295. package/icons/chevronup/index.esm.mjs +0 -36
  296. package/icons/download/index.esm.min.mjs +0 -1
  297. package/icons/download/index.esm.mjs +0 -660
  298. package/icons/exclamationtriangle/index.esm.min.mjs +0 -1
  299. package/icons/exclamationtriangle/index.esm.mjs +0 -664
  300. package/icons/eye/index.esm.min.mjs +0 -1
  301. package/icons/eye/index.esm.mjs +0 -38
  302. package/icons/eyeslash/index.esm.min.mjs +0 -1
  303. package/icons/eyeslash/index.esm.mjs +0 -660
  304. package/icons/filter/index.esm.min.mjs +0 -1
  305. package/icons/filter/index.esm.mjs +0 -658
  306. package/icons/filterslash/index.esm.min.mjs +0 -1
  307. package/icons/filterslash/index.esm.mjs +0 -660
  308. package/icons/infocircle/index.esm.min.mjs +0 -1
  309. package/icons/infocircle/index.esm.mjs +0 -660
  310. package/icons/minus/index.esm.min.mjs +0 -1
  311. package/icons/minus/index.esm.mjs +0 -36
  312. package/icons/pencil/index.esm.min.mjs +0 -1
  313. package/icons/pencil/index.esm.mjs +0 -658
  314. package/icons/plus/index.esm.min.mjs +0 -1
  315. package/icons/plus/index.esm.mjs +0 -658
  316. package/icons/refresh/index.esm.min.mjs +0 -1
  317. package/icons/refresh/index.esm.mjs +0 -660
  318. package/icons/search/index.esm.min.mjs +0 -1
  319. package/icons/search/index.esm.mjs +0 -660
  320. package/icons/searchminus/index.esm.min.mjs +0 -1
  321. package/icons/searchminus/index.esm.mjs +0 -660
  322. package/icons/searchplus/index.esm.min.mjs +0 -1
  323. package/icons/searchplus/index.esm.mjs +0 -660
  324. package/icons/sortalt/index.esm.min.mjs +0 -1
  325. package/icons/sortalt/index.esm.mjs +0 -667
  326. package/icons/sortamountdown/index.esm.min.mjs +0 -1
  327. package/icons/sortamountdown/index.esm.mjs +0 -673
  328. package/icons/sortamountupalt/index.esm.min.mjs +0 -1
  329. package/icons/sortamountupalt/index.esm.mjs +0 -673
  330. package/icons/spinner/index.esm.min.mjs +0 -1
  331. package/icons/spinner/index.esm.mjs +0 -658
  332. package/icons/star/index.esm.min.mjs +0 -1
  333. package/icons/star/index.esm.mjs +0 -658
  334. package/icons/starfill/index.esm.min.mjs +0 -1
  335. package/icons/starfill/index.esm.mjs +0 -658
  336. package/icons/thlarge/index.esm.min.mjs +0 -1
  337. package/icons/thlarge/index.esm.mjs +0 -660
  338. package/icons/times/index.esm.min.mjs +0 -1
  339. package/icons/times/index.esm.mjs +0 -36
  340. package/icons/timescircle/index.esm.min.mjs +0 -1
  341. package/icons/timescircle/index.esm.mjs +0 -660
  342. package/icons/trash/index.esm.min.mjs +0 -1
  343. package/icons/trash/index.esm.mjs +0 -660
  344. package/icons/undo/index.esm.min.mjs +0 -1
  345. package/icons/undo/index.esm.mjs +0 -660
  346. package/icons/upload/index.esm.min.mjs +0 -1
  347. package/icons/upload/index.esm.mjs +0 -660
  348. package/icons/windowmaximize/index.esm.min.mjs +0 -1
  349. package/icons/windowmaximize/index.esm.mjs +0 -660
  350. package/icons/windowminimize/index.esm.min.mjs +0 -1
  351. package/icons/windowminimize/index.esm.mjs +0 -660
  352. package/image/image.esm.min.mjs +0 -1
  353. package/image/image.esm.mjs +0 -1163
  354. package/inplace/inplace.esm.min.mjs +0 -1
  355. package/inplace/inplace.esm.mjs +0 -242
  356. package/inputmask/inputmask.esm.min.mjs +0 -1
  357. package/inputmask/inputmask.esm.mjs +0 -559
  358. package/inputnumber/inputnumber.esm.min.mjs +0 -1
  359. package/inputnumber/inputnumber.esm.mjs +0 -1208
  360. package/inputswitch/inputswitch.esm.min.mjs +0 -1
  361. package/inputswitch/inputswitch.esm.mjs +0 -290
  362. package/inputtext/inputtext.esm.min.mjs +0 -1
  363. package/inputtext/inputtext.esm.mjs +0 -170
  364. package/inputtextarea/inputtextarea.esm.min.mjs +0 -1
  365. package/inputtextarea/inputtextarea.esm.mjs +0 -219
  366. package/keyfilter/keyfilter.esm.min.mjs +0 -1
  367. package/keyfilter/keyfilter.esm.mjs +0 -107
  368. package/knob/knob.esm.min.mjs +0 -1
  369. package/knob/knob.esm.mjs +0 -317
  370. package/listbox/listbox.esm.min.mjs +0 -1
  371. package/listbox/listbox.esm.mjs +0 -809
  372. package/megamenu/megamenu.esm.min.mjs +0 -1
  373. package/megamenu/megamenu.esm.mjs +0 -715
  374. package/mention/mention.esm.min.mjs +0 -1
  375. package/mention/mention.esm.mjs +0 -770
  376. package/menu/menu.esm.min.mjs +0 -1
  377. package/menu/menu.esm.mjs +0 -484
  378. package/menubar/menubar.esm.min.mjs +0 -1
  379. package/menubar/menubar.esm.mjs +0 -583
  380. package/message/message.esm.min.mjs +0 -1
  381. package/message/message.esm.mjs +0 -168
  382. package/messages/messages.esm.min.mjs +0 -1
  383. package/messages/messages.esm.mjs +0 -438
  384. package/multiselect/multiselect.esm.min.mjs +0 -1
  385. package/multiselect/multiselect.esm.mjs +0 -1723
  386. package/multistatecheckbox/multistatecheckbox.esm.min.mjs +0 -1
  387. package/multistatecheckbox/multistatecheckbox.esm.mjs +0 -351
  388. package/orderlist/orderlist.esm.min.mjs +0 -1
  389. package/orderlist/orderlist.esm.mjs +0 -820
  390. package/organizationchart/organizationchart.esm.min.mjs +0 -1
  391. package/organizationchart/organizationchart.esm.mjs +0 -479
  392. package/overlaypanel/overlaypanel.esm.min.mjs +0 -1
  393. package/overlaypanel/overlaypanel.esm.mjs +0 -515
  394. package/overlayservice/overlayservice.esm.min.mjs +0 -1
  395. package/overlayservice/overlayservice.esm.mjs +0 -6
  396. package/paginator/paginator.esm.min.mjs +0 -1
  397. package/paginator/paginator.esm.mjs +0 -932
  398. package/panel/panel.esm.min.mjs +0 -1
  399. package/panel/panel.esm.mjs +0 -315
  400. package/panelmenu/panelmenu.esm.min.mjs +0 -1
  401. package/panelmenu/panelmenu.esm.mjs +0 -644
  402. package/passthrough/index.esm.min.mjs +0 -1
  403. package/passthrough/index.esm.mjs +0 -70
  404. package/passthrough/tailwind/index.esm.min.mjs +0 -1
  405. package/passthrough/tailwind/index.esm.mjs +0 -3513
  406. package/password/password.esm.min.mjs +0 -1
  407. package/password/password.esm.mjs +0 -566
  408. package/picklist/picklist.esm.min.mjs +0 -1
  409. package/picklist/picklist.esm.mjs +0 -1118
  410. package/portal/portal.esm.min.mjs +0 -1
  411. package/portal/portal.esm.mjs +0 -109
  412. package/primereact.all.esm.min.mjs +0 -1
  413. package/primereact.all.esm.mjs +0 -51669
  414. package/progressbar/progressbar.esm.min.mjs +0 -1
  415. package/progressbar/progressbar.esm.mjs +0 -189
  416. package/progressspinner/progressspinner.esm.min.mjs +0 -1
  417. package/progressspinner/progressspinner.esm.mjs +0 -87
  418. package/radiobutton/radiobutton.esm.min.mjs +0 -1
  419. package/radiobutton/radiobutton.esm.mjs +0 -328
  420. package/rating/rating.esm.min.mjs +0 -1
  421. package/rating/rating.esm.mjs +0 -272
  422. package/ripple/ripple.esm.min.mjs +0 -1
  423. package/ripple/ripple.esm.mjs +0 -99
  424. package/row/row.esm.min.mjs +0 -1
  425. package/row/row.esm.mjs +0 -35
  426. package/scrollpanel/scrollpanel.esm.min.mjs +0 -1
  427. package/scrollpanel/scrollpanel.esm.mjs +0 -209
  428. package/scrolltop/scrolltop.esm.min.mjs +0 -1
  429. package/scrolltop/scrolltop.esm.mjs +0 -268
  430. package/selectbutton/selectbutton.esm.min.mjs +0 -1
  431. package/selectbutton/selectbutton.esm.mjs +0 -326
  432. package/sidebar/sidebar.esm.min.mjs +0 -1
  433. package/sidebar/sidebar.esm.mjs +0 -544
  434. package/skeleton/skeleton.esm.min.mjs +0 -1
  435. package/skeleton/skeleton.esm.mjs +0 -124
  436. package/slidemenu/slidemenu.esm.min.mjs +0 -1
  437. package/slidemenu/slidemenu.esm.mjs +0 -688
  438. package/slider/slider.esm.min.mjs +0 -1
  439. package/slider/slider.esm.mjs +0 -477
  440. package/speeddial/speeddial.esm.min.mjs +0 -1
  441. package/speeddial/speeddial.esm.mjs +0 -520
  442. package/splitbutton/splitbutton.esm.min.mjs +0 -1
  443. package/splitbutton/splitbutton.esm.mjs +0 -544
  444. package/splitter/splitter.esm.min.mjs +0 -1
  445. package/splitter/splitter.esm.mjs +0 -465
  446. package/steps/steps.esm.min.mjs +0 -1
  447. package/steps/steps.esm.mjs +0 -293
  448. package/styleclass/styleclass.esm.min.mjs +0 -1
  449. package/styleclass/styleclass.esm.mjs +0 -268
  450. package/tabmenu/tabmenu.esm.min.mjs +0 -1
  451. package/tabmenu/tabmenu.esm.mjs +0 -331
  452. package/tabview/tabview.esm.min.mjs +0 -1
  453. package/tabview/tabview.esm.mjs +0 -677
  454. package/tag/tag.esm.min.mjs +0 -1
  455. package/tag/tag.esm.mjs +0 -116
  456. package/terminal/terminal.esm.min.mjs +0 -1
  457. package/terminal/terminal.esm.mjs +0 -279
  458. package/terminalservice/terminalservice.esm.min.mjs +0 -1
  459. package/terminalservice/terminalservice.esm.mjs +0 -6
  460. package/tieredmenu/tieredmenu.esm.min.mjs +0 -1
  461. package/tieredmenu/tieredmenu.esm.mjs +0 -698
  462. package/timeline/timeline.esm.min.mjs +0 -1
  463. package/timeline/timeline.esm.mjs +0 -163
  464. package/toast/toast.esm.min.mjs +0 -1
  465. package/toast/toast.esm.mjs +0 -738
  466. package/togglebutton/togglebutton.esm.min.mjs +0 -1
  467. package/togglebutton/togglebutton.esm.mjs +0 -216
  468. package/toolbar/toolbar.esm.min.mjs +0 -1
  469. package/toolbar/toolbar.esm.mjs +0 -78
  470. package/tooltip/tooltip.esm.min.mjs +0 -1
  471. package/tooltip/tooltip.esm.mjs +0 -695
  472. package/tree/tree.esm.min.mjs +0 -1
  473. package/tree/tree.esm.mjs +0 -1402
  474. package/treeselect/treeselect.esm.min.mjs +0 -1
  475. package/treeselect/treeselect.esm.mjs +0 -929
  476. package/treetable/treetable.esm.min.mjs +0 -1
  477. package/treetable/treetable.esm.mjs +0 -3093
  478. package/tristatecheckbox/tristatecheckbox.esm.min.mjs +0 -1
  479. package/tristatecheckbox/tristatecheckbox.esm.mjs +0 -291
  480. package/utils/utils.esm.min.mjs +0 -1
  481. package/utils/utils.esm.mjs +0 -2382
  482. package/virtualscroller/virtualscroller.esm.min.mjs +0 -1
  483. package/virtualscroller/virtualscroller.esm.mjs +0 -971
@@ -1,1208 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import PrimeReact, { PrimeReactContext } from 'primereact/api';
4
- import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
5
- import { useMountEffect, useUpdateEffect } from 'primereact/hooks';
6
- import { AngleDownIcon } from 'primereact/icons/angledown';
7
- import { AngleUpIcon } from 'primereact/icons/angleup';
8
- import { InputText } from 'primereact/inputtext';
9
- import { Ripple } from 'primereact/ripple';
10
- import { Tooltip } from 'primereact/tooltip';
11
- import { classNames, DomHandler, ObjectUtils, mergeProps, IconUtils } from 'primereact/utils';
12
-
13
- function _extends() {
14
- _extends = Object.assign ? Object.assign.bind() : function (target) {
15
- for (var i = 1; i < arguments.length; i++) {
16
- var source = arguments[i];
17
- for (var key in source) {
18
- if (Object.prototype.hasOwnProperty.call(source, key)) {
19
- target[key] = source[key];
20
- }
21
- }
22
- }
23
- return target;
24
- };
25
- return _extends.apply(this, arguments);
26
- }
27
-
28
- function _arrayLikeToArray(arr, len) {
29
- if (len == null || len > arr.length) len = arr.length;
30
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
31
- return arr2;
32
- }
33
-
34
- function _arrayWithoutHoles(arr) {
35
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
36
- }
37
-
38
- function _iterableToArray(iter) {
39
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
40
- }
41
-
42
- function _unsupportedIterableToArray(o, minLen) {
43
- if (!o) return;
44
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
45
- var n = Object.prototype.toString.call(o).slice(8, -1);
46
- if (n === "Object" && o.constructor) n = o.constructor.name;
47
- if (n === "Map" || n === "Set") return Array.from(o);
48
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
49
- }
50
-
51
- function _nonIterableSpread() {
52
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
53
- }
54
-
55
- function _toConsumableArray(arr) {
56
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
57
- }
58
-
59
- function _typeof(o) {
60
- "@babel/helpers - typeof";
61
-
62
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
63
- return typeof o;
64
- } : function (o) {
65
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
66
- }, _typeof(o);
67
- }
68
-
69
- function _toPrimitive(input, hint) {
70
- if (_typeof(input) !== "object" || input === null) return input;
71
- var prim = input[Symbol.toPrimitive];
72
- if (prim !== undefined) {
73
- var res = prim.call(input, hint || "default");
74
- if (_typeof(res) !== "object") return res;
75
- throw new TypeError("@@toPrimitive must return a primitive value.");
76
- }
77
- return (hint === "string" ? String : Number)(input);
78
- }
79
-
80
- function _toPropertyKey(arg) {
81
- var key = _toPrimitive(arg, "string");
82
- return _typeof(key) === "symbol" ? key : String(key);
83
- }
84
-
85
- function _defineProperty(obj, key, value) {
86
- key = _toPropertyKey(key);
87
- if (key in obj) {
88
- Object.defineProperty(obj, key, {
89
- value: value,
90
- enumerable: true,
91
- configurable: true,
92
- writable: true
93
- });
94
- } else {
95
- obj[key] = value;
96
- }
97
- return obj;
98
- }
99
-
100
- function _arrayWithHoles(arr) {
101
- if (Array.isArray(arr)) return arr;
102
- }
103
-
104
- function _iterableToArrayLimit(r, l) {
105
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
106
- if (null != t) {
107
- var e,
108
- n,
109
- i,
110
- u,
111
- a = [],
112
- f = !0,
113
- o = !1;
114
- try {
115
- if (i = (t = t.call(r)).next, 0 === l) {
116
- if (Object(t) !== t) return;
117
- f = !1;
118
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
119
- } catch (r) {
120
- o = !0, n = r;
121
- } finally {
122
- try {
123
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
124
- } finally {
125
- if (o) throw n;
126
- }
127
- }
128
- return a;
129
- }
130
- }
131
-
132
- function _nonIterableRest() {
133
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
134
- }
135
-
136
- function _slicedToArray(arr, i) {
137
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
138
- }
139
-
140
- var classes = {
141
- root: function root(_ref) {
142
- var props = _ref.props,
143
- focusedState = _ref.focusedState,
144
- stacked = _ref.stacked,
145
- horizontal = _ref.horizontal,
146
- vertical = _ref.vertical;
147
- return classNames('p-inputnumber p-component p-inputwrapper', {
148
- 'p-inputwrapper-filled': props.value != null && props.value.toString().length > 0,
149
- 'p-inputwrapper-focus': focusedState,
150
- 'p-inputnumber-buttons-stacked': stacked,
151
- 'p-inputnumber-buttons-horizontal': horizontal,
152
- 'p-inputnumber-buttons-vertical': vertical
153
- });
154
- },
155
- buttonGroup: 'p-inputnumber-button-group',
156
- incrementButton: function incrementButton(_ref2) {
157
- var props = _ref2.props;
158
- return classNames('p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component', {
159
- 'p-disabled': props.disabled
160
- });
161
- },
162
- incrementIcon: 'p-button-icon',
163
- decrementButton: function decrementButton(_ref3) {
164
- var props = _ref3.props;
165
- return classNames('p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component', {
166
- 'p-disabled': props.disabled
167
- });
168
- },
169
- decrementIcon: 'p-button-icon'
170
- };
171
- var styles = "\n@layer primereact {\n .p-inputnumber {\n display: inline-flex;\n }\n \n .p-inputnumber-button {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n }\n \n .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,\n .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label {\n display: none;\n }\n \n .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 0;\n }\n \n .p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n \n .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n padding: 0;\n }\n \n .p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: flex;\n flex-direction: column;\n }\n \n .p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n flex: 1 1 auto;\n }\n \n .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n \n .p-inputnumber-buttons-horizontal .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n }\n \n .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n \n .p-inputnumber-buttons-vertical {\n flex-direction: column;\n }\n \n .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n }\n \n .p-inputnumber-buttons-vertical .p-inputnumber-input {\n order: 2;\n border-radius: 0;\n text-align: center;\n }\n \n .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n }\n \n .p-inputnumber-input {\n flex: 1 1 auto;\n }\n \n .p-fluid .p-inputnumber {\n width: 100%;\n }\n \n .p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n }\n \n .p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n }\n}\n";
172
- var InputNumberBase = ComponentBase.extend({
173
- defaultProps: {
174
- __TYPE: 'InputNumber',
175
- __parentMetadata: null,
176
- allowEmpty: true,
177
- ariaLabelledBy: null,
178
- autoFocus: false,
179
- buttonLayout: 'stacked',
180
- className: null,
181
- currency: undefined,
182
- currencyDisplay: undefined,
183
- decrementButtonClassName: null,
184
- decrementButtonIcon: null,
185
- disabled: false,
186
- format: true,
187
- id: null,
188
- incrementButtonClassName: null,
189
- incrementButtonIcon: null,
190
- inputClassName: null,
191
- inputId: null,
192
- inputMode: null,
193
- inputRef: null,
194
- inputStyle: null,
195
- locale: undefined,
196
- localeMatcher: undefined,
197
- max: null,
198
- maxFractionDigits: undefined,
199
- maxLength: null,
200
- min: null,
201
- minFractionDigits: undefined,
202
- mode: 'decimal',
203
- name: null,
204
- onBlur: null,
205
- onChange: null,
206
- onFocus: null,
207
- onKeyDown: null,
208
- onKeyUp: null,
209
- onValueChange: null,
210
- pattern: null,
211
- placeholder: null,
212
- prefix: null,
213
- readOnly: false,
214
- required: false,
215
- showButtons: false,
216
- size: null,
217
- step: 1,
218
- style: null,
219
- suffix: null,
220
- tabIndex: null,
221
- tooltip: null,
222
- tooltipOptions: null,
223
- type: 'text',
224
- useGrouping: true,
225
- value: null,
226
- children: undefined
227
- },
228
- css: {
229
- classes: classes,
230
- styles: styles
231
- }
232
- });
233
-
234
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
235
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
236
- var InputNumber = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
237
- var context = React.useContext(PrimeReactContext);
238
- var props = InputNumberBase.getProps(inProps, context);
239
- var _React$useState = React.useState(false),
240
- _React$useState2 = _slicedToArray(_React$useState, 2),
241
- focusedState = _React$useState2[0],
242
- setFocusedState = _React$useState2[1];
243
- var metaData = _objectSpread(_objectSpread({
244
- props: props
245
- }, props.__parentMetadata), {}, {
246
- state: {
247
- focused: focusedState
248
- }
249
- });
250
- var _InputNumberBase$setM = InputNumberBase.setMetaData(metaData),
251
- ptm = _InputNumberBase$setM.ptm,
252
- cx = _InputNumberBase$setM.cx,
253
- isUnstyled = _InputNumberBase$setM.isUnstyled;
254
- useHandleStyle(InputNumberBase.css.styles, isUnstyled, {
255
- name: 'inputnumber'
256
- });
257
- var elementRef = React.useRef(null);
258
- var inputRef = React.useRef(null);
259
- var timer = React.useRef(null);
260
- var lastValue = React.useRef(null);
261
- var numberFormat = React.useRef(null);
262
- var groupChar = React.useRef(null);
263
- var prefixChar = React.useRef(null);
264
- var suffixChar = React.useRef(null);
265
- var isSpecialChar = React.useRef(null);
266
- var _numeral = React.useRef(null);
267
- var _group = React.useRef(null);
268
- var _minusSign = React.useRef(null);
269
- var _currency = React.useRef(null);
270
- var _decimal = React.useRef(null);
271
- var _suffix = React.useRef(null);
272
- var _prefix = React.useRef(null);
273
- var _index = React.useRef(null);
274
- var _locale = props.locale || context && context.locale || PrimeReact.locale;
275
- var stacked = props.showButtons && props.buttonLayout === 'stacked';
276
- var horizontal = props.showButtons && props.buttonLayout === 'horizontal';
277
- var vertical = props.showButtons && props.buttonLayout === 'vertical';
278
- var inputMode = props.inputMode || (props.mode === 'decimal' && !props.minFractionDigits ? 'numeric' : 'decimal');
279
- var getOptions = function getOptions() {
280
- return {
281
- localeMatcher: props.localeMatcher,
282
- style: props.mode,
283
- currency: props.currency,
284
- currencyDisplay: props.currencyDisplay,
285
- useGrouping: props.useGrouping,
286
- minimumFractionDigits: props.minFractionDigits,
287
- maximumFractionDigits: props.maxFractionDigits
288
- };
289
- };
290
- var constructParser = function constructParser() {
291
- numberFormat.current = new Intl.NumberFormat(_locale, getOptions());
292
- var numerals = _toConsumableArray(new Intl.NumberFormat(_locale, {
293
- useGrouping: false
294
- }).format(9876543210)).reverse();
295
- var index = new Map(numerals.map(function (d, i) {
296
- return [d, i];
297
- }));
298
- _numeral.current = new RegExp("[".concat(numerals.join(''), "]"), 'g');
299
- _group.current = getGroupingExpression();
300
- _minusSign.current = getMinusSignExpression();
301
- _currency.current = getCurrencyExpression();
302
- _decimal.current = getDecimalExpression();
303
- _suffix.current = getSuffixExpression();
304
- _prefix.current = getPrefixExpression();
305
- _index.current = function (d) {
306
- return index.get(d);
307
- };
308
- };
309
- var escapeRegExp = function escapeRegExp(text) {
310
- return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
311
- };
312
- var getDecimalExpression = function getDecimalExpression() {
313
- var formatter = new Intl.NumberFormat(_locale, _objectSpread(_objectSpread({}, getOptions()), {}, {
314
- useGrouping: false
315
- }));
316
- return new RegExp("[".concat(formatter.format(1.1).replace(_currency.current, '').trim().replace(_numeral.current, ''), "]"), 'g');
317
- };
318
- var getGroupingExpression = function getGroupingExpression() {
319
- var formatter = new Intl.NumberFormat(_locale, {
320
- useGrouping: true
321
- });
322
- groupChar.current = formatter.format(1000000).trim().replace(_numeral.current, '').charAt(0);
323
- return new RegExp("[".concat(groupChar.current, "]"), 'g');
324
- };
325
- var getMinusSignExpression = function getMinusSignExpression() {
326
- var formatter = new Intl.NumberFormat(_locale, {
327
- useGrouping: false
328
- });
329
- return new RegExp("[".concat(formatter.format(-1).trim().replace(_numeral.current, ''), "]"), 'g');
330
- };
331
- var getCurrencyExpression = function getCurrencyExpression() {
332
- if (props.currency) {
333
- var formatter = new Intl.NumberFormat(_locale, {
334
- style: 'currency',
335
- currency: props.currency,
336
- currencyDisplay: props.currencyDisplay,
337
- minimumFractionDigits: 0,
338
- maximumFractionDigits: 0
339
- });
340
- return new RegExp("[".concat(formatter.format(1).replace(/\s/g, '').replace(_numeral.current, '').replace(_group.current, ''), "]"), 'g');
341
- }
342
- return new RegExp("[]", 'g');
343
- };
344
- var getPrefixExpression = function getPrefixExpression() {
345
- if (props.prefix) {
346
- prefixChar.current = props.prefix;
347
- } else {
348
- var formatter = new Intl.NumberFormat(_locale, {
349
- style: props.mode,
350
- currency: props.currency,
351
- currencyDisplay: props.currencyDisplay
352
- });
353
- prefixChar.current = formatter.format(1).split('1')[0];
354
- }
355
- return new RegExp("".concat(escapeRegExp(prefixChar.current || '')), 'g');
356
- };
357
- var getSuffixExpression = function getSuffixExpression() {
358
- if (props.suffix) {
359
- suffixChar.current = props.suffix;
360
- } else {
361
- var formatter = new Intl.NumberFormat(_locale, {
362
- style: props.mode,
363
- currency: props.currency,
364
- currencyDisplay: props.currencyDisplay,
365
- minimumFractionDigits: 0,
366
- maximumFractionDigits: 0
367
- });
368
- suffixChar.current = formatter.format(1).split('1')[1];
369
- }
370
- return new RegExp("".concat(escapeRegExp(suffixChar.current || '')), 'g');
371
- };
372
- var formatValue = function formatValue(value) {
373
- if (value != null) {
374
- if (value === '-') {
375
- // Minus sign
376
- return value;
377
- }
378
- if (props.format) {
379
- var formatter = new Intl.NumberFormat(_locale, getOptions());
380
- var _formattedValue = formatter.format(value);
381
- if (props.prefix) {
382
- _formattedValue = props.prefix + _formattedValue;
383
- }
384
- if (props.suffix) {
385
- _formattedValue = _formattedValue + props.suffix;
386
- }
387
- return _formattedValue;
388
- }
389
- return value.toString();
390
- }
391
- return '';
392
- };
393
- var parseValue = function parseValue(text) {
394
- var filteredText = text.replace(_suffix.current, '').replace(_prefix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '').replace(_group.current, '').replace(_minusSign.current, '-').replace(_decimal.current, '.').replace(_numeral.current, _index.current);
395
- if (filteredText) {
396
- if (filteredText === '-')
397
- // Minus sign
398
- return filteredText;
399
- var parsedValue = +filteredText;
400
- return isNaN(parsedValue) ? null : parsedValue;
401
- }
402
- return null;
403
- };
404
- var repeat = function repeat(event, interval, dir) {
405
- var i = interval || 500;
406
- clearTimer();
407
- timer.current = setTimeout(function () {
408
- repeat(event, 40, dir);
409
- }, i);
410
- spin(event, dir);
411
- };
412
- var spin = function spin(event, dir) {
413
- if (inputRef.current) {
414
- var step = props.step * dir;
415
- var currentValue = parseValue(inputRef.current.value) || 0;
416
- var newValue = validateValue(currentValue + step);
417
- if (props.maxLength && props.maxLength < formatValue(newValue).length) {
418
- return;
419
- }
420
-
421
- // #3913 onChange should be called before onValueChange
422
- handleOnChange(event, currentValue, newValue);
423
- // touch devices trigger the keyboard to display because of setSelectionRange
424
- !DomHandler.isTouchDevice() && updateInput(newValue, null, 'spin');
425
- updateModel(event, newValue);
426
- }
427
- };
428
- var onUpButtonMouseDown = function onUpButtonMouseDown(event) {
429
- if (!props.disabled && !props.readOnly) {
430
- props.autoFocus && DomHandler.focus(inputRef.current, props.autoFocus);
431
- repeat(event, null, 1);
432
- }
433
- };
434
- var onUpButtonMouseUp = function onUpButtonMouseUp() {
435
- if (!props.disabled && !props.readOnly) {
436
- clearTimer();
437
- }
438
- };
439
- var onUpButtonMouseLeave = function onUpButtonMouseLeave() {
440
- if (!props.disabled && !props.readOnly) {
441
- clearTimer();
442
- }
443
- };
444
- var onUpButtonKeyUp = function onUpButtonKeyUp() {
445
- if (!props.disabled && !props.readOnly) {
446
- clearTimer();
447
- }
448
- };
449
- var onUpButtonKeyDown = function onUpButtonKeyDown(event) {
450
- if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
451
- repeat(event, null, 1);
452
- }
453
- };
454
- var onDownButtonMouseDown = function onDownButtonMouseDown(event) {
455
- if (!props.disabled && !props.readOnly) {
456
- props.autoFocus && DomHandler.focus(inputRef.current, props.autoFocus);
457
- repeat(event, null, -1);
458
- }
459
- };
460
- var onDownButtonMouseUp = function onDownButtonMouseUp() {
461
- if (!props.disabled && !props.readOnly) {
462
- clearTimer();
463
- }
464
- };
465
- var onDownButtonMouseLeave = function onDownButtonMouseLeave() {
466
- if (!props.disabled && !props.readOnly) {
467
- clearTimer();
468
- }
469
- };
470
- var onDownButtonKeyUp = function onDownButtonKeyUp() {
471
- if (!props.disabled && !props.readOnly) {
472
- clearTimer();
473
- }
474
- };
475
- var onDownButtonKeyDown = function onDownButtonKeyDown(event) {
476
- if (!props.disabled && !props.readOnly && (event.keyCode === 32 || event.keyCode === 13)) {
477
- repeat(event, null, -1);
478
- }
479
- };
480
- var onInput = function onInput(event) {
481
- if (props.disabled || props.readOnly) {
482
- return;
483
- }
484
- if (isSpecialChar.current) {
485
- event.target.value = lastValue.current;
486
- }
487
- isSpecialChar.current = false;
488
- };
489
- var onInputKeyDown = function onInputKeyDown(event) {
490
- if (props.disabled || props.readOnly) {
491
- return;
492
- }
493
- if (props.onKeyDown) {
494
- props.onKeyDown(event);
495
-
496
- // do not continue if the user defined event wants to prevent
497
- if (event.defaultPrevented) {
498
- return;
499
- }
500
- }
501
- lastValue.current = event.target.value;
502
- if (event.shiftKey || event.altKey) {
503
- isSpecialChar.current = true;
504
- return;
505
- }
506
- var selectionStart = event.target.selectionStart;
507
- var selectionEnd = event.target.selectionEnd;
508
- var inputValue = event.target.value;
509
- var newValueStr = null;
510
- if (event.altKey) {
511
- event.preventDefault();
512
- }
513
- switch (event.which) {
514
- //up
515
- case 38:
516
- spin(event, 1);
517
- event.preventDefault();
518
- break;
519
-
520
- //down
521
- case 40:
522
- spin(event, -1);
523
- event.preventDefault();
524
- break;
525
-
526
- //left
527
- case 37:
528
- if (!isNumeralChar(inputValue.charAt(selectionStart - 1))) {
529
- event.preventDefault();
530
- }
531
- break;
532
-
533
- //right
534
- case 39:
535
- if (!isNumeralChar(inputValue.charAt(selectionStart))) {
536
- event.preventDefault();
537
- }
538
- break;
539
-
540
- //enter and tab
541
- case 13:
542
- case 9:
543
- newValueStr = validateValue(parseValue(inputValue));
544
- inputRef.current.value = formatValue(newValueStr);
545
- inputRef.current.setAttribute('aria-valuenow', newValueStr);
546
- updateModel(event, newValueStr);
547
- break;
548
-
549
- //backspace
550
- case 8:
551
- event.preventDefault();
552
- if (selectionStart === selectionEnd) {
553
- var deleteChar = inputValue.charAt(selectionStart - 1);
554
- if (isNumeralChar(deleteChar)) {
555
- var _getDecimalCharIndexe = getDecimalCharIndexes(inputValue),
556
- decimalCharIndex = _getDecimalCharIndexe.decimalCharIndex,
557
- decimalCharIndexWithoutPrefix = _getDecimalCharIndexe.decimalCharIndexWithoutPrefix;
558
- var decimalLength = getDecimalLength(inputValue);
559
- if (_group.current.test(deleteChar)) {
560
- _group.current.lastIndex = 0;
561
- newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);
562
- } else if (_decimal.current.test(deleteChar)) {
563
- _decimal.current.lastIndex = 0;
564
- if (decimalLength) {
565
- inputRef.current.setSelectionRange(selectionStart - 1, selectionStart - 1);
566
- } else {
567
- newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
568
- }
569
- } else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
570
- var insertedText = isDecimalMode() && (props.minFractionDigits || 0) < decimalLength ? '' : '0';
571
- newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);
572
- } else if (decimalCharIndexWithoutPrefix === 1) {
573
- newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart);
574
- newValueStr = parseValue(newValueStr) > 0 ? newValueStr : '';
575
- } else {
576
- newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);
577
- }
578
- } else if (_currency.current.test(deleteChar)) {
579
- var _getCharIndexes = getCharIndexes(inputValue),
580
- minusCharIndex = _getCharIndexes.minusCharIndex,
581
- currencyCharIndex = _getCharIndexes.currencyCharIndex;
582
- if (minusCharIndex === currencyCharIndex - 1) {
583
- newValueStr = inputValue.slice(0, minusCharIndex) + inputValue.slice(selectionStart);
584
- }
585
- }
586
- updateValue(event, newValueStr, null, 'delete-single');
587
- } else {
588
- newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
589
- updateValue(event, newValueStr, null, 'delete-range');
590
- }
591
- break;
592
-
593
- // del
594
- case 46:
595
- event.preventDefault();
596
- if (selectionStart === selectionEnd) {
597
- var _deleteChar = inputValue.charAt(selectionStart);
598
- var _getDecimalCharIndexe2 = getDecimalCharIndexes(inputValue),
599
- _decimalCharIndex = _getDecimalCharIndexe2.decimalCharIndex,
600
- _decimalCharIndexWithoutPrefix = _getDecimalCharIndexe2.decimalCharIndexWithoutPrefix;
601
- if (isNumeralChar(_deleteChar)) {
602
- var _decimalLength = getDecimalLength(inputValue);
603
- if (_group.current.test(_deleteChar)) {
604
- _group.current.lastIndex = 0;
605
- newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);
606
- } else if (_decimal.current.test(_deleteChar)) {
607
- _decimal.current.lastIndex = 0;
608
- if (_decimalLength) {
609
- inputRef.current.setSelectionRange(selectionStart + 1, selectionStart + 1);
610
- } else {
611
- newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
612
- }
613
- } else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {
614
- var _insertedText = isDecimalMode() && (props.minFractionDigits || 0) < _decimalLength ? '' : '0';
615
- newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);
616
- } else if (_decimalCharIndexWithoutPrefix === 1) {
617
- newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
618
- newValueStr = parseValue(newValueStr) > 0 ? newValueStr : '';
619
- } else {
620
- newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);
621
- }
622
- }
623
- updateValue(event, newValueStr, null, 'delete-back-single');
624
- } else {
625
- newValueStr = deleteRange(inputValue, selectionStart, selectionEnd);
626
- updateValue(event, newValueStr, null, 'delete-range');
627
- }
628
- break;
629
- }
630
- };
631
- var onInputKeyUp = function onInputKeyUp(event) {
632
- if (props.disabled || props.readOnly) {
633
- return;
634
- }
635
- if (props.onKeyUp) {
636
- props.onKeyUp(event);
637
-
638
- // do not continue if the user defined event wants to prevent
639
- if (event.defaultPrevented) {
640
- return;
641
- }
642
- }
643
- var code = event.which || event.keyCode;
644
- if (code !== 13) {
645
- // to submit a form
646
- event.preventDefault();
647
- }
648
- var _char = String.fromCharCode(code);
649
- var _isDecimalSign = isDecimalSign(_char);
650
- var _isMinusSign = isMinusSign(_char);
651
- if (48 <= code && code <= 57 || _isMinusSign || _isDecimalSign) {
652
- insert(event, _char, {
653
- isDecimalSign: _isDecimalSign,
654
- isMinusSign: _isMinusSign
655
- });
656
- }
657
- };
658
- var onPaste = function onPaste(event) {
659
- event.preventDefault();
660
- if (props.disabled || props.readOnly) {
661
- return;
662
- }
663
- var data = (event.clipboardData || window['clipboardData']).getData('Text');
664
- if (data) {
665
- var filteredData = parseValue(data);
666
- if (filteredData != null) {
667
- insert(event, filteredData.toString());
668
- }
669
- }
670
- };
671
- var allowMinusSign = function allowMinusSign() {
672
- return ObjectUtils.isEmpty(props.min) || props.min < 0;
673
- };
674
- var isMinusSign = function isMinusSign(_char2) {
675
- if (_minusSign.current.test(_char2) || _char2 === '-') {
676
- _minusSign.current.lastIndex = 0;
677
- return true;
678
- }
679
- return false;
680
- };
681
- var isDecimalSign = function isDecimalSign(_char3) {
682
- if (_decimal.current.test(_char3)) {
683
- _decimal.current.lastIndex = 0;
684
- return true;
685
- }
686
- return false;
687
- };
688
- var isDecimalMode = function isDecimalMode() {
689
- return props.mode === 'decimal';
690
- };
691
- var getDecimalCharIndexes = function getDecimalCharIndexes(val) {
692
- var decimalCharIndex = val.search(_decimal.current);
693
- _decimal.current.lastIndex = 0;
694
- var filteredVal = val.replace(_prefix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '');
695
- var decimalCharIndexWithoutPrefix = filteredVal.search(_decimal.current);
696
- _decimal.current.lastIndex = 0;
697
- return {
698
- decimalCharIndex: decimalCharIndex,
699
- decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix
700
- };
701
- };
702
- var getCharIndexes = function getCharIndexes(val) {
703
- var decimalCharIndex = val.search(_decimal.current);
704
- _decimal.current.lastIndex = 0;
705
- var minusCharIndex = val.search(_minusSign.current);
706
- _minusSign.current.lastIndex = 0;
707
- var suffixCharIndex = val.search(_suffix.current);
708
- _suffix.current.lastIndex = 0;
709
- var currencyCharIndex = val.search(_currency.current);
710
- _currency.current.lastIndex = 0;
711
- return {
712
- decimalCharIndex: decimalCharIndex,
713
- minusCharIndex: minusCharIndex,
714
- suffixCharIndex: suffixCharIndex,
715
- currencyCharIndex: currencyCharIndex
716
- };
717
- };
718
- var insert = function insert(event, text) {
719
- var sign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
720
- isDecimalSign: false,
721
- isMinusSign: false
722
- };
723
- var minusCharIndexOnText = text.search(_minusSign.current);
724
- _minusSign.current.lastIndex = 0;
725
- if (!allowMinusSign() && minusCharIndexOnText !== -1) {
726
- return;
727
- }
728
- var selectionStart = inputRef.current.selectionStart;
729
- var selectionEnd = inputRef.current.selectionEnd;
730
- var inputValue = inputRef.current.value.trim();
731
- var _getCharIndexes2 = getCharIndexes(inputValue),
732
- decimalCharIndex = _getCharIndexes2.decimalCharIndex,
733
- minusCharIndex = _getCharIndexes2.minusCharIndex,
734
- suffixCharIndex = _getCharIndexes2.suffixCharIndex,
735
- currencyCharIndex = _getCharIndexes2.currencyCharIndex;
736
- var newValueStr;
737
- if (sign.isMinusSign) {
738
- var isNewMinusSign = minusCharIndex === -1;
739
- if (isNewMinusSign && (selectionStart === 0 || selectionStart === currencyCharIndex + 1)) {
740
- newValueStr = inputValue;
741
- if (isNewMinusSign || selectionEnd !== 0) {
742
- newValueStr = insertText(inputValue, text, 0, selectionEnd);
743
- }
744
- updateValue(event, newValueStr, text, 'insert');
745
- }
746
- } else if (sign.isDecimalSign) {
747
- if (decimalCharIndex > 0 && selectionStart === decimalCharIndex) {
748
- updateValue(event, inputValue, text, 'insert');
749
- } else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) {
750
- newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
751
- updateValue(event, newValueStr, text, 'insert');
752
- } else if (decimalCharIndex === -1 && props.maxFractionDigits) {
753
- newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
754
- updateValue(event, newValueStr, text, 'insert');
755
- }
756
- } else {
757
- var maxFractionDigits = numberFormat.current.resolvedOptions().maximumFractionDigits;
758
- var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';
759
- if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
760
- if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {
761
- var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;
762
- newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex);
763
- updateValue(event, newValueStr, text, operation);
764
- }
765
- } else {
766
- newValueStr = insertText(inputValue, text, selectionStart, selectionEnd);
767
- updateValue(event, newValueStr, text, operation);
768
- }
769
- }
770
- };
771
- var insertText = function insertText(value, text, start, end) {
772
- var textSplit = text === '.' ? text : text.split('.');
773
- if (textSplit.length === 2) {
774
- var decimalCharIndex = value.slice(start, end).search(_decimal.current);
775
- _decimal.current.lastIndex = 0;
776
- return decimalCharIndex > 0 ? value.slice(0, start) + formatValue(text) + value.slice(end) : value || formatValue(text);
777
- } else if (end - start === value.length) {
778
- return formatValue(text);
779
- } else if (start === 0) {
780
- var suffix = ObjectUtils.isLetter(value[end]) ? end - 1 : end;
781
- return text + value.slice(suffix);
782
- } else if (end === value.length) {
783
- return value.slice(0, start) + text;
784
- } else {
785
- return value.slice(0, start) + text + value.slice(end);
786
- }
787
- };
788
- var deleteRange = function deleteRange(value, start, end) {
789
- var newValueStr;
790
- if (end - start === value.length) newValueStr = '';else if (start === 0) newValueStr = value.slice(end);else if (end === value.length) newValueStr = value.slice(0, start);else newValueStr = value.slice(0, start) + value.slice(end);
791
- return newValueStr;
792
- };
793
- var initCursor = function initCursor() {
794
- var selectionStart = inputRef.current.selectionStart;
795
- var inputValue = inputRef.current.value;
796
- var valueLength = inputValue.length;
797
- var index = null;
798
-
799
- // remove prefix
800
- var prefixLength = (prefixChar.current || '').length;
801
- inputValue = inputValue.replace(_prefix.current, '');
802
- selectionStart = selectionStart - prefixLength;
803
- var _char4 = inputValue.charAt(selectionStart);
804
- if (isNumeralChar(_char4)) {
805
- return selectionStart + prefixLength;
806
- }
807
-
808
- //left
809
- var i = selectionStart - 1;
810
- while (i >= 0) {
811
- _char4 = inputValue.charAt(i);
812
- if (isNumeralChar(_char4)) {
813
- index = i + prefixLength;
814
- break;
815
- } else {
816
- i--;
817
- }
818
- }
819
- if (index !== null) {
820
- inputRef.current.setSelectionRange(index + 1, index + 1);
821
- } else {
822
- i = selectionStart;
823
- while (i < valueLength) {
824
- _char4 = inputValue.charAt(i);
825
- if (isNumeralChar(_char4)) {
826
- index = i + prefixLength;
827
- break;
828
- } else {
829
- i++;
830
- }
831
- }
832
- if (index !== null) {
833
- inputRef.current.setSelectionRange(index, index);
834
- }
835
- }
836
- return index || 0;
837
- };
838
- var onInputClick = function onInputClick() {
839
- initCursor();
840
- };
841
- var isNumeralChar = function isNumeralChar(_char5) {
842
- if (_char5.length === 1 && (_numeral.current.test(_char5) || _decimal.current.test(_char5) || _group.current.test(_char5) || _minusSign.current.test(_char5))) {
843
- resetRegex();
844
- return true;
845
- } else {
846
- return false;
847
- }
848
- };
849
- var resetRegex = function resetRegex() {
850
- _numeral.current.lastIndex = 0;
851
- _decimal.current.lastIndex = 0;
852
- _group.current.lastIndex = 0;
853
- _minusSign.current.lastIndex = 0;
854
- };
855
- var updateValue = function updateValue(event, valueStr, insertedValueStr, operation) {
856
- var currentValue = inputRef.current.value;
857
- var newValue = null;
858
- if (valueStr != null) {
859
- newValue = evaluateEmpty(parseValue(valueStr));
860
- updateInput(newValue, insertedValueStr, operation, valueStr);
861
- handleOnChange(event, currentValue, newValue);
862
- }
863
- };
864
- var evaluateEmpty = function evaluateEmpty(newValue) {
865
- return !newValue && !props.allowEmpty ? props.min || 0 : newValue;
866
- };
867
- var handleOnChange = function handleOnChange(event, currentValue, newValue) {
868
- if (props.onChange && isValueChanged(currentValue, newValue)) {
869
- props.onChange({
870
- originalEvent: event,
871
- value: newValue
872
- });
873
- }
874
- };
875
- var isValueChanged = function isValueChanged(currentValue, newValue) {
876
- if (newValue === null && currentValue !== null) {
877
- return true;
878
- }
879
- if (newValue != null) {
880
- var parsedCurrentValue = typeof currentValue === 'string' ? parseValue(currentValue) : currentValue;
881
- return newValue !== parsedCurrentValue;
882
- }
883
- return false;
884
- };
885
- var validateValue = function validateValue(value) {
886
- if (value === '-') {
887
- return null;
888
- }
889
- return validateValueByLimit(value);
890
- };
891
- var validateValueByLimit = function validateValueByLimit(value) {
892
- if (ObjectUtils.isEmpty(value)) {
893
- return null;
894
- }
895
- if (props.min !== null && value < props.min) {
896
- return props.min;
897
- }
898
- if (props.max !== null && value > props.max) {
899
- return props.max;
900
- }
901
- return value;
902
- };
903
- var updateInput = function updateInput(value, insertedValueStr, operation, valueStr) {
904
- insertedValueStr = insertedValueStr || '';
905
- var inputEl = inputRef.current;
906
- var inputValue = inputEl.value;
907
- var newValue = formatValue(value);
908
- var currentLength = inputValue.length;
909
- if (newValue !== valueStr) {
910
- newValue = concatValues(newValue, valueStr);
911
- }
912
- if (currentLength === 0) {
913
- inputEl.value = newValue;
914
- inputEl.setSelectionRange(0, 0);
915
- var index = initCursor();
916
- var selectionEnd = index + insertedValueStr.length;
917
- inputEl.setSelectionRange(selectionEnd, selectionEnd);
918
- } else {
919
- var selectionStart = inputEl.selectionStart;
920
- var _selectionEnd = inputEl.selectionEnd;
921
- if (props.maxLength && props.maxLength < newValue.length) {
922
- return;
923
- }
924
- inputEl.value = newValue;
925
- var newLength = newValue.length;
926
- if (operation === 'range-insert') {
927
- var startValue = parseValue((inputValue || '').slice(0, selectionStart));
928
- var startValueStr = startValue !== null ? startValue.toString() : '';
929
- var startExpr = startValueStr.split('').join("(".concat(groupChar.current, ")?"));
930
- var sRegex = new RegExp(startExpr, 'g');
931
- sRegex.test(newValue);
932
- var tExpr = insertedValueStr.split('').join("(".concat(groupChar.current, ")?"));
933
- var tRegex = new RegExp(tExpr, 'g');
934
- tRegex.test(newValue.slice(sRegex.lastIndex));
935
- _selectionEnd = sRegex.lastIndex + tRegex.lastIndex;
936
- inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
937
- } else if (newLength === currentLength) {
938
- if (operation === 'insert' || operation === 'delete-back-single') inputEl.setSelectionRange(_selectionEnd + 1, _selectionEnd + 1);else if (operation === 'delete-single') inputEl.setSelectionRange(_selectionEnd - 1, _selectionEnd - 1);else if (operation === 'delete-range' || operation === 'spin') inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
939
- } else if (operation === 'delete-back-single') {
940
- var prevChar = inputValue.charAt(_selectionEnd - 1);
941
- var nextChar = inputValue.charAt(_selectionEnd);
942
- var diff = currentLength - newLength;
943
- var isGroupChar = _group.current.test(nextChar);
944
- if (isGroupChar && diff === 1) {
945
- _selectionEnd += 1;
946
- } else if (!isGroupChar && isNumeralChar(prevChar)) {
947
- _selectionEnd += -1 * diff + 1;
948
- }
949
- _group.current.lastIndex = 0;
950
- inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
951
- } else if (inputValue === '-' && operation === 'insert') {
952
- inputEl.setSelectionRange(0, 0);
953
- var _index2 = initCursor();
954
- var _selectionEnd2 = _index2 + insertedValueStr.length + 1;
955
- inputEl.setSelectionRange(_selectionEnd2, _selectionEnd2);
956
- } else {
957
- _selectionEnd = _selectionEnd + (newLength - currentLength);
958
- inputEl.setSelectionRange(_selectionEnd, _selectionEnd);
959
- }
960
- }
961
- inputEl.setAttribute('aria-valuenow', value);
962
- };
963
- var updateInputValue = function updateInputValue(newValue) {
964
- newValue = evaluateEmpty(newValue);
965
- var inputEl = inputRef.current;
966
- var value = inputEl.value;
967
- var _formattedValue = formattedValue(newValue);
968
- if (value !== _formattedValue) {
969
- inputEl.value = _formattedValue;
970
- inputEl.setAttribute('aria-valuenow', newValue);
971
- }
972
- };
973
- var formattedValue = function formattedValue(val) {
974
- return formatValue(evaluateEmpty(val));
975
- };
976
- var concatValues = function concatValues(val1, val2) {
977
- if (val1 && val2) {
978
- var decimalCharIndex = val2.search(_decimal.current);
979
- _decimal.current.lastIndex = 0;
980
- return decimalCharIndex !== -1 ? val1.split(_decimal.current)[0] + val2.slice(decimalCharIndex) : val1;
981
- }
982
- return val1;
983
- };
984
- var getDecimalLength = function getDecimalLength(value) {
985
- if (value) {
986
- var valueSplit = value.split(_decimal.current);
987
- if (valueSplit.length === 2) {
988
- return valueSplit[1].replace(_suffix.current, '').trim().replace(/\s/g, '').replace(_currency.current, '').length;
989
- }
990
- }
991
- return 0;
992
- };
993
- var updateModel = function updateModel(event, value) {
994
- if (props.onValueChange) {
995
- props.onValueChange({
996
- originalEvent: event,
997
- value: value,
998
- stopPropagation: function stopPropagation() {
999
- event.stopPropagation();
1000
- },
1001
- preventDefault: function preventDefault() {
1002
- event.preventDefault();
1003
- },
1004
- target: {
1005
- name: props.name,
1006
- id: props.id,
1007
- value: value
1008
- }
1009
- });
1010
- }
1011
- };
1012
- var onInputFocus = function onInputFocus(event) {
1013
- setFocusedState(true);
1014
- props.onFocus && props.onFocus(event);
1015
- if ((props.suffix || props.currency || props.prefix) && inputRef.current) {
1016
- // GitHub #1866 Cursor must be placed before/after symbol or arrow keys don't work
1017
- var selectionEnd = initCursor();
1018
- inputRef.current.setSelectionRange(selectionEnd, selectionEnd);
1019
- }
1020
- };
1021
- var onInputBlur = function onInputBlur(event) {
1022
- setFocusedState(false);
1023
- if (inputRef.current) {
1024
- var currentValue = inputRef.current.value;
1025
- if (isValueChanged(currentValue, props.value)) {
1026
- var newValue = validateValue(parseValue(currentValue));
1027
- updateInputValue(newValue);
1028
- updateModel(event, newValue);
1029
- }
1030
- }
1031
- props.onBlur && props.onBlur(event);
1032
- };
1033
- var clearTimer = function clearTimer() {
1034
- if (timer.current) {
1035
- clearInterval(timer.current);
1036
- }
1037
- };
1038
- var changeValue = function changeValue() {
1039
- updateInputValue(validateValueByLimit(props.value));
1040
- var newValue = validateValue(props.value);
1041
- if (props.value !== null && props.value !== newValue) {
1042
- updateModel(null, newValue);
1043
- }
1044
- };
1045
- var getFormatter = function getFormatter() {
1046
- return numberFormat.current;
1047
- };
1048
- React.useImperativeHandle(ref, function () {
1049
- return {
1050
- props: props,
1051
- focus: function focus() {
1052
- return DomHandler.focus(inputRef.current);
1053
- },
1054
- getFormatter: getFormatter,
1055
- getElement: function getElement() {
1056
- return elementRef.current;
1057
- },
1058
- getInput: function getInput() {
1059
- return inputRef.current;
1060
- }
1061
- };
1062
- });
1063
- React.useEffect(function () {
1064
- ObjectUtils.combinedRefs(inputRef, props.inputRef);
1065
- }, [inputRef, props.inputRef]);
1066
- useMountEffect(function () {
1067
- constructParser();
1068
- var newValue = validateValue(props.value);
1069
- if (props.value !== null && props.value !== newValue) {
1070
- updateModel(null, newValue);
1071
- }
1072
- });
1073
- useUpdateEffect(function () {
1074
- constructParser();
1075
- changeValue();
1076
- }, [props.locale, props.localeMatcher, props.mode, props.currency, props.currencyDisplay, props.useGrouping, props.minFractionDigits, props.maxFractionDigits, props.suffix, props.prefix]);
1077
- useUpdateEffect(function () {
1078
- changeValue();
1079
- }, [props.value]);
1080
- var createInputElement = function createInputElement() {
1081
- var className = classNames('p-inputnumber-input', props.inputClassName);
1082
- var valueToRender = formattedValue(props.value);
1083
- return /*#__PURE__*/React.createElement(InputText, _extends({
1084
- ref: inputRef,
1085
- id: props.inputId,
1086
- style: props.inputStyle,
1087
- role: "spinbutton",
1088
- className: className,
1089
- defaultValue: valueToRender,
1090
- type: props.type,
1091
- size: props.size,
1092
- tabIndex: props.tabIndex,
1093
- inputMode: inputMode,
1094
- maxLength: props.maxLength,
1095
- disabled: props.disabled,
1096
- required: props.required,
1097
- pattern: props.pattern,
1098
- placeholder: props.placeholder,
1099
- readOnly: props.readOnly,
1100
- name: props.name,
1101
- autoFocus: props.autoFocus,
1102
- onKeyDown: onInputKeyDown,
1103
- onKeyPress: onInputKeyUp,
1104
- onInput: onInput,
1105
- onClick: onInputClick,
1106
- onBlur: onInputBlur,
1107
- onFocus: onInputFocus,
1108
- onPaste: onPaste,
1109
- min: props.min,
1110
- max: props.max,
1111
- "aria-valuemin": props.min,
1112
- "aria-valuemax": props.max,
1113
- "aria-valuenow": props.value
1114
- }, ariaProps, dataProps, {
1115
- pt: ptm('input'),
1116
- __parentMetadata: {
1117
- parent: metaData
1118
- }
1119
- }));
1120
- };
1121
- var createUpButton = function createUpButton() {
1122
- var incrementIconProps = mergeProps({
1123
- className: cx('incrementIcon')
1124
- }, ptm('incrementIcon'));
1125
- var icon = props.incrementButtonIcon || /*#__PURE__*/React.createElement(AngleUpIcon, incrementIconProps);
1126
- var upButton = IconUtils.getJSXIcon(icon, _objectSpread({}, incrementIconProps), {
1127
- props: props
1128
- });
1129
- var incrementButtonProps = mergeProps({
1130
- type: 'button',
1131
- className: classNames(props.incrementButtonClassName, cx('incrementButton')),
1132
- onPointerLeave: onUpButtonMouseLeave,
1133
- onPointerDown: function onPointerDown(e) {
1134
- return onUpButtonMouseDown(e);
1135
- },
1136
- onPointerUp: onUpButtonMouseUp,
1137
- onKeyDown: function onKeyDown(e) {
1138
- return onUpButtonKeyDown(e);
1139
- },
1140
- onKeyUp: onUpButtonKeyUp,
1141
- disabled: props.disabled,
1142
- tabIndex: -1
1143
- }, ptm('incrementButton'));
1144
- return /*#__PURE__*/React.createElement("button", incrementButtonProps, upButton, /*#__PURE__*/React.createElement(Ripple, null));
1145
- };
1146
- var createDownButton = function createDownButton() {
1147
- var decrementIconProps = mergeProps({
1148
- className: cx('decrementIcon')
1149
- }, ptm('decrementIcon'));
1150
- var icon = props.decrementButtonIcon || /*#__PURE__*/React.createElement(AngleDownIcon, decrementIconProps);
1151
- var downButton = IconUtils.getJSXIcon(icon, _objectSpread({}, decrementIconProps), {
1152
- props: props
1153
- });
1154
- var decrementButtonProps = mergeProps({
1155
- type: 'button',
1156
- className: classNames(props.decrementButtonClassName, cx('decrementButton')),
1157
- onPointerLeave: onDownButtonMouseLeave,
1158
- onPointerDown: function onPointerDown(e) {
1159
- return onDownButtonMouseDown(e);
1160
- },
1161
- onPointerUp: onDownButtonMouseUp,
1162
- onKeyDown: function onKeyDown(e) {
1163
- return onDownButtonKeyDown(e);
1164
- },
1165
- onKeyUp: onDownButtonKeyUp,
1166
- disabled: props.disabled,
1167
- tabIndex: -1
1168
- }, ptm('decrementButton'));
1169
- return /*#__PURE__*/React.createElement("button", decrementButtonProps, downButton, /*#__PURE__*/React.createElement(Ripple, null));
1170
- };
1171
- var createButtonGroup = function createButtonGroup() {
1172
- var upButton = props.showButtons && createUpButton();
1173
- var downButton = props.showButtons && createDownButton();
1174
- var buttonGroupProps = mergeProps({
1175
- className: cx('buttonGroup')
1176
- }, ptm('buttonGroup'));
1177
- if (stacked) {
1178
- return /*#__PURE__*/React.createElement("span", buttonGroupProps, upButton, downButton);
1179
- }
1180
- return /*#__PURE__*/React.createElement(React.Fragment, null, upButton, downButton);
1181
- };
1182
- var hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
1183
- var otherProps = InputNumberBase.getOtherProps(props);
1184
- var dataProps = ObjectUtils.reduceKeys(otherProps, DomHandler.DATA_PROPS);
1185
- var ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
1186
- var inputElement = createInputElement();
1187
- var buttonGroup = createButtonGroup();
1188
- var rootProps = mergeProps({
1189
- id: props.id,
1190
- ref: elementRef,
1191
- className: classNames(props.className, cx('root', {
1192
- focusedState: focusedState,
1193
- stacked: stacked,
1194
- horizontal: horizontal,
1195
- vertical: vertical
1196
- })),
1197
- style: props.style
1198
- }, otherProps, ptm('root'));
1199
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", rootProps, inputElement, buttonGroup), hasTooltip && /*#__PURE__*/React.createElement(Tooltip, _extends({
1200
- target: elementRef,
1201
- content: props.tooltip
1202
- }, props.tooltipOptions, {
1203
- pt: ptm('tooltip')
1204
- })));
1205
- }));
1206
- InputNumber.displayName = 'InputNumber';
1207
-
1208
- export { InputNumber };