@element-plus/nightly 0.0.20240530 → 0.0.20240601

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 (368) hide show
  1. package/dist/index.full.js +2 -2
  2. package/dist/index.full.min.js +2 -2
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +2 -2
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +2 -2
  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/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/nb-no.js +1 -1
  152. package/dist/locale/nb-no.min.js +1 -1
  153. package/dist/locale/nb-no.min.mjs +1 -1
  154. package/dist/locale/nb-no.mjs +1 -1
  155. package/dist/locale/nl.js +1 -1
  156. package/dist/locale/nl.min.js +1 -1
  157. package/dist/locale/nl.min.mjs +1 -1
  158. package/dist/locale/nl.mjs +1 -1
  159. package/dist/locale/pa.js +1 -1
  160. package/dist/locale/pa.min.js +1 -1
  161. package/dist/locale/pa.min.mjs +1 -1
  162. package/dist/locale/pa.mjs +1 -1
  163. package/dist/locale/pl.js +1 -1
  164. package/dist/locale/pl.min.js +1 -1
  165. package/dist/locale/pl.min.mjs +1 -1
  166. package/dist/locale/pl.mjs +1 -1
  167. package/dist/locale/pt-br.js +1 -1
  168. package/dist/locale/pt-br.min.js +1 -1
  169. package/dist/locale/pt-br.min.mjs +1 -1
  170. package/dist/locale/pt-br.mjs +1 -1
  171. package/dist/locale/pt.js +1 -1
  172. package/dist/locale/pt.min.js +1 -1
  173. package/dist/locale/pt.min.mjs +1 -1
  174. package/dist/locale/pt.mjs +1 -1
  175. package/dist/locale/ro.js +1 -1
  176. package/dist/locale/ro.min.js +1 -1
  177. package/dist/locale/ro.min.mjs +1 -1
  178. package/dist/locale/ro.mjs +1 -1
  179. package/dist/locale/ru.js +1 -1
  180. package/dist/locale/ru.min.js +1 -1
  181. package/dist/locale/ru.min.mjs +1 -1
  182. package/dist/locale/ru.mjs +1 -1
  183. package/dist/locale/sk.js +1 -1
  184. package/dist/locale/sk.min.js +1 -1
  185. package/dist/locale/sk.min.mjs +1 -1
  186. package/dist/locale/sk.mjs +1 -1
  187. package/dist/locale/sl.js +1 -1
  188. package/dist/locale/sl.min.js +1 -1
  189. package/dist/locale/sl.min.mjs +1 -1
  190. package/dist/locale/sl.mjs +1 -1
  191. package/dist/locale/sr.js +1 -1
  192. package/dist/locale/sr.min.js +1 -1
  193. package/dist/locale/sr.min.mjs +1 -1
  194. package/dist/locale/sr.mjs +1 -1
  195. package/dist/locale/sv.js +1 -1
  196. package/dist/locale/sv.min.js +1 -1
  197. package/dist/locale/sv.min.mjs +1 -1
  198. package/dist/locale/sv.mjs +1 -1
  199. package/dist/locale/sw.js +1 -1
  200. package/dist/locale/sw.min.js +1 -1
  201. package/dist/locale/sw.min.mjs +1 -1
  202. package/dist/locale/sw.mjs +1 -1
  203. package/dist/locale/ta.js +1 -1
  204. package/dist/locale/ta.min.js +1 -1
  205. package/dist/locale/ta.min.mjs +1 -1
  206. package/dist/locale/ta.mjs +1 -1
  207. package/dist/locale/th.js +1 -1
  208. package/dist/locale/th.min.js +1 -1
  209. package/dist/locale/th.min.mjs +1 -1
  210. package/dist/locale/th.mjs +1 -1
  211. package/dist/locale/tk.js +1 -1
  212. package/dist/locale/tk.min.js +1 -1
  213. package/dist/locale/tk.min.mjs +1 -1
  214. package/dist/locale/tk.mjs +1 -1
  215. package/dist/locale/tr.js +1 -1
  216. package/dist/locale/tr.min.js +1 -1
  217. package/dist/locale/tr.min.mjs +1 -1
  218. package/dist/locale/tr.mjs +1 -1
  219. package/dist/locale/ug-cn.js +1 -1
  220. package/dist/locale/ug-cn.min.js +1 -1
  221. package/dist/locale/ug-cn.min.mjs +1 -1
  222. package/dist/locale/ug-cn.mjs +1 -1
  223. package/dist/locale/uk.js +1 -1
  224. package/dist/locale/uk.min.js +1 -1
  225. package/dist/locale/uk.min.mjs +1 -1
  226. package/dist/locale/uk.mjs +1 -1
  227. package/dist/locale/uz-uz.js +1 -1
  228. package/dist/locale/uz-uz.min.js +1 -1
  229. package/dist/locale/uz-uz.min.mjs +1 -1
  230. package/dist/locale/uz-uz.mjs +1 -1
  231. package/dist/locale/vi.js +1 -1
  232. package/dist/locale/vi.min.js +1 -1
  233. package/dist/locale/vi.min.mjs +1 -1
  234. package/dist/locale/vi.mjs +1 -1
  235. package/dist/locale/zh-cn.js +1 -1
  236. package/dist/locale/zh-cn.min.js +1 -1
  237. package/dist/locale/zh-cn.min.mjs +1 -1
  238. package/dist/locale/zh-cn.mjs +1 -1
  239. package/dist/locale/zh-tw.js +1 -1
  240. package/dist/locale/zh-tw.min.js +1 -1
  241. package/dist/locale/zh-tw.min.mjs +1 -1
  242. package/dist/locale/zh-tw.mjs +1 -1
  243. package/es/components/affix/index.mjs +2 -2
  244. package/es/components/affix/src/affix.mjs +117 -26
  245. package/es/components/affix/src/affix.mjs.map +1 -1
  246. package/es/components/affix/src/affix2.mjs +26 -117
  247. package/es/components/affix/src/affix2.mjs.map +1 -1
  248. package/es/components/cascader/src/cascader.mjs +1 -1
  249. package/es/components/index.mjs +8 -8
  250. package/es/components/input/index.mjs +2 -2
  251. package/es/components/input/src/input.mjs +118 -462
  252. package/es/components/input/src/input.mjs.map +1 -1
  253. package/es/components/input/src/input2.mjs +462 -118
  254. package/es/components/input/src/input2.mjs.map +1 -1
  255. package/es/components/pagination/src/components/pager.mjs +17 -216
  256. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  257. package/es/components/pagination/src/components/pager2.mjs +216 -17
  258. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  259. package/es/components/pagination/src/components/sizes.mjs +23 -69
  260. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  261. package/es/components/pagination/src/components/sizes2.mjs +69 -23
  262. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  263. package/es/components/pagination/src/pagination.mjs +2 -2
  264. package/es/components/row/index.mjs +2 -2
  265. package/es/components/row/src/row.mjs +45 -29
  266. package/es/components/row/src/row.mjs.map +1 -1
  267. package/es/components/row/src/row2.mjs +29 -45
  268. package/es/components/row/src/row2.mjs.map +1 -1
  269. package/es/components/scrollbar/src/bar.mjs +64 -11
  270. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  271. package/es/components/scrollbar/src/bar2.mjs +11 -64
  272. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  273. package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
  274. package/es/components/select/src/select.mjs +1 -1
  275. package/es/components/select-v2/src/defaults.mjs +1 -1
  276. package/es/components/slider/index.mjs +2 -2
  277. package/es/components/slider/src/slider.mjs +242 -94
  278. package/es/components/slider/src/slider.mjs.map +1 -1
  279. package/es/components/slider/src/slider2.mjs +94 -242
  280. package/es/components/slider/src/slider2.mjs.map +1 -1
  281. package/es/components/steps/index.mjs +2 -2
  282. package/es/components/steps/src/steps.mjs +39 -36
  283. package/es/components/steps/src/steps.mjs.map +1 -1
  284. package/es/components/steps/src/steps2.mjs +36 -39
  285. package/es/components/steps/src/steps2.mjs.map +1 -1
  286. package/es/components/tabs/index.mjs +2 -2
  287. package/es/components/tabs/src/tab-pane.mjs +72 -13
  288. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  289. package/es/components/tabs/src/tab-pane2.mjs +13 -72
  290. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  291. package/es/components/tag/index.mjs +2 -2
  292. package/es/components/tag/src/tag.mjs +94 -29
  293. package/es/components/tag/src/tag.mjs.map +1 -1
  294. package/es/components/tag/src/tag2.mjs +29 -94
  295. package/es/components/tag/src/tag2.mjs.map +1 -1
  296. package/es/components/tooltip/index.mjs +2 -2
  297. package/es/components/tooltip/src/tooltip.mjs +170 -31
  298. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  299. package/es/components/tooltip/src/tooltip2.mjs +31 -170
  300. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  301. package/es/index.mjs +8 -8
  302. package/es/version.d.ts +1 -1
  303. package/es/version.mjs +1 -1
  304. package/es/version.mjs.map +1 -1
  305. package/lib/components/affix/index.js +2 -2
  306. package/lib/components/affix/src/affix.js +117 -27
  307. package/lib/components/affix/src/affix.js.map +1 -1
  308. package/lib/components/affix/src/affix2.js +27 -117
  309. package/lib/components/affix/src/affix2.js.map +1 -1
  310. package/lib/components/cascader/src/cascader.js +1 -1
  311. package/lib/components/index.js +8 -8
  312. package/lib/components/input/index.js +2 -2
  313. package/lib/components/input/src/input.js +118 -461
  314. package/lib/components/input/src/input.js.map +1 -1
  315. package/lib/components/input/src/input2.js +461 -118
  316. package/lib/components/input/src/input2.js.map +1 -1
  317. package/lib/components/pagination/src/components/pager.js +17 -216
  318. package/lib/components/pagination/src/components/pager.js.map +1 -1
  319. package/lib/components/pagination/src/components/pager2.js +216 -17
  320. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  321. package/lib/components/pagination/src/components/sizes.js +23 -69
  322. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  323. package/lib/components/pagination/src/components/sizes2.js +69 -23
  324. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  325. package/lib/components/pagination/src/pagination.js +2 -2
  326. package/lib/components/row/index.js +2 -2
  327. package/lib/components/row/src/row.js +45 -31
  328. package/lib/components/row/src/row.js.map +1 -1
  329. package/lib/components/row/src/row2.js +31 -45
  330. package/lib/components/row/src/row2.js.map +1 -1
  331. package/lib/components/scrollbar/src/bar.js +64 -11
  332. package/lib/components/scrollbar/src/bar.js.map +1 -1
  333. package/lib/components/scrollbar/src/bar2.js +11 -64
  334. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  335. package/lib/components/scrollbar/src/scrollbar2.js +1 -1
  336. package/lib/components/select/src/select.js +1 -1
  337. package/lib/components/select-v2/src/defaults.js +1 -1
  338. package/lib/components/slider/index.js +2 -2
  339. package/lib/components/slider/src/slider.js +242 -95
  340. package/lib/components/slider/src/slider.js.map +1 -1
  341. package/lib/components/slider/src/slider2.js +95 -242
  342. package/lib/components/slider/src/slider2.js.map +1 -1
  343. package/lib/components/steps/index.js +2 -2
  344. package/lib/components/steps/src/steps.js +39 -37
  345. package/lib/components/steps/src/steps.js.map +1 -1
  346. package/lib/components/steps/src/steps2.js +37 -39
  347. package/lib/components/steps/src/steps2.js.map +1 -1
  348. package/lib/components/tabs/index.js +2 -2
  349. package/lib/components/tabs/src/tab-pane.js +72 -13
  350. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  351. package/lib/components/tabs/src/tab-pane2.js +13 -72
  352. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  353. package/lib/components/tag/index.js +2 -2
  354. package/lib/components/tag/src/tag.js +94 -30
  355. package/lib/components/tag/src/tag.js.map +1 -1
  356. package/lib/components/tag/src/tag2.js +30 -94
  357. package/lib/components/tag/src/tag2.js.map +1 -1
  358. package/lib/components/tooltip/index.js +2 -2
  359. package/lib/components/tooltip/src/tooltip.js +170 -35
  360. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  361. package/lib/components/tooltip/src/tooltip2.js +35 -170
  362. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  363. package/lib/index.js +8 -8
  364. package/lib/version.d.ts +1 -1
  365. package/lib/version.js +1 -1
  366. package/lib/version.js.map +1 -1
  367. package/package.json +2 -2
  368. package/web-types.json +1 -1
@@ -1,125 +1,469 @@
1
- import { isString } from '@vue/shared';
1
+ import { defineComponent, useAttrs, useSlots, computed, shallowRef, ref, nextTick, watch, onMounted, toRef, openBlock, createElementBlock, mergeProps, unref, createCommentVNode, Fragment, normalizeClass, renderSlot, createElementVNode, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, normalizeStyle } from 'vue';
2
+ import { useResizeObserver, isClient } from '@vueuse/core';
3
+ import { isNil } from 'lodash-unified';
4
+ import { ElIcon } from '../../icon/index.mjs';
5
+ import { View, Hide, CircleClose } from '@element-plus/icons-vue';
6
+ import '../../form/index.mjs';
2
7
  import '../../../utils/index.mjs';
3
- import '../../../constants/index.mjs';
4
8
  import '../../../hooks/index.mjs';
5
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
6
- import { useSizeProp } from '../../../hooks/use-size/index.mjs';
7
- import { iconPropType } from '../../../utils/vue/icon.mjs';
8
- import { mutable } from '../../../utils/typescript.mjs';
9
- import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
9
+ import '../../../constants/index.mjs';
10
+ import { calcTextareaHeight } from './utils.mjs';
11
+ import { inputProps, inputEmits } from './input.mjs';
12
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
13
+ import { useAttrs as useAttrs$1 } from '../../../hooks/use-attrs/index.mjs';
14
+ import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
15
+ import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
16
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
17
+ import { useFocusController } from '../../../hooks/use-focus-controller/index.mjs';
18
+ import { debugWarn } from '../../../utils/error.mjs';
19
+ import { ValidateComponentsMap } from '../../../utils/vue/icon.mjs';
20
+ import { useCursor } from '../../../hooks/use-cursor/index.mjs';
21
+ import { isObject, NOOP } from '@vue/shared';
10
22
  import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
23
+ import { isKorean } from '../../../utils/i18n.mjs';
24
+ import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
11
25
 
12
- const inputProps = buildProps({
13
- id: {
14
- type: String,
15
- default: void 0
16
- },
17
- size: useSizeProp,
18
- disabled: Boolean,
19
- modelValue: {
20
- type: definePropType([
21
- String,
22
- Number,
23
- Object
24
- ]),
25
- default: ""
26
- },
27
- maxlength: {
28
- type: [String, Number]
29
- },
30
- minlength: {
31
- type: [String, Number]
32
- },
33
- type: {
34
- type: String,
35
- default: "text"
36
- },
37
- resize: {
38
- type: String,
39
- values: ["none", "both", "horizontal", "vertical"]
40
- },
41
- autosize: {
42
- type: definePropType([Boolean, Object]),
43
- default: false
44
- },
45
- autocomplete: {
46
- type: String,
47
- default: "off"
48
- },
49
- formatter: {
50
- type: Function
51
- },
52
- parser: {
53
- type: Function
54
- },
55
- placeholder: {
56
- type: String
57
- },
58
- form: {
59
- type: String
60
- },
61
- readonly: {
62
- type: Boolean,
63
- default: false
64
- },
65
- clearable: {
66
- type: Boolean,
67
- default: false
68
- },
69
- showPassword: {
70
- type: Boolean,
71
- default: false
72
- },
73
- showWordLimit: {
74
- type: Boolean,
75
- default: false
76
- },
77
- suffixIcon: {
78
- type: iconPropType
79
- },
80
- prefixIcon: {
81
- type: iconPropType
82
- },
83
- containerRole: {
84
- type: String,
85
- default: void 0
86
- },
87
- label: {
88
- type: String,
89
- default: void 0
90
- },
91
- tabindex: {
92
- type: [String, Number],
93
- default: 0
94
- },
95
- validateEvent: {
96
- type: Boolean,
97
- default: true
98
- },
99
- inputStyle: {
100
- type: definePropType([Object, Array, String]),
101
- default: () => mutable({})
102
- },
103
- autofocus: {
104
- type: Boolean,
105
- default: false
106
- },
107
- ...useAriaProps(["ariaLabel"])
26
+ const _hoisted_1 = ["role"];
27
+ const _hoisted_2 = ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus"];
28
+ const _hoisted_3 = ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus"];
29
+ const __default__ = defineComponent({
30
+ name: "ElInput",
31
+ inheritAttrs: false
32
+ });
33
+ const _sfc_main = /* @__PURE__ */ defineComponent({
34
+ ...__default__,
35
+ props: inputProps,
36
+ emits: inputEmits,
37
+ setup(__props, { expose, emit }) {
38
+ const props = __props;
39
+ const rawAttrs = useAttrs();
40
+ const slots = useSlots();
41
+ const containerAttrs = computed(() => {
42
+ const comboBoxAttrs = {};
43
+ if (props.containerRole === "combobox") {
44
+ comboBoxAttrs["aria-haspopup"] = rawAttrs["aria-haspopup"];
45
+ comboBoxAttrs["aria-owns"] = rawAttrs["aria-owns"];
46
+ comboBoxAttrs["aria-expanded"] = rawAttrs["aria-expanded"];
47
+ }
48
+ return comboBoxAttrs;
49
+ });
50
+ const containerKls = computed(() => [
51
+ props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
52
+ nsInput.m(inputSize.value),
53
+ nsInput.is("disabled", inputDisabled.value),
54
+ nsInput.is("exceed", inputExceed.value),
55
+ {
56
+ [nsInput.b("group")]: slots.prepend || slots.append,
57
+ [nsInput.bm("group", "append")]: slots.append,
58
+ [nsInput.bm("group", "prepend")]: slots.prepend,
59
+ [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
60
+ [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
61
+ [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value,
62
+ [nsInput.b("hidden")]: props.type === "hidden"
63
+ },
64
+ rawAttrs.class
65
+ ]);
66
+ const wrapperKls = computed(() => [
67
+ nsInput.e("wrapper"),
68
+ nsInput.is("focus", isFocused.value)
69
+ ]);
70
+ const attrs = useAttrs$1({
71
+ excludeKeys: computed(() => {
72
+ return Object.keys(containerAttrs.value);
73
+ })
74
+ });
75
+ const { form: elForm, formItem: elFormItem } = useFormItem();
76
+ const { inputId } = useFormItemInputId(props, {
77
+ formItemContext: elFormItem
78
+ });
79
+ const inputSize = useFormSize();
80
+ const inputDisabled = useFormDisabled();
81
+ const nsInput = useNamespace("input");
82
+ const nsTextarea = useNamespace("textarea");
83
+ const input = shallowRef();
84
+ const textarea = shallowRef();
85
+ const hovering = ref(false);
86
+ const isComposing = ref(false);
87
+ const passwordVisible = ref(false);
88
+ const countStyle = ref();
89
+ const textareaCalcStyle = shallowRef(props.inputStyle);
90
+ const _ref = computed(() => input.value || textarea.value);
91
+ const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(_ref, {
92
+ afterBlur() {
93
+ var _a;
94
+ if (props.validateEvent) {
95
+ (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "blur").catch((err) => debugWarn(err));
96
+ }
97
+ }
98
+ });
99
+ const needStatusIcon = computed(() => {
100
+ var _a;
101
+ return (_a = elForm == null ? void 0 : elForm.statusIcon) != null ? _a : false;
102
+ });
103
+ const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
104
+ const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
105
+ const passwordIcon = computed(() => passwordVisible.value ? View : Hide);
106
+ const containerStyle = computed(() => [
107
+ rawAttrs.style
108
+ ]);
109
+ const textareaStyle = computed(() => [
110
+ props.inputStyle,
111
+ textareaCalcStyle.value,
112
+ { resize: props.resize }
113
+ ]);
114
+ const nativeInputValue = computed(() => isNil(props.modelValue) ? "" : String(props.modelValue));
115
+ const showClear = computed(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value));
116
+ const showPwdVisible = computed(() => props.showPassword && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (!!nativeInputValue.value || isFocused.value));
117
+ const isWordLimitVisible = computed(() => props.showWordLimit && !!props.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
118
+ const textLength = computed(() => nativeInputValue.value.length);
119
+ const inputExceed = computed(() => !!isWordLimitVisible.value && textLength.value > Number(props.maxlength));
120
+ const suffixVisible = computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
121
+ const [recordCursor, setCursor] = useCursor(input);
122
+ useResizeObserver(textarea, (entries) => {
123
+ onceInitSizeTextarea();
124
+ if (!isWordLimitVisible.value || props.resize !== "both")
125
+ return;
126
+ const entry = entries[0];
127
+ const { width } = entry.contentRect;
128
+ countStyle.value = {
129
+ right: `calc(100% - ${width + 15 + 6}px)`
130
+ };
131
+ });
132
+ const resizeTextarea = () => {
133
+ const { type, autosize } = props;
134
+ if (!isClient || type !== "textarea" || !textarea.value)
135
+ return;
136
+ if (autosize) {
137
+ const minRows = isObject(autosize) ? autosize.minRows : void 0;
138
+ const maxRows = isObject(autosize) ? autosize.maxRows : void 0;
139
+ const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows);
140
+ textareaCalcStyle.value = {
141
+ overflowY: "hidden",
142
+ ...textareaStyle2
143
+ };
144
+ nextTick(() => {
145
+ textarea.value.offsetHeight;
146
+ textareaCalcStyle.value = textareaStyle2;
147
+ });
148
+ } else {
149
+ textareaCalcStyle.value = {
150
+ minHeight: calcTextareaHeight(textarea.value).minHeight
151
+ };
152
+ }
153
+ };
154
+ const createOnceInitResize = (resizeTextarea2) => {
155
+ let isInit = false;
156
+ return () => {
157
+ var _a;
158
+ if (isInit || !props.autosize)
159
+ return;
160
+ const isElHidden = ((_a = textarea.value) == null ? void 0 : _a.offsetParent) === null;
161
+ if (!isElHidden) {
162
+ resizeTextarea2();
163
+ isInit = true;
164
+ }
165
+ };
166
+ };
167
+ const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
168
+ const setNativeInputValue = () => {
169
+ const input2 = _ref.value;
170
+ const formatterValue = props.formatter ? props.formatter(nativeInputValue.value) : nativeInputValue.value;
171
+ if (!input2 || input2.value === formatterValue)
172
+ return;
173
+ input2.value = formatterValue;
174
+ };
175
+ const handleInput = async (event) => {
176
+ recordCursor();
177
+ let { value } = event.target;
178
+ if (props.formatter) {
179
+ value = props.parser ? props.parser(value) : value;
180
+ }
181
+ if (isComposing.value)
182
+ return;
183
+ if (value === nativeInputValue.value) {
184
+ setNativeInputValue();
185
+ return;
186
+ }
187
+ emit(UPDATE_MODEL_EVENT, value);
188
+ emit("input", value);
189
+ await nextTick();
190
+ setNativeInputValue();
191
+ setCursor();
192
+ };
193
+ const handleChange = (event) => {
194
+ emit("change", event.target.value);
195
+ };
196
+ const handleCompositionStart = (event) => {
197
+ emit("compositionstart", event);
198
+ isComposing.value = true;
199
+ };
200
+ const handleCompositionUpdate = (event) => {
201
+ var _a;
202
+ emit("compositionupdate", event);
203
+ const text = (_a = event.target) == null ? void 0 : _a.value;
204
+ const lastCharacter = text[text.length - 1] || "";
205
+ isComposing.value = !isKorean(lastCharacter);
206
+ };
207
+ const handleCompositionEnd = (event) => {
208
+ emit("compositionend", event);
209
+ if (isComposing.value) {
210
+ isComposing.value = false;
211
+ handleInput(event);
212
+ }
213
+ };
214
+ const handlePasswordVisible = () => {
215
+ passwordVisible.value = !passwordVisible.value;
216
+ focus();
217
+ };
218
+ const focus = async () => {
219
+ var _a;
220
+ await nextTick();
221
+ (_a = _ref.value) == null ? void 0 : _a.focus();
222
+ };
223
+ const blur = () => {
224
+ var _a;
225
+ return (_a = _ref.value) == null ? void 0 : _a.blur();
226
+ };
227
+ const handleMouseLeave = (evt) => {
228
+ hovering.value = false;
229
+ emit("mouseleave", evt);
230
+ };
231
+ const handleMouseEnter = (evt) => {
232
+ hovering.value = true;
233
+ emit("mouseenter", evt);
234
+ };
235
+ const handleKeydown = (evt) => {
236
+ emit("keydown", evt);
237
+ };
238
+ const select = () => {
239
+ var _a;
240
+ (_a = _ref.value) == null ? void 0 : _a.select();
241
+ };
242
+ const clear = () => {
243
+ emit(UPDATE_MODEL_EVENT, "");
244
+ emit("change", "");
245
+ emit("clear");
246
+ emit("input", "");
247
+ };
248
+ watch(() => props.modelValue, () => {
249
+ var _a;
250
+ nextTick(() => resizeTextarea());
251
+ if (props.validateEvent) {
252
+ (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err));
253
+ }
254
+ });
255
+ watch(nativeInputValue, () => setNativeInputValue());
256
+ watch(() => props.type, async () => {
257
+ await nextTick();
258
+ setNativeInputValue();
259
+ resizeTextarea();
260
+ });
261
+ onMounted(() => {
262
+ if (!props.formatter && props.parser) {
263
+ debugWarn("ElInput", "If you set the parser, you also need to set the formatter.");
264
+ }
265
+ setNativeInputValue();
266
+ nextTick(resizeTextarea);
267
+ });
268
+ useDeprecated({
269
+ from: "label",
270
+ replacement: "aria-label",
271
+ version: "2.8.0",
272
+ scope: "el-input",
273
+ ref: "https://element-plus.org/en-US/component/input.html"
274
+ }, computed(() => !!props.label));
275
+ expose({
276
+ input,
277
+ textarea,
278
+ ref: _ref,
279
+ textareaStyle,
280
+ autosize: toRef(props, "autosize"),
281
+ focus,
282
+ blur,
283
+ select,
284
+ clear,
285
+ resizeTextarea
286
+ });
287
+ return (_ctx, _cache) => {
288
+ return openBlock(), createElementBlock("div", mergeProps(unref(containerAttrs), {
289
+ class: unref(containerKls),
290
+ style: unref(containerStyle),
291
+ role: _ctx.containerRole,
292
+ onMouseenter: handleMouseEnter,
293
+ onMouseleave: handleMouseLeave
294
+ }), [
295
+ createCommentVNode(" input "),
296
+ _ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
297
+ createCommentVNode(" prepend slot "),
298
+ _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
299
+ key: 0,
300
+ class: normalizeClass(unref(nsInput).be("group", "prepend"))
301
+ }, [
302
+ renderSlot(_ctx.$slots, "prepend")
303
+ ], 2)) : createCommentVNode("v-if", true),
304
+ createElementVNode("div", {
305
+ ref_key: "wrapperRef",
306
+ ref: wrapperRef,
307
+ class: normalizeClass(unref(wrapperKls))
308
+ }, [
309
+ createCommentVNode(" prefix slot "),
310
+ _ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
311
+ key: 0,
312
+ class: normalizeClass(unref(nsInput).e("prefix"))
313
+ }, [
314
+ createElementVNode("span", {
315
+ class: normalizeClass(unref(nsInput).e("prefix-inner"))
316
+ }, [
317
+ renderSlot(_ctx.$slots, "prefix"),
318
+ _ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
319
+ key: 0,
320
+ class: normalizeClass(unref(nsInput).e("icon"))
321
+ }, {
322
+ default: withCtx(() => [
323
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
324
+ ]),
325
+ _: 1
326
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
327
+ ], 2)
328
+ ], 2)) : createCommentVNode("v-if", true),
329
+ createElementVNode("input", mergeProps({
330
+ id: unref(inputId),
331
+ ref_key: "input",
332
+ ref: input,
333
+ class: unref(nsInput).e("inner")
334
+ }, unref(attrs), {
335
+ minlength: _ctx.minlength,
336
+ maxlength: _ctx.maxlength,
337
+ type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
338
+ disabled: unref(inputDisabled),
339
+ readonly: _ctx.readonly,
340
+ autocomplete: _ctx.autocomplete,
341
+ tabindex: _ctx.tabindex,
342
+ "aria-label": _ctx.label || _ctx.ariaLabel,
343
+ placeholder: _ctx.placeholder,
344
+ style: _ctx.inputStyle,
345
+ form: _ctx.form,
346
+ autofocus: _ctx.autofocus,
347
+ onCompositionstart: handleCompositionStart,
348
+ onCompositionupdate: handleCompositionUpdate,
349
+ onCompositionend: handleCompositionEnd,
350
+ onInput: handleInput,
351
+ onFocus: _cache[0] || (_cache[0] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
352
+ onBlur: _cache[1] || (_cache[1] = (...args) => unref(handleBlur) && unref(handleBlur)(...args)),
353
+ onChange: handleChange,
354
+ onKeydown: handleKeydown
355
+ }), null, 16, _hoisted_2),
356
+ createCommentVNode(" suffix slot "),
357
+ unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
358
+ key: 1,
359
+ class: normalizeClass(unref(nsInput).e("suffix"))
360
+ }, [
361
+ createElementVNode("span", {
362
+ class: normalizeClass(unref(nsInput).e("suffix-inner"))
363
+ }, [
364
+ !unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
365
+ renderSlot(_ctx.$slots, "suffix"),
366
+ _ctx.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
367
+ key: 0,
368
+ class: normalizeClass(unref(nsInput).e("icon"))
369
+ }, {
370
+ default: withCtx(() => [
371
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
372
+ ]),
373
+ _: 1
374
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
375
+ ], 64)) : createCommentVNode("v-if", true),
376
+ unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
377
+ key: 1,
378
+ class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
379
+ onMousedown: withModifiers(unref(NOOP), ["prevent"]),
380
+ onClick: clear
381
+ }, {
382
+ default: withCtx(() => [
383
+ createVNode(unref(CircleClose))
384
+ ]),
385
+ _: 1
386
+ }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
387
+ unref(showPwdVisible) ? (openBlock(), createBlock(unref(ElIcon), {
388
+ key: 2,
389
+ class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
390
+ onClick: handlePasswordVisible
391
+ }, {
392
+ default: withCtx(() => [
393
+ (openBlock(), createBlock(resolveDynamicComponent(unref(passwordIcon))))
394
+ ]),
395
+ _: 1
396
+ }, 8, ["class"])) : createCommentVNode("v-if", true),
397
+ unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
398
+ key: 3,
399
+ class: normalizeClass(unref(nsInput).e("count"))
400
+ }, [
401
+ createElementVNode("span", {
402
+ class: normalizeClass(unref(nsInput).e("count-inner"))
403
+ }, toDisplayString(unref(textLength)) + " / " + toDisplayString(_ctx.maxlength), 3)
404
+ ], 2)) : createCommentVNode("v-if", true),
405
+ unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
406
+ key: 4,
407
+ class: normalizeClass([
408
+ unref(nsInput).e("icon"),
409
+ unref(nsInput).e("validateIcon"),
410
+ unref(nsInput).is("loading", unref(validateState) === "validating")
411
+ ])
412
+ }, {
413
+ default: withCtx(() => [
414
+ (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
415
+ ]),
416
+ _: 1
417
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
418
+ ], 2)
419
+ ], 2)) : createCommentVNode("v-if", true)
420
+ ], 2),
421
+ createCommentVNode(" append slot "),
422
+ _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
423
+ key: 1,
424
+ class: normalizeClass(unref(nsInput).be("group", "append"))
425
+ }, [
426
+ renderSlot(_ctx.$slots, "append")
427
+ ], 2)) : createCommentVNode("v-if", true)
428
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
429
+ createCommentVNode(" textarea "),
430
+ createElementVNode("textarea", mergeProps({
431
+ id: unref(inputId),
432
+ ref_key: "textarea",
433
+ ref: textarea,
434
+ class: unref(nsTextarea).e("inner")
435
+ }, unref(attrs), {
436
+ minlength: _ctx.minlength,
437
+ maxlength: _ctx.maxlength,
438
+ tabindex: _ctx.tabindex,
439
+ disabled: unref(inputDisabled),
440
+ readonly: _ctx.readonly,
441
+ autocomplete: _ctx.autocomplete,
442
+ style: unref(textareaStyle),
443
+ "aria-label": _ctx.label || _ctx.ariaLabel,
444
+ placeholder: _ctx.placeholder,
445
+ form: _ctx.form,
446
+ autofocus: _ctx.autofocus,
447
+ onCompositionstart: handleCompositionStart,
448
+ onCompositionupdate: handleCompositionUpdate,
449
+ onCompositionend: handleCompositionEnd,
450
+ onInput: handleInput,
451
+ onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
452
+ onBlur: _cache[3] || (_cache[3] = (...args) => unref(handleBlur) && unref(handleBlur)(...args)),
453
+ onChange: handleChange,
454
+ onKeydown: handleKeydown
455
+ }), null, 16, _hoisted_3),
456
+ unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
457
+ key: 0,
458
+ style: normalizeStyle(countStyle.value),
459
+ class: normalizeClass(unref(nsInput).e("count"))
460
+ }, toDisplayString(unref(textLength)) + " / " + toDisplayString(_ctx.maxlength), 7)) : createCommentVNode("v-if", true)
461
+ ], 64))
462
+ ], 16, _hoisted_1);
463
+ };
464
+ }
108
465
  });
109
- const inputEmits = {
110
- [UPDATE_MODEL_EVENT]: (value) => isString(value),
111
- input: (value) => isString(value),
112
- change: (value) => isString(value),
113
- focus: (evt) => evt instanceof FocusEvent,
114
- blur: (evt) => evt instanceof FocusEvent,
115
- clear: () => true,
116
- mouseleave: (evt) => evt instanceof MouseEvent,
117
- mouseenter: (evt) => evt instanceof MouseEvent,
118
- keydown: (evt) => evt instanceof Event,
119
- compositionstart: (evt) => evt instanceof CompositionEvent,
120
- compositionupdate: (evt) => evt instanceof CompositionEvent,
121
- compositionend: (evt) => evt instanceof CompositionEvent
122
- };
466
+ var Input = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "input.vue"]]);
123
467
 
124
- export { inputEmits, inputProps };
468
+ export { Input as default };
125
469
  //# sourceMappingURL=input2.mjs.map