@element-plus/nightly 0.0.20250123 → 0.0.20250124

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 (524) hide show
  1. package/dist/index.full.js +29 -15
  2. package/dist/index.full.min.js +9 -17
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +9 -17
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +29 -15
  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/hi.js +1 -1
  92. package/dist/locale/hi.min.js +1 -1
  93. package/dist/locale/hi.min.mjs +1 -1
  94. package/dist/locale/hi.mjs +1 -1
  95. package/dist/locale/hr.js +1 -1
  96. package/dist/locale/hr.min.js +1 -1
  97. package/dist/locale/hr.min.mjs +1 -1
  98. package/dist/locale/hr.mjs +1 -1
  99. package/dist/locale/hu.js +1 -1
  100. package/dist/locale/hu.min.js +1 -1
  101. package/dist/locale/hu.min.mjs +1 -1
  102. package/dist/locale/hu.mjs +1 -1
  103. package/dist/locale/hy-am.js +1 -1
  104. package/dist/locale/hy-am.min.js +1 -1
  105. package/dist/locale/hy-am.min.mjs +1 -1
  106. package/dist/locale/hy-am.mjs +1 -1
  107. package/dist/locale/id.js +1 -1
  108. package/dist/locale/id.min.js +1 -1
  109. package/dist/locale/id.min.mjs +1 -1
  110. package/dist/locale/id.mjs +1 -1
  111. package/dist/locale/it.js +1 -1
  112. package/dist/locale/it.min.js +1 -1
  113. package/dist/locale/it.min.mjs +1 -1
  114. package/dist/locale/it.mjs +1 -1
  115. package/dist/locale/ja.js +1 -1
  116. package/dist/locale/ja.min.js +1 -1
  117. package/dist/locale/ja.min.mjs +1 -1
  118. package/dist/locale/ja.mjs +1 -1
  119. package/dist/locale/kk.js +1 -1
  120. package/dist/locale/kk.min.js +1 -1
  121. package/dist/locale/kk.min.mjs +1 -1
  122. package/dist/locale/kk.mjs +1 -1
  123. package/dist/locale/km.js +1 -1
  124. package/dist/locale/km.min.js +1 -1
  125. package/dist/locale/km.min.mjs +1 -1
  126. package/dist/locale/km.mjs +1 -1
  127. package/dist/locale/ko.js +1 -1
  128. package/dist/locale/ko.min.js +1 -1
  129. package/dist/locale/ko.min.mjs +1 -1
  130. package/dist/locale/ko.mjs +1 -1
  131. package/dist/locale/ku.js +1 -1
  132. package/dist/locale/ku.min.js +1 -1
  133. package/dist/locale/ku.min.mjs +1 -1
  134. package/dist/locale/ku.mjs +1 -1
  135. package/dist/locale/ky.js +1 -1
  136. package/dist/locale/ky.min.js +1 -1
  137. package/dist/locale/ky.min.mjs +1 -1
  138. package/dist/locale/ky.mjs +1 -1
  139. package/dist/locale/lt.js +1 -1
  140. package/dist/locale/lt.min.js +1 -1
  141. package/dist/locale/lt.min.mjs +1 -1
  142. package/dist/locale/lt.mjs +1 -1
  143. package/dist/locale/lv.js +1 -1
  144. package/dist/locale/lv.min.js +1 -1
  145. package/dist/locale/lv.min.mjs +1 -1
  146. package/dist/locale/lv.mjs +1 -1
  147. package/dist/locale/mg.js +1 -1
  148. package/dist/locale/mg.min.js +1 -1
  149. package/dist/locale/mg.min.mjs +1 -1
  150. package/dist/locale/mg.mjs +1 -1
  151. package/dist/locale/mn.js +1 -1
  152. package/dist/locale/mn.min.js +1 -1
  153. package/dist/locale/mn.min.mjs +1 -1
  154. package/dist/locale/mn.mjs +1 -1
  155. package/dist/locale/ms.js +1 -1
  156. package/dist/locale/ms.min.js +1 -1
  157. package/dist/locale/ms.min.mjs +1 -1
  158. package/dist/locale/ms.mjs +1 -1
  159. package/dist/locale/my.js +1 -1
  160. package/dist/locale/my.min.js +1 -1
  161. package/dist/locale/my.min.mjs +1 -1
  162. package/dist/locale/my.mjs +1 -1
  163. package/dist/locale/nb-no.js +1 -1
  164. package/dist/locale/nb-no.min.js +1 -1
  165. package/dist/locale/nb-no.min.mjs +1 -1
  166. package/dist/locale/nb-no.mjs +1 -1
  167. package/dist/locale/nl.js +1 -1
  168. package/dist/locale/nl.min.js +1 -1
  169. package/dist/locale/nl.min.mjs +1 -1
  170. package/dist/locale/nl.mjs +1 -1
  171. package/dist/locale/no.js +1 -1
  172. package/dist/locale/no.min.js +1 -1
  173. package/dist/locale/no.min.mjs +1 -1
  174. package/dist/locale/no.mjs +1 -1
  175. package/dist/locale/pa.js +1 -1
  176. package/dist/locale/pa.min.js +1 -1
  177. package/dist/locale/pa.min.mjs +1 -1
  178. package/dist/locale/pa.mjs +1 -1
  179. package/dist/locale/pl.js +1 -1
  180. package/dist/locale/pl.min.js +1 -1
  181. package/dist/locale/pl.min.mjs +1 -1
  182. package/dist/locale/pl.mjs +1 -1
  183. package/dist/locale/pt-br.js +1 -1
  184. package/dist/locale/pt-br.min.js +1 -1
  185. package/dist/locale/pt-br.min.mjs +1 -1
  186. package/dist/locale/pt-br.mjs +1 -1
  187. package/dist/locale/pt.js +1 -1
  188. package/dist/locale/pt.min.js +1 -1
  189. package/dist/locale/pt.min.mjs +1 -1
  190. package/dist/locale/pt.mjs +1 -1
  191. package/dist/locale/ro.js +1 -1
  192. package/dist/locale/ro.min.js +1 -1
  193. package/dist/locale/ro.min.mjs +1 -1
  194. package/dist/locale/ro.mjs +1 -1
  195. package/dist/locale/ru.js +1 -1
  196. package/dist/locale/ru.min.js +1 -1
  197. package/dist/locale/ru.min.mjs +1 -1
  198. package/dist/locale/ru.mjs +1 -1
  199. package/dist/locale/sk.js +1 -1
  200. package/dist/locale/sk.min.js +1 -1
  201. package/dist/locale/sk.min.mjs +1 -1
  202. package/dist/locale/sk.mjs +1 -1
  203. package/dist/locale/sl.js +1 -1
  204. package/dist/locale/sl.min.js +1 -1
  205. package/dist/locale/sl.min.mjs +1 -1
  206. package/dist/locale/sl.mjs +1 -1
  207. package/dist/locale/sr.js +1 -1
  208. package/dist/locale/sr.min.js +1 -1
  209. package/dist/locale/sr.min.mjs +1 -1
  210. package/dist/locale/sr.mjs +1 -1
  211. package/dist/locale/sv.js +1 -1
  212. package/dist/locale/sv.min.js +1 -1
  213. package/dist/locale/sv.min.mjs +1 -1
  214. package/dist/locale/sv.mjs +1 -1
  215. package/dist/locale/sw.js +1 -1
  216. package/dist/locale/sw.min.js +1 -1
  217. package/dist/locale/sw.min.mjs +1 -1
  218. package/dist/locale/sw.mjs +1 -1
  219. package/dist/locale/ta.js +1 -1
  220. package/dist/locale/ta.min.js +1 -1
  221. package/dist/locale/ta.min.mjs +1 -1
  222. package/dist/locale/ta.mjs +1 -1
  223. package/dist/locale/te.js +1 -1
  224. package/dist/locale/te.min.js +1 -1
  225. package/dist/locale/te.min.mjs +1 -1
  226. package/dist/locale/te.mjs +1 -1
  227. package/dist/locale/th.js +1 -1
  228. package/dist/locale/th.min.js +1 -1
  229. package/dist/locale/th.min.mjs +1 -1
  230. package/dist/locale/th.mjs +1 -1
  231. package/dist/locale/tk.js +1 -1
  232. package/dist/locale/tk.min.js +1 -1
  233. package/dist/locale/tk.min.mjs +1 -1
  234. package/dist/locale/tk.mjs +1 -1
  235. package/dist/locale/tr.js +1 -1
  236. package/dist/locale/tr.min.js +1 -1
  237. package/dist/locale/tr.min.mjs +1 -1
  238. package/dist/locale/tr.mjs +1 -1
  239. package/dist/locale/ug-cn.js +1 -1
  240. package/dist/locale/ug-cn.min.js +1 -1
  241. package/dist/locale/ug-cn.min.mjs +1 -1
  242. package/dist/locale/ug-cn.mjs +1 -1
  243. package/dist/locale/uk.js +1 -1
  244. package/dist/locale/uk.min.js +1 -1
  245. package/dist/locale/uk.min.mjs +1 -1
  246. package/dist/locale/uk.mjs +1 -1
  247. package/dist/locale/uz-uz.js +1 -1
  248. package/dist/locale/uz-uz.min.js +1 -1
  249. package/dist/locale/uz-uz.min.mjs +1 -1
  250. package/dist/locale/uz-uz.mjs +1 -1
  251. package/dist/locale/vi.js +1 -1
  252. package/dist/locale/vi.min.js +1 -1
  253. package/dist/locale/vi.min.mjs +1 -1
  254. package/dist/locale/vi.mjs +1 -1
  255. package/dist/locale/zh-cn.js +1 -1
  256. package/dist/locale/zh-cn.min.js +1 -1
  257. package/dist/locale/zh-cn.min.mjs +1 -1
  258. package/dist/locale/zh-cn.mjs +1 -1
  259. package/dist/locale/zh-hk.js +1 -1
  260. package/dist/locale/zh-hk.min.js +1 -1
  261. package/dist/locale/zh-hk.min.mjs +1 -1
  262. package/dist/locale/zh-hk.mjs +1 -1
  263. package/dist/locale/zh-mo.js +1 -1
  264. package/dist/locale/zh-mo.min.js +1 -1
  265. package/dist/locale/zh-mo.min.mjs +1 -1
  266. package/dist/locale/zh-mo.mjs +1 -1
  267. package/dist/locale/zh-tw.js +1 -1
  268. package/dist/locale/zh-tw.min.js +1 -1
  269. package/dist/locale/zh-tw.min.mjs +1 -1
  270. package/dist/locale/zh-tw.mjs +1 -1
  271. package/es/components/anchor/index.mjs +2 -2
  272. package/es/components/anchor/src/anchor.mjs +42 -192
  273. package/es/components/anchor/src/anchor.mjs.map +1 -1
  274. package/es/components/anchor/src/anchor2.mjs +192 -42
  275. package/es/components/anchor/src/anchor2.mjs.map +1 -1
  276. package/es/components/backtop/index.mjs +2 -2
  277. package/es/components/backtop/src/backtop.mjs +21 -53
  278. package/es/components/backtop/src/backtop.mjs.map +1 -1
  279. package/es/components/backtop/src/backtop2.mjs +53 -21
  280. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  281. package/es/components/cascader/src/cascader.mjs +1 -1
  282. package/es/components/cascader-panel/src/store.d.ts +1 -0
  283. package/es/components/cascader-panel/src/store.mjs +10 -2
  284. package/es/components/cascader-panel/src/store.mjs.map +1 -1
  285. package/es/components/collapse/index.mjs +2 -2
  286. package/es/components/collapse/src/collapse.mjs +28 -16
  287. package/es/components/collapse/src/collapse.mjs.map +1 -1
  288. package/es/components/collapse/src/collapse2.mjs +16 -28
  289. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  290. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  291. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  292. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  293. package/es/components/form/index.mjs +2 -2
  294. package/es/components/form/src/form-item.mjs +319 -47
  295. package/es/components/form/src/form-item.mjs.map +1 -1
  296. package/es/components/form/src/form-item2.mjs +47 -319
  297. package/es/components/form/src/form-item2.mjs.map +1 -1
  298. package/es/components/index.mjs +15 -15
  299. package/es/components/input/src/utils.mjs +15 -11
  300. package/es/components/input/src/utils.mjs.map +1 -1
  301. package/es/components/input-number/index.mjs +2 -2
  302. package/es/components/input-number/src/input-number.mjs +349 -60
  303. package/es/components/input-number/src/input-number.mjs.map +1 -1
  304. package/es/components/input-number/src/input-number2.mjs +60 -349
  305. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  306. package/es/components/input-tag/src/input-tag.mjs +1 -1
  307. package/es/components/menu/index.mjs +2 -2
  308. package/es/components/menu/src/menu-item.mjs +96 -14
  309. package/es/components/menu/src/menu-item.mjs.map +1 -1
  310. package/es/components/menu/src/menu-item2.mjs +14 -96
  311. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  312. package/es/components/notification/index.mjs +1 -1
  313. package/es/components/notification/src/notification.mjs +142 -68
  314. package/es/components/notification/src/notification.mjs.map +1 -1
  315. package/es/components/notification/src/notification2.mjs +68 -142
  316. package/es/components/notification/src/notification2.mjs.map +1 -1
  317. package/es/components/notification/src/notify.mjs +2 -2
  318. package/es/components/pagination/src/components/jumper.mjs +7 -58
  319. package/es/components/pagination/src/components/jumper.mjs.map +1 -1
  320. package/es/components/pagination/src/components/jumper2.mjs +58 -7
  321. package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
  322. package/es/components/pagination/src/components/next.mjs +18 -35
  323. package/es/components/pagination/src/components/next.mjs.map +1 -1
  324. package/es/components/pagination/src/components/next2.mjs +35 -18
  325. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  326. package/es/components/pagination/src/components/sizes.mjs +23 -71
  327. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  328. package/es/components/pagination/src/components/sizes2.mjs +71 -23
  329. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  330. package/es/components/pagination/src/pagination.mjs +3 -3
  331. package/es/components/popper/index.mjs +6 -6
  332. package/es/components/popper/src/content.mjs +132 -92
  333. package/es/components/popper/src/content.mjs.map +1 -1
  334. package/es/components/popper/src/content2.mjs +92 -132
  335. package/es/components/popper/src/content2.mjs.map +1 -1
  336. package/es/components/popper/src/popper.mjs +22 -32
  337. package/es/components/popper/src/popper.mjs.map +1 -1
  338. package/es/components/popper/src/popper2.mjs +32 -22
  339. package/es/components/popper/src/popper2.mjs.map +1 -1
  340. package/es/components/popper/src/trigger.mjs +31 -127
  341. package/es/components/popper/src/trigger.mjs.map +1 -1
  342. package/es/components/popper/src/trigger2.mjs +127 -31
  343. package/es/components/popper/src/trigger2.mjs.map +1 -1
  344. package/es/components/roving-focus-group/index.mjs +3 -3
  345. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  346. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -27
  347. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  348. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -27
  349. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  350. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  351. package/es/components/select/src/select.mjs +1 -1
  352. package/es/components/select-v2/src/defaults.mjs +1 -1
  353. package/es/components/skeleton/index.mjs +4 -4
  354. package/es/components/skeleton/src/skeleton-item.mjs +17 -22
  355. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  356. package/es/components/skeleton/src/skeleton-item2.mjs +22 -17
  357. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  358. package/es/components/skeleton/src/skeleton.mjs +48 -21
  359. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  360. package/es/components/skeleton/src/skeleton2.mjs +21 -48
  361. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  362. package/es/components/table-v2/src/table-v2.mjs +2 -0
  363. package/es/components/table-v2/src/table-v2.mjs.map +1 -1
  364. package/es/components/tag/index.mjs +2 -2
  365. package/es/components/tag/src/tag.mjs +99 -27
  366. package/es/components/tag/src/tag.mjs.map +1 -1
  367. package/es/components/tag/src/tag2.mjs +27 -99
  368. package/es/components/tag/src/tag2.mjs.map +1 -1
  369. package/es/components/tooltip/src/content.mjs +1 -1
  370. package/es/components/tooltip/src/content2.mjs +1 -1
  371. package/es/components/tooltip/src/tooltip.mjs +1 -1
  372. package/es/components/tooltip/src/trigger.mjs +1 -1
  373. package/es/components/tooltip/src/trigger2.mjs +1 -1
  374. package/es/components/tooltip-v2/index.mjs +4 -4
  375. package/es/components/tooltip-v2/src/root.mjs +79 -17
  376. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  377. package/es/components/tooltip-v2/src/root2.mjs +17 -79
  378. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  379. package/es/components/tooltip-v2/src/tooltip.mjs +19 -77
  380. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  381. package/es/components/tooltip-v2/src/tooltip2.mjs +77 -19
  382. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  383. package/es/components/tooltip-v2/src/trigger.mjs +12 -89
  384. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  385. package/es/components/tooltip-v2/src/trigger2.mjs +89 -12
  386. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  387. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  388. package/es/components/transfer/src/transfer-panel.mjs +19 -130
  389. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  390. package/es/components/transfer/src/transfer-panel2.mjs +130 -19
  391. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  392. package/es/components/transfer/src/transfer2.mjs +1 -1
  393. package/es/index.mjs +15 -15
  394. package/es/version.d.ts +1 -1
  395. package/es/version.mjs +1 -1
  396. package/es/version.mjs.map +1 -1
  397. package/lib/components/anchor/index.js +2 -2
  398. package/lib/components/anchor/src/anchor.js +42 -191
  399. package/lib/components/anchor/src/anchor.js.map +1 -1
  400. package/lib/components/anchor/src/anchor2.js +191 -42
  401. package/lib/components/anchor/src/anchor2.js.map +1 -1
  402. package/lib/components/backtop/index.js +2 -2
  403. package/lib/components/backtop/src/backtop.js +22 -53
  404. package/lib/components/backtop/src/backtop.js.map +1 -1
  405. package/lib/components/backtop/src/backtop2.js +53 -22
  406. package/lib/components/backtop/src/backtop2.js.map +1 -1
  407. package/lib/components/cascader/src/cascader.js +1 -1
  408. package/lib/components/cascader-panel/src/store.d.ts +1 -0
  409. package/lib/components/cascader-panel/src/store.js +10 -2
  410. package/lib/components/cascader-panel/src/store.js.map +1 -1
  411. package/lib/components/collapse/index.js +2 -2
  412. package/lib/components/collapse/src/collapse.js +28 -18
  413. package/lib/components/collapse/src/collapse.js.map +1 -1
  414. package/lib/components/collapse/src/collapse2.js +18 -28
  415. package/lib/components/collapse/src/collapse2.js.map +1 -1
  416. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  417. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  418. package/lib/components/dropdown/src/dropdown2.js +1 -1
  419. package/lib/components/form/index.js +2 -2
  420. package/lib/components/form/src/form-item.js +323 -48
  421. package/lib/components/form/src/form-item.js.map +1 -1
  422. package/lib/components/form/src/form-item2.js +48 -323
  423. package/lib/components/form/src/form-item2.js.map +1 -1
  424. package/lib/components/index.js +15 -15
  425. package/lib/components/input/src/utils.js +15 -11
  426. package/lib/components/input/src/utils.js.map +1 -1
  427. package/lib/components/input-number/index.js +2 -2
  428. package/lib/components/input-number/src/input-number.js +347 -59
  429. package/lib/components/input-number/src/input-number.js.map +1 -1
  430. package/lib/components/input-number/src/input-number2.js +59 -347
  431. package/lib/components/input-number/src/input-number2.js.map +1 -1
  432. package/lib/components/input-tag/src/input-tag.js +1 -1
  433. package/lib/components/menu/index.js +2 -2
  434. package/lib/components/menu/src/menu-item.js +96 -15
  435. package/lib/components/menu/src/menu-item.js.map +1 -1
  436. package/lib/components/menu/src/menu-item2.js +15 -96
  437. package/lib/components/menu/src/menu-item2.js.map +1 -1
  438. package/lib/components/notification/index.js +1 -1
  439. package/lib/components/notification/src/notification.js +141 -69
  440. package/lib/components/notification/src/notification.js.map +1 -1
  441. package/lib/components/notification/src/notification2.js +69 -141
  442. package/lib/components/notification/src/notification2.js.map +1 -1
  443. package/lib/components/notification/src/notify.js +2 -2
  444. package/lib/components/pagination/src/components/jumper.js +7 -58
  445. package/lib/components/pagination/src/components/jumper.js.map +1 -1
  446. package/lib/components/pagination/src/components/jumper2.js +58 -7
  447. package/lib/components/pagination/src/components/jumper2.js.map +1 -1
  448. package/lib/components/pagination/src/components/next.js +18 -35
  449. package/lib/components/pagination/src/components/next.js.map +1 -1
  450. package/lib/components/pagination/src/components/next2.js +35 -18
  451. package/lib/components/pagination/src/components/next2.js.map +1 -1
  452. package/lib/components/pagination/src/components/sizes.js +23 -71
  453. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  454. package/lib/components/pagination/src/components/sizes2.js +71 -23
  455. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  456. package/lib/components/pagination/src/pagination.js +3 -3
  457. package/lib/components/popper/index.js +6 -6
  458. package/lib/components/popper/src/content.js +132 -97
  459. package/lib/components/popper/src/content.js.map +1 -1
  460. package/lib/components/popper/src/content2.js +97 -132
  461. package/lib/components/popper/src/content2.js.map +1 -1
  462. package/lib/components/popper/src/popper.js +25 -32
  463. package/lib/components/popper/src/popper.js.map +1 -1
  464. package/lib/components/popper/src/popper2.js +32 -25
  465. package/lib/components/popper/src/popper2.js.map +1 -1
  466. package/lib/components/popper/src/trigger.js +32 -127
  467. package/lib/components/popper/src/trigger.js.map +1 -1
  468. package/lib/components/popper/src/trigger2.js +127 -32
  469. package/lib/components/popper/src/trigger2.js.map +1 -1
  470. package/lib/components/roving-focus-group/index.js +2 -2
  471. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  472. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -31
  473. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  474. package/lib/components/roving-focus-group/src/roving-focus-group2.js +31 -27
  475. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  476. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  477. package/lib/components/select/src/select.js +1 -1
  478. package/lib/components/select-v2/src/defaults.js +1 -1
  479. package/lib/components/skeleton/index.js +4 -4
  480. package/lib/components/skeleton/src/skeleton-item.js +17 -22
  481. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  482. package/lib/components/skeleton/src/skeleton-item2.js +22 -17
  483. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  484. package/lib/components/skeleton/src/skeleton.js +48 -21
  485. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  486. package/lib/components/skeleton/src/skeleton2.js +21 -48
  487. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  488. package/lib/components/table-v2/src/table-v2.js +2 -0
  489. package/lib/components/table-v2/src/table-v2.js.map +1 -1
  490. package/lib/components/tag/index.js +2 -2
  491. package/lib/components/tag/src/tag.js +99 -28
  492. package/lib/components/tag/src/tag.js.map +1 -1
  493. package/lib/components/tag/src/tag2.js +28 -99
  494. package/lib/components/tag/src/tag2.js.map +1 -1
  495. package/lib/components/tooltip/src/content.js +1 -1
  496. package/lib/components/tooltip/src/content2.js +1 -1
  497. package/lib/components/tooltip/src/tooltip.js +1 -1
  498. package/lib/components/tooltip/src/trigger.js +1 -1
  499. package/lib/components/tooltip/src/trigger2.js +1 -1
  500. package/lib/components/tooltip-v2/index.js +4 -4
  501. package/lib/components/tooltip-v2/src/root.js +79 -17
  502. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  503. package/lib/components/tooltip-v2/src/root2.js +17 -79
  504. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  505. package/lib/components/tooltip-v2/src/tooltip.js +19 -77
  506. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  507. package/lib/components/tooltip-v2/src/tooltip2.js +77 -19
  508. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  509. package/lib/components/tooltip-v2/src/trigger.js +12 -89
  510. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  511. package/lib/components/tooltip-v2/src/trigger2.js +89 -12
  512. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  513. package/lib/components/transfer/src/composables/use-check.js +1 -1
  514. package/lib/components/transfer/src/transfer-panel.js +21 -130
  515. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  516. package/lib/components/transfer/src/transfer-panel2.js +130 -21
  517. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  518. package/lib/components/transfer/src/transfer2.js +1 -1
  519. package/lib/index.js +15 -15
  520. package/lib/version.d.ts +1 -1
  521. package/lib/version.js +1 -1
  522. package/lib/version.js.map +1 -1
  523. package/package.json +2 -2
  524. package/web-types.json +1 -1
@@ -2,357 +2,69 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
5
  var lodashUnified = require('lodash-unified');
7
- var index$4 = require('../../input/index.js');
8
- var index$2 = require('../../icon/index.js');
9
- var iconsVue = require('@element-plus/icons-vue');
10
- var inputNumber = require('./input-number.js');
11
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
12
- var index$3 = require('../../../directives/repeat-click/index.js');
13
- var index = require('../../../hooks/use-locale/index.js');
14
- var index$1 = require('../../../hooks/use-namespace/index.js');
15
- var useFormItem = require('../../form/src/hooks/use-form-item.js');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
7
+ var index = require('../../../hooks/use-size/index.js');
16
8
  var types = require('../../../utils/types.js');
17
- var error = require('../../../utils/error.js');
18
- var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
9
+ var index$1 = require('../../../hooks/use-aria/index.js');
19
10
  var event = require('../../../constants/event.js');
20
- var shared = require('@vue/shared');
21
- var browser = require('../../../utils/browser.js');
22
11
 
23
- const __default__ = vue.defineComponent({
24
- name: "ElInputNumber"
12
+ const inputNumberProps = runtime.buildProps({
13
+ id: {
14
+ type: String,
15
+ default: void 0
16
+ },
17
+ step: {
18
+ type: Number,
19
+ default: 1
20
+ },
21
+ stepStrictly: Boolean,
22
+ max: {
23
+ type: Number,
24
+ default: Number.POSITIVE_INFINITY
25
+ },
26
+ min: {
27
+ type: Number,
28
+ default: Number.NEGATIVE_INFINITY
29
+ },
30
+ modelValue: Number,
31
+ readonly: Boolean,
32
+ disabled: Boolean,
33
+ size: index.useSizeProp,
34
+ controls: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ controlsPosition: {
39
+ type: String,
40
+ default: "",
41
+ values: ["", "right"]
42
+ },
43
+ valueOnClear: {
44
+ type: [String, Number, null],
45
+ validator: (val) => val === null || types.isNumber(val) || ["min", "max"].includes(val),
46
+ default: null
47
+ },
48
+ name: String,
49
+ placeholder: String,
50
+ precision: {
51
+ type: Number,
52
+ validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
53
+ },
54
+ validateEvent: {
55
+ type: Boolean,
56
+ default: true
57
+ },
58
+ ...index$1.useAriaProps(["ariaLabel"])
25
59
  });
26
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
27
- ...__default__,
28
- props: inputNumber.inputNumberProps,
29
- emits: inputNumber.inputNumberEmits,
30
- setup(__props, { expose, emit }) {
31
- const props = __props;
32
- const { t } = index.useLocale();
33
- const ns = index$1.useNamespace("input-number");
34
- const input = vue.ref();
35
- const data = vue.reactive({
36
- currentValue: props.modelValue,
37
- userInput: null
38
- });
39
- const { formItem } = useFormItem.useFormItem();
40
- const minDisabled = vue.computed(() => types.isNumber(props.modelValue) && props.modelValue <= props.min);
41
- const maxDisabled = vue.computed(() => types.isNumber(props.modelValue) && props.modelValue >= props.max);
42
- const numPrecision = vue.computed(() => {
43
- const stepPrecision = getPrecision(props.step);
44
- if (!types.isUndefined(props.precision)) {
45
- if (stepPrecision > props.precision) {
46
- error.debugWarn("InputNumber", "precision should not be less than the decimal places of step");
47
- }
48
- return props.precision;
49
- } else {
50
- return Math.max(getPrecision(props.modelValue), stepPrecision);
51
- }
52
- });
53
- const controlsAtRight = vue.computed(() => {
54
- return props.controls && props.controlsPosition === "right";
55
- });
56
- const inputNumberSize = useFormCommonProps.useFormSize();
57
- const inputNumberDisabled = useFormCommonProps.useFormDisabled();
58
- const displayValue = vue.computed(() => {
59
- if (data.userInput !== null) {
60
- return data.userInput;
61
- }
62
- let currentValue = data.currentValue;
63
- if (lodashUnified.isNil(currentValue))
64
- return "";
65
- if (types.isNumber(currentValue)) {
66
- if (Number.isNaN(currentValue))
67
- return "";
68
- if (!types.isUndefined(props.precision)) {
69
- currentValue = currentValue.toFixed(props.precision);
70
- }
71
- }
72
- return currentValue;
73
- });
74
- const toPrecision = (num, pre) => {
75
- if (types.isUndefined(pre))
76
- pre = numPrecision.value;
77
- if (pre === 0)
78
- return Math.round(num);
79
- let snum = String(num);
80
- const pointPos = snum.indexOf(".");
81
- if (pointPos === -1)
82
- return num;
83
- const nums = snum.replace(".", "").split("");
84
- const datum = nums[pointPos + pre];
85
- if (!datum)
86
- return num;
87
- const length = snum.length;
88
- if (snum.charAt(length - 1) === "5") {
89
- snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
90
- }
91
- return Number.parseFloat(Number(snum).toFixed(pre));
92
- };
93
- const getPrecision = (value) => {
94
- if (lodashUnified.isNil(value))
95
- return 0;
96
- const valueString = value.toString();
97
- const dotPosition = valueString.indexOf(".");
98
- let precision = 0;
99
- if (dotPosition !== -1) {
100
- precision = valueString.length - dotPosition - 1;
101
- }
102
- return precision;
103
- };
104
- const ensurePrecision = (val, coefficient = 1) => {
105
- if (!types.isNumber(val))
106
- return data.currentValue;
107
- return toPrecision(val + props.step * coefficient);
108
- };
109
- const increase = () => {
110
- if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
111
- return;
112
- const value = Number(displayValue.value) || 0;
113
- const newVal = ensurePrecision(value);
114
- setCurrentValue(newVal);
115
- emit(event.INPUT_EVENT, data.currentValue);
116
- setCurrentValueToModelValue();
117
- };
118
- const decrease = () => {
119
- if (props.readonly || inputNumberDisabled.value || minDisabled.value)
120
- return;
121
- const value = Number(displayValue.value) || 0;
122
- const newVal = ensurePrecision(value, -1);
123
- setCurrentValue(newVal);
124
- emit(event.INPUT_EVENT, data.currentValue);
125
- setCurrentValueToModelValue();
126
- };
127
- const verifyValue = (value, update) => {
128
- const { max, min, step, precision, stepStrictly, valueOnClear } = props;
129
- if (max < min) {
130
- error.throwError("InputNumber", "min should not be greater than max.");
131
- }
132
- let newVal = Number(value);
133
- if (lodashUnified.isNil(value) || Number.isNaN(newVal)) {
134
- return null;
135
- }
136
- if (value === "") {
137
- if (valueOnClear === null) {
138
- return null;
139
- }
140
- newVal = shared.isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear;
141
- }
142
- if (stepStrictly) {
143
- newVal = toPrecision(Math.round(newVal / step) * step, precision);
144
- if (newVal !== value) {
145
- update && emit(event.UPDATE_MODEL_EVENT, newVal);
146
- }
147
- }
148
- if (!types.isUndefined(precision)) {
149
- newVal = toPrecision(newVal, precision);
150
- }
151
- if (newVal > max || newVal < min) {
152
- newVal = newVal > max ? max : min;
153
- update && emit(event.UPDATE_MODEL_EVENT, newVal);
154
- }
155
- return newVal;
156
- };
157
- const setCurrentValue = (value, emitChange = true) => {
158
- var _a;
159
- const oldVal = data.currentValue;
160
- const newVal = verifyValue(value);
161
- if (!emitChange) {
162
- emit(event.UPDATE_MODEL_EVENT, newVal);
163
- return;
164
- }
165
- if (oldVal === newVal && value)
166
- return;
167
- data.userInput = null;
168
- emit(event.UPDATE_MODEL_EVENT, newVal);
169
- if (oldVal !== newVal) {
170
- emit(event.CHANGE_EVENT, newVal, oldVal);
171
- }
172
- if (props.validateEvent) {
173
- (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => error.debugWarn(err));
174
- }
175
- data.currentValue = newVal;
176
- };
177
- const handleInput = (value) => {
178
- data.userInput = value;
179
- const newVal = value === "" ? null : Number(value);
180
- emit(event.INPUT_EVENT, newVal);
181
- setCurrentValue(newVal, false);
182
- };
183
- const handleInputChange = (value) => {
184
- const newVal = value !== "" ? Number(value) : "";
185
- if (types.isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
186
- setCurrentValue(newVal);
187
- }
188
- setCurrentValueToModelValue();
189
- data.userInput = null;
190
- };
191
- const focus = () => {
192
- var _a, _b;
193
- (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
194
- };
195
- const blur = () => {
196
- var _a, _b;
197
- (_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
198
- };
199
- const handleFocus = (event) => {
200
- emit("focus", event);
201
- };
202
- const handleBlur = (event) => {
203
- var _a, _b;
204
- data.userInput = null;
205
- if (browser.isFirefox() && data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) {
206
- input.value.input.value = "";
207
- }
208
- emit("blur", event);
209
- if (props.validateEvent) {
210
- (_b = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b.call(formItem, "blur").catch((err) => error.debugWarn(err));
211
- }
212
- };
213
- const setCurrentValueToModelValue = () => {
214
- if (data.currentValue !== props.modelValue) {
215
- data.currentValue = props.modelValue;
216
- }
217
- };
218
- const handleWheel = (e) => {
219
- if (document.activeElement === e.target)
220
- e.preventDefault();
221
- };
222
- vue.watch(() => props.modelValue, (value, oldValue) => {
223
- const newValue = verifyValue(value, true);
224
- if (data.userInput === null && newValue !== oldValue) {
225
- data.currentValue = newValue;
226
- }
227
- }, { immediate: true });
228
- vue.onMounted(() => {
229
- var _a;
230
- const { min, max, modelValue } = props;
231
- const innerInput = (_a = input.value) == null ? void 0 : _a.input;
232
- innerInput.setAttribute("role", "spinbutton");
233
- if (Number.isFinite(max)) {
234
- innerInput.setAttribute("aria-valuemax", String(max));
235
- } else {
236
- innerInput.removeAttribute("aria-valuemax");
237
- }
238
- if (Number.isFinite(min)) {
239
- innerInput.setAttribute("aria-valuemin", String(min));
240
- } else {
241
- innerInput.removeAttribute("aria-valuemin");
242
- }
243
- innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
244
- innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
245
- if (!types.isNumber(modelValue) && modelValue != null) {
246
- let val = Number(modelValue);
247
- if (Number.isNaN(val)) {
248
- val = null;
249
- }
250
- emit(event.UPDATE_MODEL_EVENT, val);
251
- }
252
- innerInput.addEventListener("wheel", handleWheel, { passive: false });
253
- });
254
- vue.onUpdated(() => {
255
- var _a, _b;
256
- const innerInput = (_a = input.value) == null ? void 0 : _a.input;
257
- innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${(_b = data.currentValue) != null ? _b : ""}`);
258
- });
259
- expose({
260
- focus,
261
- blur
262
- });
263
- return (_ctx, _cache) => {
264
- return vue.openBlock(), vue.createElementBlock("div", {
265
- class: vue.normalizeClass([
266
- vue.unref(ns).b(),
267
- vue.unref(ns).m(vue.unref(inputNumberSize)),
268
- vue.unref(ns).is("disabled", vue.unref(inputNumberDisabled)),
269
- vue.unref(ns).is("without-controls", !_ctx.controls),
270
- vue.unref(ns).is("controls-right", vue.unref(controlsAtRight))
271
- ]),
272
- onDragstart: vue.withModifiers(() => {
273
- }, ["prevent"])
274
- }, [
275
- _ctx.controls ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
276
- key: 0,
277
- role: "button",
278
- "aria-label": vue.unref(t)("el.inputNumber.decrease"),
279
- class: vue.normalizeClass([vue.unref(ns).e("decrease"), vue.unref(ns).is("disabled", vue.unref(minDisabled))]),
280
- onKeydown: vue.withKeys(decrease, ["enter"])
281
- }, [
282
- vue.renderSlot(_ctx.$slots, "decrease-icon", {}, () => [
283
- vue.createVNode(vue.unref(index$2.ElIcon), null, {
284
- default: vue.withCtx(() => [
285
- vue.unref(controlsAtRight) ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.ArrowDown), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.Minus), { key: 1 }))
286
- ]),
287
- _: 1
288
- })
289
- ])
290
- ], 42, ["aria-label", "onKeydown"])), [
291
- [vue.unref(index$3.vRepeatClick), decrease]
292
- ]) : vue.createCommentVNode("v-if", true),
293
- _ctx.controls ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
294
- key: 1,
295
- role: "button",
296
- "aria-label": vue.unref(t)("el.inputNumber.increase"),
297
- class: vue.normalizeClass([vue.unref(ns).e("increase"), vue.unref(ns).is("disabled", vue.unref(maxDisabled))]),
298
- onKeydown: vue.withKeys(increase, ["enter"])
299
- }, [
300
- vue.renderSlot(_ctx.$slots, "increase-icon", {}, () => [
301
- vue.createVNode(vue.unref(index$2.ElIcon), null, {
302
- default: vue.withCtx(() => [
303
- vue.unref(controlsAtRight) ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.ArrowUp), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.Plus), { key: 1 }))
304
- ]),
305
- _: 1
306
- })
307
- ])
308
- ], 42, ["aria-label", "onKeydown"])), [
309
- [vue.unref(index$3.vRepeatClick), increase]
310
- ]) : vue.createCommentVNode("v-if", true),
311
- vue.createVNode(vue.unref(index$4.ElInput), {
312
- id: _ctx.id,
313
- ref_key: "input",
314
- ref: input,
315
- type: "number",
316
- step: _ctx.step,
317
- "model-value": vue.unref(displayValue),
318
- placeholder: _ctx.placeholder,
319
- readonly: _ctx.readonly,
320
- disabled: vue.unref(inputNumberDisabled),
321
- size: vue.unref(inputNumberSize),
322
- max: _ctx.max,
323
- min: _ctx.min,
324
- name: _ctx.name,
325
- "aria-label": _ctx.ariaLabel,
326
- "validate-event": false,
327
- onKeydown: [
328
- vue.withKeys(vue.withModifiers(increase, ["prevent"]), ["up"]),
329
- vue.withKeys(vue.withModifiers(decrease, ["prevent"]), ["down"])
330
- ],
331
- onBlur: handleBlur,
332
- onFocus: handleFocus,
333
- onInput: handleInput,
334
- onChange: handleInputChange
335
- }, vue.createSlots({
336
- _: 2
337
- }, [
338
- _ctx.$slots.prefix ? {
339
- name: "prefix",
340
- fn: vue.withCtx(() => [
341
- vue.renderSlot(_ctx.$slots, "prefix")
342
- ])
343
- } : void 0,
344
- _ctx.$slots.suffix ? {
345
- name: "suffix",
346
- fn: vue.withCtx(() => [
347
- vue.renderSlot(_ctx.$slots, "suffix")
348
- ])
349
- } : void 0
350
- ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
351
- ], 42, ["onDragstart"]);
352
- };
353
- }
354
- });
355
- var InputNumber = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "input-number.vue"]]);
60
+ const inputNumberEmits = {
61
+ [event.CHANGE_EVENT]: (cur, prev) => prev !== cur,
62
+ blur: (e) => e instanceof FocusEvent,
63
+ focus: (e) => e instanceof FocusEvent,
64
+ [event.INPUT_EVENT]: (val) => types.isNumber(val) || lodashUnified.isNil(val),
65
+ [event.UPDATE_MODEL_EVENT]: (val) => types.isNumber(val) || lodashUnified.isNil(val)
66
+ };
356
67
 
357
- exports["default"] = InputNumber;
68
+ exports.inputNumberEmits = inputNumberEmits;
69
+ exports.inputNumberProps = inputNumberProps;
358
70
  //# sourceMappingURL=input-number2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-number2.js","sources":["../../../../../../packages/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":["useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","debugWarn","useFormSize","useFormDisabled","isNil","isUndefined","INPUT_EVENT","throwError","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","isFirefox","watch","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;uCAsGc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,QAAQC,OAAmB,EAAA,CAAA;AAMjC,IAAA,MAAM,OAAOC,YAAe,CAAA;AAAA,MAC1B,cAAc,KAAM,CAAA,UAAA;AAAA,MACpB,SAAW,EAAA,IAAA;AAAA,KACZ,CAAA,CAAA;AAED,IAAM,MAAA,EAAE,QAAS,EAAA,GAAIC,uBAAY,EAAA,CAAA;AAEjC,IAAA,MAAM,WAAc,GAAAC,YAAA,CAAA,MAAAC,cAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,KAAA,CAAA,UAAA,IAAA,KAAA,CAAA,GAAA,CAAA,CAAA;AAAA,IAAA,iBACH,GAAAD,mBAAqBC,cAAA,CAAM,gB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"input-number2.js","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":["buildProps","useSizeProp","isNumber","useAriaProps","CHANGE_EVENT","INPUT_EVENT","isNil","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;;;;AAQY,MAAC,gBAAgB,GAAGA,kBAAU,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,EAAEC,iBAAW;AACnB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,gBAAgB,EAAE;A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AG,KAAKL,cAAQ,CAAC,GAAG,CAAC,IAAII,mBAAK,CAAC,GAAG,CAAC;AAC5D;;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tag = require('../../tag/src/tag.js');
5
+ var tag = require('../../tag/src/tag2.js');
6
6
  var runtime = require('../../../utils/vue/props/runtime.js');
7
7
  var aria = require('../../../constants/aria.js');
8
8
  var index = require('../../../hooks/use-size/index.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var menu = require('./src/menu.js');
6
- var menuItem$1 = require('./src/menu-item2.js');
6
+ var menuItem$1 = require('./src/menu-item.js');
7
7
  var menuItemGroup$1 = require('./src/menu-item-group2.js');
8
8
  var subMenu = require('./src/sub-menu.js');
9
- var menuItem = require('./src/menu-item.js');
9
+ var menuItem = require('./src/menu-item2.js');
10
10
  var menuItemGroup = require('./src/menu-item-group.js');
11
11
  var install = require('../../utils/vue/install.js');
12
12
 
@@ -2,23 +2,104 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var runtime = require('../../../utils/vue/props/runtime.js');
6
- var shared = require('@vue/shared');
5
+ var vue = require('vue');
6
+ var index = require('../../tooltip/index.js');
7
+ var useMenu = require('./use-menu.js');
8
+ var menuItem = require('./menu-item2.js');
9
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
+ var index$1 = require('../../../hooks/use-namespace/index.js');
11
+ var error = require('../../../utils/error.js');
7
12
 
8
- const menuItemProps = runtime.buildProps({
9
- index: {
10
- type: runtime.definePropType([String, null]),
11
- default: null
13
+ const COMPONENT_NAME = "ElMenuItem";
14
+ const _sfc_main = vue.defineComponent({
15
+ name: COMPONENT_NAME,
16
+ components: {
17
+ ElTooltip: index.ElTooltip
12
18
  },
13
- route: {
14
- type: runtime.definePropType([String, Object])
15
- },
16
- disabled: Boolean
19
+ props: menuItem.menuItemProps,
20
+ emits: menuItem.menuItemEmits,
21
+ setup(props, { emit }) {
22
+ const instance = vue.getCurrentInstance();
23
+ const rootMenu = vue.inject("rootMenu");
24
+ const nsMenu = index$1.useNamespace("menu");
25
+ const nsMenuItem = index$1.useNamespace("menu-item");
26
+ if (!rootMenu)
27
+ error.throwError(COMPONENT_NAME, "can not inject root menu");
28
+ const { parentMenu, indexPath } = useMenu["default"](instance, vue.toRef(props, "index"));
29
+ const subMenu = vue.inject(`subMenu:${parentMenu.value.uid}`);
30
+ if (!subMenu)
31
+ error.throwError(COMPONENT_NAME, "can not inject sub menu");
32
+ const active = vue.computed(() => props.index === rootMenu.activeIndex);
33
+ const item = vue.reactive({
34
+ index: props.index,
35
+ indexPath,
36
+ active
37
+ });
38
+ const handleClick = () => {
39
+ if (!props.disabled) {
40
+ rootMenu.handleMenuItemClick({
41
+ index: props.index,
42
+ indexPath: indexPath.value,
43
+ route: props.route
44
+ });
45
+ emit("click", item);
46
+ }
47
+ };
48
+ vue.onMounted(() => {
49
+ subMenu.addSubMenu(item);
50
+ rootMenu.addMenuItem(item);
51
+ });
52
+ vue.onBeforeUnmount(() => {
53
+ subMenu.removeSubMenu(item);
54
+ rootMenu.removeMenuItem(item);
55
+ });
56
+ return {
57
+ parentMenu,
58
+ rootMenu,
59
+ active,
60
+ nsMenu,
61
+ nsMenuItem,
62
+ handleClick
63
+ };
64
+ }
17
65
  });
18
- const menuItemEmits = {
19
- click: (item) => shared.isString(item.index) && shared.isArray(item.indexPath)
20
- };
66
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
67
+ const _component_el_tooltip = vue.resolveComponent("el-tooltip");
68
+ return vue.openBlock(), vue.createElementBlock("li", {
69
+ class: vue.normalizeClass([
70
+ _ctx.nsMenuItem.b(),
71
+ _ctx.nsMenuItem.is("active", _ctx.active),
72
+ _ctx.nsMenuItem.is("disabled", _ctx.disabled)
73
+ ]),
74
+ role: "menuitem",
75
+ tabindex: "-1",
76
+ onClick: _ctx.handleClick
77
+ }, [
78
+ _ctx.parentMenu.type.name === "ElMenu" && _ctx.rootMenu.props.collapse && _ctx.$slots.title ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
79
+ key: 0,
80
+ effect: _ctx.rootMenu.props.popperEffect,
81
+ placement: "right",
82
+ "fallback-placements": ["left"],
83
+ persistent: ""
84
+ }, {
85
+ content: vue.withCtx(() => [
86
+ vue.renderSlot(_ctx.$slots, "title")
87
+ ]),
88
+ default: vue.withCtx(() => [
89
+ vue.createElementVNode("div", {
90
+ class: vue.normalizeClass(_ctx.nsMenu.be("tooltip", "trigger"))
91
+ }, [
92
+ vue.renderSlot(_ctx.$slots, "default")
93
+ ], 2)
94
+ ]),
95
+ _: 3
96
+ }, 8, ["effect"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
97
+ vue.renderSlot(_ctx.$slots, "default"),
98
+ vue.renderSlot(_ctx.$slots, "title")
99
+ ], 64))
100
+ ], 10, ["onClick"]);
101
+ }
102
+ var MenuItem = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "menu-item.vue"]]);
21
103
 
22
- exports.menuItemEmits = menuItemEmits;
23
- exports.menuItemProps = menuItemProps;
104
+ exports["default"] = MenuItem;
24
105
  //# sourceMappingURL=menu-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.js","sources":["../../../../../../packages/components/menu/src/menu-item.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isString,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport type { MenuItemRegistered } from './types'\n\nexport const menuItemProps = buildProps({\n /**\n * @description unique identification\n */\n index: {\n type: definePropType<string | null>([String, null]),\n default: null,\n },\n /**\n * @description Vue Router object\n */\n route: {\n type: definePropType<RouteLocationRaw>([String, Object]),\n },\n /**\n * @description whether disabled\n */\n disabled: Boolean,\n} as const)\nexport type MenuItemProps = ExtractPropTypes<typeof menuItemProps>\n\nexport const menuItemEmits = {\n click: (item: MenuItemRegistered) =>\n isString(item.index) && isArray(item.indexPath),\n}\nexport type MenuItemEmits = typeof menuItemEmits\n"],"names":["buildProps","definePropType","isString","isArray"],"mappings":";;;;;;;AAMY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACxC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEA,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,KAAK,EAAE,CAAC,IAAI,KAAKC,eAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAIC,cAAO,CAAC,IAAI,CAAC,SAAS,CAAC;AAClE;;;;;"}
1
+ {"version":3,"file":"menu-item.js","sources":["../../../../../../packages/components/menu/src/menu-item.vue"],"sourcesContent":["<template>\n <li\n :class=\"[\n nsMenuItem.b(),\n nsMenuItem.is('active', active),\n nsMenuItem.is('disabled', disabled),\n ]\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=\"handleClick\"\n >\n <el-tooltip\n v-if=\"\n parentMenu.type.name === 'ElMenu' &&\n rootMenu.props.collapse &&\n $slots.title\n \"\n :effect=\"rootMenu.props.popperEffect\"\n placement=\"right\"\n :fallback-placements=\"['left']\"\n persistent\n >\n <template #content>\n <slot name=\"title\" />\n </template>\n <div :class=\"nsMenu.be('tooltip', 'trigger')\">\n <slot />\n </div>\n </el-tooltip>\n <template v-else>\n <slot />\n <slot name=\"title\" />\n </template>\n </li>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n reactive,\n toRef,\n} from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport useMenu from './use-menu'\nimport { menuItemEmits, menuItemProps } from './menu-item'\n\nimport type { MenuItemRegistered, MenuProvider, SubMenuProvider } from './types'\n\nconst COMPONENT_NAME = 'ElMenuItem'\nexport default defineComponent({\n name: COMPONENT_NAME,\n components: {\n ElTooltip,\n },\n\n props: menuItemProps,\n emits: menuItemEmits,\n\n setup(props, { emit }) {\n const instance = getCurrentInstance()!\n const rootMenu = inject<MenuProvider>('rootMenu')\n const nsMenu = useNamespace('menu')\n const nsMenuItem = useNamespace('menu-item')\n if (!rootMenu) throwError(COMPONENT_NAME, 'can not inject root menu')\n\n const { parentMenu, indexPath } = useMenu(instance, toRef(props, 'index'))\n\n const subMenu = inject<SubMenuProvider>(`subMenu:${parentMenu.value.uid}`)\n if (!subMenu) throwError(COMPONENT_NAME, 'can not inject sub menu')\n\n const active = computed(() => props.index === rootMenu.activeIndex)\n const item: MenuItemRegistered = reactive({\n index: props.index,\n indexPath,\n active,\n })\n\n const handleClick = () => {\n if (!props.disabled) {\n rootMenu.handleMenuItemClick({\n index: props.index,\n indexPath: indexPath.value,\n route: props.route,\n })\n emit('click', item)\n }\n }\n\n onMounted(() => {\n subMenu.addSubMenu(item)\n rootMenu.addMenuItem(item)\n })\n\n onBeforeUnmount(() => {\n subMenu.removeSubMenu(item)\n rootMenu.removeMenuItem(item)\n })\n\n return {\n parentMenu,\n rootMenu,\n active,\n nsMenu,\n nsMenuItem,\n handleClick,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElTooltip","menuItemProps","menuItemEmits","getCurrentInstance","inject","useNamespace","throwError","useMenu","computed","reactive","onMounted","onBeforeUnmount","_resolveComponent","_createElementBlock","_normalizeClass","_openBlock","_createBlock","_withCtx","_createElementVNode","_export_sfc"],"mappings":";;;;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