primevue 3.7.2 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/README.md +2 -2
  2. package/accordion/Accordion.vue +1 -1
  3. package/accordion/accordion.cjs.js +1 -1
  4. package/accordion/accordion.cjs.min.js +1 -1
  5. package/accordion/accordion.esm.js +1 -1
  6. package/accordion/accordion.esm.min.js +1 -1
  7. package/accordion/accordion.js +1 -1
  8. package/accordion/accordion.min.js +1 -1
  9. package/api/Api.d.ts +73 -32
  10. package/api/api.cjs.js +66 -32
  11. package/api/api.cjs.min.js +1 -1
  12. package/api/api.esm.js +66 -32
  13. package/api/api.esm.min.js +1 -1
  14. package/api/api.js +66 -32
  15. package/api/api.min.js +1 -1
  16. package/autocomplete/AutoComplete.d.ts +43 -9
  17. package/autocomplete/AutoComplete.vue +16 -9
  18. package/autocomplete/autocomplete.cjs.js +19 -11
  19. package/autocomplete/autocomplete.cjs.min.js +1 -1
  20. package/autocomplete/autocomplete.esm.js +19 -11
  21. package/autocomplete/autocomplete.esm.min.js +1 -1
  22. package/autocomplete/autocomplete.js +19 -11
  23. package/autocomplete/autocomplete.min.js +1 -1
  24. package/blockui/BlockUI.vue +1 -1
  25. package/blockui/blockui.cjs.js +5 -7
  26. package/blockui/blockui.cjs.min.js +1 -1
  27. package/blockui/blockui.esm.js +6 -8
  28. package/blockui/blockui.esm.min.js +1 -1
  29. package/blockui/blockui.js +5 -7
  30. package/blockui/blockui.min.js +1 -1
  31. package/breadcrumb/Breadcrumb.d.ts +7 -0
  32. package/breadcrumb/Breadcrumb.vue +4 -0
  33. package/breadcrumb/BreadcrumbItem.vue +5 -2
  34. package/breadcrumb/breadcrumb.cjs.js +6 -3
  35. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  36. package/breadcrumb/breadcrumb.esm.js +6 -3
  37. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  38. package/breadcrumb/breadcrumb.js +6 -3
  39. package/breadcrumb/breadcrumb.min.js +1 -1
  40. package/calendar/Calendar.d.ts +11 -1
  41. package/calendar/Calendar.vue +362 -67
  42. package/calendar/calendar.cjs.js +459 -168
  43. package/calendar/calendar.cjs.min.js +1 -1
  44. package/calendar/calendar.esm.js +461 -170
  45. package/calendar/calendar.esm.min.js +1 -1
  46. package/calendar/calendar.js +459 -168
  47. package/calendar/calendar.min.js +1 -1
  48. package/carousel/Carousel.d.ts +6 -1
  49. package/carousel/Carousel.vue +2 -2
  50. package/carousel/carousel.cjs.js +6 -6
  51. package/carousel/carousel.cjs.min.js +1 -1
  52. package/carousel/carousel.esm.js +6 -6
  53. package/carousel/carousel.esm.min.js +1 -1
  54. package/carousel/carousel.js +6 -6
  55. package/carousel/carousel.min.js +1 -1
  56. package/cascadeselect/CascadeSelect.d.ts +19 -6
  57. package/chart/Chart.vue +9 -2
  58. package/chart/chart.cjs.js +9 -2
  59. package/chart/chart.cjs.min.js +1 -1
  60. package/chart/chart.esm.js +9 -2
  61. package/chart/chart.esm.min.js +1 -1
  62. package/chart/chart.js +9 -2
  63. package/chart/chart.min.js +1 -1
  64. package/chips/Chips.d.ts +5 -1
  65. package/colorpicker/ColorPicker.d.ts +3 -0
  66. package/colorpicker/ColorPicker.vue +6 -1
  67. package/colorpicker/colorpicker.cjs.js +6 -1
  68. package/colorpicker/colorpicker.cjs.min.js +1 -1
  69. package/colorpicker/colorpicker.esm.js +6 -1
  70. package/colorpicker/colorpicker.esm.min.js +1 -1
  71. package/colorpicker/colorpicker.js +6 -1
  72. package/colorpicker/colorpicker.min.js +1 -1
  73. package/column/Column.d.ts +42 -11
  74. package/confirmationservice/ConfirmationService.d.ts +3 -2
  75. package/confirmdialog/ConfirmDialog.vue +8 -2
  76. package/confirmdialog/confirmdialog.cjs.js +11 -4
  77. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  78. package/confirmdialog/confirmdialog.esm.js +11 -4
  79. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  80. package/confirmdialog/confirmdialog.js +11 -4
  81. package/confirmdialog/confirmdialog.min.js +1 -1
  82. package/confirmpopup/ConfirmPopup.d.ts +7 -0
  83. package/confirmpopup/ConfirmPopup.vue +7 -4
  84. package/confirmpopup/confirmpopup.cjs.js +13 -5
  85. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  86. package/confirmpopup/confirmpopup.esm.js +14 -6
  87. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  88. package/confirmpopup/confirmpopup.js +13 -5
  89. package/confirmpopup/confirmpopup.min.js +1 -1
  90. package/contextmenu/ContextMenu.d.ts +5 -1
  91. package/contextmenu/ContextMenuSub.vue +8 -5
  92. package/contextmenu/contextmenu.cjs.js +8 -5
  93. package/contextmenu/contextmenu.cjs.min.js +1 -1
  94. package/contextmenu/contextmenu.esm.js +8 -5
  95. package/contextmenu/contextmenu.esm.min.js +1 -1
  96. package/contextmenu/contextmenu.js +8 -5
  97. package/contextmenu/contextmenu.min.js +1 -1
  98. package/core/core.js +7644 -0
  99. package/core/core.min.js +47 -0
  100. package/datatable/BodyCell.vue +37 -17
  101. package/datatable/ColumnFilter.vue +17 -6
  102. package/datatable/DataTable.d.ts +37 -9
  103. package/datatable/DataTable.vue +90 -48
  104. package/datatable/FooterCell.vue +2 -2
  105. package/datatable/HeaderCell.vue +2 -2
  106. package/datatable/TableBody.vue +15 -6
  107. package/datatable/TableFooter.vue +17 -2
  108. package/datatable/TableHeader.vue +17 -2
  109. package/datatable/datatable.cjs.js +321 -197
  110. package/datatable/datatable.cjs.min.js +1 -1
  111. package/datatable/datatable.esm.js +321 -197
  112. package/datatable/datatable.esm.min.js +1 -1
  113. package/datatable/datatable.js +321 -197
  114. package/datatable/datatable.min.js +1 -1
  115. package/dataview/DataView.d.ts +9 -4
  116. package/dataview/DataView.vue +8 -8
  117. package/dataview/dataview.cjs.js +12 -12
  118. package/dataview/dataview.cjs.min.js +1 -1
  119. package/dataview/dataview.esm.js +12 -12
  120. package/dataview/dataview.esm.min.js +1 -1
  121. package/dataview/dataview.js +12 -12
  122. package/dataview/dataview.min.js +1 -1
  123. package/dialog/Dialog.vue +6 -1
  124. package/dialog/dialog.cjs.js +4 -2
  125. package/dialog/dialog.cjs.min.js +1 -1
  126. package/dialog/dialog.esm.js +4 -2
  127. package/dialog/dialog.esm.min.js +1 -1
  128. package/dialog/dialog.js +4 -2
  129. package/dialog/dialog.min.js +1 -1
  130. package/dock/Dock.d.ts +10 -1
  131. package/dock/Dock.vue +1 -1
  132. package/dock/DockSub.vue +13 -8
  133. package/dock/dock.cjs.js +24 -10
  134. package/dock/dock.cjs.min.js +1 -1
  135. package/dock/dock.esm.js +20 -10
  136. package/dock/dock.esm.min.js +1 -1
  137. package/dock/dock.js +25 -12
  138. package/dock/dock.min.js +1 -1
  139. package/dropdown/Dropdown.d.ts +56 -13
  140. package/dropdown/Dropdown.vue +1 -0
  141. package/dropdown/dropdown.cjs.js +1 -0
  142. package/dropdown/dropdown.cjs.min.js +1 -1
  143. package/dropdown/dropdown.esm.js +1 -0
  144. package/dropdown/dropdown.esm.min.js +1 -1
  145. package/dropdown/dropdown.js +1 -0
  146. package/dropdown/dropdown.min.js +1 -1
  147. package/fileupload/FileUpload.d.ts +5 -0
  148. package/galleria/Galleria.d.ts +20 -4
  149. package/inplace/Inplace.d.ts +1 -0
  150. package/inplace/Inplace.vue +12 -1
  151. package/inplace/inplace.cjs.js +13 -2
  152. package/inplace/inplace.cjs.min.js +1 -1
  153. package/inplace/inplace.esm.js +13 -2
  154. package/inplace/inplace.esm.min.js +1 -1
  155. package/inplace/inplace.js +13 -2
  156. package/inplace/inplace.min.js +1 -1
  157. package/inputnumber/InputNumber.d.ts +1 -1
  158. package/inputnumber/InputNumber.vue +19 -3
  159. package/inputnumber/inputnumber.cjs.js +19 -3
  160. package/inputnumber/inputnumber.cjs.min.js +1 -1
  161. package/inputnumber/inputnumber.esm.js +19 -3
  162. package/inputnumber/inputnumber.esm.min.js +1 -1
  163. package/inputnumber/inputnumber.js +19 -3
  164. package/inputnumber/inputnumber.min.js +1 -1
  165. package/inputswitch/InputSwitch.vue +6 -3
  166. package/inputswitch/inputswitch.cjs.js +6 -3
  167. package/inputswitch/inputswitch.cjs.min.js +1 -1
  168. package/inputswitch/inputswitch.esm.js +6 -3
  169. package/inputswitch/inputswitch.esm.min.js +1 -1
  170. package/inputswitch/inputswitch.js +6 -3
  171. package/inputswitch/inputswitch.min.js +1 -1
  172. package/inputtext/InputText.d.ts +1 -1
  173. package/inputtext/InputText.vue +1 -1
  174. package/inputtext/inputtext.cjs.js +2 -2
  175. package/inputtext/inputtext.cjs.min.js +1 -1
  176. package/inputtext/inputtext.esm.js +3 -3
  177. package/inputtext/inputtext.esm.min.js +1 -1
  178. package/inputtext/inputtext.js +2 -2
  179. package/inputtext/inputtext.min.js +1 -1
  180. package/listbox/Listbox.d.ts +48 -12
  181. package/megamenu/MegaMenu.d.ts +5 -1
  182. package/megamenu/MegaMenu.vue +11 -8
  183. package/megamenu/megamenu.cjs.js +11 -8
  184. package/megamenu/megamenu.cjs.min.js +1 -1
  185. package/megamenu/megamenu.esm.js +11 -8
  186. package/megamenu/megamenu.esm.min.js +1 -1
  187. package/megamenu/megamenu.js +11 -8
  188. package/megamenu/megamenu.min.js +1 -1
  189. package/menu/Menu.d.ts +5 -1
  190. package/menu/Menu.vue +6 -3
  191. package/menu/Menuitem.vue +5 -2
  192. package/menu/menu.cjs.js +11 -5
  193. package/menu/menu.cjs.min.js +1 -1
  194. package/menu/menu.esm.js +11 -5
  195. package/menu/menu.esm.min.js +1 -1
  196. package/menu/menu.js +11 -5
  197. package/menu/menu.min.js +1 -1
  198. package/menubar/Menubar.d.ts +5 -1
  199. package/menubar/MenubarSub.vue +8 -5
  200. package/menubar/menubar.cjs.js +8 -5
  201. package/menubar/menubar.cjs.min.js +1 -1
  202. package/menubar/menubar.esm.js +8 -5
  203. package/menubar/menubar.esm.min.js +1 -1
  204. package/menubar/menubar.js +8 -5
  205. package/menubar/menubar.min.js +1 -1
  206. package/message/Message.d.ts +1 -0
  207. package/message/Message.vue +6 -2
  208. package/message/message.cjs.js +6 -2
  209. package/message/message.cjs.min.js +1 -1
  210. package/message/message.esm.js +6 -2
  211. package/message/message.esm.min.js +1 -1
  212. package/message/message.js +6 -2
  213. package/message/message.min.js +1 -1
  214. package/multiselect/MultiSelect.d.ts +61 -14
  215. package/orderlist/OrderList.d.ts +8 -1
  216. package/orderlist/OrderList.vue +2 -0
  217. package/orderlist/orderlist.cjs.js +3 -1
  218. package/orderlist/orderlist.cjs.min.js +1 -1
  219. package/orderlist/orderlist.esm.js +3 -1
  220. package/orderlist/orderlist.esm.min.js +1 -1
  221. package/orderlist/orderlist.js +3 -1
  222. package/orderlist/orderlist.min.js +1 -1
  223. package/overlaypanel/OverlayPanel.vue +1 -0
  224. package/overlaypanel/overlaypanel.cjs.js +1 -0
  225. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  226. package/overlaypanel/overlaypanel.esm.js +1 -0
  227. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  228. package/overlaypanel/overlaypanel.js +1 -0
  229. package/overlaypanel/overlaypanel.min.js +1 -1
  230. package/package.json +5 -1
  231. package/paginator/CurrentPageReport.vue +5 -1
  232. package/paginator/JumpToPageInput.vue +1 -1
  233. package/paginator/Paginator.d.ts +10 -4
  234. package/paginator/Paginator.vue +10 -7
  235. package/paginator/paginator.cjs.js +16 -8
  236. package/paginator/paginator.cjs.min.js +1 -1
  237. package/paginator/paginator.esm.js +16 -8
  238. package/paginator/paginator.esm.min.js +1 -1
  239. package/paginator/paginator.js +16 -8
  240. package/paginator/paginator.min.js +1 -1
  241. package/panel/Panel.d.ts +1 -0
  242. package/panel/Panel.vue +1 -1
  243. package/panelmenu/PanelMenu.d.ts +5 -3
  244. package/panelmenu/PanelMenu.vue +6 -3
  245. package/panelmenu/PanelMenuSub.vue +8 -5
  246. package/panelmenu/panelmenu.cjs.js +14 -8
  247. package/panelmenu/panelmenu.cjs.min.js +1 -1
  248. package/panelmenu/panelmenu.esm.js +14 -8
  249. package/panelmenu/panelmenu.esm.min.js +1 -1
  250. package/panelmenu/panelmenu.js +14 -8
  251. package/panelmenu/panelmenu.min.js +1 -1
  252. package/picklist/PickList.d.ts +14 -3
  253. package/picklist/PickList.vue +10 -4
  254. package/picklist/picklist.cjs.js +13 -7
  255. package/picklist/picklist.cjs.min.js +1 -1
  256. package/picklist/picklist.esm.js +13 -7
  257. package/picklist/picklist.esm.min.js +1 -1
  258. package/picklist/picklist.js +13 -7
  259. package/picklist/picklist.min.js +1 -1
  260. package/progressbar/ProgressBar.vue +13 -12
  261. package/progressbar/progressbar.cjs.js +13 -12
  262. package/progressbar/progressbar.cjs.min.js +1 -1
  263. package/progressbar/progressbar.esm.js +14 -13
  264. package/progressbar/progressbar.esm.min.js +1 -1
  265. package/progressbar/progressbar.js +13 -12
  266. package/progressbar/progressbar.min.js +1 -1
  267. package/rating/Rating.vue +1 -1
  268. package/rating/rating.cjs.js +1 -1
  269. package/rating/rating.cjs.min.js +1 -1
  270. package/rating/rating.esm.js +1 -1
  271. package/rating/rating.esm.min.js +1 -1
  272. package/rating/rating.js +1 -1
  273. package/rating/rating.min.js +1 -1
  274. package/resources/primevue.css +5 -0
  275. package/resources/primevue.min.css +1 -1
  276. package/resources/themes/arya-blue/theme.css +57 -16
  277. package/resources/themes/arya-green/theme.css +57 -16
  278. package/resources/themes/arya-orange/theme.css +57 -16
  279. package/resources/themes/arya-purple/theme.css +57 -16
  280. package/resources/themes/bootstrap4-dark-blue/theme.css +54 -20
  281. package/resources/themes/bootstrap4-dark-purple/theme.css +54 -20
  282. package/resources/themes/bootstrap4-light-blue/theme.css +54 -20
  283. package/resources/themes/bootstrap4-light-purple/theme.css +54 -20
  284. package/resources/themes/fluent-light/theme.css +57 -16
  285. package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
  286. package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
  287. package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
  288. package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
  289. package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
  290. package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
  291. package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
  292. package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
  293. package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
  294. package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
  295. package/resources/themes/lara-dark-blue/theme.css +5414 -0
  296. package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
  297. package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
  298. package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
  299. package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
  300. package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
  301. package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
  302. package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
  303. package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
  304. package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
  305. package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
  306. package/resources/themes/lara-dark-indigo/theme.css +5414 -0
  307. package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
  308. package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
  309. package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
  310. package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
  311. package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
  312. package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
  313. package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
  314. package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
  315. package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
  316. package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
  317. package/resources/themes/lara-dark-purple/theme.css +5414 -0
  318. package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
  319. package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
  320. package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
  321. package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
  322. package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
  323. package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
  324. package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
  325. package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
  326. package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
  327. package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
  328. package/resources/themes/lara-dark-teal/theme.css +5414 -0
  329. package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
  330. package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
  331. package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
  332. package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
  333. package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
  334. package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
  335. package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
  336. package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
  337. package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
  338. package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
  339. package/resources/themes/lara-light-blue/theme.css +5414 -0
  340. package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
  341. package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
  342. package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
  343. package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
  344. package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
  345. package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
  346. package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
  347. package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
  348. package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
  349. package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
  350. package/resources/themes/lara-light-indigo/theme.css +5414 -0
  351. package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
  352. package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
  353. package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
  354. package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
  355. package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
  356. package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
  357. package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
  358. package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
  359. package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
  360. package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
  361. package/resources/themes/lara-light-purple/theme.css +5414 -0
  362. package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
  363. package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
  364. package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
  365. package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
  366. package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
  367. package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
  368. package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
  369. package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
  370. package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
  371. package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
  372. package/resources/themes/lara-light-teal/theme.css +5414 -0
  373. package/resources/themes/luna-amber/theme.css +54 -20
  374. package/resources/themes/luna-blue/theme.css +54 -20
  375. package/resources/themes/luna-green/theme.css +54 -20
  376. package/resources/themes/luna-pink/theme.css +54 -20
  377. package/resources/themes/md-dark-deeppurple/theme.css +245 -48
  378. package/resources/themes/md-dark-indigo/theme.css +245 -48
  379. package/resources/themes/md-light-deeppurple/theme.css +245 -48
  380. package/resources/themes/md-light-indigo/theme.css +245 -48
  381. package/resources/themes/mdc-dark-deeppurple/theme.css +245 -48
  382. package/resources/themes/mdc-dark-indigo/theme.css +245 -48
  383. package/resources/themes/mdc-light-deeppurple/theme.css +245 -48
  384. package/resources/themes/mdc-light-indigo/theme.css +245 -48
  385. package/resources/themes/nova/theme.css +54 -20
  386. package/resources/themes/nova-accent/theme.css +54 -20
  387. package/resources/themes/nova-alt/theme.css +54 -20
  388. package/resources/themes/nova-vue/theme.css +54 -20
  389. package/resources/themes/rhea/theme.css +54 -20
  390. package/resources/themes/saga-blue/theme.css +57 -16
  391. package/resources/themes/saga-green/theme.css +57 -16
  392. package/resources/themes/saga-orange/theme.css +57 -16
  393. package/resources/themes/saga-purple/theme.css +57 -16
  394. package/resources/themes/tailwind-light/theme.css +68 -19
  395. package/resources/themes/vela-blue/theme.css +57 -16
  396. package/resources/themes/vela-green/theme.css +57 -16
  397. package/resources/themes/vela-orange/theme.css +57 -16
  398. package/resources/themes/vela-purple/theme.css +57 -16
  399. package/selectbutton/SelectButton.d.ts +13 -5
  400. package/selectbutton/SelectButton.vue +8 -2
  401. package/selectbutton/selectbutton.cjs.js +14 -9
  402. package/selectbutton/selectbutton.cjs.min.js +1 -1
  403. package/selectbutton/selectbutton.esm.js +14 -9
  404. package/selectbutton/selectbutton.esm.min.js +1 -1
  405. package/selectbutton/selectbutton.js +14 -9
  406. package/selectbutton/selectbutton.min.js +1 -1
  407. package/speeddial/SpeedDial.d.ts +5 -1
  408. package/speeddial/SpeedDial.vue +2 -1
  409. package/speeddial/speeddial.cjs.js +2 -1
  410. package/speeddial/speeddial.cjs.min.js +1 -1
  411. package/speeddial/speeddial.esm.js +2 -1
  412. package/speeddial/speeddial.esm.min.js +1 -1
  413. package/speeddial/speeddial.js +2 -1
  414. package/speeddial/speeddial.min.js +1 -1
  415. package/splitter/Splitter.vue +5 -3
  416. package/splitter/splitter.cjs.js +4 -2
  417. package/splitter/splitter.cjs.min.js +1 -1
  418. package/splitter/splitter.esm.js +5 -3
  419. package/splitter/splitter.esm.min.js +1 -1
  420. package/splitter/splitter.js +4 -2
  421. package/splitter/splitter.min.js +1 -1
  422. package/steps/Steps.d.ts +5 -3
  423. package/steps/Steps.vue +5 -2
  424. package/steps/steps.cjs.js +5 -2
  425. package/steps/steps.cjs.min.js +1 -1
  426. package/steps/steps.esm.js +5 -2
  427. package/steps/steps.esm.min.js +1 -1
  428. package/steps/steps.js +5 -2
  429. package/steps/steps.min.js +1 -1
  430. package/tabmenu/TabMenu.d.ts +5 -3
  431. package/tabmenu/TabMenu.vue +10 -3
  432. package/tabmenu/tabmenu.cjs.js +7 -4
  433. package/tabmenu/tabmenu.cjs.min.js +1 -1
  434. package/tabmenu/tabmenu.esm.js +7 -4
  435. package/tabmenu/tabmenu.esm.min.js +1 -1
  436. package/tabmenu/tabmenu.js +7 -4
  437. package/tabmenu/tabmenu.min.js +1 -1
  438. package/terminal/terminal.js +1 -1
  439. package/terminal/terminal.min.js +1 -1
  440. package/terminalservice/TerminalService.d.ts +9 -6
  441. package/tieredmenu/TieredMenu.d.ts +5 -3
  442. package/tieredmenu/TieredMenuSub.vue +8 -5
  443. package/tieredmenu/tieredmenu.cjs.js +8 -5
  444. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  445. package/tieredmenu/tieredmenu.esm.js +8 -5
  446. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  447. package/tieredmenu/tieredmenu.js +8 -5
  448. package/tieredmenu/tieredmenu.min.js +1 -1
  449. package/timeline/Timeline.d.ts +8 -3
  450. package/toast/Toast.d.ts +7 -0
  451. package/toastservice/ToastService.d.ts +3 -2
  452. package/tooltip/tooltip.cjs.js +5 -1
  453. package/tooltip/tooltip.cjs.min.js +1 -1
  454. package/tooltip/tooltip.esm.js +5 -1
  455. package/tooltip/tooltip.esm.min.js +1 -1
  456. package/tooltip/tooltip.js +5 -1
  457. package/tooltip/tooltip.min.js +1 -1
  458. package/tree/Tree.d.ts +5 -1
  459. package/tree/TreeNode.vue +4 -1
  460. package/tree/tree.cjs.js +4 -1
  461. package/tree/tree.cjs.min.js +1 -1
  462. package/tree/tree.esm.js +4 -1
  463. package/tree/tree.esm.min.js +1 -1
  464. package/tree/tree.js +4 -1
  465. package/tree/tree.min.js +1 -1
  466. package/treeselect/TreeSelect.d.ts +20 -3
  467. package/treeselect/TreeSelect.vue +9 -0
  468. package/treeselect/treeselect.cjs.js +9 -0
  469. package/treeselect/treeselect.cjs.min.js +1 -1
  470. package/treeselect/treeselect.esm.js +9 -0
  471. package/treeselect/treeselect.esm.min.js +1 -1
  472. package/treeselect/treeselect.js +9 -0
  473. package/treeselect/treeselect.min.js +1 -1
  474. package/treetable/BodyCell.vue +2 -3
  475. package/treetable/FooterCell.vue +2 -2
  476. package/treetable/HeaderCell.vue +2 -2
  477. package/treetable/TreeTable.d.ts +2 -2
  478. package/treetable/TreeTable.vue +10 -10
  479. package/treetable/TreeTableRow.vue +2 -2
  480. package/treetable/treetable.cjs.js +18 -18
  481. package/treetable/treetable.cjs.min.js +1 -1
  482. package/treetable/treetable.esm.js +19 -19
  483. package/treetable/treetable.esm.min.js +1 -1
  484. package/treetable/treetable.js +18 -18
  485. package/treetable/treetable.min.js +1 -1
  486. package/utils/Utils.d.ts +80 -0
  487. package/utils/package.json +3 -2
  488. package/utils/utils.cjs.js +126 -108
  489. package/utils/utils.cjs.min.js +1 -1
  490. package/utils/utils.esm.js +126 -108
  491. package/utils/utils.esm.min.js +1 -1
  492. package/utils/utils.js +126 -108
  493. package/utils/utils.min.js +1 -1
  494. package/vetur-attributes.json +24 -0
  495. package/vetur-tags.json +9 -3
  496. package/virtualscroller/VirtualScroller.d.ts +52 -6
  497. package/virtualscroller/VirtualScroller.vue +1 -1
  498. package/virtualscroller/virtualscroller.cjs.js +1 -1
  499. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  500. package/virtualscroller/virtualscroller.esm.js +1 -1
  501. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  502. package/virtualscroller/virtualscroller.js +1 -1
  503. package/virtualscroller/virtualscroller.min.js +1 -1
  504. package/web-types.json +228 -13
@@ -18,6 +18,10 @@ var script = {
18
18
  active: {
19
19
  type: Boolean,
20
20
  default: false
21
+ },
22
+ disabled: {
23
+ type: Boolean,
24
+ default: false
21
25
  }
22
26
  },
23
27
  watch: {
@@ -32,6 +36,10 @@ var script = {
32
36
  },
33
37
  methods: {
34
38
  open(event) {
39
+ if (this.disabled) {
40
+ return;
41
+ }
42
+
35
43
  this.$emit('open', event);
36
44
  this.d_active = true;
37
45
  this.$emit('update:active', true);
@@ -45,6 +53,9 @@ var script = {
45
53
  computed: {
46
54
  containerClass() {
47
55
  return ['p-inplace p-component', {'p-inplace-closable': this.closable}];
56
+ },
57
+ displayClass() {
58
+ return ['p-inplace-display', {'p-disabled': this.disabled}];
48
59
  }
49
60
  },
50
61
  components: {
@@ -64,13 +75,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
64
75
  (!$data.d_active)
65
76
  ? (vue.openBlock(), vue.createBlock("div", {
66
77
  key: 0,
67
- class: "p-inplace-display",
78
+ class: $options.displayClass,
68
79
  tabindex: _ctx.$attrs.tabindex||'0',
69
80
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.open && $options.open(...args))),
70
81
  onKeydown: _cache[2] || (_cache[2] = vue.withKeys((...args) => ($options.open && $options.open(...args)), ["enter"]))
71
82
  }, [
72
83
  vue.renderSlot(_ctx.$slots, "display")
73
- ], 40, ["tabindex"]))
84
+ ], 42, ["tabindex"]))
74
85
  : (vue.openBlock(), vue.createBlock("div", _hoisted_1, [
75
86
  vue.renderSlot(_ctx.$slots, "content"),
76
87
  ($props.closable)
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/button"),t=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Inplace",emits:["open","close","update:active"],props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},watch:{active(e){this.d_active=e}},data(){return{d_active:this.active}},methods:{open(e){this.$emit("open",e),this.d_active=!0,this.$emit("update:active",!0)},close(e){this.$emit("close",e),this.d_active=!1,this.$emit("update:active",!1)}},computed:{containerClass(){return["p-inplace p-component",{"p-inplace-closable":this.closable}]}},components:{IPButton:n(e).default}};const o={key:1,class:"p-inplace-content"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-inplace .p-inplace-display {\n display: inline;\n cursor: pointer;\n}\n.p-inplace .p-inplace-content {\n display: inline;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n"),i.render=function(e,n,i,l,a,c){const p=t.resolveComponent("IPButton");return t.openBlock(),t.createBlock("div",{class:c.containerClass},[a.d_active?(t.openBlock(),t.createBlock("div",o,[t.renderSlot(e.$slots,"content"),i.closable?(t.openBlock(),t.createBlock(p,{key:0,icon:"pi pi-times",onClick:c.close},null,8,["onClick"])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createBlock("div",{key:0,class:"p-inplace-display",tabindex:e.$attrs.tabindex||"0",onClick:n[1]||(n[1]=(...e)=>c.open&&c.open(...e)),onKeydown:n[2]||(n[2]=t.withKeys(((...e)=>c.open&&c.open(...e)),["enter"]))},[t.renderSlot(e.$slots,"display")],40,["tabindex"]))],2)},module.exports=i;
1
+ "use strict";var e=require("primevue/button"),t=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Inplace",emits:["open","close","update:active"],props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},watch:{active(e){this.d_active=e}},data(){return{d_active:this.active}},methods:{open(e){this.disabled||(this.$emit("open",e),this.d_active=!0,this.$emit("update:active",!0))},close(e){this.$emit("close",e),this.d_active=!1,this.$emit("update:active",!1)}},computed:{containerClass(){return["p-inplace p-component",{"p-inplace-closable":this.closable}]},displayClass(){return["p-inplace-display",{"p-disabled":this.disabled}]}},components:{IPButton:n(e).default}};const l={key:1,class:"p-inplace-content"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-inplace .p-inplace-display {\n display: inline;\n cursor: pointer;\n}\n.p-inplace .p-inplace-content {\n display: inline;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n"),i.render=function(e,n,i,a,o,c){const p=t.resolveComponent("IPButton");return t.openBlock(),t.createBlock("div",{class:c.containerClass},[o.d_active?(t.openBlock(),t.createBlock("div",l,[t.renderSlot(e.$slots,"content"),i.closable?(t.openBlock(),t.createBlock(p,{key:0,icon:"pi pi-times",onClick:c.close},null,8,["onClick"])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createBlock("div",{key:0,class:c.displayClass,tabindex:e.$attrs.tabindex||"0",onClick:n[1]||(n[1]=(...e)=>c.open&&c.open(...e)),onKeydown:n[2]||(n[2]=t.withKeys(((...e)=>c.open&&c.open(...e)),["enter"]))},[t.renderSlot(e.$slots,"display")],42,["tabindex"]))],2)},module.exports=i;
@@ -12,6 +12,10 @@ var script = {
12
12
  active: {
13
13
  type: Boolean,
14
14
  default: false
15
+ },
16
+ disabled: {
17
+ type: Boolean,
18
+ default: false
15
19
  }
16
20
  },
17
21
  watch: {
@@ -26,6 +30,10 @@ var script = {
26
30
  },
27
31
  methods: {
28
32
  open(event) {
33
+ if (this.disabled) {
34
+ return;
35
+ }
36
+
29
37
  this.$emit('open', event);
30
38
  this.d_active = true;
31
39
  this.$emit('update:active', true);
@@ -39,6 +47,9 @@ var script = {
39
47
  computed: {
40
48
  containerClass() {
41
49
  return ['p-inplace p-component', {'p-inplace-closable': this.closable}];
50
+ },
51
+ displayClass() {
52
+ return ['p-inplace-display', {'p-disabled': this.disabled}];
42
53
  }
43
54
  },
44
55
  components: {
@@ -58,13 +69,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
58
69
  (!$data.d_active)
59
70
  ? (openBlock(), createBlock("div", {
60
71
  key: 0,
61
- class: "p-inplace-display",
72
+ class: $options.displayClass,
62
73
  tabindex: _ctx.$attrs.tabindex||'0',
63
74
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.open && $options.open(...args))),
64
75
  onKeydown: _cache[2] || (_cache[2] = withKeys((...args) => ($options.open && $options.open(...args)), ["enter"]))
65
76
  }, [
66
77
  renderSlot(_ctx.$slots, "display")
67
- ], 40, ["tabindex"]))
78
+ ], 42, ["tabindex"]))
68
79
  : (openBlock(), createBlock("div", _hoisted_1, [
69
80
  renderSlot(_ctx.$slots, "content"),
70
81
  ($props.closable)
@@ -1 +1 @@
1
- import e from"primevue/button";import{resolveComponent as t,openBlock as n,createBlock as i,withKeys as a,renderSlot as l,createCommentVNode as p}from"vue";var o={name:"Inplace",emits:["open","close","update:active"],props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},watch:{active(e){this.d_active=e}},data(){return{d_active:this.active}},methods:{open(e){this.$emit("open",e),this.d_active=!0,this.$emit("update:active",!0)},close(e){this.$emit("close",e),this.d_active=!1,this.$emit("update:active",!1)}},computed:{containerClass(){return["p-inplace p-component",{"p-inplace-closable":this.closable}]}},components:{IPButton:e}};const c={key:1,class:"p-inplace-content"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("\n.p-inplace .p-inplace-display {\n display: inline;\n cursor: pointer;\n}\n.p-inplace .p-inplace-content {\n display: inline;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n"),o.render=function(e,o,s,d,r,u){const m=t("IPButton");return n(),i("div",{class:u.containerClass},[r.d_active?(n(),i("div",c,[l(e.$slots,"content"),s.closable?(n(),i(m,{key:0,icon:"pi pi-times",onClick:u.close},null,8,["onClick"])):p("",!0)])):(n(),i("div",{key:0,class:"p-inplace-display",tabindex:e.$attrs.tabindex||"0",onClick:o[1]||(o[1]=(...e)=>u.open&&u.open(...e)),onKeydown:o[2]||(o[2]=a(((...e)=>u.open&&u.open(...e)),["enter"]))},[l(e.$slots,"display")],40,["tabindex"]))],2)};export default o;
1
+ import e from"primevue/button";import{resolveComponent as t,openBlock as n,createBlock as i,withKeys as a,renderSlot as l,createCommentVNode as p}from"vue";var s={name:"Inplace",emits:["open","close","update:active"],props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},watch:{active(e){this.d_active=e}},data(){return{d_active:this.active}},methods:{open(e){this.disabled||(this.$emit("open",e),this.d_active=!0,this.$emit("update:active",!0))},close(e){this.$emit("close",e),this.d_active=!1,this.$emit("update:active",!1)}},computed:{containerClass(){return["p-inplace p-component",{"p-inplace-closable":this.closable}]},displayClass(){return["p-inplace-display",{"p-disabled":this.disabled}]}},components:{IPButton:e}};const o={key:1,class:"p-inplace-content"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("\n.p-inplace .p-inplace-display {\n display: inline;\n cursor: pointer;\n}\n.p-inplace .p-inplace-content {\n display: inline;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n"),s.render=function(e,s,c,d,r,u){const m=t("IPButton");return n(),i("div",{class:u.containerClass},[r.d_active?(n(),i("div",o,[l(e.$slots,"content"),c.closable?(n(),i(m,{key:0,icon:"pi pi-times",onClick:u.close},null,8,["onClick"])):p("",!0)])):(n(),i("div",{key:0,class:u.displayClass,tabindex:e.$attrs.tabindex||"0",onClick:s[1]||(s[1]=(...e)=>u.open&&u.open(...e)),onKeydown:s[2]||(s[2]=a(((...e)=>u.open&&u.open(...e)),["enter"]))},[l(e.$slots,"display")],42,["tabindex"]))],2)};export default s;
@@ -17,6 +17,10 @@ this.primevue.inplace = (function (Button, vue) {
17
17
  active: {
18
18
  type: Boolean,
19
19
  default: false
20
+ },
21
+ disabled: {
22
+ type: Boolean,
23
+ default: false
20
24
  }
21
25
  },
22
26
  watch: {
@@ -31,6 +35,10 @@ this.primevue.inplace = (function (Button, vue) {
31
35
  },
32
36
  methods: {
33
37
  open(event) {
38
+ if (this.disabled) {
39
+ return;
40
+ }
41
+
34
42
  this.$emit('open', event);
35
43
  this.d_active = true;
36
44
  this.$emit('update:active', true);
@@ -44,6 +52,9 @@ this.primevue.inplace = (function (Button, vue) {
44
52
  computed: {
45
53
  containerClass() {
46
54
  return ['p-inplace p-component', {'p-inplace-closable': this.closable}];
55
+ },
56
+ displayClass() {
57
+ return ['p-inplace-display', {'p-disabled': this.disabled}];
47
58
  }
48
59
  },
49
60
  components: {
@@ -63,13 +74,13 @@ this.primevue.inplace = (function (Button, vue) {
63
74
  (!$data.d_active)
64
75
  ? (vue.openBlock(), vue.createBlock("div", {
65
76
  key: 0,
66
- class: "p-inplace-display",
77
+ class: $options.displayClass,
67
78
  tabindex: _ctx.$attrs.tabindex||'0',
68
79
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.open && $options.open(...args))),
69
80
  onKeydown: _cache[2] || (_cache[2] = vue.withKeys((...args) => ($options.open && $options.open(...args)), ["enter"]))
70
81
  }, [
71
82
  vue.renderSlot(_ctx.$slots, "display")
72
- ], 40, ["tabindex"]))
83
+ ], 42, ["tabindex"]))
73
84
  : (vue.openBlock(), vue.createBlock("div", _hoisted_1, [
74
85
  vue.renderSlot(_ctx.$slots, "content"),
75
86
  ($props.closable)
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.inplace=function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Inplace",emits:["open","close","update:active"],props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},watch:{active(e){this.d_active=e}},data(){return{d_active:this.active}},methods:{open(e){this.$emit("open",e),this.d_active=!0,this.$emit("update:active",!0)},close(e){this.$emit("close",e),this.d_active=!1,this.$emit("update:active",!1)}},computed:{containerClass(){return["p-inplace p-component",{"p-inplace-closable":this.closable}]}},components:{IPButton:n(e).default}};const o={key:1,class:"p-inplace-content"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-inplace .p-inplace-display {\n display: inline;\n cursor: pointer;\n}\n.p-inplace .p-inplace-content {\n display: inline;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n"),i.render=function(e,n,i,l,c,a){const p=t.resolveComponent("IPButton");return t.openBlock(),t.createBlock("div",{class:a.containerClass},[c.d_active?(t.openBlock(),t.createBlock("div",o,[t.renderSlot(e.$slots,"content"),i.closable?(t.openBlock(),t.createBlock(p,{key:0,icon:"pi pi-times",onClick:a.close},null,8,["onClick"])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createBlock("div",{key:0,class:"p-inplace-display",tabindex:e.$attrs.tabindex||"0",onClick:n[1]||(n[1]=(...e)=>a.open&&a.open(...e)),onKeydown:n[2]||(n[2]=t.withKeys(((...e)=>a.open&&a.open(...e)),["enter"]))},[t.renderSlot(e.$slots,"display")],40,["tabindex"]))],2)},i}(primevue.button,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.inplace=function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Inplace",emits:["open","close","update:active"],props:{closable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},watch:{active(e){this.d_active=e}},data(){return{d_active:this.active}},methods:{open(e){this.disabled||(this.$emit("open",e),this.d_active=!0,this.$emit("update:active",!0))},close(e){this.$emit("close",e),this.d_active=!1,this.$emit("update:active",!1)}},computed:{containerClass(){return["p-inplace p-component",{"p-inplace-closable":this.closable}]},displayClass(){return["p-inplace-display",{"p-disabled":this.disabled}]}},components:{IPButton:n(e).default}};const l={key:1,class:"p-inplace-content"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-inplace .p-inplace-display {\n display: inline;\n cursor: pointer;\n}\n.p-inplace .p-inplace-content {\n display: inline;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-inplace.p-inplace-closable .p-inplace-content > .p-inputtext {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n"),i.render=function(e,n,i,a,o,c){const p=t.resolveComponent("IPButton");return t.openBlock(),t.createBlock("div",{class:c.containerClass},[o.d_active?(t.openBlock(),t.createBlock("div",l,[t.renderSlot(e.$slots,"content"),i.closable?(t.openBlock(),t.createBlock(p,{key:0,icon:"pi pi-times",onClick:c.close},null,8,["onClick"])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createBlock("div",{key:0,class:c.displayClass,tabindex:e.$attrs.tabindex||"0",onClick:n[1]||(n[1]=(...e)=>c.open&&c.open(...e)),onKeydown:n[2]||(n[2]=t.withKeys(((...e)=>c.open&&c.open(...e)),["enter"]))},[t.renderSlot(e.$slots,"display")],42,["tabindex"]))],2)},i}(primevue.button,Vue);
@@ -24,7 +24,7 @@ interface InputNumberProps {
24
24
  inputStyle?: any;
25
25
  inputClass?: string;
26
26
  style?: any;
27
- class?: string;
27
+ class?: any;
28
28
  }
29
29
 
30
30
  declare class InputNumber {
@@ -129,10 +129,14 @@ export default {
129
129
  timer: null,
130
130
  data() {
131
131
  return {
132
+ d_modelValue: this.modelValue,
132
133
  focused: false
133
134
  }
134
135
  },
135
136
  watch: {
137
+ modelValue(newValue) {
138
+ this.d_modelValue = newValue;
139
+ },
136
140
  locale(newValue, oldValue) {
137
141
  this.updateConstructParser(newValue, oldValue);
138
142
  },
@@ -891,6 +895,7 @@ export default {
891
895
  return 0;
892
896
  },
893
897
  updateModel(event, value) {
898
+ this.d_modelValue = value;
894
899
  this.$emit('update:modelValue', value);
895
900
  },
896
901
  onInputFocus() {
@@ -909,7 +914,13 @@ export default {
909
914
  if (this.timer) {
910
915
  clearInterval(this.timer);
911
916
  }
912
- }
917
+ },
918
+ maxBoundry() {
919
+ return this.d_modelValue >= this.max;
920
+ },
921
+ minBoundry() {
922
+ return this.d_modelValue <= this.min;
923
+ },
913
924
  },
914
925
  computed: {
915
926
  containerClass() {
@@ -921,11 +932,16 @@ export default {
921
932
  'p-inputnumber-buttons-vertical': this.showButtons && this.buttonLayout === 'vertical'
922
933
  }];
923
934
  },
935
+
924
936
  upButtonClass() {
925
- return ['p-inputnumber-button p-inputnumber-button-up', this.incrementButtonClass];
937
+ return ['p-inputnumber-button p-inputnumber-button-up', this.incrementButtonClass, {
938
+ 'p-disabled': this.showButtons && this.max !== null && this.maxBoundry()
939
+ }];
926
940
  },
927
941
  downButtonClass() {
928
- return ['p-inputnumber-button p-inputnumber-button-down', this.decrementButtonClass];
942
+ return ['p-inputnumber-button p-inputnumber-button-down', this.decrementButtonClass, {
943
+ 'p-disabled': this.showButtons && this.min !== null && this.minBoundry()
944
+ }];
929
945
  },
930
946
  filled() {
931
947
  return (this.modelValue != null && this.modelValue.toString().length > 0)
@@ -123,10 +123,14 @@ var script = {
123
123
  timer: null,
124
124
  data() {
125
125
  return {
126
+ d_modelValue: this.modelValue,
126
127
  focused: false
127
128
  }
128
129
  },
129
130
  watch: {
131
+ modelValue(newValue) {
132
+ this.d_modelValue = newValue;
133
+ },
130
134
  locale(newValue, oldValue) {
131
135
  this.updateConstructParser(newValue, oldValue);
132
136
  },
@@ -882,6 +886,7 @@ var script = {
882
886
  return 0;
883
887
  },
884
888
  updateModel(event, value) {
889
+ this.d_modelValue = value;
885
890
  this.$emit('update:modelValue', value);
886
891
  },
887
892
  onInputFocus() {
@@ -900,7 +905,13 @@ var script = {
900
905
  if (this.timer) {
901
906
  clearInterval(this.timer);
902
907
  }
903
- }
908
+ },
909
+ maxBoundry() {
910
+ return this.d_modelValue >= this.max;
911
+ },
912
+ minBoundry() {
913
+ return this.d_modelValue <= this.min;
914
+ },
904
915
  },
905
916
  computed: {
906
917
  containerClass() {
@@ -912,11 +923,16 @@ var script = {
912
923
  'p-inputnumber-buttons-vertical': this.showButtons && this.buttonLayout === 'vertical'
913
924
  }];
914
925
  },
926
+
915
927
  upButtonClass() {
916
- return ['p-inputnumber-button p-inputnumber-button-up', this.incrementButtonClass];
928
+ return ['p-inputnumber-button p-inputnumber-button-up', this.incrementButtonClass, {
929
+ 'p-disabled': this.showButtons && this.max !== null && this.maxBoundry()
930
+ }];
917
931
  },
918
932
  downButtonClass() {
919
- return ['p-inputnumber-button p-inputnumber-button-down', this.decrementButtonClass];
933
+ return ['p-inputnumber-button p-inputnumber-button-down', this.decrementButtonClass, {
934
+ 'p-disabled': this.showButtons && this.min !== null && this.minBoundry()
935
+ }];
920
936
  },
921
937
  filled() {
922
938
  return (this.modelValue != null && this.modelValue.toString().length > 0)
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/inputtext"),t=require("primevue/button"),n=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),r=i(t),u={name:"InputNumber",inheritAttrs:!1,emits:["update:modelValue","input"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},style:null,class:null,inputStyle:null,inputClass:null},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data:()=>({focused:!1}),watch:{locale(e,t){this.updateConstructParser(e,t)},localeMatcher(e,t){this.updateConstructParser(e,t)},mode(e,t){this.updateConstructParser(e,t)},currency(e,t){this.updateConstructParser(e,t)},currencyDisplay(e,t){this.updateConstructParser(e,t)},useGrouping(e,t){this.updateConstructParser(e,t)},minFractionDigits(e,t){this.updateConstructParser(e,t)},maxFractionDigits(e,t){this.updateConstructParser(e,t)},suffix(e,t){this.updateConstructParser(e,t)},prefix(e,t){this.updateConstructParser(e,t)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const e=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),t=new Map(e.map(((e,t)=>[e,t])));this._numeral=new RegExp(`[${e.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=e=>t.get(e)},updateConstructParser(e,t){e!==t&&this.constructParser()},escapeRegExp:e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const e=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${e.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${e.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const e=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(e){if(null!=e){if("-"===e)return e;if(this.format){let t=new Intl.NumberFormat(this.locale,this.getOptions()).format(e);return this.prefix&&(t=this.prefix+t),this.suffix&&(t+=this.suffix),t}return e.toString()}return""},parseValue(e){let t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;let e=+t;return isNaN(e)?null:e}return null},repeat(e,t,n){let i=t||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(e,40,n)}),i),this.spin(e,n)},spin(e,t){if(this.$refs.input){let n=this.step*t,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(e,s),this.handleOnInput(e,i,s)}},onUpButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(e){if(this.lastValue=e.target.value,e.shiftKey||e.altKey)return void(this.isSpecialChar=!0);let t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,s=null;switch(e.altKey&&e.preventDefault(),e.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case 39:this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(e,s);break;case 8:if(e.preventDefault(),t===n){const n=i.charAt(t-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t-2)+i.slice(t-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t-1,t-1):s=i.slice(0,t-1)+i.slice(t);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t-1)+n+i.slice(t)}else 1===u?(s=i.slice(0,t-1)+"0"+i.slice(t),s=this.parseValue(s)>0?s:""):s=i.slice(0,t-1)+i.slice(t)}this.updateValue(e,s,null,"delete-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case 46:if(e.preventDefault(),t===n){const n=i.charAt(t),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t)+i.slice(t+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t+1,t+1):s=i.slice(0,t)+i.slice(t+1);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t)+n+i.slice(t+1)}else 1===u?(s=i.slice(0,t)+"0"+i.slice(t+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,t)+i.slice(t+1)}this.updateValue(e,s,null,"delete-back-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range")}},onInputKeyPress(e){e.preventDefault();let t=e.which||e.keyCode,n=String.fromCharCode(t);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=t&&t<=57||s||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:s})},onPaste(e){e.preventDefault();let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(e){return!(!this._minusSign.test(e)&&"-"!==e)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(e){let t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:t,decimalCharIndexWithoutPrefix:n}},getCharIndexes(e){const t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.search(this._minusSign);this._minusSign.lastIndex=0;const i=e.search(this._suffix);this._suffix.lastIndex=0;const s=e.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:t,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(e,t,n={isDecimalSign:!1,isMinusSign:!1}){const i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let c;if(n.isMinusSign)0===s&&(c=u,-1!==a&&0===r||(c=this.insertText(u,t,0,r)),this.updateValue(e,c,t,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(e,u,t,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(c=this.insertText(u,t,s,r),this.updateValue(e,c,t,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+t.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;c=u.slice(0,s)+t+u.slice(s+t.length,n)+u.slice(n),this.updateValue(e,c,t,i)}}else c=this.insertText(u,t,s,r),this.updateValue(e,c,t,i)}},insertText(e,t,n,i){if(2===("."===t?t:t.split(".")).length){const s=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)},deleteRange(e,t,n){let i;return i=n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n),i},initCursor(){let e=this.$refs.input.$el.selectionStart,t=this.$refs.input.$el.value,n=t.length,i=null,s=(this.prefixChar||"").length;t=t.replace(this._prefix,""),e-=s;let r=t.charAt(e);if(this.isNumeralChar(r))return e+s;let u=e-1;for(;u>=0;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=e;u<n;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){this.initCursor()},isNumeralChar(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(e,t,n,i){let s=this.$refs.input.$el.value,r=null;null!=t&&(r=this.parseValue(t),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,t),this.handleOnInput(e,s,r))},handleOnInput(e,t,n){this.isValueChanged(t,n)&&this.$emit("input",{originalEvent:e,value:n})},isValueChanged(e,t){if(null===t&&null!==e)return!0;if(null!=t){return t!==("string"==typeof e?this.parseValue(e):e)}return!1},validateValue(e){return"-"===e||null==e?null:null!=this.min&&e<this.min?this.min:null!=this.max&&e>this.max?this.max:e},updateInput(e,t,n,i){t=t||"";let s=this.$refs.input.$el.value,r=this.formatValue(e),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length;this.$refs.input.$el.setSelectionRange(e,e)}else{let e=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,e)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=t.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let e=s.charAt(i-1),t=s.charAt(i),n=u-l,r=this._group.test(t);r&&1===n?i+=1:!r&&this.isNumeralChar(e)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length+1;this.$refs.input.$el.setSelectionRange(e,e)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",e)},concatValues(e,t){if(e&&t){let n=t.search(this._decimal);return this._decimal.lastIndex=0,-1!==n?e.split(this._decimal)[0]+t.slice(n):e}return e},getDecimalLength(e){if(e){const t=e.split(this._decimal);if(2===t.length)return t[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(e,t){this.$emit("update:modelValue",t)},onInputFocus(){this.focused=!0},onInputBlur(e){this.focused=!1;let t=e.target,n=this.validateValue(this.parseValue(t.value));t.value=this.formatValue(n),t.setAttribute("aria-valuenow",n),this.updateModel(e,n)},clearTimer(){this.timer&&clearInterval(this.timer)}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",this.class,{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:e=>this.onUpButtonMouseDown(e),mouseup:e=>this.onUpButtonMouseUp(e),mouseleave:e=>this.onUpButtonMouseLeave(e),keydown:e=>this.onUpButtonKeyDown(e),keyup:e=>this.onUpButtonKeyUp(e)}},downButtonListeners(){return{mousedown:e=>this.onDownButtonMouseDown(e),mouseup:e=>this.onDownButtonMouseUp(e),mouseleave:e=>this.onDownButtonMouseLeave(e),keydown:e=>this.onDownButtonKeyDown(e),keyup:e=>this.onDownButtonKeyUp(e)}},formattedValue(){const e=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(e)},getFormatter(){return this.numberFormat}},components:{INInputText:s.default,INButton:r.default}};const l={key:0,class:"p-inputnumber-button-group"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-inputnumber {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\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.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.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\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.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),u.render=function(e,t,i,s,r,u){const a=n.resolveComponent("INInputText"),o=n.resolveComponent("INButton");return n.openBlock(),n.createBlock("span",{class:u.containerClass,style:i.style},[n.createVNode(a,n.mergeProps({ref:"input",class:["p-inputnumber-input",i.inputClass],style:i.inputStyle,value:u.formattedValue},e.$attrs,{"aria-valumin":i.min,"aria-valuemax":i.max,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&"stacked"===i.buttonLayout?(n.openBlock(),n.createBlock("span",l,[n.createVNode(o,n.mergeProps({class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"]),n.createVNode(o,n.mergeProps({class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:1,class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:2,class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0)],6)},module.exports=u;
1
+ "use strict";var e=require("primevue/inputtext"),t=require("primevue/button"),n=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),r=i(t),u={name:"InputNumber",inheritAttrs:!1,emits:["update:modelValue","input"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},style:null,class:null,inputStyle:null,inputClass:null},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data(){return{d_modelValue:this.modelValue,focused:!1}},watch:{modelValue(e){this.d_modelValue=e},locale(e,t){this.updateConstructParser(e,t)},localeMatcher(e,t){this.updateConstructParser(e,t)},mode(e,t){this.updateConstructParser(e,t)},currency(e,t){this.updateConstructParser(e,t)},currencyDisplay(e,t){this.updateConstructParser(e,t)},useGrouping(e,t){this.updateConstructParser(e,t)},minFractionDigits(e,t){this.updateConstructParser(e,t)},maxFractionDigits(e,t){this.updateConstructParser(e,t)},suffix(e,t){this.updateConstructParser(e,t)},prefix(e,t){this.updateConstructParser(e,t)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const e=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),t=new Map(e.map(((e,t)=>[e,t])));this._numeral=new RegExp(`[${e.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=e=>t.get(e)},updateConstructParser(e,t){e!==t&&this.constructParser()},escapeRegExp:e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const e=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${e.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${e.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const e=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(e){if(null!=e){if("-"===e)return e;if(this.format){let t=new Intl.NumberFormat(this.locale,this.getOptions()).format(e);return this.prefix&&(t=this.prefix+t),this.suffix&&(t+=this.suffix),t}return e.toString()}return""},parseValue(e){let t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;let e=+t;return isNaN(e)?null:e}return null},repeat(e,t,n){let i=t||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(e,40,n)}),i),this.spin(e,n)},spin(e,t){if(this.$refs.input){let n=this.step*t,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(e,s),this.handleOnInput(e,i,s)}},onUpButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(e){if(this.lastValue=e.target.value,e.shiftKey||e.altKey)return void(this.isSpecialChar=!0);let t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,s=null;switch(e.altKey&&e.preventDefault(),e.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case 39:this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(e,s);break;case 8:if(e.preventDefault(),t===n){const n=i.charAt(t-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t-2)+i.slice(t-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t-1,t-1):s=i.slice(0,t-1)+i.slice(t);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t-1)+n+i.slice(t)}else 1===u?(s=i.slice(0,t-1)+"0"+i.slice(t),s=this.parseValue(s)>0?s:""):s=i.slice(0,t-1)+i.slice(t)}this.updateValue(e,s,null,"delete-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case 46:if(e.preventDefault(),t===n){const n=i.charAt(t),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t)+i.slice(t+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t+1,t+1):s=i.slice(0,t)+i.slice(t+1);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t)+n+i.slice(t+1)}else 1===u?(s=i.slice(0,t)+"0"+i.slice(t+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,t)+i.slice(t+1)}this.updateValue(e,s,null,"delete-back-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range")}},onInputKeyPress(e){e.preventDefault();let t=e.which||e.keyCode,n=String.fromCharCode(t);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=t&&t<=57||s||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:s})},onPaste(e){e.preventDefault();let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(e){return!(!this._minusSign.test(e)&&"-"!==e)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(e){let t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:t,decimalCharIndexWithoutPrefix:n}},getCharIndexes(e){const t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.search(this._minusSign);this._minusSign.lastIndex=0;const i=e.search(this._suffix);this._suffix.lastIndex=0;const s=e.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:t,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(e,t,n={isDecimalSign:!1,isMinusSign:!1}){const i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let h;if(n.isMinusSign)0===s&&(h=u,-1!==a&&0===r||(h=this.insertText(u,t,0,r)),this.updateValue(e,h,t,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(e,u,t,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(h=this.insertText(u,t,s,r),this.updateValue(e,h,t,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+t.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;h=u.slice(0,s)+t+u.slice(s+t.length,n)+u.slice(n),this.updateValue(e,h,t,i)}}else h=this.insertText(u,t,s,r),this.updateValue(e,h,t,i)}},insertText(e,t,n,i){if(2===("."===t?t:t.split(".")).length){const s=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)},deleteRange(e,t,n){let i;return i=n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n),i},initCursor(){let e=this.$refs.input.$el.selectionStart,t=this.$refs.input.$el.value,n=t.length,i=null,s=(this.prefixChar||"").length;t=t.replace(this._prefix,""),e-=s;let r=t.charAt(e);if(this.isNumeralChar(r))return e+s;let u=e-1;for(;u>=0;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=e;u<n;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){this.initCursor()},isNumeralChar(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(e,t,n,i){let s=this.$refs.input.$el.value,r=null;null!=t&&(r=this.parseValue(t),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,t),this.handleOnInput(e,s,r))},handleOnInput(e,t,n){this.isValueChanged(t,n)&&this.$emit("input",{originalEvent:e,value:n})},isValueChanged(e,t){if(null===t&&null!==e)return!0;if(null!=t){return t!==("string"==typeof e?this.parseValue(e):e)}return!1},validateValue(e){return"-"===e||null==e?null:null!=this.min&&e<this.min?this.min:null!=this.max&&e>this.max?this.max:e},updateInput(e,t,n,i){t=t||"";let s=this.$refs.input.$el.value,r=this.formatValue(e),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length;this.$refs.input.$el.setSelectionRange(e,e)}else{let e=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,e)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=t.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let e=s.charAt(i-1),t=s.charAt(i),n=u-l,r=this._group.test(t);r&&1===n?i+=1:!r&&this.isNumeralChar(e)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length+1;this.$refs.input.$el.setSelectionRange(e,e)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",e)},concatValues(e,t){if(e&&t){let n=t.search(this._decimal);return this._decimal.lastIndex=0,-1!==n?e.split(this._decimal)[0]+t.slice(n):e}return e},getDecimalLength(e){if(e){const t=e.split(this._decimal);if(2===t.length)return t[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(e,t){this.d_modelValue=t,this.$emit("update:modelValue",t)},onInputFocus(){this.focused=!0},onInputBlur(e){this.focused=!1;let t=e.target,n=this.validateValue(this.parseValue(t.value));t.value=this.formatValue(n),t.setAttribute("aria-valuenow",n),this.updateModel(e,n)},clearTimer(){this.timer&&clearInterval(this.timer)},maxBoundry(){return this.d_modelValue>=this.max},minBoundry(){return this.d_modelValue<=this.min}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",this.class,{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass,{"p-disabled":this.showButtons&&null!==this.max&&this.maxBoundry()}]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass,{"p-disabled":this.showButtons&&null!==this.min&&this.minBoundry()}]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:e=>this.onUpButtonMouseDown(e),mouseup:e=>this.onUpButtonMouseUp(e),mouseleave:e=>this.onUpButtonMouseLeave(e),keydown:e=>this.onUpButtonKeyDown(e),keyup:e=>this.onUpButtonKeyUp(e)}},downButtonListeners(){return{mousedown:e=>this.onDownButtonMouseDown(e),mouseup:e=>this.onDownButtonMouseUp(e),mouseleave:e=>this.onDownButtonMouseLeave(e),keydown:e=>this.onDownButtonKeyDown(e),keyup:e=>this.onDownButtonKeyUp(e)}},formattedValue(){const e=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(e)},getFormatter(){return this.numberFormat}},components:{INInputText:s.default,INButton:r.default}};const l={key:0,class:"p-inputnumber-button-group"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-inputnumber {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\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.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.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\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.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),u.render=function(e,t,i,s,r,u){const a=n.resolveComponent("INInputText"),o=n.resolveComponent("INButton");return n.openBlock(),n.createBlock("span",{class:u.containerClass,style:i.style},[n.createVNode(a,n.mergeProps({ref:"input",class:["p-inputnumber-input",i.inputClass],style:i.inputStyle,value:u.formattedValue},e.$attrs,{"aria-valumin":i.min,"aria-valuemax":i.max,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&"stacked"===i.buttonLayout?(n.openBlock(),n.createBlock("span",l,[n.createVNode(o,n.mergeProps({class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"]),n.createVNode(o,n.mergeProps({class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:1,class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:2,class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0)],6)},module.exports=u;
@@ -116,10 +116,14 @@ var script = {
116
116
  timer: null,
117
117
  data() {
118
118
  return {
119
+ d_modelValue: this.modelValue,
119
120
  focused: false
120
121
  }
121
122
  },
122
123
  watch: {
124
+ modelValue(newValue) {
125
+ this.d_modelValue = newValue;
126
+ },
123
127
  locale(newValue, oldValue) {
124
128
  this.updateConstructParser(newValue, oldValue);
125
129
  },
@@ -875,6 +879,7 @@ var script = {
875
879
  return 0;
876
880
  },
877
881
  updateModel(event, value) {
882
+ this.d_modelValue = value;
878
883
  this.$emit('update:modelValue', value);
879
884
  },
880
885
  onInputFocus() {
@@ -893,7 +898,13 @@ var script = {
893
898
  if (this.timer) {
894
899
  clearInterval(this.timer);
895
900
  }
896
- }
901
+ },
902
+ maxBoundry() {
903
+ return this.d_modelValue >= this.max;
904
+ },
905
+ minBoundry() {
906
+ return this.d_modelValue <= this.min;
907
+ },
897
908
  },
898
909
  computed: {
899
910
  containerClass() {
@@ -905,11 +916,16 @@ var script = {
905
916
  'p-inputnumber-buttons-vertical': this.showButtons && this.buttonLayout === 'vertical'
906
917
  }];
907
918
  },
919
+
908
920
  upButtonClass() {
909
- return ['p-inputnumber-button p-inputnumber-button-up', this.incrementButtonClass];
921
+ return ['p-inputnumber-button p-inputnumber-button-up', this.incrementButtonClass, {
922
+ 'p-disabled': this.showButtons && this.max !== null && this.maxBoundry()
923
+ }];
910
924
  },
911
925
  downButtonClass() {
912
- return ['p-inputnumber-button p-inputnumber-button-down', this.decrementButtonClass];
926
+ return ['p-inputnumber-button p-inputnumber-button-down', this.decrementButtonClass, {
927
+ 'p-disabled': this.showButtons && this.min !== null && this.minBoundry()
928
+ }];
913
929
  },
914
930
  filled() {
915
931
  return (this.modelValue != null && this.modelValue.toString().length > 0)
@@ -1 +1 @@
1
- import t from"primevue/inputtext";import e from"primevue/button";import{resolveComponent as n,openBlock as i,createBlock as s,createVNode as r,mergeProps as u,toHandlers as l,createCommentVNode as a}from"vue";var o={name:"InputNumber",inheritAttrs:!1,emits:["update:modelValue","input"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},style:null,class:null,inputStyle:null,inputClass:null},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data:()=>({focused:!1}),watch:{locale(t,e){this.updateConstructParser(t,e)},localeMatcher(t,e){this.updateConstructParser(t,e)},mode(t,e){this.updateConstructParser(t,e)},currency(t,e){this.updateConstructParser(t,e)},currencyDisplay(t,e){this.updateConstructParser(t,e)},useGrouping(t,e){this.updateConstructParser(t,e)},minFractionDigits(t,e){this.updateConstructParser(t,e)},maxFractionDigits(t,e){this.updateConstructParser(t,e)},suffix(t,e){this.updateConstructParser(t,e)},prefix(t,e){this.updateConstructParser(t,e)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const t=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),e=new Map(t.map(((t,e)=>[t,e])));this._numeral=new RegExp(`[${t.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=t=>e.get(t)},updateConstructParser(t,e){t!==e&&this.constructParser()},escapeRegExp:t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const t=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${t.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=t.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const t=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${t.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=t.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=t.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(t){if(null!=t){if("-"===t)return t;if(this.format){let e=new Intl.NumberFormat(this.locale,this.getOptions()).format(t);return this.prefix&&(e=this.prefix+e),this.suffix&&(e+=this.suffix),e}return t.toString()}return""},parseValue(t){let e=t.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(e){if("-"===e)return e;let t=+e;return isNaN(t)?null:t}return null},repeat(t,e,n){let i=e||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(t,40,n)}),i),this.spin(t,n)},spin(t,e){if(this.$refs.input){let n=this.step*e,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(t,s),this.handleOnInput(t,i,s)}},onUpButtonMouseDown(t){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,1),t.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(t){32!==t.keyCode&&13!==t.keyCode||this.repeat(t,null,1)},onDownButtonMouseDown(t){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,-1),t.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyDown(t){32!==t.keyCode&&13!==t.keyCode||this.repeat(t,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(t){if(this.lastValue=t.target.value,t.shiftKey||t.altKey)return void(this.isSpecialChar=!0);let e=t.target.selectionStart,n=t.target.selectionEnd,i=t.target.value,s=null;switch(t.altKey&&t.preventDefault(),t.which){case 38:this.spin(t,1),t.preventDefault();break;case 40:this.spin(t,-1),t.preventDefault();break;case 37:this.isNumeralChar(i.charAt(e-1))||t.preventDefault();break;case 39:this.isNumeralChar(i.charAt(e))||t.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(t,s);break;case 8:if(t.preventDefault(),e===n){const n=i.charAt(e-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const t=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,e-2)+i.slice(e-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,t?this.$refs.input.$el.setSelectionRange(e-1,e-1):s=i.slice(0,e-1)+i.slice(e);else if(r>0&&e>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<t?"":"0";s=i.slice(0,e-1)+n+i.slice(e)}else 1===u?(s=i.slice(0,e-1)+"0"+i.slice(e),s=this.parseValue(s)>0?s:""):s=i.slice(0,e-1)+i.slice(e)}this.updateValue(t,s,null,"delete-single")}else s=this.deleteRange(i,e,n),this.updateValue(t,s,null,"delete-range");break;case 46:if(t.preventDefault(),e===n){const n=i.charAt(e),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const t=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,e)+i.slice(e+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,t?this.$refs.input.$el.setSelectionRange(e+1,e+1):s=i.slice(0,e)+i.slice(e+1);else if(r>0&&e>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<t?"":"0";s=i.slice(0,e)+n+i.slice(e+1)}else 1===u?(s=i.slice(0,e)+"0"+i.slice(e+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,e)+i.slice(e+1)}this.updateValue(t,s,null,"delete-back-single")}else s=this.deleteRange(i,e,n),this.updateValue(t,s,null,"delete-range")}},onInputKeyPress(t){t.preventDefault();let e=t.which||t.keyCode,n=String.fromCharCode(e);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=e&&e<=57||s||i)&&this.insert(t,n,{isDecimalSign:i,isMinusSign:s})},onPaste(t){t.preventDefault();let e=(t.clipboardData||window.clipboardData).getData("Text");if(e){let n=this.parseValue(e);null!=n&&this.insert(t,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(t){return!(!this._minusSign.test(t)&&"-"!==t)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(t){return!!this._decimal.test(t)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(t){let e=t.search(this._decimal);this._decimal.lastIndex=0;const n=t.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:e,decimalCharIndexWithoutPrefix:n}},getCharIndexes(t){const e=t.search(this._decimal);this._decimal.lastIndex=0;const n=t.search(this._minusSign);this._minusSign.lastIndex=0;const i=t.search(this._suffix);this._suffix.lastIndex=0;const s=t.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:e,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(t,e,n={isDecimalSign:!1,isMinusSign:!1}){const i=e.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let h;if(n.isMinusSign)0===s&&(h=u,-1!==a&&0===r||(h=this.insertText(u,e,0,r)),this.updateValue(t,h,e,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(t,u,e,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(h=this.insertText(u,e,s,r),this.updateValue(t,h,e,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+e.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;h=u.slice(0,s)+e+u.slice(s+e.length,n)+u.slice(n),this.updateValue(t,h,e,i)}}else h=this.insertText(u,e,s,r),this.updateValue(t,h,e,i)}},insertText(t,e,n,i){if(2===("."===e?e:e.split(".")).length){const s=t.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?t.slice(0,n)+this.formatValue(e)+t.slice(i):t||this.formatValue(e)}return i-n===t.length?this.formatValue(e):0===n?e+t.slice(i):i===t.length?t.slice(0,n)+e:t.slice(0,n)+e+t.slice(i)},deleteRange(t,e,n){let i;return i=n-e===t.length?"":0===e?t.slice(n):n===t.length?t.slice(0,e):t.slice(0,e)+t.slice(n),i},initCursor(){let t=this.$refs.input.$el.selectionStart,e=this.$refs.input.$el.value,n=e.length,i=null,s=(this.prefixChar||"").length;e=e.replace(this._prefix,""),t-=s;let r=e.charAt(t);if(this.isNumeralChar(r))return t+s;let u=t-1;for(;u>=0;){if(r=e.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=t;u<n;){if(r=e.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){this.initCursor()},isNumeralChar(t){return!(1!==t.length||!(this._numeral.test(t)||this._decimal.test(t)||this._group.test(t)||this._minusSign.test(t)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(t,e,n,i){let s=this.$refs.input.$el.value,r=null;null!=e&&(r=this.parseValue(e),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,e),this.handleOnInput(t,s,r))},handleOnInput(t,e,n){this.isValueChanged(e,n)&&this.$emit("input",{originalEvent:t,value:n})},isValueChanged(t,e){if(null===e&&null!==t)return!0;if(null!=e){return e!==("string"==typeof t?this.parseValue(t):t)}return!1},validateValue(t){return"-"===t||null==t?null:null!=this.min&&t<this.min?this.min:null!=this.max&&t>this.max?this.max:t},updateInput(t,e,n,i){e=e||"";let s=this.$refs.input.$el.value,r=this.formatValue(t),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const t=this.initCursor()+e.length;this.$refs.input.$el.setSelectionRange(t,t)}else{let t=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,t)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=e.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let t=s.charAt(i-1),e=s.charAt(i),n=u-l,r=this._group.test(e);r&&1===n?i+=1:!r&&this.isNumeralChar(t)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const t=this.initCursor()+e.length+1;this.$refs.input.$el.setSelectionRange(t,t)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",t)},concatValues(t,e){if(t&&e){let n=e.search(this._decimal);return this._decimal.lastIndex=0,-1!==n?t.split(this._decimal)[0]+e.slice(n):t}return t},getDecimalLength(t){if(t){const e=t.split(this._decimal);if(2===e.length)return e[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(t,e){this.$emit("update:modelValue",e)},onInputFocus(){this.focused=!0},onInputBlur(t){this.focused=!1;let e=t.target,n=this.validateValue(this.parseValue(e.value));e.value=this.formatValue(n),e.setAttribute("aria-valuenow",n),this.updateModel(t,n)},clearTimer(){this.timer&&clearInterval(this.timer)}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",this.class,{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:t=>this.onUpButtonMouseDown(t),mouseup:t=>this.onUpButtonMouseUp(t),mouseleave:t=>this.onUpButtonMouseLeave(t),keydown:t=>this.onUpButtonKeyDown(t),keyup:t=>this.onUpButtonKeyUp(t)}},downButtonListeners(){return{mousedown:t=>this.onDownButtonMouseDown(t),mouseup:t=>this.onDownButtonMouseUp(t),mouseleave:t=>this.onDownButtonMouseLeave(t),keydown:t=>this.onDownButtonKeyDown(t),keyup:t=>this.onDownButtonKeyUp(t)}},formattedValue(){const t=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(t)},getFormatter(){return this.numberFormat}},components:{INInputText:t,INButton:e}};const p={key:0,class:"p-inputnumber-button-group"};!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}("\n.p-inputnumber {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\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.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.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\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.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),o.render=function(t,e,o,h,c,d){const m=n("INInputText"),f=n("INButton");return i(),s("span",{class:d.containerClass,style:o.style},[r(m,u({ref:"input",class:["p-inputnumber-input",o.inputClass],style:o.inputStyle,value:d.formattedValue},t.$attrs,{"aria-valumin":o.min,"aria-valuemax":o.max,onInput:d.onUserInput,onKeydown:d.onInputKeyDown,onKeypress:d.onInputKeyPress,onPaste:d.onPaste,onClick:d.onInputClick,onFocus:d.onInputFocus,onBlur:d.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),o.showButtons&&"stacked"===o.buttonLayout?(i(),s("span",p,[r(f,u({class:d.upButtonClass,icon:o.incrementButtonIcon},l(d.upButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"]),r(f,u({class:d.downButtonClass,icon:o.decrementButtonIcon},l(d.downButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])])):a("",!0),o.showButtons&&"stacked"!==o.buttonLayout?(i(),s(f,u({key:1,class:d.upButtonClass,icon:o.incrementButtonIcon},l(d.upButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])):a("",!0),o.showButtons&&"stacked"!==o.buttonLayout?(i(),s(f,u({key:2,class:d.downButtonClass,icon:o.decrementButtonIcon},l(d.downButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])):a("",!0)],6)};export default o;
1
+ import t from"primevue/inputtext";import e from"primevue/button";import{resolveComponent as n,openBlock as i,createBlock as s,createVNode as r,mergeProps as u,toHandlers as l,createCommentVNode as a}from"vue";var o={name:"InputNumber",inheritAttrs:!1,emits:["update:modelValue","input"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},style:null,class:null,inputStyle:null,inputClass:null},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data(){return{d_modelValue:this.modelValue,focused:!1}},watch:{modelValue(t){this.d_modelValue=t},locale(t,e){this.updateConstructParser(t,e)},localeMatcher(t,e){this.updateConstructParser(t,e)},mode(t,e){this.updateConstructParser(t,e)},currency(t,e){this.updateConstructParser(t,e)},currencyDisplay(t,e){this.updateConstructParser(t,e)},useGrouping(t,e){this.updateConstructParser(t,e)},minFractionDigits(t,e){this.updateConstructParser(t,e)},maxFractionDigits(t,e){this.updateConstructParser(t,e)},suffix(t,e){this.updateConstructParser(t,e)},prefix(t,e){this.updateConstructParser(t,e)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const t=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),e=new Map(t.map(((t,e)=>[t,e])));this._numeral=new RegExp(`[${t.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=t=>e.get(t)},updateConstructParser(t,e){t!==e&&this.constructParser()},escapeRegExp:t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const t=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${t.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=t.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const t=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${t.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=t.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=t.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(t){if(null!=t){if("-"===t)return t;if(this.format){let e=new Intl.NumberFormat(this.locale,this.getOptions()).format(t);return this.prefix&&(e=this.prefix+e),this.suffix&&(e+=this.suffix),e}return t.toString()}return""},parseValue(t){let e=t.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(e){if("-"===e)return e;let t=+e;return isNaN(t)?null:t}return null},repeat(t,e,n){let i=e||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(t,40,n)}),i),this.spin(t,n)},spin(t,e){if(this.$refs.input){let n=this.step*e,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(t,s),this.handleOnInput(t,i,s)}},onUpButtonMouseDown(t){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,1),t.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(t){32!==t.keyCode&&13!==t.keyCode||this.repeat(t,null,1)},onDownButtonMouseDown(t){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,-1),t.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyDown(t){32!==t.keyCode&&13!==t.keyCode||this.repeat(t,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(t){if(this.lastValue=t.target.value,t.shiftKey||t.altKey)return void(this.isSpecialChar=!0);let e=t.target.selectionStart,n=t.target.selectionEnd,i=t.target.value,s=null;switch(t.altKey&&t.preventDefault(),t.which){case 38:this.spin(t,1),t.preventDefault();break;case 40:this.spin(t,-1),t.preventDefault();break;case 37:this.isNumeralChar(i.charAt(e-1))||t.preventDefault();break;case 39:this.isNumeralChar(i.charAt(e))||t.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(t,s);break;case 8:if(t.preventDefault(),e===n){const n=i.charAt(e-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const t=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,e-2)+i.slice(e-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,t?this.$refs.input.$el.setSelectionRange(e-1,e-1):s=i.slice(0,e-1)+i.slice(e);else if(r>0&&e>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<t?"":"0";s=i.slice(0,e-1)+n+i.slice(e)}else 1===u?(s=i.slice(0,e-1)+"0"+i.slice(e),s=this.parseValue(s)>0?s:""):s=i.slice(0,e-1)+i.slice(e)}this.updateValue(t,s,null,"delete-single")}else s=this.deleteRange(i,e,n),this.updateValue(t,s,null,"delete-range");break;case 46:if(t.preventDefault(),e===n){const n=i.charAt(e),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const t=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,e)+i.slice(e+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,t?this.$refs.input.$el.setSelectionRange(e+1,e+1):s=i.slice(0,e)+i.slice(e+1);else if(r>0&&e>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<t?"":"0";s=i.slice(0,e)+n+i.slice(e+1)}else 1===u?(s=i.slice(0,e)+"0"+i.slice(e+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,e)+i.slice(e+1)}this.updateValue(t,s,null,"delete-back-single")}else s=this.deleteRange(i,e,n),this.updateValue(t,s,null,"delete-range")}},onInputKeyPress(t){t.preventDefault();let e=t.which||t.keyCode,n=String.fromCharCode(e);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=e&&e<=57||s||i)&&this.insert(t,n,{isDecimalSign:i,isMinusSign:s})},onPaste(t){t.preventDefault();let e=(t.clipboardData||window.clipboardData).getData("Text");if(e){let n=this.parseValue(e);null!=n&&this.insert(t,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(t){return!(!this._minusSign.test(t)&&"-"!==t)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(t){return!!this._decimal.test(t)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(t){let e=t.search(this._decimal);this._decimal.lastIndex=0;const n=t.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:e,decimalCharIndexWithoutPrefix:n}},getCharIndexes(t){const e=t.search(this._decimal);this._decimal.lastIndex=0;const n=t.search(this._minusSign);this._minusSign.lastIndex=0;const i=t.search(this._suffix);this._suffix.lastIndex=0;const s=t.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:e,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(t,e,n={isDecimalSign:!1,isMinusSign:!1}){const i=e.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let h;if(n.isMinusSign)0===s&&(h=u,-1!==a&&0===r||(h=this.insertText(u,e,0,r)),this.updateValue(t,h,e,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(t,u,e,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(h=this.insertText(u,e,s,r),this.updateValue(t,h,e,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+e.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;h=u.slice(0,s)+e+u.slice(s+e.length,n)+u.slice(n),this.updateValue(t,h,e,i)}}else h=this.insertText(u,e,s,r),this.updateValue(t,h,e,i)}},insertText(t,e,n,i){if(2===("."===e?e:e.split(".")).length){const s=t.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?t.slice(0,n)+this.formatValue(e)+t.slice(i):t||this.formatValue(e)}return i-n===t.length?this.formatValue(e):0===n?e+t.slice(i):i===t.length?t.slice(0,n)+e:t.slice(0,n)+e+t.slice(i)},deleteRange(t,e,n){let i;return i=n-e===t.length?"":0===e?t.slice(n):n===t.length?t.slice(0,e):t.slice(0,e)+t.slice(n),i},initCursor(){let t=this.$refs.input.$el.selectionStart,e=this.$refs.input.$el.value,n=e.length,i=null,s=(this.prefixChar||"").length;e=e.replace(this._prefix,""),t-=s;let r=e.charAt(t);if(this.isNumeralChar(r))return t+s;let u=t-1;for(;u>=0;){if(r=e.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=t;u<n;){if(r=e.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){this.initCursor()},isNumeralChar(t){return!(1!==t.length||!(this._numeral.test(t)||this._decimal.test(t)||this._group.test(t)||this._minusSign.test(t)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(t,e,n,i){let s=this.$refs.input.$el.value,r=null;null!=e&&(r=this.parseValue(e),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,e),this.handleOnInput(t,s,r))},handleOnInput(t,e,n){this.isValueChanged(e,n)&&this.$emit("input",{originalEvent:t,value:n})},isValueChanged(t,e){if(null===e&&null!==t)return!0;if(null!=e){return e!==("string"==typeof t?this.parseValue(t):t)}return!1},validateValue(t){return"-"===t||null==t?null:null!=this.min&&t<this.min?this.min:null!=this.max&&t>this.max?this.max:t},updateInput(t,e,n,i){e=e||"";let s=this.$refs.input.$el.value,r=this.formatValue(t),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const t=this.initCursor()+e.length;this.$refs.input.$el.setSelectionRange(t,t)}else{let t=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,t)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=e.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let t=s.charAt(i-1),e=s.charAt(i),n=u-l,r=this._group.test(e);r&&1===n?i+=1:!r&&this.isNumeralChar(t)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const t=this.initCursor()+e.length+1;this.$refs.input.$el.setSelectionRange(t,t)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",t)},concatValues(t,e){if(t&&e){let n=e.search(this._decimal);return this._decimal.lastIndex=0,-1!==n?t.split(this._decimal)[0]+e.slice(n):t}return t},getDecimalLength(t){if(t){const e=t.split(this._decimal);if(2===e.length)return e[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(t,e){this.d_modelValue=e,this.$emit("update:modelValue",e)},onInputFocus(){this.focused=!0},onInputBlur(t){this.focused=!1;let e=t.target,n=this.validateValue(this.parseValue(e.value));e.value=this.formatValue(n),e.setAttribute("aria-valuenow",n),this.updateModel(t,n)},clearTimer(){this.timer&&clearInterval(this.timer)},maxBoundry(){return this.d_modelValue>=this.max},minBoundry(){return this.d_modelValue<=this.min}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",this.class,{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass,{"p-disabled":this.showButtons&&null!==this.max&&this.maxBoundry()}]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass,{"p-disabled":this.showButtons&&null!==this.min&&this.minBoundry()}]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:t=>this.onUpButtonMouseDown(t),mouseup:t=>this.onUpButtonMouseUp(t),mouseleave:t=>this.onUpButtonMouseLeave(t),keydown:t=>this.onUpButtonKeyDown(t),keyup:t=>this.onUpButtonKeyUp(t)}},downButtonListeners(){return{mousedown:t=>this.onDownButtonMouseDown(t),mouseup:t=>this.onDownButtonMouseUp(t),mouseleave:t=>this.onDownButtonMouseLeave(t),keydown:t=>this.onDownButtonKeyDown(t),keyup:t=>this.onDownButtonKeyUp(t)}},formattedValue(){const t=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(t)},getFormatter(){return this.numberFormat}},components:{INInputText:t,INButton:e}};const p={key:0,class:"p-inputnumber-button-group"};!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}("\n.p-inputnumber {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\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.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.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\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.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),o.render=function(t,e,o,h,c,d){const m=n("INInputText"),f=n("INButton");return i(),s("span",{class:d.containerClass,style:o.style},[r(m,u({ref:"input",class:["p-inputnumber-input",o.inputClass],style:o.inputStyle,value:d.formattedValue},t.$attrs,{"aria-valumin":o.min,"aria-valuemax":o.max,onInput:d.onUserInput,onKeydown:d.onInputKeyDown,onKeypress:d.onInputKeyPress,onPaste:d.onPaste,onClick:d.onInputClick,onFocus:d.onInputFocus,onBlur:d.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),o.showButtons&&"stacked"===o.buttonLayout?(i(),s("span",p,[r(f,u({class:d.upButtonClass,icon:o.incrementButtonIcon},l(d.upButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"]),r(f,u({class:d.downButtonClass,icon:o.decrementButtonIcon},l(d.downButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])])):a("",!0),o.showButtons&&"stacked"!==o.buttonLayout?(i(),s(f,u({key:1,class:d.upButtonClass,icon:o.incrementButtonIcon},l(d.upButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])):a("",!0),o.showButtons&&"stacked"!==o.buttonLayout?(i(),s(f,u({key:2,class:d.downButtonClass,icon:o.decrementButtonIcon},l(d.downButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])):a("",!0)],6)};export default o;