element-pe 2.0.6 → 2.0.7

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 (302) hide show
  1. package/dist/index.full.js +1 -1
  2. package/dist/index.full.min.js +1 -1
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +1 -1
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +1 -1
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +114 -23
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +23 -114
  11. package/es/components/affix/src/affix2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.mjs +2 -2
  13. package/es/components/autocomplete/src/autocomplete.mjs +325 -67
  14. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  15. package/es/components/autocomplete/src/autocomplete2.mjs +67 -325
  16. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  17. package/es/components/backtop/index.mjs +2 -2
  18. package/es/components/backtop/src/backtop.mjs +100 -21
  19. package/es/components/backtop/src/backtop.mjs.map +1 -1
  20. package/es/components/backtop/src/backtop2.mjs +21 -100
  21. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  22. package/es/components/breadcrumb/index.mjs +2 -2
  23. package/es/components/breadcrumb/src/breadcrumb-item.mjs +11 -57
  24. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  25. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +57 -11
  26. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  27. package/es/components/button/index.mjs +3 -3
  28. package/es/components/button/src/button-group.mjs +5 -30
  29. package/es/components/button/src/button-group.mjs.map +1 -1
  30. package/es/components/button/src/button-group2.mjs +30 -5
  31. package/es/components/button/src/button-group2.mjs.map +1 -1
  32. package/es/components/button/src/button.mjs +106 -51
  33. package/es/components/button/src/button.mjs.map +1 -1
  34. package/es/components/button/src/button2.mjs +51 -106
  35. package/es/components/button/src/button2.mjs.map +1 -1
  36. package/es/components/carousel/index.mjs +2 -2
  37. package/es/components/carousel/src/carousel.mjs +48 -319
  38. package/es/components/carousel/src/carousel.mjs.map +1 -1
  39. package/es/components/carousel/src/carousel2.mjs +319 -48
  40. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  41. package/es/components/dialog/index.mjs +2 -2
  42. package/es/components/dialog/src/dialog.mjs +113 -70
  43. package/es/components/dialog/src/dialog.mjs.map +1 -1
  44. package/es/components/dialog/src/dialog2.mjs +70 -113
  45. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  46. package/es/components/drawer/index.mjs +2 -2
  47. package/es/components/drawer/src/drawer.mjs +21 -126
  48. package/es/components/drawer/src/drawer.mjs.map +1 -1
  49. package/es/components/drawer/src/drawer2.mjs +126 -21
  50. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  51. package/es/components/empty/index.mjs +2 -2
  52. package/es/components/empty/src/empty.mjs +11 -56
  53. package/es/components/empty/src/empty.mjs.map +1 -1
  54. package/es/components/empty/src/empty2.mjs +56 -11
  55. package/es/components/empty/src/empty2.mjs.map +1 -1
  56. package/es/components/form/index.mjs +2 -2
  57. package/es/components/form/src/form-item.mjs +43 -272
  58. package/es/components/form/src/form-item.mjs.map +1 -1
  59. package/es/components/form/src/form-item2.mjs +272 -43
  60. package/es/components/form/src/form-item2.mjs.map +1 -1
  61. package/es/components/icon/index.mjs +2 -2
  62. package/es/components/icon/src/icon.mjs +35 -8
  63. package/es/components/icon/src/icon.mjs.map +1 -1
  64. package/es/components/icon/src/icon2.mjs +8 -35
  65. package/es/components/icon/src/icon2.mjs.map +1 -1
  66. package/es/components/index.mjs +26 -26
  67. package/es/components/input/index.mjs +2 -2
  68. package/es/components/input/src/input.mjs +92 -433
  69. package/es/components/input/src/input.mjs.map +1 -1
  70. package/es/components/input/src/input2.mjs +433 -92
  71. package/es/components/input/src/input2.mjs.map +1 -1
  72. package/es/components/input-number/index.mjs +2 -2
  73. package/es/components/input-number/src/input-number.mjs +284 -53
  74. package/es/components/input-number/src/input-number.mjs.map +1 -1
  75. package/es/components/input-number/src/input-number2.mjs +53 -284
  76. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  77. package/es/components/link/index.mjs +2 -2
  78. package/es/components/link/src/link.mjs +49 -22
  79. package/es/components/link/src/link.mjs.map +1 -1
  80. package/es/components/link/src/link2.mjs +22 -49
  81. package/es/components/link/src/link2.mjs.map +1 -1
  82. package/es/components/menu/index.mjs +2 -2
  83. package/es/components/menu/src/menu-item-group.mjs +4 -51
  84. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  85. package/es/components/menu/src/menu-item-group2.mjs +51 -4
  86. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  87. package/es/components/page-header/index.mjs +2 -2
  88. package/es/components/page-header/src/page-header.mjs +60 -17
  89. package/es/components/page-header/src/page-header.mjs.map +1 -1
  90. package/es/components/page-header/src/page-header2.mjs +17 -60
  91. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  92. package/es/components/popconfirm/index.mjs +2 -2
  93. package/es/components/popconfirm/src/popconfirm.mjs +52 -119
  94. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  95. package/es/components/popconfirm/src/popconfirm2.mjs +119 -52
  96. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  97. package/es/components/popper/index.mjs +2 -2
  98. package/es/components/popper/src/arrow.mjs +37 -7
  99. package/es/components/popper/src/arrow.mjs.map +1 -1
  100. package/es/components/popper/src/arrow2.mjs +7 -37
  101. package/es/components/popper/src/arrow2.mjs.map +1 -1
  102. package/es/components/progress/index.mjs +2 -2
  103. package/es/components/progress/src/progress.mjs +230 -57
  104. package/es/components/progress/src/progress.mjs.map +1 -1
  105. package/es/components/progress/src/progress2.mjs +57 -230
  106. package/es/components/progress/src/progress2.mjs.map +1 -1
  107. package/es/components/radio/index.mjs +2 -2
  108. package/es/components/radio/src/radio-group.mjs +20 -84
  109. package/es/components/radio/src/radio-group.mjs.map +1 -1
  110. package/es/components/radio/src/radio-group2.mjs +84 -20
  111. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  112. package/es/components/rate/index.mjs +2 -2
  113. package/es/components/rate/src/rate.mjs +239 -88
  114. package/es/components/rate/src/rate.mjs.map +1 -1
  115. package/es/components/rate/src/rate2.mjs +88 -239
  116. package/es/components/rate/src/rate2.mjs.map +1 -1
  117. package/es/components/skeleton/index.mjs +2 -2
  118. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  119. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  120. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  121. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  122. package/es/components/skeleton/src/skeleton.mjs +1 -1
  123. package/es/components/switch/index.mjs +2 -2
  124. package/es/components/switch/src/switch.mjs +250 -87
  125. package/es/components/switch/src/switch.mjs.map +1 -1
  126. package/es/components/switch/src/switch2.mjs +87 -250
  127. package/es/components/switch/src/switch2.mjs.map +1 -1
  128. package/es/components/tabs/index.mjs +3 -3
  129. package/es/components/tabs/src/tab-bar.mjs +76 -7
  130. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  131. package/es/components/tabs/src/tab-bar2.mjs +7 -76
  132. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  133. package/es/components/tabs/src/tab-nav.mjs +1 -1
  134. package/es/components/tabs/src/tab-pane.mjs +60 -14
  135. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  136. package/es/components/tabs/src/tab-pane2.mjs +14 -60
  137. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  138. package/es/components/teleport/index.mjs +2 -2
  139. package/es/components/teleport/src/teleport.mjs +18 -43
  140. package/es/components/teleport/src/teleport.mjs.map +1 -1
  141. package/es/components/teleport/src/teleport2.mjs +43 -18
  142. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  143. package/es/components/tooltip/src/tooltip2.mjs +2 -2
  144. package/es/components/tooltip-v2/index.mjs +3 -3
  145. package/es/components/tooltip-v2/src/arrow.mjs +22 -38
  146. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  147. package/es/components/tooltip-v2/src/arrow2.mjs +38 -22
  148. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  149. package/es/components/tooltip-v2/src/tooltip.mjs +20 -73
  150. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  151. package/es/components/tooltip-v2/src/tooltip2.mjs +73 -20
  152. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  153. package/es/index.mjs +26 -26
  154. package/lib/components/affix/index.js +2 -2
  155. package/lib/components/affix/src/affix.js +114 -24
  156. package/lib/components/affix/src/affix.js.map +1 -1
  157. package/lib/components/affix/src/affix2.js +24 -114
  158. package/lib/components/affix/src/affix2.js.map +1 -1
  159. package/lib/components/autocomplete/index.js +2 -2
  160. package/lib/components/autocomplete/src/autocomplete.js +324 -67
  161. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  162. package/lib/components/autocomplete/src/autocomplete2.js +67 -324
  163. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  164. package/lib/components/backtop/index.js +2 -2
  165. package/lib/components/backtop/src/backtop.js +100 -22
  166. package/lib/components/backtop/src/backtop.js.map +1 -1
  167. package/lib/components/backtop/src/backtop2.js +22 -100
  168. package/lib/components/backtop/src/backtop2.js.map +1 -1
  169. package/lib/components/breadcrumb/index.js +2 -2
  170. package/lib/components/breadcrumb/src/breadcrumb-item.js +11 -57
  171. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  172. package/lib/components/breadcrumb/src/breadcrumb-item2.js +57 -11
  173. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  174. package/lib/components/button/index.js +3 -3
  175. package/lib/components/button/src/button-group.js +5 -30
  176. package/lib/components/button/src/button-group.js.map +1 -1
  177. package/lib/components/button/src/button-group2.js +30 -5
  178. package/lib/components/button/src/button-group2.js.map +1 -1
  179. package/lib/components/button/src/button.js +106 -54
  180. package/lib/components/button/src/button.js.map +1 -1
  181. package/lib/components/button/src/button2.js +54 -106
  182. package/lib/components/button/src/button2.js.map +1 -1
  183. package/lib/components/carousel/index.js +2 -2
  184. package/lib/components/carousel/src/carousel.js +49 -319
  185. package/lib/components/carousel/src/carousel.js.map +1 -1
  186. package/lib/components/carousel/src/carousel2.js +319 -49
  187. package/lib/components/carousel/src/carousel2.js.map +1 -1
  188. package/lib/components/dialog/index.js +2 -2
  189. package/lib/components/dialog/src/dialog.js +113 -71
  190. package/lib/components/dialog/src/dialog.js.map +1 -1
  191. package/lib/components/dialog/src/dialog2.js +71 -113
  192. package/lib/components/dialog/src/dialog2.js.map +1 -1
  193. package/lib/components/drawer/index.js +2 -2
  194. package/lib/components/drawer/src/drawer.js +22 -126
  195. package/lib/components/drawer/src/drawer.js.map +1 -1
  196. package/lib/components/drawer/src/drawer2.js +126 -22
  197. package/lib/components/drawer/src/drawer2.js.map +1 -1
  198. package/lib/components/empty/index.js +2 -2
  199. package/lib/components/empty/src/empty.js +11 -56
  200. package/lib/components/empty/src/empty.js.map +1 -1
  201. package/lib/components/empty/src/empty2.js +56 -11
  202. package/lib/components/empty/src/empty2.js.map +1 -1
  203. package/lib/components/form/index.js +2 -2
  204. package/lib/components/form/src/form-item.js +44 -276
  205. package/lib/components/form/src/form-item.js.map +1 -1
  206. package/lib/components/form/src/form-item2.js +276 -44
  207. package/lib/components/form/src/form-item2.js.map +1 -1
  208. package/lib/components/icon/index.js +2 -2
  209. package/lib/components/icon/src/icon.js +35 -8
  210. package/lib/components/icon/src/icon.js.map +1 -1
  211. package/lib/components/icon/src/icon2.js +8 -35
  212. package/lib/components/icon/src/icon2.js.map +1 -1
  213. package/lib/components/index.js +26 -26
  214. package/lib/components/input/index.js +2 -2
  215. package/lib/components/input/src/input.js +92 -432
  216. package/lib/components/input/src/input.js.map +1 -1
  217. package/lib/components/input/src/input2.js +432 -92
  218. package/lib/components/input/src/input2.js.map +1 -1
  219. package/lib/components/input-number/index.js +2 -2
  220. package/lib/components/input-number/src/input-number.js +284 -54
  221. package/lib/components/input-number/src/input-number.js.map +1 -1
  222. package/lib/components/input-number/src/input-number2.js +54 -284
  223. package/lib/components/input-number/src/input-number2.js.map +1 -1
  224. package/lib/components/link/index.js +2 -2
  225. package/lib/components/link/src/link.js +49 -23
  226. package/lib/components/link/src/link.js.map +1 -1
  227. package/lib/components/link/src/link2.js +23 -49
  228. package/lib/components/link/src/link2.js.map +1 -1
  229. package/lib/components/menu/index.js +2 -2
  230. package/lib/components/menu/src/menu-item-group.js +4 -51
  231. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  232. package/lib/components/menu/src/menu-item-group2.js +51 -4
  233. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  234. package/lib/components/page-header/index.js +2 -2
  235. package/lib/components/page-header/src/page-header.js +60 -18
  236. package/lib/components/page-header/src/page-header.js.map +1 -1
  237. package/lib/components/page-header/src/page-header2.js +18 -60
  238. package/lib/components/page-header/src/page-header2.js.map +1 -1
  239. package/lib/components/popconfirm/index.js +2 -2
  240. package/lib/components/popconfirm/src/popconfirm.js +52 -119
  241. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  242. package/lib/components/popconfirm/src/popconfirm2.js +119 -52
  243. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  244. package/lib/components/popper/index.js +2 -2
  245. package/lib/components/popper/src/arrow.js +37 -7
  246. package/lib/components/popper/src/arrow.js.map +1 -1
  247. package/lib/components/popper/src/arrow2.js +7 -37
  248. package/lib/components/popper/src/arrow2.js.map +1 -1
  249. package/lib/components/progress/index.js +2 -2
  250. package/lib/components/progress/src/progress.js +230 -57
  251. package/lib/components/progress/src/progress.js.map +1 -1
  252. package/lib/components/progress/src/progress2.js +57 -230
  253. package/lib/components/progress/src/progress2.js.map +1 -1
  254. package/lib/components/radio/index.js +2 -2
  255. package/lib/components/radio/src/radio-group.js +21 -84
  256. package/lib/components/radio/src/radio-group.js.map +1 -1
  257. package/lib/components/radio/src/radio-group2.js +84 -21
  258. package/lib/components/radio/src/radio-group2.js.map +1 -1
  259. package/lib/components/rate/index.js +2 -2
  260. package/lib/components/rate/src/rate.js +239 -89
  261. package/lib/components/rate/src/rate.js.map +1 -1
  262. package/lib/components/rate/src/rate2.js +89 -239
  263. package/lib/components/rate/src/rate2.js.map +1 -1
  264. package/lib/components/skeleton/index.js +2 -2
  265. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  266. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  267. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  268. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  269. package/lib/components/skeleton/src/skeleton.js +1 -1
  270. package/lib/components/switch/index.js +2 -2
  271. package/lib/components/switch/src/switch.js +249 -87
  272. package/lib/components/switch/src/switch.js.map +1 -1
  273. package/lib/components/switch/src/switch2.js +87 -249
  274. package/lib/components/switch/src/switch2.js.map +1 -1
  275. package/lib/components/tabs/index.js +3 -3
  276. package/lib/components/tabs/src/tab-bar.js +76 -7
  277. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  278. package/lib/components/tabs/src/tab-bar2.js +7 -76
  279. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  280. package/lib/components/tabs/src/tab-nav.js +1 -1
  281. package/lib/components/tabs/src/tab-pane.js +60 -14
  282. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  283. package/lib/components/tabs/src/tab-pane2.js +14 -60
  284. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  285. package/lib/components/teleport/index.js +2 -2
  286. package/lib/components/teleport/src/teleport.js +18 -43
  287. package/lib/components/teleport/src/teleport.js.map +1 -1
  288. package/lib/components/teleport/src/teleport2.js +43 -18
  289. package/lib/components/teleport/src/teleport2.js.map +1 -1
  290. package/lib/components/tooltip/src/tooltip2.js +2 -2
  291. package/lib/components/tooltip-v2/index.js +3 -3
  292. package/lib/components/tooltip-v2/src/arrow.js +23 -38
  293. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  294. package/lib/components/tooltip-v2/src/arrow2.js +38 -23
  295. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  296. package/lib/components/tooltip-v2/src/tooltip.js +20 -73
  297. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  298. package/lib/components/tooltip-v2/src/tooltip2.js +73 -20
  299. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  300. package/lib/index.js +26 -26
  301. package/package.json +1 -1
  302. package/web-types.json +1 -1
@@ -2,444 +2,104 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var core = require('@vueuse/core');
7
- var lodashUnified = require('lodash-unified');
8
- var index$4 = require('../../icon/index.js');
9
- var iconsVue = require('@element-plus/icons-vue');
5
+ var shared = require('@vue/shared');
10
6
  require('../../../utils/index.js');
11
- require('../../../hooks/index.js');
12
7
  require('../../../constants/index.js');
13
- var utils = require('./utils.js');
14
- var input = require('./input2.js');
15
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
16
- var index = require('../../../hooks/use-attrs/index.js');
17
- var index$1 = require('../../../hooks/use-form-item/index.js');
18
- var index$2 = require('../../../hooks/use-common-props/index.js');
19
- var index$3 = require('../../../hooks/use-namespace/index.js');
8
+ require('../../../hooks/index.js');
9
+ var props = require('../../../utils/vue/props.js');
10
+ var index = require('../../../hooks/use-common-props/index.js');
20
11
  var icon = require('../../../utils/vue/icon.js');
21
- var shared = require('@vue/shared');
12
+ var typescript = require('../../../utils/typescript.js');
22
13
  var event = require('../../../constants/event.js');
23
- var i18n = require('../../../utils/i18n.js');
24
- var error = require('../../../utils/error.js');
25
14
 
26
- const _hoisted_1 = ["type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder"];
27
- const _hoisted_2 = ["tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder"];
28
- const __default__ = {
29
- name: "ElInput",
30
- inheritAttrs: false
31
- };
32
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
33
- ...__default__,
34
- props: input.inputProps,
35
- emits: input.inputEmits,
36
- setup(__props, { expose, emit }) {
37
- const props = __props;
38
- const PENDANT_MAP = {
39
- suffix: "append",
40
- prefix: "prepend"
41
- };
42
- const instance = vue.getCurrentInstance();
43
- const rawAttrs = vue.useAttrs();
44
- const slots = vue.useSlots();
45
- const attrs = index.useAttrs();
46
- const { form, formItem } = index$1.useFormItem();
47
- const inputSize = index$2.useSize();
48
- const inputDisabled = index$2.useDisabled();
49
- const nsInput = index$3.useNamespace("input");
50
- const nsTextarea = index$3.useNamespace("textarea");
51
- const input = vue.shallowRef();
52
- const textarea = vue.shallowRef();
53
- const focused = vue.ref(false);
54
- const hovering = vue.ref(false);
55
- const isComposing = vue.ref(false);
56
- const passwordVisible = vue.ref(false);
57
- const textareaCalcStyle = vue.shallowRef(props.inputStyle);
58
- const _ref = vue.computed(() => input.value || textarea.value);
59
- const needStatusIcon = vue.computed(() => {
60
- var _a;
61
- return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
62
- });
63
- const validateState = vue.computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
64
- const validateIcon = vue.computed(() => icon.ValidateComponentsMap[validateState.value]);
65
- const passwordIcon = vue.computed(() => passwordVisible.value ? iconsVue.View : iconsVue.Hide);
66
- const containerStyle = vue.computed(() => [
67
- rawAttrs.style,
68
- props.inputStyle
69
- ]);
70
- const textareaStyle = vue.computed(() => [
71
- props.inputStyle,
72
- textareaCalcStyle.value,
73
- { resize: props.resize }
74
- ]);
75
- const nativeInputValue = vue.computed(() => lodashUnified.isNil(props.modelValue) ? "" : String(props.modelValue));
76
- const showClear = vue.computed(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
77
- const showPwdVisible = vue.computed(() => props.showPassword && !inputDisabled.value && !props.readonly && (!!nativeInputValue.value || focused.value));
78
- const isWordLimitVisible = vue.computed(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
79
- const textLength = vue.computed(() => Array.from(nativeInputValue.value).length);
80
- const inputExceed = vue.computed(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
81
- const suffixVisible = vue.computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
82
- const resizeTextarea = () => {
83
- const { type, autosize } = props;
84
- if (!core.isClient || type !== "textarea")
85
- return;
86
- if (autosize) {
87
- const minRows = shared.isObject(autosize) ? autosize.minRows : void 0;
88
- const maxRows = shared.isObject(autosize) ? autosize.maxRows : void 0;
89
- textareaCalcStyle.value = {
90
- ...utils.calcTextareaHeight(textarea.value, minRows, maxRows)
91
- };
92
- } else {
93
- textareaCalcStyle.value = {
94
- minHeight: utils.calcTextareaHeight(textarea.value).minHeight
95
- };
96
- }
97
- };
98
- const setNativeInputValue = () => {
99
- const input2 = _ref.value;
100
- if (!input2 || input2.value === nativeInputValue.value)
101
- return;
102
- input2.value = nativeInputValue.value;
103
- };
104
- const calcIconOffset = (place) => {
105
- const { el } = instance.vnode;
106
- if (!el)
107
- return;
108
- const elList = Array.from(el.querySelectorAll(`.${nsInput.e(place)}`));
109
- const target = elList.find((item) => item.parentNode === el);
110
- if (!target)
111
- return;
112
- const pendant = PENDANT_MAP[place];
113
- if (slots[pendant]) {
114
- target.style.transform = `translateX(${place === "suffix" ? "-" : ""}${el.querySelector(`.${nsInput.be("group", pendant)}`).offsetWidth}px)`;
115
- } else {
116
- target.removeAttribute("style");
117
- }
118
- };
119
- const updateIconOffset = () => {
120
- calcIconOffset("prefix");
121
- calcIconOffset("suffix");
122
- };
123
- const handleInput = async (event$1) => {
124
- const { value } = event$1.target;
125
- if (isComposing.value)
126
- return;
127
- if (value === nativeInputValue.value)
128
- return;
129
- emit(event.UPDATE_MODEL_EVENT, value);
130
- emit("input", value);
131
- await vue.nextTick();
132
- setNativeInputValue();
133
- };
134
- const handleChange = (event) => {
135
- emit("change", event.target.value);
136
- };
137
- const handleCompositionStart = (event) => {
138
- emit("compositionstart", event);
139
- isComposing.value = true;
140
- };
141
- const handleCompositionUpdate = (event) => {
142
- var _a;
143
- emit("compositionupdate", event);
144
- const text = (_a = event.target) == null ? void 0 : _a.value;
145
- const lastCharacter = text[text.length - 1] || "";
146
- isComposing.value = !i18n.isKorean(lastCharacter);
147
- };
148
- const handleCompositionEnd = (event) => {
149
- emit("compositionend", event);
150
- if (isComposing.value) {
151
- isComposing.value = false;
152
- handleInput(event);
153
- }
154
- };
155
- const handlePasswordVisible = () => {
156
- passwordVisible.value = !passwordVisible.value;
157
- focus();
158
- };
159
- const focus = async () => {
160
- var _a;
161
- await vue.nextTick();
162
- (_a = _ref.value) == null ? void 0 : _a.focus();
163
- };
164
- const blur = () => {
165
- var _a;
166
- return (_a = _ref.value) == null ? void 0 : _a.blur();
167
- };
168
- const handleFocus = (event) => {
169
- focused.value = true;
170
- emit("focus", event);
171
- };
172
- const handleBlur = (event) => {
173
- var _a;
174
- focused.value = false;
175
- emit("blur", event);
176
- if (props.validateEvent) {
177
- (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => error.debugWarn(err));
178
- }
179
- };
180
- const handleMouseLeave = (evt) => {
181
- hovering.value = false;
182
- emit("mouseleave", evt);
183
- };
184
- const handleMouseEnter = (evt) => {
185
- hovering.value = true;
186
- emit("mouseenter", evt);
187
- };
188
- const handleKeydown = (evt) => {
189
- emit("keydown", evt);
190
- };
191
- const select = () => {
192
- var _a;
193
- (_a = _ref.value) == null ? void 0 : _a.select();
194
- };
195
- const clear = () => {
196
- emit(event.UPDATE_MODEL_EVENT, "");
197
- emit("change", "");
198
- emit("clear");
199
- emit("input", "");
200
- };
201
- vue.watch(() => props.modelValue, () => {
202
- var _a;
203
- vue.nextTick(() => resizeTextarea());
204
- if (props.validateEvent) {
205
- (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => error.debugWarn(err));
206
- }
207
- });
208
- vue.watch(nativeInputValue, () => setNativeInputValue());
209
- vue.watch(() => props.type, async () => {
210
- await vue.nextTick();
211
- setNativeInputValue();
212
- resizeTextarea();
213
- updateIconOffset();
214
- });
215
- const innerSuffixRef = vue.ref();
216
- const innerPrefixRef = vue.ref();
217
- const inputStyleInner = vue.ref({});
218
- const getSuffixOrPrefixWidth = (slotElm, defaultVal) => {
219
- if (slotElm.value) {
220
- const slotElmWidth = slotElm.value.offsetWidth;
221
- return slotElmWidth > 0 ? slotElmWidth + 16 : defaultVal;
222
- }
223
- return defaultVal;
224
- };
225
- const setInputPadding = () => {
226
- inputStyleInner.value = {
227
- paddingRight: `${getSuffixOrPrefixWidth(innerSuffixRef, 0)}px`,
228
- paddingLeft: `${getSuffixOrPrefixWidth(innerPrefixRef, 11)}px`,
229
- ...props.inputStyle
230
- };
231
- };
232
- vue.watch(showClear, () => {
233
- vue.nextTick(() => {
234
- setInputPadding();
235
- });
236
- });
237
- vue.onMounted(async () => {
238
- setInputPadding();
239
- setNativeInputValue();
240
- updateIconOffset();
241
- await vue.nextTick();
242
- resizeTextarea();
243
- });
244
- vue.onUpdated(async () => {
245
- await vue.nextTick();
246
- updateIconOffset();
247
- });
248
- expose({
249
- input,
250
- textarea,
251
- ref: _ref,
252
- textareaStyle,
253
- autosize: vue.toRef(props, "autosize"),
254
- focus,
255
- blur,
256
- select,
257
- clear,
258
- resizeTextarea
259
- });
260
- return (_ctx, _cache) => {
261
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
262
- class: vue.normalizeClass([
263
- _ctx.type === "textarea" ? vue.unref(nsTextarea).b() : vue.unref(nsInput).b(),
264
- vue.unref(nsInput).m(vue.unref(inputSize)),
265
- vue.unref(nsInput).is("disabled", vue.unref(inputDisabled)),
266
- vue.unref(nsInput).is("exceed", vue.unref(inputExceed)),
267
- {
268
- [vue.unref(nsInput).b("group")]: _ctx.$slots.prepend || _ctx.$slots.append,
269
- [vue.unref(nsInput).bm("group", "append")]: _ctx.$slots.append,
270
- [vue.unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend,
271
- [vue.unref(nsInput).m("prefix")]: _ctx.$slots.prefix || _ctx.prefixIcon,
272
- [vue.unref(nsInput).m("suffix")]: _ctx.$slots.suffix || _ctx.suffixIcon || _ctx.clearable || _ctx.showPassword,
273
- [vue.unref(nsInput).m("suffix--password-clear")]: vue.unref(showClear) && vue.unref(showPwdVisible)
274
- },
275
- _ctx.$attrs.class
276
- ]),
277
- style: vue.normalizeStyle(vue.unref(containerStyle)),
278
- onMouseenter: handleMouseEnter,
279
- onMouseleave: handleMouseLeave
280
- }, [
281
- vue.createCommentVNode(" input "),
282
- _ctx.type !== "textarea" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
283
- vue.createCommentVNode(" prepend slot "),
284
- _ctx.$slots.prepend ? (vue.openBlock(), vue.createElementBlock("div", {
285
- key: 0,
286
- class: vue.normalizeClass(vue.unref(nsInput).be("group", "prepend"))
287
- }, [
288
- vue.renderSlot(_ctx.$slots, "prepend")
289
- ], 2)) : vue.createCommentVNode("v-if", true),
290
- vue.createElementVNode("input", vue.mergeProps({
291
- ref_key: "input",
292
- ref: input,
293
- class: vue.unref(nsInput).e("inner")
294
- }, vue.unref(attrs), {
295
- type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
296
- disabled: vue.unref(inputDisabled),
297
- readonly: _ctx.readonly,
298
- autocomplete: _ctx.autocomplete,
299
- tabindex: _ctx.tabindex,
300
- "aria-label": _ctx.label,
301
- placeholder: _ctx.placeholder,
302
- style: inputStyleInner.value,
303
- onCompositionstart: handleCompositionStart,
304
- onCompositionupdate: handleCompositionUpdate,
305
- onCompositionend: handleCompositionEnd,
306
- onInput: handleInput,
307
- onFocus: handleFocus,
308
- onBlur: handleBlur,
309
- onChange: handleChange,
310
- onKeydown: handleKeydown
311
- }), null, 16, _hoisted_1),
312
- vue.createCommentVNode(" prefix slot "),
313
- _ctx.$slots.prefix || _ctx.prefixIcon ? (vue.openBlock(), vue.createElementBlock("span", {
314
- key: 1,
315
- class: vue.normalizeClass(vue.unref(nsInput).e("prefix"))
316
- }, [
317
- vue.createElementVNode("span", {
318
- ref_key: "innerPrefixRef",
319
- ref: innerPrefixRef,
320
- class: vue.normalizeClass(vue.unref(nsInput).e("prefix-inner"))
321
- }, [
322
- vue.renderSlot(_ctx.$slots, "prefix"),
323
- _ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), {
324
- key: 0,
325
- class: vue.normalizeClass(vue.unref(nsInput).e("icon"))
326
- }, {
327
- default: vue.withCtx(() => [
328
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prefixIcon)))
329
- ]),
330
- _: 1
331
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
332
- ], 2)
333
- ], 2)) : vue.createCommentVNode("v-if", true),
334
- vue.createCommentVNode(" suffix slot "),
335
- vue.unref(suffixVisible) ? (vue.openBlock(), vue.createElementBlock("span", {
336
- key: 2,
337
- class: vue.normalizeClass(vue.unref(nsInput).e("suffix"))
338
- }, [
339
- vue.createElementVNode("span", {
340
- ref_key: "innerSuffixRef",
341
- ref: innerSuffixRef,
342
- class: vue.normalizeClass(vue.unref(nsInput).e("suffix-inner"))
343
- }, [
344
- !vue.unref(showClear) || !vue.unref(showPwdVisible) || !vue.unref(isWordLimitVisible) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
345
- vue.renderSlot(_ctx.$slots, "suffix"),
346
- _ctx.suffixIcon ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), {
347
- key: 0,
348
- class: vue.normalizeClass(vue.unref(nsInput).e("icon"))
349
- }, {
350
- default: vue.withCtx(() => [
351
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.suffixIcon)))
352
- ]),
353
- _: 1
354
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
355
- ], 64)) : vue.createCommentVNode("v-if", true),
356
- vue.unref(showClear) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), {
357
- key: 1,
358
- class: vue.normalizeClass([vue.unref(nsInput).e("icon"), vue.unref(nsInput).e("clear")]),
359
- onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(() => {
360
- }, ["prevent"])),
361
- onClick: clear
362
- }, {
363
- default: vue.withCtx(() => [
364
- vue.createVNode(vue.unref(iconsVue.CircleClose))
365
- ]),
366
- _: 1
367
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
368
- vue.unref(showPwdVisible) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), {
369
- key: 2,
370
- class: vue.normalizeClass([vue.unref(nsInput).e("icon"), vue.unref(nsInput).e("clear")]),
371
- onClick: handlePasswordVisible
372
- }, {
373
- default: vue.withCtx(() => [
374
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(passwordIcon))))
375
- ]),
376
- _: 1
377
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
378
- vue.unref(isWordLimitVisible) ? (vue.openBlock(), vue.createElementBlock("span", {
379
- key: 3,
380
- class: vue.normalizeClass(vue.unref(nsInput).e("count"))
381
- }, [
382
- vue.createElementVNode("span", {
383
- class: vue.normalizeClass(vue.unref(nsInput).e("count-inner"))
384
- }, vue.toDisplayString(vue.unref(textLength)) + " / " + vue.toDisplayString(vue.unref(attrs).maxlength), 3)
385
- ], 2)) : vue.createCommentVNode("v-if", true)
386
- ], 2),
387
- vue.unref(validateState) && vue.unref(validateIcon) && vue.unref(needStatusIcon) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElIcon), {
388
- key: 0,
389
- class: vue.normalizeClass([
390
- vue.unref(nsInput).e("icon"),
391
- vue.unref(nsInput).e("validateIcon"),
392
- vue.unref(nsInput).is("loading", vue.unref(validateState) === "validating")
393
- ])
394
- }, {
395
- default: vue.withCtx(() => [
396
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(validateIcon))))
397
- ]),
398
- _: 1
399
- }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
400
- ], 2)) : vue.createCommentVNode("v-if", true),
401
- vue.createCommentVNode(" append slot "),
402
- _ctx.$slots.append ? (vue.openBlock(), vue.createElementBlock("div", {
403
- key: 3,
404
- class: vue.normalizeClass(vue.unref(nsInput).be("group", "append"))
405
- }, [
406
- vue.renderSlot(_ctx.$slots, "append")
407
- ], 2)) : vue.createCommentVNode("v-if", true)
408
- ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
409
- vue.createCommentVNode(" textarea "),
410
- vue.createElementVNode("textarea", vue.mergeProps({
411
- ref_key: "textarea",
412
- ref: textarea,
413
- class: vue.unref(nsTextarea).e("inner")
414
- }, vue.unref(attrs), {
415
- tabindex: _ctx.tabindex,
416
- disabled: vue.unref(inputDisabled),
417
- readonly: _ctx.readonly,
418
- autocomplete: _ctx.autocomplete,
419
- style: vue.unref(textareaStyle),
420
- "aria-label": _ctx.label,
421
- placeholder: _ctx.placeholder,
422
- onCompositionstart: handleCompositionStart,
423
- onCompositionupdate: handleCompositionUpdate,
424
- onCompositionend: handleCompositionEnd,
425
- onInput: handleInput,
426
- onFocus: handleFocus,
427
- onBlur: handleBlur,
428
- onChange: handleChange,
429
- onKeydown: handleKeydown
430
- }), null, 16, _hoisted_2),
431
- vue.unref(isWordLimitVisible) ? (vue.openBlock(), vue.createElementBlock("span", {
432
- key: 0,
433
- class: vue.normalizeClass(vue.unref(nsInput).e("count"))
434
- }, vue.toDisplayString(vue.unref(textLength)) + " / " + vue.toDisplayString(vue.unref(attrs).maxlength), 3)) : vue.createCommentVNode("v-if", true)
435
- ], 64))
436
- ], 38)), [
437
- [vue.vShow, _ctx.type !== "hidden"]
438
- ]);
439
- };
15
+ const inputProps = props.buildProps({
16
+ size: index.useSizeProp,
17
+ disabled: Boolean,
18
+ modelValue: {
19
+ type: props.definePropType([
20
+ String,
21
+ Number,
22
+ Object
23
+ ]),
24
+ default: ""
25
+ },
26
+ type: {
27
+ type: String,
28
+ default: "text"
29
+ },
30
+ resize: {
31
+ type: String,
32
+ values: ["none", "both", "horizontal", "vertical"]
33
+ },
34
+ autosize: {
35
+ type: props.definePropType([Boolean, Object]),
36
+ default: false
37
+ },
38
+ autocomplete: {
39
+ type: String,
40
+ default: "off"
41
+ },
42
+ placeholder: {
43
+ type: String
44
+ },
45
+ form: {
46
+ type: String,
47
+ default: ""
48
+ },
49
+ readonly: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ clearable: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ showPassword: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ showWordLimit: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ suffixIcon: {
66
+ type: icon.iconPropType,
67
+ default: ""
68
+ },
69
+ prefixIcon: {
70
+ type: icon.iconPropType,
71
+ default: ""
72
+ },
73
+ label: {
74
+ type: String
75
+ },
76
+ tabindex: {
77
+ type: [Number, String]
78
+ },
79
+ validateEvent: {
80
+ type: Boolean,
81
+ default: true
82
+ },
83
+ inputStyle: {
84
+ type: props.definePropType([Object, Array, String]),
85
+ default: () => typescript.mutable({})
440
86
  }
441
87
  });
442
- var Input = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/input/src/input.vue"]]);
88
+ const inputEmits = {
89
+ [event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
90
+ input: (value) => shared.isString(value),
91
+ change: (value) => shared.isString(value),
92
+ focus: (evt) => evt instanceof FocusEvent,
93
+ blur: (evt) => evt instanceof FocusEvent,
94
+ clear: () => true,
95
+ mouseleave: (evt) => evt instanceof MouseEvent,
96
+ mouseenter: (evt) => evt instanceof MouseEvent,
97
+ keydown: (evt) => evt instanceof Event,
98
+ compositionstart: (evt) => evt instanceof CompositionEvent,
99
+ compositionupdate: (evt) => evt instanceof CompositionEvent,
100
+ compositionend: (evt) => evt instanceof CompositionEvent
101
+ };
443
102
 
444
- exports["default"] = Input;
103
+ exports.inputEmits = inputEmits;
104
+ exports.inputProps = inputProps;
445
105
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n v-show=\"type !== 'hidden'\"\n :class=\"[\n type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize),\n nsInput.is('disabled', inputDisabled),\n nsInput.is('exceed', inputExceed),\n {\n [nsInput.b('group')]: $slots.prepend || $slots.append,\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n [nsInput.m('prefix')]: $slots.prefix || prefixIcon,\n [nsInput.m('suffix')]:\n $slots.suffix || suffixIcon || clearable || showPassword,\n [nsInput.m('suffix--password-clear')]: showClear && showPwdVisible,\n },\n $attrs.class,\n ]\"\n :style=\"containerStyle\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <!-- input -->\n <template v-if=\"type !== 'textarea'\">\n <!-- prepend slot -->\n <div v-if=\"$slots.prepend\" :class=\"nsInput.be('group', 'prepend')\">\n <slot name=\"prepend\" />\n </div>\n\n <input\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"label\"\n :placeholder=\"placeholder\"\n :style=\"inputStyleInner\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span ref=\"innerPrefixRef\" :class=\"nsInput.e('prefix-inner')\">\n <slot name=\"prefix\" />\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </span>\n </span>\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span ref=\"innerSuffixRef\" :class=\"nsInput.e('suffix-inner')\">\n <template v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\">\n <slot name=\"suffix\" />\n <el-icon v-if=\"suffixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"suffixIcon\" />\n </el-icon>\n </template>\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n @mousedown.prevent\n @click=\"clear\"\n >\n <circle-close />\n </el-icon>\n <el-icon\n v-if=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n @click=\"handlePasswordVisible\"\n >\n <component :is=\"passwordIcon\" />\n </el-icon>\n <span v-if=\"isWordLimitVisible\" :class=\"nsInput.e('count')\">\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ attrs.maxlength }}\n </span>\n </span>\n </span>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </span>\n\n <!-- append slot -->\n <div v-if=\"$slots.append\" :class=\"nsInput.be('group', 'append')\">\n <slot name=\"append\" />\n </div>\n </template>\n\n <!-- textarea -->\n <template v-else>\n <textarea\n ref=\"textarea\"\n :class=\"nsTextarea.e('inner')\"\n v-bind=\"attrs\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"label\"\n :placeholder=\"placeholder\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n <span v-if=\"isWordLimitVisible\" :class=\"nsInput.e('count')\">\n {{ textLength }} / {{ attrs.maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n getCurrentInstance,\n nextTick,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n CircleClose,\n Hide as IconHide,\n View as IconView,\n} from '@element-plus/icons-vue'\nimport {\n ValidateComponentsMap,\n debugWarn,\n isKorean,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useDisabled,\n useFormItem,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { calcTextareaHeight } from './utils'\nimport { inputEmits, inputProps } from './input'\nimport type { CSSProperties, Ref, StyleValue } from 'vue'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\nconst PENDANT_MAP = {\n suffix: 'append',\n prefix: 'prepend',\n} as const\n\ndefineOptions({\n name: 'ElInput',\n inheritAttrs: false,\n})\nconst props = defineProps(inputProps)\nconst emit = defineEmits(inputEmits)\n\nconst instance = getCurrentInstance()!\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst attrs = useAttrs()\nconst { form, formItem } = useFormItem()\nconst inputSize = useSize()\nconst inputDisabled = useDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst focused = ref(false)\nconst hovering = ref(false)\nconst isComposing = ref(false)\nconst passwordVisible = ref(false)\nconst textareaCalcStyle = shallowRef(props.inputStyle)\n\nconst _ref = computed(() => input.value || textarea.value)\n\nconst needStatusIcon = computed(() => form?.statusIcon ?? false)\nconst validateState = computed(() => formItem?.validateState || '')\nconst validateIcon = computed(() => ValidateComponentsMap[validateState.value])\nconst passwordIcon = computed(() =>\n passwordVisible.value ? IconView : IconHide\n)\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n props.inputStyle,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst showClear = computed(\n () =>\n props.clearable &&\n !inputDisabled.value &&\n !props.readonly &&\n !!nativeInputValue.value &&\n (focused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () =>\n props.showPassword &&\n !inputDisabled.value &&\n !props.readonly &&\n (!!nativeInputValue.value || focused.value)\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!attrs.value.maxlength &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => Array.from(nativeInputValue.value).length)\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value &&\n textLength.value > Number(attrs.value.maxlength)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n showClear.value ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea') return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n textareaCalcStyle.value = {\n ...calcTextareaHeight(textarea.value!, minRows, maxRows),\n }\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value!).minHeight,\n }\n }\n}\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n if (!input || input.value === nativeInputValue.value) return\n input.value = nativeInputValue.value\n}\n\nconst calcIconOffset = (place: 'prefix' | 'suffix') => {\n const { el } = instance.vnode\n if (!el) return\n const elList = Array.from(\n (el as Element).querySelectorAll<HTMLSpanElement>(`.${nsInput.e(place)}`)\n )\n const target = elList.find((item) => item.parentNode === el)\n if (!target) return\n\n const pendant = PENDANT_MAP[place]\n\n if (slots[pendant]) {\n target.style.transform = `translateX(${place === 'suffix' ? '-' : ''}${\n el.querySelector(`.${nsInput.be('group', pendant)}`).offsetWidth\n }px)`\n } else {\n target.removeAttribute('style')\n }\n}\n\nconst updateIconOffset = () => {\n calcIconOffset('prefix')\n calcIconOffset('suffix')\n}\n\nconst handleInput = async (event: Event) => {\n const { value } = event.target as TargetElement\n\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n // hack for https://github.com/ElemeFE/element/issues/8548\n // should remove the following line when we don't support IE\n if (value === nativeInputValue.value) return\n\n emit(UPDATE_MODEL_EVENT, value)\n emit('input', value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n setNativeInputValue()\n}\n\nconst handleChange = (event: Event) => {\n emit('change', (event.target as TargetElement).value)\n}\n\nconst handleCompositionStart = (event: CompositionEvent) => {\n emit('compositionstart', event)\n isComposing.value = true\n}\n\nconst handleCompositionUpdate = (event: CompositionEvent) => {\n emit('compositionupdate', event)\n const text = (event.target as HTMLInputElement)?.value\n const lastCharacter = text[text.length - 1] || ''\n isComposing.value = !isKorean(lastCharacter)\n}\n\nconst handleCompositionEnd = (event: CompositionEvent) => {\n emit('compositionend', event)\n if (isComposing.value) {\n isComposing.value = false\n handleInput(event)\n }\n}\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n focus()\n}\n\nconst focus = async () => {\n // see: https://github.com/ElemeFE/element/issues/18573\n await nextTick()\n _ref.value?.focus()\n}\n\nconst blur = () => _ref.value?.blur()\n\nconst handleFocus = (event: FocusEvent) => {\n focused.value = true\n emit('focus', event)\n}\n\nconst handleBlur = (event: FocusEvent) => {\n focused.value = false\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst handleMouseLeave = (evt: MouseEvent) => {\n hovering.value = false\n emit('mouseleave', evt)\n}\n\nconst handleMouseEnter = (evt: MouseEvent) => {\n hovering.value = true\n emit('mouseenter', evt)\n}\n\nconst handleKeydown = (evt: KeyboardEvent) => {\n emit('keydown', evt)\n}\n\nconst select = () => {\n _ref.value?.select()\n}\n\nconst clear = () => {\n emit(UPDATE_MODEL_EVENT, '')\n emit('change', '')\n emit('clear')\n emit('input', '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => resizeTextarea())\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\n// native input value is set explicitly\n// do not use v-model / :value in template\n// see: https://github.com/ElemeFE/element/issues/14521\nwatch(nativeInputValue, () => setNativeInputValue())\n\n// when change between <input> and <textarea>,\n// update DOM dependent value and styles\n// https://github.com/ElemeFE/element/issues/14857\nwatch(\n () => props.type,\n async () => {\n await nextTick()\n setNativeInputValue()\n resizeTextarea()\n updateIconOffset()\n }\n)\n\n// Get the widths of 'suffix' and 'prefix' to set the padding property of the input\n// https://github.com/element-plus/element-plus/issues/6464\nconst innerSuffixRef = ref<HTMLElement>()\nconst innerPrefixRef = ref<HTMLElement>()\nconst inputStyleInner = ref<CSSProperties>({})\nconst getSuffixOrPrefixWidth = (\n slotElm: Ref<HTMLElement>,\n defaultVal: number\n): number => {\n if (slotElm.value) {\n const slotElmWidth = (slotElm.value as HTMLElement).offsetWidth\n return slotElmWidth > 0 ? slotElmWidth + 16 : defaultVal\n }\n return defaultVal\n}\nconst setInputPadding = (): void => {\n // If the user sets 'padding', use the 'padding' set by the user\n inputStyleInner.value = {\n paddingRight: `${getSuffixOrPrefixWidth(innerSuffixRef, 0)}px`,\n paddingLeft: `${getSuffixOrPrefixWidth(innerPrefixRef, 11)}px`,\n ...props.inputStyle,\n }\n}\nwatch(showClear, () => {\n nextTick(() => {\n setInputPadding()\n })\n})\n\nonMounted(async () => {\n setInputPadding()\n setNativeInputValue()\n updateIconOffset()\n await nextTick()\n resizeTextarea()\n})\n\nonUpdated(async () => {\n await nextTick()\n updateIconOffset()\n})\n\ndefineExpose({\n /** @description HTML input element */\n input,\n /** @description HTML textarea element */\n textarea,\n /** @description HTML element, input or textarea */\n ref: _ref,\n /** @description style of textarea. */\n textareaStyle,\n\n /** @description from props (used on unit test) */\n autosize: toRef(props, 'autosize'),\n\n /** @description HTML input element native method */\n focus,\n /** @description HTML input element native method */\n blur,\n /** @description HTML input element native method */\n select,\n /** @description clear input value */\n clear,\n /** @description resize textarea. */\n resizeTextarea,\n})\n</script>\n"],"names":["getCurrentInstance","useRawAttrs","useSlots","useAttrs","useFormItem","useSize","useDisabled","useNamespace","shallowRef","ref","computed","ValidateComponentsMap","IconView","IconHide","isNil","isClient","isObject","calcTextareaHeight","event","UPDATE_MODEL_EVENT","nextTick","isKorean","debugWarn","watch","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,IAAA,MAAA,WAAA,GAAA;AAAA,MACA,MAAA,EAAA,QAAA;AAAA,MACA,MAAA,EAAA,SAAA;AAAA,KACA,CAAA;AASA,IAAA,MAAA,WAAAA,sBAAA,EAAA,CAAA;AACA,IAAA,MAAA,WAAAC,YAAA,EAA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,eAAA,EAAA,CAAA;AACA,OAAA,CAAA,CAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAAI,aAAA,CAAA,YAAA;AAAA,MAEA,eAAA,EAAA,CAAA;AAAA,MAEA,mBAAA,EAAA,CAAA;AAAA,MAEA,gBAAA,EAAA,CAAA;AAAA,MAEA,MAAAJ,YAAA,EAAA,CAAA;AAAA,MAGA,cAAA,EAAA,CAAA;AAAA,KAGA,CAAA,CAAA;AAAA,IAEAK,aAAA,CAAA,YAAA;AAAA,MAEA,MAAAL,YAAA,EAAA,CAAA;AAAA,MAEA,gBAAA,EAAA,CAAA;AAAA,KAEA,CAAA,CAAA;AAAA,IACA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input.js","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { isString } from '@vue/shared'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n mutable,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport type Input from './input.vue'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\n\nexport type InputAutoSize = { minRows?: number; maxRows?: number } | boolean\n\nexport const inputProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n Object,\n ]),\n default: '',\n },\n type: {\n type: String,\n default: 'text',\n },\n resize: {\n type: String,\n values: ['none', 'both', 'horizontal', 'vertical'],\n },\n autosize: {\n type: definePropType<InputAutoSize>([Boolean, Object]),\n default: false,\n },\n autocomplete: {\n type: String,\n default: 'off',\n },\n placeholder: {\n type: String,\n },\n form: {\n type: String,\n default: '',\n },\n readonly: {\n type: Boolean,\n default: false,\n },\n clearable: {\n type: Boolean,\n default: false,\n },\n showPassword: {\n type: Boolean,\n default: false,\n },\n showWordLimit: {\n type: Boolean,\n default: false,\n },\n suffixIcon: {\n type: iconPropType,\n default: '',\n },\n prefixIcon: {\n type: iconPropType,\n default: '',\n },\n label: {\n type: String,\n },\n tabindex: {\n type: [Number, String],\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n inputStyle: {\n type: definePropType<StyleValue>([Object, Array, String]),\n default: () => mutable({} as const),\n },\n} as const)\nexport type InputProps = ExtractPropTypes<typeof inputProps>\n\nexport const inputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string) => isString(value),\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n mouseleave: (evt: MouseEvent) => evt instanceof MouseEvent,\n mouseenter: (evt: MouseEvent) => evt instanceof MouseEvent,\n // NOTE: when autofill by browser, the keydown event is instanceof Event, not KeyboardEvent\n // relative bug report https://github.com/element-plus/element-plus/issues/6665\n keydown: (evt: KeyboardEvent | Event) => evt instanceof Event,\n compositionstart: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n compositionupdate: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n compositionend: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n}\nexport type InputEmits = typeof inputEmits\n\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":["buildProps","useSizeProp","definePropType","iconPropType","mutable","UPDATE_MODEL_EVENT","isString"],"mappings":";;;;;;;;;;;;;;AASY,MAAC,UAAU,GAAGA,gBAAU,CAAC;AACrC,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,oBAAc,CAAC;AACz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