vxe-pc-ui 4.20.34 → 4.20.35

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 (367) hide show
  1. package/dist/all.esm.js +45718 -45038
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +307 -1
  4. package/dist/style.mini.css +1 -1
  5. package/es/alert/src/alert.js +117 -114
  6. package/es/anchor/src/anchor-link.js +110 -107
  7. package/es/anchor/src/anchor.js +212 -209
  8. package/es/avatar/src/avatar.js +132 -129
  9. package/es/backtop/src/backtop.js +267 -264
  10. package/es/badge/src/badge.js +102 -99
  11. package/es/breadcrumb/src/breadcrumb-item.js +104 -101
  12. package/es/breadcrumb/src/breadcrumb.js +70 -67
  13. package/es/button/src/button-group.js +88 -85
  14. package/es/calendar/src/calendar.js +1371 -1368
  15. package/es/card/src/card.js +235 -232
  16. package/es/carousel/src/carousel-item.js +78 -75
  17. package/es/carousel/src/carousel.js +392 -389
  18. package/es/cascader/src/cascader.js +1667 -1664
  19. package/es/checkbox/src/button.js +198 -195
  20. package/es/checkbox/src/checkbox.js +181 -178
  21. package/es/checkbox/src/group.js +210 -207
  22. package/es/collapse/src/collapse-pane.js +98 -95
  23. package/es/collapse/src/collapse.js +340 -337
  24. package/es/color-picker/src/color-picker.js +1116 -1113
  25. package/es/components.d.ts +1 -0
  26. package/es/components.js +3 -0
  27. package/es/context-menu/src/context-menu.js +601 -598
  28. package/es/countdown/src/countdown.js +224 -221
  29. package/es/date-panel/src/date-panel.js +1905 -1902
  30. package/es/date-picker/src/date-picker.js +1537 -1534
  31. package/es/date-range-picker/src/date-range-picker.js +1412 -1409
  32. package/es/divider/src/divider.js +80 -77
  33. package/es/drawer/src/drawer.js +778 -775
  34. package/es/empty/src/empty.js +100 -97
  35. package/es/form/src/form-group.js +74 -71
  36. package/es/form/src/form-item.js +76 -73
  37. package/es/form/src/form.js +789 -786
  38. package/es/icon/src/icon.js +59 -56
  39. package/es/icon/style.css +1 -1
  40. package/es/icon/style.mini.css +1 -1
  41. package/es/icon-picker/src/icon-picker.js +719 -716
  42. package/es/image/src/group.js +130 -127
  43. package/es/image/src/image.js +243 -240
  44. package/es/image/src/preview.js +627 -624
  45. package/es/index.esm.js +2 -0
  46. package/es/index.js +2 -0
  47. package/es/input/src/input.js +2700 -2697
  48. package/es/layout-aside/src/layout-aside.js +138 -135
  49. package/es/layout-body/src/layout-body.js +145 -142
  50. package/es/layout-container/src/layout-container.js +71 -68
  51. package/es/layout-footer/src/layout-footer.js +60 -57
  52. package/es/layout-header/src/layout-header.js +58 -55
  53. package/es/link/src/link.js +131 -128
  54. package/es/list/src/list.js +2174 -2171
  55. package/es/loading/src/loading.js +141 -138
  56. package/es/mention/src/mention.js +49 -46
  57. package/es/menu/src/menu.js +799 -796
  58. package/es/modal/src/modal.js +1519 -1527
  59. package/es/notice-bar/src/notice-bar.js +168 -165
  60. package/es/number-input/src/number-input.js +1094 -1091
  61. package/es/pager/src/pager.js +767 -764
  62. package/es/password-input/src/password-input.js +431 -428
  63. package/es/print/src/page-break.js +63 -60
  64. package/es/print/src/print.js +303 -300
  65. package/es/pulldown/src/pulldown.js +403 -400
  66. package/es/radio/src/button.js +214 -211
  67. package/es/radio/src/group.js +195 -192
  68. package/es/radio/src/radio.js +194 -191
  69. package/es/rate/src/rate.js +164 -161
  70. package/es/result/src/result.js +116 -113
  71. package/es/row/src/col.js +133 -130
  72. package/es/row/src/row.js +111 -108
  73. package/es/scrollbar/src/scrollbar.js +518 -515
  74. package/es/segmented/src/segmented.js +240 -237
  75. package/es/select/src/optgroup.js +44 -41
  76. package/es/select/src/option.js +39 -36
  77. package/es/select/src/select.js +1914 -1896
  78. package/es/slider/src/slider.js +419 -416
  79. package/es/space/src/space.js +190 -187
  80. package/es/splitter/src/splitter-panel.js +146 -143
  81. package/es/splitter/src/splitter.js +917 -914
  82. package/es/step-item/index.d.ts +76 -0
  83. package/es/step-item/index.js +17 -0
  84. package/es/steps/index.d.ts +288 -34
  85. package/es/steps/src/step-info.d.ts +6 -0
  86. package/es/steps/src/step-info.js +20 -0
  87. package/es/steps/src/step-item.d.ts +14 -0
  88. package/es/steps/src/step-item.js +39 -0
  89. package/es/steps/src/steps.d.ts +68 -8
  90. package/es/steps/src/steps.js +299 -47
  91. package/es/steps/src/util.d.ts +7 -0
  92. package/es/steps/src/util.js +44 -0
  93. package/es/steps/style.css +297 -0
  94. package/es/steps/style.mini.css +1 -0
  95. package/es/style.css +307 -1
  96. package/es/style.mini.css +1 -1
  97. package/es/switch/src/switch.js +228 -225
  98. package/es/table-select/src/table-select.js +865 -862
  99. package/es/table-transfer/src/table-transfer.js +61 -58
  100. package/es/tabs/src/tab-pane.js +102 -99
  101. package/es/tabs/src/tabs.js +936 -933
  102. package/es/tag/src/tag.js +163 -160
  103. package/es/text/src/text.js +232 -229
  104. package/es/text-ellipsis/src/text-ellipsis.js +252 -249
  105. package/es/textarea/src/textarea.js +434 -431
  106. package/es/timeline/src/timeline.js +74 -36
  107. package/es/timeline/src/util.js +7 -4
  108. package/es/tip/src/tip.js +117 -114
  109. package/es/tooltip/src/tooltip.js +552 -549
  110. package/es/tour/src/tour.js +49 -46
  111. package/es/transfer/src/transfer.js +95 -92
  112. package/es/tree/src/tree.js +3379 -3376
  113. package/es/tree-select/src/tree-select.js +969 -966
  114. package/es/ui/index.js +8 -2
  115. package/es/ui/src/log.js +1 -1
  116. package/es/upload/src/upload.js +1791 -1788
  117. package/es/vxe-icon/style.css +1 -1
  118. package/es/vxe-icon/style.mini.css +1 -1
  119. package/es/vxe-steps/style.css +297 -0
  120. package/es/vxe-steps/style.mini.css +1 -0
  121. package/es/watermark/src/watermark.js +158 -155
  122. package/lib/alert/src/alert.js +117 -114
  123. package/lib/anchor/src/anchor-link.js +110 -107
  124. package/lib/anchor/src/anchor.js +212 -209
  125. package/lib/avatar/src/avatar.js +132 -129
  126. package/lib/backtop/src/backtop.js +267 -264
  127. package/lib/badge/src/badge.js +102 -99
  128. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  129. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  130. package/lib/button/src/button-group.js +88 -85
  131. package/lib/calendar/src/calendar.js +1371 -1368
  132. package/lib/card/src/card.js +235 -232
  133. package/lib/carousel/src/carousel-item.js +78 -75
  134. package/lib/carousel/src/carousel.js +392 -389
  135. package/lib/cascader/src/cascader.js +1665 -1662
  136. package/lib/checkbox/src/button.js +198 -195
  137. package/lib/checkbox/src/checkbox.js +181 -178
  138. package/lib/checkbox/src/group.js +210 -207
  139. package/lib/collapse/src/collapse-pane.js +98 -95
  140. package/lib/collapse/src/collapse.js +340 -337
  141. package/lib/color-picker/src/color-picker.js +1116 -1113
  142. package/lib/components.js +3 -0
  143. package/lib/context-menu/src/context-menu.js +601 -598
  144. package/lib/countdown/src/countdown.js +224 -221
  145. package/lib/date-panel/src/date-panel.js +1905 -1902
  146. package/lib/date-picker/src/date-picker.js +1537 -1534
  147. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  148. package/lib/divider/src/divider.js +80 -77
  149. package/lib/drawer/src/drawer.js +778 -775
  150. package/lib/empty/src/empty.js +100 -97
  151. package/lib/form/src/form-group.js +74 -71
  152. package/lib/form/src/form-item.js +76 -73
  153. package/lib/form/src/form.js +789 -786
  154. package/lib/icon/src/icon.js +59 -56
  155. package/lib/icon/style/style.css +1 -1
  156. package/lib/icon/style/style.mini.css +1 -1
  157. package/lib/icon-picker/src/icon-picker.js +719 -716
  158. package/lib/image/src/group.js +130 -127
  159. package/lib/image/src/image.js +243 -240
  160. package/lib/image/src/preview.js +627 -624
  161. package/lib/index.common.js +2 -0
  162. package/lib/index.js +2 -0
  163. package/lib/index.umd.js +47411 -46732
  164. package/lib/index.umd.min.js +3 -3
  165. package/lib/input/src/input.js +2700 -2697
  166. package/lib/layout-aside/src/layout-aside.js +138 -135
  167. package/lib/layout-body/src/layout-body.js +145 -142
  168. package/lib/layout-container/src/layout-container.js +71 -68
  169. package/lib/layout-footer/src/layout-footer.js +60 -57
  170. package/lib/layout-header/src/layout-header.js +58 -55
  171. package/lib/link/src/link.js +131 -128
  172. package/lib/list/src/list.js +2173 -2170
  173. package/lib/loading/src/loading.js +141 -138
  174. package/lib/mention/src/mention.js +49 -46
  175. package/lib/menu/src/menu.js +799 -796
  176. package/lib/modal/src/modal.js +1519 -1527
  177. package/lib/notice-bar/src/notice-bar.js +168 -165
  178. package/lib/number-input/src/number-input.js +1094 -1091
  179. package/lib/pager/src/pager.js +767 -764
  180. package/lib/password-input/src/password-input.js +431 -428
  181. package/lib/print/src/page-break.js +63 -60
  182. package/lib/print/src/print.js +303 -300
  183. package/lib/pulldown/src/pulldown.js +403 -400
  184. package/lib/radio/src/button.js +214 -211
  185. package/lib/radio/src/group.js +195 -192
  186. package/lib/radio/src/radio.js +194 -191
  187. package/lib/rate/src/rate.js +164 -161
  188. package/lib/result/src/result.js +116 -113
  189. package/lib/row/src/col.js +133 -130
  190. package/lib/row/src/row.js +111 -108
  191. package/lib/scrollbar/src/scrollbar.js +518 -515
  192. package/lib/segmented/src/segmented.js +240 -237
  193. package/lib/select/src/optgroup.js +44 -41
  194. package/lib/select/src/option.js +39 -36
  195. package/lib/select/src/select.js +1915 -1897
  196. package/lib/slider/src/slider.js +419 -416
  197. package/lib/space/src/space.js +190 -187
  198. package/lib/splitter/src/splitter-panel.js +146 -143
  199. package/lib/splitter/src/splitter.js +917 -914
  200. package/lib/step-item/index.js +47 -0
  201. package/lib/steps/src/step-info.js +49 -0
  202. package/lib/steps/src/step-item.js +59 -0
  203. package/lib/steps/src/steps.js +298 -46
  204. package/lib/steps/src/util.js +74 -0
  205. package/lib/steps/style/style.css +297 -0
  206. package/lib/steps/style/style.mini.css +1 -0
  207. package/lib/style.css +307 -1
  208. package/lib/style.mini.css +1 -1
  209. package/lib/switch/src/switch.js +228 -225
  210. package/lib/table-select/src/table-select.js +865 -862
  211. package/lib/table-transfer/src/table-transfer.js +61 -58
  212. package/lib/tabs/src/tab-pane.js +102 -99
  213. package/lib/tabs/src/tabs.js +936 -933
  214. package/lib/tag/src/tag.js +163 -160
  215. package/lib/text/src/text.js +232 -229
  216. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  217. package/lib/textarea/src/textarea.js +434 -431
  218. package/lib/timeline/src/timeline.js +74 -36
  219. package/lib/timeline/src/util.js +7 -4
  220. package/lib/tip/src/tip.js +117 -114
  221. package/lib/tooltip/src/tooltip.js +552 -549
  222. package/lib/tour/src/tour.js +49 -46
  223. package/lib/transfer/src/transfer.js +95 -92
  224. package/lib/tree/src/tree.js +3379 -3376
  225. package/lib/tree-select/src/tree-select.js +969 -966
  226. package/lib/ui/index.js +8 -2
  227. package/lib/ui/src/log.js +1 -1
  228. package/lib/upload/src/upload.js +1788 -1785
  229. package/lib/vxe-icon/style/style.css +1 -1
  230. package/lib/vxe-icon/style/style.mini.css +1 -1
  231. package/lib/vxe-steps/style/style.css +297 -0
  232. package/lib/vxe-steps/style/style.mini.css +1 -0
  233. package/lib/watermark/src/watermark.js +158 -155
  234. package/package.json +1 -1
  235. package/packages/alert/src/alert.ts +2 -2
  236. package/packages/anchor/src/anchor-link.ts +2 -2
  237. package/packages/anchor/src/anchor.ts +2 -2
  238. package/packages/avatar/src/avatar.ts +2 -2
  239. package/packages/backtop/src/backtop.ts +2 -2
  240. package/packages/badge/src/badge.ts +2 -2
  241. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  242. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  243. package/packages/button/src/button-group.ts +2 -2
  244. package/packages/calendar/src/calendar.ts +2 -2
  245. package/packages/card/src/card.ts +2 -2
  246. package/packages/carousel/src/carousel-item.ts +2 -2
  247. package/packages/carousel/src/carousel.ts +2 -2
  248. package/packages/cascader/src/cascader.ts +2 -2
  249. package/packages/checkbox/src/button.ts +3 -15
  250. package/packages/checkbox/src/checkbox.ts +2 -2
  251. package/packages/checkbox/src/group.ts +2 -2
  252. package/packages/collapse/src/collapse-pane.ts +2 -2
  253. package/packages/collapse/src/collapse.ts +2 -2
  254. package/packages/color-picker/src/color-picker.ts +2 -2
  255. package/packages/components.ts +3 -0
  256. package/packages/context-menu/src/context-menu.ts +3 -16
  257. package/packages/countdown/src/countdown.ts +2 -2
  258. package/packages/date-panel/src/date-panel.ts +2 -2
  259. package/packages/date-picker/src/date-picker.ts +2 -2
  260. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  261. package/packages/divider/src/divider.ts +2 -2
  262. package/packages/drawer/src/drawer.ts +2 -2
  263. package/packages/empty/src/empty.ts +2 -2
  264. package/packages/form/src/form-group.ts +2 -2
  265. package/packages/form/src/form-item.ts +2 -2
  266. package/packages/form/src/form.ts +2 -2
  267. package/packages/icon/src/icon.ts +2 -2
  268. package/packages/icon-picker/src/icon-picker.ts +2 -2
  269. package/packages/image/src/group.ts +2 -2
  270. package/packages/image/src/image.ts +2 -2
  271. package/packages/image/src/preview.ts +3 -16
  272. package/packages/index.ts +2 -2
  273. package/packages/input/src/input.ts +2 -2
  274. package/packages/layout-aside/src/layout-aside.ts +2 -2
  275. package/packages/layout-body/src/layout-body.ts +2 -2
  276. package/packages/layout-container/src/layout-container.ts +3 -14
  277. package/packages/layout-footer/src/layout-footer.ts +2 -2
  278. package/packages/layout-header/src/layout-header.ts +2 -2
  279. package/packages/link/src/link.ts +2 -2
  280. package/packages/list/src/list.ts +2 -2
  281. package/packages/loading/src/loading.ts +2 -2
  282. package/packages/mention/src/mention.ts +2 -2
  283. package/packages/menu/src/menu.ts +2 -2
  284. package/packages/modal/src/modal.ts +5 -20
  285. package/packages/notice-bar/src/notice-bar.ts +2 -2
  286. package/packages/number-input/src/number-input.ts +3 -17
  287. package/packages/pager/src/pager.ts +2 -2
  288. package/packages/password-input/src/password-input.ts +2 -2
  289. package/packages/print/src/page-break.ts +2 -2
  290. package/packages/print/src/print.ts +2 -2
  291. package/packages/pulldown/src/pulldown.ts +2 -2
  292. package/packages/radio/src/button.ts +3 -16
  293. package/packages/radio/src/group.ts +3 -17
  294. package/packages/radio/src/radio.ts +2 -2
  295. package/packages/rate/src/rate.ts +2 -2
  296. package/packages/result/src/result.ts +2 -2
  297. package/packages/row/src/col.ts +2 -2
  298. package/packages/row/src/row.ts +2 -2
  299. package/packages/scrollbar/src/scrollbar.ts +3 -4
  300. package/packages/segmented/src/segmented.ts +2 -2
  301. package/packages/select/src/optgroup.ts +2 -2
  302. package/packages/select/src/option.ts +2 -2
  303. package/packages/select/src/select.ts +33 -19
  304. package/packages/slider/src/slider.ts +2 -2
  305. package/packages/space/src/space.ts +2 -2
  306. package/packages/splitter/src/splitter-panel.ts +2 -2
  307. package/packages/splitter/src/splitter.ts +2 -2
  308. package/packages/step-item/index.ts +16 -0
  309. package/packages/steps/src/step-info.ts +18 -0
  310. package/packages/steps/src/step-item.ts +41 -0
  311. package/packages/steps/src/steps.ts +273 -13
  312. package/packages/steps/src/util.ts +44 -0
  313. package/packages/switch/src/switch.ts +2 -2
  314. package/packages/table-select/src/table-select.ts +2 -2
  315. package/packages/table-transfer/src/table-transfer.ts +3 -15
  316. package/packages/tabs/src/tab-pane.ts +2 -2
  317. package/packages/tabs/src/tabs.ts +2 -2
  318. package/packages/tag/src/tag.ts +2 -2
  319. package/packages/text/src/text.ts +2 -2
  320. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  321. package/packages/textarea/src/textarea.ts +2 -2
  322. package/packages/timeline/src/timeline-info.ts +17 -17
  323. package/packages/timeline/src/timeline.ts +93 -49
  324. package/packages/timeline/src/util.ts +44 -41
  325. package/packages/tip/src/tip.ts +2 -2
  326. package/packages/tooltip/src/tooltip.ts +2 -2
  327. package/packages/tour/src/tour.ts +2 -2
  328. package/packages/transfer/src/transfer.ts +2 -2
  329. package/packages/tree/src/tree.ts +2 -2
  330. package/packages/tree-select/src/tree-select.ts +2 -2
  331. package/packages/ui/index.ts +8 -1
  332. package/packages/upload/src/upload.ts +2 -2
  333. package/packages/watermark/src/watermark.ts +2 -2
  334. package/styles/all.scss +1 -0
  335. package/styles/components/step-item.scss +0 -0
  336. package/styles/components/steps.scss +354 -0
  337. package/styles/theme/base.scss +9 -0
  338. package/types/all.d.ts +3 -0
  339. package/types/components/gantt.d.ts +1 -3
  340. package/types/components/select.d.ts +1 -13
  341. package/types/components/step-item.d.ts +72 -0
  342. package/types/components/steps.d.ts +67 -8
  343. package/types/components/table.d.ts +7 -66
  344. package/types/handles/form-design.d.ts +1 -4
  345. package/types/ui/global-config.d.ts +2 -0
  346. package/types/ui/global-icon.d.ts +7 -0
  347. /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  348. /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  349. /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  350. /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  351. /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  352. /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  353. /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  354. /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  355. /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  356. /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  357. /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  358. /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  359. /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  360. /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  361. /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  362. /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  363. /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  364. /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  365. /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  366. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  367. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
@@ -42,1170 +42,1173 @@ var import_vn = require("../../ui/src/vn");
42
42
  var import_util = require("./util");
43
43
  const { getConfig, getIcon, getI18n, globalEvents, GLOBAL_EVENT_KEYS, createEvent, useFns, renderEmptyElement } = import_core.VxeUI;
44
44
  const { errLog } = (0, import_log.createComponentLog)("number-input");
45
- var number_input_default = (0, import_comp.defineVxeComponent)({
46
- name: "VxeNumberInput",
47
- props: {
48
- modelValue: [String, Number],
49
- immediate: {
50
- type: Boolean,
51
- default: true
52
- },
53
- name: String,
54
- type: {
55
- type: String,
56
- default: "number"
57
- },
58
- clearable: {
59
- type: Boolean,
60
- default: () => getConfig().numberInput.clearable
61
- },
62
- readonly: {
63
- type: Boolean,
64
- default: null
65
- },
66
- disabled: {
67
- type: Boolean,
68
- default: null
69
- },
70
- placeholder: String,
71
- floatContent: {
72
- type: String,
73
- default: () => getConfig().numberInput.floatContent
74
- },
75
- floatAlign: {
76
- type: String,
77
- default: () => getConfig().numberInput.floatAlign
78
- },
79
- maxLength: {
80
- type: [String, Number],
81
- default: () => getConfig().numberInput.maxLength
82
- },
83
- autoComplete: {
84
- type: String,
85
- default: "off"
86
- },
87
- align: String,
88
- form: String,
89
- className: String,
90
- inputClassName: {
91
- type: String,
92
- default: () => getConfig().numberInput.inputClassName
93
- },
94
- width: [String, Number],
95
- size: {
96
- type: String,
97
- default: () => getConfig().numberInput.size || getConfig().size
98
- },
99
- min: {
100
- type: [String, Number],
101
- default: null
102
- },
103
- max: {
104
- type: [String, Number],
105
- default: null
106
- },
107
- step: [String, Number],
108
- exponential: {
109
- type: Boolean,
110
- default: () => getConfig().numberInput.exponential
111
- },
112
- negative: {
113
- type: Boolean,
114
- default: () => getConfig().numberInput.negative
115
- },
116
- showCurrency: {
117
- type: Boolean,
118
- default: () => getConfig().numberInput.showCurrency
119
- },
120
- currencySymbol: {
121
- type: String,
122
- default: () => getConfig().numberInput.currencySymbol
123
- },
124
- controlConfig: Object,
125
- // number、float、amount
126
- roundingMode: {
127
- type: String,
128
- default: () => getConfig().numberInput.roundingMode
129
- },
130
- // float、amount
131
- digits: {
132
- type: [String, Number],
133
- default: null
134
- },
135
- autoFill: {
136
- type: Boolean,
137
- default: () => getConfig().numberInput.autoFill
138
- },
139
- editable: {
140
- type: Boolean,
141
- default: true
142
- },
143
- plusIcon: String,
144
- minusIcon: String,
145
- prefixIcon: String,
146
- prefixConfig: Object,
147
- suffixIcon: String,
148
- suffixConfig: Object,
149
- showTooltip: {
150
- type: Boolean,
151
- default: () => getConfig().numberInput.showTooltip
152
- },
153
- tooltipConfig: Object,
154
- // 已废弃
155
- controls: {
156
- type: Boolean,
157
- default: null
45
+ var number_input_default = (
46
+ /* define-vxe-component start */
47
+ (0, import_comp.defineVxeComponent)({
48
+ name: "VxeNumberInput",
49
+ props: {
50
+ modelValue: [String, Number],
51
+ immediate: {
52
+ type: Boolean,
53
+ default: true
54
+ },
55
+ name: String,
56
+ type: {
57
+ type: String,
58
+ default: "number"
59
+ },
60
+ clearable: {
61
+ type: Boolean,
62
+ default: () => getConfig().numberInput.clearable
63
+ },
64
+ readonly: {
65
+ type: Boolean,
66
+ default: null
67
+ },
68
+ disabled: {
69
+ type: Boolean,
70
+ default: null
71
+ },
72
+ placeholder: String,
73
+ floatContent: {
74
+ type: String,
75
+ default: () => getConfig().numberInput.floatContent
76
+ },
77
+ floatAlign: {
78
+ type: String,
79
+ default: () => getConfig().numberInput.floatAlign
80
+ },
81
+ maxLength: {
82
+ type: [String, Number],
83
+ default: () => getConfig().numberInput.maxLength
84
+ },
85
+ autoComplete: {
86
+ type: String,
87
+ default: "off"
88
+ },
89
+ align: String,
90
+ form: String,
91
+ className: String,
92
+ inputClassName: {
93
+ type: String,
94
+ default: () => getConfig().numberInput.inputClassName
95
+ },
96
+ width: [String, Number],
97
+ size: {
98
+ type: String,
99
+ default: () => getConfig().numberInput.size || getConfig().size
100
+ },
101
+ min: {
102
+ type: [String, Number],
103
+ default: null
104
+ },
105
+ max: {
106
+ type: [String, Number],
107
+ default: null
108
+ },
109
+ step: [String, Number],
110
+ exponential: {
111
+ type: Boolean,
112
+ default: () => getConfig().numberInput.exponential
113
+ },
114
+ negative: {
115
+ type: Boolean,
116
+ default: () => getConfig().numberInput.negative
117
+ },
118
+ showCurrency: {
119
+ type: Boolean,
120
+ default: () => getConfig().numberInput.showCurrency
121
+ },
122
+ currencySymbol: {
123
+ type: String,
124
+ default: () => getConfig().numberInput.currencySymbol
125
+ },
126
+ controlConfig: Object,
127
+ // number、float、amount
128
+ roundingMode: {
129
+ type: String,
130
+ default: () => getConfig().numberInput.roundingMode
131
+ },
132
+ // float、amount
133
+ digits: {
134
+ type: [String, Number],
135
+ default: null
136
+ },
137
+ autoFill: {
138
+ type: Boolean,
139
+ default: () => getConfig().numberInput.autoFill
140
+ },
141
+ editable: {
142
+ type: Boolean,
143
+ default: true
144
+ },
145
+ plusIcon: String,
146
+ minusIcon: String,
147
+ prefixIcon: String,
148
+ prefixConfig: Object,
149
+ suffixIcon: String,
150
+ suffixConfig: Object,
151
+ showTooltip: {
152
+ type: Boolean,
153
+ default: () => getConfig().numberInput.showTooltip
154
+ },
155
+ tooltipConfig: Object,
156
+ // 已废弃
157
+ controls: {
158
+ type: Boolean,
159
+ default: null
160
+ },
161
+ // 已废弃
162
+ maxlength: [String, Number],
163
+ // 已废弃
164
+ autocomplete: String
158
165
  },
159
- // 已废弃
160
- maxlength: [String, Number],
161
- // 已废弃
162
- autocomplete: String
163
- },
164
- emits: [
165
- "update:modelValue",
166
- "input",
167
- "change",
168
- "keydown",
169
- "keyup",
170
- "wheel",
171
- "click",
172
- "focus",
173
- "blur",
174
- "clear",
175
- "lazy-change",
176
- "plus-number",
177
- "minus-number",
178
- "prefix-click",
179
- "suffix-click",
180
- // 已废弃
181
- "prev-number",
182
- "next-number"
183
- ],
184
- setup(props, context) {
185
- const { slots, emit } = context;
186
- const $xeForm = (0, import_vue.inject)("$xeForm", null);
187
- const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
188
- const xID = import_xe_utils.default.uniqueId();
189
- const { computeSize } = useFns.useSize(props);
190
- const reactData = (0, import_vue.reactive)({
191
- isFocus: false,
192
- isActivated: false,
193
- inputValue: ""
194
- });
195
- const internalData = {
196
- // dnTimeout: undefined,
197
- // ainTimeout: undefined,
198
- // isMouseDown: undefined,
199
- // isUM: undefined
200
- };
201
- const refElem = (0, import_vue.ref)();
202
- const refInputTarget = (0, import_vue.ref)();
203
- const refInputPanel = (0, import_vue.ref)();
204
- const computeFormReadonly = (0, import_vue.computed)(() => {
205
- const { readonly } = props;
206
- if (readonly === null) {
207
- if ($xeForm) {
208
- return $xeForm.props.readonly;
166
+ emits: [
167
+ "update:modelValue",
168
+ "input",
169
+ "change",
170
+ "keydown",
171
+ "keyup",
172
+ "wheel",
173
+ "click",
174
+ "focus",
175
+ "blur",
176
+ "clear",
177
+ "lazy-change",
178
+ "plus-number",
179
+ "minus-number",
180
+ "prefix-click",
181
+ "suffix-click",
182
+ // 已废弃
183
+ "prev-number",
184
+ "next-number"
185
+ ],
186
+ setup(props, context) {
187
+ const { slots, emit } = context;
188
+ const $xeForm = (0, import_vue.inject)("$xeForm", null);
189
+ const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
190
+ const xID = import_xe_utils.default.uniqueId();
191
+ const { computeSize } = useFns.useSize(props);
192
+ const reactData = (0, import_vue.reactive)({
193
+ isFocus: false,
194
+ isActivated: false,
195
+ inputValue: ""
196
+ });
197
+ const internalData = {
198
+ // dnTimeout: undefined,
199
+ // ainTimeout: undefined,
200
+ // isMouseDown: undefined,
201
+ // isUM: undefined
202
+ };
203
+ const refElem = (0, import_vue.ref)();
204
+ const refInputTarget = (0, import_vue.ref)();
205
+ const refInputPanel = (0, import_vue.ref)();
206
+ const computeFormReadonly = (0, import_vue.computed)(() => {
207
+ const { readonly } = props;
208
+ if (readonly === null) {
209
+ if ($xeForm) {
210
+ return $xeForm.props.readonly;
211
+ }
212
+ return false;
209
213
  }
210
- return false;
211
- }
212
- return readonly;
213
- });
214
- const computeIsDisabled = (0, import_vue.computed)(() => {
215
- const { disabled } = props;
216
- if (disabled === null) {
217
- if ($xeForm) {
218
- return $xeForm.props.disabled;
214
+ return readonly;
215
+ });
216
+ const computeIsDisabled = (0, import_vue.computed)(() => {
217
+ const { disabled } = props;
218
+ if (disabled === null) {
219
+ if ($xeForm) {
220
+ return $xeForm.props.disabled;
221
+ }
222
+ return false;
219
223
  }
220
- return false;
221
- }
222
- return disabled;
223
- });
224
- const computeDigitsValue = (0, import_vue.computed)(() => {
225
- const { type, digits } = props;
226
- let defDigits = digits;
227
- if (defDigits === null) {
228
- defDigits = getConfig().numberInput.digits;
224
+ return disabled;
225
+ });
226
+ const computeDigitsValue = (0, import_vue.computed)(() => {
227
+ const { type, digits } = props;
228
+ let defDigits = digits;
229
229
  if (defDigits === null) {
230
- if (type === "amount") {
231
- defDigits = 2;
230
+ defDigits = getConfig().numberInput.digits;
231
+ if (defDigits === null) {
232
+ if (type === "amount") {
233
+ defDigits = 2;
234
+ }
232
235
  }
233
236
  }
234
- }
235
- return import_xe_utils.default.toInteger(defDigits) || 1;
236
- });
237
- const computeControlOpts = (0, import_vue.computed)(() => {
238
- return Object.assign({}, getConfig().numberInput.controlConfig, props.controlConfig);
239
- });
240
- const computePrefixOpts = (0, import_vue.computed)(() => {
241
- return Object.assign({}, getConfig().numberInput.prefixConfig, props.prefixConfig);
242
- });
243
- const computeSuffixOpts = (0, import_vue.computed)(() => {
244
- return Object.assign({}, getConfig().numberInput.suffixConfig, props.suffixConfig);
245
- });
246
- const computeTooltipOpts = (0, import_vue.computed)(() => {
247
- return Object.assign({}, getConfig().numberInput.tooltipConfig, props.tooltipConfig);
248
- });
249
- const computeDecimalsType = (0, import_vue.computed)(() => {
250
- const { type } = props;
251
- return type === "float" || type === "amount";
252
- });
253
- const computeStepValue = (0, import_vue.computed)(() => {
254
- const { type } = props;
255
- const digitsValue = computeDigitsValue.value;
256
- const decimalsType = computeDecimalsType.value;
257
- const step = props.step;
258
- if (type === "integer") {
259
- return import_xe_utils.default.toInteger(step) || 1;
260
- } else if (decimalsType) {
261
- return import_xe_utils.default.toNumber(step) || 1 / Math.pow(10, digitsValue);
262
- }
263
- return import_xe_utils.default.toNumber(step) || 1;
264
- });
265
- const computeIsClearable = (0, import_vue.computed)(() => {
266
- return props.clearable;
267
- });
268
- const computeInputReadonly = (0, import_vue.computed)(() => {
269
- const { editable } = props;
270
- const formReadonly = computeFormReadonly.value;
271
- return formReadonly || !editable;
272
- });
273
- const computeInpPlaceholder = (0, import_vue.computed)(() => {
274
- const { placeholder } = props;
275
- if (placeholder) {
276
- return (0, import_utils.getFuncText)(placeholder);
277
- }
278
- const globalPlaceholder = getConfig().numberInput.placeholder;
279
- if (globalPlaceholder) {
280
- return (0, import_utils.getFuncText)(globalPlaceholder);
281
- }
282
- return getI18n("vxe.base.pleaseInput");
283
- });
284
- const computeInpMaxLength = (0, import_vue.computed)(() => {
285
- const { type, maxLength, maxlength, min, max } = props;
286
- const digitsValue = computeDigitsValue.value;
287
- const maxDefLen = 16;
288
- if (!(0, import_utils.eqEmptyValue)(min) && !(0, import_utils.eqEmptyValue)(max)) {
289
- return `${max}`.length + (type === "integer" ? 0 : digitsValue + 1) + (import_xe_utils.default.toNumber(min) >= 0 ? 0 : 1);
290
- }
291
- if (maxLength || maxlength) {
292
- return import_xe_utils.default.toNumber(maxLength || maxlength);
293
- }
294
- return maxDefLen;
295
- });
296
- const computeInpImmediate = (0, import_vue.computed)(() => {
297
- const { immediate } = props;
298
- return immediate;
299
- });
300
- const computeNumValue = (0, import_vue.computed)(() => {
301
- const { type } = props;
302
- const { inputValue } = reactData;
303
- return type === "integer" ? import_xe_utils.default.toInteger((0, import_util.handleNumber)(inputValue)) : import_xe_utils.default.toNumber((0, import_util.handleNumber)(inputValue));
304
- });
305
- const computeNumLabel = (0, import_vue.computed)(() => {
306
- const { type, roundingMode, showCurrency, currencySymbol, autoFill } = props;
307
- const { inputValue } = reactData;
308
- const digitsValue = computeDigitsValue.value;
309
- if (type === "amount") {
310
- const num = import_xe_utils.default.toNumber(inputValue);
311
- const cfyOpts = { digits: digitsValue };
312
- if (roundingMode === "floor") {
313
- cfyOpts.floor = true;
314
- } else if (roundingMode === "ceil") {
315
- cfyOpts.ceil = true;
316
- } else {
317
- cfyOpts.round = true;
318
- }
319
- let amountLabel = import_xe_utils.default.commafy(num, cfyOpts);
320
- if (!autoFill) {
321
- const [iStr, dStr] = amountLabel.split(".");
322
- if (dStr) {
323
- const dRest = dStr.replace(/0+$/, "");
324
- amountLabel = dRest ? [iStr, ".", dRest].join("") : iStr;
325
- }
237
+ return import_xe_utils.default.toInteger(defDigits) || 1;
238
+ });
239
+ const computeControlOpts = (0, import_vue.computed)(() => {
240
+ return Object.assign({}, getConfig().numberInput.controlConfig, props.controlConfig);
241
+ });
242
+ const computePrefixOpts = (0, import_vue.computed)(() => {
243
+ return Object.assign({}, getConfig().numberInput.prefixConfig, props.prefixConfig);
244
+ });
245
+ const computeSuffixOpts = (0, import_vue.computed)(() => {
246
+ return Object.assign({}, getConfig().numberInput.suffixConfig, props.suffixConfig);
247
+ });
248
+ const computeTooltipOpts = (0, import_vue.computed)(() => {
249
+ return Object.assign({}, getConfig().numberInput.tooltipConfig, props.tooltipConfig);
250
+ });
251
+ const computeDecimalsType = (0, import_vue.computed)(() => {
252
+ const { type } = props;
253
+ return type === "float" || type === "amount";
254
+ });
255
+ const computeStepValue = (0, import_vue.computed)(() => {
256
+ const { type } = props;
257
+ const digitsValue = computeDigitsValue.value;
258
+ const decimalsType = computeDecimalsType.value;
259
+ const step = props.step;
260
+ if (type === "integer") {
261
+ return import_xe_utils.default.toInteger(step) || 1;
262
+ } else if (decimalsType) {
263
+ return import_xe_utils.default.toNumber(step) || 1 / Math.pow(10, digitsValue);
326
264
  }
327
- if (showCurrency) {
328
- return `${currencySymbol || getI18n("vxe.numberInput.currencySymbol") || ""}${amountLabel}`;
265
+ return import_xe_utils.default.toNumber(step) || 1;
266
+ });
267
+ const computeIsClearable = (0, import_vue.computed)(() => {
268
+ return props.clearable;
269
+ });
270
+ const computeInputReadonly = (0, import_vue.computed)(() => {
271
+ const { editable } = props;
272
+ const formReadonly = computeFormReadonly.value;
273
+ return formReadonly || !editable;
274
+ });
275
+ const computeInpPlaceholder = (0, import_vue.computed)(() => {
276
+ const { placeholder } = props;
277
+ if (placeholder) {
278
+ return (0, import_utils.getFuncText)(placeholder);
329
279
  }
330
- return amountLabel;
331
- }
332
- return import_xe_utils.default.toString(inputValue);
333
- });
334
- const computeIsDisabledSubtractNumber = (0, import_vue.computed)(() => {
335
- const { min } = props;
336
- const { inputValue } = reactData;
337
- const numValue = computeNumValue.value;
338
- if ((inputValue || inputValue === 0) && min !== null) {
339
- return numValue <= import_xe_utils.default.toNumber(min);
340
- }
341
- return false;
342
- });
343
- const computeIsDisabledAddNumber = (0, import_vue.computed)(() => {
344
- const { max } = props;
345
- const { inputValue } = reactData;
346
- const numValue = computeNumValue.value;
347
- if ((inputValue || inputValue === 0) && max !== null) {
348
- return numValue >= import_xe_utils.default.toNumber(max);
349
- }
350
- return false;
351
- });
352
- const computeInpClassNamevalue = (0, import_vue.computed)(() => {
353
- const { inputClassName } = props;
354
- return "vxe-number-input--input" + (inputClassName ? " " + inputClassName : "");
355
- });
356
- const computeCurrStyle = (0, import_vue.computed)(() => {
357
- const { width } = props;
358
- const stys = {};
359
- if (width) {
360
- stys.width = (0, import_dom.toCssUnit)(width);
361
- }
362
- return stys;
363
- });
364
- const refMaps = {
365
- refElem,
366
- refInput: refInputTarget
367
- };
368
- const computeMaps = {
369
- computeControlOpts
370
- };
371
- const $xeNumberInput = {
372
- xID,
373
- props,
374
- context,
375
- reactData,
376
- internalData,
377
- getRefMaps: () => refMaps,
378
- getComputeMaps: () => computeMaps
379
- };
380
- const dispatchEvent = (type, params, evnt) => {
381
- emit(type, createEvent(evnt, { $numberInput: $xeNumberInput }, params));
382
- };
383
- const handleNumberString = (val) => {
384
- if (import_xe_utils.default.eqNull(val)) {
385
- return "";
386
- }
387
- return `${val}`;
388
- };
389
- const getNumberValue = (val) => {
390
- const { type, exponential, roundingMode, autoFill } = props;
391
- const inpMaxLength = computeInpMaxLength.value;
392
- const digitsValue = computeDigitsValue.value;
393
- const decimalsType = computeDecimalsType.value;
394
- let restVal = "";
395
- if (decimalsType) {
396
- restVal = (0, import_util.toFloatValueFixed)(val, type, digitsValue, roundingMode);
397
- if (!autoFill) {
398
- restVal = handleNumberString(import_xe_utils.default.toNumber(restVal));
280
+ const globalPlaceholder = getConfig().numberInput.placeholder;
281
+ if (globalPlaceholder) {
282
+ return (0, import_utils.getFuncText)(globalPlaceholder);
399
283
  }
400
- } else {
401
- restVal = handleNumberString(val);
402
- }
403
- if (exponential && (val === restVal || handleNumberString(val).toLowerCase() === import_xe_utils.default.toNumber(restVal).toExponential())) {
404
- return val;
405
- }
406
- return restVal.slice(0, inpMaxLength);
407
- };
408
- const triggerEvent = (evnt) => {
409
- const { inputValue } = reactData;
410
- dispatchEvent(evnt.type, { value: inputValue }, evnt);
411
- };
412
- const handleChange = (val, inputValue, evnt) => {
413
- const value = (0, import_utils.eqEmptyValue)(val) ? null : Number(val);
414
- const isChange = value !== props.modelValue;
415
- if (isChange) {
416
- internalData.isUM = true;
417
- emit("update:modelValue", value);
418
- }
419
- if (reactData.inputValue !== inputValue) {
420
- (0, import_vue.nextTick)(() => {
421
- reactData.inputValue = inputValue || "";
422
- });
423
- }
424
- dispatchEvent("input", { value }, evnt);
425
- if (isChange) {
426
- dispatchEvent("change", { value }, evnt);
427
- if ($xeForm && formItemInfo) {
428
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
284
+ return getI18n("vxe.base.pleaseInput");
285
+ });
286
+ const computeInpMaxLength = (0, import_vue.computed)(() => {
287
+ const { type, maxLength, maxlength, min, max } = props;
288
+ const digitsValue = computeDigitsValue.value;
289
+ const maxDefLen = 16;
290
+ if (!(0, import_utils.eqEmptyValue)(min) && !(0, import_utils.eqEmptyValue)(max)) {
291
+ return `${max}`.length + (type === "integer" ? 0 : digitsValue + 1) + (import_xe_utils.default.toNumber(min) >= 0 ? 0 : 1);
429
292
  }
430
- }
431
- };
432
- const emitInputEvent = (inputValue, evnt) => {
433
- const inpImmediate = computeInpImmediate.value;
434
- const value = (0, import_utils.eqEmptyValue)(inputValue) ? null : import_xe_utils.default.toNumber(inputValue);
435
- reactData.inputValue = inputValue;
436
- if (inpImmediate) {
437
- handleChange(value, inputValue, evnt);
438
- } else {
439
- dispatchEvent("input", { value }, evnt);
440
- if ($xeForm && formItemInfo) {
441
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
293
+ if (maxLength || maxlength) {
294
+ return import_xe_utils.default.toNumber(maxLength || maxlength);
442
295
  }
443
- }
444
- };
445
- const inputEvent = (evnt) => {
446
- const inputElem = evnt.target;
447
- const value = inputElem.value;
448
- emitInputEvent(value, evnt);
449
- };
450
- const changeEvent = (evnt) => {
451
- const inpImmediate = computeInpImmediate.value;
452
- if (!inpImmediate) {
453
- triggerEvent(evnt);
454
- }
455
- dispatchEvent("lazy-change", { value: reactData.inputValue }, evnt);
456
- };
457
- const focusEvent = (evnt) => {
458
- const inputReadonly = computeInputReadonly.value;
459
- if (!inputReadonly) {
296
+ return maxDefLen;
297
+ });
298
+ const computeInpImmediate = (0, import_vue.computed)(() => {
299
+ const { immediate } = props;
300
+ return immediate;
301
+ });
302
+ const computeNumValue = (0, import_vue.computed)(() => {
303
+ const { type } = props;
460
304
  const { inputValue } = reactData;
461
- reactData.inputValue = (0, import_utils.eqEmptyValue)(inputValue) ? "" : `${import_xe_utils.default.toNumber(inputValue)}`;
462
- reactData.isFocus = true;
463
- reactData.isActivated = true;
464
- triggerEvent(evnt);
465
- }
466
- };
467
- const clickPrefixEvent = (evnt) => {
468
- const isDisabled = computeIsDisabled.value;
469
- if (!isDisabled) {
305
+ return type === "integer" ? import_xe_utils.default.toInteger((0, import_util.handleNumber)(inputValue)) : import_xe_utils.default.toNumber((0, import_util.handleNumber)(inputValue));
306
+ });
307
+ const computeNumLabel = (0, import_vue.computed)(() => {
308
+ const { type, roundingMode, showCurrency, currencySymbol, autoFill } = props;
470
309
  const { inputValue } = reactData;
471
- dispatchEvent("prefix-click", { value: inputValue }, evnt);
472
- }
473
- };
474
- const clearValueEvent = (evnt, value) => {
475
- focus();
476
- handleChange(null, "", evnt);
477
- dispatchEvent("clear", { value }, evnt);
478
- dispatchEvent("lazy-change", { value }, evnt);
479
- (0, import_vue.nextTick)(() => {
480
- handleShowTip();
310
+ const digitsValue = computeDigitsValue.value;
311
+ if (type === "amount") {
312
+ const num = import_xe_utils.default.toNumber(inputValue);
313
+ const cfyOpts = { digits: digitsValue };
314
+ if (roundingMode === "floor") {
315
+ cfyOpts.floor = true;
316
+ } else if (roundingMode === "ceil") {
317
+ cfyOpts.ceil = true;
318
+ } else {
319
+ cfyOpts.round = true;
320
+ }
321
+ let amountLabel = import_xe_utils.default.commafy(num, cfyOpts);
322
+ if (!autoFill) {
323
+ const [iStr, dStr] = amountLabel.split(".");
324
+ if (dStr) {
325
+ const dRest = dStr.replace(/0+$/, "");
326
+ amountLabel = dRest ? [iStr, ".", dRest].join("") : iStr;
327
+ }
328
+ }
329
+ if (showCurrency) {
330
+ return `${currencySymbol || getI18n("vxe.numberInput.currencySymbol") || ""}${amountLabel}`;
331
+ }
332
+ return amountLabel;
333
+ }
334
+ return import_xe_utils.default.toString(inputValue);
335
+ });
336
+ const computeIsDisabledSubtractNumber = (0, import_vue.computed)(() => {
337
+ const { min } = props;
338
+ const { inputValue } = reactData;
339
+ const numValue = computeNumValue.value;
340
+ if ((inputValue || inputValue === 0) && min !== null) {
341
+ return numValue <= import_xe_utils.default.toNumber(min);
342
+ }
343
+ return false;
481
344
  });
482
- };
483
- const clickSuffixEvent = (evnt) => {
484
- const isDisabled = computeIsDisabled.value;
485
- if (!isDisabled) {
345
+ const computeIsDisabledAddNumber = (0, import_vue.computed)(() => {
346
+ const { max } = props;
486
347
  const { inputValue } = reactData;
487
- dispatchEvent("suffix-click", { value: inputValue }, evnt);
488
- }
489
- };
490
- const updateModel = (val) => {
491
- const { type, roundingMode, autoFill } = props;
492
- const { inputValue } = reactData;
493
- const digitsValue = computeDigitsValue.value;
494
- const decimalsType = computeDecimalsType.value;
495
- if ((0, import_utils.eqEmptyValue)(val)) {
496
- reactData.inputValue = "";
497
- } else {
498
- let textValue = "" + val;
348
+ const numValue = computeNumValue.value;
349
+ if ((inputValue || inputValue === 0) && max !== null) {
350
+ return numValue >= import_xe_utils.default.toNumber(max);
351
+ }
352
+ return false;
353
+ });
354
+ const computeInpClassNamevalue = (0, import_vue.computed)(() => {
355
+ const { inputClassName } = props;
356
+ return "vxe-number-input--input" + (inputClassName ? " " + inputClassName : "");
357
+ });
358
+ const computeCurrStyle = (0, import_vue.computed)(() => {
359
+ const { width } = props;
360
+ const stys = {};
361
+ if (width) {
362
+ stys.width = (0, import_dom.toCssUnit)(width);
363
+ }
364
+ return stys;
365
+ });
366
+ const refMaps = {
367
+ refElem,
368
+ refInput: refInputTarget
369
+ };
370
+ const computeMaps = {
371
+ computeControlOpts
372
+ };
373
+ const $xeNumberInput = {
374
+ xID,
375
+ props,
376
+ context,
377
+ reactData,
378
+ internalData,
379
+ getRefMaps: () => refMaps,
380
+ getComputeMaps: () => computeMaps
381
+ };
382
+ const dispatchEvent = (type, params, evnt) => {
383
+ emit(type, createEvent(evnt, { $numberInput: $xeNumberInput }, params));
384
+ };
385
+ const handleNumberString = (val) => {
386
+ if (import_xe_utils.default.eqNull(val)) {
387
+ return "";
388
+ }
389
+ return `${val}`;
390
+ };
391
+ const getNumberValue = (val) => {
392
+ const { type, exponential, roundingMode, autoFill } = props;
393
+ const inpMaxLength = computeInpMaxLength.value;
394
+ const digitsValue = computeDigitsValue.value;
395
+ const decimalsType = computeDecimalsType.value;
396
+ let restVal = "";
499
397
  if (decimalsType) {
500
- textValue = (0, import_util.toFloatValueFixed)(val, type, digitsValue, roundingMode);
398
+ restVal = (0, import_util.toFloatValueFixed)(val, type, digitsValue, roundingMode);
501
399
  if (!autoFill) {
502
- textValue = "" + import_xe_utils.default.toNumber(textValue);
400
+ restVal = handleNumberString(import_xe_utils.default.toNumber(restVal));
503
401
  }
402
+ } else {
403
+ restVal = handleNumberString(val);
504
404
  }
505
- if (textValue !== inputValue) {
506
- reactData.inputValue = textValue;
405
+ if (exponential && (val === restVal || handleNumberString(val).toLowerCase() === import_xe_utils.default.toNumber(restVal).toExponential())) {
406
+ return val;
507
407
  }
508
- }
509
- };
510
- const initValue = () => {
511
- const { type, roundingMode, autoFill } = props;
512
- const { inputValue } = reactData;
513
- const digitsValue = computeDigitsValue.value;
514
- const decimalsType = computeDecimalsType.value;
515
- if (decimalsType) {
516
- if (inputValue) {
517
- let textValue = "";
518
- let validValue = null;
519
- if (inputValue) {
520
- textValue = (0, import_util.toFloatValueFixed)(inputValue, type, digitsValue, roundingMode);
521
- validValue = import_xe_utils.default.toNumber(textValue);
408
+ return restVal.slice(0, inpMaxLength);
409
+ };
410
+ const triggerEvent = (evnt) => {
411
+ const { inputValue } = reactData;
412
+ dispatchEvent(evnt.type, { value: inputValue }, evnt);
413
+ };
414
+ const handleChange = (val, inputValue, evnt) => {
415
+ const value = (0, import_utils.eqEmptyValue)(val) ? null : Number(val);
416
+ const isChange = value !== props.modelValue;
417
+ if (isChange) {
418
+ internalData.isUM = true;
419
+ emit("update:modelValue", value);
420
+ }
421
+ if (reactData.inputValue !== inputValue) {
422
+ (0, import_vue.nextTick)(() => {
423
+ reactData.inputValue = inputValue || "";
424
+ });
425
+ }
426
+ dispatchEvent("input", { value }, evnt);
427
+ if (isChange) {
428
+ dispatchEvent("change", { value }, evnt);
429
+ if ($xeForm && formItemInfo) {
430
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
431
+ }
432
+ }
433
+ };
434
+ const emitInputEvent = (inputValue, evnt) => {
435
+ const inpImmediate = computeInpImmediate.value;
436
+ const value = (0, import_utils.eqEmptyValue)(inputValue) ? null : import_xe_utils.default.toNumber(inputValue);
437
+ reactData.inputValue = inputValue;
438
+ if (inpImmediate) {
439
+ handleChange(value, inputValue, evnt);
440
+ } else {
441
+ dispatchEvent("input", { value }, evnt);
442
+ if ($xeForm && formItemInfo) {
443
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
444
+ }
445
+ }
446
+ };
447
+ const inputEvent = (evnt) => {
448
+ const inputElem = evnt.target;
449
+ const value = inputElem.value;
450
+ emitInputEvent(value, evnt);
451
+ };
452
+ const changeEvent = (evnt) => {
453
+ const inpImmediate = computeInpImmediate.value;
454
+ if (!inpImmediate) {
455
+ triggerEvent(evnt);
456
+ }
457
+ dispatchEvent("lazy-change", { value: reactData.inputValue }, evnt);
458
+ };
459
+ const focusEvent = (evnt) => {
460
+ const inputReadonly = computeInputReadonly.value;
461
+ if (!inputReadonly) {
462
+ const { inputValue } = reactData;
463
+ reactData.inputValue = (0, import_utils.eqEmptyValue)(inputValue) ? "" : `${import_xe_utils.default.toNumber(inputValue)}`;
464
+ reactData.isFocus = true;
465
+ reactData.isActivated = true;
466
+ triggerEvent(evnt);
467
+ }
468
+ };
469
+ const clickPrefixEvent = (evnt) => {
470
+ const isDisabled = computeIsDisabled.value;
471
+ if (!isDisabled) {
472
+ const { inputValue } = reactData;
473
+ dispatchEvent("prefix-click", { value: inputValue }, evnt);
474
+ }
475
+ };
476
+ const clearValueEvent = (evnt, value) => {
477
+ focus();
478
+ handleChange(null, "", evnt);
479
+ dispatchEvent("clear", { value }, evnt);
480
+ dispatchEvent("lazy-change", { value }, evnt);
481
+ (0, import_vue.nextTick)(() => {
482
+ handleShowTip();
483
+ });
484
+ };
485
+ const clickSuffixEvent = (evnt) => {
486
+ const isDisabled = computeIsDisabled.value;
487
+ if (!isDisabled) {
488
+ const { inputValue } = reactData;
489
+ dispatchEvent("suffix-click", { value: inputValue }, evnt);
490
+ }
491
+ };
492
+ const updateModel = (val) => {
493
+ const { type, roundingMode, autoFill } = props;
494
+ const { inputValue } = reactData;
495
+ const digitsValue = computeDigitsValue.value;
496
+ const decimalsType = computeDecimalsType.value;
497
+ if ((0, import_utils.eqEmptyValue)(val)) {
498
+ reactData.inputValue = "";
499
+ } else {
500
+ let textValue = "" + val;
501
+ if (decimalsType) {
502
+ textValue = (0, import_util.toFloatValueFixed)(val, type, digitsValue, roundingMode);
522
503
  if (!autoFill) {
523
- textValue = `${validValue}`;
504
+ textValue = "" + import_xe_utils.default.toNumber(textValue);
524
505
  }
525
506
  }
526
- if (inputValue !== validValue) {
527
- handleChange(validValue, textValue, { type: "init" });
528
- } else {
507
+ if (textValue !== inputValue) {
529
508
  reactData.inputValue = textValue;
530
509
  }
531
510
  }
532
- }
533
- };
534
- const validMaxNum = (num) => {
535
- return props.max === null || props.max === "" || import_xe_utils.default.toNumber(num) <= import_xe_utils.default.toNumber(props.max);
536
- };
537
- const validMinNum = (num) => {
538
- return props.min === null || props.min === "" || import_xe_utils.default.toNumber(num) >= import_xe_utils.default.toNumber(props.min);
539
- };
540
- const afterCheckValue = () => {
541
- const { type, min, max, negative, exponential, clearable } = props;
542
- const { inputValue } = reactData;
543
- const inputReadonly = computeInputReadonly.value;
544
- if (!inputReadonly) {
545
- if ((0, import_utils.eqEmptyValue)(inputValue)) {
546
- if (clearable) {
547
- handleChange(null, "", { type: "check" });
548
- return;
549
- }
550
- let inpNumVal = null;
551
- let inpValue = inputValue;
552
- if (min || min === 0) {
553
- inpNumVal = import_xe_utils.default.toNumber(min);
554
- inpValue = `${inpNumVal}`;
511
+ };
512
+ const initValue = () => {
513
+ const { type, roundingMode, autoFill } = props;
514
+ const { inputValue } = reactData;
515
+ const digitsValue = computeDigitsValue.value;
516
+ const decimalsType = computeDecimalsType.value;
517
+ if (decimalsType) {
518
+ if (inputValue) {
519
+ let textValue = "";
520
+ let validValue = null;
521
+ if (inputValue) {
522
+ textValue = (0, import_util.toFloatValueFixed)(inputValue, type, digitsValue, roundingMode);
523
+ validValue = import_xe_utils.default.toNumber(textValue);
524
+ if (!autoFill) {
525
+ textValue = `${validValue}`;
526
+ }
527
+ }
528
+ if (inputValue !== validValue) {
529
+ handleChange(validValue, textValue, { type: "init" });
530
+ } else {
531
+ reactData.inputValue = textValue;
532
+ }
555
533
  }
556
- handleChange(inpNumVal, `${inpValue || ""}`, { type: "check" });
557
- return;
558
534
  }
559
- if (inputValue || min || max) {
560
- let inpNumVal = type === "integer" ? import_xe_utils.default.toInteger((0, import_util.handleNumber)(inputValue)) : import_xe_utils.default.toNumber((0, import_util.handleNumber)(inputValue));
561
- if (!validMinNum(inpNumVal)) {
562
- inpNumVal = min;
563
- } else if (!validMaxNum(inpNumVal)) {
564
- inpNumVal = max;
565
- }
566
- if (!negative) {
567
- inpNumVal = Math.abs(inpNumVal);
535
+ };
536
+ const validMaxNum = (num) => {
537
+ return props.max === null || props.max === "" || import_xe_utils.default.toNumber(num) <= import_xe_utils.default.toNumber(props.max);
538
+ };
539
+ const validMinNum = (num) => {
540
+ return props.min === null || props.min === "" || import_xe_utils.default.toNumber(num) >= import_xe_utils.default.toNumber(props.min);
541
+ };
542
+ const afterCheckValue = () => {
543
+ const { type, min, max, negative, exponential, clearable } = props;
544
+ const { inputValue } = reactData;
545
+ const inputReadonly = computeInputReadonly.value;
546
+ if (!inputReadonly) {
547
+ if ((0, import_utils.eqEmptyValue)(inputValue)) {
548
+ if (clearable) {
549
+ handleChange(null, "", { type: "check" });
550
+ return;
551
+ }
552
+ let inpNumVal = null;
553
+ let inpValue = inputValue;
554
+ if (min || min === 0) {
555
+ inpNumVal = import_xe_utils.default.toNumber(min);
556
+ inpValue = `${inpNumVal}`;
557
+ }
558
+ handleChange(inpNumVal, `${inpValue || ""}`, { type: "check" });
559
+ return;
568
560
  }
569
- if (exponential) {
570
- const inpStringVal = handleNumberString(inputValue).toLowerCase();
571
- if (inpStringVal === import_xe_utils.default.toNumber(inpNumVal).toExponential()) {
572
- inpNumVal = inpStringVal;
561
+ if (inputValue || min || max) {
562
+ let inpNumVal = type === "integer" ? import_xe_utils.default.toInteger((0, import_util.handleNumber)(inputValue)) : import_xe_utils.default.toNumber((0, import_util.handleNumber)(inputValue));
563
+ if (!validMinNum(inpNumVal)) {
564
+ inpNumVal = min;
565
+ } else if (!validMaxNum(inpNumVal)) {
566
+ inpNumVal = max;
567
+ }
568
+ if (!negative) {
569
+ inpNumVal = Math.abs(inpNumVal);
573
570
  }
571
+ if (exponential) {
572
+ const inpStringVal = handleNumberString(inputValue).toLowerCase();
573
+ if (inpStringVal === import_xe_utils.default.toNumber(inpNumVal).toExponential()) {
574
+ inpNumVal = inpStringVal;
575
+ }
576
+ }
577
+ const inpValue = getNumberValue(inpNumVal);
578
+ handleChange((0, import_utils.eqEmptyValue)(inpValue) ? null : Number(inpValue), inpValue, { type: "check" });
574
579
  }
575
- const inpValue = getNumberValue(inpNumVal);
576
- handleChange((0, import_utils.eqEmptyValue)(inpValue) ? null : Number(inpValue), inpValue, { type: "check" });
577
580
  }
578
- }
579
- };
580
- const blurEvent = (evnt) => {
581
- const { inputValue } = reactData;
582
- const inpImmediate = computeInpImmediate.value;
583
- const value = inputValue ? Number(inputValue) : null;
584
- if (!inpImmediate) {
585
- handleChange(value, handleNumberString(inputValue), evnt);
586
- }
587
- afterCheckValue();
588
- reactData.isFocus = false;
589
- reactData.isActivated = false;
590
- dispatchEvent("blur", { value }, evnt);
591
- if ($xeForm && formItemInfo) {
592
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
593
- }
594
- };
595
- const mouseenterEvent = () => {
596
- handleShowTip();
597
- };
598
- const mouseleaveEvent = () => {
599
- handleHideTip();
600
- };
601
- const numberChange = (isPlus, evnt) => {
602
- const { min, max, type } = props;
603
- const { inputValue } = reactData;
604
- const stepValue = computeStepValue.value;
605
- const numValue = type === "integer" ? import_xe_utils.default.toInteger((0, import_util.handleNumber)(inputValue)) : import_xe_utils.default.toNumber((0, import_util.handleNumber)(inputValue));
606
- const newValue = isPlus ? import_xe_utils.default.add(numValue, stepValue) : import_xe_utils.default.subtract(numValue, stepValue);
607
- let restNum;
608
- if (!validMinNum(newValue)) {
609
- restNum = min;
610
- } else if (!validMaxNum(newValue)) {
611
- restNum = max;
612
- } else {
613
- restNum = newValue;
614
- }
615
- emitInputEvent(getNumberValue(restNum), evnt);
616
- };
617
- const numberPlusEvent = (evnt) => {
618
- const isDisabled = computeIsDisabled.value;
619
- const formReadonly = computeFormReadonly.value;
620
- const isDisabledAddNumber = computeIsDisabledAddNumber.value;
621
- if (!isDisabled && !formReadonly && !isDisabledAddNumber) {
622
- numberChange(true, evnt);
623
- }
624
- reactData.isActivated = true;
625
- handleShowTip();
626
- dispatchEvent("plus-number", { value: reactData.inputValue }, evnt);
627
- dispatchEvent("lazy-change", { value: reactData.inputValue }, evnt);
628
- dispatchEvent("next-number", { value: reactData.inputValue }, evnt);
629
- };
630
- const numberMinusEvent = (evnt) => {
631
- const isDisabled = computeIsDisabled.value;
632
- const formReadonly = computeFormReadonly.value;
633
- const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
634
- if (!isDisabled && !formReadonly && !isDisabledSubtractNumber) {
635
- numberChange(false, evnt);
636
- }
637
- reactData.isActivated = true;
638
- handleShowTip();
639
- dispatchEvent("minus-number", { value: reactData.inputValue }, evnt);
640
- dispatchEvent("lazy-change", { value: reactData.inputValue }, evnt);
641
- dispatchEvent("prev-number", { value: reactData.inputValue }, evnt);
642
- };
643
- const numberKeydownEvent = (evnt) => {
644
- const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
645
- const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
646
- if (isUpArrow || isDwArrow) {
647
- evnt.preventDefault();
648
- if (isUpArrow) {
649
- numberPlusEvent(evnt);
581
+ };
582
+ const blurEvent = (evnt) => {
583
+ const { inputValue } = reactData;
584
+ const inpImmediate = computeInpImmediate.value;
585
+ const value = inputValue ? Number(inputValue) : null;
586
+ if (!inpImmediate) {
587
+ handleChange(value, handleNumberString(inputValue), evnt);
588
+ }
589
+ afterCheckValue();
590
+ reactData.isFocus = false;
591
+ reactData.isActivated = false;
592
+ dispatchEvent("blur", { value }, evnt);
593
+ if ($xeForm && formItemInfo) {
594
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
595
+ }
596
+ };
597
+ const mouseenterEvent = () => {
598
+ handleShowTip();
599
+ };
600
+ const mouseleaveEvent = () => {
601
+ handleHideTip();
602
+ };
603
+ const numberChange = (isPlus, evnt) => {
604
+ const { min, max, type } = props;
605
+ const { inputValue } = reactData;
606
+ const stepValue = computeStepValue.value;
607
+ const numValue = type === "integer" ? import_xe_utils.default.toInteger((0, import_util.handleNumber)(inputValue)) : import_xe_utils.default.toNumber((0, import_util.handleNumber)(inputValue));
608
+ const newValue = isPlus ? import_xe_utils.default.add(numValue, stepValue) : import_xe_utils.default.subtract(numValue, stepValue);
609
+ let restNum;
610
+ if (!validMinNum(newValue)) {
611
+ restNum = min;
612
+ } else if (!validMaxNum(newValue)) {
613
+ restNum = max;
650
614
  } else {
651
- numberMinusEvent(evnt);
615
+ restNum = newValue;
652
616
  }
653
- }
654
- };
655
- const handleShowTip = () => {
656
- const { type, showTooltip } = props;
657
- const { inputValue } = reactData;
658
- if (showTooltip) {
659
- if (import_core.VxeUI.tooltip) {
660
- const numLabel = computeNumLabel.value;
661
- const tooltipOpts = computeTooltipOpts.value;
662
- const { contentMethod } = tooltipOpts;
663
- const inputElem = refInputTarget.value;
664
- const content = (0, import_utils.getText)(
665
- contentMethod ? contentMethod({
666
- $numberInput: $xeNumberInput,
667
- type,
668
- inputValue: inputElem.value,
669
- value: inputValue || "",
670
- label: numLabel
671
- }) : numLabel
672
- );
673
- if (content) {
674
- import_core.VxeUI.tooltip.open(
675
- inputElem,
676
- Object.assign(
677
- {},
678
- {
679
- ...tooltipOpts,
680
- content
681
- },
682
- {
683
- contentMethod: void 0
684
- }
685
- )
686
- );
617
+ emitInputEvent(getNumberValue(restNum), evnt);
618
+ };
619
+ const numberPlusEvent = (evnt) => {
620
+ const isDisabled = computeIsDisabled.value;
621
+ const formReadonly = computeFormReadonly.value;
622
+ const isDisabledAddNumber = computeIsDisabledAddNumber.value;
623
+ if (!isDisabled && !formReadonly && !isDisabledAddNumber) {
624
+ numberChange(true, evnt);
625
+ }
626
+ reactData.isActivated = true;
627
+ handleShowTip();
628
+ dispatchEvent("plus-number", { value: reactData.inputValue }, evnt);
629
+ dispatchEvent("lazy-change", { value: reactData.inputValue }, evnt);
630
+ dispatchEvent("next-number", { value: reactData.inputValue }, evnt);
631
+ };
632
+ const numberMinusEvent = (evnt) => {
633
+ const isDisabled = computeIsDisabled.value;
634
+ const formReadonly = computeFormReadonly.value;
635
+ const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
636
+ if (!isDisabled && !formReadonly && !isDisabledSubtractNumber) {
637
+ numberChange(false, evnt);
638
+ }
639
+ reactData.isActivated = true;
640
+ handleShowTip();
641
+ dispatchEvent("minus-number", { value: reactData.inputValue }, evnt);
642
+ dispatchEvent("lazy-change", { value: reactData.inputValue }, evnt);
643
+ dispatchEvent("prev-number", { value: reactData.inputValue }, evnt);
644
+ };
645
+ const numberKeydownEvent = (evnt) => {
646
+ const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
647
+ const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
648
+ if (isUpArrow || isDwArrow) {
649
+ evnt.preventDefault();
650
+ if (isUpArrow) {
651
+ numberPlusEvent(evnt);
687
652
  } else {
653
+ numberMinusEvent(evnt);
654
+ }
655
+ }
656
+ };
657
+ const handleShowTip = () => {
658
+ const { type, showTooltip } = props;
659
+ const { inputValue } = reactData;
660
+ if (showTooltip) {
661
+ if (import_core.VxeUI.tooltip) {
662
+ const numLabel = computeNumLabel.value;
663
+ const tooltipOpts = computeTooltipOpts.value;
664
+ const { contentMethod } = tooltipOpts;
665
+ const inputElem = refInputTarget.value;
666
+ const content = (0, import_utils.getText)(
667
+ contentMethod ? contentMethod({
668
+ $numberInput: $xeNumberInput,
669
+ type,
670
+ inputValue: inputElem.value,
671
+ value: inputValue || "",
672
+ label: numLabel
673
+ }) : numLabel
674
+ );
675
+ if (content) {
676
+ import_core.VxeUI.tooltip.open(
677
+ inputElem,
678
+ Object.assign(
679
+ {},
680
+ {
681
+ ...tooltipOpts,
682
+ content
683
+ },
684
+ {
685
+ contentMethod: void 0
686
+ }
687
+ )
688
+ );
689
+ } else {
690
+ import_core.VxeUI.tooltip.close();
691
+ }
692
+ }
693
+ }
694
+ };
695
+ const handleHideTip = () => {
696
+ const { showTooltip } = props;
697
+ if (showTooltip) {
698
+ if (import_core.VxeUI.tooltip) {
688
699
  import_core.VxeUI.tooltip.close();
689
700
  }
690
701
  }
691
- }
692
- };
693
- const handleHideTip = () => {
694
- const { showTooltip } = props;
695
- if (showTooltip) {
696
- if (import_core.VxeUI.tooltip) {
697
- import_core.VxeUI.tooltip.close();
702
+ };
703
+ const keydownEvent = (evnt) => {
704
+ const { type, negative, exponential, controls } = props;
705
+ const controlOpts = computeControlOpts.value;
706
+ const { isArrow } = controlOpts;
707
+ const inputReadonly = computeInputReadonly.value;
708
+ const isControlKey = (0, import_dom.hasControlKey)(evnt);
709
+ const isShiftKey = evnt.shiftKey;
710
+ const isAltKey = evnt.altKey;
711
+ const key = evnt.key;
712
+ const keyCode = evnt.keyCode;
713
+ const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
714
+ const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
715
+ const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
716
+ if (!isControlKey && !isShiftKey && !isAltKey) {
717
+ if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR) || !negative && key === "-" || type === "integer" && key === "." || (!exponential || keyCode !== 69) && keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191) {
718
+ evnt.preventDefault();
719
+ }
698
720
  }
699
- }
700
- };
701
- const keydownEvent = (evnt) => {
702
- const { type, negative, exponential, controls } = props;
703
- const controlOpts = computeControlOpts.value;
704
- const { isArrow } = controlOpts;
705
- const inputReadonly = computeInputReadonly.value;
706
- const isControlKey = (0, import_dom.hasControlKey)(evnt);
707
- const isShiftKey = evnt.shiftKey;
708
- const isAltKey = evnt.altKey;
709
- const key = evnt.key;
710
- const keyCode = evnt.keyCode;
711
- const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
712
- const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
713
- const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
714
- if (!isControlKey && !isShiftKey && !isAltKey) {
715
- if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR) || !negative && key === "-" || type === "integer" && key === "." || (!exponential || keyCode !== 69) && keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191) {
716
- evnt.preventDefault();
721
+ if (isEsc) {
722
+ afterCheckValue();
723
+ } else if (isUpArrow || isDwArrow) {
724
+ if ((0, import_utils.isEnableConf)(controlOpts) && (controls === false ? controls : isArrow) && !inputReadonly) {
725
+ numberKeydownEvent(evnt);
726
+ }
717
727
  }
718
- }
719
- if (isEsc) {
720
- afterCheckValue();
721
- } else if (isUpArrow || isDwArrow) {
722
- if ((0, import_utils.isEnableConf)(controlOpts) && (controls === false ? controls : isArrow) && !inputReadonly) {
723
- numberKeydownEvent(evnt);
728
+ triggerEvent(evnt);
729
+ };
730
+ const keyupEvent = (evnt) => {
731
+ handleShowTip();
732
+ triggerEvent(evnt);
733
+ };
734
+ const stopDown = () => {
735
+ const { dnTimeout } = internalData;
736
+ if (dnTimeout) {
737
+ clearTimeout(dnTimeout);
738
+ internalData.dnTimeout = void 0;
724
739
  }
725
- }
726
- triggerEvent(evnt);
727
- };
728
- const keyupEvent = (evnt) => {
729
- handleShowTip();
730
- triggerEvent(evnt);
731
- };
732
- const stopDown = () => {
733
- const { dnTimeout } = internalData;
734
- if (dnTimeout) {
735
- clearTimeout(dnTimeout);
736
- internalData.dnTimeout = void 0;
737
- }
738
- };
739
- const stopAutoIncrement = () => {
740
- const { ainTimeout } = internalData;
741
- if (ainTimeout) {
742
- clearTimeout(ainTimeout);
743
- internalData.ainTimeout = void 0;
744
- }
745
- };
746
- const numberDownMinusEvent = (evnt) => {
747
- numberStopAll();
748
- internalData.ainTimeout = setTimeout(() => {
749
- numberMinusEvent(evnt);
750
- numberDownMinusEvent(evnt);
751
- }, 60);
752
- };
753
- const numberDownPlusEvent = (evnt) => {
754
- numberStopAll();
755
- internalData.ainTimeout = setTimeout(() => {
756
- numberPlusEvent(evnt);
757
- numberDownPlusEvent(evnt);
758
- }, 60);
759
- };
760
- const numberStopAll = () => {
761
- stopDown();
762
- stopAutoIncrement();
763
- };
764
- const numberClickEvent = (evnt) => {
765
- if (internalData.isMouseDown) {
766
- internalData.isMouseDown = false;
767
- } else {
740
+ };
741
+ const stopAutoIncrement = () => {
742
+ const { ainTimeout } = internalData;
743
+ if (ainTimeout) {
744
+ clearTimeout(ainTimeout);
745
+ internalData.ainTimeout = void 0;
746
+ }
747
+ };
748
+ const numberDownMinusEvent = (evnt) => {
768
749
  numberStopAll();
769
- const isAddNumber = (0, import_dom.hasClass)(evnt.currentTarget, "is--plus");
770
- if (isAddNumber) {
771
- numberPlusEvent(evnt);
772
- } else {
750
+ internalData.ainTimeout = setTimeout(() => {
773
751
  numberMinusEvent(evnt);
774
- }
775
- }
776
- };
777
- const numberMousedownEvent = (evnt) => {
778
- numberStopAll();
779
- internalData.isMouseDown = true;
780
- if (evnt.button === 0) {
781
- const isAddNumber = (0, import_dom.hasClass)(evnt.currentTarget, "is--plus");
782
- if (isAddNumber) {
752
+ numberDownMinusEvent(evnt);
753
+ }, 60);
754
+ };
755
+ const numberDownPlusEvent = (evnt) => {
756
+ numberStopAll();
757
+ internalData.ainTimeout = setTimeout(() => {
783
758
  numberPlusEvent(evnt);
759
+ numberDownPlusEvent(evnt);
760
+ }, 60);
761
+ };
762
+ const numberStopAll = () => {
763
+ stopDown();
764
+ stopAutoIncrement();
765
+ };
766
+ const numberClickEvent = (evnt) => {
767
+ if (internalData.isMouseDown) {
768
+ internalData.isMouseDown = false;
784
769
  } else {
785
- numberMinusEvent(evnt);
786
- }
787
- internalData.dnTimeout = setTimeout(() => {
770
+ numberStopAll();
771
+ const isAddNumber = (0, import_dom.hasClass)(evnt.currentTarget, "is--plus");
788
772
  if (isAddNumber) {
789
- numberDownPlusEvent(evnt);
773
+ numberPlusEvent(evnt);
790
774
  } else {
791
- numberDownMinusEvent(evnt);
792
- }
793
- }, 500);
794
- }
795
- };
796
- const wheelEvent = (evnt) => {
797
- const { controls } = props;
798
- const controlOpts = computeControlOpts.value;
799
- const { isWheel } = controlOpts;
800
- const inputReadonly = computeInputReadonly.value;
801
- if ((0, import_utils.isEnableConf)(controlOpts) && (controls === false ? controls : isWheel) && !inputReadonly) {
802
- if (reactData.isActivated) {
803
- evnt.stopPropagation();
804
- evnt.preventDefault();
805
- const delta = evnt.deltaY;
806
- if (delta > 0) {
807
775
  numberMinusEvent(evnt);
808
- } else if (delta < 0) {
776
+ }
777
+ }
778
+ };
779
+ const numberMousedownEvent = (evnt) => {
780
+ numberStopAll();
781
+ internalData.isMouseDown = true;
782
+ if (evnt.button === 0) {
783
+ const isAddNumber = (0, import_dom.hasClass)(evnt.currentTarget, "is--plus");
784
+ if (isAddNumber) {
809
785
  numberPlusEvent(evnt);
786
+ } else {
787
+ numberMinusEvent(evnt);
810
788
  }
789
+ internalData.dnTimeout = setTimeout(() => {
790
+ if (isAddNumber) {
791
+ numberDownPlusEvent(evnt);
792
+ } else {
793
+ numberDownMinusEvent(evnt);
794
+ }
795
+ }, 500);
811
796
  }
812
- }
813
- triggerEvent(evnt);
814
- };
815
- const clickEvent = (evnt) => {
816
- handleShowTip();
817
- triggerEvent(evnt);
818
- };
819
- const handleGlobalMousedownEvent = (evnt) => {
820
- const { isActivated } = reactData;
821
- const el = refElem.value;
822
- const panelElem = refInputPanel.value;
823
- const isDisabled = computeIsDisabled.value;
824
- const inputReadonly = computeInputReadonly.value;
825
- const inpImmediate = computeInpImmediate.value;
826
- if (!isDisabled && !inputReadonly && isActivated) {
827
- reactData.isActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelElem).flag;
828
- if (!reactData.isActivated) {
829
- if (!inpImmediate) {
830
- const { inputValue } = reactData;
831
- const value = inputValue ? Number(inputValue) : null;
832
- handleChange(value, handleNumberString(inputValue), evnt);
797
+ };
798
+ const wheelEvent = (evnt) => {
799
+ const { controls } = props;
800
+ const controlOpts = computeControlOpts.value;
801
+ const { isWheel } = controlOpts;
802
+ const inputReadonly = computeInputReadonly.value;
803
+ if ((0, import_utils.isEnableConf)(controlOpts) && (controls === false ? controls : isWheel) && !inputReadonly) {
804
+ if (reactData.isActivated) {
805
+ evnt.stopPropagation();
806
+ evnt.preventDefault();
807
+ const delta = evnt.deltaY;
808
+ if (delta > 0) {
809
+ numberMinusEvent(evnt);
810
+ } else if (delta < 0) {
811
+ numberPlusEvent(evnt);
812
+ }
833
813
  }
834
- afterCheckValue();
835
- handleHideTip();
836
814
  }
837
- }
838
- };
839
- const handleGlobalKeydownEvent = (evnt) => {
840
- const { clearable } = props;
841
- const isDisabled = computeIsDisabled.value;
842
- const inputReadonly = computeInputReadonly.value;
843
- if (!isDisabled && !inputReadonly) {
844
- const isTab = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.TAB);
845
- const isDel = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.DELETE);
846
- let isActivated = reactData.isActivated;
847
- if (isTab) {
848
- if (isActivated) {
815
+ triggerEvent(evnt);
816
+ };
817
+ const clickEvent = (evnt) => {
818
+ handleShowTip();
819
+ triggerEvent(evnt);
820
+ };
821
+ const handleGlobalMousedownEvent = (evnt) => {
822
+ const { isActivated } = reactData;
823
+ const el = refElem.value;
824
+ const panelElem = refInputPanel.value;
825
+ const isDisabled = computeIsDisabled.value;
826
+ const inputReadonly = computeInputReadonly.value;
827
+ const inpImmediate = computeInpImmediate.value;
828
+ if (!isDisabled && !inputReadonly && isActivated) {
829
+ reactData.isActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelElem).flag;
830
+ if (!reactData.isActivated) {
831
+ if (!inpImmediate) {
832
+ const { inputValue } = reactData;
833
+ const value = inputValue ? Number(inputValue) : null;
834
+ handleChange(value, handleNumberString(inputValue), evnt);
835
+ }
849
836
  afterCheckValue();
837
+ handleHideTip();
850
838
  }
851
- isActivated = false;
852
- reactData.isActivated = isActivated;
853
839
  }
854
- if (isDel && clearable) {
855
- if (isActivated) {
856
- clearValueEvent(evnt, null);
840
+ };
841
+ const handleGlobalKeydownEvent = (evnt) => {
842
+ const { clearable } = props;
843
+ const isDisabled = computeIsDisabled.value;
844
+ const inputReadonly = computeInputReadonly.value;
845
+ if (!isDisabled && !inputReadonly) {
846
+ const isTab = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.TAB);
847
+ const isDel = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.DELETE);
848
+ let isActivated = reactData.isActivated;
849
+ if (isTab) {
850
+ if (isActivated) {
851
+ afterCheckValue();
852
+ }
853
+ isActivated = false;
854
+ reactData.isActivated = isActivated;
855
+ }
856
+ if (isDel && clearable) {
857
+ if (isActivated) {
858
+ clearValueEvent(evnt, null);
859
+ }
857
860
  }
858
861
  }
859
- }
860
- };
861
- const handleGlobalBlurEvent = () => {
862
- const { isActivated } = reactData;
863
- if (isActivated) {
864
- afterCheckValue();
865
- }
866
- };
867
- const numberInputMethods = {
868
- dispatchEvent,
869
- focus() {
870
- const inputReadonly = computeInputReadonly.value;
871
- if (!inputReadonly) {
872
- const inputElem = refInputTarget.value;
873
- reactData.isActivated = true;
874
- inputElem.focus();
862
+ };
863
+ const handleGlobalBlurEvent = () => {
864
+ const { isActivated } = reactData;
865
+ if (isActivated) {
866
+ afterCheckValue();
875
867
  }
876
- return (0, import_vue.nextTick)();
877
- },
878
- blur() {
879
- const inputElem = refInputTarget.value;
880
- inputElem.blur();
881
- reactData.isActivated = false;
882
- return (0, import_vue.nextTick)();
883
- },
884
- select() {
885
- const inputElem = refInputTarget.value;
886
- inputElem.select();
887
- reactData.isActivated = false;
888
- return (0, import_vue.nextTick)();
889
- }
890
- };
891
- Object.assign($xeNumberInput, numberInputMethods);
892
- const renderPrefixIcon = () => {
893
- const { prefixIcon } = props;
894
- const prefixOpts = computePrefixOpts.value;
895
- const prefixSlot = slots.prefix;
896
- const preIcon = prefixIcon || prefixOpts.icon;
897
- const sufContent = prefixOpts.content;
898
- return prefixSlot || preIcon || sufContent ? (0, import_vue.h)(
899
- "div",
900
- {
901
- class: "vxe-number-input--prefix",
902
- onClick: clickPrefixEvent
868
+ };
869
+ const numberInputMethods = {
870
+ dispatchEvent,
871
+ focus() {
872
+ const inputReadonly = computeInputReadonly.value;
873
+ if (!inputReadonly) {
874
+ const inputElem = refInputTarget.value;
875
+ reactData.isActivated = true;
876
+ inputElem.focus();
877
+ }
878
+ return (0, import_vue.nextTick)();
903
879
  },
904
- [
905
- (0, import_vue.h)(
906
- "div",
907
- {
908
- class: "vxe-number-input--prefix-icon"
909
- },
910
- prefixSlot ? (0, import_vn.getSlotVNs)(prefixSlot({})) : [
911
- preIcon ? (0, import_vue.h)("i", {
912
- class: preIcon
913
- }) : renderEmptyElement($xeNumberInput),
914
- sufContent ? (0, import_vue.h)(
915
- "span",
916
- {
917
- class: "vxe-prefix-input--suffix-text"
918
- },
919
- `${sufContent}`
920
- ) : renderEmptyElement($xeNumberInput)
921
- ]
922
- )
923
- ]
924
- ) : renderEmptyElement($xeNumberInput);
925
- };
926
- const renderSuffixIcon = () => {
927
- const { suffixIcon } = props;
928
- const { inputValue } = reactData;
929
- const suffixSlot = slots.suffix;
930
- const suffixOpts = computeSuffixOpts.value;
931
- const isDisabled = computeIsDisabled.value;
932
- const isClearable = computeIsClearable.value;
933
- const sufIcon = suffixIcon || suffixOpts.icon;
934
- const sufContent = suffixOpts.content;
935
- return (0, import_vue.h)(
936
- "div",
937
- {
938
- class: [
939
- "vxe-number-input--suffix",
940
- {
941
- "is--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
942
- }
943
- ]
880
+ blur() {
881
+ const inputElem = refInputTarget.value;
882
+ inputElem.blur();
883
+ reactData.isActivated = false;
884
+ return (0, import_vue.nextTick)();
944
885
  },
945
- [
946
- isClearable ? (0, import_vue.h)(
947
- "div",
948
- {
949
- class: "vxe-number-input--clear-icon",
950
- onClick: clearValueEvent
951
- },
952
- [
953
- (0, import_vue.h)("i", {
954
- class: getIcon().INPUT_CLEAR
955
- })
886
+ select() {
887
+ const inputElem = refInputTarget.value;
888
+ inputElem.select();
889
+ reactData.isActivated = false;
890
+ return (0, import_vue.nextTick)();
891
+ }
892
+ };
893
+ Object.assign($xeNumberInput, numberInputMethods);
894
+ const renderPrefixIcon = () => {
895
+ const { prefixIcon } = props;
896
+ const prefixOpts = computePrefixOpts.value;
897
+ const prefixSlot = slots.prefix;
898
+ const preIcon = prefixIcon || prefixOpts.icon;
899
+ const sufContent = prefixOpts.content;
900
+ return prefixSlot || preIcon || sufContent ? (0, import_vue.h)(
901
+ "div",
902
+ {
903
+ class: "vxe-number-input--prefix",
904
+ onClick: clickPrefixEvent
905
+ },
906
+ [
907
+ (0, import_vue.h)(
908
+ "div",
909
+ {
910
+ class: "vxe-number-input--prefix-icon"
911
+ },
912
+ prefixSlot ? (0, import_vn.getSlotVNs)(prefixSlot({})) : [
913
+ preIcon ? (0, import_vue.h)("i", {
914
+ class: preIcon
915
+ }) : renderEmptyElement($xeNumberInput),
916
+ sufContent ? (0, import_vue.h)(
917
+ "span",
918
+ {
919
+ class: "vxe-prefix-input--suffix-text"
920
+ },
921
+ `${sufContent}`
922
+ ) : renderEmptyElement($xeNumberInput)
923
+ ]
924
+ )
925
+ ]
926
+ ) : renderEmptyElement($xeNumberInput);
927
+ };
928
+ const renderSuffixIcon = () => {
929
+ const { suffixIcon } = props;
930
+ const { inputValue } = reactData;
931
+ const suffixSlot = slots.suffix;
932
+ const suffixOpts = computeSuffixOpts.value;
933
+ const isDisabled = computeIsDisabled.value;
934
+ const isClearable = computeIsClearable.value;
935
+ const sufIcon = suffixIcon || suffixOpts.icon;
936
+ const sufContent = suffixOpts.content;
937
+ return (0, import_vue.h)(
938
+ "div",
939
+ {
940
+ class: [
941
+ "vxe-number-input--suffix",
942
+ {
943
+ "is--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
944
+ }
956
945
  ]
957
- ) : renderEmptyElement($xeNumberInput),
958
- suffixSlot || sufIcon || sufContent ? (0, import_vue.h)(
959
- "div",
946
+ },
947
+ [
948
+ isClearable ? (0, import_vue.h)(
949
+ "div",
950
+ {
951
+ class: "vxe-number-input--clear-icon",
952
+ onClick: clearValueEvent
953
+ },
954
+ [
955
+ (0, import_vue.h)("i", {
956
+ class: getIcon().INPUT_CLEAR
957
+ })
958
+ ]
959
+ ) : renderEmptyElement($xeNumberInput),
960
+ suffixSlot || sufIcon || sufContent ? (0, import_vue.h)(
961
+ "div",
962
+ {
963
+ class: "vxe-number-input--suffix-icon",
964
+ onClick: clickSuffixEvent
965
+ },
966
+ suffixSlot ? (0, import_vn.getSlotVNs)(suffixSlot({})) : [
967
+ sufIcon ? (0, import_vue.h)("i", {
968
+ class: sufIcon
969
+ }) : renderEmptyElement($xeNumberInput),
970
+ sufContent ? (0, import_vue.h)(
971
+ "span",
972
+ {
973
+ class: "vxe-number-input--suffix-text"
974
+ },
975
+ `${sufContent}`
976
+ ) : renderEmptyElement($xeNumberInput)
977
+ ]
978
+ ) : renderEmptyElement($xeNumberInput)
979
+ ]
980
+ );
981
+ };
982
+ const renderInput = () => {
983
+ const { type, name, autocomplete, autoComplete } = props;
984
+ const { inputValue, isFocus } = reactData;
985
+ const isDisabled = computeIsDisabled.value;
986
+ const numLabel = computeNumLabel.value;
987
+ const inputReadonly = computeInputReadonly.value;
988
+ const inpMaxLength = computeInpMaxLength.value;
989
+ const inpPlaceholder = computeInpPlaceholder.value;
990
+ const inpClassName = computeInpClassNamevalue.value;
991
+ return (0, import_vue.h)(
992
+ "div",
993
+ {
994
+ key: "ni",
995
+ class: "vxe-number-input--input-wrapper"
996
+ },
997
+ [
998
+ renderPrefixIcon(),
999
+ (0, import_vue.h)(
1000
+ "div",
1001
+ {
1002
+ class: "vxe-number-input--input-inner"
1003
+ },
1004
+ [
1005
+ (0, import_vue.h)("input", {
1006
+ ref: refInputTarget,
1007
+ class: inpClassName,
1008
+ name,
1009
+ type: "text",
1010
+ value: !isFocus && type === "amount" ? numLabel : inputValue,
1011
+ placeholder: inpPlaceholder,
1012
+ maxlength: inpMaxLength,
1013
+ readonly: inputReadonly,
1014
+ disabled: isDisabled,
1015
+ autocomplete: autoComplete || autocomplete,
1016
+ onKeydown: keydownEvent,
1017
+ onKeyup: keyupEvent,
1018
+ onClick: clickEvent,
1019
+ onInput: inputEvent,
1020
+ onChange: changeEvent,
1021
+ onFocus: focusEvent,
1022
+ onBlur: blurEvent
1023
+ }),
1024
+ renderFloat()
1025
+ ]
1026
+ ),
1027
+ renderSuffixIcon()
1028
+ ]
1029
+ );
1030
+ };
1031
+ const renderMinusBtn = () => {
1032
+ const { minusIcon } = props;
1033
+ const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
1034
+ return (0, import_vue.h)(
1035
+ "button",
1036
+ {
1037
+ key: "prev",
1038
+ class: [
1039
+ "vxe-number-input--minus-btn is--minus",
1040
+ {
1041
+ "is--disabled": isDisabledSubtractNumber
1042
+ }
1043
+ ],
1044
+ type: "button",
1045
+ onClick: numberClickEvent,
1046
+ onMousedown: numberMousedownEvent,
1047
+ onMouseup: numberStopAll,
1048
+ onMouseleave: numberStopAll
1049
+ },
1050
+ [
1051
+ (0, import_vue.h)("i", {
1052
+ class: minusIcon || getIcon().NUMBER_INPUT_MINUS_NUM
1053
+ })
1054
+ ]
1055
+ );
1056
+ };
1057
+ const renderPlusBtn = () => {
1058
+ const { plusIcon } = props;
1059
+ const isDisabledAddNumber = computeIsDisabledAddNumber.value;
1060
+ return (0, import_vue.h)(
1061
+ "button",
1062
+ {
1063
+ key: "next",
1064
+ class: [
1065
+ "vxe-number-input--plus-btn is--plus",
1066
+ {
1067
+ "is--disabled": isDisabledAddNumber
1068
+ }
1069
+ ],
1070
+ type: "button",
1071
+ onClick: numberClickEvent,
1072
+ onMousedown: numberMousedownEvent,
1073
+ onMouseup: numberStopAll,
1074
+ onMouseleave: numberStopAll
1075
+ },
1076
+ [
1077
+ (0, import_vue.h)("i", {
1078
+ class: plusIcon || getIcon().NUMBER_INPUT_PLUS_NUM
1079
+ })
1080
+ ]
1081
+ );
1082
+ };
1083
+ const renderSideControl = () => {
1084
+ return (0, import_vue.h)(
1085
+ "div",
1086
+ {
1087
+ key: "cplr",
1088
+ class: "vxe-number-input--side-control"
1089
+ },
1090
+ [renderPlusBtn(), renderMinusBtn()]
1091
+ );
1092
+ };
1093
+ const renderFloat = () => {
1094
+ const { floatContent } = props;
1095
+ const floatSlot = slots.float;
1096
+ if (floatContent || floatSlot) {
1097
+ return (0, import_vue.h)(
1098
+ "span",
960
1099
  {
961
- class: "vxe-number-input--suffix-icon",
962
- onClick: clickSuffixEvent
1100
+ class: "vxe-number-input--float-wrapper"
963
1101
  },
964
- suffixSlot ? (0, import_vn.getSlotVNs)(suffixSlot({})) : [
965
- sufIcon ? (0, import_vue.h)("i", {
966
- class: sufIcon
967
- }) : renderEmptyElement($xeNumberInput),
968
- sufContent ? (0, import_vue.h)(
969
- "span",
970
- {
971
- class: "vxe-number-input--suffix-text"
972
- },
973
- `${sufContent}`
974
- ) : renderEmptyElement($xeNumberInput)
975
- ]
976
- ) : renderEmptyElement($xeNumberInput)
977
- ]
978
- );
979
- };
980
- const renderInput = () => {
981
- const { type, name, autocomplete, autoComplete } = props;
982
- const { inputValue, isFocus } = reactData;
983
- const isDisabled = computeIsDisabled.value;
984
- const numLabel = computeNumLabel.value;
985
- const inputReadonly = computeInputReadonly.value;
986
- const inpMaxLength = computeInpMaxLength.value;
987
- const inpPlaceholder = computeInpPlaceholder.value;
988
- const inpClassName = computeInpClassNamevalue.value;
989
- return (0, import_vue.h)(
990
- "div",
991
- {
992
- key: "ni",
993
- class: "vxe-number-input--input-wrapper"
994
- },
995
- [
996
- renderPrefixIcon(),
997
- (0, import_vue.h)(
1102
+ floatSlot ? floatSlot({}) : (0, import_utils.getText)(floatContent)
1103
+ );
1104
+ }
1105
+ return renderEmptyElement($xeNumberInput);
1106
+ };
1107
+ const renderVN = () => {
1108
+ const { className, controls, type, align, prefixIcon, suffixIcon, floatContent, floatAlign } = props;
1109
+ const { inputValue, isActivated } = reactData;
1110
+ const vSize = computeSize.value;
1111
+ const controlOpts = computeControlOpts.value;
1112
+ const { layout, showButton } = controlOpts;
1113
+ const isDisabled = computeIsDisabled.value;
1114
+ const formReadonly = computeFormReadonly.value;
1115
+ const numLabel = computeNumLabel.value;
1116
+ const prefixSlot = slots.prefix;
1117
+ const suffixSlot = slots.suffix;
1118
+ if (formReadonly) {
1119
+ return (0, import_vue.h)(
998
1120
  "div",
999
1121
  {
1000
- class: "vxe-number-input--input-inner"
1122
+ ref: refElem,
1123
+ class: ["vxe-number-input--readonly", `type--${type}`, className]
1001
1124
  },
1002
- [
1003
- (0, import_vue.h)("input", {
1004
- ref: refInputTarget,
1005
- class: inpClassName,
1006
- name,
1007
- type: "text",
1008
- value: !isFocus && type === "amount" ? numLabel : inputValue,
1009
- placeholder: inpPlaceholder,
1010
- maxlength: inpMaxLength,
1011
- readonly: inputReadonly,
1012
- disabled: isDisabled,
1013
- autocomplete: autoComplete || autocomplete,
1014
- onKeydown: keydownEvent,
1015
- onKeyup: keyupEvent,
1016
- onClick: clickEvent,
1017
- onInput: inputEvent,
1018
- onChange: changeEvent,
1019
- onFocus: focusEvent,
1020
- onBlur: blurEvent
1021
- }),
1022
- renderFloat()
1023
- ]
1024
- ),
1025
- renderSuffixIcon()
1026
- ]
1027
- );
1028
- };
1029
- const renderMinusBtn = () => {
1030
- const { minusIcon } = props;
1031
- const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
1032
- return (0, import_vue.h)(
1033
- "button",
1034
- {
1035
- key: "prev",
1036
- class: [
1037
- "vxe-number-input--minus-btn is--minus",
1038
- {
1039
- "is--disabled": isDisabledSubtractNumber
1040
- }
1041
- ],
1042
- type: "button",
1043
- onClick: numberClickEvent,
1044
- onMousedown: numberMousedownEvent,
1045
- onMouseup: numberStopAll,
1046
- onMouseleave: numberStopAll
1047
- },
1048
- [
1049
- (0, import_vue.h)("i", {
1050
- class: minusIcon || getIcon().NUMBER_INPUT_MINUS_NUM
1051
- })
1052
- ]
1053
- );
1054
- };
1055
- const renderPlusBtn = () => {
1056
- const { plusIcon } = props;
1057
- const isDisabledAddNumber = computeIsDisabledAddNumber.value;
1058
- return (0, import_vue.h)(
1059
- "button",
1060
- {
1061
- key: "next",
1062
- class: [
1063
- "vxe-number-input--plus-btn is--plus",
1064
- {
1065
- "is--disabled": isDisabledAddNumber
1066
- }
1067
- ],
1068
- type: "button",
1069
- onClick: numberClickEvent,
1070
- onMousedown: numberMousedownEvent,
1071
- onMouseup: numberStopAll,
1072
- onMouseleave: numberStopAll
1073
- },
1074
- [
1075
- (0, import_vue.h)("i", {
1076
- class: plusIcon || getIcon().NUMBER_INPUT_PLUS_NUM
1077
- })
1078
- ]
1079
- );
1080
- };
1081
- const renderSideControl = () => {
1082
- return (0, import_vue.h)(
1083
- "div",
1084
- {
1085
- key: "cplr",
1086
- class: "vxe-number-input--side-control"
1087
- },
1088
- [renderPlusBtn(), renderMinusBtn()]
1089
- );
1090
- };
1091
- const renderFloat = () => {
1092
- const { floatContent } = props;
1093
- const floatSlot = slots.float;
1094
- if (floatContent || floatSlot) {
1095
- return (0, import_vue.h)(
1096
- "span",
1097
- {
1098
- class: "vxe-number-input--float-wrapper"
1099
- },
1100
- floatSlot ? floatSlot({}) : (0, import_utils.getText)(floatContent)
1101
- );
1102
- }
1103
- return renderEmptyElement($xeNumberInput);
1104
- };
1105
- const renderVN = () => {
1106
- const { className, controls, type, align, prefixIcon, suffixIcon, floatContent, floatAlign } = props;
1107
- const { inputValue, isActivated } = reactData;
1108
- const vSize = computeSize.value;
1109
- const controlOpts = computeControlOpts.value;
1110
- const { layout, showButton } = controlOpts;
1111
- const isDisabled = computeIsDisabled.value;
1112
- const formReadonly = computeFormReadonly.value;
1113
- const numLabel = computeNumLabel.value;
1114
- const prefixSlot = slots.prefix;
1115
- const suffixSlot = slots.suffix;
1116
- if (formReadonly) {
1125
+ numLabel
1126
+ );
1127
+ }
1128
+ const currStyle = computeCurrStyle.value;
1129
+ const inputReadonly = computeInputReadonly.value;
1130
+ const isClearable = computeIsClearable.value;
1131
+ const isControls = (0, import_utils.isEnableConf)(controlOpts) && (controls === false ? controls : showButton);
1117
1132
  return (0, import_vue.h)(
1118
1133
  "div",
1119
1134
  {
1120
1135
  ref: refElem,
1121
- class: ["vxe-number-input--readonly", `type--${type}`, className]
1136
+ class: [
1137
+ "vxe-number-input",
1138
+ `type--${type}`,
1139
+ isControls ? `ctl--${layout === "right" || layout === "left" ? layout : "default"}` : "",
1140
+ floatContent ? `fla--${floatAlign || "center"}` : "",
1141
+ className,
1142
+ {
1143
+ [`size--${vSize}`]: vSize,
1144
+ [`is--${align}`]: align,
1145
+ "is--controls": isControls && !inputReadonly,
1146
+ "is--prefix": !!prefixSlot || prefixIcon,
1147
+ "is--suffix": !!suffixSlot || suffixIcon,
1148
+ "is--disabled": isDisabled,
1149
+ "is--active": isActivated,
1150
+ "show--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
1151
+ }
1152
+ ],
1153
+ style: currStyle,
1154
+ spellcheck: false,
1155
+ onMouseenter: mouseenterEvent,
1156
+ onMouseleave: mouseleaveEvent
1122
1157
  },
1123
- numLabel
1158
+ isControls ? layout === "right" ? [renderInput(), renderSideControl()] : layout === "left" ? [renderSideControl(), renderInput()] : [renderMinusBtn(), renderInput(), renderPlusBtn()] : [renderInput()]
1124
1159
  );
1125
- }
1126
- const currStyle = computeCurrStyle.value;
1127
- const inputReadonly = computeInputReadonly.value;
1128
- const isClearable = computeIsClearable.value;
1129
- const isControls = (0, import_utils.isEnableConf)(controlOpts) && (controls === false ? controls : showButton);
1130
- return (0, import_vue.h)(
1131
- "div",
1132
- {
1133
- ref: refElem,
1134
- class: [
1135
- "vxe-number-input",
1136
- `type--${type}`,
1137
- isControls ? `ctl--${layout === "right" || layout === "left" ? layout : "default"}` : "",
1138
- floatContent ? `fla--${floatAlign || "center"}` : "",
1139
- className,
1140
- {
1141
- [`size--${vSize}`]: vSize,
1142
- [`is--${align}`]: align,
1143
- "is--controls": isControls && !inputReadonly,
1144
- "is--prefix": !!prefixSlot || prefixIcon,
1145
- "is--suffix": !!suffixSlot || suffixIcon,
1146
- "is--disabled": isDisabled,
1147
- "is--active": isActivated,
1148
- "show--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
1149
- }
1150
- ],
1151
- style: currStyle,
1152
- spellcheck: false,
1153
- onMouseenter: mouseenterEvent,
1154
- onMouseleave: mouseleaveEvent
1155
- },
1156
- isControls ? layout === "right" ? [renderInput(), renderSideControl()] : layout === "left" ? [renderSideControl(), renderInput()] : [renderMinusBtn(), renderInput(), renderPlusBtn()] : [renderInput()]
1160
+ };
1161
+ $xeNumberInput.renderVN = renderVN;
1162
+ (0, import_vue.watch)(
1163
+ () => props.modelValue,
1164
+ (val) => {
1165
+ if (!internalData.isUM) {
1166
+ updateModel(val);
1167
+ }
1168
+ internalData.isUM = false;
1169
+ }
1157
1170
  );
1158
- };
1159
- $xeNumberInput.renderVN = renderVN;
1160
- (0, import_vue.watch)(
1161
- () => props.modelValue,
1162
- (val) => {
1163
- if (!internalData.isUM) {
1164
- updateModel(val);
1171
+ (0, import_vue.watch)(
1172
+ () => props.type,
1173
+ () => {
1174
+ Object.assign(reactData, {
1175
+ inputValue: props.modelValue
1176
+ });
1177
+ initValue();
1165
1178
  }
1166
- internalData.isUM = false;
1167
- }
1168
- );
1169
- (0, import_vue.watch)(
1170
- () => props.type,
1171
- () => {
1172
- Object.assign(reactData, {
1173
- inputValue: props.modelValue
1174
- });
1175
- initValue();
1176
- }
1177
- );
1178
- (0, import_vue.onMounted)(() => {
1179
- if (props.showTooltip) {
1180
- if (!import_core.VxeUI.tooltip) {
1181
- errLog("vxe.error.reqComp", ["vxe-tooltip"]);
1179
+ );
1180
+ (0, import_vue.onMounted)(() => {
1181
+ if (props.showTooltip) {
1182
+ if (!import_core.VxeUI.tooltip) {
1183
+ errLog("vxe.error.reqComp", ["vxe-tooltip"]);
1184
+ }
1182
1185
  }
1183
- }
1184
- updateModel(props.modelValue);
1185
- const targetElem = refInputTarget.value;
1186
- if (targetElem) {
1187
- targetElem.addEventListener("wheel", wheelEvent, { passive: false });
1188
- }
1189
- globalEvents.on($xeNumberInput, "mousedown", handleGlobalMousedownEvent);
1190
- globalEvents.on($xeNumberInput, "keydown", handleGlobalKeydownEvent);
1191
- globalEvents.on($xeNumberInput, "blur", handleGlobalBlurEvent);
1192
- });
1193
- (0, import_vue.onBeforeUnmount)(() => {
1194
- reactData.isFocus = false;
1195
- numberStopAll();
1196
- afterCheckValue();
1197
- const targetElem = refInputTarget.value;
1198
- if (targetElem) {
1199
- targetElem.removeEventListener("wheel", wheelEvent);
1200
- }
1201
- globalEvents.off($xeNumberInput, "mousedown");
1202
- globalEvents.off($xeNumberInput, "keydown");
1203
- globalEvents.off($xeNumberInput, "blur");
1204
- });
1205
- initValue();
1206
- return $xeNumberInput;
1207
- },
1208
- render() {
1209
- return this.renderVN();
1210
- }
1211
- });
1186
+ updateModel(props.modelValue);
1187
+ const targetElem = refInputTarget.value;
1188
+ if (targetElem) {
1189
+ targetElem.addEventListener("wheel", wheelEvent, { passive: false });
1190
+ }
1191
+ globalEvents.on($xeNumberInput, "mousedown", handleGlobalMousedownEvent);
1192
+ globalEvents.on($xeNumberInput, "keydown", handleGlobalKeydownEvent);
1193
+ globalEvents.on($xeNumberInput, "blur", handleGlobalBlurEvent);
1194
+ });
1195
+ (0, import_vue.onBeforeUnmount)(() => {
1196
+ reactData.isFocus = false;
1197
+ numberStopAll();
1198
+ afterCheckValue();
1199
+ const targetElem = refInputTarget.value;
1200
+ if (targetElem) {
1201
+ targetElem.removeEventListener("wheel", wheelEvent);
1202
+ }
1203
+ globalEvents.off($xeNumberInput, "mousedown");
1204
+ globalEvents.off($xeNumberInput, "keydown");
1205
+ globalEvents.off($xeNumberInput, "blur");
1206
+ });
1207
+ initValue();
1208
+ return $xeNumberInput;
1209
+ },
1210
+ render() {
1211
+ return this.renderVN();
1212
+ }
1213
+ })
1214
+ );