@element-plus/nightly 0.0.20260426 → 0.0.20260428

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 (442) hide show
  1. package/dist/index.full.js +121 -63
  2. package/dist/index.full.min.js +6 -6
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +6 -6
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +121 -63
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hi.js +1 -1
  92. package/dist/locale/hi.min.js +1 -1
  93. package/dist/locale/hi.min.mjs +1 -1
  94. package/dist/locale/hi.mjs +1 -1
  95. package/dist/locale/hr.js +1 -1
  96. package/dist/locale/hr.min.js +1 -1
  97. package/dist/locale/hr.min.mjs +1 -1
  98. package/dist/locale/hr.mjs +1 -1
  99. package/dist/locale/hu.js +1 -1
  100. package/dist/locale/hu.min.js +1 -1
  101. package/dist/locale/hu.min.mjs +1 -1
  102. package/dist/locale/hu.mjs +1 -1
  103. package/dist/locale/hy-am.js +1 -1
  104. package/dist/locale/hy-am.min.js +1 -1
  105. package/dist/locale/hy-am.min.mjs +1 -1
  106. package/dist/locale/hy-am.mjs +1 -1
  107. package/dist/locale/id.js +1 -1
  108. package/dist/locale/id.min.js +1 -1
  109. package/dist/locale/id.min.mjs +1 -1
  110. package/dist/locale/id.mjs +1 -1
  111. package/dist/locale/it.js +1 -1
  112. package/dist/locale/it.min.js +1 -1
  113. package/dist/locale/it.min.mjs +1 -1
  114. package/dist/locale/it.mjs +1 -1
  115. package/dist/locale/ja.js +1 -1
  116. package/dist/locale/ja.min.js +1 -1
  117. package/dist/locale/ja.min.mjs +1 -1
  118. package/dist/locale/ja.mjs +1 -1
  119. package/dist/locale/kk.js +1 -1
  120. package/dist/locale/kk.min.js +1 -1
  121. package/dist/locale/kk.min.mjs +1 -1
  122. package/dist/locale/kk.mjs +1 -1
  123. package/dist/locale/km.js +1 -1
  124. package/dist/locale/km.min.js +1 -1
  125. package/dist/locale/km.min.mjs +1 -1
  126. package/dist/locale/km.mjs +1 -1
  127. package/dist/locale/ko.js +1 -1
  128. package/dist/locale/ko.min.js +1 -1
  129. package/dist/locale/ko.min.mjs +1 -1
  130. package/dist/locale/ko.mjs +1 -1
  131. package/dist/locale/ku.js +1 -1
  132. package/dist/locale/ku.min.js +1 -1
  133. package/dist/locale/ku.min.mjs +1 -1
  134. package/dist/locale/ku.mjs +1 -1
  135. package/dist/locale/ky.js +1 -1
  136. package/dist/locale/ky.min.js +1 -1
  137. package/dist/locale/ky.min.mjs +1 -1
  138. package/dist/locale/ky.mjs +1 -1
  139. package/dist/locale/lo.js +1 -1
  140. package/dist/locale/lo.min.js +1 -1
  141. package/dist/locale/lo.min.mjs +1 -1
  142. package/dist/locale/lo.mjs +1 -1
  143. package/dist/locale/lt.js +1 -1
  144. package/dist/locale/lt.min.js +1 -1
  145. package/dist/locale/lt.min.mjs +1 -1
  146. package/dist/locale/lt.mjs +1 -1
  147. package/dist/locale/lv.js +1 -1
  148. package/dist/locale/lv.min.js +1 -1
  149. package/dist/locale/lv.min.mjs +1 -1
  150. package/dist/locale/lv.mjs +1 -1
  151. package/dist/locale/mg.js +1 -1
  152. package/dist/locale/mg.min.js +1 -1
  153. package/dist/locale/mg.min.mjs +1 -1
  154. package/dist/locale/mg.mjs +1 -1
  155. package/dist/locale/mn.js +1 -1
  156. package/dist/locale/mn.min.js +1 -1
  157. package/dist/locale/mn.min.mjs +1 -1
  158. package/dist/locale/mn.mjs +1 -1
  159. package/dist/locale/ms.js +1 -1
  160. package/dist/locale/ms.min.js +1 -1
  161. package/dist/locale/ms.min.mjs +1 -1
  162. package/dist/locale/ms.mjs +1 -1
  163. package/dist/locale/my.js +1 -1
  164. package/dist/locale/my.min.js +1 -1
  165. package/dist/locale/my.min.mjs +1 -1
  166. package/dist/locale/my.mjs +1 -1
  167. package/dist/locale/nb-no.js +1 -1
  168. package/dist/locale/nb-no.min.js +1 -1
  169. package/dist/locale/nb-no.min.mjs +1 -1
  170. package/dist/locale/nb-no.mjs +1 -1
  171. package/dist/locale/nl.js +1 -1
  172. package/dist/locale/nl.min.js +1 -1
  173. package/dist/locale/nl.min.mjs +1 -1
  174. package/dist/locale/nl.mjs +1 -1
  175. package/dist/locale/no.js +1 -1
  176. package/dist/locale/no.min.js +1 -1
  177. package/dist/locale/no.min.mjs +1 -1
  178. package/dist/locale/no.mjs +1 -1
  179. package/dist/locale/pa.js +1 -1
  180. package/dist/locale/pa.min.js +1 -1
  181. package/dist/locale/pa.min.mjs +1 -1
  182. package/dist/locale/pa.mjs +1 -1
  183. package/dist/locale/pl.js +1 -1
  184. package/dist/locale/pl.min.js +1 -1
  185. package/dist/locale/pl.min.mjs +1 -1
  186. package/dist/locale/pl.mjs +1 -1
  187. package/dist/locale/pt-br.js +1 -1
  188. package/dist/locale/pt-br.min.js +1 -1
  189. package/dist/locale/pt-br.min.mjs +1 -1
  190. package/dist/locale/pt-br.mjs +1 -1
  191. package/dist/locale/pt.js +1 -1
  192. package/dist/locale/pt.min.js +1 -1
  193. package/dist/locale/pt.min.mjs +1 -1
  194. package/dist/locale/pt.mjs +1 -1
  195. package/dist/locale/ro.js +1 -1
  196. package/dist/locale/ro.min.js +1 -1
  197. package/dist/locale/ro.min.mjs +1 -1
  198. package/dist/locale/ro.mjs +1 -1
  199. package/dist/locale/ru.js +1 -1
  200. package/dist/locale/ru.min.js +1 -1
  201. package/dist/locale/ru.min.mjs +1 -1
  202. package/dist/locale/ru.mjs +1 -1
  203. package/dist/locale/sk.js +1 -1
  204. package/dist/locale/sk.min.js +1 -1
  205. package/dist/locale/sk.min.mjs +1 -1
  206. package/dist/locale/sk.mjs +1 -1
  207. package/dist/locale/sl.js +1 -1
  208. package/dist/locale/sl.min.js +1 -1
  209. package/dist/locale/sl.min.mjs +1 -1
  210. package/dist/locale/sl.mjs +1 -1
  211. package/dist/locale/sr.js +1 -1
  212. package/dist/locale/sr.min.js +1 -1
  213. package/dist/locale/sr.min.mjs +1 -1
  214. package/dist/locale/sr.mjs +1 -1
  215. package/dist/locale/sv.js +1 -1
  216. package/dist/locale/sv.min.js +1 -1
  217. package/dist/locale/sv.min.mjs +1 -1
  218. package/dist/locale/sv.mjs +1 -1
  219. package/dist/locale/sw.js +1 -1
  220. package/dist/locale/sw.min.js +1 -1
  221. package/dist/locale/sw.min.mjs +1 -1
  222. package/dist/locale/sw.mjs +1 -1
  223. package/dist/locale/ta.js +1 -1
  224. package/dist/locale/ta.min.js +1 -1
  225. package/dist/locale/ta.min.mjs +1 -1
  226. package/dist/locale/ta.mjs +1 -1
  227. package/dist/locale/te.js +1 -1
  228. package/dist/locale/te.min.js +1 -1
  229. package/dist/locale/te.min.mjs +1 -1
  230. package/dist/locale/te.mjs +1 -1
  231. package/dist/locale/th.js +1 -1
  232. package/dist/locale/th.min.js +1 -1
  233. package/dist/locale/th.min.mjs +1 -1
  234. package/dist/locale/th.mjs +1 -1
  235. package/dist/locale/tk.js +1 -1
  236. package/dist/locale/tk.min.js +1 -1
  237. package/dist/locale/tk.min.mjs +1 -1
  238. package/dist/locale/tk.mjs +1 -1
  239. package/dist/locale/tr.js +1 -1
  240. package/dist/locale/tr.min.js +1 -1
  241. package/dist/locale/tr.min.mjs +1 -1
  242. package/dist/locale/tr.mjs +1 -1
  243. package/dist/locale/ug-cn.js +1 -1
  244. package/dist/locale/ug-cn.min.js +1 -1
  245. package/dist/locale/ug-cn.min.mjs +1 -1
  246. package/dist/locale/ug-cn.mjs +1 -1
  247. package/dist/locale/uk.js +1 -1
  248. package/dist/locale/uk.min.js +1 -1
  249. package/dist/locale/uk.min.mjs +1 -1
  250. package/dist/locale/uk.mjs +1 -1
  251. package/dist/locale/uz-uz.js +1 -1
  252. package/dist/locale/uz-uz.min.js +1 -1
  253. package/dist/locale/uz-uz.min.mjs +1 -1
  254. package/dist/locale/uz-uz.mjs +1 -1
  255. package/dist/locale/vi.js +1 -1
  256. package/dist/locale/vi.min.js +1 -1
  257. package/dist/locale/vi.min.mjs +1 -1
  258. package/dist/locale/vi.mjs +1 -1
  259. package/dist/locale/zh-cn.js +1 -1
  260. package/dist/locale/zh-cn.min.js +1 -1
  261. package/dist/locale/zh-cn.min.mjs +1 -1
  262. package/dist/locale/zh-cn.mjs +1 -1
  263. package/dist/locale/zh-hk.js +1 -1
  264. package/dist/locale/zh-hk.min.js +1 -1
  265. package/dist/locale/zh-hk.min.mjs +1 -1
  266. package/dist/locale/zh-hk.mjs +1 -1
  267. package/dist/locale/zh-mo.js +1 -1
  268. package/dist/locale/zh-mo.min.js +1 -1
  269. package/dist/locale/zh-mo.min.mjs +1 -1
  270. package/dist/locale/zh-mo.mjs +1 -1
  271. package/dist/locale/zh-tw.js +1 -1
  272. package/dist/locale/zh-tw.min.js +1 -1
  273. package/dist/locale/zh-tw.min.mjs +1 -1
  274. package/dist/locale/zh-tw.mjs +1 -1
  275. package/es/components/autocomplete/src/autocomplete.d.ts +1 -6
  276. package/es/components/autocomplete/src/autocomplete.vue.d.ts +2 -2
  277. package/es/components/avatar/src/avatar-group-props.d.ts +3 -7
  278. package/es/components/avatar/src/avatar-group-props.mjs +9 -5
  279. package/es/components/avatar/src/avatar-group-props.mjs.map +1 -1
  280. package/es/components/avatar/src/avatar-group.d.ts +7 -13
  281. package/es/components/badge/src/badge.d.ts +2 -7
  282. package/es/components/badge/src/badge.mjs +9 -5
  283. package/es/components/badge/src/badge.mjs.map +1 -1
  284. package/es/components/card/src/card.mjs +2 -1
  285. package/es/components/card/src/card.mjs.map +1 -1
  286. package/es/components/cascader/src/cascader.d.ts +1 -6
  287. package/es/components/cascader/src/cascader.vue.d.ts +2 -2
  288. package/es/components/color-picker/src/color-picker.d.ts +1 -6
  289. package/es/components/color-picker/src/color-picker.vue.d.ts +2 -2
  290. package/es/components/color-picker-panel/src/color-picker-panel.d.ts +1 -6
  291. package/es/components/color-picker-panel/src/color-picker-panel.mjs +9 -5
  292. package/es/components/color-picker-panel/src/color-picker-panel.mjs.map +1 -1
  293. package/es/components/countdown/src/countdown.d.ts +2 -7
  294. package/es/components/countdown/src/countdown.mjs +9 -5
  295. package/es/components/countdown/src/countdown.mjs.map +1 -1
  296. package/es/components/date-picker/src/date-picker.d.ts +3 -12
  297. package/es/components/date-picker/src/props.d.ts +1 -6
  298. package/es/components/date-picker-panel/src/date-picker-panel.d.ts +2 -2
  299. package/es/components/drawer/src/drawer.vue.d.ts +1 -1
  300. package/es/components/dropdown/src/dropdown.d.ts +1 -6
  301. package/es/components/dropdown/src/dropdown.vue.d.ts +43 -48
  302. package/es/components/input/src/input.mjs +2 -1
  303. package/es/components/input/src/input.mjs.map +1 -1
  304. package/es/components/input/src/input.vue.d.ts +2 -2
  305. package/es/components/input/src/input.vue_vue_type_script_setup_true_lang.mjs +22 -5
  306. package/es/components/input/src/input.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  307. package/es/components/input/src/input2.mjs.map +1 -1
  308. package/es/components/input-tag/src/input-tag.vue.d.ts +2 -2
  309. package/es/components/mention/src/mention.d.ts +1 -6
  310. package/es/components/popover/src/popover.d.ts +1 -6
  311. package/es/components/popper/src/content.d.ts +4 -24
  312. package/es/components/popper/src/content.mjs +18 -10
  313. package/es/components/popper/src/content.mjs.map +1 -1
  314. package/es/components/roving-focus-group/src/roving-focus-group.d.ts +1 -6
  315. package/es/components/roving-focus-group/src/roving-focus-group.mjs +9 -5
  316. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  317. package/es/components/roving-focus-group/src/roving-focus-group.vue.d.ts +3 -12
  318. package/es/components/scrollbar/src/scrollbar.d.ts +1 -1
  319. package/es/components/scrollbar/src/scrollbar.mjs +6 -4
  320. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  321. package/es/components/segmented/index.d.ts +15 -1
  322. package/es/components/select/src/select.vue.d.ts +2 -2
  323. package/es/components/select-v2/src/defaults.d.ts +1 -6
  324. package/es/components/select-v2/src/select.vue.d.ts +4 -13
  325. package/es/components/space/src/space.mjs +2 -1
  326. package/es/components/space/src/space.mjs.map +1 -1
  327. package/es/components/statistic/src/statistic.d.ts +2 -7
  328. package/es/components/statistic/src/statistic.mjs +9 -5
  329. package/es/components/statistic/src/statistic.mjs.map +1 -1
  330. package/es/components/table/src/table/defaults.mjs +2 -1
  331. package/es/components/table/src/table/defaults.mjs.map +1 -1
  332. package/es/components/table/src/table-column/index.d.ts +20 -23
  333. package/es/components/table/src/table-header/index.d.ts +20 -23
  334. package/es/components/table/src/table.vue.d.ts +20 -23
  335. package/es/components/table-v2/src/cell.d.ts +2 -7
  336. package/es/components/table-v2/src/cell.mjs +9 -5
  337. package/es/components/table-v2/src/cell.mjs.map +1 -1
  338. package/es/components/time-picker/src/common/picker.vue.d.ts +5 -14
  339. package/es/components/time-picker/src/common/props.d.ts +1 -6
  340. package/es/components/time-picker/src/time-picker.d.ts +3 -12
  341. package/es/components/time-select/src/time-select.vue.d.ts +2 -2
  342. package/es/components/tooltip/src/content.d.ts +2 -12
  343. package/es/components/tooltip/src/tooltip.d.ts +2 -12
  344. package/es/components/tree/src/tree.vue.d.ts +20 -23
  345. package/es/components/virtual-list/src/builders/build-grid.d.ts +3 -12
  346. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +3 -12
  347. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +3 -12
  348. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +3 -12
  349. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +3 -12
  350. package/es/components/virtual-list/src/props.d.ts +3 -18
  351. package/es/components/virtual-list/src/props.mjs +9 -5
  352. package/es/components/virtual-list/src/props.mjs.map +1 -1
  353. package/es/hooks/use-draggable/index.mjs +5 -4
  354. package/es/hooks/use-draggable/index.mjs.map +1 -1
  355. package/es/utils/vue/typescript.d.ts +12 -4
  356. package/es/version.mjs +1 -1
  357. package/es/version.mjs.map +1 -1
  358. package/lib/components/autocomplete/src/autocomplete.d.ts +1 -6
  359. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +2 -2
  360. package/lib/components/avatar/src/avatar-group-props.d.ts +3 -7
  361. package/lib/components/avatar/src/avatar-group-props.js +9 -5
  362. package/lib/components/avatar/src/avatar-group-props.js.map +1 -1
  363. package/lib/components/avatar/src/avatar-group.d.ts +7 -13
  364. package/lib/components/badge/src/badge.d.ts +2 -7
  365. package/lib/components/badge/src/badge.js +9 -5
  366. package/lib/components/badge/src/badge.js.map +1 -1
  367. package/lib/components/card/src/card.js +2 -1
  368. package/lib/components/card/src/card.js.map +1 -1
  369. package/lib/components/cascader/src/cascader.d.ts +1 -6
  370. package/lib/components/cascader/src/cascader.vue.d.ts +2 -2
  371. package/lib/components/color-picker/src/color-picker.d.ts +1 -6
  372. package/lib/components/color-picker/src/color-picker.vue.d.ts +2 -2
  373. package/lib/components/color-picker-panel/src/color-picker-panel.d.ts +1 -6
  374. package/lib/components/color-picker-panel/src/color-picker-panel.js +9 -5
  375. package/lib/components/color-picker-panel/src/color-picker-panel.js.map +1 -1
  376. package/lib/components/countdown/src/countdown.d.ts +2 -7
  377. package/lib/components/countdown/src/countdown.js +9 -5
  378. package/lib/components/countdown/src/countdown.js.map +1 -1
  379. package/lib/components/date-picker/src/date-picker.d.ts +3 -12
  380. package/lib/components/date-picker/src/props.d.ts +1 -6
  381. package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +2 -2
  382. package/lib/components/drawer/src/drawer.vue.d.ts +1 -1
  383. package/lib/components/dropdown/src/dropdown.d.ts +1 -6
  384. package/lib/components/dropdown/src/dropdown.vue.d.ts +43 -48
  385. package/lib/components/input/src/input.js +2 -1
  386. package/lib/components/input/src/input.js.map +1 -1
  387. package/lib/components/input/src/input.vue.d.ts +2 -2
  388. package/lib/components/input/src/input.vue_vue_type_script_setup_true_lang.js +21 -4
  389. package/lib/components/input/src/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
  390. package/lib/components/input/src/input2.js.map +1 -1
  391. package/lib/components/input-tag/src/input-tag.vue.d.ts +2 -2
  392. package/lib/components/mention/src/mention.d.ts +1 -6
  393. package/lib/components/popover/src/popover.d.ts +1 -6
  394. package/lib/components/popper/src/content.d.ts +4 -24
  395. package/lib/components/popper/src/content.js +18 -10
  396. package/lib/components/popper/src/content.js.map +1 -1
  397. package/lib/components/roving-focus-group/src/roving-focus-group.d.ts +1 -6
  398. package/lib/components/roving-focus-group/src/roving-focus-group.js +9 -5
  399. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  400. package/lib/components/roving-focus-group/src/roving-focus-group.vue.d.ts +3 -12
  401. package/lib/components/scrollbar/src/scrollbar.d.ts +1 -1
  402. package/lib/components/scrollbar/src/scrollbar.js +6 -4
  403. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  404. package/lib/components/segmented/index.d.ts +15 -1
  405. package/lib/components/select/src/select.vue.d.ts +2 -2
  406. package/lib/components/select-v2/src/defaults.d.ts +1 -6
  407. package/lib/components/select-v2/src/select.vue.d.ts +4 -13
  408. package/lib/components/space/src/space.js +2 -1
  409. package/lib/components/space/src/space.js.map +1 -1
  410. package/lib/components/statistic/src/statistic.d.ts +2 -7
  411. package/lib/components/statistic/src/statistic.js +9 -5
  412. package/lib/components/statistic/src/statistic.js.map +1 -1
  413. package/lib/components/table/src/table/defaults.js +2 -1
  414. package/lib/components/table/src/table/defaults.js.map +1 -1
  415. package/lib/components/table/src/table-column/index.d.ts +20 -23
  416. package/lib/components/table/src/table-header/index.d.ts +20 -23
  417. package/lib/components/table/src/table.vue.d.ts +20 -23
  418. package/lib/components/table-v2/src/cell.d.ts +2 -7
  419. package/lib/components/table-v2/src/cell.js +9 -5
  420. package/lib/components/table-v2/src/cell.js.map +1 -1
  421. package/lib/components/time-picker/src/common/picker.vue.d.ts +5 -14
  422. package/lib/components/time-picker/src/common/props.d.ts +1 -6
  423. package/lib/components/time-picker/src/time-picker.d.ts +3 -12
  424. package/lib/components/time-select/src/time-select.vue.d.ts +2 -2
  425. package/lib/components/tooltip/src/content.d.ts +2 -12
  426. package/lib/components/tooltip/src/tooltip.d.ts +2 -12
  427. package/lib/components/tree/src/tree.vue.d.ts +20 -23
  428. package/lib/components/virtual-list/src/builders/build-grid.d.ts +3 -12
  429. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +3 -12
  430. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +3 -12
  431. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +3 -12
  432. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +3 -12
  433. package/lib/components/virtual-list/src/props.d.ts +3 -18
  434. package/lib/components/virtual-list/src/props.js +9 -5
  435. package/lib/components/virtual-list/src/props.js.map +1 -1
  436. package/lib/hooks/use-draggable/index.js +5 -4
  437. package/lib/hooks/use-draggable/index.js.map +1 -1
  438. package/lib/utils/vue/typescript.d.ts +12 -4
  439. package/lib/version.js +1 -1
  440. package/lib/version.js.map +1 -1
  441. package/package.json +3 -3
  442. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"input.mjs","names":[],"sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { markRaw } from 'vue'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { CircleClose } from '@element-plus/icons-vue'\n\nimport type { ExtractPublicPropTypes, HTMLAttributes, StyleValue } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { IconPropType } from '@element-plus/utils'\n\nexport type InputModelModifiers = {\n lazy?: true\n number?: true\n trim?: true\n}\nexport type InputAutoSize = { minRows?: number; maxRows?: number } | boolean\n// Some commonly used values for input type\nexport type InputType =\n | 'text'\n | 'textarea'\n | 'number'\n | 'password'\n | 'email'\n | 'search'\n | 'tel'\n | 'url'\n | (string & NonNullable<unknown>)\n\nexport interface InputProps {\n /**\n * @description native input id\n */\n id?: string\n /**\n * @description input box size\n */\n size?: ComponentSize\n /**\n * @description whether to disable\n */\n disabled?: boolean\n /**\n * @description binding value\n */\n modelValue?: string | number | null | undefined\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers?: InputModelModifiers\n /**\n * @description same as `maxlength` in native input\n */\n maxlength?: string | number\n /**\n * @description same as `minlength` in native input\n */\n minlength?: string | number\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type?: InputType\n /**\n * @description control the resizability\n */\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n /**\n * @description whether textarea has an adaptive height\n */\n autosize?: InputAutoSize\n /**\n * @description native input autocomplete\n * - When the number of literal types in a union exceeds 315, the TS2590 error occurs. see: https://github.com/vuejs/core/issues/10514\n */\n autocomplete?: string // HTMLInputElement['autocomplete']\n /**\n * @description format content\n */\n formatter?: (value: string) => string\n /**\n * @description parse content\n */\n parser?: (value: string) => string\n /**\n * @description placeholder\n */\n placeholder?: string\n /**\n * @description native input form\n */\n form?: string\n /**\n * @description native input readonly\n */\n readonly?: boolean\n /**\n * @description whether to show clear button\n */\n clearable?: boolean\n /**\n * @description custom clear icon component\n */\n clearIcon?: IconPropType\n /**\n * @description toggleable password input\n */\n showPassword?: boolean\n /**\n * @description word count\n */\n showWordLimit?: boolean\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition?: 'inside' | 'outside'\n /**\n * @description suffix icon\n */\n suffixIcon?: IconPropType\n /**\n * @description prefix icon\n */\n prefixIcon?: IconPropType\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole?: string\n /**\n * @description input tabindex\n */\n tabindex?: string | number\n /**\n * @description whether to trigger form validation\n */\n validateEvent?: boolean\n /**\n * @description input or textarea element style\n */\n inputStyle?: StyleValue\n /**\n * @description native input autofocus\n */\n autofocus?: boolean\n /**\n * @description number of rows of textarea, only works when `type` is 'textarea'\n */\n rows?: number\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel?: string\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode?: HTMLAttributes['inputmode']\n /**\n * @description same as `name` in native input\n */\n name?: string\n /**\n * @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.\n */\n countGraphemes?: (value: string) => number\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport const inputProps = buildProps({\n /**\n * @description native input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description input box size\n */\n size: useSizeProp,\n /**\n * @description whether to disable\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n Object,\n ]),\n default: '',\n },\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers: {\n type: definePropType<InputModelModifiers>(Object),\n default: () => ({}),\n },\n /**\n * @description same as `maxlength` in native input\n */\n maxlength: {\n type: [String, Number],\n },\n /**\n * @description same as `minlength` in native input\n */\n minlength: {\n type: [String, Number],\n },\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type: {\n type: definePropType<InputType>(String),\n default: 'text',\n },\n /**\n * @description control the resizability\n */\n resize: {\n type: String,\n values: ['none', 'both', 'horizontal', 'vertical'],\n },\n /**\n * @description whether textarea has an adaptive height\n */\n autosize: {\n type: definePropType<InputAutoSize>([Boolean, Object]),\n default: false,\n },\n /**\n * @description native input autocomplete\n */\n autocomplete: {\n type: definePropType<HTMLInputElement['autocomplete']>(String),\n default: 'off',\n },\n /**\n * @description format content\n */\n formatter: {\n type: Function,\n },\n /**\n * @description parse content\n */\n parser: {\n type: Function,\n },\n /**\n * @description placeholder\n */\n placeholder: {\n type: String,\n },\n /**\n * @description native input form\n */\n form: {\n type: String,\n },\n /**\n * @description native input readonly\n */\n readonly: Boolean,\n /**\n * @description whether to show clear button\n */\n clearable: Boolean,\n /**\n * @description custom clear icon component\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description toggleable password input\n */\n showPassword: Boolean,\n /**\n * @description word count\n */\n showWordLimit: Boolean,\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition: {\n type: String,\n values: ['inside', 'outside'],\n default: 'inside',\n },\n /**\n * @description suffix icon\n */\n suffixIcon: {\n type: iconPropType,\n },\n /**\n * @description prefix icon\n */\n prefixIcon: {\n type: iconPropType,\n },\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole: {\n type: String,\n default: undefined,\n },\n /**\n * @description input tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description input or textarea element style\n */\n inputStyle: {\n type: definePropType<StyleValue>([Object, Array, String]),\n default: () => mutable({} as const),\n },\n /**\n * @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.\n */\n countGraphemes: {\n type: definePropType<(value: string) => number>(Function),\n },\n /**\n * @description native input autofocus\n */\n autofocus: Boolean,\n rows: {\n type: Number,\n default: 2,\n },\n ...useAriaProps(['ariaLabel']),\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode: {\n type: definePropType<HTMLAttributes['inputmode']>(String),\n default: undefined,\n },\n /**\n * @description same as `name` in native input\n */\n name: String,\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport type InputPropsPublic = ExtractPublicPropTypes<typeof inputProps>\n\nexport const inputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string, evt?: Event) =>\n isString(value) && (evt instanceof Event || evt === undefined),\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: (evt: MouseEvent | undefined) =>\n evt === undefined || evt instanceof MouseEvent,\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\n/**\n * @description default values for InputProps, used in components that extend InputProps like Autocomplete\n */\nexport const inputPropsDefaults = {\n disabled: undefined,\n modelValue: '',\n modelModifiers: () => ({}),\n type: 'text' as InputType,\n autocomplete: 'off',\n clearIcon: markRaw(CircleClose),\n wordLimitPosition: 'inside',\n tabindex: 0,\n validateEvent: true,\n inputStyle: () => ({}),\n rows: 2,\n} as const\n"],"mappings":";;;;;;;;;;;;;;AA6KA,MAAa,aAAa,WAAW;CAInC,IAAI;EACF,MAAM;EACN,SAAS;EACV;CAID,MAAM;CAIN,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAM,eAAmD;GACvD;GACA;GACA;GACD,CAAC;EACF,SAAS;EACV;CAID,gBAAgB;EACd,MAAM,eAAoC,OAAO;EACjD,gBAAgB,EAAE;EACnB;CAID,WAAW,EACT,MAAM,CAAC,QAAQ,OAAO,EACvB;CAID,WAAW,EACT,MAAM,CAAC,QAAQ,OAAO,EACvB;CAID,MAAM;EACJ,MAAM,eAA0B,OAAO;EACvC,SAAS;EACV;CAID,QAAQ;EACN,MAAM;EACN,QAAQ;GAAC;GAAQ;GAAQ;GAAc;GAAW;EACnD;CAID,UAAU;EACR,MAAM,eAA8B,CAAC,SAAS,OAAO,CAAC;EACtD,SAAS;EACV;CAID,cAAc;EACZ,MAAM,eAAiD,OAAO;EAC9D,SAAS;EACV;CAID,WAAW,EACT,MAAM,UACP;CAID,QAAQ,EACN,MAAM,UACP;CAID,aAAa,EACX,MAAM,QACP;CAID,MAAM,EACJ,MAAM,QACP;CAID,UAAU;CAIV,WAAW;CAIX,WAAW;EACT,MAAM;EACN,SAAS;EACV;CAID,cAAc;CAId,eAAe;CAIf,mBAAmB;EACjB,MAAM;EACN,QAAQ,CAAC,UAAU,UAAU;EAC7B,SAAS;EACV;CAID,YAAY,EACV,MAAM,cACP;CAID,YAAY,EACV,MAAM,cACP;CAID,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAM,eAA2B;GAAC;GAAQ;GAAO;GAAO,CAAC;EACzD,eAAe,QAAQ,EAAE,CAAU;EACpC;CAID,gBAAgB,EACd,MAAM,eAA0C,SAAS,EAC1D;CAID,WAAW;CACX,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CACD,GAAG,aAAa,CAAC,YAAY,CAAC;CAI9B,WAAW;EACT,MAAM,eAA4C,OAAO;EACzD,SAAS;EACV;CAID,MAAM;CACP,CAAU;AAOX,MAAa,aAAa;EACvB,sBAAsB,UAAkB,SAAS,MAAM;CACxD,QAAQ,UAAkB,SAAS,MAAM;CACzC,SAAS,OAAe,QACtB,SAAS,MAAM,KAAK,eAAe,SAAS,QAAQ;CACtD,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,QAAQ,QACN,QAAQ,UAAa,eAAe;CACtC,aAAa,QAAoB,eAAe;CAChD,aAAa,QAAoB,eAAe;CAGhD,UAAU,QAA+B,eAAe;CACxD,mBAAmB,QAA0B,eAAe;CAC5D,oBAAoB,QAA0B,eAAe;CAC7D,iBAAiB,QAA0B,eAAe;CAC3D;;;;AAMD,MAAa,qBAAqB;CAChC,UAAU;CACV,YAAY;CACZ,uBAAuB,EAAE;CACzB,MAAM;CACN,cAAc;CACd,WAAW,QAAQ,YAAY;CAC/B,mBAAmB;CACnB,UAAU;CACV,eAAe;CACf,mBAAmB,EAAE;CACrB,MAAM;CACP"}
1
+ {"version":3,"file":"input.mjs","names":[],"sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { markRaw } from 'vue'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { CircleClose } from '@element-plus/icons-vue'\n\nimport type { ExtractPublicPropTypes, HTMLAttributes, StyleValue } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { IconPropType } from '@element-plus/utils'\n\nexport type InputModelModifiers = {\n lazy?: true\n number?: true\n trim?: true\n}\nexport type InputAutoSize = { minRows?: number; maxRows?: number } | boolean\n// Some commonly used values for input type\nexport type InputType =\n | 'text'\n | 'textarea'\n | 'number'\n | 'password'\n | 'email'\n | 'search'\n | 'tel'\n | 'url'\n | (string & NonNullable<unknown>)\n\nexport interface InputProps {\n /**\n * @description native input id\n */\n id?: string\n /**\n * @description input box size\n */\n size?: ComponentSize\n /**\n * @description whether to disable\n */\n disabled?: boolean\n /**\n * @description binding value\n */\n modelValue?: string | number | null | undefined\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers?: InputModelModifiers\n /**\n * @description same as `maxlength` in native input\n */\n maxlength?: string | number\n /**\n * @description same as `minlength` in native input\n */\n minlength?: string | number\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type?: InputType\n /**\n * @description control the resizability\n */\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n /**\n * @description whether textarea has an adaptive height\n */\n autosize?: InputAutoSize\n /**\n * @description native input autocomplete\n * - When the number of literal types in a union exceeds 315, the TS2590 error occurs. see: https://github.com/vuejs/core/issues/10514\n */\n autocomplete?: string // HTMLInputElement['autocomplete']\n /**\n * @description format content\n */\n formatter?: (value: string) => string\n /**\n * @description parse content\n */\n parser?: (value: string) => string\n /**\n * @description placeholder\n */\n placeholder?: string\n /**\n * @description native input form\n */\n form?: string\n /**\n * @description native input readonly\n */\n readonly?: boolean\n /**\n * @description whether to show clear button\n */\n clearable?: boolean\n /**\n * @description custom clear icon component\n */\n clearIcon?: IconPropType\n /**\n * @description toggleable password input\n */\n showPassword?: boolean\n /**\n * @description word count\n */\n showWordLimit?: boolean\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition?: 'inside' | 'outside'\n /**\n * @description suffix icon\n */\n suffixIcon?: IconPropType\n /**\n * @description prefix icon\n */\n prefixIcon?: IconPropType\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole?: string\n /**\n * @description input tabindex\n */\n tabindex?: string | number\n /**\n * @description whether to trigger form validation\n */\n validateEvent?: boolean\n /**\n * @description input or textarea element style\n */\n inputStyle?: StyleValue\n /**\n * @description native input autofocus\n */\n autofocus?: boolean\n /**\n * @description number of rows of textarea, only works when `type` is 'textarea'\n */\n rows?: number\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel?: string\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode?: HTMLAttributes['inputmode']\n /**\n * @description same as `name` in native input\n */\n name?: string\n /**\n * @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.\n */\n countGraphemes?: (value: string) => number\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport const inputProps = buildProps({\n /**\n * @description native input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description input box size\n */\n size: useSizeProp,\n /**\n * @description whether to disable\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n Object,\n ]),\n default: '',\n },\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers: {\n type: definePropType<InputModelModifiers>(Object),\n default: () => ({}),\n },\n /**\n * @description same as `maxlength` in native input\n */\n maxlength: {\n type: [String, Number],\n },\n /**\n * @description same as `minlength` in native input\n */\n minlength: {\n type: [String, Number],\n },\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type: {\n type: definePropType<InputType>(String),\n default: 'text',\n },\n /**\n * @description control the resizability\n */\n resize: {\n type: String,\n values: ['none', 'both', 'horizontal', 'vertical'],\n },\n /**\n * @description whether textarea has an adaptive height\n */\n autosize: {\n type: definePropType<InputAutoSize>([Boolean, Object]),\n default: false,\n },\n /**\n * @description native input autocomplete\n */\n autocomplete: {\n type: definePropType<HTMLInputElement['autocomplete']>(String),\n default: 'off',\n },\n /**\n * @description format content\n */\n formatter: {\n type: Function,\n },\n /**\n * @description parse content\n */\n parser: {\n type: Function,\n },\n /**\n * @description placeholder\n */\n placeholder: {\n type: String,\n },\n /**\n * @description native input form\n */\n form: {\n type: String,\n },\n /**\n * @description native input readonly\n */\n readonly: Boolean,\n /**\n * @description whether to show clear button\n */\n clearable: Boolean,\n /**\n * @description custom clear icon component\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description toggleable password input\n */\n showPassword: Boolean,\n /**\n * @description word count\n */\n showWordLimit: Boolean,\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition: {\n type: String,\n values: ['inside', 'outside'],\n default: 'inside',\n },\n /**\n * @description suffix icon\n */\n suffixIcon: {\n type: iconPropType,\n },\n /**\n * @description prefix icon\n */\n prefixIcon: {\n type: iconPropType,\n },\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole: {\n type: String,\n default: undefined,\n },\n /**\n * @description input tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description input or textarea element style\n */\n inputStyle: {\n type: definePropType<StyleValue>([Object, Array, String, Boolean]),\n default: () => mutable({} as const),\n },\n /**\n * @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.\n */\n countGraphemes: {\n type: definePropType<(value: string) => number>(Function),\n },\n /**\n * @description native input autofocus\n */\n autofocus: Boolean,\n rows: {\n type: Number,\n default: 2,\n },\n ...useAriaProps(['ariaLabel']),\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode: {\n type: definePropType<HTMLAttributes['inputmode']>(String),\n default: undefined,\n },\n /**\n * @description same as `name` in native input\n */\n name: String,\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport type InputPropsPublic = ExtractPublicPropTypes<typeof inputProps>\n\nexport const inputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string, evt?: Event) =>\n isString(value) && (evt instanceof Event || evt === undefined),\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: (evt: MouseEvent | undefined) =>\n evt === undefined || evt instanceof MouseEvent,\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\n/**\n * @description default values for InputProps, used in components that extend InputProps like Autocomplete\n */\nexport const inputPropsDefaults = {\n disabled: undefined,\n modelValue: '',\n modelModifiers: () => ({}),\n type: 'text' as InputType,\n autocomplete: 'off',\n clearIcon: markRaw(CircleClose),\n wordLimitPosition: 'inside',\n tabindex: 0,\n validateEvent: true,\n inputStyle: () => ({}),\n rows: 2,\n} as const\n"],"mappings":";;;;;;;;;;;;;;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SAAS;EACV;CACD,GAAG,aAAa,CAAC,YAAY,CAAC;CAI9B,WAAW;EACT,MAAM,eAA4C,OAAO;EACzD,SAAS;EACV;CAID,MAAM;CACP,CAAU;AAOX,MAAa,aAAa;EACvB,sBAAsB,UAAkB,SAAS,MAAM;CACxD,QAAQ,UAAkB,SAAS,MAAM;CACzC,SAAS,OAAe,QACtB,SAAS,MAAM,KAAK,eAAe,SAAS,QAAQ;CACtD,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,QAAQ,QACN,QAAQ,UAAa,eAAe;CACtC,aAAa,QAAoB,eAAe;CAChD,aAAa,QAAoB,eAAe;CAGhD,UAAU,QAA+B,eAAe;CACxD,mBAAmB,QAA0B,eAAe;CAC5D,oBAAoB,QAA0B,eAAe;CAC7D,iBAAiB,QAA0B,eAAe;CAC3D;;;;AAMD,MAAa,qBAAqB;CAChC,UAAU;CACV,YAAY;CACZ,uBAAuB,EAAE;CACzB,MAAM;CACN,cAAc;CACd,WAAW,QAAQ,YAAY;CAC/B,mBAAmB;CACnB,UAAU;CACV,eAAe;CACf,mBAAmB,EAAE;CACrB,MAAM;CACP"}
@@ -35,11 +35,11 @@ declare const __VLS_base: vue.DefineComponent<InputProps, {
35
35
  resizeTextarea: () => void;
36
36
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
37
37
  change: (value: string, evt?: Event | undefined) => void;
38
+ clear: (evt: MouseEvent | undefined) => void;
38
39
  "update:modelValue": (value: string) => void;
39
40
  input: (value: string) => void;
40
41
  focus: (evt: FocusEvent) => void;
41
42
  blur: (evt: FocusEvent) => void;
42
- clear: (evt: MouseEvent | undefined) => void;
43
43
  mouseleave: (evt: MouseEvent) => void;
44
44
  mouseenter: (evt: MouseEvent) => void;
45
45
  keydown: (evt: Event | KeyboardEvent) => void;
@@ -48,11 +48,11 @@ declare const __VLS_base: vue.DefineComponent<InputProps, {
48
48
  compositionend: (evt: CompositionEvent) => void;
49
49
  }, string, vue.PublicProps, Readonly<InputProps> & Readonly<{
50
50
  onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
51
+ onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
51
52
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
52
53
  onInput?: ((value: string) => any) | undefined;
53
54
  onFocus?: ((evt: FocusEvent) => any) | undefined;
54
55
  onBlur?: ((evt: FocusEvent) => any) | undefined;
55
- onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
56
56
  onMouseleave?: ((evt: MouseEvent) => any) | undefined;
57
57
  onMouseenter?: ((evt: MouseEvent) => any) | undefined;
58
58
  onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
@@ -1,6 +1,7 @@
1
1
  import { CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT } from "../../../constants/event.mjs";
2
2
  import { isClient as isClient$1 } from "../../../utils/browser.mjs";
3
3
  import { isObject } from "../../../utils/types.mjs";
4
+ import { cAF, rAF } from "../../../utils/raf.mjs";
4
5
  import { debugWarn } from "../../../utils/error.mjs";
5
6
  import { ValidateComponentsMap } from "../../../utils/vue/icon.mjs";
6
7
  import { NOOP } from "../../../utils/functions.mjs";
@@ -17,7 +18,7 @@ import { calcTextareaHeight, looseToNumber } from "./utils.mjs";
17
18
  import { useResizeObserver } from "@vueuse/core";
18
19
  import { isNil } from "lodash-unified";
19
20
  import { Hide, View } from "@element-plus/icons-vue";
20
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, unref, useAttrs, useSlots, watch, withCtx, withModifiers } from "vue";
21
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, unref, useAttrs, useSlots, watch, withCtx, withModifiers } from "vue";
21
22
 
22
23
  //#region ../../packages/components/input/src/input.vue?vue&type=script&setup=true&lang.ts
23
24
  const _hoisted_1 = [
@@ -94,6 +95,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
94
95
  const hovering = ref(false);
95
96
  const passwordVisible = ref(false);
96
97
  const countStyle = ref();
98
+ const clearIconStyle = ref();
97
99
  const textareaCalcStyle = shallowRef(props.inputStyle);
98
100
  const saveValue = ref("");
99
101
  const textareaHeight = ref();
@@ -128,11 +130,18 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
128
130
  const suffixVisible = computed(() => !!slots.suffix || !!props.suffixIcon || props.clearable || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
129
131
  const hasModelModifiers = computed(() => !!Object.keys(props.modelModifiers).length);
130
132
  const [recordCursor, setCursor] = useCursor(input);
133
+ let rAFId;
131
134
  useResizeObserver(textarea, (entries) => {
132
135
  onceInitSizeTextarea();
133
- if (!isWordLimitVisible.value || props.resize !== "both" && props.resize !== "horizontal") return;
134
- const { width } = entries[0].contentRect;
135
- countStyle.value = { right: `calc(100% - ${width + 22 - 10}px)` };
136
+ if (!isWordLimitVisible.value && !renderClear.value || props.resize !== "both" && props.resize !== "horizontal") return;
137
+ const { width } = entries[0].target.getBoundingClientRect();
138
+ const updateStyle = () => {
139
+ rAFId = void 0;
140
+ countStyle.value = { right: `calc(100% - ${width - 10}px)` };
141
+ clearIconStyle.value = { right: `calc(100% - ${width - 11}px)` };
142
+ };
143
+ rAFId && cAF(rAFId);
144
+ rAFId = rAF(updateStyle);
136
145
  });
137
146
  const resizeTextarea = () => {
138
147
  const { type, autosize } = props;
@@ -324,6 +333,9 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
324
333
  setNativeInputValue();
325
334
  nextTick(resizeTextarea);
326
335
  });
336
+ onBeforeUnmount(() => {
337
+ rAFId && cAF(rAFId);
338
+ });
327
339
  __expose({
328
340
  input,
329
341
  textarea,
@@ -498,12 +510,17 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
498
510
  showClear.value ? (openBlock(), createBlock(unref(ElIcon), {
499
511
  key: 0,
500
512
  class: normalizeClass([unref(nsTextarea).e("icon"), unref(nsTextarea).e("clear")]),
513
+ style: normalizeStyle(clearIconStyle.value),
501
514
  onMousedown: withModifiers(unref(NOOP), ["prevent"]),
502
515
  onClick: clear
503
516
  }, {
504
517
  default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]),
505
518
  _: 1
506
- }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
519
+ }, 8, [
520
+ "class",
521
+ "style",
522
+ "onMousedown"
523
+ ])) : createCommentVNode("v-if", true),
507
524
  isWordLimitVisible.value ? (openBlock(), createElementBlock("span", {
508
525
  key: 1,
509
526
  style: normalizeStyle(countStyle.value),
@@ -1 +1 @@
1
- {"version":3,"file":"input.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\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 <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :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 <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <el-icon\n v-if=\"renderClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n :style=\"{ visibility: showClear ? 'visible' : 'hidden' }\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\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=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\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 </span>\n </div>\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 :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\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 <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n debugWarn,\n isClient,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\nconst textareaHeight = ref<string>()\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch(NOOP)\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n textareaHeight.value ? { height: textareaHeight.value } : undefined,\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst renderClear = computed(\n () => props.clearable && !inputDisabled.value && !props.readonly\n)\nconst showClear = computed(\n () =>\n renderClear.value &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n props.clearable ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n !isWordLimitVisible.value ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.contentRect\n countStyle.value = {\n /** right: 100% - width + padding(22) - right(10) */\n right: `calc(100% - ${width + 22 - 10}px)`,\n }\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) {\n if (props.resize !== 'none') {\n // The execution here may occur before `setTimeout(resizeTextarea)`,\n // potentially causing a regression of issue #21836, so the assignment needs to be deferred.\n setTimeout(() => {\n textareaHeight.value = textarea.value?.style.height\n })\n }\n return\n }\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\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 (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\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 = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => {\n resizeTextarea()\n if (props.autosize) {\n textareaHeight.value = undefined\n }\n })\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch(NOOP)\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\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, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\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 }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\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 is input composing */\n isComposing,\n\n /** @description whether the password is visible */\n passwordVisible,\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmOA,MAAM,iBAAiB;;;;;;;;EAKvB,MAAM,QA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AAW,QAAA;KACX,oBAAgB,OAAA,OAAA,OAAA,kBAAE,MAAA,uBAAA,IAAA,MAAA,uBAAA,CAAA,GAAA,KAAsB;KACxC,qBAAiB,OAAA,OAAA,OAAA,kBAAE,MAAA,wBAAA,IAAA,MAAA,wBAAA,CAAA,GAAA,KAAuB;KAC1C,kBAAc,OAAA,OAAA,OAAA,kBAAE,MAAA,qBAAA,IAAA,MAAA,qBAAA,CAAA,GAAA,KAAoB;KACpC,SAAO;KACP,SAAK,OAAA,OAAA,OAAA,kBAAE,MAAA,YAAA,IAAA,MAAA,YAAA,CAAA,GAAA,KAAW;KAClB,QAAI,OAAA,OAAA,OAAA,kBAAE,MAAA,WAAA,IAAA,MAAA,WAAA,CAAA,GAAA,KAAU;KAChB,UAAQ;KACR,WAAS;;IAGJ,UAAA,sBADR,YAOU,MAAA,OAAA,EAAA;;KALP,OAAK,eAAA,CAAG,MAAA,WAAU,CAAC,EAAC,OAAA,EAAU,MAAA,WAAU,CAAC,EAAC,QAAA,CAAA,CAAA;KAC1C,aAAS,cAAU,MAAA,KAAI,EAAA,CAAA,UAAA,CAAA;KACvB,SAAO;;4BAEqB,eAA7B,YAA6B,wBAAb,QAAA,UAAS,CAAA;;;IAGnB,mBAAA,sBADR,mBASO,QAAA;;KAPJ,OAAK,eAAE,WAAA,MAAU;KACjB,OAAK,eAAA,CAAc,MAAA,QAAO,CAAC,EAAC,QAAA,EAAqB,MAAA,QAAO,CAAC,GAAE,WAAY,QAAA,sBAAiB,UAAA;uBAKtF,WAAA,MAAU,GAAG,QAAG,gBAAG,UAAA,MAAS,EAAA,EAAA"}
1
+ {"version":3,"file":"input.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\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 <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :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 <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <el-icon\n v-if=\"renderClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n :style=\"{ visibility: showClear ? 'visible' : 'hidden' }\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\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=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\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 </span>\n </div>\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 :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\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 <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n :style=\"clearIconStyle\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n cAF,\n debugWarn,\n isClient,\n isObject,\n rAF,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst clearIconStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\nconst textareaHeight = ref<string>()\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch(NOOP)\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n textareaHeight.value ? { height: textareaHeight.value } : undefined,\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst renderClear = computed(\n () => props.clearable && !inputDisabled.value && !props.readonly\n)\nconst showClear = computed(\n () =>\n renderClear.value &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n props.clearable ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nlet rAFId: number | undefined\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n (!isWordLimitVisible.value && !renderClear.value) ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.target.getBoundingClientRect()\n\n const updateStyle = () => {\n rAFId = undefined\n countStyle.value = {\n /** right: 100% - (width - right(10)) */\n right: `calc(100% - ${width - 10}px)`,\n }\n clearIconStyle.value = {\n /** right: 100% - (width - right(11)) */\n right: `calc(100% - ${width - 11}px)`,\n }\n }\n\n rAFId && cAF(rAFId)\n rAFId = rAF(updateStyle)\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) {\n if (props.resize !== 'none') {\n // The execution here may occur before `setTimeout(resizeTextarea)`,\n // potentially causing a regression of issue #21836, so the assignment needs to be deferred.\n setTimeout(() => {\n textareaHeight.value = textarea.value?.style.height\n })\n }\n return\n }\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\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 (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\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 = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => {\n resizeTextarea()\n if (props.autosize) {\n textareaHeight.value = undefined\n }\n })\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch(NOOP)\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\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, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\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 }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\n})\n\nonBeforeUnmount(() => {\n rAFId && cAF(rAFId)\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 is input composing */\n isComposing,\n\n /** @description whether the password is visible */\n passwordVisible,\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuOA,MAAM,iBAAiB;;;;;;;;EAKvB,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,WAAW,UAAY;EAC7B,MAAM,QAAQ,UAAS;EAEvB,MAAM,eAAe,eAAe;GAClC,MAAM,SAAS,aAAa,WAAW,GAAG,GAAG,QAAQ,GAAG;GACxD,QAAQ,EAAE,UAAU,MAAM;GAC1B,QAAQ,GAAG,YAAY,cAAc,MAAM;GAC3C,QAAQ,GAAG,UAAU,YAAY,MAAM;GACvC;KACG,QAAQ,EAAE,QAAQ,GAAG,MAAM,WAAW,MAAM;KAC5C,QAAQ,EAAE,SAAS,GAAG,MAAM,UAAU,MAAM;KAC5C,QAAQ,EAAE,SAAS,GAClB,MAAM,UAAU,MAAM,cAAc,MAAM,aAAa,MAAM;KAC9D,QAAQ,GAAG,UAAU,iBAAiB,GACrC,UAAU,SAAS,eAAe;KACnC,QAAQ,EAAE,SAAS,GAAG,MAAM,SAAS;IACvC;GACD,SAAS;GACV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A,OAAA,OAAA,kBAAE,MAAA,YAAA,IAAA,MAAA,YAAA,CAAA,GAAA,KAAW;KAClB,QAAI,OAAA,OAAA,OAAA,kBAAE,MAAA,WAAA,IAAA,MAAA,WAAA,CAAA,GAAA,KAAU;KAChB,UAAQ;KACR,WAAS;;IAGJ,UAAA,sBADR,YAQU,MAAA,OAAA,EAAA;;KANP,OAAK,eAAA,CAAG,MAAA,WAAU,CAAC,EAAC,OAAA,EAAU,MAAA,WAAU,CAAC,EAAC,QAAA,CAAA,CAAA;KAC1C,OAAK,eAAE,eAAA,MAAc;KACrB,aAAS,cAAU,MAAA,KAAI,EAAA,CAAA,UAAA,CAAA;KACvB,SAAO;;4BAEqB,eAA7B,YAA6B,wBAAb,QAAA,UAAS,CAAA;;;;;;;IAGnB,mBAAA,sBADR,mBASO,QAAA;;KAPJ,OAAK,eAAE,WAAA,MAAU;KACjB,OAAK,eAAA,CAAc,MAAA,QAAO,CAAC,EAAC,QAAA,EAAqB,MAAA,QAAO,CAAC,GAAE,WAAY,QAAA,sBAAiB,UAAA;uBAKtF,WAAA,MAAU,GAAG,QAAG,gBAAG,UAAA,MAAS,EAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"input2.mjs","names":[],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\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 <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :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 <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <el-icon\n v-if=\"renderClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n :style=\"{ visibility: showClear ? 'visible' : 'hidden' }\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\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=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\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 </span>\n </div>\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 :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\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 <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n debugWarn,\n isClient,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\nconst textareaHeight = ref<string>()\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch(NOOP)\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n textareaHeight.value ? { height: textareaHeight.value } : undefined,\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst renderClear = computed(\n () => props.clearable && !inputDisabled.value && !props.readonly\n)\nconst showClear = computed(\n () =>\n renderClear.value &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n props.clearable ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n !isWordLimitVisible.value ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.contentRect\n countStyle.value = {\n /** right: 100% - width + padding(22) - right(10) */\n right: `calc(100% - ${width + 22 - 10}px)`,\n }\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) {\n if (props.resize !== 'none') {\n // The execution here may occur before `setTimeout(resizeTextarea)`,\n // potentially causing a regression of issue #21836, so the assignment needs to be deferred.\n setTimeout(() => {\n textareaHeight.value = textarea.value?.style.height\n })\n }\n return\n }\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\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 (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\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 = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => {\n resizeTextarea()\n if (props.autosize) {\n textareaHeight.value = undefined\n }\n })\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch(NOOP)\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\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, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\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 }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\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 is input composing */\n isComposing,\n\n /** @description whether the password is visible */\n passwordVisible,\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"],"mappings":""}
1
+ {"version":3,"file":"input2.mjs","names":[],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\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 <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :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 <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <el-icon\n v-if=\"renderClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n :style=\"{ visibility: showClear ? 'visible' : 'hidden' }\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\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=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\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 </span>\n </div>\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 :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\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 <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n :style=\"clearIconStyle\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n cAF,\n debugWarn,\n isClient,\n isObject,\n rAF,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst clearIconStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\nconst textareaHeight = ref<string>()\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch(NOOP)\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n textareaHeight.value ? { height: textareaHeight.value } : undefined,\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst renderClear = computed(\n () => props.clearable && !inputDisabled.value && !props.readonly\n)\nconst showClear = computed(\n () =>\n renderClear.value &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n props.clearable ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nlet rAFId: number | undefined\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n (!isWordLimitVisible.value && !renderClear.value) ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.target.getBoundingClientRect()\n\n const updateStyle = () => {\n rAFId = undefined\n countStyle.value = {\n /** right: 100% - (width - right(10)) */\n right: `calc(100% - ${width - 10}px)`,\n }\n clearIconStyle.value = {\n /** right: 100% - (width - right(11)) */\n right: `calc(100% - ${width - 11}px)`,\n }\n }\n\n rAFId && cAF(rAFId)\n rAFId = rAF(updateStyle)\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) {\n if (props.resize !== 'none') {\n // The execution here may occur before `setTimeout(resizeTextarea)`,\n // potentially causing a regression of issue #21836, so the assignment needs to be deferred.\n setTimeout(() => {\n textareaHeight.value = textarea.value?.style.height\n })\n }\n return\n }\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\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 (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\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 = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => {\n resizeTextarea()\n if (props.autosize) {\n textareaHeight.value = undefined\n }\n })\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch(NOOP)\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\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, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\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 }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\n})\n\nonBeforeUnmount(() => {\n rAFId && cAF(rAFId)\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 is input composing */\n isComposing,\n\n /** @description whether the password is visible */\n passwordVisible,\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"],"mappings":""}
@@ -27,21 +27,21 @@ declare const __VLS_base: vue.DefineComponent<InputTagProps, {
27
27
  blur: () => void;
28
28
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
29
29
  change: (value?: string[] | undefined) => void;
30
+ clear: () => void;
30
31
  "update:modelValue": (value?: string[] | undefined) => void;
31
32
  input: (value: string) => void;
32
33
  focus: (evt: FocusEvent) => void;
33
34
  blur: (evt: FocusEvent) => void;
34
- clear: () => void;
35
35
  "add-tag": (value: string | string[]) => void;
36
36
  "remove-tag": (value: string, index: number) => void;
37
37
  "drag-tag": (oldIndex: number, newIndex: number, value: string) => void;
38
38
  }, string, vue.PublicProps, Readonly<InputTagProps> & Readonly<{
39
39
  onChange?: ((value?: string[] | undefined) => any) | undefined;
40
+ onClear?: (() => any) | undefined;
40
41
  "onUpdate:modelValue"?: ((value?: string[] | undefined) => any) | undefined;
41
42
  onInput?: ((value: string) => any) | undefined;
42
43
  onFocus?: ((evt: FocusEvent) => any) | undefined;
43
44
  onBlur?: ((evt: FocusEvent) => any) | undefined;
44
- onClear?: (() => any) | undefined;
45
45
  "onAdd-tag"?: ((value: string | string[]) => any) | undefined;
46
46
  "onRemove-tag"?: ((value: string, index: number) => any) | undefined;
47
47
  "onDrag-tag"?: ((oldIndex: number, newIndex: number, value: string) => any) | undefined;
@@ -199,12 +199,7 @@ declare const mentionProps: {
199
199
  readonly validator: ((val: unknown) => boolean) | undefined;
200
200
  __epPropKey: true;
201
201
  };
202
- popperStyle: {
203
- readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue)) | null)[], unknown, unknown>>;
204
- readonly required: false;
205
- readonly validator: ((val: unknown) => boolean) | undefined;
206
- __epPropKey: true;
207
- };
202
+ popperStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
208
203
  popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | (((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>)) | null)[], unknown, unknown, () => Partial<Options>, boolean>;
209
204
  props: EpPropFinalized<(new (...args: any[]) => MentionOptionProps) | (() => MentionOptionProps) | (((new (...args: any[]) => MentionOptionProps) | (() => MentionOptionProps)) | null)[], unknown, unknown, () => Required<MentionOptionProps>, boolean>;
210
205
  inputmode: EpPropFinalized<(new (...args: any[]) => "text" | "email" | "search" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "text" | "email" | "search" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "text" | "email" | "search" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "text" | "email" | "search" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
@@ -124,12 +124,7 @@ declare const popoverProps: {
124
124
  readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | (((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>)) | null)[], unknown, unknown, () => {}, boolean>;
125
125
  readonly tabindex: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown, 0, boolean>;
126
126
  readonly content: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
127
- readonly popperStyle: {
128
- readonly type: PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue)) | null)[], unknown, unknown>>;
129
- readonly required: false;
130
- readonly validator: ((val: unknown) => boolean) | undefined;
131
- __epPropKey: true;
132
- };
127
+ readonly popperStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
133
128
  readonly popperClass: {
134
129
  readonly type: PropType<EpPropMergeType<(new (...args: any[]) => string | {
135
130
  [x: string]: boolean;
@@ -78,12 +78,7 @@ declare const popperContentProps: {
78
78
  readonly loop: BooleanConstructor;
79
79
  readonly ariaLabel: StringConstructor;
80
80
  readonly id: StringConstructor;
81
- readonly style: {
82
- readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown>>;
83
- readonly required: false;
84
- readonly validator: ((val: unknown) => boolean) | undefined;
85
- __epPropKey: true;
86
- };
81
+ readonly style: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
87
82
  readonly className: {
88
83
  readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | ClassObjectType | ClassType[]) | (() => ClassType) | (((new (...args: any[]) => string | ClassObjectType | ClassType[]) | (() => ClassType)) | null)[], unknown, unknown>>;
89
84
  readonly required: false;
@@ -102,12 +97,7 @@ declare const popperContentProps: {
102
97
  readonly validator: ((val: unknown) => boolean) | undefined;
103
98
  __epPropKey: true;
104
99
  };
105
- readonly popperStyle: {
106
- readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown>>;
107
- readonly required: false;
108
- readonly validator: ((val: unknown) => boolean) | undefined;
109
- __epPropKey: true;
110
- };
100
+ readonly popperStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
111
101
  readonly referenceEl: {
112
102
  readonly type: vue.PropType<HTMLElement>;
113
103
  readonly required: false;
@@ -188,12 +178,7 @@ declare const usePopperContentProps: {
188
178
  readonly loop: BooleanConstructor;
189
179
  readonly ariaLabel: StringConstructor;
190
180
  readonly id: StringConstructor;
191
- readonly style: {
192
- readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown>>;
193
- readonly required: false;
194
- readonly validator: ((val: unknown) => boolean) | undefined;
195
- __epPropKey: true;
196
- };
181
+ readonly style: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
197
182
  readonly className: {
198
183
  readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | ClassObjectType | ClassType[]) | (() => ClassType) | (((new (...args: any[]) => string | ClassObjectType | ClassType[]) | (() => ClassType)) | null)[], unknown, unknown>>;
199
184
  readonly required: false;
@@ -212,12 +197,7 @@ declare const usePopperContentProps: {
212
197
  readonly validator: ((val: unknown) => boolean) | undefined;
213
198
  __epPropKey: true;
214
199
  };
215
- readonly popperStyle: {
216
- readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown>>;
217
- readonly required: false;
218
- readonly validator: ((val: unknown) => boolean) | undefined;
219
- __epPropKey: true;
220
- };
200
+ readonly popperStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
221
201
  readonly referenceEl: {
222
202
  readonly type: vue.PropType<HTMLElement>;
223
203
  readonly required: false;