vxe-pc-ui 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/es/button/src/button.js +3 -0
  2. package/es/carousel/index.js +12 -0
  3. package/es/carousel/src/carousel-item.js +100 -0
  4. package/es/carousel/src/carousel.js +418 -0
  5. package/es/carousel/src/util.js +17 -0
  6. package/es/carousel/style.css +185 -0
  7. package/es/carousel/style.min.css +1 -0
  8. package/es/carousel-item/index.js +12 -0
  9. package/es/carousel-item/style.css +0 -0
  10. package/es/carousel-item/style.min.css +0 -0
  11. package/es/checkbox/index.js +12 -0
  12. package/es/checkbox/src/checkbox.js +159 -0
  13. package/es/checkbox/src/group.js +154 -0
  14. package/es/checkbox/style.css +117 -0
  15. package/es/checkbox/style.min.css +1 -0
  16. package/es/checkbox-group/index.js +12 -0
  17. package/es/checkbox-group/style.css +0 -0
  18. package/es/checkbox-group/style.min.css +0 -0
  19. package/es/components.js +39 -39
  20. package/es/date-picker/src/date-picker.js +3 -0
  21. package/es/icon/style.css +1 -1
  22. package/es/icon-picker/index.js +12 -0
  23. package/es/icon-picker/src/icon-picker.js +668 -0
  24. package/es/icon-picker/style.css +207 -0
  25. package/es/icon-picker/style.min.css +1 -0
  26. package/es/input/index.js +12 -0
  27. package/es/input/src/input.js +2892 -0
  28. package/es/input/style.css +941 -0
  29. package/es/input/style.min.css +1 -0
  30. package/es/layout-footer/src/layout-footer.js +2 -1
  31. package/es/layout-header/src/layout-header.js +2 -1
  32. package/es/optgroup/index.js +12 -0
  33. package/es/optgroup/style.css +0 -0
  34. package/es/optgroup/style.min.css +0 -0
  35. package/es/option/index.js +12 -0
  36. package/es/option/style.css +0 -0
  37. package/es/option/style.min.css +0 -0
  38. package/es/pager/index.js +12 -0
  39. package/es/pager/src/pager.js +687 -0
  40. package/es/password-input/index.js +12 -0
  41. package/es/password-input/src/password-input.js +388 -0
  42. package/es/password-input/style.css +604 -0
  43. package/es/password-input/style.min.css +1 -0
  44. package/es/pulldown/src/pulldown.js +5 -1
  45. package/es/select/index.js +12 -0
  46. package/es/select/src/optgroup.js +90 -0
  47. package/es/select/src/option-info.js +16 -0
  48. package/es/select/src/option.js +86 -0
  49. package/es/select/src/select.js +1269 -0
  50. package/es/select/src/util.js +35 -0
  51. package/es/select/style.css +207 -0
  52. package/es/select/style.min.css +1 -0
  53. package/es/style.css +1 -1
  54. package/es/style.min.css +1 -1
  55. package/es/tab-pane/index.js +12 -0
  56. package/es/tab-pane/style.css +0 -0
  57. package/es/tab-pane/style.min.css +0 -0
  58. package/es/tabs/index.js +12 -0
  59. package/es/tabs/src/tab-pane.js +119 -0
  60. package/es/tabs/src/tabs.js +593 -0
  61. package/es/tabs/src/util.js +17 -0
  62. package/es/tabs/style.css +342 -0
  63. package/es/tabs/style.min.css +1 -0
  64. package/es/ui/index.js +1 -1
  65. package/es/ui/src/log.js +1 -1
  66. package/es/vxe-carousel/index.js +3 -0
  67. package/es/vxe-carousel/style.css +185 -0
  68. package/es/vxe-carousel/style.min.css +1 -0
  69. package/es/vxe-carousel-item/index.js +3 -0
  70. package/es/vxe-carousel-item/style.css +0 -0
  71. package/es/vxe-carousel-item/style.min.css +0 -0
  72. package/es/vxe-checkbox/index.js +3 -0
  73. package/es/vxe-checkbox/style.css +117 -0
  74. package/es/vxe-checkbox/style.min.css +1 -0
  75. package/es/vxe-checkbox-group/index.js +3 -0
  76. package/es/vxe-checkbox-group/style.css +0 -0
  77. package/es/vxe-checkbox-group/style.min.css +0 -0
  78. package/es/vxe-icon-picker/index.js +3 -0
  79. package/es/vxe-icon-picker/style.css +207 -0
  80. package/es/vxe-icon-picker/style.min.css +1 -0
  81. package/es/vxe-input/index.js +3 -0
  82. package/es/vxe-input/style.css +941 -0
  83. package/es/vxe-input/style.min.css +1 -0
  84. package/es/vxe-optgroup/index.js +3 -0
  85. package/es/vxe-optgroup/style.css +0 -0
  86. package/es/vxe-optgroup/style.min.css +0 -0
  87. package/es/vxe-option/index.js +3 -0
  88. package/es/vxe-option/style.css +0 -0
  89. package/es/vxe-option/style.min.css +0 -0
  90. package/es/vxe-password-input/index.js +3 -0
  91. package/es/vxe-password-input/style.css +604 -0
  92. package/es/vxe-password-input/style.min.css +1 -0
  93. package/es/vxe-select/index.js +3 -0
  94. package/es/vxe-select/style.css +207 -0
  95. package/es/vxe-select/style.min.css +1 -0
  96. package/es/vxe-tab-pane/index.js +3 -0
  97. package/es/vxe-tab-pane/style.css +0 -0
  98. package/es/vxe-tab-pane/style.min.css +0 -0
  99. package/es/vxe-tabs/index.js +3 -0
  100. package/es/vxe-tabs/style.css +342 -0
  101. package/es/vxe-tabs/style.min.css +1 -0
  102. package/lib/button/src/button.js +3 -0
  103. package/lib/button/src/button.min.js +1 -1
  104. package/lib/carousel/index.js +19 -0
  105. package/lib/carousel/index.min.js +1 -0
  106. package/lib/carousel/src/carousel-item.js +107 -0
  107. package/lib/carousel/src/carousel-item.min.js +1 -0
  108. package/lib/carousel/src/carousel.js +437 -0
  109. package/lib/carousel/src/carousel.min.js +1 -0
  110. package/lib/carousel/src/util.js +27 -0
  111. package/lib/carousel/src/util.min.js +1 -0
  112. package/lib/carousel/style/index.js +1 -0
  113. package/lib/carousel/style/style.css +185 -0
  114. package/lib/carousel/style/style.min.css +1 -0
  115. package/lib/carousel-item/index.js +19 -0
  116. package/lib/carousel-item/index.min.js +1 -0
  117. package/lib/carousel-item/style/index.js +1 -0
  118. package/lib/carousel-item/style/style.css +0 -0
  119. package/lib/carousel-item/style/style.min.css +0 -0
  120. package/lib/checkbox/index.js +19 -0
  121. package/lib/checkbox/index.min.js +1 -0
  122. package/lib/checkbox/src/checkbox.js +169 -0
  123. package/lib/checkbox/src/checkbox.min.js +1 -0
  124. package/lib/checkbox/src/group.js +164 -0
  125. package/lib/checkbox/src/group.min.js +1 -0
  126. package/lib/checkbox/style/index.js +1 -0
  127. package/lib/checkbox/style/style.css +117 -0
  128. package/lib/checkbox/style/style.min.css +1 -0
  129. package/lib/checkbox-group/index.js +19 -0
  130. package/lib/checkbox-group/index.min.js +1 -0
  131. package/lib/checkbox-group/style/index.js +1 -0
  132. package/lib/checkbox-group/style/style.css +0 -0
  133. package/lib/checkbox-group/style/style.min.css +0 -0
  134. package/lib/components.js +159 -60
  135. package/lib/components.min.js +1 -1
  136. package/lib/date-picker/src/date-picker.js +3 -0
  137. package/lib/date-picker/src/date-picker.min.js +1 -1
  138. package/lib/icon/style/style.css +1 -1
  139. package/lib/icon/style/style.min.css +1 -1
  140. package/lib/icon-picker/index.js +19 -0
  141. package/lib/icon-picker/index.min.js +1 -0
  142. package/lib/icon-picker/src/icon-picker.js +646 -0
  143. package/lib/icon-picker/src/icon-picker.min.js +1 -0
  144. package/lib/icon-picker/style/index.js +1 -0
  145. package/lib/icon-picker/style/style.css +207 -0
  146. package/lib/icon-picker/style/style.min.css +1 -0
  147. package/lib/index.umd.js +15870 -7738
  148. package/lib/index.umd.min.js +1 -1
  149. package/lib/input/index.js +19 -0
  150. package/lib/input/index.min.js +1 -0
  151. package/lib/input/src/input.js +2897 -0
  152. package/lib/input/src/input.min.js +1 -0
  153. package/lib/input/style/index.js +1 -0
  154. package/lib/input/style/style.css +941 -0
  155. package/lib/input/style/style.min.css +1 -0
  156. package/lib/layout-footer/src/layout-footer.js +2 -1
  157. package/lib/layout-header/src/layout-header.js +2 -1
  158. package/lib/optgroup/index.js +19 -0
  159. package/lib/optgroup/index.min.js +1 -0
  160. package/lib/optgroup/style/index.js +1 -0
  161. package/lib/optgroup/style/style.css +0 -0
  162. package/lib/optgroup/style/style.min.css +0 -0
  163. package/lib/option/index.js +19 -0
  164. package/lib/option/index.min.js +1 -0
  165. package/lib/option/style/index.js +1 -0
  166. package/lib/option/style/style.css +0 -0
  167. package/lib/option/style/style.min.css +0 -0
  168. package/lib/pager/index.js +19 -0
  169. package/lib/pager/index.min.js +1 -0
  170. package/lib/pager/src/pager.js +714 -0
  171. package/lib/pager/src/pager.min.js +1 -0
  172. package/lib/password-input/index.js +19 -0
  173. package/lib/password-input/index.min.js +1 -0
  174. package/lib/password-input/src/password-input.js +398 -0
  175. package/lib/password-input/src/password-input.min.js +1 -0
  176. package/lib/password-input/style/index.js +1 -0
  177. package/lib/password-input/style/style.css +604 -0
  178. package/lib/password-input/style/style.min.css +1 -0
  179. package/lib/pulldown/src/pulldown.js +5 -1
  180. package/lib/pulldown/src/pulldown.min.js +1 -1
  181. package/lib/select/index.js +19 -0
  182. package/lib/select/index.min.js +1 -0
  183. package/lib/select/src/optgroup.js +97 -0
  184. package/lib/select/src/optgroup.min.js +1 -0
  185. package/lib/select/src/option-info.js +33 -0
  186. package/lib/select/src/option-info.min.js +1 -0
  187. package/lib/select/src/option.js +93 -0
  188. package/lib/select/src/option.min.js +1 -0
  189. package/lib/select/src/select.js +1315 -0
  190. package/lib/select/src/select.min.js +1 -0
  191. package/lib/select/src/util.js +50 -0
  192. package/lib/select/src/util.min.js +1 -0
  193. package/lib/select/style/index.js +1 -0
  194. package/lib/select/style/style.css +207 -0
  195. package/lib/select/style/style.min.css +1 -0
  196. package/lib/style.css +1 -1
  197. package/lib/style.min.css +1 -1
  198. package/lib/tab-pane/index.js +19 -0
  199. package/lib/tab-pane/index.min.js +1 -0
  200. package/lib/tab-pane/style/index.js +1 -0
  201. package/lib/tab-pane/style/style.css +0 -0
  202. package/lib/tab-pane/style/style.min.css +0 -0
  203. package/lib/tabs/index.js +19 -0
  204. package/lib/tabs/index.min.js +1 -0
  205. package/lib/tabs/src/tab-pane.js +128 -0
  206. package/lib/tabs/src/tab-pane.min.js +1 -0
  207. package/lib/tabs/src/tabs.js +630 -0
  208. package/lib/tabs/src/tabs.min.js +1 -0
  209. package/lib/tabs/src/util.js +29 -0
  210. package/lib/tabs/src/util.min.js +1 -0
  211. package/lib/tabs/style/index.js +1 -0
  212. package/lib/tabs/style/style.css +342 -0
  213. package/lib/tabs/style/style.min.css +1 -0
  214. package/lib/ui/index.js +1 -1
  215. package/lib/ui/index.min.js +1 -1
  216. package/lib/ui/src/log.js +1 -1
  217. package/lib/ui/src/log.min.js +1 -1
  218. package/lib/vxe-carousel/index.js +23 -0
  219. package/lib/vxe-carousel/index.min.js +1 -0
  220. package/lib/vxe-carousel/style/index.js +1 -0
  221. package/lib/vxe-carousel/style/style.css +185 -0
  222. package/lib/vxe-carousel/style/style.min.css +1 -0
  223. package/lib/vxe-carousel-item/index.js +23 -0
  224. package/lib/vxe-carousel-item/index.min.js +1 -0
  225. package/lib/vxe-carousel-item/style/index.js +1 -0
  226. package/lib/vxe-carousel-item/style/style.css +0 -0
  227. package/lib/vxe-carousel-item/style/style.min.css +0 -0
  228. package/lib/vxe-checkbox/index.js +23 -0
  229. package/lib/vxe-checkbox/index.min.js +1 -0
  230. package/lib/vxe-checkbox/style/index.js +1 -0
  231. package/lib/vxe-checkbox/style/style.css +117 -0
  232. package/lib/vxe-checkbox/style/style.min.css +1 -0
  233. package/lib/vxe-checkbox-group/index.js +23 -0
  234. package/lib/vxe-checkbox-group/index.min.js +1 -0
  235. package/lib/vxe-checkbox-group/style/index.js +1 -0
  236. package/lib/vxe-checkbox-group/style/style.css +0 -0
  237. package/lib/vxe-checkbox-group/style/style.min.css +0 -0
  238. package/lib/vxe-icon-picker/index.js +23 -0
  239. package/lib/vxe-icon-picker/index.min.js +1 -0
  240. package/lib/vxe-icon-picker/style/index.js +1 -0
  241. package/lib/vxe-icon-picker/style/style.css +207 -0
  242. package/lib/vxe-icon-picker/style/style.min.css +1 -0
  243. package/lib/vxe-input/index.js +23 -0
  244. package/lib/vxe-input/index.min.js +1 -0
  245. package/lib/vxe-input/style/index.js +1 -0
  246. package/lib/vxe-input/style/style.css +941 -0
  247. package/lib/vxe-input/style/style.min.css +1 -0
  248. package/lib/vxe-optgroup/index.js +23 -0
  249. package/lib/vxe-optgroup/index.min.js +1 -0
  250. package/lib/vxe-optgroup/style/index.js +1 -0
  251. package/lib/vxe-optgroup/style/style.css +0 -0
  252. package/lib/vxe-optgroup/style/style.min.css +0 -0
  253. package/lib/vxe-option/index.js +23 -0
  254. package/lib/vxe-option/index.min.js +1 -0
  255. package/lib/vxe-option/style/index.js +1 -0
  256. package/lib/vxe-option/style/style.css +0 -0
  257. package/lib/vxe-option/style/style.min.css +0 -0
  258. package/lib/vxe-password-input/index.js +23 -0
  259. package/lib/vxe-password-input/index.min.js +1 -0
  260. package/lib/vxe-password-input/style/index.js +1 -0
  261. package/lib/vxe-password-input/style/style.css +604 -0
  262. package/lib/vxe-password-input/style/style.min.css +1 -0
  263. package/lib/vxe-select/index.js +23 -0
  264. package/lib/vxe-select/index.min.js +1 -0
  265. package/lib/vxe-select/style/index.js +1 -0
  266. package/lib/vxe-select/style/style.css +207 -0
  267. package/lib/vxe-select/style/style.min.css +1 -0
  268. package/lib/vxe-tab-pane/index.js +23 -0
  269. package/lib/vxe-tab-pane/index.min.js +1 -0
  270. package/lib/vxe-tab-pane/style/index.js +1 -0
  271. package/lib/vxe-tab-pane/style/style.css +0 -0
  272. package/lib/vxe-tab-pane/style/style.min.css +0 -0
  273. package/lib/vxe-tabs/index.js +23 -0
  274. package/lib/vxe-tabs/index.min.js +1 -0
  275. package/lib/vxe-tabs/style/index.js +1 -0
  276. package/lib/vxe-tabs/style/style.css +342 -0
  277. package/lib/vxe-tabs/style/style.min.css +1 -0
  278. package/package.json +1 -1
  279. package/packages/button/src/button.ts +3 -0
  280. package/packages/carousel/index.ts +16 -0
  281. package/packages/carousel/src/carousel-item.ts +114 -0
  282. package/packages/carousel/src/carousel.ts +449 -0
  283. package/packages/carousel/src/util.ts +21 -0
  284. package/packages/carousel-item/index.ts +16 -0
  285. package/packages/checkbox/index.ts +16 -0
  286. package/packages/checkbox/src/checkbox.ts +176 -0
  287. package/packages/checkbox/src/group.ts +178 -0
  288. package/packages/checkbox-group/index.ts +16 -0
  289. package/packages/components.ts +39 -39
  290. package/packages/date-picker/src/date-picker.ts +3 -0
  291. package/packages/icon-picker/index.ts +16 -0
  292. package/packages/icon-picker/src/icon-picker.ts +711 -0
  293. package/packages/input/index.ts +16 -0
  294. package/packages/input/src/input.ts +2995 -0
  295. package/packages/layout-footer/src/layout-footer.ts +4 -3
  296. package/packages/layout-header/src/layout-header.ts +2 -1
  297. package/packages/optgroup/index.ts +16 -0
  298. package/packages/option/index.ts +16 -0
  299. package/packages/pager/index.ts +16 -0
  300. package/packages/pager/src/pager.ts +743 -0
  301. package/packages/password-input/index.ts +16 -0
  302. package/packages/password-input/src/password-input.ts +427 -0
  303. package/packages/pulldown/src/pulldown.ts +5 -1
  304. package/packages/select/index.ts +16 -0
  305. package/packages/select/src/optgroup.ts +107 -0
  306. package/packages/select/src/option-info.ts +20 -0
  307. package/packages/select/src/option.ts +103 -0
  308. package/packages/select/src/select.ts +1325 -0
  309. package/packages/select/src/util.ts +46 -0
  310. package/packages/tab-pane/index.ts +16 -0
  311. package/packages/tabs/index.ts +16 -0
  312. package/packages/tabs/src/tab-pane.ts +136 -0
  313. package/packages/tabs/src/tabs.ts +630 -0
  314. package/packages/tabs/src/util.ts +21 -0
  315. package/types/components/carousel.d.ts +5 -0
  316. package/types/components/icon-picker.d.ts +4 -0
  317. package/types/components/input.d.ts +9 -1
  318. package/types/components/optgroup.d.ts +10 -4
  319. package/types/components/tabs.d.ts +4 -0
  320. /package/es/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  321. /package/es/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  322. /package/es/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
  323. /package/es/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  324. /package/es/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  325. /package/es/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
  326. /package/lib/icon/style/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  327. /package/lib/icon/style/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  328. /package/lib/icon/style/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
  329. /package/lib/{iconfont.1725630285930.ttf → iconfont.1725723159302.ttf} +0 -0
  330. /package/lib/{iconfont.1725630285930.woff → iconfont.1725723159302.woff} +0 -0
  331. /package/lib/{iconfont.1725630285930.woff2 → iconfont.1725723159302.woff2} +0 -0
@@ -0,0 +1,388 @@
1
+ import { defineVxeComponent } from '../../ui/src/comp';
2
+ import XEUtils from 'xe-utils';
3
+ import { getConfig, getIcon, getI18n, createEvent, globalMixins, renderEmptyElement } from '../../ui';
4
+ import { getFuncText } from '../../ui/src/utils';
5
+ import { getSlotVNs } from '../..//ui/src/vn';
6
+ export default defineVxeComponent({
7
+ name: 'VxePasswordInput',
8
+ mixins: [
9
+ globalMixins.sizeMixin
10
+ ],
11
+ model: {
12
+ prop: 'value',
13
+ event: 'modelValue'
14
+ },
15
+ props: {
16
+ value: String,
17
+ name: String,
18
+ clearable: { type: Boolean, default: () => getConfig().passwordInput.clearable },
19
+ readonly: Boolean,
20
+ disabled: Boolean,
21
+ maxLength: [String, Number],
22
+ placeholder: String,
23
+ autoComplete: {
24
+ type: String,
25
+ default: 'off'
26
+ },
27
+ className: String,
28
+ size: { type: String, default: () => getConfig().passwordInput.size || getConfig().size },
29
+ prefixIcon: String,
30
+ suffixIcon: String,
31
+ // 已废弃
32
+ autocomplete: String
33
+ },
34
+ inject: {
35
+ $xeForm: {
36
+ default: null
37
+ },
38
+ formItemInfo: {
39
+ from: 'xeFormItemInfo',
40
+ default: null
41
+ }
42
+ },
43
+ data() {
44
+ const xID = XEUtils.uniqueId();
45
+ const reactData = {
46
+ showPwd: false,
47
+ isActivated: false,
48
+ inputValue: ''
49
+ };
50
+ return {
51
+ xID,
52
+ reactData
53
+ };
54
+ },
55
+ computed: Object.assign(Object.assign({}, {}), { computeIsClearable() {
56
+ const $xePasswordInput = this;
57
+ const props = $xePasswordInput;
58
+ return props.clearable;
59
+ },
60
+ computeInpReadonly() {
61
+ const $xePasswordInput = this;
62
+ const props = $xePasswordInput;
63
+ const { readonly } = props;
64
+ return readonly;
65
+ },
66
+ computeInpPlaceholder() {
67
+ const $xePasswordInput = this;
68
+ const props = $xePasswordInput;
69
+ const { placeholder } = props;
70
+ if (placeholder) {
71
+ return getFuncText(placeholder);
72
+ }
73
+ const globalPlaceholder = getConfig().passwordInput.placeholder;
74
+ if (globalPlaceholder) {
75
+ return getFuncText(globalPlaceholder);
76
+ }
77
+ return getI18n('vxe.base.pleaseInput');
78
+ },
79
+ computeInputType() {
80
+ const $xePasswordInput = this;
81
+ const reactData = $xePasswordInput.reactData;
82
+ const { showPwd } = reactData;
83
+ if (showPwd) {
84
+ return 'text';
85
+ }
86
+ return 'password';
87
+ } }),
88
+ methods: {
89
+ //
90
+ // Method
91
+ //
92
+ dispatchEvent(type, params, evnt) {
93
+ const $xePasswordInput = this;
94
+ $xePasswordInput.$emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params));
95
+ },
96
+ focus() {
97
+ const $xePasswordInput = this;
98
+ const reactData = $xePasswordInput.reactData;
99
+ const inputElem = $xePasswordInput.$refs.refInputTarget;
100
+ reactData.isActivated = true;
101
+ inputElem.focus();
102
+ return $xePasswordInput.$nextTick();
103
+ },
104
+ blur() {
105
+ const $xePasswordInput = this;
106
+ const reactData = $xePasswordInput.reactData;
107
+ const inputElem = $xePasswordInput.$refs.refInputTarget;
108
+ inputElem.blur();
109
+ reactData.isActivated = false;
110
+ return $xePasswordInput.$nextTick();
111
+ },
112
+ select() {
113
+ const $xePasswordInput = this;
114
+ const reactData = $xePasswordInput.reactData;
115
+ const inputElem = $xePasswordInput.$refs.refInputTarget;
116
+ inputElem.select();
117
+ reactData.isActivated = false;
118
+ return $xePasswordInput.$nextTick();
119
+ },
120
+ triggerEvent(evnt) {
121
+ const $xePasswordInput = this;
122
+ const reactData = $xePasswordInput.reactData;
123
+ const { inputValue } = reactData;
124
+ $xePasswordInput.dispatchEvent(evnt.type, { value: inputValue }, evnt);
125
+ },
126
+ emitInputEvent(value, evnt) {
127
+ const $xePasswordInput = this;
128
+ const reactData = $xePasswordInput.reactData;
129
+ reactData.inputValue = value;
130
+ $xePasswordInput.dispatchEvent('input', { value }, evnt);
131
+ },
132
+ inputEvent(evnt) {
133
+ const $xePasswordInput = this;
134
+ const inputElem = evnt.target;
135
+ const value = inputElem.value;
136
+ $xePasswordInput.emitInputEvent(value, evnt);
137
+ },
138
+ emitModel(value, evnt) {
139
+ const $xePasswordInput = this;
140
+ const props = $xePasswordInput;
141
+ const reactData = $xePasswordInput.reactData;
142
+ const $xeForm = $xePasswordInput.$xeForm;
143
+ const formItemInfo = $xePasswordInput.formItemInfo;
144
+ reactData.inputValue = value;
145
+ $xePasswordInput.$emit('modelValue', value);
146
+ $xePasswordInput.dispatchEvent('input', { value }, evnt);
147
+ if (XEUtils.toValueString(props.value) !== value) {
148
+ $xePasswordInput.dispatchEvent('change', { value }, evnt);
149
+ // 自动更新校验状态
150
+ if ($xeForm && formItemInfo) {
151
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
152
+ }
153
+ }
154
+ },
155
+ changeEvent(evnt) {
156
+ const $xePasswordInput = this;
157
+ const reactData = $xePasswordInput.reactData;
158
+ const $xeForm = $xePasswordInput.$xeForm;
159
+ const formItemInfo = $xePasswordInput.formItemInfo;
160
+ $xePasswordInput.triggerEvent(evnt);
161
+ const { inputValue } = reactData;
162
+ // 自动更新校验状态
163
+ if ($xeForm && formItemInfo) {
164
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, inputValue);
165
+ }
166
+ },
167
+ focusEvent(evnt) {
168
+ const $xePasswordInput = this;
169
+ const reactData = $xePasswordInput.reactData;
170
+ reactData.isActivated = true;
171
+ $xePasswordInput.triggerEvent(evnt);
172
+ },
173
+ blurEvent(evnt) {
174
+ const $xePasswordInput = this;
175
+ const reactData = $xePasswordInput.reactData;
176
+ const { inputValue } = reactData;
177
+ $xePasswordInput.dispatchEvent('blur', { value: inputValue }, evnt);
178
+ },
179
+ passwordToggleEvent(evnt) {
180
+ const $xePasswordInput = this;
181
+ const props = $xePasswordInput;
182
+ const reactData = $xePasswordInput.reactData;
183
+ const { readonly, disabled } = props;
184
+ const { showPwd } = reactData;
185
+ if (!disabled && !readonly) {
186
+ reactData.showPwd = !showPwd;
187
+ }
188
+ $xePasswordInput.dispatchEvent('toggle-visible', { visible: reactData.showPwd }, evnt);
189
+ },
190
+ clickEvent(evnt) {
191
+ const $xePasswordInput = this;
192
+ $xePasswordInput.triggerEvent(evnt);
193
+ },
194
+ clearValueEvent(evnt, value) {
195
+ const $xePasswordInput = this;
196
+ $xePasswordInput.focus();
197
+ $xePasswordInput.emitModel('', evnt);
198
+ $xePasswordInput.dispatchEvent('clear', { value }, evnt);
199
+ },
200
+ clickSuffixEvent(evnt) {
201
+ const $xePasswordInput = this;
202
+ const props = $xePasswordInput;
203
+ const reactData = $xePasswordInput.reactData;
204
+ const { disabled } = props;
205
+ if (!disabled) {
206
+ const { inputValue } = reactData;
207
+ $xePasswordInput.dispatchEvent('suffix-click', { value: inputValue }, evnt);
208
+ }
209
+ },
210
+ clickPrefixEvent(evnt) {
211
+ const $xePasswordInput = this;
212
+ const props = $xePasswordInput;
213
+ const reactData = $xePasswordInput.reactData;
214
+ const { disabled } = props;
215
+ if (!disabled) {
216
+ const { inputValue } = reactData;
217
+ $xePasswordInput.dispatchEvent('prefix-click', { value: inputValue }, evnt);
218
+ }
219
+ },
220
+ //
221
+ // Render
222
+ //
223
+ renderPasswordIcon(h) {
224
+ const $xePasswordInput = this;
225
+ const reactData = $xePasswordInput.reactData;
226
+ const { showPwd } = reactData;
227
+ return h('div', {
228
+ class: 'password-input--control-icon',
229
+ on: {
230
+ click: $xePasswordInput.passwordToggleEvent
231
+ }
232
+ }, [
233
+ h('i', {
234
+ class: ['password-input--password-icon', showPwd ? getIcon().PASSWORD_INPUT_SHOW_PWD : getIcon().PASSWORD_INPUT_HIDE_PWD]
235
+ })
236
+ ]);
237
+ },
238
+ renderPrefixIcon(h) {
239
+ const $xePasswordInput = this;
240
+ const props = $xePasswordInput;
241
+ const slots = $xePasswordInput.$scopedSlots;
242
+ const { prefixIcon } = props;
243
+ const prefixSlot = slots.prefix;
244
+ return prefixSlot || prefixIcon
245
+ ? h('div', {
246
+ class: 'password-input--prefix',
247
+ on: {
248
+ click: $xePasswordInput.clickPrefixEvent
249
+ }
250
+ }, [
251
+ h('div', {
252
+ class: 'password-input--prefix-icon'
253
+ }, prefixSlot
254
+ ? getSlotVNs(prefixSlot({}))
255
+ : [
256
+ h('i', {
257
+ class: prefixIcon
258
+ })
259
+ ])
260
+ ])
261
+ : null;
262
+ },
263
+ renderSuffixIcon(h) {
264
+ const $xePasswordInput = this;
265
+ const props = $xePasswordInput;
266
+ const slots = $xePasswordInput.$scopedSlots;
267
+ const reactData = $xePasswordInput.reactData;
268
+ const { disabled, suffixIcon } = props;
269
+ const { inputValue } = reactData;
270
+ const suffixSlot = slots.suffix;
271
+ const isClearable = $xePasswordInput.computeIsClearable;
272
+ return isClearable || suffixSlot || suffixIcon
273
+ ? h('div', {
274
+ class: ['password-input--suffix', {
275
+ 'is--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
276
+ }]
277
+ }, [
278
+ isClearable
279
+ ? h('div', {
280
+ class: 'password-input--clear-icon',
281
+ on: {
282
+ click: $xePasswordInput.clearValueEvent
283
+ }
284
+ }, [
285
+ h('i', {
286
+ class: getIcon().INPUT_CLEAR
287
+ })
288
+ ])
289
+ : renderEmptyElement($xePasswordInput),
290
+ $xePasswordInput.renderExtraSuffixIcon(h),
291
+ suffixSlot || suffixIcon
292
+ ? h('div', {
293
+ class: 'password-input--suffix-icon',
294
+ on: {
295
+ click: $xePasswordInput.clickSuffixEvent
296
+ }
297
+ }, suffixSlot
298
+ ? getSlotVNs(suffixSlot({}))
299
+ : [
300
+ h('i', {
301
+ class: suffixIcon
302
+ })
303
+ ])
304
+ : renderEmptyElement($xePasswordInput)
305
+ ])
306
+ : null;
307
+ },
308
+ renderExtraSuffixIcon(h) {
309
+ const $xePasswordInput = this;
310
+ return $xePasswordInput.renderPasswordIcon(h);
311
+ },
312
+ renderVN(h) {
313
+ const $xePasswordInput = this;
314
+ const props = $xePasswordInput;
315
+ const reactData = $xePasswordInput.reactData;
316
+ const { className, name, disabled, readonly, autocomplete, autoComplete, maxLength } = props;
317
+ const { inputValue, isActivated } = reactData;
318
+ const vSize = $xePasswordInput.computeSize;
319
+ const inpReadonly = $xePasswordInput.computeInpReadonly;
320
+ const inputType = $xePasswordInput.computeInputType;
321
+ const inpPlaceholder = $xePasswordInput.computeInpPlaceholder;
322
+ const isClearable = $xePasswordInput.computeIsClearable;
323
+ const prefix = $xePasswordInput.renderPrefixIcon(h);
324
+ const suffix = $xePasswordInput.renderSuffixIcon(h);
325
+ return h('div', {
326
+ ref: 'refElem',
327
+ class: ['password-input', className, {
328
+ [`size--${vSize}`]: vSize,
329
+ 'is--prefix': !!prefix,
330
+ 'is--suffix': !!suffix,
331
+ 'is--readonly': readonly,
332
+ 'is--disabled': disabled,
333
+ 'is--active': isActivated,
334
+ 'show--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
335
+ }],
336
+ attrs: {
337
+ spellcheck: false
338
+ }
339
+ }, [
340
+ prefix || renderEmptyElement($xePasswordInput),
341
+ h('div', {
342
+ class: 'password-input--wrapper'
343
+ }, [
344
+ h('input', {
345
+ ref: 'refInputTarget',
346
+ class: 'password-input--inner',
347
+ domProps: {
348
+ value: inputValue
349
+ },
350
+ attrs: {
351
+ name,
352
+ type: inputType,
353
+ placeholder: inpPlaceholder,
354
+ readonly: inpReadonly,
355
+ disabled,
356
+ autocomplete: autocomplete || autoComplete,
357
+ maxlength: maxLength
358
+ },
359
+ on: {
360
+ click: $xePasswordInput.clickEvent,
361
+ input: $xePasswordInput.inputEvent,
362
+ change: $xePasswordInput.changeEvent,
363
+ focus: $xePasswordInput.focusEvent,
364
+ blur: $xePasswordInput.blurEvent
365
+ }
366
+ })
367
+ ]),
368
+ suffix || renderEmptyElement($xePasswordInput)
369
+ ]);
370
+ }
371
+ },
372
+ watch: {
373
+ value(val) {
374
+ const $xePasswordInput = this;
375
+ const reactData = $xePasswordInput.reactData;
376
+ reactData.inputValue = val;
377
+ }
378
+ },
379
+ created() {
380
+ const $xePasswordInput = this;
381
+ const props = $xePasswordInput;
382
+ const reactData = $xePasswordInput.reactData;
383
+ reactData.inputValue = props.value;
384
+ },
385
+ render(h) {
386
+ return this.renderVN(h);
387
+ }
388
+ });