@element-plus/nightly 0.0.20240529 → 0.0.20240530

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