@element-plus/nightly 0.0.20241218 → 0.0.20241220

Sign up to get free protection for your applications and to get access to all the features.
Files changed (582) 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/ms.js +1 -1
  152. package/dist/locale/ms.min.js +1 -1
  153. package/dist/locale/ms.min.mjs +1 -1
  154. package/dist/locale/ms.mjs +1 -1
  155. package/dist/locale/my.js +1 -1
  156. package/dist/locale/my.min.js +1 -1
  157. package/dist/locale/my.min.mjs +1 -1
  158. package/dist/locale/my.mjs +1 -1
  159. package/dist/locale/nb-no.js +1 -1
  160. package/dist/locale/nb-no.min.js +1 -1
  161. package/dist/locale/nb-no.min.mjs +1 -1
  162. package/dist/locale/nb-no.mjs +1 -1
  163. package/dist/locale/nl.js +1 -1
  164. package/dist/locale/nl.min.js +1 -1
  165. package/dist/locale/nl.min.mjs +1 -1
  166. package/dist/locale/nl.mjs +1 -1
  167. package/dist/locale/pa.js +1 -1
  168. package/dist/locale/pa.min.js +1 -1
  169. package/dist/locale/pa.min.mjs +1 -1
  170. package/dist/locale/pa.mjs +1 -1
  171. package/dist/locale/pl.js +1 -1
  172. package/dist/locale/pl.min.js +1 -1
  173. package/dist/locale/pl.min.mjs +1 -1
  174. package/dist/locale/pl.mjs +1 -1
  175. package/dist/locale/pt-br.js +1 -1
  176. package/dist/locale/pt-br.min.js +1 -1
  177. package/dist/locale/pt-br.min.mjs +1 -1
  178. package/dist/locale/pt-br.mjs +1 -1
  179. package/dist/locale/pt.js +1 -1
  180. package/dist/locale/pt.min.js +1 -1
  181. package/dist/locale/pt.min.mjs +1 -1
  182. package/dist/locale/pt.mjs +1 -1
  183. package/dist/locale/ro.js +1 -1
  184. package/dist/locale/ro.min.js +1 -1
  185. package/dist/locale/ro.min.mjs +1 -1
  186. package/dist/locale/ro.mjs +1 -1
  187. package/dist/locale/ru.js +1 -1
  188. package/dist/locale/ru.min.js +1 -1
  189. package/dist/locale/ru.min.mjs +1 -1
  190. package/dist/locale/ru.mjs +1 -1
  191. package/dist/locale/sk.js +1 -1
  192. package/dist/locale/sk.min.js +1 -1
  193. package/dist/locale/sk.min.mjs +1 -1
  194. package/dist/locale/sk.mjs +1 -1
  195. package/dist/locale/sl.js +1 -1
  196. package/dist/locale/sl.min.js +1 -1
  197. package/dist/locale/sl.min.mjs +1 -1
  198. package/dist/locale/sl.mjs +1 -1
  199. package/dist/locale/sr.js +1 -1
  200. package/dist/locale/sr.min.js +1 -1
  201. package/dist/locale/sr.min.mjs +1 -1
  202. package/dist/locale/sr.mjs +1 -1
  203. package/dist/locale/sv.js +1 -1
  204. package/dist/locale/sv.min.js +1 -1
  205. package/dist/locale/sv.min.mjs +1 -1
  206. package/dist/locale/sv.mjs +1 -1
  207. package/dist/locale/sw.js +1 -1
  208. package/dist/locale/sw.min.js +1 -1
  209. package/dist/locale/sw.min.mjs +1 -1
  210. package/dist/locale/sw.mjs +1 -1
  211. package/dist/locale/ta.js +1 -1
  212. package/dist/locale/ta.min.js +1 -1
  213. package/dist/locale/ta.min.mjs +1 -1
  214. package/dist/locale/ta.mjs +1 -1
  215. package/dist/locale/th.js +1 -1
  216. package/dist/locale/th.min.js +1 -1
  217. package/dist/locale/th.min.mjs +1 -1
  218. package/dist/locale/th.mjs +1 -1
  219. package/dist/locale/tk.js +1 -1
  220. package/dist/locale/tk.min.js +1 -1
  221. package/dist/locale/tk.min.mjs +1 -1
  222. package/dist/locale/tk.mjs +1 -1
  223. package/dist/locale/tr.js +1 -1
  224. package/dist/locale/tr.min.js +1 -1
  225. package/dist/locale/tr.min.mjs +1 -1
  226. package/dist/locale/tr.mjs +1 -1
  227. package/dist/locale/ug-cn.js +1 -1
  228. package/dist/locale/ug-cn.min.js +1 -1
  229. package/dist/locale/ug-cn.min.mjs +1 -1
  230. package/dist/locale/ug-cn.mjs +1 -1
  231. package/dist/locale/uk.js +1 -1
  232. package/dist/locale/uk.min.js +1 -1
  233. package/dist/locale/uk.min.mjs +1 -1
  234. package/dist/locale/uk.mjs +1 -1
  235. package/dist/locale/uz-uz.js +1 -1
  236. package/dist/locale/uz-uz.min.js +1 -1
  237. package/dist/locale/uz-uz.min.mjs +1 -1
  238. package/dist/locale/uz-uz.mjs +1 -1
  239. package/dist/locale/vi.js +1 -1
  240. package/dist/locale/vi.min.js +1 -1
  241. package/dist/locale/vi.min.mjs +1 -1
  242. package/dist/locale/vi.mjs +1 -1
  243. package/dist/locale/zh-cn.js +1 -1
  244. package/dist/locale/zh-cn.min.js +1 -1
  245. package/dist/locale/zh-cn.min.mjs +1 -1
  246. package/dist/locale/zh-cn.mjs +1 -1
  247. package/dist/locale/zh-tw.js +1 -1
  248. package/dist/locale/zh-tw.min.js +1 -1
  249. package/dist/locale/zh-tw.min.mjs +1 -1
  250. package/dist/locale/zh-tw.mjs +1 -1
  251. package/es/components/anchor/index.mjs +1 -1
  252. package/es/components/anchor/src/anchor-link.mjs +81 -5
  253. package/es/components/anchor/src/anchor-link.mjs.map +1 -1
  254. package/es/components/anchor/src/anchor-link2.mjs +5 -81
  255. package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
  256. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  257. package/es/components/badge/index.mjs +2 -2
  258. package/es/components/badge/src/badge.mjs +71 -32
  259. package/es/components/badge/src/badge.mjs.map +1 -1
  260. package/es/components/badge/src/badge2.mjs +32 -71
  261. package/es/components/badge/src/badge2.mjs.map +1 -1
  262. package/es/components/breadcrumb/index.mjs +2 -2
  263. package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -8
  264. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  265. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +8 -56
  266. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  267. package/es/components/button/index.mjs +1 -1
  268. package/es/components/button/src/button-group.mjs +6 -29
  269. package/es/components/button/src/button-group.mjs.map +1 -1
  270. package/es/components/button/src/button-group2.mjs +29 -6
  271. package/es/components/button/src/button-group2.mjs.map +1 -1
  272. package/es/components/carousel/index.mjs +2 -2
  273. package/es/components/carousel/src/carousel-item.mjs +69 -7
  274. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  275. package/es/components/carousel/src/carousel-item2.mjs +7 -69
  276. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  277. package/es/components/cascader/src/cascader.mjs +1 -1
  278. package/es/components/collapse/index.mjs +2 -2
  279. package/es/components/collapse/src/collapse.mjs +28 -16
  280. package/es/components/collapse/src/collapse.mjs.map +1 -1
  281. package/es/components/collapse/src/collapse2.mjs +16 -28
  282. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  283. package/es/components/color-picker/src/color-picker.mjs +1 -1
  284. package/es/components/dialog/index.mjs +2 -2
  285. package/es/components/dialog/src/dialog.mjs +168 -64
  286. package/es/components/dialog/src/dialog.mjs.map +1 -1
  287. package/es/components/dialog/src/dialog2.mjs +64 -168
  288. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  289. package/es/components/drawer/src/drawer.mjs +1 -1
  290. package/es/components/dropdown/index.mjs +2 -2
  291. package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -2
  292. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  293. package/es/components/dropdown/src/dropdown-menu.mjs +2 -2
  294. package/es/components/dropdown/src/dropdown.mjs +298 -102
  295. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  296. package/es/components/dropdown/src/dropdown2.mjs +102 -298
  297. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  298. package/es/components/form/index.mjs +2 -2
  299. package/es/components/form/src/form.mjs +151 -53
  300. package/es/components/form/src/form.mjs.map +1 -1
  301. package/es/components/form/src/form2.mjs +53 -151
  302. package/es/components/form/src/form2.mjs.map +1 -1
  303. package/es/components/image/index.mjs +2 -2
  304. package/es/components/image/src/image.mjs +232 -64
  305. package/es/components/image/src/image.mjs.map +1 -1
  306. package/es/components/image/src/image2.mjs +64 -232
  307. package/es/components/image/src/image2.mjs.map +1 -1
  308. package/es/components/index.mjs +21 -21
  309. package/es/components/input/index.mjs +2 -2
  310. package/es/components/input/src/input.mjs +431 -102
  311. package/es/components/input/src/input.mjs.map +1 -1
  312. package/es/components/input/src/input2.mjs +102 -431
  313. package/es/components/input/src/input2.mjs.map +1 -1
  314. package/es/components/input-number/index.mjs +2 -2
  315. package/es/components/input-number/src/input-number.mjs +60 -349
  316. package/es/components/input-number/src/input-number.mjs.map +1 -1
  317. package/es/components/input-number/src/input-number2.mjs +349 -60
  318. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  319. package/es/components/mention/index.mjs +2 -2
  320. package/es/components/mention/src/mention-dropdown.mjs +166 -15
  321. package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
  322. package/es/components/mention/src/mention-dropdown2.mjs +15 -166
  323. package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
  324. package/es/components/mention/src/mention.mjs +283 -63
  325. package/es/components/mention/src/mention.mjs.map +1 -1
  326. package/es/components/mention/src/mention2.mjs +63 -283
  327. package/es/components/mention/src/mention2.mjs.map +1 -1
  328. package/es/components/menu/index.mjs +2 -2
  329. package/es/components/menu/src/menu-item-group.mjs +34 -4
  330. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  331. package/es/components/menu/src/menu-item-group2.mjs +4 -34
  332. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  333. package/es/components/message/index.mjs +1 -1
  334. package/es/components/message/src/message.mjs +145 -91
  335. package/es/components/message/src/message.mjs.map +1 -1
  336. package/es/components/message/src/message2.mjs +91 -145
  337. package/es/components/message/src/message2.mjs.map +1 -1
  338. package/es/components/message/src/method.mjs +2 -2
  339. package/es/components/pagination/src/components/total.mjs +26 -6
  340. package/es/components/pagination/src/components/total.mjs.map +1 -1
  341. package/es/components/pagination/src/components/total2.mjs +6 -26
  342. package/es/components/pagination/src/components/total2.mjs.map +1 -1
  343. package/es/components/pagination/src/pagination.mjs +1 -1
  344. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  345. package/es/components/popover/src/popover.mjs +2 -2
  346. package/es/components/popper/index.mjs +2 -2
  347. package/es/components/popper/src/popper.mjs +22 -32
  348. package/es/components/popper/src/popper.mjs.map +1 -1
  349. package/es/components/popper/src/popper2.mjs +32 -22
  350. package/es/components/popper/src/popper2.mjs.map +1 -1
  351. package/es/components/progress/index.mjs +2 -2
  352. package/es/components/progress/src/progress.mjs +207 -53
  353. package/es/components/progress/src/progress.mjs.map +1 -1
  354. package/es/components/progress/src/progress2.mjs +53 -207
  355. package/es/components/progress/src/progress2.mjs.map +1 -1
  356. package/es/components/roving-focus-group/index.mjs +3 -3
  357. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  358. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -27
  359. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  360. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -27
  361. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  362. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  363. package/es/components/segmented/index.mjs +2 -2
  364. package/es/components/segmented/src/segmented.mjs +33 -167
  365. package/es/components/segmented/src/segmented.mjs.map +1 -1
  366. package/es/components/segmented/src/segmented2.mjs +167 -33
  367. package/es/components/segmented/src/segmented2.mjs.map +1 -1
  368. package/es/components/select/src/select.mjs +1 -1
  369. package/es/components/select-v2/src/defaults.mjs +1 -1
  370. package/es/components/slider/src/button.mjs +89 -19
  371. package/es/components/slider/src/button.mjs.map +1 -1
  372. package/es/components/slider/src/button2.mjs +19 -89
  373. package/es/components/slider/src/button2.mjs.map +1 -1
  374. package/es/components/slider/src/slider2.mjs +1 -1
  375. package/es/components/switch/index.mjs +2 -2
  376. package/es/components/switch/src/switch.mjs +72 -228
  377. package/es/components/switch/src/switch.mjs.map +1 -1
  378. package/es/components/switch/src/switch2.mjs +228 -72
  379. package/es/components/switch/src/switch2.mjs.map +1 -1
  380. package/es/components/text/index.mjs +2 -2
  381. package/es/components/text/src/text.mjs +21 -36
  382. package/es/components/text/src/text.mjs.map +1 -1
  383. package/es/components/text/src/text2.mjs +36 -21
  384. package/es/components/text/src/text2.mjs.map +1 -1
  385. package/es/components/time-select/index.mjs +2 -2
  386. package/es/components/time-select/src/time-select.mjs +123 -50
  387. package/es/components/time-select/src/time-select.mjs.map +1 -1
  388. package/es/components/time-select/src/time-select2.mjs +50 -123
  389. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  390. package/es/components/tooltip/index.mjs +1 -1
  391. package/es/components/tooltip/src/content.mjs +183 -28
  392. package/es/components/tooltip/src/content.mjs.map +1 -1
  393. package/es/components/tooltip/src/content2.mjs +28 -183
  394. package/es/components/tooltip/src/content2.mjs.map +1 -1
  395. package/es/components/tooltip/src/tooltip.mjs +2 -2
  396. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  397. package/es/components/tooltip-v2/index.mjs +1 -1
  398. package/es/components/tooltip-v2/src/arrow.mjs +21 -37
  399. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  400. package/es/components/tooltip-v2/src/arrow2.mjs +37 -21
  401. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  402. package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
  403. package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
  404. package/es/components/tour/index.mjs +1 -1
  405. package/es/components/tour/src/content.mjs +43 -67
  406. package/es/components/tour/src/content.mjs.map +1 -1
  407. package/es/components/tour/src/content2.mjs +67 -43
  408. package/es/components/tour/src/content2.mjs.map +1 -1
  409. package/es/components/tour/src/step.mjs +1 -1
  410. package/es/components/tour/src/tour.mjs +1 -1
  411. package/es/components/tour/src/tour2.mjs +1 -1
  412. package/es/index.mjs +21 -21
  413. package/es/version.d.ts +1 -1
  414. package/es/version.mjs +1 -1
  415. package/es/version.mjs.map +1 -1
  416. package/lib/components/anchor/index.js +1 -1
  417. package/lib/components/anchor/src/anchor-link.js +81 -5
  418. package/lib/components/anchor/src/anchor-link.js.map +1 -1
  419. package/lib/components/anchor/src/anchor-link2.js +5 -81
  420. package/lib/components/anchor/src/anchor-link2.js.map +1 -1
  421. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  422. package/lib/components/badge/index.js +2 -2
  423. package/lib/components/badge/src/badge.js +71 -32
  424. package/lib/components/badge/src/badge.js.map +1 -1
  425. package/lib/components/badge/src/badge2.js +32 -71
  426. package/lib/components/badge/src/badge2.js.map +1 -1
  427. package/lib/components/breadcrumb/index.js +2 -2
  428. package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -8
  429. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  430. package/lib/components/breadcrumb/src/breadcrumb-item2.js +8 -56
  431. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  432. package/lib/components/button/index.js +1 -1
  433. package/lib/components/button/src/button-group.js +6 -29
  434. package/lib/components/button/src/button-group.js.map +1 -1
  435. package/lib/components/button/src/button-group2.js +29 -6
  436. package/lib/components/button/src/button-group2.js.map +1 -1
  437. package/lib/components/carousel/index.js +2 -2
  438. package/lib/components/carousel/src/carousel-item.js +69 -7
  439. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  440. package/lib/components/carousel/src/carousel-item2.js +7 -69
  441. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  442. package/lib/components/cascader/src/cascader.js +1 -1
  443. package/lib/components/collapse/index.js +2 -2
  444. package/lib/components/collapse/src/collapse.js +28 -18
  445. package/lib/components/collapse/src/collapse.js.map +1 -1
  446. package/lib/components/collapse/src/collapse2.js +18 -28
  447. package/lib/components/collapse/src/collapse2.js.map +1 -1
  448. package/lib/components/color-picker/src/color-picker.js +1 -1
  449. package/lib/components/dialog/index.js +2 -2
  450. package/lib/components/dialog/src/dialog.js +168 -65
  451. package/lib/components/dialog/src/dialog.js.map +1 -1
  452. package/lib/components/dialog/src/dialog2.js +65 -168
  453. package/lib/components/dialog/src/dialog2.js.map +1 -1
  454. package/lib/components/drawer/src/drawer.js +1 -1
  455. package/lib/components/dropdown/index.js +2 -2
  456. package/lib/components/dropdown/src/dropdown-item-impl.js +2 -2
  457. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  458. package/lib/components/dropdown/src/dropdown-menu.js +2 -2
  459. package/lib/components/dropdown/src/dropdown.js +298 -111
  460. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  461. package/lib/components/dropdown/src/dropdown2.js +111 -298
  462. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  463. package/lib/components/form/index.js +2 -2
  464. package/lib/components/form/src/form.js +150 -54
  465. package/lib/components/form/src/form.js.map +1 -1
  466. package/lib/components/form/src/form2.js +54 -150
  467. package/lib/components/form/src/form2.js.map +1 -1
  468. package/lib/components/image/index.js +2 -2
  469. package/lib/components/image/src/image.js +231 -64
  470. package/lib/components/image/src/image.js.map +1 -1
  471. package/lib/components/image/src/image2.js +64 -231
  472. package/lib/components/image/src/image2.js.map +1 -1
  473. package/lib/components/index.js +21 -21
  474. package/lib/components/input/index.js +2 -2
  475. package/lib/components/input/src/input.js +430 -102
  476. package/lib/components/input/src/input.js.map +1 -1
  477. package/lib/components/input/src/input2.js +102 -430
  478. package/lib/components/input/src/input2.js.map +1 -1
  479. package/lib/components/input-number/index.js +2 -2
  480. package/lib/components/input-number/src/input-number.js +59 -347
  481. package/lib/components/input-number/src/input-number.js.map +1 -1
  482. package/lib/components/input-number/src/input-number2.js +347 -59
  483. package/lib/components/input-number/src/input-number2.js.map +1 -1
  484. package/lib/components/mention/index.js +2 -2
  485. package/lib/components/mention/src/mention-dropdown.js +166 -16
  486. package/lib/components/mention/src/mention-dropdown.js.map +1 -1
  487. package/lib/components/mention/src/mention-dropdown2.js +16 -166
  488. package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
  489. package/lib/components/mention/src/mention.js +281 -62
  490. package/lib/components/mention/src/mention.js.map +1 -1
  491. package/lib/components/mention/src/mention2.js +62 -281
  492. package/lib/components/mention/src/mention2.js.map +1 -1
  493. package/lib/components/menu/index.js +2 -2
  494. package/lib/components/menu/src/menu-item-group.js +34 -4
  495. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  496. package/lib/components/menu/src/menu-item-group2.js +4 -34
  497. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  498. package/lib/components/message/index.js +1 -1
  499. package/lib/components/message/src/message.js +144 -93
  500. package/lib/components/message/src/message.js.map +1 -1
  501. package/lib/components/message/src/message2.js +93 -144
  502. package/lib/components/message/src/message2.js.map +1 -1
  503. package/lib/components/message/src/method.js +2 -2
  504. package/lib/components/pagination/src/components/total.js +26 -6
  505. package/lib/components/pagination/src/components/total.js.map +1 -1
  506. package/lib/components/pagination/src/components/total2.js +6 -26
  507. package/lib/components/pagination/src/components/total2.js.map +1 -1
  508. package/lib/components/pagination/src/pagination.js +1 -1
  509. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  510. package/lib/components/popover/src/popover.js +2 -2
  511. package/lib/components/popper/index.js +2 -2
  512. package/lib/components/popper/src/popper.js +25 -32
  513. package/lib/components/popper/src/popper.js.map +1 -1
  514. package/lib/components/popper/src/popper2.js +32 -25
  515. package/lib/components/popper/src/popper2.js.map +1 -1
  516. package/lib/components/progress/index.js +2 -2
  517. package/lib/components/progress/src/progress.js +207 -53
  518. package/lib/components/progress/src/progress.js.map +1 -1
  519. package/lib/components/progress/src/progress2.js +53 -207
  520. package/lib/components/progress/src/progress2.js.map +1 -1
  521. package/lib/components/roving-focus-group/index.js +2 -2
  522. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  523. package/lib/components/roving-focus-group/src/roving-focus-group.js +31 -27
  524. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  525. package/lib/components/roving-focus-group/src/roving-focus-group2.js +27 -31
  526. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  527. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  528. package/lib/components/segmented/index.js +2 -2
  529. package/lib/components/segmented/src/segmented.js +34 -167
  530. package/lib/components/segmented/src/segmented.js.map +1 -1
  531. package/lib/components/segmented/src/segmented2.js +167 -34
  532. package/lib/components/segmented/src/segmented2.js.map +1 -1
  533. package/lib/components/select/src/select.js +1 -1
  534. package/lib/components/select-v2/src/defaults.js +1 -1
  535. package/lib/components/slider/src/button.js +89 -20
  536. package/lib/components/slider/src/button.js.map +1 -1
  537. package/lib/components/slider/src/button2.js +20 -89
  538. package/lib/components/slider/src/button2.js.map +1 -1
  539. package/lib/components/slider/src/slider2.js +1 -1
  540. package/lib/components/switch/index.js +2 -2
  541. package/lib/components/switch/src/switch.js +72 -227
  542. package/lib/components/switch/src/switch.js.map +1 -1
  543. package/lib/components/switch/src/switch2.js +227 -72
  544. package/lib/components/switch/src/switch2.js.map +1 -1
  545. package/lib/components/text/index.js +2 -2
  546. package/lib/components/text/src/text.js +21 -36
  547. package/lib/components/text/src/text.js.map +1 -1
  548. package/lib/components/text/src/text2.js +36 -21
  549. package/lib/components/text/src/text2.js.map +1 -1
  550. package/lib/components/time-select/index.js +2 -2
  551. package/lib/components/time-select/src/time-select.js +128 -50
  552. package/lib/components/time-select/src/time-select.js.map +1 -1
  553. package/lib/components/time-select/src/time-select2.js +50 -128
  554. package/lib/components/time-select/src/time-select2.js.map +1 -1
  555. package/lib/components/tooltip/index.js +1 -1
  556. package/lib/components/tooltip/src/content.js +183 -28
  557. package/lib/components/tooltip/src/content.js.map +1 -1
  558. package/lib/components/tooltip/src/content2.js +28 -183
  559. package/lib/components/tooltip/src/content2.js.map +1 -1
  560. package/lib/components/tooltip/src/tooltip.js +2 -2
  561. package/lib/components/tooltip/src/tooltip2.js +1 -1
  562. package/lib/components/tooltip-v2/index.js +1 -1
  563. package/lib/components/tooltip-v2/src/arrow.js +22 -37
  564. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  565. package/lib/components/tooltip-v2/src/arrow2.js +37 -22
  566. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  567. package/lib/components/tooltip-v2/src/tooltip.js +1 -1
  568. package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
  569. package/lib/components/tour/index.js +1 -1
  570. package/lib/components/tour/src/content.js +46 -67
  571. package/lib/components/tour/src/content.js.map +1 -1
  572. package/lib/components/tour/src/content2.js +67 -46
  573. package/lib/components/tour/src/content2.js.map +1 -1
  574. package/lib/components/tour/src/step.js +1 -1
  575. package/lib/components/tour/src/tour.js +1 -1
  576. package/lib/components/tour/src/tour2.js +1 -1
  577. package/lib/index.js +21 -21
  578. package/lib/version.d.ts +1 -1
  579. package/lib/version.js +1 -1
  580. package/lib/version.js.map +1 -1
  581. package/package.json +2 -2
  582. package/web-types.json +1 -1
@@ -1,65 +1,354 @@
1
+ import { defineComponent, ref, reactive, computed, watch, onMounted, onUpdated, openBlock, createElementBlock, normalizeClass, unref, withModifiers, withDirectives, withKeys, renderSlot, createVNode, withCtx, createBlock, createCommentVNode, createSlots } from 'vue';
1
2
  import { isNil } from 'lodash-unified';
2
- import { buildProps } from '../../../utils/vue/props/runtime.mjs';
3
- import { useSizeProp } from '../../../hooks/use-size/index.mjs';
4
- import { isNumber } from '../../../utils/types.mjs';
5
- import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
6
- import { CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
3
+ import { ElInput } from '../../input/index.mjs';
4
+ import { ElIcon } from '../../icon/index.mjs';
5
+ import { ArrowDown, Minus, ArrowUp, Plus } from '@element-plus/icons-vue';
6
+ import { inputNumberProps, inputNumberEmits } from './input-number.mjs';
7
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
+ import { vRepeatClick } from '../../../directives/repeat-click/index.mjs';
9
+ import { useLocale } from '../../../hooks/use-locale/index.mjs';
10
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { useFormItem } from '../../form/src/hooks/use-form-item.mjs';
12
+ import { isNumber, isUndefined } from '../../../utils/types.mjs';
13
+ import { debugWarn, throwError } from '../../../utils/error.mjs';
14
+ import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
15
+ import { UPDATE_MODEL_EVENT, INPUT_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
16
+ import { isString } from '@vue/shared';
17
+ import { isFirefox } from '../../../utils/browser.mjs';
7
18
 
8
- const inputNumberProps = buildProps({
9
- id: {
10
- type: String,
11
- default: void 0
12
- },
13
- step: {
14
- type: Number,
15
- default: 1
16
- },
17
- stepStrictly: Boolean,
18
- max: {
19
- type: Number,
20
- default: Number.POSITIVE_INFINITY
21
- },
22
- min: {
23
- type: Number,
24
- default: Number.NEGATIVE_INFINITY
25
- },
26
- modelValue: Number,
27
- readonly: Boolean,
28
- disabled: Boolean,
29
- size: useSizeProp,
30
- controls: {
31
- type: Boolean,
32
- default: true
33
- },
34
- controlsPosition: {
35
- type: String,
36
- default: "",
37
- values: ["", "right"]
38
- },
39
- valueOnClear: {
40
- type: [String, Number, null],
41
- validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
42
- default: null
43
- },
44
- name: String,
45
- placeholder: String,
46
- precision: {
47
- type: Number,
48
- validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
49
- },
50
- validateEvent: {
51
- type: Boolean,
52
- default: true
53
- },
54
- ...useAriaProps(["ariaLabel"])
19
+ const __default__ = defineComponent({
20
+ name: "ElInputNumber"
55
21
  });
56
- const inputNumberEmits = {
57
- [CHANGE_EVENT]: (cur, prev) => prev !== cur,
58
- blur: (e) => e instanceof FocusEvent,
59
- focus: (e) => e instanceof FocusEvent,
60
- [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
61
- [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
62
- };
22
+ const _sfc_main = /* @__PURE__ */ defineComponent({
23
+ ...__default__,
24
+ props: inputNumberProps,
25
+ emits: inputNumberEmits,
26
+ setup(__props, { expose, emit }) {
27
+ const props = __props;
28
+ const { t } = useLocale();
29
+ const ns = useNamespace("input-number");
30
+ const input = ref();
31
+ const data = reactive({
32
+ currentValue: props.modelValue,
33
+ userInput: null
34
+ });
35
+ const { formItem } = useFormItem();
36
+ const minDisabled = computed(() => isNumber(props.modelValue) && props.modelValue <= props.min);
37
+ const maxDisabled = computed(() => isNumber(props.modelValue) && props.modelValue >= props.max);
38
+ const numPrecision = computed(() => {
39
+ const stepPrecision = getPrecision(props.step);
40
+ if (!isUndefined(props.precision)) {
41
+ if (stepPrecision > props.precision) {
42
+ debugWarn("InputNumber", "precision should not be less than the decimal places of step");
43
+ }
44
+ return props.precision;
45
+ } else {
46
+ return Math.max(getPrecision(props.modelValue), stepPrecision);
47
+ }
48
+ });
49
+ const controlsAtRight = computed(() => {
50
+ return props.controls && props.controlsPosition === "right";
51
+ });
52
+ const inputNumberSize = useFormSize();
53
+ const inputNumberDisabled = useFormDisabled();
54
+ const displayValue = computed(() => {
55
+ if (data.userInput !== null) {
56
+ return data.userInput;
57
+ }
58
+ let currentValue = data.currentValue;
59
+ if (isNil(currentValue))
60
+ return "";
61
+ if (isNumber(currentValue)) {
62
+ if (Number.isNaN(currentValue))
63
+ return "";
64
+ if (!isUndefined(props.precision)) {
65
+ currentValue = currentValue.toFixed(props.precision);
66
+ }
67
+ }
68
+ return currentValue;
69
+ });
70
+ const toPrecision = (num, pre) => {
71
+ if (isUndefined(pre))
72
+ pre = numPrecision.value;
73
+ if (pre === 0)
74
+ return Math.round(num);
75
+ let snum = String(num);
76
+ const pointPos = snum.indexOf(".");
77
+ if (pointPos === -1)
78
+ return num;
79
+ const nums = snum.replace(".", "").split("");
80
+ const datum = nums[pointPos + pre];
81
+ if (!datum)
82
+ return num;
83
+ const length = snum.length;
84
+ if (snum.charAt(length - 1) === "5") {
85
+ snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
86
+ }
87
+ return Number.parseFloat(Number(snum).toFixed(pre));
88
+ };
89
+ const getPrecision = (value) => {
90
+ if (isNil(value))
91
+ return 0;
92
+ const valueString = value.toString();
93
+ const dotPosition = valueString.indexOf(".");
94
+ let precision = 0;
95
+ if (dotPosition !== -1) {
96
+ precision = valueString.length - dotPosition - 1;
97
+ }
98
+ return precision;
99
+ };
100
+ const ensurePrecision = (val, coefficient = 1) => {
101
+ if (!isNumber(val))
102
+ return data.currentValue;
103
+ return toPrecision(val + props.step * coefficient);
104
+ };
105
+ const increase = () => {
106
+ if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
107
+ return;
108
+ const value = Number(displayValue.value) || 0;
109
+ const newVal = ensurePrecision(value);
110
+ setCurrentValue(newVal);
111
+ emit(INPUT_EVENT, data.currentValue);
112
+ setCurrentValueToModelValue();
113
+ };
114
+ const decrease = () => {
115
+ if (props.readonly || inputNumberDisabled.value || minDisabled.value)
116
+ return;
117
+ const value = Number(displayValue.value) || 0;
118
+ const newVal = ensurePrecision(value, -1);
119
+ setCurrentValue(newVal);
120
+ emit(INPUT_EVENT, data.currentValue);
121
+ setCurrentValueToModelValue();
122
+ };
123
+ const verifyValue = (value, update) => {
124
+ const { max, min, step, precision, stepStrictly, valueOnClear } = props;
125
+ if (max < min) {
126
+ throwError("InputNumber", "min should not be greater than max.");
127
+ }
128
+ let newVal = Number(value);
129
+ if (isNil(value) || Number.isNaN(newVal)) {
130
+ return null;
131
+ }
132
+ if (value === "") {
133
+ if (valueOnClear === null) {
134
+ return null;
135
+ }
136
+ newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear;
137
+ }
138
+ if (stepStrictly) {
139
+ newVal = toPrecision(Math.round(newVal / step) * step, precision);
140
+ if (newVal !== value) {
141
+ update && emit(UPDATE_MODEL_EVENT, newVal);
142
+ }
143
+ }
144
+ if (!isUndefined(precision)) {
145
+ newVal = toPrecision(newVal, precision);
146
+ }
147
+ if (newVal > max || newVal < min) {
148
+ newVal = newVal > max ? max : min;
149
+ update && emit(UPDATE_MODEL_EVENT, newVal);
150
+ }
151
+ return newVal;
152
+ };
153
+ const setCurrentValue = (value, emitChange = true) => {
154
+ var _a;
155
+ const oldVal = data.currentValue;
156
+ const newVal = verifyValue(value);
157
+ if (!emitChange) {
158
+ emit(UPDATE_MODEL_EVENT, newVal);
159
+ return;
160
+ }
161
+ if (oldVal === newVal && value)
162
+ return;
163
+ data.userInput = null;
164
+ emit(UPDATE_MODEL_EVENT, newVal);
165
+ if (oldVal !== newVal) {
166
+ emit(CHANGE_EVENT, newVal, oldVal);
167
+ }
168
+ if (props.validateEvent) {
169
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
170
+ }
171
+ data.currentValue = newVal;
172
+ };
173
+ const handleInput = (value) => {
174
+ data.userInput = value;
175
+ const newVal = value === "" ? null : Number(value);
176
+ emit(INPUT_EVENT, newVal);
177
+ setCurrentValue(newVal, false);
178
+ };
179
+ const handleInputChange = (value) => {
180
+ const newVal = value !== "" ? Number(value) : "";
181
+ if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
182
+ setCurrentValue(newVal);
183
+ }
184
+ setCurrentValueToModelValue();
185
+ data.userInput = null;
186
+ };
187
+ const focus = () => {
188
+ var _a, _b;
189
+ (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
190
+ };
191
+ const blur = () => {
192
+ var _a, _b;
193
+ (_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
194
+ };
195
+ const handleFocus = (event) => {
196
+ emit("focus", event);
197
+ };
198
+ const handleBlur = (event) => {
199
+ var _a, _b;
200
+ data.userInput = null;
201
+ if (isFirefox() && data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) {
202
+ input.value.input.value = "";
203
+ }
204
+ emit("blur", event);
205
+ if (props.validateEvent) {
206
+ (_b = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b.call(formItem, "blur").catch((err) => debugWarn(err));
207
+ }
208
+ };
209
+ const setCurrentValueToModelValue = () => {
210
+ if (data.currentValue !== props.modelValue) {
211
+ data.currentValue = props.modelValue;
212
+ }
213
+ };
214
+ const handleWheel = (e) => {
215
+ if (document.activeElement === e.target)
216
+ e.preventDefault();
217
+ };
218
+ watch(() => props.modelValue, (value, oldValue) => {
219
+ const newValue = verifyValue(value, true);
220
+ if (data.userInput === null && newValue !== oldValue) {
221
+ data.currentValue = newValue;
222
+ }
223
+ }, { immediate: true });
224
+ onMounted(() => {
225
+ var _a;
226
+ const { min, max, modelValue } = props;
227
+ const innerInput = (_a = input.value) == null ? void 0 : _a.input;
228
+ innerInput.setAttribute("role", "spinbutton");
229
+ if (Number.isFinite(max)) {
230
+ innerInput.setAttribute("aria-valuemax", String(max));
231
+ } else {
232
+ innerInput.removeAttribute("aria-valuemax");
233
+ }
234
+ if (Number.isFinite(min)) {
235
+ innerInput.setAttribute("aria-valuemin", String(min));
236
+ } else {
237
+ innerInput.removeAttribute("aria-valuemin");
238
+ }
239
+ innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
240
+ innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
241
+ if (!isNumber(modelValue) && modelValue != null) {
242
+ let val = Number(modelValue);
243
+ if (Number.isNaN(val)) {
244
+ val = null;
245
+ }
246
+ emit(UPDATE_MODEL_EVENT, val);
247
+ }
248
+ innerInput.addEventListener("wheel", handleWheel, { passive: false });
249
+ });
250
+ onUpdated(() => {
251
+ var _a, _b;
252
+ const innerInput = (_a = input.value) == null ? void 0 : _a.input;
253
+ innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${(_b = data.currentValue) != null ? _b : ""}`);
254
+ });
255
+ expose({
256
+ focus,
257
+ blur
258
+ });
259
+ return (_ctx, _cache) => {
260
+ return openBlock(), createElementBlock("div", {
261
+ class: normalizeClass([
262
+ unref(ns).b(),
263
+ unref(ns).m(unref(inputNumberSize)),
264
+ unref(ns).is("disabled", unref(inputNumberDisabled)),
265
+ unref(ns).is("without-controls", !_ctx.controls),
266
+ unref(ns).is("controls-right", unref(controlsAtRight))
267
+ ]),
268
+ onDragstart: withModifiers(() => {
269
+ }, ["prevent"])
270
+ }, [
271
+ _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
272
+ key: 0,
273
+ role: "button",
274
+ "aria-label": unref(t)("el.inputNumber.decrease"),
275
+ class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", unref(minDisabled))]),
276
+ onKeydown: withKeys(decrease, ["enter"])
277
+ }, [
278
+ renderSlot(_ctx.$slots, "decrease-icon", {}, () => [
279
+ createVNode(unref(ElIcon), null, {
280
+ default: withCtx(() => [
281
+ unref(controlsAtRight) ? (openBlock(), createBlock(unref(ArrowDown), { key: 0 })) : (openBlock(), createBlock(unref(Minus), { key: 1 }))
282
+ ]),
283
+ _: 1
284
+ })
285
+ ])
286
+ ], 42, ["aria-label", "onKeydown"])), [
287
+ [unref(vRepeatClick), decrease]
288
+ ]) : createCommentVNode("v-if", true),
289
+ _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
290
+ key: 1,
291
+ role: "button",
292
+ "aria-label": unref(t)("el.inputNumber.increase"),
293
+ class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
294
+ onKeydown: withKeys(increase, ["enter"])
295
+ }, [
296
+ renderSlot(_ctx.$slots, "increase-icon", {}, () => [
297
+ createVNode(unref(ElIcon), null, {
298
+ default: withCtx(() => [
299
+ unref(controlsAtRight) ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(Plus), { key: 1 }))
300
+ ]),
301
+ _: 1
302
+ })
303
+ ])
304
+ ], 42, ["aria-label", "onKeydown"])), [
305
+ [unref(vRepeatClick), increase]
306
+ ]) : createCommentVNode("v-if", true),
307
+ createVNode(unref(ElInput), {
308
+ id: _ctx.id,
309
+ ref_key: "input",
310
+ ref: input,
311
+ type: "number",
312
+ step: _ctx.step,
313
+ "model-value": unref(displayValue),
314
+ placeholder: _ctx.placeholder,
315
+ readonly: _ctx.readonly,
316
+ disabled: unref(inputNumberDisabled),
317
+ size: unref(inputNumberSize),
318
+ max: _ctx.max,
319
+ min: _ctx.min,
320
+ name: _ctx.name,
321
+ "aria-label": _ctx.ariaLabel,
322
+ "validate-event": false,
323
+ onKeydown: [
324
+ withKeys(withModifiers(increase, ["prevent"]), ["up"]),
325
+ withKeys(withModifiers(decrease, ["prevent"]), ["down"])
326
+ ],
327
+ onBlur: handleBlur,
328
+ onFocus: handleFocus,
329
+ onInput: handleInput,
330
+ onChange: handleInputChange
331
+ }, createSlots({
332
+ _: 2
333
+ }, [
334
+ _ctx.$slots.prefix ? {
335
+ name: "prefix",
336
+ fn: withCtx(() => [
337
+ renderSlot(_ctx.$slots, "prefix")
338
+ ])
339
+ } : void 0,
340
+ _ctx.$slots.suffix ? {
341
+ name: "suffix",
342
+ fn: withCtx(() => [
343
+ renderSlot(_ctx.$slots, "suffix")
344
+ ])
345
+ } : void 0
346
+ ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
347
+ ], 42, ["onDragstart"]);
348
+ };
349
+ }
350
+ });
351
+ var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "input-number.vue"]]);
63
352
 
64
- export { inputNumberEmits, inputNumberProps };
353
+ export { InputNumber as default };
65
354
  //# sourceMappingURL=input-number2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-number2.mjs","sources":["../../../../../../packages/components/input-number/src/input-number.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { buildProps, isNumber } from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type InputNumber from './input-number.vue'\n\nexport const inputNumberProps = buildProps({\n /**\n * @description same as `id` in native input\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description incremental step\n */\n step: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether input value can only be multiple of step\n */\n stepStrictly: Boolean,\n /**\n * @description the maximum allowed value\n */\n max: {\n type: Number,\n default: Number.POSITIVE_INFINITY,\n },\n /**\n * @description the minimum allowed value\n */\n min: {\n type: Number,\n default: Number.NEGATIVE_INFINITY,\n },\n /**\n * @description binding value\n */\n modelValue: Number,\n /**\n * @description same as `readonly` in native input\n */\n readonly: Boolean,\n /**\n * @description whether the component is disabled\n */\n disabled: Boolean,\n /**\n * @description size of the component\n */\n size: useSizeProp,\n /**\n * @description whether to enable the control buttons\n */\n controls: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of the control buttons\n */\n controlsPosition: {\n type: String,\n default: '',\n values: ['', 'right'],\n },\n /**\n * @description value should be set when input box is cleared\n */\n valueOnClear: {\n type: [String, Number, null],\n validator: (val: 'min' | 'max' | number | null) =>\n val === null || isNumber(val) || ['min', 'max'].includes(val),\n default: null,\n },\n /**\n * @description same as `name` in native input\n */\n name: String,\n /**\n * @description same as `placeholder` in native input\n */\n placeholder: String,\n /**\n * @description precision of input value\n */\n precision: {\n type: Number,\n validator: (val: number) =>\n val >= 0 && val === Number.parseInt(`${val}`, 10),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\nexport type InputNumberProps = ExtractPropTypes<typeof inputNumberProps>\n\nexport const inputNumberEmits = {\n [CHANGE_EVENT]: (cur: number | undefined, prev: number | undefined) =>\n prev !== cur,\n blur: (e: FocusEvent) => e instanceof FocusEvent,\n focus: (e: FocusEvent) => e instanceof FocusEvent,\n [INPUT_EVENT]: (val: number | null | undefined) =>\n isNumber(val) || isNil(val),\n [UPDATE_MODEL_EVENT]: (val: number | undefined) =>\n isNumber(val) || isNil(val),\n}\nexport type InputNumberEmits = typeof inputNumberEmits\n\nexport type InputNumberInstance = InstanceType<typeof InputNumber>\n"],"names":[],"mappings":";;;;;;;AAQY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,YAAY,EAAE,OAAO;AACvB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM,CAAC,iBAAiB;AACrC,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM,CAAC,iBAAiB;AACrC,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC;A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/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n @keydown.up.prevent=\"increase\"\n @keydown.down.prevent=\"decrease\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n isFirefox,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits, inputNumberProps } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = defineProps(inputNumberProps)\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(Math.round(newVal / step) * step, precision)\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n if (oldVal === newVal && value) return\n data.userInput = null\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n // This is a Firefox-specific problem. When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (isFirefox() && data.currentValue === null && input.value?.input) {\n input.value.input.value = ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;mCAsGc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,QAAQ,GAAmB,EAAA,CAAA;AAMjC,IAAA,MAAM,OAAO,QAAe,CAAA;AAAA,MAC1B,cAAc,KAAM,CAAA,UAAA;AAAA,MACpB,SA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AA,EAAA,GAAA,IAAA,CAAA,YAAA,KAAA,IAAA,GAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- import Mention from './src/mention2.mjs';
2
- export { mentionEmits, mentionProps } from './src/mention.mjs';
1
+ import Mention from './src/mention.mjs';
2
+ export { mentionEmits, mentionProps } from './src/mention2.mjs';
3
3
  import { withInstall } from '../../utils/vue/install.mjs';
4
4
 
5
5
  const ElMention = withInstall(Mention);
@@ -1,19 +1,170 @@
1
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
2
- import { isString } from '@vue/shared';
1
+ import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createCommentVNode, withDirectives, createVNode, withCtx, Fragment, renderList, withModifiers, createElementVNode, toDisplayString, vShow, createTextVNode, nextTick } from 'vue';
2
+ import { ElScrollbar } from '../../scrollbar/index.mjs';
3
+ import { mentionDropdownProps, mentionDropdownEmits } from './mention-dropdown2.mjs';
4
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
5
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
6
+ import { useLocale } from '../../../hooks/use-locale/index.mjs';
7
+ import { scrollIntoView } from '../../../utils/dom/scroll.mjs';
3
8
 
4
- const mentionDropdownProps = buildProps({
5
- options: {
6
- type: definePropType(Array),
7
- default: () => []
8
- },
9
- loading: Boolean,
10
- disabled: Boolean,
11
- contentId: String,
12
- ariaLabel: String
9
+ const __default__ = defineComponent({
10
+ name: "ElMentionDropdown"
13
11
  });
14
- const mentionDropdownEmits = {
15
- select: (option) => isString(option.value)
16
- };
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ ...__default__,
14
+ props: mentionDropdownProps,
15
+ emits: mentionDropdownEmits,
16
+ setup(__props, { expose, emit }) {
17
+ const props = __props;
18
+ const ns = useNamespace("mention");
19
+ const { t } = useLocale();
20
+ const hoveringIndex = ref(-1);
21
+ const scrollbarRef = ref();
22
+ const optionRefs = ref();
23
+ const dropdownRef = ref();
24
+ const optionkls = (item, index) => [
25
+ ns.be("dropdown", "item"),
26
+ ns.is("hovering", hoveringIndex.value === index),
27
+ ns.is("disabled", item.disabled || props.disabled)
28
+ ];
29
+ const handleSelect = (item) => {
30
+ if (item.disabled || props.disabled)
31
+ return;
32
+ emit("select", item);
33
+ };
34
+ const handleMouseEnter = (index) => {
35
+ hoveringIndex.value = index;
36
+ };
37
+ const filteredAllDisabled = computed(() => props.disabled || props.options.every((item) => item.disabled));
38
+ const hoverOption = computed(() => props.options[hoveringIndex.value]);
39
+ const selectHoverOption = () => {
40
+ if (!hoverOption.value)
41
+ return;
42
+ emit("select", hoverOption.value);
43
+ };
44
+ const navigateOptions = (direction) => {
45
+ const { options } = props;
46
+ if (options.length === 0 || filteredAllDisabled.value)
47
+ return;
48
+ if (direction === "next") {
49
+ hoveringIndex.value++;
50
+ if (hoveringIndex.value === options.length) {
51
+ hoveringIndex.value = 0;
52
+ }
53
+ } else if (direction === "prev") {
54
+ hoveringIndex.value--;
55
+ if (hoveringIndex.value < 0) {
56
+ hoveringIndex.value = options.length - 1;
57
+ }
58
+ }
59
+ const option = options[hoveringIndex.value];
60
+ if (option.disabled) {
61
+ navigateOptions(direction);
62
+ return;
63
+ }
64
+ nextTick(() => scrollToOption(option));
65
+ };
66
+ const scrollToOption = (option) => {
67
+ var _a, _b, _c, _d;
68
+ const { options } = props;
69
+ const index = options.findIndex((item) => item.value === option.value);
70
+ const target = (_a = optionRefs.value) == null ? void 0 : _a[index];
71
+ if (target) {
72
+ const menu = (_c = (_b = dropdownRef.value) == null ? void 0 : _b.querySelector) == null ? void 0 : _c.call(_b, `.${ns.be("dropdown", "wrap")}`);
73
+ if (menu) {
74
+ scrollIntoView(menu, target);
75
+ }
76
+ }
77
+ (_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll();
78
+ };
79
+ const resetHoveringIndex = () => {
80
+ if (filteredAllDisabled.value || props.options.length === 0) {
81
+ hoveringIndex.value = -1;
82
+ } else {
83
+ hoveringIndex.value = 0;
84
+ }
85
+ };
86
+ watch(() => props.options, resetHoveringIndex, {
87
+ immediate: true
88
+ });
89
+ expose({
90
+ hoveringIndex,
91
+ navigateOptions,
92
+ selectHoverOption,
93
+ hoverOption
94
+ });
95
+ return (_ctx, _cache) => {
96
+ return openBlock(), createElementBlock("div", {
97
+ ref_key: "dropdownRef",
98
+ ref: dropdownRef,
99
+ class: normalizeClass(unref(ns).b("dropdown"))
100
+ }, [
101
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
102
+ key: 0,
103
+ class: normalizeClass(unref(ns).be("dropdown", "header"))
104
+ }, [
105
+ renderSlot(_ctx.$slots, "header")
106
+ ], 2)) : createCommentVNode("v-if", true),
107
+ withDirectives(createVNode(unref(ElScrollbar), {
108
+ id: _ctx.contentId,
109
+ ref_key: "scrollbarRef",
110
+ ref: scrollbarRef,
111
+ tag: "ul",
112
+ "wrap-class": unref(ns).be("dropdown", "wrap"),
113
+ "view-class": unref(ns).be("dropdown", "list"),
114
+ role: "listbox",
115
+ "aria-label": _ctx.ariaLabel,
116
+ "aria-orientation": "vertical"
117
+ }, {
118
+ default: withCtx(() => [
119
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
120
+ return openBlock(), createElementBlock("li", {
121
+ id: `${_ctx.contentId}-${index}`,
122
+ ref_for: true,
123
+ ref_key: "optionRefs",
124
+ ref: optionRefs,
125
+ key: index,
126
+ class: normalizeClass(optionkls(item, index)),
127
+ role: "option",
128
+ "aria-disabled": item.disabled || _ctx.disabled || void 0,
129
+ "aria-selected": hoveringIndex.value === index,
130
+ onMousemove: ($event) => handleMouseEnter(index),
131
+ onClick: withModifiers(($event) => handleSelect(item), ["stop"])
132
+ }, [
133
+ renderSlot(_ctx.$slots, "label", {
134
+ item,
135
+ index
136
+ }, () => {
137
+ var _a;
138
+ return [
139
+ createElementVNode("span", null, toDisplayString((_a = item.label) != null ? _a : item.value), 1)
140
+ ];
141
+ })
142
+ ], 42, ["id", "aria-disabled", "aria-selected", "onMousemove", "onClick"]);
143
+ }), 128))
144
+ ]),
145
+ _: 3
146
+ }, 8, ["id", "wrap-class", "view-class", "aria-label"]), [
147
+ [vShow, _ctx.options.length > 0 && !_ctx.loading]
148
+ ]),
149
+ _ctx.loading ? (openBlock(), createElementBlock("div", {
150
+ key: 1,
151
+ class: normalizeClass(unref(ns).be("dropdown", "loading"))
152
+ }, [
153
+ renderSlot(_ctx.$slots, "loading", {}, () => [
154
+ createTextVNode(toDisplayString(unref(t)("el.mention.loading")), 1)
155
+ ])
156
+ ], 2)) : createCommentVNode("v-if", true),
157
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
158
+ key: 2,
159
+ class: normalizeClass(unref(ns).be("dropdown", "footer"))
160
+ }, [
161
+ renderSlot(_ctx.$slots, "footer")
162
+ ], 2)) : createCommentVNode("v-if", true)
163
+ ], 2);
164
+ };
165
+ }
166
+ });
167
+ var ElMentionDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "mention-dropdown.vue"]]);
17
168
 
18
- export { mentionDropdownEmits, mentionDropdownProps };
169
+ export { ElMentionDropdown as default };
19
170
  //# sourceMappingURL=mention-dropdown.mjs.map