vxe-pc-ui 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (714) hide show
  1. package/es/anchor/src/anchor.js +1 -1
  2. package/es/anchor-link/index.js +1 -1
  3. package/es/{button-group → button}/src/button-group.js +2 -2
  4. package/es/button/src/button.js +3 -3
  5. package/es/button/style.css +17 -17
  6. package/es/button/style.min.css +1 -1
  7. package/es/button-group/index.js +1 -1
  8. package/es/checkbox/index.js +10 -0
  9. package/es/checkbox/src/checkbox.js +116 -0
  10. package/es/checkbox/src/group.js +108 -0
  11. package/es/checkbox/style.css +107 -0
  12. package/es/checkbox/style.min.css +1 -0
  13. package/es/checkbox-group/index.js +10 -0
  14. package/es/col/index.js +1 -1
  15. package/es/components.js +98 -35
  16. package/es/dynamics/index.js +27 -0
  17. package/es/form/index.js +8 -0
  18. package/es/form/src/form-config-item.js +178 -0
  19. package/es/form/src/form-gather.js +47 -0
  20. package/es/form/src/form-item.js +228 -0
  21. package/es/form/src/form.js +665 -0
  22. package/es/form/src/itemInfo.js +39 -0
  23. package/es/form/src/render.js +68 -0
  24. package/es/form/src/util.js +65 -0
  25. package/es/form/style.css +321 -0
  26. package/es/form/style.min.css +1 -0
  27. package/es/form-design/index.js +8 -0
  28. package/es/form-design/src/form-design.js +79 -0
  29. package/es/form-design/src/setting.js +12 -0
  30. package/es/form-design/src/util.js +8 -0
  31. package/es/form-design/src/view.js +113 -0
  32. package/es/form-design/src/widget.js +104 -0
  33. package/es/form-design/style.css +97 -0
  34. package/es/form-design/style.min.css +1 -0
  35. package/es/form-gather/index.js +8 -0
  36. package/es/form-item/index.js +8 -0
  37. package/es/icon/style.css +540 -1
  38. package/es/icon/style.min.css +1 -1
  39. package/es/input/index.js +10 -0
  40. package/es/input/src/date.js +41 -0
  41. package/es/input/src/input.js +2333 -0
  42. package/es/input/src/number.js +10 -0
  43. package/es/input/style.css +1000 -0
  44. package/es/input/style.min.css +1 -0
  45. package/es/layout-aside/style.css +1 -0
  46. package/es/layout-aside/style.min.css +1 -1
  47. package/es/layout-body/style.css +1 -0
  48. package/es/layout-body/style.min.css +1 -1
  49. package/es/layout-footer/style.css +1 -0
  50. package/es/layout-footer/style.min.css +1 -1
  51. package/es/layout-header/style.css +1 -0
  52. package/es/layout-header/style.min.css +1 -1
  53. package/es/list-design/index.js +8 -0
  54. package/es/{design/src/design.js → list-design/src/list-design.js} +7 -7
  55. package/es/loading/index.js +8 -0
  56. package/es/loading/src/loading.js +53 -0
  57. package/es/loading/style.css +75 -0
  58. package/es/loading/style.min.css +1 -0
  59. package/es/modal/index.js +96 -0
  60. package/es/modal/src/modal.js +876 -0
  61. package/es/modal/style.css +323 -0
  62. package/es/modal/style.min.css +1 -0
  63. package/es/optgroup/index.js +10 -0
  64. package/es/optgroup/style.css +0 -0
  65. package/es/optgroup/style.min.css +0 -0
  66. package/es/option/index.js +10 -0
  67. package/es/option/style.css +0 -0
  68. package/es/option/style.min.css +0 -0
  69. package/es/pager/index.js +10 -0
  70. package/es/pager/src/pager.js +539 -0
  71. package/es/pager/style.css +319 -0
  72. package/es/pager/style.min.css +1 -0
  73. package/es/pulldown/index.js +10 -0
  74. package/es/pulldown/src/pulldown.js +328 -0
  75. package/es/pulldown/style.css +57 -0
  76. package/es/pulldown/style.min.css +1 -0
  77. package/es/radio/index.js +10 -0
  78. package/es/radio/src/button.js +113 -0
  79. package/es/radio/src/group.js +93 -0
  80. package/es/radio/src/radio.js +118 -0
  81. package/es/radio/style.css +143 -0
  82. package/es/radio/style.min.css +1 -0
  83. package/es/radio-button/index.js +10 -0
  84. package/es/radio-button/style.css +0 -0
  85. package/es/radio-button/style.min.css +0 -0
  86. package/es/radio-group/index.js +10 -0
  87. package/es/radio-group/style.css +0 -0
  88. package/es/radio-group/style.min.css +0 -0
  89. package/es/select/index.js +10 -0
  90. package/es/select/src/optgroup.js +31 -0
  91. package/es/select/src/option.js +31 -0
  92. package/es/select/src/optionInfo.js +16 -0
  93. package/es/select/src/select.js +992 -0
  94. package/es/select/src/util.js +36 -0
  95. package/es/select/style.css +201 -0
  96. package/es/select/style.min.css +1 -0
  97. package/es/style.css +1 -1
  98. package/es/style.min.css +1 -1
  99. package/es/switch/index.js +10 -0
  100. package/es/switch/src/switch.js +151 -0
  101. package/es/switch/style.css +97 -0
  102. package/es/switch/style.min.css +1 -0
  103. package/es/textarea/index.js +10 -0
  104. package/es/textarea/src/textarea.js +245 -0
  105. package/es/textarea/style.css +102 -0
  106. package/es/textarea/style.min.css +1 -0
  107. package/es/tooltip/index.js +8 -0
  108. package/es/tooltip/src/tooltip.js +336 -0
  109. package/es/tooltip/style.css +103 -0
  110. package/es/tooltip/style.min.css +1 -0
  111. package/es/ui/src/core.js +12 -2
  112. package/es/ui/src/dom.js +20 -0
  113. package/es/ui/src/globalStore.js +119 -4
  114. package/es/ui/src/i18n.js +7 -0
  115. package/es/ui/src/log.js +2 -2
  116. package/es/ui/src/renderer.js +67 -0
  117. package/es/ui/src/store.js +41 -0
  118. package/es/ui/src/utils.js +10 -0
  119. package/es/ui/src/validators.js +5 -0
  120. package/es/ui/src/vn.js +10 -0
  121. package/es/vxe-button/style.css +17 -17
  122. package/es/vxe-button/style.min.css +1 -1
  123. package/es/vxe-checkbox/index.js +3 -0
  124. package/es/vxe-checkbox/style.css +107 -0
  125. package/es/vxe-checkbox/style.min.css +1 -0
  126. package/es/vxe-checkbox-group/index.js +3 -0
  127. package/es/vxe-checkbox-group/style.css +0 -0
  128. package/es/vxe-checkbox-group/style.min.css +0 -0
  129. package/es/vxe-form/index.js +3 -0
  130. package/es/vxe-form/style.css +321 -0
  131. package/es/vxe-form/style.min.css +1 -0
  132. package/es/vxe-form-design/index.js +3 -0
  133. package/es/vxe-form-design/style.css +97 -0
  134. package/es/vxe-form-design/style.min.css +1 -0
  135. package/es/vxe-form-gather/index.js +3 -0
  136. package/es/vxe-form-gather/style.css +0 -0
  137. package/es/vxe-form-gather/style.min.css +0 -0
  138. package/es/vxe-form-item/index.js +3 -0
  139. package/es/vxe-form-item/style.css +0 -0
  140. package/es/vxe-form-item/style.min.css +0 -0
  141. package/es/vxe-icon/style.css +540 -1
  142. package/es/vxe-icon/style.min.css +1 -1
  143. package/es/vxe-input/index.js +3 -0
  144. package/es/vxe-input/style.css +1000 -0
  145. package/es/vxe-input/style.min.css +1 -0
  146. package/es/vxe-layout-aside/style.css +1 -0
  147. package/es/vxe-layout-aside/style.min.css +1 -1
  148. package/es/vxe-layout-body/style.css +1 -0
  149. package/es/vxe-layout-body/style.min.css +1 -1
  150. package/es/vxe-layout-footer/style.css +1 -0
  151. package/es/vxe-layout-footer/style.min.css +1 -1
  152. package/es/vxe-layout-header/style.css +1 -0
  153. package/es/vxe-layout-header/style.min.css +1 -1
  154. package/es/vxe-list-design/index.js +3 -0
  155. package/es/vxe-list-design/style.css +0 -0
  156. package/es/vxe-list-design/style.min.css +0 -0
  157. package/es/vxe-loading/index.js +3 -0
  158. package/es/vxe-loading/style.css +75 -0
  159. package/es/vxe-loading/style.min.css +1 -0
  160. package/es/vxe-modal/index.js +3 -0
  161. package/es/vxe-modal/style.css +323 -0
  162. package/es/vxe-modal/style.min.css +1 -0
  163. package/es/vxe-optgroup/index.js +3 -0
  164. package/es/vxe-optgroup/style.css +0 -0
  165. package/es/vxe-optgroup/style.min.css +0 -0
  166. package/es/vxe-option/index.js +3 -0
  167. package/es/vxe-option/style.css +0 -0
  168. package/es/vxe-option/style.min.css +0 -0
  169. package/es/vxe-pager/index.js +3 -0
  170. package/es/vxe-pager/style.css +319 -0
  171. package/es/vxe-pager/style.min.css +1 -0
  172. package/es/vxe-pulldown/index.js +3 -0
  173. package/es/vxe-pulldown/style.css +57 -0
  174. package/es/vxe-pulldown/style.min.css +1 -0
  175. package/es/vxe-radio/index.js +3 -0
  176. package/es/vxe-radio/style.css +143 -0
  177. package/es/vxe-radio/style.min.css +1 -0
  178. package/es/vxe-radio-button/index.js +3 -0
  179. package/es/vxe-radio-button/style.css +0 -0
  180. package/es/vxe-radio-button/style.min.css +0 -0
  181. package/es/vxe-radio-group/index.js +3 -0
  182. package/es/vxe-radio-group/style.css +0 -0
  183. package/es/vxe-radio-group/style.min.css +0 -0
  184. package/es/vxe-select/index.js +3 -0
  185. package/es/vxe-select/style.css +201 -0
  186. package/es/vxe-select/style.min.css +1 -0
  187. package/es/vxe-switch/index.js +3 -0
  188. package/es/vxe-switch/style.css +97 -0
  189. package/es/vxe-switch/style.min.css +1 -0
  190. package/es/vxe-textarea/index.js +3 -0
  191. package/es/vxe-textarea/style.css +102 -0
  192. package/es/vxe-textarea/style.min.css +1 -0
  193. package/es/vxe-tooltip/index.js +3 -0
  194. package/es/vxe-tooltip/style.css +103 -0
  195. package/es/vxe-tooltip/style.min.css +1 -0
  196. package/lib/anchor/src/anchor.js +1 -1
  197. package/lib/anchor/src/anchor.min.js +1 -1
  198. package/lib/anchor-link/index.js +1 -1
  199. package/lib/anchor-link/index.min.js +1 -1
  200. package/lib/{button-group → button}/src/button-group.js +2 -2
  201. package/lib/button/src/button-group.min.js +1 -0
  202. package/lib/button/src/button.js +3 -3
  203. package/lib/button/src/button.min.js +1 -1
  204. package/lib/button/style/style.css +17 -17
  205. package/lib/button/style/style.min.css +1 -1
  206. package/lib/button-group/index.js +1 -1
  207. package/lib/button-group/index.min.js +1 -1
  208. package/lib/checkbox/index.js +17 -0
  209. package/lib/checkbox/index.min.js +1 -0
  210. package/lib/checkbox/src/checkbox.js +144 -0
  211. package/lib/checkbox/src/checkbox.min.js +1 -0
  212. package/lib/checkbox/src/group.js +129 -0
  213. package/lib/checkbox/src/group.min.js +1 -0
  214. package/lib/checkbox/style/style.css +107 -0
  215. package/lib/checkbox/style/style.min.css +1 -0
  216. package/lib/checkbox-group/index.js +17 -0
  217. package/lib/checkbox-group/index.min.js +1 -0
  218. package/lib/checkbox-group/style/style.css +0 -0
  219. package/lib/checkbox-group/style/style.min.css +0 -0
  220. package/lib/col/index.js +1 -1
  221. package/lib/col/index.min.js +1 -1
  222. package/lib/components.js +290 -63
  223. package/lib/components.min.js +1 -1
  224. package/lib/dynamics/index.js +36 -0
  225. package/lib/dynamics/index.min.js +1 -0
  226. package/lib/form/index.js +15 -0
  227. package/lib/form/index.min.js +1 -0
  228. package/lib/form/src/form-config-item.js +192 -0
  229. package/lib/form/src/form-config-item.min.js +1 -0
  230. package/lib/form/src/form-gather.js +57 -0
  231. package/lib/form/src/form-gather.min.js +1 -0
  232. package/lib/form/src/form-item.js +247 -0
  233. package/lib/form/src/form-item.min.js +1 -0
  234. package/lib/form/src/form.js +768 -0
  235. package/lib/form/src/form.min.js +1 -0
  236. package/lib/form/src/itemInfo.js +47 -0
  237. package/lib/form/src/itemInfo.min.js +1 -0
  238. package/lib/form/src/render.js +84 -0
  239. package/lib/form/src/render.min.js +1 -0
  240. package/lib/form/src/util.js +108 -0
  241. package/lib/form/src/util.min.js +1 -0
  242. package/lib/form/style/index.js +1 -0
  243. package/lib/form/style/style.css +321 -0
  244. package/lib/form/style/style.min.css +1 -0
  245. package/lib/form-design/index.js +15 -0
  246. package/lib/form-design/index.min.js +1 -0
  247. package/lib/form-design/src/form-design.js +87 -0
  248. package/lib/form-design/src/form-design.min.js +1 -0
  249. package/lib/form-design/src/setting.js +18 -0
  250. package/lib/form-design/src/setting.min.js +1 -0
  251. package/lib/form-design/src/util.js +17 -0
  252. package/lib/form-design/src/util.min.js +1 -0
  253. package/lib/form-design/src/view.js +147 -0
  254. package/lib/form-design/src/view.min.js +1 -0
  255. package/lib/form-design/src/widget.js +114 -0
  256. package/lib/form-design/src/widget.min.js +1 -0
  257. package/lib/form-design/style/index.js +1 -0
  258. package/lib/form-design/style/style.css +97 -0
  259. package/lib/form-design/style/style.min.css +1 -0
  260. package/lib/form-gather/index.js +15 -0
  261. package/lib/form-gather/index.min.js +1 -0
  262. package/lib/form-gather/style/index.js +1 -0
  263. package/lib/form-gather/style/style.css +0 -0
  264. package/lib/form-gather/style/style.min.css +0 -0
  265. package/lib/form-item/index.js +15 -0
  266. package/lib/form-item/index.min.js +1 -0
  267. package/lib/form-item/style/index.js +1 -0
  268. package/lib/form-item/style/style.css +0 -0
  269. package/lib/form-item/style/style.min.css +0 -0
  270. package/lib/icon/style/style.css +540 -1
  271. package/lib/icon/style/style.min.css +1 -1
  272. package/lib/index.umd.js +10741 -782
  273. package/lib/index.umd.min.js +1 -1
  274. package/lib/input/index.js +17 -0
  275. package/lib/input/index.min.js +1 -0
  276. package/lib/input/src/date.js +46 -0
  277. package/lib/input/src/date.min.js +1 -0
  278. package/lib/input/src/input.js +2546 -0
  279. package/lib/input/src/input.min.js +1 -0
  280. package/lib/input/src/number.js +18 -0
  281. package/lib/input/src/number.min.js +1 -0
  282. package/lib/input/style/index.js +1 -0
  283. package/lib/input/style/style.css +1000 -0
  284. package/lib/input/style/style.min.css +1 -0
  285. package/lib/layout-aside/style/style.css +1 -0
  286. package/lib/layout-aside/style/style.min.css +1 -1
  287. package/lib/layout-body/style/style.css +1 -0
  288. package/lib/layout-body/style/style.min.css +1 -1
  289. package/lib/layout-footer/style/style.css +1 -0
  290. package/lib/layout-footer/style/style.min.css +1 -1
  291. package/lib/layout-header/style/style.css +1 -0
  292. package/lib/layout-header/style/style.min.css +1 -1
  293. package/lib/list-design/index.js +15 -0
  294. package/lib/list-design/index.min.js +1 -0
  295. package/lib/{design/src/design.js → list-design/src/list-design.js} +7 -7
  296. package/lib/list-design/src/list-design.min.js +1 -0
  297. package/lib/list-design/style/index.js +1 -0
  298. package/lib/list-design/style/style.css +0 -0
  299. package/lib/list-design/style/style.min.css +0 -0
  300. package/lib/loading/index.js +15 -0
  301. package/lib/loading/index.min.js +1 -0
  302. package/lib/loading/src/loading.js +49 -0
  303. package/lib/loading/src/loading.min.js +1 -0
  304. package/lib/loading/style/index.js +1 -0
  305. package/lib/loading/style/style.css +75 -0
  306. package/lib/loading/style/style.min.css +1 -0
  307. package/lib/modal/index.js +110 -0
  308. package/lib/modal/index.min.js +1 -0
  309. package/lib/modal/src/modal.js +1064 -0
  310. package/lib/modal/src/modal.min.js +1 -0
  311. package/lib/modal/style/index.js +1 -0
  312. package/lib/modal/style/style.css +323 -0
  313. package/lib/modal/style/style.min.css +1 -0
  314. package/lib/optgroup/index.js +17 -0
  315. package/lib/optgroup/index.min.js +1 -0
  316. package/lib/optgroup/style/index.js +1 -0
  317. package/lib/optgroup/style/style.css +0 -0
  318. package/lib/optgroup/style/style.min.css +0 -0
  319. package/lib/option/index.js +17 -0
  320. package/lib/option/index.min.js +1 -0
  321. package/lib/option/style/index.js +1 -0
  322. package/lib/option/style/style.css +0 -0
  323. package/lib/option/style/style.min.css +0 -0
  324. package/lib/pager/index.js +17 -0
  325. package/lib/pager/index.min.js +1 -0
  326. package/lib/pager/src/pager.js +593 -0
  327. package/lib/pager/src/pager.min.js +1 -0
  328. package/lib/pager/style/index.js +1 -0
  329. package/lib/pager/style/style.css +319 -0
  330. package/lib/pager/style/style.min.css +1 -0
  331. package/lib/pulldown/index.js +17 -0
  332. package/lib/pulldown/index.min.js +1 -0
  333. package/lib/pulldown/src/pulldown.js +359 -0
  334. package/lib/pulldown/src/pulldown.min.js +1 -0
  335. package/lib/pulldown/style/index.js +1 -0
  336. package/lib/pulldown/style/style.css +57 -0
  337. package/lib/pulldown/style/style.min.css +1 -0
  338. package/lib/radio/index.js +17 -0
  339. package/lib/radio/index.min.js +1 -0
  340. package/lib/radio/src/button.js +135 -0
  341. package/lib/radio/src/button.min.js +1 -0
  342. package/lib/radio/src/group.js +108 -0
  343. package/lib/radio/src/group.min.js +1 -0
  344. package/lib/radio/src/radio.js +139 -0
  345. package/lib/radio/src/radio.min.js +1 -0
  346. package/lib/radio/style/index.js +1 -0
  347. package/lib/radio/style/style.css +143 -0
  348. package/lib/radio/style/style.min.css +1 -0
  349. package/lib/radio-button/index.js +17 -0
  350. package/lib/radio-button/index.min.js +1 -0
  351. package/lib/radio-button/style/index.js +1 -0
  352. package/lib/radio-button/style/style.css +0 -0
  353. package/lib/radio-button/style/style.min.css +0 -0
  354. package/lib/radio-group/index.js +17 -0
  355. package/lib/radio-group/index.min.js +1 -0
  356. package/lib/radio-group/style/index.js +1 -0
  357. package/lib/radio-group/style/style.css +0 -0
  358. package/lib/radio-group/style/style.min.css +0 -0
  359. package/lib/select/index.js +17 -0
  360. package/lib/select/index.min.js +1 -0
  361. package/lib/select/src/optgroup.js +47 -0
  362. package/lib/select/src/optgroup.min.js +1 -0
  363. package/lib/select/src/option.js +45 -0
  364. package/lib/select/src/option.min.js +1 -0
  365. package/lib/select/src/optionInfo.js +24 -0
  366. package/lib/select/src/optionInfo.min.js +1 -0
  367. package/lib/select/src/select.js +1104 -0
  368. package/lib/select/src/select.min.js +1 -0
  369. package/lib/select/src/util.js +57 -0
  370. package/lib/select/src/util.min.js +1 -0
  371. package/lib/select/style/index.js +1 -0
  372. package/lib/select/style/style.css +201 -0
  373. package/lib/select/style/style.min.css +1 -0
  374. package/lib/style.css +1 -1
  375. package/lib/style.min.css +1 -1
  376. package/lib/switch/index.js +17 -0
  377. package/lib/switch/index.min.js +1 -0
  378. package/lib/switch/src/switch.js +161 -0
  379. package/lib/switch/src/switch.min.js +1 -0
  380. package/lib/switch/style/index.js +1 -0
  381. package/lib/switch/style/style.css +97 -0
  382. package/lib/switch/style/style.min.css +1 -0
  383. package/lib/textarea/index.js +17 -0
  384. package/lib/textarea/index.min.js +1 -0
  385. package/lib/textarea/src/textarea.js +298 -0
  386. package/lib/textarea/src/textarea.min.js +1 -0
  387. package/lib/textarea/style/index.js +1 -0
  388. package/lib/textarea/style/style.css +102 -0
  389. package/lib/textarea/style/style.min.css +1 -0
  390. package/lib/tooltip/index.js +15 -0
  391. package/lib/tooltip/index.min.js +1 -0
  392. package/lib/tooltip/src/tooltip.js +418 -0
  393. package/lib/tooltip/src/tooltip.min.js +1 -0
  394. package/lib/tooltip/style/index.js +1 -0
  395. package/lib/tooltip/style/style.css +103 -0
  396. package/lib/tooltip/style/style.min.css +1 -0
  397. package/lib/ui/src/core.js +49 -2
  398. package/lib/ui/src/core.min.js +1 -1
  399. package/lib/ui/src/dom.js +22 -0
  400. package/lib/ui/src/dom.min.js +1 -1
  401. package/lib/ui/src/globalStore.js +119 -4
  402. package/lib/ui/src/globalStore.min.js +1 -1
  403. package/lib/ui/src/i18n.js +14 -0
  404. package/lib/ui/src/i18n.min.js +1 -0
  405. package/lib/ui/src/log.js +2 -3
  406. package/lib/ui/src/log.min.js +1 -1
  407. package/lib/ui/src/renderer.js +77 -0
  408. package/lib/ui/src/renderer.min.js +1 -0
  409. package/lib/ui/src/store.js +49 -0
  410. package/lib/ui/src/store.min.js +1 -0
  411. package/lib/ui/src/utils.js +12 -0
  412. package/lib/ui/src/utils.min.js +1 -1
  413. package/lib/ui/src/validators.js +14 -0
  414. package/lib/ui/src/validators.min.js +1 -0
  415. package/lib/ui/src/vn.js +18 -0
  416. package/lib/ui/src/vn.min.js +1 -0
  417. package/lib/vxe-button/style/style.css +17 -17
  418. package/lib/vxe-button/style/style.min.css +1 -1
  419. package/lib/vxe-checkbox/index.js +22 -0
  420. package/lib/vxe-checkbox/index.min.js +1 -0
  421. package/lib/vxe-checkbox/style/index.js +1 -0
  422. package/lib/vxe-checkbox/style/style.css +107 -0
  423. package/lib/vxe-checkbox/style/style.min.css +1 -0
  424. package/lib/vxe-checkbox-group/index.js +22 -0
  425. package/lib/vxe-checkbox-group/index.min.js +1 -0
  426. package/lib/vxe-checkbox-group/style/index.js +1 -0
  427. package/lib/vxe-checkbox-group/style/style.css +0 -0
  428. package/lib/vxe-checkbox-group/style/style.min.css +0 -0
  429. package/lib/{vxe-design → vxe-form}/index.js +5 -5
  430. package/lib/vxe-form/index.min.js +1 -0
  431. package/lib/vxe-form/style/index.js +1 -0
  432. package/lib/vxe-form/style/style.css +321 -0
  433. package/lib/vxe-form/style/style.min.css +1 -0
  434. package/lib/vxe-form-design/index.js +22 -0
  435. package/lib/vxe-form-design/index.min.js +1 -0
  436. package/lib/vxe-form-design/style/index.js +1 -0
  437. package/lib/vxe-form-design/style/style.css +97 -0
  438. package/lib/vxe-form-design/style/style.min.css +1 -0
  439. package/lib/vxe-form-gather/index.js +22 -0
  440. package/lib/vxe-form-gather/index.min.js +1 -0
  441. package/lib/vxe-form-gather/style/index.js +1 -0
  442. package/lib/vxe-form-gather/style/style.css +0 -0
  443. package/lib/vxe-form-gather/style/style.min.css +0 -0
  444. package/lib/vxe-form-item/index.js +22 -0
  445. package/lib/vxe-form-item/index.min.js +1 -0
  446. package/lib/vxe-form-item/style/index.js +1 -0
  447. package/lib/vxe-form-item/style/style.css +0 -0
  448. package/lib/vxe-form-item/style/style.min.css +0 -0
  449. package/lib/vxe-icon/style/style.css +540 -1
  450. package/lib/vxe-icon/style/style.min.css +1 -1
  451. package/lib/vxe-input/index.js +22 -0
  452. package/lib/vxe-input/index.min.js +1 -0
  453. package/lib/vxe-input/style/index.js +1 -0
  454. package/lib/vxe-input/style/style.css +1000 -0
  455. package/lib/vxe-input/style/style.min.css +1 -0
  456. package/lib/vxe-layout-aside/style/style.css +1 -0
  457. package/lib/vxe-layout-aside/style/style.min.css +1 -1
  458. package/lib/vxe-layout-body/style/style.css +1 -0
  459. package/lib/vxe-layout-body/style/style.min.css +1 -1
  460. package/lib/vxe-layout-footer/style/style.css +1 -0
  461. package/lib/vxe-layout-footer/style/style.min.css +1 -1
  462. package/lib/vxe-layout-header/style/style.css +1 -0
  463. package/lib/vxe-layout-header/style/style.min.css +1 -1
  464. package/lib/vxe-list-design/index.js +22 -0
  465. package/lib/vxe-list-design/index.min.js +1 -0
  466. package/lib/vxe-list-design/style/index.js +1 -0
  467. package/lib/vxe-list-design/style/style.css +0 -0
  468. package/lib/vxe-list-design/style/style.min.css +0 -0
  469. package/lib/vxe-loading/index.js +22 -0
  470. package/lib/vxe-loading/index.min.js +1 -0
  471. package/lib/vxe-loading/style/index.js +1 -0
  472. package/lib/vxe-loading/style/style.css +75 -0
  473. package/lib/vxe-loading/style/style.min.css +1 -0
  474. package/lib/vxe-modal/index.js +22 -0
  475. package/lib/vxe-modal/index.min.js +1 -0
  476. package/lib/vxe-modal/style/index.js +1 -0
  477. package/lib/vxe-modal/style/style.css +323 -0
  478. package/lib/vxe-modal/style/style.min.css +1 -0
  479. package/lib/vxe-optgroup/index.js +22 -0
  480. package/lib/vxe-optgroup/index.min.js +1 -0
  481. package/lib/vxe-optgroup/style/index.js +1 -0
  482. package/lib/vxe-optgroup/style/style.css +0 -0
  483. package/lib/vxe-optgroup/style/style.min.css +0 -0
  484. package/lib/vxe-option/index.js +22 -0
  485. package/lib/vxe-option/index.min.js +1 -0
  486. package/lib/vxe-option/style/index.js +1 -0
  487. package/lib/vxe-option/style/style.css +0 -0
  488. package/lib/vxe-option/style/style.min.css +0 -0
  489. package/lib/vxe-pager/index.js +22 -0
  490. package/lib/vxe-pager/index.min.js +1 -0
  491. package/lib/vxe-pager/style/index.js +1 -0
  492. package/lib/vxe-pager/style/style.css +319 -0
  493. package/lib/vxe-pager/style/style.min.css +1 -0
  494. package/lib/vxe-pulldown/index.js +22 -0
  495. package/lib/vxe-pulldown/index.min.js +1 -0
  496. package/lib/vxe-pulldown/style/index.js +1 -0
  497. package/lib/vxe-pulldown/style/style.css +57 -0
  498. package/lib/vxe-pulldown/style/style.min.css +1 -0
  499. package/lib/vxe-radio/index.js +22 -0
  500. package/lib/vxe-radio/index.min.js +1 -0
  501. package/lib/vxe-radio/style/index.js +1 -0
  502. package/lib/vxe-radio/style/style.css +143 -0
  503. package/lib/vxe-radio/style/style.min.css +1 -0
  504. package/lib/vxe-radio-button/index.js +22 -0
  505. package/lib/vxe-radio-button/index.min.js +1 -0
  506. package/lib/vxe-radio-button/style/index.js +1 -0
  507. package/lib/vxe-radio-button/style/style.css +0 -0
  508. package/lib/vxe-radio-button/style/style.min.css +0 -0
  509. package/lib/vxe-radio-group/index.js +22 -0
  510. package/lib/vxe-radio-group/index.min.js +1 -0
  511. package/lib/vxe-radio-group/style/index.js +1 -0
  512. package/lib/vxe-radio-group/style/style.css +0 -0
  513. package/lib/vxe-radio-group/style/style.min.css +0 -0
  514. package/lib/vxe-select/index.js +22 -0
  515. package/lib/vxe-select/index.min.js +1 -0
  516. package/lib/vxe-select/style/index.js +1 -0
  517. package/lib/vxe-select/style/style.css +201 -0
  518. package/lib/vxe-select/style/style.min.css +1 -0
  519. package/lib/vxe-switch/index.js +22 -0
  520. package/lib/vxe-switch/index.min.js +1 -0
  521. package/lib/vxe-switch/style/index.js +1 -0
  522. package/lib/vxe-switch/style/style.css +97 -0
  523. package/lib/vxe-switch/style/style.min.css +1 -0
  524. package/lib/vxe-textarea/index.js +22 -0
  525. package/lib/vxe-textarea/index.min.js +1 -0
  526. package/lib/vxe-textarea/style/index.js +1 -0
  527. package/lib/vxe-textarea/style/style.css +102 -0
  528. package/lib/vxe-textarea/style/style.min.css +1 -0
  529. package/lib/vxe-tooltip/index.js +22 -0
  530. package/lib/vxe-tooltip/index.min.js +1 -0
  531. package/lib/vxe-tooltip/style/index.js +1 -0
  532. package/lib/vxe-tooltip/style/style.css +103 -0
  533. package/lib/vxe-tooltip/style/style.min.css +1 -0
  534. package/package.json +1 -1
  535. package/packages/anchor/src/anchor.ts +1 -1
  536. package/packages/anchor-link/index.ts +1 -1
  537. package/packages/{button-group → button}/src/button-group.ts +2 -2
  538. package/packages/button/src/button.ts +3 -3
  539. package/packages/button-group/index.ts +1 -1
  540. package/packages/checkbox/index.ts +15 -0
  541. package/packages/checkbox/src/checkbox.ts +131 -0
  542. package/packages/checkbox/src/group.ts +127 -0
  543. package/packages/checkbox-group/index.ts +15 -0
  544. package/packages/col/index.ts +1 -1
  545. package/packages/components.ts +100 -35
  546. package/packages/dynamics/index.ts +34 -0
  547. package/packages/form/index.ts +11 -0
  548. package/packages/form/src/form-config-item.ts +193 -0
  549. package/packages/form/src/form-gather.ts +60 -0
  550. package/packages/form/src/form-item.ts +253 -0
  551. package/packages/form/src/form.ts +716 -0
  552. package/packages/form/src/itemInfo.ts +43 -0
  553. package/packages/form/src/render.ts +83 -0
  554. package/packages/form/src/util.ts +79 -0
  555. package/packages/form-design/index.ts +11 -0
  556. package/packages/form-design/src/form-design.ts +99 -0
  557. package/packages/form-design/src/setting.ts +13 -0
  558. package/packages/form-design/src/util.ts +10 -0
  559. package/packages/form-design/src/view.ts +125 -0
  560. package/packages/form-design/src/widget.ts +117 -0
  561. package/packages/form-gather/index.ts +11 -0
  562. package/packages/form-item/index.ts +11 -0
  563. package/packages/icon/src/icon.ts +1 -1
  564. package/packages/input/index.ts +15 -0
  565. package/packages/input/src/date.ts +42 -0
  566. package/packages/input/src/input.ts +2480 -0
  567. package/packages/input/src/number.ts +12 -0
  568. package/packages/list-design/index.ts +11 -0
  569. package/packages/list-design/src/list-design.ts +55 -0
  570. package/packages/loading/index.ts +11 -0
  571. package/packages/loading/src/loading.ts +56 -0
  572. package/packages/modal/index.ts +110 -0
  573. package/packages/modal/src/modal.ts +950 -0
  574. package/packages/optgroup/index.ts +15 -0
  575. package/packages/option/index.ts +15 -0
  576. package/packages/pager/index.ts +15 -0
  577. package/packages/pager/src/pager.ts +595 -0
  578. package/packages/pulldown/index.ts +15 -0
  579. package/packages/pulldown/src/pulldown.ts +349 -0
  580. package/packages/radio/index.ts +15 -0
  581. package/packages/radio/src/button.ts +132 -0
  582. package/packages/radio/src/group.ts +110 -0
  583. package/packages/radio/src/radio.ts +137 -0
  584. package/packages/radio-button/index.ts +15 -0
  585. package/packages/radio-group/index.ts +15 -0
  586. package/packages/select/index.ts +15 -0
  587. package/packages/select/src/optgroup.ts +39 -0
  588. package/packages/select/src/option.ts +38 -0
  589. package/packages/select/src/optionInfo.ts +20 -0
  590. package/packages/select/src/select.ts +1034 -0
  591. package/packages/select/src/util.ts +47 -0
  592. package/packages/switch/index.ts +15 -0
  593. package/packages/switch/src/switch.ts +171 -0
  594. package/packages/textarea/index.ts +15 -0
  595. package/packages/textarea/src/textarea.ts +273 -0
  596. package/packages/tooltip/index.ts +11 -0
  597. package/packages/tooltip/src/tooltip.ts +360 -0
  598. package/packages/ui/src/core.ts +13 -1
  599. package/packages/ui/src/dom.ts +23 -0
  600. package/packages/ui/src/globalStore.ts +122 -5
  601. package/packages/ui/src/i18n.ts +8 -0
  602. package/packages/ui/src/log.ts +2 -2
  603. package/packages/ui/src/renderer.ts +71 -0
  604. package/packages/ui/src/store.ts +49 -0
  605. package/packages/ui/src/utils.ts +12 -0
  606. package/packages/ui/src/validators.ts +9 -0
  607. package/packages/ui/src/vn.ts +14 -0
  608. package/styles/all.scss +30 -10
  609. package/styles/base/common.scss +13 -0
  610. package/styles/components/button.scss +8 -8
  611. package/styles/components/checkbox-group.scss +0 -0
  612. package/styles/components/checkbox.scss +91 -0
  613. package/styles/components/form-design.scss +93 -0
  614. package/styles/components/form-gather.scss +0 -0
  615. package/styles/components/form-item.scss +0 -0
  616. package/styles/components/form.scss +339 -0
  617. package/styles/components/icon.scss +3 -1
  618. package/styles/components/input.scss +911 -0
  619. package/styles/components/layout-aside.scss +1 -0
  620. package/styles/components/layout-body.scss +1 -0
  621. package/styles/components/layout-footer.scss +1 -0
  622. package/styles/components/layout-header.scss +1 -0
  623. package/styles/components/list-design.scss +0 -0
  624. package/styles/components/list.scss +26 -0
  625. package/styles/components/loading.scss +84 -0
  626. package/styles/components/modal.scss +383 -0
  627. package/styles/components/old-icon.scss +712 -0
  628. package/styles/components/optgroup.scss +0 -0
  629. package/styles/components/option.scss +0 -0
  630. package/styles/components/pager.scss +287 -0
  631. package/styles/components/pulldown.scss +55 -0
  632. package/styles/components/radio-button.scss +0 -0
  633. package/styles/components/radio-group.scss +0 -0
  634. package/styles/components/radio.scss +149 -0
  635. package/styles/components/select.scss +226 -0
  636. package/styles/components/switch.scss +113 -0
  637. package/styles/components/textarea.scss +102 -0
  638. package/styles/components/tooltip.scss +124 -0
  639. package/styles/helpers/mixin.scss +12 -12
  640. package/styles/theme/base.scss +143 -6
  641. package/types/all.d.ts +66 -33
  642. package/types/{component → components}/anchor-link.d.ts +17 -2
  643. package/types/{component → components}/anchor.d.ts +10 -2
  644. package/types/{component → components}/breadcrumb-item.d.ts +12 -1
  645. package/types/{component → components}/breadcrumb.d.ts +10 -2
  646. package/types/{component → components}/button-group.d.ts +11 -3
  647. package/types/{component → components}/button.d.ts +14 -3
  648. package/types/components/checkbox-group.d.ts +112 -0
  649. package/types/components/checkbox.d.ts +119 -0
  650. package/types/{component → components}/col.d.ts +9 -1
  651. package/types/components/form-design.d.ts +88 -0
  652. package/types/components/form-gather.d.ts +75 -0
  653. package/types/components/form-item.d.ts +231 -0
  654. package/types/components/form.d.ts +349 -0
  655. package/types/{component → components}/icon.d.ts +7 -2
  656. package/types/components/input.d.ts +375 -0
  657. package/types/{component → components}/layout-aside.d.ts +10 -2
  658. package/types/{component → components}/layout-body.d.ts +10 -2
  659. package/types/{component → components}/layout-container.d.ts +10 -2
  660. package/types/{component → components}/layout-footer.d.ts +10 -2
  661. package/types/{component → components}/layout-header.d.ts +7 -1
  662. package/types/components/list-design.d.ts +67 -0
  663. package/types/components/loading.d.ts +66 -0
  664. package/types/components/modal.d.ts +381 -0
  665. package/types/components/optgroup.d.ts +80 -0
  666. package/types/components/option.d.ts +99 -0
  667. package/types/components/pager.d.ts +208 -0
  668. package/types/components/pulldown.d.ts +134 -0
  669. package/types/components/radio-button.d.ts +99 -0
  670. package/types/components/radio-group.d.ts +107 -0
  671. package/types/components/radio.d.ts +119 -0
  672. package/types/{component → components}/row.d.ts +10 -2
  673. package/types/components/select.d.ts +274 -0
  674. package/types/components/switch.d.ts +118 -0
  675. package/types/components/textarea.d.ts +212 -0
  676. package/types/components/tooltip.d.ts +122 -0
  677. package/types/ui/global-config.d.ts +43 -6
  678. package/types/ui/global-icon.d.ts +80 -10
  679. package/types/ui/index.d.ts +25 -2
  680. package/types/ui/renderer.d.ts +239 -0
  681. package/types/ui/validators.d.ts +26 -0
  682. package/es/design/index.js +0 -8
  683. package/es/vxe-design/index.js +0 -3
  684. package/lib/button-group/src/button-group.min.js +0 -1
  685. package/lib/design/index.js +0 -15
  686. package/lib/design/index.min.js +0 -1
  687. package/lib/design/src/design.min.js +0 -1
  688. package/lib/vxe-design/index.min.js +0 -1
  689. package/packages/design/index.ts +0 -11
  690. package/packages/design/src/design.ts +0 -55
  691. package/styles/components/design.scss +0 -1
  692. package/types/component/design.d.ts +0 -63
  693. /package/es/{anchor-link → anchor}/src/anchor-link.js +0 -0
  694. /package/es/{anchor-link → anchor}/src/util.js +0 -0
  695. /package/es/{design → checkbox-group}/style.css +0 -0
  696. /package/es/{design → checkbox-group}/style.min.css +0 -0
  697. /package/es/{vxe-design → form-gather}/style.css +0 -0
  698. /package/es/{vxe-design → form-gather}/style.min.css +0 -0
  699. /package/{lib/design/style → es/form-item}/style.css +0 -0
  700. /package/{lib/design/style → es/form-item}/style.min.css +0 -0
  701. /package/{lib/vxe-design/style → es/list-design}/style.css +0 -0
  702. /package/{lib/vxe-design/style → es/list-design}/style.min.css +0 -0
  703. /package/es/{col → row}/src/col.js +0 -0
  704. /package/lib/{anchor-link → anchor}/src/anchor-link.js +0 -0
  705. /package/lib/{anchor-link → anchor}/src/anchor-link.min.js +0 -0
  706. /package/lib/{anchor-link → anchor}/src/util.js +0 -0
  707. /package/lib/{anchor-link → anchor}/src/util.min.js +0 -0
  708. /package/lib/{vxe-design → checkbox}/style/index.js +0 -0
  709. /package/lib/{design → checkbox-group}/style/index.js +0 -0
  710. /package/lib/{col → row}/src/col.js +0 -0
  711. /package/lib/{col → row}/src/col.min.js +0 -0
  712. /package/packages/{anchor-link → anchor}/src/anchor-link.ts +0 -0
  713. /package/packages/{anchor-link → anchor}/src/util.ts +0 -0
  714. /package/packages/{col → row}/src/col.ts +0 -0
@@ -0,0 +1,2546 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _vue = require("vue");
8
+ var _xeUtils = _interopRequireDefault(require("xe-utils"));
9
+ var _globalStore = _interopRequireDefault(require("../../ui/src/globalStore"));
10
+ var _iconStore = _interopRequireDefault(require("../../ui/src/iconStore"));
11
+ var _size = require("../../hooks/size");
12
+ var _utils = require("../../ui/src/utils");
13
+ var _dom = require("../../ui/src/dom");
14
+ var _event = require("../../ui/src/event");
15
+ var _i18n = require("../../ui/src/i18n");
16
+ var _date = require("./date");
17
+ var _number = require("./number");
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ const yearSize = 12;
20
+ const monthSize = 20;
21
+ const quarterSize = 8;
22
+ var _default = exports.default = (0, _vue.defineComponent)({
23
+ name: 'VxeInput',
24
+ props: {
25
+ modelValue: [String, Number, Date],
26
+ immediate: {
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ name: String,
31
+ type: {
32
+ type: String,
33
+ default: 'text'
34
+ },
35
+ clearable: {
36
+ type: Boolean,
37
+ default: () => _globalStore.default.input.clearable
38
+ },
39
+ readonly: Boolean,
40
+ disabled: Boolean,
41
+ placeholder: {
42
+ type: String,
43
+ default: () => _xeUtils.default.eqNull(_globalStore.default.input.placeholder) ? (0, _i18n.getI18n)('vxe.base.pleaseInput') : _globalStore.default.input.placeholder
44
+ },
45
+ maxlength: [String, Number],
46
+ autocomplete: {
47
+ type: String,
48
+ default: 'off'
49
+ },
50
+ align: String,
51
+ form: String,
52
+ className: String,
53
+ size: {
54
+ type: String,
55
+ default: () => _globalStore.default.input.size || _globalStore.default.size
56
+ },
57
+ multiple: Boolean,
58
+ // text
59
+ showWordCount: Boolean,
60
+ countMethod: Function,
61
+ // number、integer、float
62
+ min: {
63
+ type: [String, Number],
64
+ default: null
65
+ },
66
+ max: {
67
+ type: [String, Number],
68
+ default: null
69
+ },
70
+ step: [String, Number],
71
+ exponential: {
72
+ type: Boolean,
73
+ default: () => _globalStore.default.input.exponential
74
+ },
75
+ // number、integer、float、password
76
+ controls: {
77
+ type: Boolean,
78
+ default: () => _globalStore.default.input.controls
79
+ },
80
+ // float
81
+ digits: {
82
+ type: [String, Number],
83
+ default: () => _globalStore.default.input.digits
84
+ },
85
+ // date、week、month、quarter、year
86
+ startDate: {
87
+ type: [String, Number, Date],
88
+ default: () => _globalStore.default.input.startDate
89
+ },
90
+ endDate: {
91
+ type: [String, Number, Date],
92
+ default: () => _globalStore.default.input.endDate
93
+ },
94
+ minDate: [String, Number, Date],
95
+ maxDate: [String, Number, Date],
96
+ // 已废弃 startWeek,被 startDay 替换
97
+ startWeek: Number,
98
+ startDay: {
99
+ type: [String, Number],
100
+ default: () => _globalStore.default.input.startDay
101
+ },
102
+ labelFormat: {
103
+ type: String,
104
+ default: () => _globalStore.default.input.labelFormat
105
+ },
106
+ valueFormat: {
107
+ type: String,
108
+ default: () => _globalStore.default.input.valueFormat
109
+ },
110
+ editable: {
111
+ type: Boolean,
112
+ default: true
113
+ },
114
+ festivalMethod: {
115
+ type: Function,
116
+ default: () => _globalStore.default.input.festivalMethod
117
+ },
118
+ disabledMethod: {
119
+ type: Function,
120
+ default: () => _globalStore.default.input.disabledMethod
121
+ },
122
+ // week
123
+ selectDay: {
124
+ type: [String, Number],
125
+ default: () => _globalStore.default.input.selectDay
126
+ },
127
+ prefixIcon: String,
128
+ suffixIcon: String,
129
+ placement: String,
130
+ transfer: {
131
+ type: Boolean,
132
+ default: () => _globalStore.default.input.transfer
133
+ }
134
+ },
135
+ emits: ['update:modelValue', 'input', 'change', 'keydown', 'keyup', 'wheel', 'click', 'focus', 'blur', 'clear', 'search-click', 'toggle-visible', 'prev-number', 'next-number', 'prefix-click', 'suffix-click', 'date-prev', 'date-today', 'date-next'],
136
+ setup(props, context) {
137
+ const {
138
+ slots,
139
+ emit
140
+ } = context;
141
+ const $xeform = (0, _vue.inject)('$xeForm', null);
142
+ const $xeformiteminfo = (0, _vue.inject)('$xeFormItemInfo', null);
143
+ const xID = _xeUtils.default.uniqueId();
144
+ const computeSize = (0, _size.useSize)(props);
145
+ const reactData = (0, _vue.reactive)({
146
+ inited: false,
147
+ panelIndex: 0,
148
+ showPwd: false,
149
+ visiblePanel: false,
150
+ animatVisible: false,
151
+ panelStyle: null,
152
+ panelPlacement: '',
153
+ isActivated: false,
154
+ inputValue: props.modelValue,
155
+ datetimePanelValue: null,
156
+ datePanelValue: null,
157
+ datePanelLabel: '',
158
+ datePanelType: 'day',
159
+ selectMonth: null,
160
+ currentDate: null
161
+ });
162
+ const refElem = (0, _vue.ref)();
163
+ const refInputTarget = (0, _vue.ref)();
164
+ const refInputPanel = (0, _vue.ref)();
165
+ const refInputTimeBody = (0, _vue.ref)();
166
+ const refMaps = {
167
+ refElem,
168
+ refInput: refInputTarget
169
+ };
170
+ const $xeinput = {
171
+ xID,
172
+ props,
173
+ context,
174
+ reactData,
175
+ getRefMaps: () => refMaps
176
+ };
177
+ let inputMethods = {};
178
+ const parseDate = (value, format) => {
179
+ const {
180
+ type
181
+ } = props;
182
+ if (type === 'time') {
183
+ return (0, _date.toStringTimeDate)(value);
184
+ }
185
+ return _xeUtils.default.toStringDate(value, format);
186
+ };
187
+ const computeIsDateTimeType = (0, _vue.computed)(() => {
188
+ const {
189
+ type
190
+ } = props;
191
+ return type === 'time' || type === 'datetime';
192
+ });
193
+ const computeIsNumType = (0, _vue.computed)(() => {
194
+ return ['number', 'integer', 'float'].indexOf(props.type) > -1;
195
+ });
196
+ const computeInputCount = (0, _vue.computed)(() => {
197
+ return _xeUtils.default.getSize(reactData.inputValue);
198
+ });
199
+ const computeIsCountError = (0, _vue.computed)(() => {
200
+ const inputCount = computeInputCount.value;
201
+ return props.maxlength && inputCount > _xeUtils.default.toNumber(props.maxlength);
202
+ });
203
+ const computeIsDatePickerType = (0, _vue.computed)(() => {
204
+ const isDateTimeType = computeIsDateTimeType.value;
205
+ return isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
206
+ });
207
+ const computeIsPawdType = (0, _vue.computed)(() => {
208
+ return props.type === 'password';
209
+ });
210
+ const computeIsSearchType = (0, _vue.computed)(() => {
211
+ return props.type === 'search';
212
+ });
213
+ const computeDigitsValue = (0, _vue.computed)(() => {
214
+ return _xeUtils.default.toInteger(props.digits) || 1;
215
+ });
216
+ const computeStepValue = (0, _vue.computed)(() => {
217
+ const {
218
+ type
219
+ } = props;
220
+ const digitsValue = computeDigitsValue.value;
221
+ const step = props.step;
222
+ if (type === 'integer') {
223
+ return _xeUtils.default.toInteger(step) || 1;
224
+ } else if (type === 'float') {
225
+ return _xeUtils.default.toNumber(step) || 1 / Math.pow(10, digitsValue);
226
+ }
227
+ return _xeUtils.default.toNumber(step) || 1;
228
+ });
229
+ const computeIsClearable = (0, _vue.computed)(() => {
230
+ const {
231
+ type
232
+ } = props;
233
+ const isNumType = computeIsNumType.value;
234
+ const isDatePickerType = computeIsDatePickerType.value;
235
+ const isPawdType = computeIsPawdType.value;
236
+ return props.clearable && (isPawdType || isNumType || isDatePickerType || type === 'text' || type === 'search');
237
+ });
238
+ const computeDateStartTime = (0, _vue.computed)(() => {
239
+ return props.startDate ? _xeUtils.default.toStringDate(props.startDate) : null;
240
+ });
241
+ const computeDateEndTime = (0, _vue.computed)(() => {
242
+ return props.endDate ? _xeUtils.default.toStringDate(props.endDate) : null;
243
+ });
244
+ const computeSupportMultiples = (0, _vue.computed)(() => {
245
+ return ['date', 'week', 'month', 'quarter', 'year'].includes(props.type);
246
+ });
247
+ const computeDateListValue = (0, _vue.computed)(() => {
248
+ const {
249
+ modelValue,
250
+ multiple
251
+ } = props;
252
+ const isDatePickerType = computeIsDatePickerType.value;
253
+ const dateValueFormat = computeDateValueFormat.value;
254
+ if (multiple && modelValue && isDatePickerType) {
255
+ return _xeUtils.default.toValueString(modelValue).split(',').map(item => {
256
+ const date = parseDate(item, dateValueFormat);
257
+ if (_xeUtils.default.isValidDate(date)) {
258
+ return date;
259
+ }
260
+ return null;
261
+ });
262
+ }
263
+ return [];
264
+ });
265
+ const computeDateMultipleValue = (0, _vue.computed)(() => {
266
+ const dateListValue = computeDateListValue.value;
267
+ const dateValueFormat = computeDateValueFormat.value;
268
+ return dateListValue.map(date => _xeUtils.default.toDateString(date, dateValueFormat));
269
+ });
270
+ const computeDateMultipleLabel = (0, _vue.computed)(() => {
271
+ const dateListValue = computeDateListValue.value;
272
+ const dateLabelFormat = computeDateLabelFormat.value;
273
+ return dateListValue.map(date => _xeUtils.default.toDateString(date, dateLabelFormat)).join(', ');
274
+ });
275
+ const computeDateValueFormat = (0, _vue.computed)(() => {
276
+ const {
277
+ type
278
+ } = props;
279
+ return type === 'time' ? 'HH:mm:ss' : props.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd');
280
+ });
281
+ const computeDateValue = (0, _vue.computed)(() => {
282
+ const {
283
+ modelValue
284
+ } = props;
285
+ const isDatePickerType = computeIsDatePickerType.value;
286
+ const dateValueFormat = computeDateValueFormat.value;
287
+ let val = null;
288
+ if (modelValue && isDatePickerType) {
289
+ const date = parseDate(modelValue, dateValueFormat);
290
+ if (_xeUtils.default.isValidDate(date)) {
291
+ val = date;
292
+ }
293
+ }
294
+ return val;
295
+ });
296
+ const computeIsDisabledPrevDateBtn = (0, _vue.computed)(() => {
297
+ const dateStartTime = computeDateStartTime.value;
298
+ const {
299
+ selectMonth
300
+ } = reactData;
301
+ if (selectMonth && dateStartTime) {
302
+ return selectMonth <= dateStartTime;
303
+ }
304
+ return false;
305
+ });
306
+ const computeIsDisabledNextDateBtn = (0, _vue.computed)(() => {
307
+ const dateEndTime = computeDateEndTime.value;
308
+ const {
309
+ selectMonth
310
+ } = reactData;
311
+ if (selectMonth && dateEndTime) {
312
+ return selectMonth >= dateEndTime;
313
+ }
314
+ return false;
315
+ });
316
+ const computeDateTimeLabel = (0, _vue.computed)(() => {
317
+ const {
318
+ datetimePanelValue
319
+ } = reactData;
320
+ if (datetimePanelValue) {
321
+ return _xeUtils.default.toDateString(datetimePanelValue, 'HH:mm:ss');
322
+ }
323
+ return '';
324
+ });
325
+ const computeDateHMSTime = (0, _vue.computed)(() => {
326
+ const dateValue = computeDateValue.value;
327
+ const isDateTimeType = computeIsDateTimeType.value;
328
+ return dateValue && isDateTimeType ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
329
+ });
330
+ const computeDateLabelFormat = (0, _vue.computed)(() => {
331
+ const isDatePickerType = computeIsDatePickerType.value;
332
+ if (isDatePickerType) {
333
+ return props.labelFormat || (0, _i18n.getI18n)(`vxe.input.date.labelFormat.${props.type}`);
334
+ }
335
+ return null;
336
+ });
337
+ const computeYearList = (0, _vue.computed)(() => {
338
+ const {
339
+ selectMonth,
340
+ currentDate
341
+ } = reactData;
342
+ const years = [];
343
+ if (selectMonth && currentDate) {
344
+ const currFullYear = currentDate.getFullYear();
345
+ const selectFullYear = selectMonth.getFullYear();
346
+ const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
347
+ for (let index = -4; index < yearSize + 4; index++) {
348
+ const date = _xeUtils.default.getWhatYear(startYearDate, index, 'first');
349
+ const itemFullYear = date.getFullYear();
350
+ years.push({
351
+ date,
352
+ isCurrent: true,
353
+ isPrev: index < 0,
354
+ isNow: currFullYear === itemFullYear,
355
+ isNext: index >= yearSize,
356
+ year: itemFullYear
357
+ });
358
+ }
359
+ }
360
+ return years;
361
+ });
362
+ const computeSelectDatePanelLabel = (0, _vue.computed)(() => {
363
+ const isDatePickerType = computeIsDatePickerType.value;
364
+ if (isDatePickerType) {
365
+ const {
366
+ datePanelType,
367
+ selectMonth
368
+ } = reactData;
369
+ const yearList = computeYearList.value;
370
+ let year = '';
371
+ let month;
372
+ if (selectMonth) {
373
+ year = selectMonth.getFullYear();
374
+ month = selectMonth.getMonth() + 1;
375
+ }
376
+ if (datePanelType === 'quarter') {
377
+ return (0, _i18n.getI18n)('vxe.input.date.quarterLabel', [year]);
378
+ } else if (datePanelType === 'month') {
379
+ return (0, _i18n.getI18n)('vxe.input.date.monthLabel', [year]);
380
+ } else if (datePanelType === 'year') {
381
+ return yearList.length ? `${yearList[0].year} - ${yearList[yearList.length - 1].year}` : '';
382
+ }
383
+ return (0, _i18n.getI18n)('vxe.input.date.dayLabel', [year, month ? (0, _i18n.getI18n)(`vxe.input.date.m${month}`) : '-']);
384
+ }
385
+ return '';
386
+ });
387
+ const computeFirstDayOfWeek = (0, _vue.computed)(() => {
388
+ const {
389
+ startDay,
390
+ startWeek
391
+ } = props;
392
+ return _xeUtils.default.toNumber(_xeUtils.default.isNumber(startDay) || _xeUtils.default.isString(startDay) ? startDay : startWeek);
393
+ });
394
+ const computeWeekDatas = (0, _vue.computed)(() => {
395
+ const weeks = [];
396
+ const isDatePickerType = computeIsDatePickerType.value;
397
+ if (isDatePickerType) {
398
+ let sWeek = computeFirstDayOfWeek.value;
399
+ weeks.push(sWeek);
400
+ for (let index = 0; index < 6; index++) {
401
+ if (sWeek >= 6) {
402
+ sWeek = 0;
403
+ } else {
404
+ sWeek++;
405
+ }
406
+ weeks.push(sWeek);
407
+ }
408
+ }
409
+ return weeks;
410
+ });
411
+ const computeDateHeaders = (0, _vue.computed)(() => {
412
+ const isDatePickerType = computeIsDatePickerType.value;
413
+ if (isDatePickerType) {
414
+ const weekDatas = computeWeekDatas.value;
415
+ return weekDatas.map(day => {
416
+ return {
417
+ value: day,
418
+ label: (0, _i18n.getI18n)(`vxe.input.date.weeks.w${day}`)
419
+ };
420
+ });
421
+ }
422
+ return [];
423
+ });
424
+ const computeWeekHeaders = (0, _vue.computed)(() => {
425
+ const isDatePickerType = computeIsDatePickerType.value;
426
+ if (isDatePickerType) {
427
+ const dateHeaders = computeDateHeaders.value;
428
+ return [{
429
+ label: (0, _i18n.getI18n)('vxe.input.date.weeks.w')
430
+ }].concat(dateHeaders);
431
+ }
432
+ return [];
433
+ });
434
+ const computeYearDatas = (0, _vue.computed)(() => {
435
+ const yearList = computeYearList.value;
436
+ return _xeUtils.default.chunk(yearList, 4);
437
+ });
438
+ const computeQuarterList = (0, _vue.computed)(() => {
439
+ const {
440
+ selectMonth,
441
+ currentDate
442
+ } = reactData;
443
+ const quarters = [];
444
+ if (selectMonth && currentDate) {
445
+ const currFullYear = currentDate.getFullYear();
446
+ const currQuarter = (0, _date.getDateQuarter)(currentDate);
447
+ const firstYear = _xeUtils.default.getWhatYear(selectMonth, 0, 'first');
448
+ const selFullYear = firstYear.getFullYear();
449
+ for (let index = -2; index < quarterSize - 2; index++) {
450
+ const date = _xeUtils.default.getWhatQuarter(firstYear, index);
451
+ const itemFullYear = date.getFullYear();
452
+ const itemQuarter = (0, _date.getDateQuarter)(date);
453
+ const isPrev = itemFullYear < selFullYear;
454
+ quarters.push({
455
+ date,
456
+ isPrev,
457
+ isCurrent: itemFullYear === selFullYear,
458
+ isNow: itemFullYear === currFullYear && itemQuarter === currQuarter,
459
+ isNext: !isPrev && itemFullYear > selFullYear,
460
+ quarter: itemQuarter
461
+ });
462
+ }
463
+ }
464
+ return quarters;
465
+ });
466
+ const computeQuarterDatas = (0, _vue.computed)(() => {
467
+ const quarterList = computeQuarterList.value;
468
+ return _xeUtils.default.chunk(quarterList, 2);
469
+ });
470
+ const computeMonthList = (0, _vue.computed)(() => {
471
+ const {
472
+ selectMonth,
473
+ currentDate
474
+ } = reactData;
475
+ const months = [];
476
+ if (selectMonth && currentDate) {
477
+ const currFullYear = currentDate.getFullYear();
478
+ const currMonth = currentDate.getMonth();
479
+ const selFullYear = _xeUtils.default.getWhatYear(selectMonth, 0, 'first').getFullYear();
480
+ for (let index = -4; index < monthSize - 4; index++) {
481
+ const date = _xeUtils.default.getWhatYear(selectMonth, 0, index);
482
+ const itemFullYear = date.getFullYear();
483
+ const itemMonth = date.getMonth();
484
+ const isPrev = itemFullYear < selFullYear;
485
+ months.push({
486
+ date,
487
+ isPrev,
488
+ isCurrent: itemFullYear === selFullYear,
489
+ isNow: itemFullYear === currFullYear && itemMonth === currMonth,
490
+ isNext: !isPrev && itemFullYear > selFullYear,
491
+ month: itemMonth
492
+ });
493
+ }
494
+ }
495
+ return months;
496
+ });
497
+ const computeMonthDatas = (0, _vue.computed)(() => {
498
+ const monthList = computeMonthList.value;
499
+ return _xeUtils.default.chunk(monthList, 4);
500
+ });
501
+ const computeDayList = (0, _vue.computed)(() => {
502
+ const {
503
+ selectMonth,
504
+ currentDate
505
+ } = reactData;
506
+ const days = [];
507
+ if (selectMonth && currentDate) {
508
+ const dateHMSTime = computeDateHMSTime.value;
509
+ const weekDatas = computeWeekDatas.value;
510
+ const currFullYear = currentDate.getFullYear();
511
+ const currMonth = currentDate.getMonth();
512
+ const currDate = currentDate.getDate();
513
+ const selFullYear = selectMonth.getFullYear();
514
+ const selMonth = selectMonth.getMonth();
515
+ const selDay = selectMonth.getDay();
516
+ const prevOffsetDate = -weekDatas.indexOf(selDay);
517
+ const startDayDate = new Date(_xeUtils.default.getWhatDay(selectMonth, prevOffsetDate).getTime() + dateHMSTime);
518
+ for (let index = 0; index < 42; index++) {
519
+ const date = _xeUtils.default.getWhatDay(startDayDate, index);
520
+ const itemFullYear = date.getFullYear();
521
+ const itemMonth = date.getMonth();
522
+ const itemDate = date.getDate();
523
+ const isPrev = date < selectMonth;
524
+ days.push({
525
+ date,
526
+ isPrev,
527
+ isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
528
+ isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
529
+ isNext: !isPrev && selMonth !== itemMonth,
530
+ label: itemDate
531
+ });
532
+ }
533
+ }
534
+ return days;
535
+ });
536
+ const computeDayDatas = (0, _vue.computed)(() => {
537
+ const dayList = computeDayList.value;
538
+ return _xeUtils.default.chunk(dayList, 7);
539
+ });
540
+ const computeWeekDates = (0, _vue.computed)(() => {
541
+ const dayDatas = computeDayDatas.value;
542
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
543
+ return dayDatas.map(list => {
544
+ const firstItem = list[0];
545
+ const item = {
546
+ date: firstItem.date,
547
+ isWeekNumber: true,
548
+ isPrev: false,
549
+ isCurrent: false,
550
+ isNow: false,
551
+ isNext: false,
552
+ label: _xeUtils.default.getYearWeek(firstItem.date, firstDayOfWeek)
553
+ };
554
+ return [item].concat(list);
555
+ });
556
+ });
557
+ const computeHourList = (0, _vue.computed)(() => {
558
+ const list = [];
559
+ const isDateTimeType = computeIsDateTimeType.value;
560
+ if (isDateTimeType) {
561
+ for (let index = 0; index < 24; index++) {
562
+ list.push({
563
+ value: index,
564
+ label: ('' + index).padStart(2, '0')
565
+ });
566
+ }
567
+ }
568
+ return list;
569
+ });
570
+ const computeMinuteList = (0, _vue.computed)(() => {
571
+ const list = [];
572
+ const isDateTimeType = computeIsDateTimeType.value;
573
+ if (isDateTimeType) {
574
+ for (let index = 0; index < 60; index++) {
575
+ list.push({
576
+ value: index,
577
+ label: ('' + index).padStart(2, '0')
578
+ });
579
+ }
580
+ }
581
+ return list;
582
+ });
583
+ const computeSecondList = (0, _vue.computed)(() => {
584
+ const minuteList = computeMinuteList.value;
585
+ return minuteList;
586
+ });
587
+ const computeInpReadonly = (0, _vue.computed)(() => {
588
+ const {
589
+ type,
590
+ readonly,
591
+ editable,
592
+ multiple
593
+ } = props;
594
+ return readonly || multiple || !editable || type === 'week' || type === 'quarter';
595
+ });
596
+ const computeInputType = (0, _vue.computed)(() => {
597
+ const {
598
+ type
599
+ } = props;
600
+ const {
601
+ showPwd
602
+ } = reactData;
603
+ const isNumType = computeIsNumType.value;
604
+ const isDatePickerType = computeIsDatePickerType.value;
605
+ const isPawdType = computeIsPawdType.value;
606
+ if (isDatePickerType || isNumType || isPawdType && showPwd || type === 'number') {
607
+ return 'text';
608
+ }
609
+ return type;
610
+ });
611
+ const computeInpPlaceholder = (0, _vue.computed)(() => {
612
+ const {
613
+ placeholder
614
+ } = props;
615
+ if (placeholder) {
616
+ return (0, _utils.getFuncText)(placeholder);
617
+ }
618
+ return '';
619
+ });
620
+ const computeInpMaxlength = (0, _vue.computed)(() => {
621
+ const {
622
+ maxlength
623
+ } = props;
624
+ const isNumType = computeIsNumType.value;
625
+ // 数值最大长度限制 16 位,包含小数
626
+ return isNumType && !_xeUtils.default.toNumber(maxlength) ? 16 : maxlength;
627
+ });
628
+ const computeInpImmediate = (0, _vue.computed)(() => {
629
+ const {
630
+ type,
631
+ immediate
632
+ } = props;
633
+ return immediate || !(type === 'text' || type === 'number' || type === 'integer' || type === 'float');
634
+ });
635
+ const computeNumValue = (0, _vue.computed)(() => {
636
+ const {
637
+ type
638
+ } = props;
639
+ const {
640
+ inputValue
641
+ } = reactData;
642
+ const isNumType = computeIsNumType.value;
643
+ if (isNumType) {
644
+ return type === 'integer' ? _xeUtils.default.toInteger((0, _number.handleNumber)(inputValue)) : _xeUtils.default.toNumber((0, _number.handleNumber)(inputValue));
645
+ }
646
+ return 0;
647
+ });
648
+ const computeIsDisabledSubtractNumber = (0, _vue.computed)(() => {
649
+ const {
650
+ min
651
+ } = props;
652
+ const {
653
+ inputValue
654
+ } = reactData;
655
+ const isNumType = computeIsNumType.value;
656
+ const numValue = computeNumValue.value;
657
+ // 当有值时再进行判断
658
+ if ((inputValue || inputValue === 0) && isNumType && min !== null) {
659
+ return numValue <= _xeUtils.default.toNumber(min);
660
+ }
661
+ return false;
662
+ });
663
+ const computeIsDisabledAddNumber = (0, _vue.computed)(() => {
664
+ const {
665
+ max
666
+ } = props;
667
+ const {
668
+ inputValue
669
+ } = reactData;
670
+ const isNumType = computeIsNumType.value;
671
+ const numValue = computeNumValue.value;
672
+ // 当有值时再进行判断
673
+ if ((inputValue || inputValue === 0) && isNumType && max !== null) {
674
+ return numValue >= _xeUtils.default.toNumber(max);
675
+ }
676
+ return false;
677
+ });
678
+ const getNumberValue = val => {
679
+ const {
680
+ type,
681
+ exponential
682
+ } = props;
683
+ const inpMaxlength = computeInpMaxlength.value;
684
+ const digitsValue = computeDigitsValue.value;
685
+ const restVal = type === 'float' ? (0, _number.toFloatValueFixed)(val, digitsValue) : _xeUtils.default.toValueString(val);
686
+ if (exponential && (val === restVal || _xeUtils.default.toValueString(val).toLowerCase() === _xeUtils.default.toNumber(restVal).toExponential())) {
687
+ return val;
688
+ }
689
+ return restVal.slice(0, inpMaxlength);
690
+ };
691
+ const triggerEvent = evnt => {
692
+ const {
693
+ inputValue
694
+ } = reactData;
695
+ inputMethods.dispatchEvent(evnt.type, {
696
+ value: inputValue
697
+ }, evnt);
698
+ };
699
+ const emitModel = (value, evnt) => {
700
+ reactData.inputValue = value;
701
+ emit('update:modelValue', value);
702
+ inputMethods.dispatchEvent('input', {
703
+ value
704
+ }, evnt);
705
+ if (_xeUtils.default.toValueString(props.modelValue) !== value) {
706
+ inputMethods.dispatchEvent('change', {
707
+ value
708
+ }, evnt);
709
+ // 自动更新校验状态
710
+ if ($xeform && $xeformiteminfo) {
711
+ $xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, value);
712
+ }
713
+ }
714
+ };
715
+ const emitInputEvent = (value, evnt) => {
716
+ const isDatePickerType = computeIsDatePickerType.value;
717
+ const inpImmediate = computeInpImmediate.value;
718
+ reactData.inputValue = value;
719
+ if (!isDatePickerType) {
720
+ if (inpImmediate) {
721
+ emitModel(value, evnt);
722
+ } else {
723
+ inputMethods.dispatchEvent('input', {
724
+ value
725
+ }, evnt);
726
+ }
727
+ }
728
+ };
729
+ const inputEvent = evnt => {
730
+ const inputElem = evnt.target;
731
+ const value = inputElem.value;
732
+ emitInputEvent(value, evnt);
733
+ };
734
+ const changeEvent = evnt => {
735
+ const inpImmediate = computeInpImmediate.value;
736
+ if (!inpImmediate) {
737
+ triggerEvent(evnt);
738
+ }
739
+ };
740
+ const focusEvent = evnt => {
741
+ reactData.isActivated = true;
742
+ const isDatePickerType = computeIsDatePickerType.value;
743
+ if (isDatePickerType) {
744
+ datePickerOpenEvent(evnt);
745
+ }
746
+ triggerEvent(evnt);
747
+ };
748
+ const clickPrefixEvent = evnt => {
749
+ const {
750
+ disabled
751
+ } = props;
752
+ if (!disabled) {
753
+ const {
754
+ inputValue
755
+ } = reactData;
756
+ inputMethods.dispatchEvent('prefix-click', {
757
+ value: inputValue
758
+ }, evnt);
759
+ }
760
+ };
761
+ let hidePanelTimeout;
762
+ const hidePanel = () => {
763
+ return new Promise(resolve => {
764
+ reactData.visiblePanel = false;
765
+ hidePanelTimeout = window.setTimeout(() => {
766
+ reactData.animatVisible = false;
767
+ resolve();
768
+ }, 350);
769
+ });
770
+ };
771
+ const clearValueEvent = (evnt, value) => {
772
+ const {
773
+ type
774
+ } = props;
775
+ const isNumType = computeIsNumType.value;
776
+ const isDatePickerType = computeIsDatePickerType.value;
777
+ if (isDatePickerType) {
778
+ hidePanel();
779
+ }
780
+ if (isNumType || ['text', 'search', 'password'].indexOf(type) > -1) {
781
+ focus();
782
+ }
783
+ inputMethods.dispatchEvent('clear', {
784
+ value
785
+ }, evnt);
786
+ };
787
+ const clickSuffixEvent = evnt => {
788
+ const {
789
+ disabled
790
+ } = props;
791
+ if (!disabled) {
792
+ if ((0, _dom.hasClass)(evnt.currentTarget, 'is--clear')) {
793
+ emitModel('', evnt);
794
+ clearValueEvent(evnt, '');
795
+ } else {
796
+ const {
797
+ inputValue
798
+ } = reactData;
799
+ inputMethods.dispatchEvent('suffix-click', {
800
+ value: inputValue
801
+ }, evnt);
802
+ }
803
+ }
804
+ };
805
+ const dateParseValue = value => {
806
+ const {
807
+ type
808
+ } = props;
809
+ const {
810
+ valueFormat
811
+ } = props;
812
+ const dateLabelFormat = computeDateLabelFormat.value;
813
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
814
+ let dValue = null;
815
+ let dLabel = '';
816
+ if (value) {
817
+ dValue = parseDate(value, valueFormat);
818
+ }
819
+ if (_xeUtils.default.isValidDate(dValue)) {
820
+ dLabel = _xeUtils.default.toDateString(dValue, dateLabelFormat, {
821
+ firstDay: firstDayOfWeek
822
+ });
823
+ // 由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年
824
+ if (dateLabelFormat && type === 'week') {
825
+ const firstWeekDate = _xeUtils.default.getWhatWeek(dValue, 0, firstDayOfWeek, firstDayOfWeek);
826
+ if (firstWeekDate.getFullYear() < dValue.getFullYear()) {
827
+ const yyIndex = dateLabelFormat.indexOf('yyyy');
828
+ if (yyIndex > -1) {
829
+ const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
830
+ if (yyNum && !isNaN(yyNum)) {
831
+ dLabel = dLabel.replace(`${yyNum}`, `${yyNum - 1}`);
832
+ }
833
+ }
834
+ }
835
+ }
836
+ } else {
837
+ dValue = null;
838
+ }
839
+ reactData.datePanelValue = dValue;
840
+ reactData.datePanelLabel = dLabel;
841
+ };
842
+ /**
843
+ * 值变化时处理
844
+ */
845
+ const changeValue = () => {
846
+ const isDatePickerType = computeIsDatePickerType.value;
847
+ const {
848
+ inputValue
849
+ } = reactData;
850
+ if (isDatePickerType) {
851
+ dateParseValue(inputValue);
852
+ reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
853
+ }
854
+ };
855
+ /**
856
+ * 检查初始值
857
+ */
858
+ const initValue = () => {
859
+ const {
860
+ type
861
+ } = props;
862
+ const {
863
+ inputValue
864
+ } = reactData;
865
+ const isDatePickerType = computeIsDatePickerType.value;
866
+ const digitsValue = computeDigitsValue.value;
867
+ if (isDatePickerType) {
868
+ changeValue();
869
+ } else if (type === 'float') {
870
+ if (inputValue) {
871
+ const validValue = (0, _number.toFloatValueFixed)(inputValue, digitsValue);
872
+ if (inputValue !== validValue) {
873
+ emitModel(validValue, {
874
+ type: 'init'
875
+ });
876
+ }
877
+ }
878
+ }
879
+ };
880
+ const vaildMaxNum = num => {
881
+ return props.max === null || _xeUtils.default.toNumber(num) <= _xeUtils.default.toNumber(props.max);
882
+ };
883
+ const vaildMinNum = num => {
884
+ return props.min === null || _xeUtils.default.toNumber(num) >= _xeUtils.default.toNumber(props.min);
885
+ };
886
+ const dateRevert = () => {
887
+ reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
888
+ };
889
+ const dateCheckMonth = date => {
890
+ const month = _xeUtils.default.getWhatMonth(date, 0, 'first');
891
+ if (!_xeUtils.default.isEqual(month, reactData.selectMonth)) {
892
+ reactData.selectMonth = month;
893
+ }
894
+ };
895
+ const dateChange = date => {
896
+ const {
897
+ modelValue,
898
+ multiple
899
+ } = props;
900
+ const {
901
+ datetimePanelValue
902
+ } = reactData;
903
+ const isDateTimeType = computeIsDateTimeType.value;
904
+ const dateValueFormat = computeDateValueFormat.value;
905
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
906
+ if (props.type === 'week') {
907
+ const sWeek = _xeUtils.default.toNumber(props.selectDay);
908
+ date = _xeUtils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
909
+ } else if (isDateTimeType) {
910
+ date.setHours(datetimePanelValue.getHours());
911
+ date.setMinutes(datetimePanelValue.getMinutes());
912
+ date.setSeconds(datetimePanelValue.getSeconds());
913
+ }
914
+ const inpVal = _xeUtils.default.toDateString(date, dateValueFormat, {
915
+ firstDay: firstDayOfWeek
916
+ });
917
+ dateCheckMonth(date);
918
+ if (multiple) {
919
+ // 如果为多选
920
+ const dateMultipleValue = computeDateMultipleValue.value;
921
+ if (isDateTimeType) {
922
+ // 如果是datetime特殊类型
923
+ const dateListValue = [...computeDateListValue.value];
924
+ const datetimeRest = [];
925
+ const eqIndex = _xeUtils.default.findIndexOf(dateListValue, val => _xeUtils.default.isDateSame(date, val, 'yyyyMMdd'));
926
+ if (eqIndex === -1) {
927
+ dateListValue.push(date);
928
+ } else {
929
+ dateListValue.splice(eqIndex, 1);
930
+ }
931
+ dateListValue.forEach(item => {
932
+ if (item) {
933
+ item.setHours(datetimePanelValue.getHours());
934
+ item.setMinutes(datetimePanelValue.getMinutes());
935
+ item.setSeconds(datetimePanelValue.getSeconds());
936
+ datetimeRest.push(item);
937
+ }
938
+ });
939
+ emitModel(datetimeRest.map(date => _xeUtils.default.toDateString(date, dateValueFormat)).join(','), {
940
+ type: 'update'
941
+ });
942
+ } else {
943
+ // 如果是日期类型
944
+ if (dateMultipleValue.some(val => _xeUtils.default.isEqual(val, inpVal))) {
945
+ emitModel(dateMultipleValue.filter(val => !_xeUtils.default.isEqual(val, inpVal)).join(','), {
946
+ type: 'update'
947
+ });
948
+ } else {
949
+ emitModel(dateMultipleValue.concat([inpVal]).join(','), {
950
+ type: 'update'
951
+ });
952
+ }
953
+ }
954
+ } else {
955
+ // 如果为单选
956
+ if (!_xeUtils.default.isEqual(modelValue, inpVal)) {
957
+ emitModel(inpVal, {
958
+ type: 'update'
959
+ });
960
+ }
961
+ }
962
+ };
963
+ const afterCheckValue = () => {
964
+ const {
965
+ type,
966
+ min,
967
+ max,
968
+ exponential
969
+ } = props;
970
+ const {
971
+ inputValue,
972
+ datetimePanelValue
973
+ } = reactData;
974
+ const isNumType = computeIsNumType.value;
975
+ const isDatePickerType = computeIsDatePickerType.value;
976
+ const dateLabelFormat = computeDateLabelFormat.value;
977
+ const inpReadonly = computeInpReadonly.value;
978
+ if (!inpReadonly) {
979
+ if (isNumType) {
980
+ if (inputValue) {
981
+ let inpNumVal = type === 'integer' ? _xeUtils.default.toInteger((0, _number.handleNumber)(inputValue)) : _xeUtils.default.toNumber((0, _number.handleNumber)(inputValue));
982
+ if (!vaildMinNum(inpNumVal)) {
983
+ inpNumVal = min;
984
+ } else if (!vaildMaxNum(inpNumVal)) {
985
+ inpNumVal = max;
986
+ }
987
+ if (exponential) {
988
+ const inpStringVal = _xeUtils.default.toValueString(inputValue).toLowerCase();
989
+ if (inpStringVal === _xeUtils.default.toNumber(inpNumVal).toExponential()) {
990
+ inpNumVal = inpStringVal;
991
+ }
992
+ }
993
+ emitModel(getNumberValue(inpNumVal), {
994
+ type: 'check'
995
+ });
996
+ }
997
+ } else if (isDatePickerType) {
998
+ if (inputValue) {
999
+ let inpDateVal = parseDate(inputValue, dateLabelFormat);
1000
+ if (_xeUtils.default.isValidDate(inpDateVal)) {
1001
+ if (type === 'time') {
1002
+ inpDateVal = _xeUtils.default.toDateString(inpDateVal, dateLabelFormat);
1003
+ if (inputValue !== inpDateVal) {
1004
+ emitModel(inpDateVal, {
1005
+ type: 'check'
1006
+ });
1007
+ }
1008
+ reactData.inputValue = inpDateVal;
1009
+ } else {
1010
+ let isChange = false;
1011
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
1012
+ if (type === 'datetime') {
1013
+ const dateValue = computeDateValue.value;
1014
+ if (inputValue !== _xeUtils.default.toDateString(dateValue, dateLabelFormat) || inputValue !== _xeUtils.default.toDateString(inpDateVal, dateLabelFormat)) {
1015
+ isChange = true;
1016
+ datetimePanelValue.setHours(inpDateVal.getHours());
1017
+ datetimePanelValue.setMinutes(inpDateVal.getMinutes());
1018
+ datetimePanelValue.setSeconds(inpDateVal.getSeconds());
1019
+ }
1020
+ } else {
1021
+ isChange = true;
1022
+ }
1023
+ reactData.inputValue = _xeUtils.default.toDateString(inpDateVal, dateLabelFormat, {
1024
+ firstDay: firstDayOfWeek
1025
+ });
1026
+ if (isChange) {
1027
+ dateChange(inpDateVal);
1028
+ }
1029
+ }
1030
+ } else {
1031
+ dateRevert();
1032
+ }
1033
+ } else {
1034
+ emitModel('', {
1035
+ type: 'check'
1036
+ });
1037
+ }
1038
+ }
1039
+ }
1040
+ };
1041
+ const blurEvent = evnt => {
1042
+ const {
1043
+ inputValue
1044
+ } = reactData;
1045
+ const inpImmediate = computeInpImmediate.value;
1046
+ if (!inpImmediate) {
1047
+ emitModel(inputValue, evnt);
1048
+ }
1049
+ afterCheckValue();
1050
+ if (!reactData.visiblePanel) {
1051
+ reactData.isActivated = false;
1052
+ }
1053
+ inputMethods.dispatchEvent('blur', {
1054
+ value: inputValue
1055
+ }, evnt);
1056
+ };
1057
+ // 密码
1058
+ const passwordToggleEvent = evnt => {
1059
+ const {
1060
+ readonly,
1061
+ disabled
1062
+ } = props;
1063
+ const {
1064
+ showPwd
1065
+ } = reactData;
1066
+ if (!disabled && !readonly) {
1067
+ reactData.showPwd = !showPwd;
1068
+ }
1069
+ inputMethods.dispatchEvent('toggle-visible', {
1070
+ visible: reactData.showPwd
1071
+ }, evnt);
1072
+ };
1073
+ // 密码
1074
+ // 搜索
1075
+ const searchEvent = evnt => {
1076
+ inputMethods.dispatchEvent('search-click', {}, evnt);
1077
+ };
1078
+ // 搜索
1079
+ // 数值
1080
+ const numberChange = (isPlus, evnt) => {
1081
+ const {
1082
+ min,
1083
+ max,
1084
+ type
1085
+ } = props;
1086
+ const {
1087
+ inputValue
1088
+ } = reactData;
1089
+ const stepValue = computeStepValue.value;
1090
+ const numValue = type === 'integer' ? _xeUtils.default.toInteger((0, _number.handleNumber)(inputValue)) : _xeUtils.default.toNumber((0, _number.handleNumber)(inputValue));
1091
+ const newValue = isPlus ? _xeUtils.default.add(numValue, stepValue) : _xeUtils.default.subtract(numValue, stepValue);
1092
+ let restNum;
1093
+ if (!vaildMinNum(newValue)) {
1094
+ restNum = min;
1095
+ } else if (!vaildMaxNum(newValue)) {
1096
+ restNum = max;
1097
+ } else {
1098
+ restNum = newValue;
1099
+ }
1100
+ emitInputEvent(getNumberValue(restNum), evnt);
1101
+ };
1102
+ let downbumTimeout;
1103
+ const numberNextEvent = evnt => {
1104
+ const {
1105
+ readonly,
1106
+ disabled
1107
+ } = props;
1108
+ const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
1109
+ clearTimeout(downbumTimeout);
1110
+ if (!disabled && !readonly && !isDisabledSubtractNumber) {
1111
+ numberChange(false, evnt);
1112
+ }
1113
+ inputMethods.dispatchEvent('next-number', {}, evnt);
1114
+ };
1115
+ const numberDownNextEvent = evnt => {
1116
+ downbumTimeout = window.setTimeout(() => {
1117
+ numberNextEvent(evnt);
1118
+ numberDownNextEvent(evnt);
1119
+ }, 60);
1120
+ };
1121
+ const numberPrevEvent = evnt => {
1122
+ const {
1123
+ readonly,
1124
+ disabled
1125
+ } = props;
1126
+ const isDisabledAddNumber = computeIsDisabledAddNumber.value;
1127
+ clearTimeout(downbumTimeout);
1128
+ if (!disabled && !readonly && !isDisabledAddNumber) {
1129
+ numberChange(true, evnt);
1130
+ }
1131
+ inputMethods.dispatchEvent('prev-number', {}, evnt);
1132
+ };
1133
+ const numberKeydownEvent = evnt => {
1134
+ const isUpArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_UP);
1135
+ const isDwArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_DOWN);
1136
+ if (isUpArrow || isDwArrow) {
1137
+ evnt.preventDefault();
1138
+ if (isUpArrow) {
1139
+ numberPrevEvent(evnt);
1140
+ } else {
1141
+ numberNextEvent(evnt);
1142
+ }
1143
+ }
1144
+ };
1145
+ const keydownEvent = evnt => {
1146
+ const {
1147
+ exponential,
1148
+ controls
1149
+ } = props;
1150
+ const isNumType = computeIsNumType.value;
1151
+ if (isNumType) {
1152
+ const isCtrlKey = evnt.ctrlKey;
1153
+ const isShiftKey = evnt.shiftKey;
1154
+ const isAltKey = evnt.altKey;
1155
+ const keyCode = evnt.keyCode;
1156
+ if (!isCtrlKey && !isShiftKey && !isAltKey && ((0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.SPACEBAR) || (!exponential || keyCode !== 69) && keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191)) {
1157
+ evnt.preventDefault();
1158
+ }
1159
+ if (controls) {
1160
+ numberKeydownEvent(evnt);
1161
+ }
1162
+ }
1163
+ triggerEvent(evnt);
1164
+ };
1165
+ const keyupEvent = evnt => {
1166
+ triggerEvent(evnt);
1167
+ };
1168
+ // 数值
1169
+ const numberStopDown = () => {
1170
+ clearTimeout(downbumTimeout);
1171
+ };
1172
+ const numberDownPrevEvent = evnt => {
1173
+ downbumTimeout = window.setTimeout(() => {
1174
+ numberPrevEvent(evnt);
1175
+ numberDownPrevEvent(evnt);
1176
+ }, 60);
1177
+ };
1178
+ const numberMousedownEvent = evnt => {
1179
+ numberStopDown();
1180
+ if (evnt.button === 0) {
1181
+ const isPrevNumber = (0, _dom.hasClass)(evnt.currentTarget, 'is--prev');
1182
+ if (isPrevNumber) {
1183
+ numberPrevEvent(evnt);
1184
+ } else {
1185
+ numberNextEvent(evnt);
1186
+ }
1187
+ downbumTimeout = window.setTimeout(() => {
1188
+ if (isPrevNumber) {
1189
+ numberDownPrevEvent(evnt);
1190
+ } else {
1191
+ numberDownNextEvent(evnt);
1192
+ }
1193
+ }, 500);
1194
+ }
1195
+ };
1196
+ const wheelEvent = evnt => {
1197
+ const isNumType = computeIsNumType.value;
1198
+ if (isNumType && props.controls) {
1199
+ if (reactData.isActivated) {
1200
+ const delta = evnt.deltaY;
1201
+ if (delta > 0) {
1202
+ numberNextEvent(evnt);
1203
+ } else if (delta < 0) {
1204
+ numberPrevEvent(evnt);
1205
+ }
1206
+ evnt.preventDefault();
1207
+ }
1208
+ }
1209
+ triggerEvent(evnt);
1210
+ };
1211
+ // 日期
1212
+ const dateMonthHandle = (date, offsetMonth) => {
1213
+ reactData.selectMonth = _xeUtils.default.getWhatMonth(date, offsetMonth, 'first');
1214
+ };
1215
+ const dateNowHandle = () => {
1216
+ const currentDate = _xeUtils.default.getWhatDay(Date.now(), 0, 'first');
1217
+ reactData.currentDate = currentDate;
1218
+ dateMonthHandle(currentDate, 0);
1219
+ };
1220
+ const dateToggleTypeEvent = () => {
1221
+ let {
1222
+ datePanelType
1223
+ } = reactData;
1224
+ if (datePanelType === 'month' || datePanelType === 'quarter') {
1225
+ datePanelType = 'year';
1226
+ } else {
1227
+ datePanelType = 'month';
1228
+ }
1229
+ reactData.datePanelType = datePanelType;
1230
+ };
1231
+ const datePrevEvent = evnt => {
1232
+ const {
1233
+ type
1234
+ } = props;
1235
+ const {
1236
+ datePanelType,
1237
+ selectMonth
1238
+ } = reactData;
1239
+ const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
1240
+ if (!isDisabledPrevDateBtn) {
1241
+ if (type === 'year') {
1242
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, -yearSize, 'first');
1243
+ } else if (type === 'month' || type === 'quarter') {
1244
+ if (datePanelType === 'year') {
1245
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, -yearSize, 'first');
1246
+ } else {
1247
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, -1, 'first');
1248
+ }
1249
+ } else {
1250
+ if (datePanelType === 'year') {
1251
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, -yearSize, 'first');
1252
+ } else if (datePanelType === 'month') {
1253
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, -1, 'first');
1254
+ } else {
1255
+ reactData.selectMonth = _xeUtils.default.getWhatMonth(selectMonth, -1, 'first');
1256
+ }
1257
+ }
1258
+ inputMethods.dispatchEvent('date-prev', {
1259
+ type
1260
+ }, evnt);
1261
+ }
1262
+ };
1263
+ const dateTodayMonthEvent = evnt => {
1264
+ dateNowHandle();
1265
+ if (!props.multiple) {
1266
+ dateChange(reactData.currentDate);
1267
+ hidePanel();
1268
+ }
1269
+ inputMethods.dispatchEvent('date-today', {
1270
+ type: props.type
1271
+ }, evnt);
1272
+ };
1273
+ const dateNextEvent = evnt => {
1274
+ const {
1275
+ type
1276
+ } = props;
1277
+ const {
1278
+ datePanelType,
1279
+ selectMonth
1280
+ } = reactData;
1281
+ const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
1282
+ if (!isDisabledNextDateBtn) {
1283
+ if (type === 'year') {
1284
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, yearSize, 'first');
1285
+ } else if (type === 'month' || type === 'quarter') {
1286
+ if (datePanelType === 'year') {
1287
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, yearSize, 'first');
1288
+ } else {
1289
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, 1, 'first');
1290
+ }
1291
+ } else {
1292
+ if (datePanelType === 'year') {
1293
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, yearSize, 'first');
1294
+ } else if (datePanelType === 'month') {
1295
+ reactData.selectMonth = _xeUtils.default.getWhatYear(selectMonth, 1, 'first');
1296
+ } else {
1297
+ reactData.selectMonth = _xeUtils.default.getWhatMonth(selectMonth, 1, 'first');
1298
+ }
1299
+ }
1300
+ inputMethods.dispatchEvent('date-next', {
1301
+ type
1302
+ }, evnt);
1303
+ }
1304
+ };
1305
+ const isDateDisabled = item => {
1306
+ const {
1307
+ disabledMethod
1308
+ } = props;
1309
+ const {
1310
+ datePanelType
1311
+ } = reactData;
1312
+ return disabledMethod && disabledMethod({
1313
+ type: datePanelType,
1314
+ viewType: datePanelType,
1315
+ date: item.date,
1316
+ $input: $xeinput
1317
+ });
1318
+ };
1319
+ const dateSelectItem = date => {
1320
+ const {
1321
+ type,
1322
+ multiple
1323
+ } = props;
1324
+ const {
1325
+ datePanelType
1326
+ } = reactData;
1327
+ if (type === 'month') {
1328
+ if (datePanelType === 'year') {
1329
+ reactData.datePanelType = 'month';
1330
+ dateCheckMonth(date);
1331
+ } else {
1332
+ dateChange(date);
1333
+ if (!multiple) {
1334
+ hidePanel();
1335
+ }
1336
+ }
1337
+ } else if (type === 'year') {
1338
+ dateChange(date);
1339
+ if (!multiple) {
1340
+ hidePanel();
1341
+ }
1342
+ } else if (type === 'quarter') {
1343
+ if (datePanelType === 'year') {
1344
+ reactData.datePanelType = 'quarter';
1345
+ dateCheckMonth(date);
1346
+ } else {
1347
+ dateChange(date);
1348
+ if (!multiple) {
1349
+ hidePanel();
1350
+ }
1351
+ }
1352
+ } else {
1353
+ if (datePanelType === 'month') {
1354
+ reactData.datePanelType = type === 'week' ? type : 'day';
1355
+ dateCheckMonth(date);
1356
+ } else if (datePanelType === 'year') {
1357
+ reactData.datePanelType = 'month';
1358
+ dateCheckMonth(date);
1359
+ } else {
1360
+ dateChange(date);
1361
+ if (type === 'datetime') {
1362
+ // 日期带时间
1363
+ } else {
1364
+ if (!multiple) {
1365
+ hidePanel();
1366
+ }
1367
+ }
1368
+ }
1369
+ }
1370
+ };
1371
+ const dateSelectEvent = item => {
1372
+ if (!isDateDisabled(item)) {
1373
+ dateSelectItem(item.date);
1374
+ }
1375
+ };
1376
+ const dateMoveDay = offsetDay => {
1377
+ if (!isDateDisabled({
1378
+ date: offsetDay
1379
+ })) {
1380
+ const dayList = computeDayList.value;
1381
+ if (!dayList.some(item => _xeUtils.default.isDateSame(item.date, offsetDay, 'yyyyMMdd'))) {
1382
+ dateCheckMonth(offsetDay);
1383
+ }
1384
+ dateParseValue(offsetDay);
1385
+ }
1386
+ };
1387
+ const dateMoveYear = offsetYear => {
1388
+ if (!isDateDisabled({
1389
+ date: offsetYear
1390
+ })) {
1391
+ const yearList = computeYearList.value;
1392
+ if (!yearList.some(item => _xeUtils.default.isDateSame(item.date, offsetYear, 'yyyy'))) {
1393
+ dateCheckMonth(offsetYear);
1394
+ }
1395
+ dateParseValue(offsetYear);
1396
+ }
1397
+ };
1398
+ const dateMoveQuarter = offsetQuarter => {
1399
+ if (!isDateDisabled({
1400
+ date: offsetQuarter
1401
+ })) {
1402
+ const quarterList = computeQuarterList.value;
1403
+ if (!quarterList.some(item => _xeUtils.default.isDateSame(item.date, offsetQuarter, 'yyyyq'))) {
1404
+ dateCheckMonth(offsetQuarter);
1405
+ }
1406
+ dateParseValue(offsetQuarter);
1407
+ }
1408
+ };
1409
+ const dateMoveMonth = offsetMonth => {
1410
+ if (!isDateDisabled({
1411
+ date: offsetMonth
1412
+ })) {
1413
+ const monthList = computeMonthList.value;
1414
+ if (!monthList.some(item => _xeUtils.default.isDateSame(item.date, offsetMonth, 'yyyyMM'))) {
1415
+ dateCheckMonth(offsetMonth);
1416
+ }
1417
+ dateParseValue(offsetMonth);
1418
+ }
1419
+ };
1420
+ const dateMouseenterEvent = item => {
1421
+ if (!isDateDisabled(item)) {
1422
+ const {
1423
+ datePanelType
1424
+ } = reactData;
1425
+ if (datePanelType === 'month') {
1426
+ dateMoveMonth(item.date);
1427
+ } else if (datePanelType === 'quarter') {
1428
+ dateMoveQuarter(item.date);
1429
+ } else if (datePanelType === 'year') {
1430
+ dateMoveYear(item.date);
1431
+ } else {
1432
+ dateMoveDay(item.date);
1433
+ }
1434
+ }
1435
+ };
1436
+ const updateTimePos = liElem => {
1437
+ if (liElem) {
1438
+ const height = liElem.offsetHeight;
1439
+ const ulElem = liElem.parentNode;
1440
+ ulElem.scrollTop = liElem.offsetTop - height * 4;
1441
+ }
1442
+ };
1443
+ const dateTimeChangeEvent = evnt => {
1444
+ reactData.datetimePanelValue = new Date(reactData.datetimePanelValue.getTime());
1445
+ updateTimePos(evnt.currentTarget);
1446
+ };
1447
+ const dateHourEvent = (evnt, item) => {
1448
+ reactData.datetimePanelValue.setHours(item.value);
1449
+ dateTimeChangeEvent(evnt);
1450
+ };
1451
+ const dateConfirmEvent = () => {
1452
+ const {
1453
+ multiple
1454
+ } = props;
1455
+ const {
1456
+ datetimePanelValue
1457
+ } = reactData;
1458
+ const dateValue = computeDateValue.value;
1459
+ const isDateTimeType = computeIsDateTimeType.value;
1460
+ if (isDateTimeType) {
1461
+ const dateValueFormat = computeDateValueFormat.value;
1462
+ if (multiple) {
1463
+ // 如果为多选
1464
+ const dateMultipleValue = computeDateMultipleValue.value;
1465
+ if (isDateTimeType) {
1466
+ // 如果是datetime特殊类型
1467
+ const dateListValue = [...computeDateListValue.value];
1468
+ const datetimeRest = [];
1469
+ dateListValue.forEach(item => {
1470
+ if (item) {
1471
+ item.setHours(datetimePanelValue.getHours());
1472
+ item.setMinutes(datetimePanelValue.getMinutes());
1473
+ item.setSeconds(datetimePanelValue.getSeconds());
1474
+ datetimeRest.push(item);
1475
+ }
1476
+ });
1477
+ emitModel(datetimeRest.map(date => _xeUtils.default.toDateString(date, dateValueFormat)).join(','), {
1478
+ type: 'update'
1479
+ });
1480
+ } else {
1481
+ // 如果是日期类型
1482
+ emitModel(dateMultipleValue.join(','), {
1483
+ type: 'update'
1484
+ });
1485
+ }
1486
+ } else {
1487
+ dateChange(dateValue || reactData.currentDate);
1488
+ }
1489
+ }
1490
+ hidePanel();
1491
+ };
1492
+ const dateMinuteEvent = (evnt, item) => {
1493
+ reactData.datetimePanelValue.setMinutes(item.value);
1494
+ dateTimeChangeEvent(evnt);
1495
+ };
1496
+ const dateSecondEvent = (evnt, item) => {
1497
+ reactData.datetimePanelValue.setSeconds(item.value);
1498
+ dateTimeChangeEvent(evnt);
1499
+ };
1500
+ const dateOffsetEvent = evnt => {
1501
+ const {
1502
+ isActivated,
1503
+ datePanelValue,
1504
+ datePanelType
1505
+ } = reactData;
1506
+ if (isActivated) {
1507
+ evnt.preventDefault();
1508
+ const isLeftArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_LEFT);
1509
+ const isUpArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_UP);
1510
+ const isRightArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_RIGHT);
1511
+ const isDwArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_DOWN);
1512
+ if (datePanelType === 'year') {
1513
+ let offsetYear = _xeUtils.default.getWhatYear(datePanelValue || Date.now(), 0, 'first');
1514
+ if (isLeftArrow) {
1515
+ offsetYear = _xeUtils.default.getWhatYear(offsetYear, -1);
1516
+ } else if (isUpArrow) {
1517
+ offsetYear = _xeUtils.default.getWhatYear(offsetYear, -4);
1518
+ } else if (isRightArrow) {
1519
+ offsetYear = _xeUtils.default.getWhatYear(offsetYear, 1);
1520
+ } else if (isDwArrow) {
1521
+ offsetYear = _xeUtils.default.getWhatYear(offsetYear, 4);
1522
+ }
1523
+ dateMoveYear(offsetYear);
1524
+ } else if (datePanelType === 'quarter') {
1525
+ let offsetQuarter = _xeUtils.default.getWhatQuarter(datePanelValue || Date.now(), 0, 'first');
1526
+ if (isLeftArrow) {
1527
+ offsetQuarter = _xeUtils.default.getWhatQuarter(offsetQuarter, -1);
1528
+ } else if (isUpArrow) {
1529
+ offsetQuarter = _xeUtils.default.getWhatQuarter(offsetQuarter, -2);
1530
+ } else if (isRightArrow) {
1531
+ offsetQuarter = _xeUtils.default.getWhatQuarter(offsetQuarter, 1);
1532
+ } else if (isDwArrow) {
1533
+ offsetQuarter = _xeUtils.default.getWhatQuarter(offsetQuarter, 2);
1534
+ }
1535
+ dateMoveQuarter(offsetQuarter);
1536
+ } else if (datePanelType === 'month') {
1537
+ let offsetMonth = _xeUtils.default.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
1538
+ if (isLeftArrow) {
1539
+ offsetMonth = _xeUtils.default.getWhatMonth(offsetMonth, -1);
1540
+ } else if (isUpArrow) {
1541
+ offsetMonth = _xeUtils.default.getWhatMonth(offsetMonth, -4);
1542
+ } else if (isRightArrow) {
1543
+ offsetMonth = _xeUtils.default.getWhatMonth(offsetMonth, 1);
1544
+ } else if (isDwArrow) {
1545
+ offsetMonth = _xeUtils.default.getWhatMonth(offsetMonth, 4);
1546
+ }
1547
+ dateMoveMonth(offsetMonth);
1548
+ } else {
1549
+ let offsetDay = datePanelValue || _xeUtils.default.getWhatDay(Date.now(), 0, 'first');
1550
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
1551
+ if (isLeftArrow) {
1552
+ offsetDay = _xeUtils.default.getWhatDay(offsetDay, -1);
1553
+ } else if (isUpArrow) {
1554
+ offsetDay = _xeUtils.default.getWhatWeek(offsetDay, -1, firstDayOfWeek);
1555
+ } else if (isRightArrow) {
1556
+ offsetDay = _xeUtils.default.getWhatDay(offsetDay, 1);
1557
+ } else if (isDwArrow) {
1558
+ offsetDay = _xeUtils.default.getWhatWeek(offsetDay, 1, firstDayOfWeek);
1559
+ }
1560
+ dateMoveDay(offsetDay);
1561
+ }
1562
+ }
1563
+ };
1564
+ const datePgOffsetEvent = evnt => {
1565
+ const {
1566
+ isActivated
1567
+ } = reactData;
1568
+ if (isActivated) {
1569
+ const isPgUp = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.PAGE_UP);
1570
+ evnt.preventDefault();
1571
+ if (isPgUp) {
1572
+ datePrevEvent(evnt);
1573
+ } else {
1574
+ dateNextEvent(evnt);
1575
+ }
1576
+ }
1577
+ };
1578
+ const dateOpenPanel = () => {
1579
+ const {
1580
+ type
1581
+ } = props;
1582
+ const isDateTimeType = computeIsDateTimeType.value;
1583
+ const dateValue = computeDateValue.value;
1584
+ if (['year', 'quarter', 'month', 'week'].indexOf(type) > -1) {
1585
+ reactData.datePanelType = type;
1586
+ } else {
1587
+ reactData.datePanelType = 'day';
1588
+ }
1589
+ reactData.currentDate = _xeUtils.default.getWhatDay(Date.now(), 0, 'first');
1590
+ if (dateValue) {
1591
+ dateMonthHandle(dateValue, 0);
1592
+ dateParseValue(dateValue);
1593
+ } else {
1594
+ dateNowHandle();
1595
+ }
1596
+ if (isDateTimeType) {
1597
+ reactData.datetimePanelValue = reactData.datePanelValue || _xeUtils.default.getWhatDay(Date.now(), 0, 'first');
1598
+ (0, _vue.nextTick)(() => {
1599
+ const timeBodyElem = refInputTimeBody.value;
1600
+ _xeUtils.default.arrayEach(timeBodyElem.querySelectorAll('li.is--selected'), updateTimePos);
1601
+ });
1602
+ }
1603
+ };
1604
+ // 日期
1605
+ // 弹出面板
1606
+ const updateZindex = () => {
1607
+ if (reactData.panelIndex < (0, _utils.getLastZIndex)()) {
1608
+ reactData.panelIndex = (0, _utils.nextZIndex)();
1609
+ }
1610
+ };
1611
+ const updatePlacement = () => {
1612
+ return (0, _vue.nextTick)().then(() => {
1613
+ const {
1614
+ transfer,
1615
+ placement
1616
+ } = props;
1617
+ const {
1618
+ panelIndex
1619
+ } = reactData;
1620
+ const targetElem = refInputTarget.value;
1621
+ const panelElem = refInputPanel.value;
1622
+ if (targetElem && panelElem) {
1623
+ const targetHeight = targetElem.offsetHeight;
1624
+ const targetWidth = targetElem.offsetWidth;
1625
+ const panelHeight = panelElem.offsetHeight;
1626
+ const panelWidth = panelElem.offsetWidth;
1627
+ const marginSize = 5;
1628
+ const panelStyle = {
1629
+ zIndex: panelIndex
1630
+ };
1631
+ const {
1632
+ boundingTop,
1633
+ boundingLeft,
1634
+ visibleHeight,
1635
+ visibleWidth
1636
+ } = (0, _dom.getAbsolutePos)(targetElem);
1637
+ let panelPlacement = 'bottom';
1638
+ console.log((0, _dom.getAbsolutePos)(targetElem));
1639
+ if (transfer) {
1640
+ let left = boundingLeft;
1641
+ let top = boundingTop + targetHeight;
1642
+ if (placement === 'top') {
1643
+ panelPlacement = 'top';
1644
+ top = boundingTop - panelHeight;
1645
+ } else if (!placement) {
1646
+ // 如果下面不够放,则向上
1647
+ if (top + panelHeight + marginSize > visibleHeight) {
1648
+ panelPlacement = 'top';
1649
+ top = boundingTop - panelHeight;
1650
+ }
1651
+ // 如果上面不够放,则向下(优先)
1652
+ if (top < marginSize) {
1653
+ panelPlacement = 'bottom';
1654
+ top = boundingTop + targetHeight;
1655
+ }
1656
+ }
1657
+ // 如果溢出右边
1658
+ if (left + panelWidth + marginSize > visibleWidth) {
1659
+ left -= left + panelWidth + marginSize - visibleWidth;
1660
+ }
1661
+ // 如果溢出左边
1662
+ if (left < marginSize) {
1663
+ left = marginSize;
1664
+ }
1665
+ Object.assign(panelStyle, {
1666
+ left: `${left}px`,
1667
+ top: `${top}px`,
1668
+ minWidth: `${targetWidth}px`
1669
+ });
1670
+ } else {
1671
+ if (placement === 'top') {
1672
+ panelPlacement = 'top';
1673
+ panelStyle.bottom = `${targetHeight}px`;
1674
+ } else if (!placement) {
1675
+ // 如果下面不够放,则向上
1676
+ if (boundingTop + targetHeight + panelHeight > visibleHeight) {
1677
+ // 如果上面不够放,则向下(优先)
1678
+ if (boundingTop - targetHeight - panelHeight > marginSize) {
1679
+ panelPlacement = 'top';
1680
+ panelStyle.bottom = `${targetHeight}px`;
1681
+ }
1682
+ }
1683
+ }
1684
+ }
1685
+ reactData.panelStyle = panelStyle;
1686
+ reactData.panelPlacement = panelPlacement;
1687
+ return (0, _vue.nextTick)();
1688
+ }
1689
+ });
1690
+ };
1691
+ const showPanel = () => {
1692
+ const {
1693
+ disabled
1694
+ } = props;
1695
+ const {
1696
+ visiblePanel
1697
+ } = reactData;
1698
+ const isDatePickerType = computeIsDatePickerType.value;
1699
+ if (!disabled && !visiblePanel) {
1700
+ if (!reactData.inited) {
1701
+ reactData.inited = true;
1702
+ }
1703
+ clearTimeout(hidePanelTimeout);
1704
+ reactData.isActivated = true;
1705
+ reactData.animatVisible = true;
1706
+ if (isDatePickerType) {
1707
+ dateOpenPanel();
1708
+ }
1709
+ setTimeout(() => {
1710
+ reactData.visiblePanel = true;
1711
+ }, 10);
1712
+ updateZindex();
1713
+ return updatePlacement();
1714
+ }
1715
+ return (0, _vue.nextTick)();
1716
+ };
1717
+ const datePickerOpenEvent = evnt => {
1718
+ const {
1719
+ readonly
1720
+ } = props;
1721
+ if (!readonly) {
1722
+ evnt.preventDefault();
1723
+ showPanel();
1724
+ }
1725
+ };
1726
+ const clickEvent = evnt => {
1727
+ triggerEvent(evnt);
1728
+ };
1729
+ // 弹出面板
1730
+ // 全局事件
1731
+ const handleGlobalMousedownEvent = evnt => {
1732
+ const {
1733
+ disabled
1734
+ } = props;
1735
+ const {
1736
+ visiblePanel,
1737
+ isActivated
1738
+ } = reactData;
1739
+ const isDatePickerType = computeIsDatePickerType.value;
1740
+ const el = refElem.value;
1741
+ const panelElem = refInputPanel.value;
1742
+ if (!disabled && isActivated) {
1743
+ reactData.isActivated = (0, _dom.getEventTargetNode)(evnt, el).flag || (0, _dom.getEventTargetNode)(evnt, panelElem).flag;
1744
+ if (!reactData.isActivated) {
1745
+ // 如果是日期类型
1746
+ if (isDatePickerType) {
1747
+ if (visiblePanel) {
1748
+ hidePanel();
1749
+ afterCheckValue();
1750
+ }
1751
+ } else {
1752
+ afterCheckValue();
1753
+ }
1754
+ }
1755
+ }
1756
+ };
1757
+ const handleGlobalKeydownEvent = evnt => {
1758
+ const {
1759
+ clearable,
1760
+ disabled
1761
+ } = props;
1762
+ const {
1763
+ visiblePanel
1764
+ } = reactData;
1765
+ const isDatePickerType = computeIsDatePickerType.value;
1766
+ if (!disabled) {
1767
+ const isTab = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.TAB);
1768
+ const isDel = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.DELETE);
1769
+ const isEsc = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ESCAPE);
1770
+ const isEnter = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ENTER);
1771
+ const isLeftArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_LEFT);
1772
+ const isUpArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_UP);
1773
+ const isRightArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_RIGHT);
1774
+ const isDwArrow = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.ARROW_DOWN);
1775
+ const isPgUp = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.PAGE_UP);
1776
+ const isPgDn = (0, _event.hasEventKey)(evnt, _event.EVENT_KEYS.PAGE_DOWN);
1777
+ const operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
1778
+ let isActivated = reactData.isActivated;
1779
+ if (isTab) {
1780
+ if (isActivated) {
1781
+ afterCheckValue();
1782
+ }
1783
+ isActivated = false;
1784
+ reactData.isActivated = isActivated;
1785
+ } else if (operArrow) {
1786
+ if (isDatePickerType) {
1787
+ if (isActivated) {
1788
+ if (visiblePanel) {
1789
+ dateOffsetEvent(evnt);
1790
+ } else if (isUpArrow || isDwArrow) {
1791
+ datePickerOpenEvent(evnt);
1792
+ }
1793
+ }
1794
+ }
1795
+ } else if (isEnter) {
1796
+ if (isDatePickerType) {
1797
+ if (visiblePanel) {
1798
+ if (reactData.datePanelValue) {
1799
+ dateSelectItem(reactData.datePanelValue);
1800
+ } else {
1801
+ hidePanel();
1802
+ }
1803
+ } else if (isActivated) {
1804
+ datePickerOpenEvent(evnt);
1805
+ }
1806
+ }
1807
+ } else if (isPgUp || isPgDn) {
1808
+ if (isDatePickerType) {
1809
+ if (isActivated) {
1810
+ datePgOffsetEvent(evnt);
1811
+ }
1812
+ }
1813
+ }
1814
+ if (isTab || isEsc) {
1815
+ if (visiblePanel) {
1816
+ hidePanel();
1817
+ }
1818
+ } else if (isDel && clearable) {
1819
+ if (isActivated) {
1820
+ clearValueEvent(evnt, null);
1821
+ }
1822
+ }
1823
+ }
1824
+ };
1825
+ const handleGlobalMousewheelEvent = evnt => {
1826
+ const {
1827
+ disabled
1828
+ } = props;
1829
+ const {
1830
+ visiblePanel
1831
+ } = reactData;
1832
+ if (!disabled) {
1833
+ if (visiblePanel) {
1834
+ const panelElem = refInputPanel.value;
1835
+ if ((0, _dom.getEventTargetNode)(evnt, panelElem).flag) {
1836
+ updatePlacement();
1837
+ } else {
1838
+ hidePanel();
1839
+ afterCheckValue();
1840
+ }
1841
+ }
1842
+ }
1843
+ };
1844
+ const handleGlobalBlurEvent = () => {
1845
+ const {
1846
+ isActivated,
1847
+ visiblePanel
1848
+ } = reactData;
1849
+ if (visiblePanel) {
1850
+ hidePanel();
1851
+ afterCheckValue();
1852
+ } else if (isActivated) {
1853
+ afterCheckValue();
1854
+ }
1855
+ };
1856
+ const renderDateLabel = (item, label) => {
1857
+ const {
1858
+ festivalMethod
1859
+ } = props;
1860
+ if (festivalMethod) {
1861
+ const {
1862
+ datePanelType
1863
+ } = reactData;
1864
+ const festivalRest = festivalMethod({
1865
+ type: datePanelType,
1866
+ viewType: datePanelType,
1867
+ date: item.date,
1868
+ $input: $xeinput
1869
+ });
1870
+ const festivalItem = festivalRest ? _xeUtils.default.isString(festivalRest) ? {
1871
+ label: festivalRest
1872
+ } : festivalRest : {};
1873
+ const extraItem = festivalItem.extra ? _xeUtils.default.isString(festivalItem.extra) ? {
1874
+ label: festivalItem.extra
1875
+ } : festivalItem.extra : null;
1876
+ const labels = [(0, _vue.h)('span', {
1877
+ class: ['vxe-input--date-label', {
1878
+ 'is-notice': festivalItem.notice
1879
+ }]
1880
+ }, extraItem && extraItem.label ? [(0, _vue.h)('span', label), (0, _vue.h)('span', {
1881
+ class: ['vxe-input--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
1882
+ style: extraItem.style
1883
+ }, _xeUtils.default.toValueString(extraItem.label))] : label)];
1884
+ const festivalLabel = festivalItem.label;
1885
+ if (festivalLabel) {
1886
+ // 默认最多支持3个节日重叠
1887
+ const festivalLabels = _xeUtils.default.toValueString(festivalLabel).split(',');
1888
+ labels.push((0, _vue.h)('span', {
1889
+ class: ['vxe-input--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
1890
+ style: festivalItem.style
1891
+ }, [festivalLabels.length > 1 ? (0, _vue.h)('span', {
1892
+ class: ['vxe-input--date-festival--overlap', `overlap--${festivalLabels.length}`]
1893
+ }, festivalLabels.map(label => (0, _vue.h)('span', label.substring(0, 3)))) : (0, _vue.h)('span', {
1894
+ class: 'vxe-input--date-festival--label'
1895
+ }, festivalLabels[0].substring(0, 3))]));
1896
+ }
1897
+ return labels;
1898
+ }
1899
+ return label;
1900
+ };
1901
+ const renderDateDayTable = () => {
1902
+ const {
1903
+ multiple
1904
+ } = props;
1905
+ const {
1906
+ datePanelType,
1907
+ datePanelValue
1908
+ } = reactData;
1909
+ const dateValue = computeDateValue.value;
1910
+ const dateHeaders = computeDateHeaders.value;
1911
+ const dayDatas = computeDayDatas.value;
1912
+ const dateListValue = computeDateListValue.value;
1913
+ const matchFormat = 'yyyyMMdd';
1914
+ return [(0, _vue.h)('table', {
1915
+ class: `vxe-input--date-${datePanelType}-view`,
1916
+ cellspacing: 0,
1917
+ cellpadding: 0,
1918
+ border: 0
1919
+ }, [(0, _vue.h)('thead', [(0, _vue.h)('tr', dateHeaders.map(item => {
1920
+ return (0, _vue.h)('th', item.label);
1921
+ }))]), (0, _vue.h)('tbody', dayDatas.map(rows => {
1922
+ return (0, _vue.h)('tr', rows.map(item => {
1923
+ return (0, _vue.h)('td', {
1924
+ class: {
1925
+ 'is--prev': item.isPrev,
1926
+ 'is--current': item.isCurrent,
1927
+ 'is--now': item.isNow,
1928
+ 'is--next': item.isNext,
1929
+ 'is--disabled': isDateDisabled(item),
1930
+ 'is--selected': multiple ? dateListValue.some(val => _xeUtils.default.isDateSame(val, item.date, matchFormat)) : _xeUtils.default.isDateSame(dateValue, item.date, matchFormat),
1931
+ 'is--hover': _xeUtils.default.isDateSame(datePanelValue, item.date, matchFormat)
1932
+ },
1933
+ onClick: () => dateSelectEvent(item),
1934
+ onMouseenter: () => dateMouseenterEvent(item)
1935
+ }, renderDateLabel(item, item.label));
1936
+ }));
1937
+ }))])];
1938
+ };
1939
+ const renderDateWeekTable = () => {
1940
+ const {
1941
+ multiple
1942
+ } = props;
1943
+ const {
1944
+ datePanelType,
1945
+ datePanelValue
1946
+ } = reactData;
1947
+ const dateValue = computeDateValue.value;
1948
+ const weekHeaders = computeWeekHeaders.value;
1949
+ const weekDates = computeWeekDates.value;
1950
+ const dateListValue = computeDateListValue.value;
1951
+ const matchFormat = 'yyyyMMdd';
1952
+ return [(0, _vue.h)('table', {
1953
+ class: `vxe-input--date-${datePanelType}-view`,
1954
+ cellspacing: 0,
1955
+ cellpadding: 0,
1956
+ border: 0
1957
+ }, [(0, _vue.h)('thead', [(0, _vue.h)('tr', weekHeaders.map(item => {
1958
+ return (0, _vue.h)('th', item.label);
1959
+ }))]), (0, _vue.h)('tbody', weekDates.map(rows => {
1960
+ const isSelected = multiple ? rows.some(item => dateListValue.some(val => _xeUtils.default.isDateSame(val, item.date, matchFormat))) : rows.some(item => _xeUtils.default.isDateSame(dateValue, item.date, matchFormat));
1961
+ const isHover = rows.some(item => _xeUtils.default.isDateSame(datePanelValue, item.date, matchFormat));
1962
+ return (0, _vue.h)('tr', rows.map(item => {
1963
+ return (0, _vue.h)('td', {
1964
+ class: {
1965
+ 'is--prev': item.isPrev,
1966
+ 'is--current': item.isCurrent,
1967
+ 'is--now': item.isNow,
1968
+ 'is--next': item.isNext,
1969
+ 'is--disabled': isDateDisabled(item),
1970
+ 'is--selected': isSelected,
1971
+ 'is--hover': isHover
1972
+ },
1973
+ // event
1974
+ onClick: () => dateSelectEvent(item),
1975
+ onMouseenter: () => dateMouseenterEvent(item)
1976
+ }, renderDateLabel(item, item.label));
1977
+ }));
1978
+ }))])];
1979
+ };
1980
+ const renderDateMonthTable = () => {
1981
+ const {
1982
+ multiple
1983
+ } = props;
1984
+ const {
1985
+ datePanelType,
1986
+ datePanelValue
1987
+ } = reactData;
1988
+ const dateValue = computeDateValue.value;
1989
+ const monthDatas = computeMonthDatas.value;
1990
+ const dateListValue = computeDateListValue.value;
1991
+ const matchFormat = 'yyyyMM';
1992
+ return [(0, _vue.h)('table', {
1993
+ class: `vxe-input--date-${datePanelType}-view`,
1994
+ cellspacing: 0,
1995
+ cellpadding: 0,
1996
+ border: 0
1997
+ }, [(0, _vue.h)('tbody', monthDatas.map(rows => {
1998
+ return (0, _vue.h)('tr', rows.map(item => {
1999
+ return (0, _vue.h)('td', {
2000
+ class: {
2001
+ 'is--prev': item.isPrev,
2002
+ 'is--current': item.isCurrent,
2003
+ 'is--now': item.isNow,
2004
+ 'is--next': item.isNext,
2005
+ 'is--disabled': isDateDisabled(item),
2006
+ 'is--selected': multiple ? dateListValue.some(val => _xeUtils.default.isDateSame(val, item.date, matchFormat)) : _xeUtils.default.isDateSame(dateValue, item.date, matchFormat),
2007
+ 'is--hover': _xeUtils.default.isDateSame(datePanelValue, item.date, matchFormat)
2008
+ },
2009
+ onClick: () => dateSelectEvent(item),
2010
+ onMouseenter: () => dateMouseenterEvent(item)
2011
+ }, renderDateLabel(item, (0, _i18n.getI18n)(`vxe.input.date.months.m${item.month}`)));
2012
+ }));
2013
+ }))])];
2014
+ };
2015
+ const renderDateQuarterTable = () => {
2016
+ const {
2017
+ multiple
2018
+ } = props;
2019
+ const {
2020
+ datePanelType,
2021
+ datePanelValue
2022
+ } = reactData;
2023
+ const dateValue = computeDateValue.value;
2024
+ const quarterDatas = computeQuarterDatas.value;
2025
+ const dateListValue = computeDateListValue.value;
2026
+ const matchFormat = 'yyyyq';
2027
+ return [(0, _vue.h)('table', {
2028
+ class: `vxe-input--date-${datePanelType}-view`,
2029
+ cellspacing: 0,
2030
+ cellpadding: 0,
2031
+ border: 0
2032
+ }, [(0, _vue.h)('tbody', quarterDatas.map(rows => {
2033
+ return (0, _vue.h)('tr', rows.map(item => {
2034
+ return (0, _vue.h)('td', {
2035
+ class: {
2036
+ 'is--prev': item.isPrev,
2037
+ 'is--current': item.isCurrent,
2038
+ 'is--now': item.isNow,
2039
+ 'is--next': item.isNext,
2040
+ 'is--disabled': isDateDisabled(item),
2041
+ 'is--selected': multiple ? dateListValue.some(val => _xeUtils.default.isDateSame(val, item.date, matchFormat)) : _xeUtils.default.isDateSame(dateValue, item.date, matchFormat),
2042
+ 'is--hover': _xeUtils.default.isDateSame(datePanelValue, item.date, matchFormat)
2043
+ },
2044
+ onClick: () => dateSelectEvent(item),
2045
+ onMouseenter: () => dateMouseenterEvent(item)
2046
+ }, renderDateLabel(item, (0, _i18n.getI18n)(`vxe.input.date.quarters.q${item.quarter}`)));
2047
+ }));
2048
+ }))])];
2049
+ };
2050
+ const renderDateYearTable = () => {
2051
+ const {
2052
+ multiple
2053
+ } = props;
2054
+ const {
2055
+ datePanelType,
2056
+ datePanelValue
2057
+ } = reactData;
2058
+ const dateValue = computeDateValue.value;
2059
+ const yearDatas = computeYearDatas.value;
2060
+ const dateListValue = computeDateListValue.value;
2061
+ const matchFormat = 'yyyy';
2062
+ return [(0, _vue.h)('table', {
2063
+ class: `vxe-input--date-${datePanelType}-view`,
2064
+ cellspacing: 0,
2065
+ cellpadding: 0,
2066
+ border: 0
2067
+ }, [(0, _vue.h)('tbody', yearDatas.map(rows => {
2068
+ return (0, _vue.h)('tr', rows.map(item => {
2069
+ return (0, _vue.h)('td', {
2070
+ class: {
2071
+ 'is--prev': item.isPrev,
2072
+ 'is--current': item.isCurrent,
2073
+ 'is--now': item.isNow,
2074
+ 'is--next': item.isNext,
2075
+ 'is--disabled': isDateDisabled(item),
2076
+ 'is--selected': multiple ? dateListValue.some(val => _xeUtils.default.isDateSame(val, item.date, matchFormat)) : _xeUtils.default.isDateSame(dateValue, item.date, matchFormat),
2077
+ 'is--hover': _xeUtils.default.isDateSame(datePanelValue, item.date, matchFormat)
2078
+ },
2079
+ onClick: () => dateSelectEvent(item),
2080
+ onMouseenter: () => dateMouseenterEvent(item)
2081
+ }, renderDateLabel(item, item.year));
2082
+ }));
2083
+ }))])];
2084
+ };
2085
+ const renderDateTable = () => {
2086
+ const {
2087
+ datePanelType
2088
+ } = reactData;
2089
+ switch (datePanelType) {
2090
+ case 'week':
2091
+ return renderDateWeekTable();
2092
+ case 'month':
2093
+ return renderDateMonthTable();
2094
+ case 'quarter':
2095
+ return renderDateQuarterTable();
2096
+ case 'year':
2097
+ return renderDateYearTable();
2098
+ }
2099
+ return renderDateDayTable();
2100
+ };
2101
+ const renderDatePanel = () => {
2102
+ const {
2103
+ multiple
2104
+ } = props;
2105
+ const {
2106
+ datePanelType
2107
+ } = reactData;
2108
+ const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
2109
+ const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
2110
+ const selectDatePanelLabel = computeSelectDatePanelLabel.value;
2111
+ return [(0, _vue.h)('div', {
2112
+ class: 'vxe-input--date-picker-header'
2113
+ }, [(0, _vue.h)('div', {
2114
+ class: 'vxe-input--date-picker-type-wrapper'
2115
+ }, [datePanelType === 'year' ? (0, _vue.h)('span', {
2116
+ class: 'vxe-input--date-picker-label'
2117
+ }, selectDatePanelLabel) : (0, _vue.h)('span', {
2118
+ class: 'vxe-input--date-picker-btn',
2119
+ onClick: dateToggleTypeEvent
2120
+ }, selectDatePanelLabel)]), (0, _vue.h)('div', {
2121
+ class: 'vxe-input--date-picker-btn-wrapper'
2122
+ }, [(0, _vue.h)('span', {
2123
+ class: ['vxe-input--date-picker-btn vxe-input--date-picker-prev-btn', {
2124
+ 'is--disabled': isDisabledPrevDateBtn
2125
+ }],
2126
+ onClick: datePrevEvent
2127
+ }, [(0, _vue.h)('i', {
2128
+ class: 'vxe-icon-caret-left'
2129
+ })]), (0, _vue.h)('span', {
2130
+ class: 'vxe-input--date-picker-btn vxe-input--date-picker-current-btn',
2131
+ onClick: dateTodayMonthEvent
2132
+ }, [(0, _vue.h)('i', {
2133
+ class: 'vxe-icon-dot'
2134
+ })]), (0, _vue.h)('span', {
2135
+ class: ['vxe-input--date-picker-btn vxe-input--date-picker-next-btn', {
2136
+ 'is--disabled': isDisabledNextDateBtn
2137
+ }],
2138
+ onClick: dateNextEvent
2139
+ }, [(0, _vue.h)('i', {
2140
+ class: 'vxe-icon-caret-right'
2141
+ })]), multiple && computeSupportMultiples.value ? (0, _vue.h)('span', {
2142
+ class: 'vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn'
2143
+ }, [(0, _vue.h)('button', {
2144
+ class: 'vxe-input--date-picker-confirm',
2145
+ type: 'button',
2146
+ onClick: dateConfirmEvent
2147
+ }, (0, _i18n.getI18n)('vxe.button.confirm'))]) : null])]), (0, _vue.h)('div', {
2148
+ class: 'vxe-input--date-picker-body'
2149
+ }, renderDateTable())];
2150
+ };
2151
+ const renderTimePanel = () => {
2152
+ const {
2153
+ datetimePanelValue
2154
+ } = reactData;
2155
+ const dateTimeLabel = computeDateTimeLabel.value;
2156
+ const hourList = computeHourList.value;
2157
+ const minuteList = computeMinuteList.value;
2158
+ const secondList = computeSecondList.value;
2159
+ return [(0, _vue.h)('div', {
2160
+ class: 'vxe-input--time-picker-header'
2161
+ }, [(0, _vue.h)('span', {
2162
+ class: 'vxe-input--time-picker-title'
2163
+ }, dateTimeLabel), (0, _vue.h)('button', {
2164
+ class: 'vxe-input--time-picker-confirm',
2165
+ type: 'button',
2166
+ onClick: dateConfirmEvent
2167
+ }, (0, _i18n.getI18n)('vxe.button.confirm'))]), (0, _vue.h)('div', {
2168
+ ref: refInputTimeBody,
2169
+ class: 'vxe-input--time-picker-body'
2170
+ }, [(0, _vue.h)('ul', {
2171
+ class: 'vxe-input--time-picker-hour-list'
2172
+ }, hourList.map((item, index) => {
2173
+ return (0, _vue.h)('li', {
2174
+ key: index,
2175
+ class: {
2176
+ 'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
2177
+ },
2178
+ onClick: evnt => dateHourEvent(evnt, item)
2179
+ }, item.label);
2180
+ })), (0, _vue.h)('ul', {
2181
+ class: 'vxe-input--time-picker-minute-list'
2182
+ }, minuteList.map((item, index) => {
2183
+ return (0, _vue.h)('li', {
2184
+ key: index,
2185
+ class: {
2186
+ 'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
2187
+ },
2188
+ onClick: evnt => dateMinuteEvent(evnt, item)
2189
+ }, item.label);
2190
+ })), (0, _vue.h)('ul', {
2191
+ class: 'vxe-input--time-picker-second-list'
2192
+ }, secondList.map((item, index) => {
2193
+ return (0, _vue.h)('li', {
2194
+ key: index,
2195
+ class: {
2196
+ 'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
2197
+ },
2198
+ onClick: evnt => dateSecondEvent(evnt, item)
2199
+ }, item.label);
2200
+ }))])];
2201
+ };
2202
+ const renderPanel = () => {
2203
+ const {
2204
+ type,
2205
+ transfer
2206
+ } = props;
2207
+ const {
2208
+ inited,
2209
+ animatVisible,
2210
+ visiblePanel,
2211
+ panelPlacement,
2212
+ panelStyle
2213
+ } = reactData;
2214
+ const vSize = computeSize.value;
2215
+ const isDatePickerType = computeIsDatePickerType.value;
2216
+ const renders = [];
2217
+ if (isDatePickerType) {
2218
+ if (type === 'datetime') {
2219
+ renders.push((0, _vue.h)('div', {
2220
+ class: 'vxe-input--panel-layout-wrapper'
2221
+ }, [(0, _vue.h)('div', {
2222
+ class: 'vxe-input--panel-left-wrapper'
2223
+ }, renderDatePanel()), (0, _vue.h)('div', {
2224
+ class: 'vxe-input--panel-right-wrapper'
2225
+ }, renderTimePanel())]));
2226
+ } else if (type === 'time') {
2227
+ renders.push((0, _vue.h)('div', {
2228
+ class: 'vxe-input--panel-wrapper'
2229
+ }, renderTimePanel()));
2230
+ } else {
2231
+ renders.push((0, _vue.h)('div', {
2232
+ class: 'vxe-input--panel-wrapper'
2233
+ }, renderDatePanel()));
2234
+ }
2235
+ return (0, _vue.h)(_vue.Teleport, {
2236
+ to: 'body',
2237
+ disabled: transfer ? !inited : true
2238
+ }, [(0, _vue.h)('div', {
2239
+ ref: refInputPanel,
2240
+ class: ['vxe-table--ignore-clear vxe-input--panel', `type--${type}`, {
2241
+ [`size--${vSize}`]: vSize,
2242
+ 'is--transfer': transfer,
2243
+ 'animat--leave': animatVisible,
2244
+ 'animat--enter': visiblePanel
2245
+ }],
2246
+ placement: panelPlacement,
2247
+ style: panelStyle
2248
+ }, renders)]);
2249
+ }
2250
+ return null;
2251
+ };
2252
+ const renderNumberIcon = () => {
2253
+ const isDisabledAddNumber = computeIsDisabledAddNumber.value;
2254
+ const isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
2255
+ return (0, _vue.h)('span', {
2256
+ class: 'vxe-input--number-suffix'
2257
+ }, [(0, _vue.h)('span', {
2258
+ class: ['vxe-input--number-prev is--prev', {
2259
+ 'is--disabled': isDisabledAddNumber
2260
+ }],
2261
+ onMousedown: numberMousedownEvent,
2262
+ onMouseup: numberStopDown,
2263
+ onMouseleave: numberStopDown
2264
+ }, [(0, _vue.h)('i', {
2265
+ class: ['vxe-input--number-prev-icon', _iconStore.default.INPUT_PREV_NUM]
2266
+ })]), (0, _vue.h)('span', {
2267
+ class: ['vxe-input--number-next is--next', {
2268
+ 'is--disabled': isDisabledSubtractNumber
2269
+ }],
2270
+ onMousedown: numberMousedownEvent,
2271
+ onMouseup: numberStopDown,
2272
+ onMouseleave: numberStopDown
2273
+ }, [(0, _vue.h)('i', {
2274
+ class: ['vxe-input--number-next-icon', _iconStore.default.INPUT_NEXT_NUM]
2275
+ })])]);
2276
+ };
2277
+ const renderDatePickerIcon = () => {
2278
+ return (0, _vue.h)('span', {
2279
+ class: 'vxe-input--date-picker-suffix',
2280
+ onClick: datePickerOpenEvent
2281
+ }, [(0, _vue.h)('i', {
2282
+ class: ['vxe-input--date-picker-icon', _iconStore.default.INPUT_DATE]
2283
+ })]);
2284
+ };
2285
+ const renderSearchIcon = () => {
2286
+ return (0, _vue.h)('span', {
2287
+ class: 'vxe-input--search-suffix',
2288
+ onClick: searchEvent
2289
+ }, [(0, _vue.h)('i', {
2290
+ class: ['vxe-input--search-icon', _iconStore.default.INPUT_SEARCH]
2291
+ })]);
2292
+ };
2293
+ const renderPasswordIcon = () => {
2294
+ const {
2295
+ showPwd
2296
+ } = reactData;
2297
+ return (0, _vue.h)('span', {
2298
+ class: 'vxe-input--password-suffix',
2299
+ onClick: passwordToggleEvent
2300
+ }, [(0, _vue.h)('i', {
2301
+ class: ['vxe-input--password-icon', showPwd ? _iconStore.default.INPUT_SHOW_PWD : _iconStore.default.INPUT_PWD]
2302
+ })]);
2303
+ };
2304
+ const rendePrefixIcon = () => {
2305
+ const {
2306
+ prefixIcon
2307
+ } = props;
2308
+ const prefixSlot = slots.prefix;
2309
+ const icons = [];
2310
+ if (prefixSlot) {
2311
+ icons.push((0, _vue.h)('span', {
2312
+ class: 'vxe-input--prefix-icon'
2313
+ }, prefixSlot({})));
2314
+ } else if (prefixIcon) {
2315
+ icons.push((0, _vue.h)('i', {
2316
+ class: ['vxe-input--prefix-icon', prefixIcon]
2317
+ }));
2318
+ }
2319
+ return icons.length ? (0, _vue.h)('span', {
2320
+ class: 'vxe-input--prefix',
2321
+ onClick: clickPrefixEvent
2322
+ }, icons) : null;
2323
+ };
2324
+ const renderSuffixIcon = () => {
2325
+ const {
2326
+ disabled,
2327
+ suffixIcon
2328
+ } = props;
2329
+ const {
2330
+ inputValue
2331
+ } = reactData;
2332
+ const suffixSlot = slots.suffix;
2333
+ const isClearable = computeIsClearable.value;
2334
+ const icons = [];
2335
+ if (suffixSlot) {
2336
+ icons.push((0, _vue.h)('span', {
2337
+ class: 'vxe-input--suffix-icon'
2338
+ }, suffixSlot({})));
2339
+ } else if (suffixIcon) {
2340
+ icons.push((0, _vue.h)('i', {
2341
+ class: ['vxe-input--suffix-icon', suffixIcon]
2342
+ }));
2343
+ }
2344
+ if (isClearable) {
2345
+ icons.push((0, _vue.h)('i', {
2346
+ class: ['vxe-input--clear-icon', _iconStore.default.INPUT_CLEAR]
2347
+ }));
2348
+ }
2349
+ return icons.length ? (0, _vue.h)('span', {
2350
+ class: ['vxe-input--suffix', {
2351
+ 'is--clear': isClearable && !disabled && !(inputValue === '' || _xeUtils.default.eqNull(inputValue))
2352
+ }],
2353
+ onClick: clickSuffixEvent
2354
+ }, icons) : null;
2355
+ };
2356
+ const renderExtraSuffixIcon = () => {
2357
+ const {
2358
+ controls
2359
+ } = props;
2360
+ const isNumType = computeIsNumType.value;
2361
+ const isDatePickerType = computeIsDatePickerType.value;
2362
+ const isPawdType = computeIsPawdType.value;
2363
+ const isSearchType = computeIsSearchType.value;
2364
+ let icons;
2365
+ if (isPawdType) {
2366
+ icons = renderPasswordIcon();
2367
+ } else if (isNumType) {
2368
+ if (controls) {
2369
+ icons = renderNumberIcon();
2370
+ }
2371
+ } else if (isDatePickerType) {
2372
+ icons = renderDatePickerIcon();
2373
+ } else if (isSearchType) {
2374
+ icons = renderSearchIcon();
2375
+ }
2376
+ return icons ? (0, _vue.h)('span', {
2377
+ class: 'vxe-input--extra-suffix'
2378
+ }, [icons]) : null;
2379
+ };
2380
+ inputMethods = {
2381
+ dispatchEvent(type, params, evnt) {
2382
+ emit(type, Object.assign({
2383
+ $input: $xeinput,
2384
+ $event: evnt
2385
+ }, params));
2386
+ },
2387
+ focus() {
2388
+ const inputElem = refInputTarget.value;
2389
+ reactData.isActivated = true;
2390
+ inputElem.focus();
2391
+ return (0, _vue.nextTick)();
2392
+ },
2393
+ blur() {
2394
+ const inputElem = refInputTarget.value;
2395
+ inputElem.blur();
2396
+ reactData.isActivated = false;
2397
+ return (0, _vue.nextTick)();
2398
+ },
2399
+ select() {
2400
+ const inputElem = refInputTarget.value;
2401
+ inputElem.select();
2402
+ reactData.isActivated = false;
2403
+ return (0, _vue.nextTick)();
2404
+ },
2405
+ showPanel,
2406
+ hidePanel,
2407
+ updatePlacement
2408
+ };
2409
+ Object.assign($xeinput, inputMethods);
2410
+ (0, _vue.watch)(() => props.modelValue, val => {
2411
+ reactData.inputValue = val;
2412
+ changeValue();
2413
+ });
2414
+ (0, _vue.watch)(() => props.type, () => {
2415
+ // 切换类型是重置内置变量
2416
+ Object.assign(reactData, {
2417
+ inputValue: props.modelValue,
2418
+ datetimePanelValue: null,
2419
+ datePanelValue: null,
2420
+ datePanelLabel: '',
2421
+ datePanelType: 'day',
2422
+ selectMonth: null,
2423
+ currentDate: null
2424
+ });
2425
+ initValue();
2426
+ });
2427
+ (0, _vue.watch)(computeDateLabelFormat, () => {
2428
+ const isDatePickerType = computeIsDatePickerType.value;
2429
+ if (isDatePickerType) {
2430
+ dateParseValue(reactData.datePanelValue);
2431
+ reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
2432
+ }
2433
+ });
2434
+ (0, _vue.nextTick)(() => {
2435
+ _event.GlobalEvent.on($xeinput, 'mousewheel', handleGlobalMousewheelEvent);
2436
+ _event.GlobalEvent.on($xeinput, 'mousedown', handleGlobalMousedownEvent);
2437
+ _event.GlobalEvent.on($xeinput, 'keydown', handleGlobalKeydownEvent);
2438
+ _event.GlobalEvent.on($xeinput, 'blur', handleGlobalBlurEvent);
2439
+ });
2440
+ (0, _vue.onUnmounted)(() => {
2441
+ numberStopDown();
2442
+ _event.GlobalEvent.off($xeinput, 'mousewheel');
2443
+ _event.GlobalEvent.off($xeinput, 'mousedown');
2444
+ _event.GlobalEvent.off($xeinput, 'keydown');
2445
+ _event.GlobalEvent.off($xeinput, 'blur');
2446
+ });
2447
+ initValue();
2448
+ const renderVN = () => {
2449
+ const {
2450
+ className,
2451
+ controls,
2452
+ type,
2453
+ align,
2454
+ showWordCount,
2455
+ countMethod,
2456
+ name,
2457
+ disabled,
2458
+ readonly,
2459
+ autocomplete
2460
+ } = props;
2461
+ const {
2462
+ inputValue,
2463
+ visiblePanel,
2464
+ isActivated
2465
+ } = reactData;
2466
+ const vSize = computeSize.value;
2467
+ const isCountError = computeIsCountError.value;
2468
+ const inputCount = computeInputCount.value;
2469
+ const isDatePickerType = computeIsDatePickerType.value;
2470
+ const inpReadonly = computeInpReadonly.value;
2471
+ const inpMaxlength = computeInpMaxlength.value;
2472
+ const inputType = computeInputType.value;
2473
+ const inpPlaceholder = computeInpPlaceholder.value;
2474
+ const childs = [];
2475
+ const prefix = rendePrefixIcon();
2476
+ const suffix = renderSuffixIcon();
2477
+ // 前缀图标
2478
+ if (prefix) {
2479
+ childs.push(prefix);
2480
+ }
2481
+ // 输入框
2482
+ childs.push((0, _vue.h)('input', {
2483
+ ref: refInputTarget,
2484
+ class: 'vxe-input--inner',
2485
+ value: inputValue,
2486
+ name,
2487
+ type: inputType,
2488
+ placeholder: inpPlaceholder,
2489
+ maxlength: inpMaxlength,
2490
+ readonly: inpReadonly,
2491
+ disabled,
2492
+ autocomplete,
2493
+ onKeydown: keydownEvent,
2494
+ onKeyup: keyupEvent,
2495
+ onWheel: wheelEvent,
2496
+ onClick: clickEvent,
2497
+ onInput: inputEvent,
2498
+ onChange: changeEvent,
2499
+ onFocus: focusEvent,
2500
+ onBlur: blurEvent
2501
+ }));
2502
+ // 后缀图标
2503
+ if (suffix) {
2504
+ childs.push(suffix);
2505
+ }
2506
+ // 特殊功能图标
2507
+ childs.push(renderExtraSuffixIcon());
2508
+ // 面板容器
2509
+ if (isDatePickerType) {
2510
+ childs.push(renderPanel());
2511
+ }
2512
+ let isWordCount = false;
2513
+ // 统计字数
2514
+ if (showWordCount && ['text', 'search'].includes(type)) {
2515
+ isWordCount = true;
2516
+ childs.push((0, _vue.h)('span', {
2517
+ class: ['vxe-input--count', {
2518
+ 'is--error': isCountError
2519
+ }]
2520
+ }, countMethod ? `${countMethod({
2521
+ value: inputValue
2522
+ })}` : `${inputCount}${inpMaxlength ? `/${inpMaxlength}` : ''}`));
2523
+ }
2524
+ return (0, _vue.h)('div', {
2525
+ ref: refElem,
2526
+ class: ['vxe-input', `type--${type}`, className, {
2527
+ [`size--${vSize}`]: vSize,
2528
+ [`is--${align}`]: align,
2529
+ 'is--controls': controls,
2530
+ 'is--prefix': !!prefix,
2531
+ 'is--suffix': !!suffix,
2532
+ 'is--readonly': readonly,
2533
+ 'is--visivle': visiblePanel,
2534
+ 'is--count': isWordCount,
2535
+ 'is--disabled': disabled,
2536
+ 'is--active': isActivated
2537
+ }]
2538
+ }, childs);
2539
+ };
2540
+ $xeinput.renderVN = renderVN;
2541
+ return $xeinput;
2542
+ },
2543
+ render() {
2544
+ return this.renderVN();
2545
+ }
2546
+ });