@element-plus/nightly 0.0.20240124 → 0.0.20240125

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