@element-plus/nightly 0.0.20240401 → 0.0.20240403

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