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,16 @@
1
+ import { VueConstructor } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import VxePasswordInputComponent from './src/password-input'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxePasswordInput = Object.assign({}, VxePasswordInputComponent, {
7
+ install (app: VueConstructor) {
8
+ app.component(VxePasswordInputComponent.name as string, VxePasswordInputComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxePasswordInput)
13
+ VxeUI.component(VxePasswordInputComponent)
14
+
15
+ export const PasswordInput = VxePasswordInput
16
+ export default VxePasswordInput
@@ -0,0 +1,427 @@
1
+ import { CreateElement, PropType, VNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import XEUtils from 'xe-utils'
4
+ import { getConfig, getIcon, getI18n, createEvent, globalMixins, renderEmptyElement } from '../../ui'
5
+ import { getFuncText } from '../../ui/src/utils'
6
+ import { getSlotVNs } from '../..//ui/src/vn'
7
+
8
+ import type { VxePasswordInputEmits, VxeComponentSizeType, PasswordInputReactData, ValueOf, VxePasswordInputPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines } from '../../../types'
9
+
10
+ export default defineVxeComponent({
11
+ name: 'VxePasswordInput',
12
+ mixins: [
13
+ globalMixins.sizeMixin
14
+ ],
15
+ model: {
16
+ prop: 'value',
17
+ event: 'modelValue'
18
+ },
19
+ props: {
20
+ value: String as PropType<VxePasswordInputPropTypes.ModelValue>,
21
+ name: String as PropType<VxePasswordInputPropTypes.Name>,
22
+ clearable: { type: Boolean as PropType<VxePasswordInputPropTypes.Clearable>, default: () => getConfig().passwordInput.clearable },
23
+ readonly: Boolean as PropType<VxePasswordInputPropTypes.Readonly>,
24
+ disabled: Boolean as PropType<VxePasswordInputPropTypes.Disabled>,
25
+ maxLength: [String, Number] as PropType<VxePasswordInputPropTypes.MaxLength>,
26
+ placeholder: String as PropType<VxePasswordInputPropTypes.Placeholder>,
27
+ autoComplete: {
28
+ type: String as PropType<VxePasswordInputPropTypes.AutoComplete>,
29
+ default: 'off'
30
+ },
31
+ className: String as PropType<VxePasswordInputPropTypes.ClassName>,
32
+ size: { type: String as PropType<VxePasswordInputPropTypes.Size>, default: () => getConfig().passwordInput.size || getConfig().size },
33
+ prefixIcon: String as PropType<VxePasswordInputPropTypes.PrefixIcon>,
34
+ suffixIcon: String as PropType<VxePasswordInputPropTypes.SuffixIcon>,
35
+
36
+ // 已废弃
37
+ autocomplete: String as PropType<VxePasswordInputPropTypes.Autocomplete>
38
+ },
39
+ inject: {
40
+ $xeForm: {
41
+ default: null
42
+ },
43
+ formItemInfo: {
44
+ from: 'xeFormItemInfo',
45
+ default: null
46
+ }
47
+ },
48
+ data () {
49
+ const xID = XEUtils.uniqueId()
50
+ const reactData: PasswordInputReactData = {
51
+ showPwd: false,
52
+ isActivated: false,
53
+ inputValue: ''
54
+ }
55
+ return {
56
+ xID,
57
+ reactData
58
+ }
59
+ },
60
+ computed: {
61
+ ...({} as {
62
+ computeSize(): VxeComponentSizeType
63
+ $xeForm(): (VxeFormConstructor & VxeFormPrivateMethods) | null
64
+ formItemInfo(): VxeFormDefines.ProvideItemInfo | null
65
+ }),
66
+ computeIsClearable () {
67
+ const $xePasswordInput = this
68
+ const props = $xePasswordInput
69
+
70
+ return props.clearable
71
+ },
72
+ computeInpReadonly () {
73
+ const $xePasswordInput = this
74
+ const props = $xePasswordInput
75
+
76
+ const { readonly } = props
77
+ return readonly
78
+ },
79
+ computeInpPlaceholder () {
80
+ const $xePasswordInput = this
81
+ const props = $xePasswordInput
82
+
83
+ const { placeholder } = props
84
+ if (placeholder) {
85
+ return getFuncText(placeholder)
86
+ }
87
+ const globalPlaceholder = getConfig().passwordInput.placeholder
88
+ if (globalPlaceholder) {
89
+ return getFuncText(globalPlaceholder)
90
+ }
91
+ return getI18n('vxe.base.pleaseInput')
92
+ },
93
+ computeInputType () {
94
+ const $xePasswordInput = this
95
+ const reactData = $xePasswordInput.reactData
96
+
97
+ const { showPwd } = reactData
98
+ if (showPwd) {
99
+ return 'text'
100
+ }
101
+ return 'password'
102
+ }
103
+ },
104
+ methods: {
105
+ //
106
+ // Method
107
+ //
108
+ dispatchEvent (type: ValueOf<VxePasswordInputEmits>, params: Record<string, any>, evnt: Event | null) {
109
+ const $xePasswordInput = this
110
+ $xePasswordInput.$emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params))
111
+ },
112
+ focus () {
113
+ const $xePasswordInput = this
114
+ const reactData = $xePasswordInput.reactData
115
+
116
+ const inputElem = $xePasswordInput.$refs.refInputTarget as HTMLInputElement
117
+ reactData.isActivated = true
118
+ inputElem.focus()
119
+ return $xePasswordInput.$nextTick()
120
+ },
121
+ blur () {
122
+ const $xePasswordInput = this
123
+ const reactData = $xePasswordInput.reactData
124
+
125
+ const inputElem = $xePasswordInput.$refs.refInputTarget as HTMLInputElement
126
+ inputElem.blur()
127
+ reactData.isActivated = false
128
+ return $xePasswordInput.$nextTick()
129
+ },
130
+ select () {
131
+ const $xePasswordInput = this
132
+ const reactData = $xePasswordInput.reactData
133
+
134
+ const inputElem = $xePasswordInput.$refs.refInputTarget as HTMLInputElement
135
+ inputElem.select()
136
+ reactData.isActivated = false
137
+ return $xePasswordInput.$nextTick()
138
+ },
139
+ triggerEvent (evnt: Event & { type: 'input' | 'change' | 'click' | 'focus' | 'blur' }) {
140
+ const $xePasswordInput = this
141
+ const reactData = $xePasswordInput.reactData
142
+
143
+ const { inputValue } = reactData
144
+ $xePasswordInput.dispatchEvent(evnt.type, { value: inputValue }, evnt)
145
+ },
146
+ emitInputEvent (value: any, evnt: Event) {
147
+ const $xePasswordInput = this
148
+ const reactData = $xePasswordInput.reactData
149
+
150
+ reactData.inputValue = value
151
+ $xePasswordInput.dispatchEvent('input', { value }, evnt)
152
+ },
153
+ inputEvent (evnt: Event & { type: 'input' }) {
154
+ const $xePasswordInput = this
155
+
156
+ const inputElem = evnt.target as HTMLInputElement
157
+ const value = inputElem.value
158
+ $xePasswordInput.emitInputEvent(value, evnt)
159
+ },
160
+ emitModel (value: string, evnt: Event | { type: string }) {
161
+ const $xePasswordInput = this
162
+ const props = $xePasswordInput
163
+ const reactData = $xePasswordInput.reactData
164
+ const $xeForm = $xePasswordInput.$xeForm
165
+ const formItemInfo = $xePasswordInput.formItemInfo
166
+
167
+ reactData.inputValue = value
168
+ $xePasswordInput.$emit('modelValue', value)
169
+ $xePasswordInput.dispatchEvent('input', { value }, evnt as any)
170
+ if (XEUtils.toValueString(props.value) !== value) {
171
+ $xePasswordInput.dispatchEvent('change', { value }, evnt as any)
172
+ // 自动更新校验状态
173
+ if ($xeForm && formItemInfo) {
174
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
175
+ }
176
+ }
177
+ },
178
+ changeEvent (evnt: Event & { type: 'change' }) {
179
+ const $xePasswordInput = this
180
+ const reactData = $xePasswordInput.reactData
181
+ const $xeForm = $xePasswordInput.$xeForm
182
+ const formItemInfo = $xePasswordInput.formItemInfo
183
+
184
+ $xePasswordInput.triggerEvent(evnt)
185
+ const { inputValue } = reactData
186
+ // 自动更新校验状态
187
+ if ($xeForm && formItemInfo) {
188
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, inputValue)
189
+ }
190
+ },
191
+ focusEvent (evnt: Event & { type: 'focus' }) {
192
+ const $xePasswordInput = this
193
+ const reactData = $xePasswordInput.reactData
194
+
195
+ reactData.isActivated = true
196
+ $xePasswordInput.triggerEvent(evnt)
197
+ },
198
+ blurEvent (evnt: Event & { type: 'blur' }) {
199
+ const $xePasswordInput = this
200
+ const reactData = $xePasswordInput.reactData
201
+
202
+ const { inputValue } = reactData
203
+ $xePasswordInput.dispatchEvent('blur', { value: inputValue }, evnt)
204
+ },
205
+ passwordToggleEvent (evnt: Event) {
206
+ const $xePasswordInput = this
207
+ const props = $xePasswordInput
208
+ const reactData = $xePasswordInput.reactData
209
+
210
+ const { readonly, disabled } = props
211
+ const { showPwd } = reactData
212
+ if (!disabled && !readonly) {
213
+ reactData.showPwd = !showPwd
214
+ }
215
+ $xePasswordInput.dispatchEvent('toggle-visible', { visible: reactData.showPwd }, evnt)
216
+ },
217
+ clickEvent (evnt: Event & { type: 'click' }) {
218
+ const $xePasswordInput = this
219
+
220
+ $xePasswordInput.triggerEvent(evnt)
221
+ },
222
+ clearValueEvent (evnt: Event, value: VxePasswordInputPropTypes.ModelValue) {
223
+ const $xePasswordInput = this
224
+
225
+ $xePasswordInput.focus()
226
+ $xePasswordInput.emitModel('', evnt)
227
+ $xePasswordInput.dispatchEvent('clear', { value }, evnt)
228
+ },
229
+ clickSuffixEvent (evnt: Event) {
230
+ const $xePasswordInput = this
231
+ const props = $xePasswordInput
232
+ const reactData = $xePasswordInput.reactData
233
+
234
+ const { disabled } = props
235
+ if (!disabled) {
236
+ const { inputValue } = reactData
237
+ $xePasswordInput.dispatchEvent('suffix-click', { value: inputValue }, evnt)
238
+ }
239
+ },
240
+ clickPrefixEvent (evnt: Event) {
241
+ const $xePasswordInput = this
242
+ const props = $xePasswordInput
243
+ const reactData = $xePasswordInput.reactData
244
+
245
+ const { disabled } = props
246
+ if (!disabled) {
247
+ const { inputValue } = reactData
248
+ $xePasswordInput.dispatchEvent('prefix-click', { value: inputValue }, evnt)
249
+ }
250
+ },
251
+
252
+ //
253
+ // Render
254
+ //
255
+ renderPasswordIcon (h: CreateElement) {
256
+ const $xePasswordInput = this
257
+ const reactData = $xePasswordInput.reactData
258
+
259
+ const { showPwd } = reactData
260
+ return h('div', {
261
+ class: 'password-input--control-icon',
262
+ on: {
263
+ click: $xePasswordInput.passwordToggleEvent
264
+ }
265
+ }, [
266
+ h('i', {
267
+ class: ['password-input--password-icon', showPwd ? getIcon().PASSWORD_INPUT_SHOW_PWD : getIcon().PASSWORD_INPUT_HIDE_PWD]
268
+ })
269
+ ])
270
+ },
271
+ renderPrefixIcon (h: CreateElement) {
272
+ const $xePasswordInput = this
273
+ const props = $xePasswordInput
274
+ const slots = $xePasswordInput.$scopedSlots
275
+
276
+ const { prefixIcon } = props
277
+ const prefixSlot = slots.prefix
278
+ return prefixSlot || prefixIcon
279
+ ? h('div', {
280
+ class: 'password-input--prefix',
281
+ on: {
282
+ click: $xePasswordInput.clickPrefixEvent
283
+ }
284
+ }, [
285
+ h('div', {
286
+ class: 'password-input--prefix-icon'
287
+ }, prefixSlot
288
+ ? getSlotVNs(prefixSlot({}))
289
+ : [
290
+ h('i', {
291
+ class: prefixIcon
292
+ })
293
+ ])
294
+ ])
295
+ : null
296
+ },
297
+ renderSuffixIcon (h: CreateElement) {
298
+ const $xePasswordInput = this
299
+ const props = $xePasswordInput
300
+ const slots = $xePasswordInput.$scopedSlots
301
+ const reactData = $xePasswordInput.reactData
302
+
303
+ const { disabled, suffixIcon } = props
304
+ const { inputValue } = reactData
305
+ const suffixSlot = slots.suffix
306
+ const isClearable = $xePasswordInput.computeIsClearable
307
+ return isClearable || suffixSlot || suffixIcon
308
+ ? h('div', {
309
+ class: ['password-input--suffix', {
310
+ 'is--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
311
+ }]
312
+ }, [
313
+ isClearable
314
+ ? h('div', {
315
+ class: 'password-input--clear-icon',
316
+ on: {
317
+ click: $xePasswordInput.clearValueEvent
318
+ }
319
+ }, [
320
+ h('i', {
321
+ class: getIcon().INPUT_CLEAR
322
+ })
323
+ ])
324
+ : renderEmptyElement($xePasswordInput),
325
+ $xePasswordInput.renderExtraSuffixIcon(h),
326
+ suffixSlot || suffixIcon
327
+ ? h('div', {
328
+ class: 'password-input--suffix-icon',
329
+ on: {
330
+ click: $xePasswordInput.clickSuffixEvent
331
+ }
332
+ }, suffixSlot
333
+ ? getSlotVNs(suffixSlot({}))
334
+ : [
335
+ h('i', {
336
+ class: suffixIcon
337
+ })
338
+ ])
339
+ : renderEmptyElement($xePasswordInput)
340
+ ])
341
+ : null
342
+ },
343
+ renderExtraSuffixIcon (h: CreateElement) {
344
+ const $xePasswordInput = this
345
+
346
+ return $xePasswordInput.renderPasswordIcon(h)
347
+ },
348
+ renderVN (h: CreateElement): VNode {
349
+ const $xePasswordInput = this
350
+ const props = $xePasswordInput
351
+ const reactData = $xePasswordInput.reactData
352
+
353
+ const { className, name, disabled, readonly, autocomplete, autoComplete, maxLength } = props
354
+ const { inputValue, isActivated } = reactData
355
+ const vSize = $xePasswordInput.computeSize
356
+ const inpReadonly = $xePasswordInput.computeInpReadonly
357
+ const inputType = $xePasswordInput.computeInputType
358
+ const inpPlaceholder = $xePasswordInput.computeInpPlaceholder
359
+ const isClearable = $xePasswordInput.computeIsClearable
360
+ const prefix = $xePasswordInput.renderPrefixIcon(h)
361
+ const suffix = $xePasswordInput.renderSuffixIcon(h)
362
+ return h('div', {
363
+ ref: 'refElem',
364
+ class: ['password-input', className, {
365
+ [`size--${vSize}`]: vSize,
366
+ 'is--prefix': !!prefix,
367
+ 'is--suffix': !!suffix,
368
+ 'is--readonly': readonly,
369
+ 'is--disabled': disabled,
370
+ 'is--active': isActivated,
371
+ 'show--clear': isClearable && !disabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
372
+ }],
373
+ attrs: {
374
+ spellcheck: false
375
+ }
376
+ }, [
377
+ prefix || renderEmptyElement($xePasswordInput),
378
+ h('div', {
379
+ class: 'password-input--wrapper'
380
+ }, [
381
+ h('input', {
382
+ ref: 'refInputTarget',
383
+ class: 'password-input--inner',
384
+ domProps: {
385
+ value: inputValue
386
+ },
387
+ attrs: {
388
+ name,
389
+ type: inputType,
390
+ placeholder: inpPlaceholder,
391
+ readonly: inpReadonly,
392
+ disabled,
393
+ autocomplete: autocomplete || autoComplete,
394
+ maxlength: maxLength
395
+ },
396
+ on: {
397
+ click: $xePasswordInput.clickEvent,
398
+ input: $xePasswordInput.inputEvent,
399
+ change: $xePasswordInput.changeEvent,
400
+ focus: $xePasswordInput.focusEvent,
401
+ blur: $xePasswordInput.blurEvent
402
+ }
403
+ })
404
+ ]),
405
+ suffix || renderEmptyElement($xePasswordInput)
406
+ ])
407
+ }
408
+ },
409
+ watch: {
410
+ value (val) {
411
+ const $xePasswordInput = this
412
+ const reactData = $xePasswordInput.reactData
413
+
414
+ reactData.inputValue = val
415
+ }
416
+ },
417
+ created () {
418
+ const $xePasswordInput = this
419
+ const props = $xePasswordInput
420
+ const reactData = $xePasswordInput.reactData
421
+
422
+ reactData.inputValue = props.value
423
+ },
424
+ render (this: any, h) {
425
+ return this.renderVN(h)
426
+ }
427
+ })
@@ -46,6 +46,9 @@ export default defineVxeComponent({
46
46
  $xeModal: {
47
47
  default: null
48
48
  },
49
+ $xeDrawer: {
50
+ default: null
51
+ },
49
52
  $xeTable: {
50
53
  default: null
51
54
  },
@@ -54,6 +57,7 @@ export default defineVxeComponent({
54
57
  }
55
58
  },
56
59
  data () {
60
+ const xID = XEUtils.uniqueId()
57
61
  const reactData: PulldownReactData = {
58
62
  initialized: false,
59
63
  panelIndex: 0,
@@ -67,7 +71,7 @@ export default defineVxeComponent({
67
71
  hpTimeout: undefined
68
72
  }
69
73
  return {
70
- xID: XEUtils.uniqueId(),
74
+ xID,
71
75
  reactData,
72
76
  internalData
73
77
  }
@@ -0,0 +1,16 @@
1
+ import { VueConstructor } from 'vue'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import VxeSelectComponent from './src/select'
4
+ import { dynamicApp } from '../dynamics'
5
+
6
+ export const VxeSelect = Object.assign(VxeSelectComponent, {
7
+ install: function (app: VueConstructor) {
8
+ app.component(VxeSelectComponent.name as string, VxeSelectComponent)
9
+ }
10
+ })
11
+
12
+ dynamicApp.use(VxeSelect)
13
+ VxeUI.component(VxeSelectComponent)
14
+
15
+ export const Select = VxeSelect
16
+ export default VxeSelect
@@ -0,0 +1,107 @@
1
+ import { PropType, CreateElement, VNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import { createEvent, globalMixins } from '../../ui'
4
+ import XEUtils from 'xe-utils'
5
+ import { createOption, watchOption, destroyOption, assembleOption } from './util'
6
+ import { OptionInfo } from './option-info'
7
+
8
+ import type { VxeSelectConstructor, VxeOptgroupPropTypes, VxeComponentSizeType, VxeOptgroupEmits, ValueOf, OptgroupReactData } from '../../../types'
9
+
10
+ export default defineVxeComponent({
11
+ name: 'VxeOptgroup',
12
+ mixins: [
13
+ globalMixins.sizeMixin
14
+ ],
15
+ props: {
16
+ label: {
17
+ type: [String, Number, Boolean] as PropType<VxeOptgroupPropTypes.Label>,
18
+ default: ''
19
+ },
20
+ visible: {
21
+ type: Boolean as PropType<VxeOptgroupPropTypes.Visible>,
22
+ default: null
23
+ },
24
+ className: [String, Function] as PropType<VxeOptgroupPropTypes.ClassName>,
25
+ disabled: Boolean as PropType<VxeOptgroupPropTypes.Disabled>
26
+ },
27
+ inject: {
28
+ $xeSelect: {
29
+ default: null
30
+ }
31
+ },
32
+ provide () {
33
+ const $xeOptgroup = this
34
+ return {
35
+ $xeOptgroup
36
+ }
37
+ },
38
+ data () {
39
+ const xID = XEUtils.uniqueId()
40
+ const reactData: OptgroupReactData = {
41
+ }
42
+ const optionConfig = {} as OptionInfo
43
+ return {
44
+ xID,
45
+ reactData,
46
+ optionConfig
47
+ }
48
+ },
49
+ computed: {
50
+ ...({} as {
51
+ computeSize(): VxeComponentSizeType
52
+ $xeSelect(): VxeSelectConstructor
53
+ })
54
+ },
55
+ methods: {
56
+ //
57
+ // Method
58
+ //
59
+ dispatchEvent (type: ValueOf<VxeOptgroupEmits>, params: Record<string, any>, evnt: Event | null) {
60
+ const $xeOptgroup = this
61
+ $xeOptgroup.$emit(type, createEvent(evnt, { $optgroup: $xeOptgroup }, params))
62
+ },
63
+
64
+ //
65
+ // Render
66
+ //
67
+ renderVN (h: CreateElement): VNode {
68
+ const $xeOptgroup = this
69
+ const slots = $xeOptgroup.$scopedSlots
70
+ const defaultSlot = slots.default
71
+
72
+ return h('div', {
73
+ ref: 'elem'
74
+ }, defaultSlot ? defaultSlot({}) : [])
75
+ }
76
+ },
77
+ created () {
78
+ const $xeOptgroup = this
79
+ const props = $xeOptgroup
80
+ const slots = $xeOptgroup.$scopedSlots
81
+ const $xeSelect = $xeOptgroup.$xeSelect
82
+
83
+ const optionConfig = createOption($xeSelect, props)
84
+ optionConfig.slots = slots
85
+ $xeOptgroup.optionConfig = optionConfig
86
+
87
+ watchOption($xeOptgroup, optionConfig)
88
+ },
89
+ mounted () {
90
+ const $xeOptgroup = this
91
+ const optionConfig = $xeOptgroup.optionConfig
92
+ const $xeSelect = $xeOptgroup.$xeSelect
93
+
94
+ const el = $xeOptgroup.$refs.elem as HTMLDivElement
95
+ assembleOption($xeSelect, el, optionConfig)
96
+ },
97
+ beforeDestroy () {
98
+ const $xeOptgroup = this
99
+ const optionConfig = $xeOptgroup.optionConfig
100
+ const $xeSelect = $xeOptgroup.$xeSelect
101
+
102
+ destroyOption($xeSelect, optionConfig)
103
+ },
104
+ render (this: any, h) {
105
+ return this.renderVN(h)
106
+ }
107
+ })
@@ -0,0 +1,20 @@
1
+ import XEUtils from 'xe-utils'
2
+
3
+ export class OptionInfo {
4
+ constructor ($xeselect: any, _vm: any) {
5
+ Object.assign(this, {
6
+ id: XEUtils.uniqueId('option_'),
7
+ value: _vm.value,
8
+ label: _vm.label,
9
+ visible: _vm.visible,
10
+ className: _vm.className,
11
+ disabled: _vm.disabled
12
+ })
13
+ }
14
+
15
+ update (name: any, value: any) {
16
+ this[name] = value
17
+ }
18
+
19
+ [key: string]: any
20
+ }