@element-plus/nightly 0.0.20241112 → 0.0.20241114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (392) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.full.js +146 -115
  3. package/dist/index.full.min.js +11 -11
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +11 -11
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +146 -115
  8. package/dist/locale/af.js +1 -1
  9. package/dist/locale/af.min.js +1 -1
  10. package/dist/locale/af.min.mjs +1 -1
  11. package/dist/locale/af.mjs +1 -1
  12. package/dist/locale/ar-eg.js +1 -1
  13. package/dist/locale/ar-eg.min.js +1 -1
  14. package/dist/locale/ar-eg.min.mjs +1 -1
  15. package/dist/locale/ar-eg.mjs +1 -1
  16. package/dist/locale/ar.js +1 -1
  17. package/dist/locale/ar.min.js +1 -1
  18. package/dist/locale/ar.min.mjs +1 -1
  19. package/dist/locale/ar.mjs +1 -1
  20. package/dist/locale/az.js +1 -1
  21. package/dist/locale/az.min.js +1 -1
  22. package/dist/locale/az.min.mjs +1 -1
  23. package/dist/locale/az.mjs +1 -1
  24. package/dist/locale/bg.js +1 -1
  25. package/dist/locale/bg.min.js +1 -1
  26. package/dist/locale/bg.min.mjs +1 -1
  27. package/dist/locale/bg.mjs +1 -1
  28. package/dist/locale/bn.js +1 -1
  29. package/dist/locale/bn.min.js +1 -1
  30. package/dist/locale/bn.min.mjs +1 -1
  31. package/dist/locale/bn.mjs +1 -1
  32. package/dist/locale/ca.js +1 -1
  33. package/dist/locale/ca.min.js +1 -1
  34. package/dist/locale/ca.min.mjs +1 -1
  35. package/dist/locale/ca.mjs +1 -1
  36. package/dist/locale/ckb.js +1 -1
  37. package/dist/locale/ckb.min.js +1 -1
  38. package/dist/locale/ckb.min.mjs +1 -1
  39. package/dist/locale/ckb.mjs +1 -1
  40. package/dist/locale/cs.js +1 -1
  41. package/dist/locale/cs.min.js +1 -1
  42. package/dist/locale/cs.min.mjs +1 -1
  43. package/dist/locale/cs.mjs +1 -1
  44. package/dist/locale/da.js +1 -1
  45. package/dist/locale/da.min.js +1 -1
  46. package/dist/locale/da.min.mjs +1 -1
  47. package/dist/locale/da.mjs +1 -1
  48. package/dist/locale/de.js +1 -1
  49. package/dist/locale/de.min.js +1 -1
  50. package/dist/locale/de.min.mjs +1 -1
  51. package/dist/locale/de.mjs +1 -1
  52. package/dist/locale/el.js +1 -1
  53. package/dist/locale/el.min.js +1 -1
  54. package/dist/locale/el.min.mjs +1 -1
  55. package/dist/locale/el.mjs +1 -1
  56. package/dist/locale/en.js +1 -1
  57. package/dist/locale/en.min.js +1 -1
  58. package/dist/locale/en.min.mjs +1 -1
  59. package/dist/locale/en.mjs +1 -1
  60. package/dist/locale/eo.js +1 -1
  61. package/dist/locale/eo.min.js +1 -1
  62. package/dist/locale/eo.min.mjs +1 -1
  63. package/dist/locale/eo.mjs +1 -1
  64. package/dist/locale/es.js +1 -1
  65. package/dist/locale/es.min.js +1 -1
  66. package/dist/locale/es.min.mjs +1 -1
  67. package/dist/locale/es.mjs +1 -1
  68. package/dist/locale/et.js +1 -1
  69. package/dist/locale/et.min.js +1 -1
  70. package/dist/locale/et.min.mjs +1 -1
  71. package/dist/locale/et.mjs +1 -1
  72. package/dist/locale/eu.js +1 -1
  73. package/dist/locale/eu.min.js +1 -1
  74. package/dist/locale/eu.min.mjs +1 -1
  75. package/dist/locale/eu.mjs +1 -1
  76. package/dist/locale/fa.js +1 -1
  77. package/dist/locale/fa.min.js +1 -1
  78. package/dist/locale/fa.min.mjs +1 -1
  79. package/dist/locale/fa.mjs +1 -1
  80. package/dist/locale/fi.js +1 -1
  81. package/dist/locale/fi.min.js +1 -1
  82. package/dist/locale/fi.min.mjs +1 -1
  83. package/dist/locale/fi.mjs +1 -1
  84. package/dist/locale/fr.js +1 -1
  85. package/dist/locale/fr.min.js +1 -1
  86. package/dist/locale/fr.min.mjs +1 -1
  87. package/dist/locale/fr.mjs +1 -1
  88. package/dist/locale/he.js +1 -1
  89. package/dist/locale/he.min.js +1 -1
  90. package/dist/locale/he.min.mjs +1 -1
  91. package/dist/locale/he.mjs +1 -1
  92. package/dist/locale/hr.js +1 -1
  93. package/dist/locale/hr.min.js +1 -1
  94. package/dist/locale/hr.min.mjs +1 -1
  95. package/dist/locale/hr.mjs +1 -1
  96. package/dist/locale/hu.js +1 -1
  97. package/dist/locale/hu.min.js +1 -1
  98. package/dist/locale/hu.min.mjs +1 -1
  99. package/dist/locale/hu.mjs +1 -1
  100. package/dist/locale/hy-am.js +1 -1
  101. package/dist/locale/hy-am.min.js +1 -1
  102. package/dist/locale/hy-am.min.mjs +1 -1
  103. package/dist/locale/hy-am.mjs +1 -1
  104. package/dist/locale/id.js +1 -1
  105. package/dist/locale/id.min.js +1 -1
  106. package/dist/locale/id.min.mjs +1 -1
  107. package/dist/locale/id.mjs +1 -1
  108. package/dist/locale/it.js +1 -1
  109. package/dist/locale/it.min.js +1 -1
  110. package/dist/locale/it.min.mjs +1 -1
  111. package/dist/locale/it.mjs +1 -1
  112. package/dist/locale/ja.js +1 -1
  113. package/dist/locale/ja.min.js +1 -1
  114. package/dist/locale/ja.min.mjs +1 -1
  115. package/dist/locale/ja.mjs +1 -1
  116. package/dist/locale/kk.js +1 -1
  117. package/dist/locale/kk.min.js +1 -1
  118. package/dist/locale/kk.min.mjs +1 -1
  119. package/dist/locale/kk.mjs +1 -1
  120. package/dist/locale/km.js +1 -1
  121. package/dist/locale/km.min.js +1 -1
  122. package/dist/locale/km.min.mjs +1 -1
  123. package/dist/locale/km.mjs +1 -1
  124. package/dist/locale/ko.js +1 -1
  125. package/dist/locale/ko.min.js +1 -1
  126. package/dist/locale/ko.min.mjs +1 -1
  127. package/dist/locale/ko.mjs +1 -1
  128. package/dist/locale/ku.js +1 -1
  129. package/dist/locale/ku.min.js +1 -1
  130. package/dist/locale/ku.min.mjs +1 -1
  131. package/dist/locale/ku.mjs +1 -1
  132. package/dist/locale/ky.js +1 -1
  133. package/dist/locale/ky.min.js +1 -1
  134. package/dist/locale/ky.min.mjs +1 -1
  135. package/dist/locale/ky.mjs +1 -1
  136. package/dist/locale/lt.js +1 -1
  137. package/dist/locale/lt.min.js +1 -1
  138. package/dist/locale/lt.min.mjs +1 -1
  139. package/dist/locale/lt.mjs +1 -1
  140. package/dist/locale/lv.js +1 -1
  141. package/dist/locale/lv.min.js +1 -1
  142. package/dist/locale/lv.min.mjs +1 -1
  143. package/dist/locale/lv.mjs +1 -1
  144. package/dist/locale/mg.js +1 -1
  145. package/dist/locale/mg.min.js +1 -1
  146. package/dist/locale/mg.min.mjs +1 -1
  147. package/dist/locale/mg.mjs +1 -1
  148. package/dist/locale/mn.js +1 -1
  149. package/dist/locale/mn.min.js +1 -1
  150. package/dist/locale/mn.min.mjs +1 -1
  151. package/dist/locale/mn.mjs +1 -1
  152. package/dist/locale/my.js +1 -1
  153. package/dist/locale/my.min.js +1 -1
  154. package/dist/locale/my.min.mjs +1 -1
  155. package/dist/locale/my.mjs +1 -1
  156. package/dist/locale/nb-no.js +1 -1
  157. package/dist/locale/nb-no.min.js +1 -1
  158. package/dist/locale/nb-no.min.mjs +1 -1
  159. package/dist/locale/nb-no.mjs +1 -1
  160. package/dist/locale/nl.js +1 -1
  161. package/dist/locale/nl.min.js +1 -1
  162. package/dist/locale/nl.min.mjs +1 -1
  163. package/dist/locale/nl.mjs +1 -1
  164. package/dist/locale/pa.js +1 -1
  165. package/dist/locale/pa.min.js +1 -1
  166. package/dist/locale/pa.min.mjs +1 -1
  167. package/dist/locale/pa.mjs +1 -1
  168. package/dist/locale/pl.js +1 -1
  169. package/dist/locale/pl.min.js +1 -1
  170. package/dist/locale/pl.min.mjs +1 -1
  171. package/dist/locale/pl.mjs +1 -1
  172. package/dist/locale/pt-br.js +1 -1
  173. package/dist/locale/pt-br.min.js +1 -1
  174. package/dist/locale/pt-br.min.mjs +1 -1
  175. package/dist/locale/pt-br.mjs +1 -1
  176. package/dist/locale/pt.js +1 -1
  177. package/dist/locale/pt.min.js +1 -1
  178. package/dist/locale/pt.min.mjs +1 -1
  179. package/dist/locale/pt.mjs +1 -1
  180. package/dist/locale/ro.js +1 -1
  181. package/dist/locale/ro.min.js +1 -1
  182. package/dist/locale/ro.min.mjs +1 -1
  183. package/dist/locale/ro.mjs +1 -1
  184. package/dist/locale/ru.js +1 -1
  185. package/dist/locale/ru.min.js +1 -1
  186. package/dist/locale/ru.min.mjs +1 -1
  187. package/dist/locale/ru.mjs +1 -1
  188. package/dist/locale/sk.js +1 -1
  189. package/dist/locale/sk.min.js +1 -1
  190. package/dist/locale/sk.min.mjs +1 -1
  191. package/dist/locale/sk.mjs +1 -1
  192. package/dist/locale/sl.js +1 -1
  193. package/dist/locale/sl.min.js +1 -1
  194. package/dist/locale/sl.min.mjs +1 -1
  195. package/dist/locale/sl.mjs +1 -1
  196. package/dist/locale/sr.js +1 -1
  197. package/dist/locale/sr.min.js +1 -1
  198. package/dist/locale/sr.min.mjs +1 -1
  199. package/dist/locale/sr.mjs +1 -1
  200. package/dist/locale/sv.js +1 -1
  201. package/dist/locale/sv.min.js +1 -1
  202. package/dist/locale/sv.min.mjs +1 -1
  203. package/dist/locale/sv.mjs +1 -1
  204. package/dist/locale/sw.js +1 -1
  205. package/dist/locale/sw.min.js +1 -1
  206. package/dist/locale/sw.min.mjs +1 -1
  207. package/dist/locale/sw.mjs +1 -1
  208. package/dist/locale/ta.js +1 -1
  209. package/dist/locale/ta.min.js +1 -1
  210. package/dist/locale/ta.min.mjs +1 -1
  211. package/dist/locale/ta.mjs +1 -1
  212. package/dist/locale/th.js +1 -1
  213. package/dist/locale/th.min.js +1 -1
  214. package/dist/locale/th.min.mjs +1 -1
  215. package/dist/locale/th.mjs +1 -1
  216. package/dist/locale/tk.js +1 -1
  217. package/dist/locale/tk.min.js +1 -1
  218. package/dist/locale/tk.min.mjs +1 -1
  219. package/dist/locale/tk.mjs +1 -1
  220. package/dist/locale/tr.js +1 -1
  221. package/dist/locale/tr.min.js +1 -1
  222. package/dist/locale/tr.min.mjs +1 -1
  223. package/dist/locale/tr.mjs +1 -1
  224. package/dist/locale/ug-cn.js +1 -1
  225. package/dist/locale/ug-cn.min.js +1 -1
  226. package/dist/locale/ug-cn.min.mjs +1 -1
  227. package/dist/locale/ug-cn.mjs +1 -1
  228. package/dist/locale/uk.js +1 -1
  229. package/dist/locale/uk.min.js +1 -1
  230. package/dist/locale/uk.min.mjs +1 -1
  231. package/dist/locale/uk.mjs +1 -1
  232. package/dist/locale/uz-uz.js +1 -1
  233. package/dist/locale/uz-uz.min.js +1 -1
  234. package/dist/locale/uz-uz.min.mjs +1 -1
  235. package/dist/locale/uz-uz.mjs +1 -1
  236. package/dist/locale/vi.js +1 -1
  237. package/dist/locale/vi.min.js +1 -1
  238. package/dist/locale/vi.min.mjs +1 -1
  239. package/dist/locale/vi.mjs +1 -1
  240. package/dist/locale/zh-cn.js +1 -1
  241. package/dist/locale/zh-cn.min.js +1 -1
  242. package/dist/locale/zh-cn.min.mjs +1 -1
  243. package/dist/locale/zh-cn.mjs +1 -1
  244. package/dist/locale/zh-tw.js +1 -1
  245. package/dist/locale/zh-tw.min.js +1 -1
  246. package/dist/locale/zh-tw.min.mjs +1 -1
  247. package/dist/locale/zh-tw.mjs +1 -1
  248. package/es/components/cascader/src/cascader2.mjs +2 -0
  249. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  250. package/es/components/cascader-panel/src/index.mjs +1 -0
  251. package/es/components/cascader-panel/src/index.mjs.map +1 -1
  252. package/es/components/color-picker/src/color-picker2.mjs +1 -0
  253. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  254. package/es/components/descriptions/src/description-item.d.ts +4 -0
  255. package/es/components/descriptions/src/description-item.mjs +4 -0
  256. package/es/components/descriptions/src/description-item.mjs.map +1 -1
  257. package/es/components/descriptions/src/description.d.ts +1 -0
  258. package/es/components/descriptions/src/description.mjs +4 -0
  259. package/es/components/descriptions/src/description.mjs.map +1 -1
  260. package/es/components/descriptions/src/description.vue.d.ts +3 -0
  261. package/es/components/descriptions/src/descriptions-cell.mjs +2 -1
  262. package/es/components/descriptions/src/descriptions-cell.mjs.map +1 -1
  263. package/es/components/descriptions/src/descriptions.type.d.ts +2 -0
  264. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -2
  265. package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
  266. package/es/components/dropdown/src/dropdown2.mjs +6 -1
  267. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  268. package/es/components/dropdown/src/useDropdown.mjs +1 -1
  269. package/es/components/dropdown/src/useDropdown.mjs.map +1 -1
  270. package/es/components/focus-trap/src/focus-trap.mjs +2 -2
  271. package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
  272. package/es/components/mention/src/mention2.mjs +51 -45
  273. package/es/components/mention/src/mention2.mjs.map +1 -1
  274. package/es/components/menu/src/utils/menu-item.mjs +1 -0
  275. package/es/components/menu/src/utils/menu-item.mjs.map +1 -1
  276. package/es/components/menu/src/utils/submenu.mjs +1 -0
  277. package/es/components/menu/src/utils/submenu.mjs.map +1 -1
  278. package/es/components/pagination/src/components/next.mjs +36 -19
  279. package/es/components/pagination/src/components/next.mjs.map +1 -1
  280. package/es/components/pagination/src/components/next2.mjs +19 -36
  281. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  282. package/es/components/pagination/src/pagination.mjs +1 -1
  283. package/es/components/pagination/style/css.d.ts +1 -0
  284. package/es/components/pagination/style/css.mjs +1 -0
  285. package/es/components/pagination/style/css.mjs.map +1 -1
  286. package/es/components/pagination/style/index.d.ts +1 -0
  287. package/es/components/pagination/style/index.mjs +1 -0
  288. package/es/components/pagination/style/index.mjs.map +1 -1
  289. package/es/components/roving-focus-group/src/roving-focus-item.mjs +2 -2
  290. package/es/components/roving-focus-group/src/roving-focus-item.mjs.map +1 -1
  291. package/es/components/roving-focus-group/src/utils.mjs +1 -1
  292. package/es/components/roving-focus-group/src/utils.mjs.map +1 -1
  293. package/es/components/select-v2/src/select-dropdown.mjs +7 -9
  294. package/es/components/select-v2/src/select-dropdown.mjs.map +1 -1
  295. package/es/components/select-v2/src/useSelect.mjs +2 -1
  296. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  297. package/es/components/slider/src/button.mjs +21 -91
  298. package/es/components/slider/src/button.mjs.map +1 -1
  299. package/es/components/slider/src/button2.mjs +91 -21
  300. package/es/components/slider/src/button2.mjs.map +1 -1
  301. package/es/components/slider/src/composables/use-slider-button.mjs +24 -15
  302. package/es/components/slider/src/composables/use-slider-button.mjs.map +1 -1
  303. package/es/components/slider/src/slider2.mjs +1 -1
  304. package/es/components/tabs/src/tab-nav.mjs +21 -25
  305. package/es/components/tabs/src/tab-nav.mjs.map +1 -1
  306. package/es/components/tabs/src/tabs.mjs +1 -1
  307. package/es/components/tabs/src/tabs.mjs.map +1 -1
  308. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.mjs +8 -4
  309. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.mjs.map +1 -1
  310. package/es/components/tooltip/src/trigger.mjs +1 -1
  311. package/es/components/tooltip/src/trigger.mjs.map +1 -1
  312. package/es/components/tree/src/model/useKeydown.mjs +1 -1
  313. package/es/components/tree/src/model/useKeydown.mjs.map +1 -1
  314. package/es/hooks/use-escape-keydown/index.mjs +2 -3
  315. package/es/hooks/use-escape-keydown/index.mjs.map +1 -1
  316. package/es/version.d.ts +1 -1
  317. package/es/version.mjs +1 -1
  318. package/es/version.mjs.map +1 -1
  319. package/lib/components/cascader/src/cascader2.js +2 -0
  320. package/lib/components/cascader/src/cascader2.js.map +1 -1
  321. package/lib/components/cascader-panel/src/index.js +1 -0
  322. package/lib/components/cascader-panel/src/index.js.map +1 -1
  323. package/lib/components/color-picker/src/color-picker2.js +1 -0
  324. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  325. package/lib/components/descriptions/src/description-item.d.ts +4 -0
  326. package/lib/components/descriptions/src/description-item.js +4 -0
  327. package/lib/components/descriptions/src/description-item.js.map +1 -1
  328. package/lib/components/descriptions/src/description.d.ts +1 -0
  329. package/lib/components/descriptions/src/description.js +4 -0
  330. package/lib/components/descriptions/src/description.js.map +1 -1
  331. package/lib/components/descriptions/src/description.vue.d.ts +3 -0
  332. package/lib/components/descriptions/src/descriptions-cell.js +2 -1
  333. package/lib/components/descriptions/src/descriptions-cell.js.map +1 -1
  334. package/lib/components/descriptions/src/descriptions.type.d.ts +2 -0
  335. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -2
  336. package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
  337. package/lib/components/dropdown/src/dropdown2.js +6 -1
  338. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  339. package/lib/components/dropdown/src/useDropdown.js +1 -1
  340. package/lib/components/dropdown/src/useDropdown.js.map +1 -1
  341. package/lib/components/focus-trap/src/focus-trap.js +2 -2
  342. package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
  343. package/lib/components/mention/src/mention2.js +51 -45
  344. package/lib/components/mention/src/mention2.js.map +1 -1
  345. package/lib/components/menu/src/utils/menu-item.js +1 -0
  346. package/lib/components/menu/src/utils/menu-item.js.map +1 -1
  347. package/lib/components/menu/src/utils/submenu.js +1 -0
  348. package/lib/components/menu/src/utils/submenu.js.map +1 -1
  349. package/lib/components/pagination/src/components/next.js +36 -19
  350. package/lib/components/pagination/src/components/next.js.map +1 -1
  351. package/lib/components/pagination/src/components/next2.js +19 -36
  352. package/lib/components/pagination/src/components/next2.js.map +1 -1
  353. package/lib/components/pagination/src/pagination.js +1 -1
  354. package/lib/components/pagination/style/css.d.ts +1 -0
  355. package/lib/components/pagination/style/css.js +1 -0
  356. package/lib/components/pagination/style/css.js.map +1 -1
  357. package/lib/components/pagination/style/index.d.ts +1 -0
  358. package/lib/components/pagination/style/index.js +1 -0
  359. package/lib/components/pagination/style/index.js.map +1 -1
  360. package/lib/components/roving-focus-group/src/roving-focus-item.js +2 -2
  361. package/lib/components/roving-focus-group/src/roving-focus-item.js.map +1 -1
  362. package/lib/components/roving-focus-group/src/utils.js +1 -1
  363. package/lib/components/roving-focus-group/src/utils.js.map +1 -1
  364. package/lib/components/select-v2/src/select-dropdown.js +7 -9
  365. package/lib/components/select-v2/src/select-dropdown.js.map +1 -1
  366. package/lib/components/select-v2/src/useSelect.js +2 -1
  367. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  368. package/lib/components/slider/src/button.js +22 -91
  369. package/lib/components/slider/src/button.js.map +1 -1
  370. package/lib/components/slider/src/button2.js +91 -22
  371. package/lib/components/slider/src/button2.js.map +1 -1
  372. package/lib/components/slider/src/composables/use-slider-button.js +24 -15
  373. package/lib/components/slider/src/composables/use-slider-button.js.map +1 -1
  374. package/lib/components/slider/src/slider2.js +1 -1
  375. package/lib/components/tabs/src/tab-nav.js +21 -25
  376. package/lib/components/tabs/src/tab-nav.js.map +1 -1
  377. package/lib/components/tabs/src/tabs.js +1 -1
  378. package/lib/components/tabs/src/tabs.js.map +1 -1
  379. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.js +7 -3
  380. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.js.map +1 -1
  381. package/lib/components/tooltip/src/trigger.js +1 -1
  382. package/lib/components/tooltip/src/trigger.js.map +1 -1
  383. package/lib/components/tree/src/model/useKeydown.js +1 -1
  384. package/lib/components/tree/src/model/useKeydown.js.map +1 -1
  385. package/lib/hooks/use-escape-keydown/index.js +2 -3
  386. package/lib/hooks/use-escape-keydown/index.js.map +1 -1
  387. package/lib/version.d.ts +1 -1
  388. package/lib/version.js +1 -1
  389. package/lib/version.js.map +1 -1
  390. package/package.json +2 -2
  391. package/tags.json +1 -1
  392. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.mjs","sources":["../../../../../../../packages/components/menu/src/utils/menu-item.ts"],"sourcesContent":["// @ts-nocheck\nimport { triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport SubMenu from './submenu'\n\nclass MenuItem {\n public submenu: SubMenu = null\n constructor(public domNode: HTMLElement, namespace: string) {\n this.submenu = null\n this.init(namespace)\n }\n\n init(namespace: string): void {\n this.domNode.setAttribute('tabindex', '0')\n const menuChild = this.domNode.querySelector(`.${namespace}-menu`)\n if (menuChild) {\n this.submenu = new SubMenu(this, menuChild)\n }\n this.addListeners()\n }\n\n addListeners(): void {\n this.domNode.addEventListener('keydown', (event: KeyboardEvent) => {\n let prevDef = false\n switch (event.code) {\n case EVENT_CODE.down: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu && this.submenu.gotoSubIndex(0)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu &&\n this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n }\n })\n }\n}\n\nexport default MenuItem\n"],"names":[],"mappings":";;;;;;AAGA,MAAM,QAAQ,CAAC;AACf,EAAE,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE;AAClC,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAC3B,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;AACxB,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;AACxB,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACzB,GAAG;AACH,EAAE,IAAI,CAAC,SAAS,EAAE;AAClB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AAC/C,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAA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;AACzB,UAAU,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACtC,UAAU,MAAM;AAChB,SAAS;AACT,OAAO;AACP,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,KAAK,CAAC,cAAc,EAAE,CAAC;AAC/B,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"menu-item.mjs","sources":["../../../../../../../packages/components/menu/src/utils/menu-item.ts"],"sourcesContent":["// @ts-nocheck\nimport { triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport SubMenu from './submenu'\n\nclass MenuItem {\n public submenu: SubMenu = null\n constructor(public domNode: HTMLElement, namespace: string) {\n this.submenu = null\n this.init(namespace)\n }\n\n init(namespace: string): void {\n this.domNode.setAttribute('tabindex', '0')\n const menuChild = this.domNode.querySelector(`.${namespace}-menu`)\n if (menuChild) {\n this.submenu = new SubMenu(this, menuChild)\n }\n this.addListeners()\n }\n\n addListeners(): void {\n this.domNode.addEventListener('keydown', (event: KeyboardEvent) => {\n let prevDef = false\n switch (event.code) {\n case EVENT_CODE.down: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu && this.submenu.gotoSubIndex(0)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu &&\n this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n }\n })\n }\n}\n\nexport default MenuItem\n"],"names":[],"mappings":";;;;;;AAGA,MAAM,QAAQ,CAAC;AACf,EAAE,WAAW,CAAC,OAAO,EAAE,S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AI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC1F,UAAU,OAAO,GAAG,IAAI,CAAC;AACzB,UAAU,MAAM;AAChB,SAAS;AACT,QAAQ,KAAK,UAAU,CAAC,GAAG,EAAE;AAC7B,UAAU,YAAY,CAAC,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AAC1D,UAAU,MAAM;AAChB,SAAS;AACT,QAAQ,KAAK,UAAU,CAAC,KAAK,CAAC;AAC9B,QAAQ,KAAK,UAAU,CAAC,WAAW,CAAC;AACpC,QAAQ,KAAK,UAAU,CAAC,KAAK,EAAE;AAC/B,UAAU,OAAO,GAAG,IAAI,CAAC;AACzB,UAAU,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACtC,UAAU,MAAM;AAChB,SAAS;AACT,OAAO;AACP,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,KAAK,CAAC,cAAc,EAAE,CAAC;AAC/B,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
@@ -46,6 +46,7 @@ class SubMenu {
46
46
  break;
47
47
  }
48
48
  case EVENT_CODE.enter:
49
+ case EVENT_CODE.numpadEnter:
49
50
  case EVENT_CODE.space: {
50
51
  prevDef = true;
51
52
  event.currentTarget.click();
@@ -1 +1 @@
1
- {"version":3,"file":"submenu.mjs","sources":["../../../../../../../packages/components/menu/src/utils/submenu.ts"],"sourcesContent":["// @ts-nocheck\nimport { triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport type MenuItem from './menu-item'\n\nclass SubMenu {\n public subMenuItems: NodeList\n public subIndex = 0\n constructor(public parent: MenuItem, public domNode: ParentNode) {\n this.subIndex = 0\n this.init()\n }\n\n init(): void {\n this.subMenuItems = this.domNode.querySelectorAll('li')\n this.addListeners()\n }\n\n gotoSubIndex(idx: number): void {\n if (idx === this.subMenuItems.length) {\n idx = 0\n } else if (idx < 0) {\n idx = this.subMenuItems.length - 1\n }\n ;(this.subMenuItems[idx] as HTMLElement).focus()\n this.subIndex = idx\n }\n\n addListeners(): void {\n const parentNode = this.parent.domNode\n Array.prototype.forEach.call(this.subMenuItems, (el: Element) => {\n el.addEventListener('keydown', (event: KeyboardEvent) => {\n let prevDef = false\n switch (event.code) {\n case EVENT_CODE.down: {\n this.gotoSubIndex(this.subIndex + 1)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n this.gotoSubIndex(this.subIndex - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(parentNode as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n event.stopPropagation()\n }\n return false\n })\n })\n }\n}\n\nexport default SubMenu\n"],"names":[],"mappings":";;;;;AAEA,MAAM,OAAO,CAAC;AACd,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/B,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACzB,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAC3B,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;AACtB,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;AACtB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;AAChB,GAAG;AACH,EAAE,IAAI,GAAG;AACT,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAC5D,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;AACxB,GAAG;AACH,EAAE,YAAY,CAAC,GAAG,EAAE;AACpB,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;AAC1C,MAAM,GAAG,GAAG,CAAC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,OAAO,GAAG,IAAI,CAAC;AAC3B,YAAY,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxC,YAAY,MAAM;AAClB,WAAW;AACX,SAAS;AACT,QAAQ,IAAI,OAAO,EAAE;AACrB,UAAU,KAAK,CAAC,cAAc,EAAE,CAAC;AACjC,UAAU,KAAK,CAAC,eAAe,EAAE,CAAC;AAClC,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO,CAAC,CAAC;AACT,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"submenu.mjs","sources":["../../../../../../../packages/components/menu/src/utils/submenu.ts"],"sourcesContent":["// @ts-nocheck\nimport { triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport type MenuItem from './menu-item'\n\nclass SubMenu {\n public subMenuItems: NodeList\n public subIndex = 0\n constructor(public parent: MenuItem, public domNode: ParentNode) {\n this.subIndex = 0\n this.init()\n }\n\n init(): void {\n this.subMenuItems = this.domNode.querySelectorAll('li')\n this.addListeners()\n }\n\n gotoSubIndex(idx: number): void {\n if (idx === this.subMenuItems.length) {\n idx = 0\n } else if (idx < 0) {\n idx = this.subMenuItems.length - 1\n }\n ;(this.subMenuItems[idx] as HTMLElement).focus()\n this.subIndex = idx\n }\n\n addListeners(): void {\n const parentNode = this.parent.domNode\n Array.prototype.forEach.call(this.subMenuItems, (el: Element) => {\n el.addEventListener('keydown', (event: KeyboardEvent) => {\n let prevDef = false\n switch (event.code) {\n case EVENT_CODE.down: {\n this.gotoSubIndex(this.subIndex + 1)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n this.gotoSubIndex(this.subIndex - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(parentNode as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break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,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,KAAK;AAChD,QAAQ,IAAI,OAAO,GAAG,KAAK,CAAC;AAC5B,QAAQ,QAAQ,KAAK,CAAC,IAAI;AAC1B,UAAU,KAAK,UAAU,CAAC,IAAI,EAAE;AAChC,YAAY,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;AACjD,YAAY,OAAO,GAAG,IAAI,CAAC;AAC3B,YAAY,MAAM;AAClB,WAAW;AACX,UAAU,KAAK,UAAU,CAAC,EAAE,EAAE;AAC9B,YAAY,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;AACjD,YAAY,OAAO,GAAG,IAAI,CAAC;AAC3B,YAAY,MAAM;AAClB,WAAW;AACX,UAAU,KAAK,UAAU,CAAC,GAAG,EAAE;AAC/B,YAAY,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACnD,YAAY,MAAM;AAClB,WAAW;AACX,UAAU,KAAK,UAAU,CAAC,KAAK,CAAC;AAChC,UAAU,KAAK,UAAU,CAAC,WAAW,CAAC;AACtC,UAAU,KAAK,UAAU,CAAC,KAAK,EAAE;AACjC,YAAY,OAAO,GAAG,IAAI,CAAC;AAC3B,YAAY,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxC,YAAY,MAAM;AAClB,WAAW;AACX,SAAS;AACT,QAAQ,IAAI,OAAO,EAAE;AACrB,UAAU,KAAK,CAAC,cAAc,EAAE,CAAC;AACjC,UAAU,KAAK,CAAC,eAAe,EAAE,CAAC;AAClC,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO,CAAC,CAAC;AACT,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
@@ -1,24 +1,41 @@
1
- import '../../../../utils/index.mjs';
2
- import { buildProps } from '../../../../utils/vue/props/runtime.mjs';
3
- import { iconPropType } from '../../../../utils/vue/icon.mjs';
1
+ import { defineComponent, computed, openBlock, createElementBlock, unref, toDisplayString, createBlock, withCtx, resolveDynamicComponent } from 'vue';
2
+ import '../../../../hooks/index.mjs';
3
+ import { ElIcon } from '../../../icon/index.mjs';
4
+ import { paginationNextProps } from './next2.mjs';
5
+ import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useLocale } from '../../../../hooks/use-locale/index.mjs';
4
7
 
5
- const paginationNextProps = buildProps({
6
- disabled: Boolean,
7
- currentPage: {
8
- type: Number,
9
- default: 1
10
- },
11
- pageCount: {
12
- type: Number,
13
- default: 50
14
- },
15
- nextText: {
16
- type: String
17
- },
18
- nextIcon: {
19
- type: iconPropType
8
+ const __default__ = defineComponent({
9
+ name: "ElPaginationNext"
10
+ });
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...__default__,
13
+ props: paginationNextProps,
14
+ emits: ["click"],
15
+ setup(__props) {
16
+ const props = __props;
17
+ const { t } = useLocale();
18
+ const internalDisabled = computed(() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0);
19
+ return (_ctx, _cache) => {
20
+ return openBlock(), createElementBlock("button", {
21
+ type: "button",
22
+ class: "btn-next",
23
+ disabled: unref(internalDisabled),
24
+ "aria-label": _ctx.nextText || unref(t)("el.pagination.next"),
25
+ "aria-disabled": unref(internalDisabled),
26
+ onClick: ($event) => _ctx.$emit("click", $event)
27
+ }, [
28
+ _ctx.nextText ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.nextText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
29
+ default: withCtx(() => [
30
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))
31
+ ]),
32
+ _: 1
33
+ }))
34
+ ], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
35
+ };
20
36
  }
21
37
  });
38
+ var Next = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "next.vue"]]);
22
39
 
23
- export { paginationNextProps };
40
+ export { Next as default };
24
41
  //# sourceMappingURL=next.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"next.mjs","sources":["../../../../../../../packages/components/pagination/src/components/next.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Next from './next.vue'\n\nexport const paginationNextProps = buildProps({\n disabled: Boolean,\n currentPage: {\n type: Number,\n default: 1,\n },\n pageCount: {\n type: Number,\n default: 50,\n },\n nextText: {\n type: String,\n },\n nextIcon: {\n type: iconPropType,\n },\n} as const)\n\nexport type PaginationNextProps = ExtractPropTypes<typeof paginationNextProps>\n\nexport type NextInstance = InstanceType<typeof Next>\n"],"names":[],"mappings":";;;;AACY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"next.mjs","sources":["../../../../../../../packages/components/pagination/src/components/next.vue"],"sourcesContent":["<template>\n <button\n type=\"button\"\n class=\"btn-next\"\n :disabled=\"internalDisabled\"\n :aria-label=\"nextText || t('el.pagination.next')\"\n :aria-disabled=\"internalDisabled\"\n @click=\"$emit('click', $event)\"\n >\n <span v-if=\"nextText\">{{ nextText }}</span>\n <el-icon v-else>\n <component :is=\"nextIcon\" />\n </el-icon>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { paginationNextProps } from './next'\n\ndefineOptions({\n name: 'ElPaginationNext',\n})\n\nconst props = defineProps(paginationNextProps)\n\ndefineEmits(['click'])\n\nconst { t } = useLocale()\n\nconst internalDisabled = computed(\n () =>\n props.disabled ||\n props.currentPage === props.pageCount ||\n props.pageCount === 0\n)\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;mCAsBc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAMA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAExB,IAAA,MAAM,gBAAmB,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,WAAA,KAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,SAAA,KAAA,CAAA,CAAA,CAAA;AAAA,IACvB,OAAA,CACE,MAAM,MACN,KAAA;AACoB,MACxB,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,41 +1,24 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, unref, toDisplayString, createBlock, withCtx, resolveDynamicComponent } from 'vue';
2
- import '../../../../hooks/index.mjs';
3
- import { ElIcon } from '../../../icon/index.mjs';
4
- import { paginationNextProps } from './next.mjs';
5
- import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { useLocale } from '../../../../hooks/use-locale/index.mjs';
1
+ import '../../../../utils/index.mjs';
2
+ import { buildProps } from '../../../../utils/vue/props/runtime.mjs';
3
+ import { iconPropType } from '../../../../utils/vue/icon.mjs';
7
4
 
8
- const __default__ = defineComponent({
9
- name: "ElPaginationNext"
10
- });
11
- const _sfc_main = /* @__PURE__ */ defineComponent({
12
- ...__default__,
13
- props: paginationNextProps,
14
- emits: ["click"],
15
- setup(__props) {
16
- const props = __props;
17
- const { t } = useLocale();
18
- const internalDisabled = computed(() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0);
19
- return (_ctx, _cache) => {
20
- return openBlock(), createElementBlock("button", {
21
- type: "button",
22
- class: "btn-next",
23
- disabled: unref(internalDisabled),
24
- "aria-label": _ctx.nextText || unref(t)("el.pagination.next"),
25
- "aria-disabled": unref(internalDisabled),
26
- onClick: ($event) => _ctx.$emit("click", $event)
27
- }, [
28
- _ctx.nextText ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.nextText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
29
- default: withCtx(() => [
30
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))
31
- ]),
32
- _: 1
33
- }))
34
- ], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
35
- };
5
+ const paginationNextProps = buildProps({
6
+ disabled: Boolean,
7
+ currentPage: {
8
+ type: Number,
9
+ default: 1
10
+ },
11
+ pageCount: {
12
+ type: Number,
13
+ default: 50
14
+ },
15
+ nextText: {
16
+ type: String
17
+ },
18
+ nextIcon: {
19
+ type: iconPropType
36
20
  }
37
21
  });
38
- var Next = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "next.vue"]]);
39
22
 
40
- export { Next as default };
23
+ export { paginationNextProps };
41
24
  //# sourceMappingURL=next2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"next2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/next.vue"],"sourcesContent":["<template>\n <button\n type=\"button\"\n class=\"btn-next\"\n :disabled=\"internalDisabled\"\n :aria-label=\"nextText || t('el.pagination.next')\"\n :aria-disabled=\"internalDisabled\"\n @click=\"$emit('click', $event)\"\n >\n <span v-if=\"nextText\">{{ nextText }}</span>\n <el-icon v-else>\n <component :is=\"nextIcon\" />\n </el-icon>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { paginationNextProps } from './next'\n\ndefineOptions({\n name: 'ElPaginationNext',\n})\n\nconst props = defineProps(paginationNextProps)\n\ndefineEmits(['click'])\n\nconst { t } = useLocale()\n\nconst internalDisabled = computed(\n () =>\n props.disabled ||\n props.currentPage === props.pageCount ||\n props.pageCount === 0\n)\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;mCAsBc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAMA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAExB,IAAA,MAAM,gBAAmB,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,WAAA,KAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,SAAA,KAAA,CAAA,CAAA,CAAA;AAAA,IACvB,OAAA,CACE,MAAM,MACN,KAAA;AACoB,MACxB,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"next2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/next.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Next from './next.vue'\n\nexport const paginationNextProps = buildProps({\n disabled: Boolean,\n currentPage: {\n type: Number,\n default: 1,\n },\n pageCount: {\n type: Number,\n default: 50,\n },\n nextText: {\n type: String,\n },\n nextIcon: {\n type: iconPropType,\n },\n} as const)\n\nexport type PaginationNextProps = ExtractPropTypes<typeof paginationNextProps>\n\nexport type NextInstance = InstanceType<typeof Next>\n"],"names":[],"mappings":";;;;AACY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,CAAC;;;;"}
@@ -4,7 +4,7 @@ import '../../../utils/index.mjs';
4
4
  import '../../../hooks/index.mjs';
5
5
  import { elPaginationKey } from './constants.mjs';
6
6
  import Prev from './components/prev2.mjs';
7
- import Next from './components/next2.mjs';
7
+ import Next from './components/next.mjs';
8
8
  import Sizes from './components/sizes2.mjs';
9
9
  import Jumper from './components/jumper2.mjs';
10
10
  import Total from './components/total2.mjs';
@@ -1,3 +1,4 @@
1
1
  import '@element-plus/nightly/es/components/base/style/css';
2
2
  import '@element-plus/nightly/es/nightly/theme-chalk/el-pagination.css';
3
3
  import '@element-plus/nightly/es/components/select/style/css';
4
+ import '@element-plus/nightly/es/components/input/style/css';
@@ -1,4 +1,5 @@
1
1
  import '../../base/style/css.mjs';
2
2
  import '@element-plus/nightly/theme-chalk/el-pagination.css';
3
3
  import '../../select/style/css.mjs';
4
+ import '../../input/style/css.mjs';
4
5
  //# sourceMappingURL=css.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,3 +1,4 @@
1
1
  import '@element-plus/nightly/es/components/base/style';
2
2
  import '@element-plus/nightly/es/nightly/theme-chalk/src/pagination.scss';
3
3
  import '@element-plus/nightly/es/components/select/style';
4
+ import '@element-plus/nightly/es/components/input/style';
@@ -1,4 +1,5 @@
1
1
  import '../../base/style/index.mjs';
2
2
  import '@element-plus/nightly/theme-chalk/src/pagination.scss';
3
3
  import '../../select/style/index.mjs';
4
+ import '../../input/style/index.mjs';
4
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -47,8 +47,8 @@ const _sfc_main = defineComponent({
47
47
  const handleKeydown = composeEventHandlers((e) => {
48
48
  emit("keydown", e);
49
49
  }, (e) => {
50
- const { key, shiftKey, target, currentTarget } = e;
51
- if (key === EVENT_CODE.tab && shiftKey) {
50
+ const { code, shiftKey, target, currentTarget } = e;
51
+ if (code === EVENT_CODE.tab && shiftKey) {
52
52
  onItemShiftTab();
53
53
  return;
54
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"roving-focus-item.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-item.vue"],"sourcesContent":["<template>\n <el-roving-focus-collection-item\n :id=\"id\"\n :focusable=\"focusable\"\n :active=\"active\"\n >\n <slot />\n </el-roving-focus-collection-item>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n inject,\n nextTick,\n provide,\n ref,\n unref,\n} from 'vue'\nimport { useId } from '@element-plus/hooks'\nimport { composeEventHandlers } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ElCollectionItem as ElRovingFocusCollectionItem,\n ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n} from './roving-focus-group'\nimport {\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,\n} from './tokens'\nimport { focusFirst, getFocusIntent, reorderArray } from './utils'\n\nexport default defineComponent({\n components: {\n ElRovingFocusCollectionItem,\n },\n props: {\n focusable: {\n type: Boolean,\n default: true,\n },\n active: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['mousedown', 'focus', 'keydown'],\n setup(props, { emit }) {\n const { currentTabbedId, loop, onItemFocus, onItemShiftTab } = inject(\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n undefined\n )!\n\n const { getItems } = inject(\n ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n undefined\n )!\n\n const id = useId()\n const rovingFocusGroupItemRef = ref<HTMLElement | null>(null)\n\n const handleMousedown = composeEventHandlers(\n (e: Event) => {\n emit('mousedown', e)\n },\n (e) => {\n if (!props.focusable) {\n e.preventDefault()\n } else {\n onItemFocus(unref(id))\n }\n }\n )\n\n const handleFocus = composeEventHandlers(\n (e: Event) => {\n emit('focus', e)\n },\n () => {\n onItemFocus(unref(id))\n }\n )\n\n const handleKeydown = composeEventHandlers(\n (e: Event) => {\n emit('keydown', e)\n },\n (e) => {\n const { key, shiftKey, target, currentTarget } = e as KeyboardEvent\n if (key === EVENT_CODE.tab && shiftKey) {\n onItemShiftTab()\n return\n }\n if (target !== currentTarget) return\n const focusIntent = getFocusIntent(e as KeyboardEvent)\n\n if (focusIntent) {\n e.preventDefault()\n const items = getItems<typeof props>().filter(\n (item) => item.focusable\n )\n\n let elements = items.map((item) => item.ref!)\n\n switch (focusIntent) {\n case 'last': {\n elements.reverse()\n break\n }\n case 'prev':\n case 'next': {\n if (focusIntent === 'prev') {\n elements.reverse()\n }\n const currentIdx = elements.indexOf(currentTarget as HTMLElement)\n elements = loop.value\n ? reorderArray(elements, currentIdx + 1)\n : elements.slice(currentIdx + 1)\n break\n }\n default: {\n break\n }\n }\n\n nextTick(() => {\n focusFirst(elements)\n })\n }\n }\n )\n\n const isCurrentTab = computed(() => currentTabbedId.value === unref(id))\n\n provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {\n rovingFocusGroupItemRef,\n tabIndex: computed(() => (unref(isCurrentTab) ? 0 : -1)),\n handleMousedown,\n handleFocus,\n handleKeydown,\n })\n\n return {\n id,\n handleKeydown,\n handleFocus,\n handleMousedown,\n }\n },\n})\n</script>\n"],"names":["ElRovingFocusCollectionItem","ROVING_FOCUS_COLLECTION_INJECTION_KEY","_resolveComponent","_createBlock","_withCtx","_renderSlot"],"mappings":";;;;;;;;;;;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AAAA,KACA,CAAA;AAAA,IACA,CAAA,EAAA,CAAA;AAAA,GACA,EAAA,CAAA,EAAA,CAAA,IAAA,EAAA,WAAA,EAAA,QAAA,CAAA,CAAA,CAAA;AAAA,CACF;AAEJ,wBAAC,gBAAA,WAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,uBAAA,CAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"roving-focus-item.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-item.vue"],"sourcesContent":["<template>\n <el-roving-focus-collection-item\n :id=\"id\"\n :focusable=\"focusable\"\n :active=\"active\"\n >\n <slot />\n </el-roving-focus-collection-item>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n inject,\n nextTick,\n provide,\n ref,\n unref,\n} from 'vue'\nimport { useId } from '@element-plus/hooks'\nimport { composeEventHandlers } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ElCollectionItem as ElRovingFocusCollectionItem,\n ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n} from './roving-focus-group'\nimport {\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,\n} from './tokens'\nimport { focusFirst, getFocusIntent, reorderArray } from './utils'\n\nexport default defineComponent({\n components: {\n ElRovingFocusCollectionItem,\n },\n props: {\n focusable: {\n type: Boolean,\n default: true,\n },\n active: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['mousedown', 'focus', 'keydown'],\n setup(props, { emit }) {\n const { currentTabbedId, loop, onItemFocus, onItemShiftTab } = inject(\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n undefined\n )!\n\n const { getItems } = inject(\n ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n undefined\n )!\n\n const id = useId()\n const rovingFocusGroupItemRef = ref<HTMLElement | null>(null)\n\n const handleMousedown = composeEventHandlers(\n (e: Event) => {\n emit('mousedown', e)\n },\n (e) => {\n if (!props.focusable) {\n e.preventDefault()\n } else {\n onItemFocus(unref(id))\n }\n }\n )\n\n const handleFocus = composeEventHandlers(\n (e: Event) => {\n emit('focus', e)\n },\n () => {\n onItemFocus(unref(id))\n }\n )\n\n const handleKeydown = composeEventHandlers(\n (e: Event) => {\n emit('keydown', e)\n },\n (e) => {\n const { code, shiftKey, target, currentTarget } = e as KeyboardEvent\n if (code === EVENT_CODE.tab && shiftKey) {\n onItemShiftTab()\n return\n }\n if (target !== currentTarget) return\n const focusIntent = getFocusIntent(e as KeyboardEvent)\n\n if (focusIntent) {\n e.preventDefault()\n const items = getItems<typeof props>().filter(\n (item) => item.focusable\n )\n\n let elements = items.map((item) => item.ref!)\n\n switch (focusIntent) {\n case 'last': {\n elements.reverse()\n break\n }\n case 'prev':\n case 'next': {\n if (focusIntent === 'prev') {\n elements.reverse()\n }\n const currentIdx = elements.indexOf(currentTarget as HTMLElement)\n elements = loop.value\n ? reorderArray(elements, currentIdx + 1)\n : elements.slice(currentIdx + 1)\n break\n }\n default: {\n break\n }\n }\n\n nextTick(() => {\n focusFirst(elements)\n })\n }\n }\n )\n\n const isCurrentTab = computed(() => currentTabbedId.value === unref(id))\n\n provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {\n rovingFocusGroupItemRef,\n tabIndex: computed(() => (unref(isCurrentTab) ? 0 : -1)),\n handleMousedown,\n handleFocus,\n handleKeydown,\n })\n\n return {\n id,\n handleKeydown,\n handleFocus,\n handleMousedown,\n }\n },\n})\n</script>\n"],"names":["ElRovingFocusCollectionItem","ROVING_FOCUS_COLLECTION_INJECTION_KEY","_resolveComponent","_createBlock","_withCtx","_renderSlot"],"mappings":";;;;;;;;;;;;AAiCA,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,UAAY,EAAA;AAAA,iCACVA,gBAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,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,wBAAC,gBAAA,WAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,uBAAA,CAAA,CAAA,CAAA;;;;"}
@@ -24,7 +24,7 @@ const getDirectionAwareKey = (key, dir) => {
24
24
  }
25
25
  };
26
26
  const getFocusIntent = (event, orientation, dir) => {
27
- const key = getDirectionAwareKey(event.key, dir);
27
+ const key = getDirectionAwareKey(event.code, dir);
28
28
  if (orientation === "vertical" && [EVENT_CODE.left, EVENT_CODE.right].includes(key))
29
29
  return void 0;
30
30
  if (orientation === "horizontal" && [EVENT_CODE.up, EVENT_CODE.down].includes(key))
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/utils.ts"],"sourcesContent":["import { EVENT_CODE } from '@element-plus/constants'\nimport type { HTMLAttributes } from 'vue'\n\ntype Orientation = HTMLAttributes['aria-orientation']\ntype Direction = 'ltr' | 'rtl'\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next'\n\nconst MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n ArrowLeft: 'prev',\n ArrowUp: 'prev',\n ArrowRight: 'next',\n ArrowDown: 'next',\n PageUp: 'first',\n Home: 'first',\n PageDown: 'last',\n End: 'last',\n}\n\nconst getDirectionAwareKey = (key: string, dir?: Direction) => {\n if (dir !== 'rtl') return key\n\n switch (key) {\n case EVENT_CODE.right:\n return EVENT_CODE.left\n case EVENT_CODE.left:\n return EVENT_CODE.right\n default:\n return key\n }\n}\n\nexport const getFocusIntent = (\n event: KeyboardEvent,\n orientation?: Orientation,\n dir?: Direction\n) => {\n const key = getDirectionAwareKey(event.key, dir)\n if (\n orientation === 'vertical' &&\n [EVENT_CODE.left, EVENT_CODE.right].includes(key)\n )\n return undefined\n if (\n orientation === 'horizontal' &&\n [EVENT_CODE.up, EVENT_CODE.down].includes(key)\n )\n return undefined\n return MAP_KEY_TO_FOCUS_INTENT[key]\n}\n\nexport const reorderArray = <T>(array: T[], atIdx: number) => {\n return array.map((_, idx) => array[(idx + atIdx) % array.length])\n}\n\nexport const focusFirst = (elements: HTMLElement[]) => {\n const { activeElement: prevActive } = document\n\n for (const element of elements) {\n if (element === prevActive) return\n element.focus()\n if (prevActive !== document.activeElement) return\n }\n}\n"],"names":[],"mappings":";;;AACA,MAAM,uBAAuB,GAAG;AAChC,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,QAAQ,EAAE,MAAM;AAClB,EAAE,GAAG,EAAE,MAAM;AACb,CAAC,CAAC;AACF,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK;AAC3C,EAAE,IAAI,GAAG,KAAK,KAAK;AACnB,IAAI,OAAO,GAAG,CAAC;AACf,EAAE,QAAQ,GAAG;AACb,IAAI,KAAK,UAAU,CAAC,KAAK;AACzB,MAAM,OAAO,UAAU,CAAC,IAAI,CAAC;AAC7B,IAAI,KAAK,UAAU,CAAC,IAAI;AACxB,MAAM,OAAO,UAAU,CAAC,KAAK,CAAC;AAC9B,IAAI;AACJ,MAAM,OAAO,GAAG,CAAC;AACjB,GAAG;AACH,CAAC,CAAC;AACU,MAAC,cAAc,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK;AAC3D,EAAE,MAAM,GAAG,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACnD,EAAE,IAAI,WAAW,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;AACrF,IAAI,OAAO,KAAK,CAAC,CAAC;AAClB,EAAE,IAAI,WAAW,KAAK,YAAY,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;AACpF,IAAI,OAAO,KAAK,CAAC,CAAC;AAClB,EAAE,OAAO,uBAAuB,CAAC,GAAG,CAAC,CAAC;AACtC,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK;AAC9C,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,KAAK,CAAC,CAAC,GAAG,GAAG,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACpE,EAAE;AACU,MAAC,UAAU,GAAG,CAAC,QAAQ,KAAK;AACxC,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;AACjD,EAAE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;AAClC,IAAI,IAAI,OAAO,KAAK,UAAU;AAC9B,MAAM,OAAO;AACb,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;AACpB,IAAI,IAAI,UAAU,KAAK,QAAQ,CAAC,aAAa;AAC7C,MAAM,OAAO;AACb,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../../../../../packages/components/roving-focus-group/src/utils.ts"],"sourcesContent":["import { EVENT_CODE } from '@element-plus/constants'\nimport type { HTMLAttributes } from 'vue'\n\ntype Orientation = HTMLAttributes['aria-orientation']\ntype Direction = 'ltr' | 'rtl'\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next'\n\nconst MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n ArrowLeft: 'prev',\n ArrowUp: 'prev',\n ArrowRight: 'next',\n ArrowDown: 'next',\n PageUp: 'first',\n Home: 'first',\n PageDown: 'last',\n End: 'last',\n}\n\nconst getDirectionAwareKey = (key: string, dir?: Direction) => {\n if (dir !== 'rtl') return key\n\n switch (key) {\n case EVENT_CODE.right:\n return EVENT_CODE.left\n case EVENT_CODE.left:\n return EVENT_CODE.right\n default:\n return key\n }\n}\n\nexport const getFocusIntent = (\n event: KeyboardEvent,\n orientation?: Orientation,\n dir?: Direction\n) => {\n const key = getDirectionAwareKey(event.code, dir)\n if (\n orientation === 'vertical' &&\n [EVENT_CODE.left, EVENT_CODE.right].includes(key)\n )\n return undefined\n if (\n orientation === 'horizontal' &&\n [EVENT_CODE.up, EVENT_CODE.down].includes(key)\n )\n return undefined\n return MAP_KEY_TO_FOCUS_INTENT[key]\n}\n\nexport const reorderArray = <T>(array: T[], atIdx: number) => {\n return array.map((_, idx) => array[(idx + atIdx) % array.length])\n}\n\nexport const focusFirst = (elements: HTMLElement[]) => {\n const { activeElement: prevActive } = document\n\n for (const element of elements) {\n if (element === prevActive) return\n element.focus()\n if (prevActive !== document.activeElement) return\n }\n}\n"],"names":[],"mappings":";;;AACA,MAAM,uBAAuB,GAAG;AAChC,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,OAAO,EAAE,MAAM;AACjB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,QAAQ,EAAE,MAAM;AAClB,EAAE,GAAG,EAAE,MAAM;AACb,CAAC,CAAC;AACF,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK;AAC3C,EAAE,IAAI,GAAG,KAAK,KAAK;AACnB,IAAI,OAAO,GAAG,CAAC;AACf,EAAE,QAAQ,GAAG;AACb,IAAI,KAAK,UAAU,CAAC,KAAK;AACzB,MAAM,OAAO,UAAU,CAAC,IAAI,CAAC;AAC7B,IAAI,KAAK,UAAU,CAAC,IAAI;AACxB,MAAM,OAAO,UAAU,CAAC,KAAK,CAAC;AAC9B,IAAI;AACJ,MAAM,OAAO,GAAG,CAAC;AACjB,GAAG;AACH,CAAC,CAAC;AACU,MAAC,cAAc,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK;AAC3D,EAAE,MAAM,GAAG,GAAG,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACpD,EAAE,IAAI,WAAW,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;AACrF,IAAI,OAAO,KAAK,CAAC,CAAC;AAClB,EAAE,IAAI,WAAW,KAAK,YAAY,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;AACpF,IAAI,OAAO,KAAK,CAAC,CAAC;AAClB,EAAE,OAAO,uBAAuB,CAAC,GAAG,CAAC,CAAC;AACtC,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK;AAC9C,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,KAAK,CAAC,CAAC,GAAG,GAAG,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACpE,EAAE;AACU,MAAC,UAAU,GAAG,CAAC,QAAQ,KAAK;AACxC,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;AACjD,EAAE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;AAClC,IAAI,IAAI,OAAO,KAAK,UAAU;AAC9B,MAAM,OAAO;AACb,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;AACpB,IAAI,IAAI,UAAU,KAAK,QAAQ,CAAC,aAAa;AAC7C,MAAM,OAAO;AACb,GAAG;AACH;;;;"}
@@ -182,7 +182,8 @@ var ElSelectMenu = defineComponent({
182
182
  esc,
183
183
  down,
184
184
  up,
185
- enter
185
+ enter,
186
+ numpadEnter
186
187
  } = EVENT_CODE;
187
188
  if (code !== tab) {
188
189
  e.preventDefault();
@@ -190,22 +191,19 @@ var ElSelectMenu = defineComponent({
190
191
  }
191
192
  switch (code) {
192
193
  case tab:
193
- case esc: {
194
+ case esc:
194
195
  onEscOrTab();
195
196
  break;
196
- }
197
- case down: {
197
+ case down:
198
198
  onForward();
199
199
  break;
200
- }
201
- case up: {
200
+ case up:
202
201
  onBackward();
203
202
  break;
204
- }
205
- case enter: {
203
+ case enter:
204
+ case numpadEnter:
206
205
  onKeyboardSelect();
207
206
  break;
208
- }
209
207
  }
210
208
  };
211
209
  return () => {
@@ -1 +1 @@
1
- {"version":3,"file":"select-dropdown.mjs","sources":["../../../../../../packages/components/select-v2/src/select-dropdown.tsx"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n ref,\n toRaw,\n unref,\n watch,\n} from 'vue'\nimport { get } from 'lodash-unified'\nimport { isObject, isUndefined } from '@element-plus/utils'\nimport {\n DynamicSizeList,\n FixedSizeList,\n} from '@element-plus/components/virtual-list'\nimport { useNamespace } from '@element-plus/hooks'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport GroupItem from './group-item.vue'\nimport OptionItem from './option-item.vue'\nimport { useProps } from './useProps'\n\nimport { selectV2InjectionKey } from './token'\n\nimport type {\n DynamicSizeListInstance,\n FixedSizeListInstance,\n ItemProps,\n} from '@element-plus/components/virtual-list'\nimport type { Option, OptionItemProps } from './select.types'\nimport type {\n ComponentPublicInstance,\n ComputedRef,\n ExtractPropTypes,\n Ref,\n} from 'vue'\n\nconst props = {\n loading: Boolean,\n data: {\n type: Array,\n required: true as const,\n },\n hoveringIndex: Number,\n width: Number,\n}\ninterface SelectDropdownExposed {\n listRef: Ref<FixedSizeListInstance | DynamicSizeListInstance | undefined>\n isSized: ComputedRef<boolean>\n isItemDisabled: (modelValue: any[] | any, selected: boolean) => boolean\n isItemHovering: (target: number) => boolean\n isItemSelected: (modelValue: any[] | any, target: Option) => boolean\n scrollToItem: (index: number) => void\n resetScrollTop: () => void\n}\nexport type SelectDropdownInstance = ComponentPublicInstance<\n ExtractPropTypes<typeof props>,\n SelectDropdownExposed\n>\nexport default defineComponent({\n name: 'ElSelectDropdown',\n props,\n setup(props, { slots, expose }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { getLabel, getValue, getDisabled } = useProps(select.props)\n\n const cachedHeights = ref<Array<number>>([])\n\n const listRef = ref<FixedSizeListInstance | DynamicSizeListInstance>()\n\n const size = computed(() => props.data.length)\n watch(\n () => size.value,\n () => {\n select.tooltipRef.value!.updatePopper?.()\n }\n )\n\n const isSized = computed(() =>\n isUndefined(select.props.estimatedOptionHeight)\n )\n const listProps = computed(() => {\n if (isSized.value) {\n return {\n itemSize: select.props.itemHeight,\n }\n }\n\n return {\n estimatedSize: select.props.estimatedOptionHeight,\n itemSize: (idx: number) => cachedHeights.value[idx],\n }\n })\n\n const contains = (arr: Array<any> = [], target: any) => {\n const {\n props: { valueKey },\n } = select\n\n if (!isObject(target)) {\n return arr.includes(target)\n }\n\n return (\n arr &&\n arr.some((item) => {\n return toRaw(get(item, valueKey)) === get(target, valueKey)\n })\n )\n }\n const isEqual = (selected: unknown, target: unknown) => {\n if (!isObject(target)) {\n return selected === target\n } else {\n const { valueKey } = select.props\n return get(selected, valueKey) === get(target, valueKey)\n }\n }\n\n const isItemSelected: SelectDropdownExposed['isItemSelected'] = (\n modelValue,\n target\n ) => {\n if (select.props.multiple) {\n return contains(modelValue, getValue(target))\n }\n return isEqual(modelValue, getValue(target))\n }\n\n const isItemDisabled: SelectDropdownExposed['isItemDisabled'] = (\n modelValue,\n selected\n ) => {\n const { disabled, multiple, multipleLimit } = select.props\n return (\n disabled ||\n (!selected &&\n (multiple\n ? multipleLimit > 0 && modelValue.length >= multipleLimit\n : false))\n )\n }\n\n const isItemHovering: SelectDropdownExposed['isItemHovering'] = (target) =>\n props.hoveringIndex === target\n\n const scrollToItem: SelectDropdownExposed['scrollToItem'] = (index) => {\n const list = listRef.value\n if (list) {\n list.scrollToItem(index)\n }\n }\n\n const resetScrollTop: SelectDropdownExposed['resetScrollTop'] = () => {\n const list = listRef.value\n if (list) {\n list.resetScrollTop()\n }\n }\n const exposed: SelectDropdownExposed = {\n listRef,\n isSized,\n\n isItemDisabled,\n isItemHovering,\n isItemSelected,\n scrollToItem,\n resetScrollTop,\n }\n expose(exposed)\n\n const Item = (itemProps: ItemProps<any>) => {\n const { index, data, style } = itemProps\n const sized = unref(isSized)\n const { itemSize, estimatedSize } = unref(listProps)\n const { modelValue } = select.props\n const { onSelect, onHover } = select\n const item = data[index]\n if (item.type === 'Group') {\n return (\n <GroupItem\n item={item}\n style={style}\n height={sized ? (itemSize as number) : estimatedSize}\n />\n )\n }\n\n const isSelected = isItemSelected(modelValue, item)\n const isDisabled = isItemDisabled(modelValue, isSelected)\n const isHovering = isItemHovering(index)\n return (\n <OptionItem\n {...itemProps}\n selected={isSelected}\n disabled={getDisabled(item) || isDisabled}\n created={!!item.created}\n hovering={isHovering}\n item={item}\n onSelect={onSelect}\n onHover={onHover}\n >\n {{\n default: (props: OptionItemProps) =>\n slots.default?.(props) || <span>{getLabel(item)}</span>,\n }}\n </OptionItem>\n )\n }\n\n // computed\n const { onKeyboardNavigate, onKeyboardSelect } = select\n\n const onForward = () => {\n onKeyboardNavigate('forward')\n }\n\n const onBackward = () => {\n onKeyboardNavigate('backward')\n }\n\n const onEscOrTab = () => {\n // The following line actually doesn't work. Fixing it may introduce a small breaking change for some users, so just comment it out for now.\n // select.expanded = false\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n const { code } = e\n const { tab, esc, down, up, enter } = EVENT_CODE\n if (code !== tab) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n switch (code) {\n case tab:\n case esc: {\n onEscOrTab()\n break\n }\n case down: {\n onForward()\n break\n }\n case up: {\n onBackward()\n break\n }\n case enter: {\n onKeyboardSelect()\n break\n }\n }\n }\n\n return () => {\n const { data, width } = props\n const { height, multiple, scrollbarAlwaysOn } = select.props\n\n const List = unref(isSized) ? FixedSizeList : DynamicSizeList\n\n return (\n <div\n class={[ns.b('dropdown'), ns.is('multiple', multiple)]}\n style={{\n width: `${width}px`,\n }}\n >\n {slots.header?.()}\n {slots.loading?.() || slots.empty?.() || (\n <List\n ref={listRef}\n {...unref(listProps)}\n className={ns.be('dropdown', 'list')}\n scrollbarAlwaysOn={scrollbarAlwaysOn}\n data={data}\n height={height}\n width={width}\n total={data.length}\n // @ts-ignore - dts problem\n onKeydown={onKeydown}\n >\n {{\n default: (props: ItemProps<any>) => <Item {...props} />,\n }}\n </List>\n )}\n {slots.footer?.()}\n </div>\n )\n }\n },\n})\n"],"names":["props","loading","Boolean","data","type","Array","required","hoveringIndex","Number","width","defineComponent","name","slots","expose","select","ns","getLabel","getValue","getDisabled","cachedHeights","ref","listRef","size","computed","watch","tooltipRef","value","isSized","isUndefined","estimatedOptionHeight","listProps","itemSize","itemHeight","estimatedSize","contains","valueKey","isObject","target","arr","item","isEqual","selected","get","isItemSelected","modelValue","isItemDisabled","multipleLimit","isItemHovering","scrollToItem","resetScrollTop","list","Item","itemProps","style","_createVNode","unref","_mergeProps","onSelect","onHover","sized","default","onKeyboardSelect","onForward","onBackward","onEscOrTab","onKeydown","code","up","enter","EVENT_CODE","e","tab"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,MAAMA,KAAK,GAAG;AACZC,EAAAA,OAAO,EAAEC,OADG;AAEZC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAEC,KADF;AAEJC,IAAAA,QAAQ,EAAE,IAAA;GAJA;AAMZC,EAAAA,aAAa,EAAEC,MANH;AAOZC,EAAAA,KAAK,EAAED,MAAAA;AAPK,CAAd,CAAA;AAsBA,mBAAeE,eAAe,CAAC;AAC7BC,EAAAA,IAAI,EAAE,kBADuB;EAE7BX,KAF6B;;IAGxB;IAAUY,MAAF;AAASC,GAAAA,EAAAA;AAAT,IAAmB,MAAA,MAAA,GAAA,MAAA,CAAA,oBAAA,CAAA,CAAA;AAC9B,IAAA,MAAMC,EAAM,GAAA;AACZ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AA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,MAAA,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,IAAAb,WAAA,CAAA,IAAA,EAAAE,UAAA,CAAA;AAAS,QAAA,KAAA,EAAA,OAAA;cACG,CAAA,SAAA,CAAA,EAAA;AACV,QAAA,WAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,MAAA,CAAA;AACD,QAAA,mBAAA,EAAA,iBAAA;;AACD,QAAA,QAAA,EAAA,MAAA;AAAY,QAAA,OAAA,EAAA,KAAA;eACM,EAAA,IAAA,CAAA,MAAA;AAChB,QAAA,WAAA,EAAA,SAAA;AACD,OAAA,CAAA,EAAA;AAjBH,QAAA,OAAA,EAAA,CAAA,MAAA,KAAAF,WAAA,CAAA,IAAA,EAAA,MAAA,EAAA,IAAA,CAAA;OARF,CAAA,EAAA,CAAA,EAAA,GAAA,KAAA,CAAA,MAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;;AA6BA,GAAA;;;;;"}
1
+ {"version":3,"file":"select-dropdown.mjs","sources":["../../../../../../packages/components/select-v2/src/select-dropdown.tsx"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n ref,\n toRaw,\n unref,\n watch,\n} from 'vue'\nimport { get } from 'lodash-unified'\nimport { isObject, isUndefined } from '@element-plus/utils'\nimport {\n DynamicSizeList,\n FixedSizeList,\n} from '@element-plus/components/virtual-list'\nimport { useNamespace } from '@element-plus/hooks'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport GroupItem from './group-item.vue'\nimport OptionItem from './option-item.vue'\nimport { useProps } from './useProps'\n\nimport { selectV2InjectionKey } from './token'\n\nimport type {\n DynamicSizeListInstance,\n FixedSizeListInstance,\n ItemProps,\n} from '@element-plus/components/virtual-list'\nimport type { Option, OptionItemProps } from './select.types'\nimport type {\n ComponentPublicInstance,\n ComputedRef,\n ExtractPropTypes,\n Ref,\n} from 'vue'\n\nconst props = {\n loading: Boolean,\n data: {\n type: Array,\n required: true as const,\n },\n hoveringIndex: Number,\n width: Number,\n}\ninterface SelectDropdownExposed {\n listRef: Ref<FixedSizeListInstance | DynamicSizeListInstance | undefined>\n isSized: ComputedRef<boolean>\n isItemDisabled: (modelValue: any[] | any, selected: boolean) => boolean\n isItemHovering: (target: number) => boolean\n isItemSelected: (modelValue: any[] | any, target: Option) => boolean\n scrollToItem: (index: number) => void\n resetScrollTop: () => void\n}\nexport type SelectDropdownInstance = ComponentPublicInstance<\n ExtractPropTypes<typeof props>,\n SelectDropdownExposed\n>\nexport default defineComponent({\n name: 'ElSelectDropdown',\n props,\n setup(props, { slots, expose }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { getLabel, getValue, getDisabled } = useProps(select.props)\n\n const cachedHeights = ref<Array<number>>([])\n\n const listRef = ref<FixedSizeListInstance | DynamicSizeListInstance>()\n\n const size = computed(() => props.data.length)\n watch(\n () => size.value,\n () => {\n select.tooltipRef.value!.updatePopper?.()\n }\n )\n\n const isSized = computed(() =>\n isUndefined(select.props.estimatedOptionHeight)\n )\n const listProps = computed(() => {\n if (isSized.value) {\n return {\n itemSize: select.props.itemHeight,\n }\n }\n\n return {\n estimatedSize: select.props.estimatedOptionHeight,\n itemSize: (idx: number) => cachedHeights.value[idx],\n }\n })\n\n const contains = (arr: Array<any> = [], target: any) => {\n const {\n props: { valueKey },\n } = select\n\n if (!isObject(target)) {\n return arr.includes(target)\n }\n\n return (\n arr &&\n arr.some((item) => {\n return toRaw(get(item, valueKey)) === get(target, valueKey)\n })\n )\n }\n const isEqual = (selected: unknown, target: unknown) => {\n if (!isObject(target)) {\n return selected === target\n } else {\n const { valueKey } = select.props\n return get(selected, valueKey) === get(target, valueKey)\n }\n }\n\n const isItemSelected: SelectDropdownExposed['isItemSelected'] = (\n modelValue,\n target\n ) => {\n if (select.props.multiple) {\n return contains(modelValue, getValue(target))\n }\n return isEqual(modelValue, getValue(target))\n }\n\n const isItemDisabled: SelectDropdownExposed['isItemDisabled'] = (\n modelValue,\n selected\n ) => {\n const { disabled, multiple, multipleLimit } = select.props\n return (\n disabled ||\n (!selected &&\n (multiple\n ? multipleLimit > 0 && modelValue.length >= multipleLimit\n : false))\n )\n }\n\n const isItemHovering: SelectDropdownExposed['isItemHovering'] = (target) =>\n props.hoveringIndex === target\n\n const scrollToItem: SelectDropdownExposed['scrollToItem'] = (index) => {\n const list = listRef.value\n if (list) {\n list.scrollToItem(index)\n }\n }\n\n const resetScrollTop: SelectDropdownExposed['resetScrollTop'] = () => {\n const list = listRef.value\n if (list) {\n list.resetScrollTop()\n }\n }\n const exposed: SelectDropdownExposed = {\n listRef,\n isSized,\n\n isItemDisabled,\n isItemHovering,\n isItemSelected,\n scrollToItem,\n resetScrollTop,\n }\n expose(exposed)\n\n const Item = (itemProps: ItemProps<any>) => {\n const { index, data, style } = itemProps\n const sized = unref(isSized)\n const { itemSize, estimatedSize } = unref(listProps)\n const { modelValue } = select.props\n const { onSelect, onHover } = select\n const item = data[index]\n if (item.type === 'Group') {\n return (\n <GroupItem\n item={item}\n style={style}\n height={sized ? (itemSize as number) : estimatedSize}\n />\n )\n }\n\n const isSelected = isItemSelected(modelValue, item)\n const isDisabled = isItemDisabled(modelValue, isSelected)\n const isHovering = isItemHovering(index)\n return (\n <OptionItem\n {...itemProps}\n selected={isSelected}\n disabled={getDisabled(item) || isDisabled}\n created={!!item.created}\n hovering={isHovering}\n item={item}\n onSelect={onSelect}\n onHover={onHover}\n >\n {{\n default: (props: OptionItemProps) =>\n slots.default?.(props) || <span>{getLabel(item)}</span>,\n }}\n </OptionItem>\n )\n }\n\n // computed\n const { onKeyboardNavigate, onKeyboardSelect } = select\n\n const onForward = () => {\n onKeyboardNavigate('forward')\n }\n\n const onBackward = () => {\n onKeyboardNavigate('backward')\n }\n\n const onEscOrTab = () => {\n // The following line actually doesn't work. Fixing it may introduce a small breaking change for some users, so just comment it out for now.\n // select.expanded = false\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n const { code } = e\n const { tab, esc, down, up, enter, numpadEnter } = EVENT_CODE\n if (code !== tab) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n switch (code) {\n case tab:\n case esc:\n onEscOrTab()\n break\n case down:\n onForward()\n break\n case up:\n onBackward()\n break\n case enter:\n case numpadEnter:\n onKeyboardSelect()\n break\n }\n }\n\n return () => {\n const { data, width } = props\n const { height, multiple, scrollbarAlwaysOn } = select.props\n\n const List = unref(isSized) ? FixedSizeList : DynamicSizeList\n\n return (\n <div\n class={[ns.b('dropdown'), ns.is('multiple', multiple)]}\n style={{\n width: `${width}px`,\n }}\n >\n {slots.header?.()}\n {slots.loading?.() || slots.empty?.() || (\n <List\n ref={listRef}\n {...unref(listProps)}\n className={ns.be('dropdown', 'list')}\n scrollbarAlwaysOn={scrollbarAlwaysOn}\n data={data}\n height={height}\n width={width}\n total={data.length}\n // @ts-ignore - dts problem\n onKeydown={onKeydown}\n >\n {{\n default: (props: ItemProps<any>) => <Item {...props} />,\n }}\n </List>\n )}\n {slots.footer?.()}\n </div>\n )\n }\n },\n})\n"],"names":["props","loading","Boolean","data","type","Array","required","hoveringIndex","Number","width","defineComponent","name","slots","expose","select","ns","getLabel","getValue","getDisabled","cachedHeights","ref","listRef","size","computed","watch","tooltipRef","value","isSized","isUndefined","estimatedOptionHeight","listProps","itemSize","itemHeight","estimatedSize","contains","valueKey","isObject","target","arr","item","isEqual","selected","get","isItemSelected","modelValue","isItemDisabled","multipleLimit","isItemHovering","scrollToItem","resetScrollTop","list","Item","itemProps","style","_createVNode","unref","_mergeProps","onSelect","onHover","sized","default","onKeyboardSelect","onForward","onBackward","onEscOrTab","onKeydown","code","esc","down","numpadEnter","tab","e"],"mappings":";;;;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AA;eACW,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,UAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,QAAA,CAAA,CAAA;AACT,QAAA,OAAA,EAAA;;AACF,SAAA;UACEL,CAAU,EAAA,GAAA,KAAA,CAAA,MAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,MAAA,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,IAAAT,WAAA,CAAA,IAAA,EAAAE,UAAA,CAAA;AACV,QAAA,KAAA,EAAA,OAAA;;AACF,QAAA,WAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,MAAA,CAAA;AACA,QAAA,mBAAA,EAAA,iBAAA;cACkB,EAAA,IAAA;AAChB,QAAA,QAAA,EAAA,MAAA;AAdJ,QAAA,OAAA,EAAA,KAAA;QARF,OAAA,EAAA,IAAA,CAAA,MAAA;;AA0BA,OAAA,CAAA,EAAA;QACQ,OAAA,EAAA,CAAA,MAAA,KAAAF,WAAA,CAAA,IAAA,EAAA,MAAA,EAAA,IAAA,CAAA;QAAEnD,EAAF,CAAA,EAAA,GAAA,KAAA,CAAA,MAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AAAQM,KAAAA,CAAAA;AAAR,GAAA;;;;;"}
@@ -594,7 +594,8 @@ const useSelect = (props, emit) => {
594
594
  });
595
595
  watch(() => props.modelValue, (val, oldVal) => {
596
596
  var _a;
597
- if (!val || props.multiple && val.toString() !== states.previousValue || !props.multiple && getValueKey(val) !== getValueKey(states.previousValue)) {
597
+ const isValEmpty = !val || isArray(val) && val.length === 0;
598
+ if (isValEmpty || props.multiple && !isEqual(val.toString(), states.previousValue) || !props.multiple && getValueKey(val) !== getValueKey(states.previousValue)) {
598
599
  initStates(true);
599
600
  }
600
601
  if (!isEqual(val, oldVal) && props.validateEvent) {