@element-plus/nightly 0.0.20241113 → 0.0.20241115

Sign up to get free protection for your applications and to get access to all the features.
Files changed (440) hide show
  1. package/dist/index.full.js +131 -130
  2. package/dist/index.full.min.js +11 -11
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +11 -11
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +131 -130
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/my.js +1 -1
  152. package/dist/locale/my.min.js +1 -1
  153. package/dist/locale/my.min.mjs +1 -1
  154. package/dist/locale/my.mjs +1 -1
  155. package/dist/locale/nb-no.js +1 -1
  156. package/dist/locale/nb-no.min.js +1 -1
  157. package/dist/locale/nb-no.min.mjs +1 -1
  158. package/dist/locale/nb-no.mjs +1 -1
  159. package/dist/locale/nl.js +1 -1
  160. package/dist/locale/nl.min.js +1 -1
  161. package/dist/locale/nl.min.mjs +1 -1
  162. package/dist/locale/nl.mjs +1 -1
  163. package/dist/locale/pa.js +1 -1
  164. package/dist/locale/pa.min.js +1 -1
  165. package/dist/locale/pa.min.mjs +1 -1
  166. package/dist/locale/pa.mjs +1 -1
  167. package/dist/locale/pl.js +1 -1
  168. package/dist/locale/pl.min.js +1 -1
  169. package/dist/locale/pl.min.mjs +1 -1
  170. package/dist/locale/pl.mjs +1 -1
  171. package/dist/locale/pt-br.js +1 -1
  172. package/dist/locale/pt-br.min.js +1 -1
  173. package/dist/locale/pt-br.min.mjs +1 -1
  174. package/dist/locale/pt-br.mjs +1 -1
  175. package/dist/locale/pt.js +1 -1
  176. package/dist/locale/pt.min.js +1 -1
  177. package/dist/locale/pt.min.mjs +1 -1
  178. package/dist/locale/pt.mjs +1 -1
  179. package/dist/locale/ro.js +1 -1
  180. package/dist/locale/ro.min.js +1 -1
  181. package/dist/locale/ro.min.mjs +1 -1
  182. package/dist/locale/ro.mjs +1 -1
  183. package/dist/locale/ru.js +1 -1
  184. package/dist/locale/ru.min.js +1 -1
  185. package/dist/locale/ru.min.mjs +1 -1
  186. package/dist/locale/ru.mjs +1 -1
  187. package/dist/locale/sk.js +1 -1
  188. package/dist/locale/sk.min.js +1 -1
  189. package/dist/locale/sk.min.mjs +1 -1
  190. package/dist/locale/sk.mjs +1 -1
  191. package/dist/locale/sl.js +1 -1
  192. package/dist/locale/sl.min.js +1 -1
  193. package/dist/locale/sl.min.mjs +1 -1
  194. package/dist/locale/sl.mjs +1 -1
  195. package/dist/locale/sr.js +1 -1
  196. package/dist/locale/sr.min.js +1 -1
  197. package/dist/locale/sr.min.mjs +1 -1
  198. package/dist/locale/sr.mjs +1 -1
  199. package/dist/locale/sv.js +1 -1
  200. package/dist/locale/sv.min.js +1 -1
  201. package/dist/locale/sv.min.mjs +1 -1
  202. package/dist/locale/sv.mjs +1 -1
  203. package/dist/locale/sw.js +1 -1
  204. package/dist/locale/sw.min.js +1 -1
  205. package/dist/locale/sw.min.mjs +1 -1
  206. package/dist/locale/sw.mjs +1 -1
  207. package/dist/locale/ta.js +1 -1
  208. package/dist/locale/ta.min.js +1 -1
  209. package/dist/locale/ta.min.mjs +1 -1
  210. package/dist/locale/ta.mjs +1 -1
  211. package/dist/locale/th.js +1 -1
  212. package/dist/locale/th.min.js +1 -1
  213. package/dist/locale/th.min.mjs +1 -1
  214. package/dist/locale/th.mjs +1 -1
  215. package/dist/locale/tk.js +1 -1
  216. package/dist/locale/tk.min.js +1 -1
  217. package/dist/locale/tk.min.mjs +1 -1
  218. package/dist/locale/tk.mjs +1 -1
  219. package/dist/locale/tr.js +1 -1
  220. package/dist/locale/tr.min.js +1 -1
  221. package/dist/locale/tr.min.mjs +1 -1
  222. package/dist/locale/tr.mjs +1 -1
  223. package/dist/locale/ug-cn.js +1 -1
  224. package/dist/locale/ug-cn.min.js +1 -1
  225. package/dist/locale/ug-cn.min.mjs +1 -1
  226. package/dist/locale/ug-cn.mjs +1 -1
  227. package/dist/locale/uk.js +1 -1
  228. package/dist/locale/uk.min.js +1 -1
  229. package/dist/locale/uk.min.mjs +1 -1
  230. package/dist/locale/uk.mjs +1 -1
  231. package/dist/locale/uz-uz.js +1 -1
  232. package/dist/locale/uz-uz.min.js +1 -1
  233. package/dist/locale/uz-uz.min.mjs +1 -1
  234. package/dist/locale/uz-uz.mjs +1 -1
  235. package/dist/locale/vi.js +1 -1
  236. package/dist/locale/vi.min.js +1 -1
  237. package/dist/locale/vi.min.mjs +1 -1
  238. package/dist/locale/vi.mjs +1 -1
  239. package/dist/locale/zh-cn.js +1 -1
  240. package/dist/locale/zh-cn.min.js +1 -1
  241. package/dist/locale/zh-cn.min.mjs +1 -1
  242. package/dist/locale/zh-cn.mjs +1 -1
  243. package/dist/locale/zh-tw.js +1 -1
  244. package/dist/locale/zh-tw.min.js +1 -1
  245. package/dist/locale/zh-tw.min.mjs +1 -1
  246. package/dist/locale/zh-tw.mjs +1 -1
  247. package/es/components/carousel/index.mjs +2 -2
  248. package/es/components/carousel/src/carousel-item.mjs +8 -70
  249. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  250. package/es/components/carousel/src/carousel-item2.mjs +70 -8
  251. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  252. package/es/components/cascader/index.mjs +2 -2
  253. package/es/components/cascader/src/cascader.mjs +83 -627
  254. package/es/components/cascader/src/cascader.mjs.map +1 -1
  255. package/es/components/cascader/src/cascader2.mjs +629 -83
  256. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  257. package/es/components/cascader-panel/src/index.mjs +1 -0
  258. package/es/components/cascader-panel/src/index.mjs.map +1 -1
  259. package/es/components/collapse/index.mjs +2 -2
  260. package/es/components/collapse/src/collapse.mjs +18 -28
  261. package/es/components/collapse/src/collapse.mjs.map +1 -1
  262. package/es/components/collapse/src/collapse2.mjs +28 -18
  263. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  264. package/es/components/color-picker/src/color-picker2.mjs +1 -0
  265. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  266. package/es/components/countdown/index.mjs +2 -2
  267. package/es/components/countdown/src/countdown.mjs +79 -23
  268. package/es/components/countdown/src/countdown.mjs.map +1 -1
  269. package/es/components/countdown/src/countdown2.mjs +23 -79
  270. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  271. package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -3
  272. package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
  273. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  274. package/es/components/dropdown/src/dropdown2.mjs +7 -2
  275. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  276. package/es/components/dropdown/src/useDropdown.mjs +1 -1
  277. package/es/components/dropdown/src/useDropdown.mjs.map +1 -1
  278. package/es/components/focus-trap/src/focus-trap.mjs +2 -2
  279. package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
  280. package/es/components/index.mjs +7 -7
  281. package/es/components/mention/src/mention2.mjs +51 -45
  282. package/es/components/mention/src/mention2.mjs.map +1 -1
  283. package/es/components/menu/src/utils/menu-item.mjs +1 -0
  284. package/es/components/menu/src/utils/menu-item.mjs.map +1 -1
  285. package/es/components/menu/src/utils/submenu.mjs +1 -0
  286. package/es/components/menu/src/utils/submenu.mjs.map +1 -1
  287. package/es/components/pagination/src/components/prev.mjs +36 -18
  288. package/es/components/pagination/src/components/prev.mjs.map +1 -1
  289. package/es/components/pagination/src/components/prev2.mjs +18 -36
  290. package/es/components/pagination/src/components/prev2.mjs.map +1 -1
  291. package/es/components/pagination/src/pagination.mjs +1 -1
  292. package/es/components/roving-focus-group/index.mjs +3 -3
  293. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  294. package/es/components/roving-focus-group/src/roving-focus-group.mjs +29 -27
  295. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  296. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -29
  297. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  298. package/es/components/roving-focus-group/src/roving-focus-item.mjs +3 -3
  299. package/es/components/roving-focus-group/src/roving-focus-item.mjs.map +1 -1
  300. package/es/components/roving-focus-group/src/utils.mjs +1 -1
  301. package/es/components/roving-focus-group/src/utils.mjs.map +1 -1
  302. package/es/components/scrollbar/index.mjs +2 -2
  303. package/es/components/scrollbar/src/scrollbar.mjs +55 -171
  304. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  305. package/es/components/scrollbar/src/scrollbar2.mjs +171 -55
  306. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  307. package/es/components/segmented/index.mjs +2 -2
  308. package/es/components/segmented/src/segmented.mjs +34 -169
  309. package/es/components/segmented/src/segmented.mjs.map +1 -1
  310. package/es/components/segmented/src/segmented2.mjs +169 -34
  311. package/es/components/segmented/src/segmented2.mjs.map +1 -1
  312. package/es/components/select-v2/src/select-dropdown.mjs +7 -9
  313. package/es/components/select-v2/src/select-dropdown.mjs.map +1 -1
  314. package/es/components/select-v2/src/useSelect.mjs +2 -1
  315. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  316. package/es/components/slider/src/composables/use-slider-button.mjs +24 -15
  317. package/es/components/slider/src/composables/use-slider-button.mjs.map +1 -1
  318. package/es/components/steps/index.mjs +2 -2
  319. package/es/components/steps/src/item.mjs +191 -19
  320. package/es/components/steps/src/item.mjs.map +1 -1
  321. package/es/components/steps/src/item2.mjs +19 -191
  322. package/es/components/steps/src/item2.mjs.map +1 -1
  323. package/es/components/table/src/table/style-helper.d.ts +0 -10
  324. package/es/components/table/src/table/style-helper.mjs +0 -14
  325. package/es/components/table/src/table/style-helper.mjs.map +1 -1
  326. package/es/components/table/src/table.mjs +2 -5
  327. package/es/components/table/src/table.mjs.map +1 -1
  328. package/es/components/table/src/table.vue.d.ts +0 -10
  329. package/es/components/tabs/src/tab-nav.mjs +21 -25
  330. package/es/components/tabs/src/tab-nav.mjs.map +1 -1
  331. package/es/components/tabs/src/tabs.mjs +1 -1
  332. package/es/components/tabs/src/tabs.mjs.map +1 -1
  333. package/es/components/tooltip/src/trigger.mjs +1 -1
  334. package/es/components/tooltip/src/trigger.mjs.map +1 -1
  335. package/es/components/tree/src/model/useKeydown.mjs +1 -1
  336. package/es/components/tree/src/model/useKeydown.mjs.map +1 -1
  337. package/es/hooks/use-escape-keydown/index.mjs +2 -3
  338. package/es/hooks/use-escape-keydown/index.mjs.map +1 -1
  339. package/es/index.mjs +7 -7
  340. package/es/version.d.ts +1 -1
  341. package/es/version.mjs +1 -1
  342. package/es/version.mjs.map +1 -1
  343. package/lib/components/carousel/index.js +2 -2
  344. package/lib/components/carousel/src/carousel-item.js +8 -70
  345. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  346. package/lib/components/carousel/src/carousel-item2.js +70 -8
  347. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  348. package/lib/components/cascader/index.js +2 -2
  349. package/lib/components/cascader/src/cascader.js +84 -627
  350. package/lib/components/cascader/src/cascader.js.map +1 -1
  351. package/lib/components/cascader/src/cascader2.js +629 -84
  352. package/lib/components/cascader/src/cascader2.js.map +1 -1
  353. package/lib/components/cascader-panel/src/index.js +1 -0
  354. package/lib/components/cascader-panel/src/index.js.map +1 -1
  355. package/lib/components/collapse/index.js +2 -2
  356. package/lib/components/collapse/src/collapse.js +20 -28
  357. package/lib/components/collapse/src/collapse.js.map +1 -1
  358. package/lib/components/collapse/src/collapse2.js +28 -20
  359. package/lib/components/collapse/src/collapse2.js.map +1 -1
  360. package/lib/components/color-picker/src/color-picker2.js +1 -0
  361. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  362. package/lib/components/countdown/index.js +2 -2
  363. package/lib/components/countdown/src/countdown.js +79 -24
  364. package/lib/components/countdown/src/countdown.js.map +1 -1
  365. package/lib/components/countdown/src/countdown2.js +24 -79
  366. package/lib/components/countdown/src/countdown2.js.map +1 -1
  367. package/lib/components/dropdown/src/dropdown-item-impl.js +2 -3
  368. package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
  369. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  370. package/lib/components/dropdown/src/dropdown2.js +7 -2
  371. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  372. package/lib/components/dropdown/src/useDropdown.js +1 -1
  373. package/lib/components/dropdown/src/useDropdown.js.map +1 -1
  374. package/lib/components/focus-trap/src/focus-trap.js +2 -2
  375. package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
  376. package/lib/components/index.js +7 -7
  377. package/lib/components/mention/src/mention2.js +51 -45
  378. package/lib/components/mention/src/mention2.js.map +1 -1
  379. package/lib/components/menu/src/utils/menu-item.js +1 -0
  380. package/lib/components/menu/src/utils/menu-item.js.map +1 -1
  381. package/lib/components/menu/src/utils/submenu.js +1 -0
  382. package/lib/components/menu/src/utils/submenu.js.map +1 -1
  383. package/lib/components/pagination/src/components/prev.js +36 -19
  384. package/lib/components/pagination/src/components/prev.js.map +1 -1
  385. package/lib/components/pagination/src/components/prev2.js +19 -36
  386. package/lib/components/pagination/src/components/prev2.js.map +1 -1
  387. package/lib/components/pagination/src/pagination.js +1 -1
  388. package/lib/components/roving-focus-group/index.js +2 -2
  389. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  390. package/lib/components/roving-focus-group/src/roving-focus-group.js +33 -27
  391. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  392. package/lib/components/roving-focus-group/src/roving-focus-group2.js +27 -33
  393. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  394. package/lib/components/roving-focus-group/src/roving-focus-item.js +3 -3
  395. package/lib/components/roving-focus-group/src/roving-focus-item.js.map +1 -1
  396. package/lib/components/roving-focus-group/src/utils.js +1 -1
  397. package/lib/components/roving-focus-group/src/utils.js.map +1 -1
  398. package/lib/components/scrollbar/index.js +2 -2
  399. package/lib/components/scrollbar/src/scrollbar.js +56 -171
  400. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  401. package/lib/components/scrollbar/src/scrollbar2.js +171 -56
  402. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  403. package/lib/components/segmented/index.js +2 -2
  404. package/lib/components/segmented/src/segmented.js +34 -168
  405. package/lib/components/segmented/src/segmented.js.map +1 -1
  406. package/lib/components/segmented/src/segmented2.js +168 -34
  407. package/lib/components/segmented/src/segmented2.js.map +1 -1
  408. package/lib/components/select-v2/src/select-dropdown.js +7 -9
  409. package/lib/components/select-v2/src/select-dropdown.js.map +1 -1
  410. package/lib/components/select-v2/src/useSelect.js +2 -1
  411. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  412. package/lib/components/slider/src/composables/use-slider-button.js +24 -15
  413. package/lib/components/slider/src/composables/use-slider-button.js.map +1 -1
  414. package/lib/components/steps/index.js +2 -2
  415. package/lib/components/steps/src/item.js +191 -19
  416. package/lib/components/steps/src/item.js.map +1 -1
  417. package/lib/components/steps/src/item2.js +19 -191
  418. package/lib/components/steps/src/item2.js.map +1 -1
  419. package/lib/components/table/src/table/style-helper.d.ts +0 -10
  420. package/lib/components/table/src/table/style-helper.js +0 -14
  421. package/lib/components/table/src/table/style-helper.js.map +1 -1
  422. package/lib/components/table/src/table.js +2 -5
  423. package/lib/components/table/src/table.js.map +1 -1
  424. package/lib/components/table/src/table.vue.d.ts +0 -10
  425. package/lib/components/tabs/src/tab-nav.js +21 -25
  426. package/lib/components/tabs/src/tab-nav.js.map +1 -1
  427. package/lib/components/tabs/src/tabs.js +1 -1
  428. package/lib/components/tabs/src/tabs.js.map +1 -1
  429. package/lib/components/tooltip/src/trigger.js +1 -1
  430. package/lib/components/tooltip/src/trigger.js.map +1 -1
  431. package/lib/components/tree/src/model/useKeydown.js +1 -1
  432. package/lib/components/tree/src/model/useKeydown.js.map +1 -1
  433. package/lib/hooks/use-escape-keydown/index.js +2 -3
  434. package/lib/hooks/use-escape-keydown/index.js.map +1 -1
  435. package/lib/index.js +7 -7
  436. package/lib/version.d.ts +1 -1
  437. package/lib/version.js +1 -1
  438. package/lib/version.js.map +1 -1
  439. package/package.json +2 -2
  440. package/web-types.json +1 -1
@@ -141,31 +141,27 @@ const TabNav = defineComponent({
141
141
  }
142
142
  }
143
143
  };
144
- const changeTab = (e) => {
145
- const code = e.code;
146
- const {
147
- up,
148
- down,
149
- left,
150
- right
151
- } = EVENT_CODE;
152
- if (![up, down, left, right].includes(code))
153
- return;
154
- const tabList = Array.from(e.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
155
- const currentIndex = tabList.indexOf(e.target);
156
- let nextIndex;
157
- if (code === left || code === up) {
158
- if (currentIndex === 0) {
159
- nextIndex = tabList.length - 1;
160
- } else {
161
- nextIndex = currentIndex - 1;
162
- }
163
- } else {
164
- if (currentIndex < tabList.length - 1) {
165
- nextIndex = currentIndex + 1;
166
- } else {
167
- nextIndex = 0;
168
- }
144
+ const changeTab = (event) => {
145
+ let step = 0;
146
+ switch (event.code) {
147
+ case EVENT_CODE.left:
148
+ case EVENT_CODE.up:
149
+ step = -1;
150
+ break;
151
+ case EVENT_CODE.right:
152
+ case EVENT_CODE.down:
153
+ step = 1;
154
+ break;
155
+ default:
156
+ return;
157
+ }
158
+ const tabList = Array.from(event.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
159
+ const currentIndex = tabList.indexOf(event.target);
160
+ let nextIndex = currentIndex + step;
161
+ if (nextIndex < 0) {
162
+ nextIndex = tabList.length - 1;
163
+ } else if (nextIndex >= tabList.length) {
164
+ nextIndex = 0;
169
165
  }
170
166
  tabList[nextIndex].focus({
171
167
  preventScroll: true
@@ -1 +1 @@
1
- {"version":3,"file":"tab-nav.mjs","sources":["../../../../../../packages/components/tabs/src/tab-nav.tsx"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n nextTick,\n onMounted,\n onUpdated,\n ref,\n watch,\n} from 'vue'\nimport {\n useDocumentVisibility,\n useResizeObserver,\n useWindowFocus,\n} from '@vueuse/core'\nimport {\n buildProps,\n capitalize,\n definePropType,\n mutable,\n throwError,\n} from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport TabBar from './tab-bar.vue'\nimport { tabsRootContextKey } from './constants'\n\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\nimport type { TabsPaneContext } from './constants'\nimport type { TabPaneName } from './tabs'\n\ninterface Scrollable {\n next?: boolean\n prev?: number\n}\n\nexport const tabNavProps = buildProps({\n panes: {\n type: definePropType<TabsPaneContext[]>(Array),\n default: () => mutable([] as const),\n },\n currentName: {\n type: [String, Number],\n default: '',\n },\n editable: Boolean,\n type: {\n type: String,\n values: ['card', 'border-card', ''],\n default: '',\n },\n stretch: Boolean,\n} as const)\n\nexport const tabNavEmits = {\n tabClick: (tab: TabsPaneContext, tabName: TabPaneName, ev: Event) =>\n ev instanceof Event,\n tabRemove: (tab: TabsPaneContext, ev: Event) => ev instanceof Event,\n}\n\nexport type TabNavProps = ExtractPropTypes<typeof tabNavProps>\nexport type TabNavEmits = typeof tabNavEmits\n\nconst COMPONENT_NAME = 'ElTabNav'\nconst TabNav = defineComponent({\n name: COMPONENT_NAME,\n props: tabNavProps,\n emits: tabNavEmits,\n setup(props, { expose, emit }) {\n const rootTabs = inject(tabsRootContextKey)\n if (!rootTabs) throwError(COMPONENT_NAME, `<el-tabs><tab-nav /></el-tabs>`)\n\n const ns = useNamespace('tabs')\n const visibility = useDocumentVisibility()\n const focused = useWindowFocus()\n\n const navScroll$ = ref<HTMLDivElement>()\n const nav$ = ref<HTMLDivElement>()\n const el$ = ref<HTMLDivElement>()\n\n const tabBarRef = ref<InstanceType<typeof TabBar>>()\n\n const scrollable = ref<false | Scrollable>(false)\n const navOffset = ref(0)\n const isFocus = ref(false)\n const focusable = ref(true)\n\n const sizeName = computed(() =>\n ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ? 'width'\n : 'height'\n )\n const navStyle = computed<CSSProperties>(() => {\n const dir = sizeName.value === 'width' ? 'X' : 'Y'\n return {\n transform: `translate${dir}(-${navOffset.value}px)`,\n }\n })\n\n const scrollPrev = () => {\n if (!navScroll$.value) return\n\n const containerSize =\n navScroll$.value[`offset${capitalize(sizeName.value)}`]\n const currentOffset = navOffset.value\n\n if (!currentOffset) return\n\n const newOffset =\n currentOffset > containerSize ? currentOffset - containerSize : 0\n\n navOffset.value = newOffset\n }\n\n const scrollNext = () => {\n if (!navScroll$.value || !nav$.value) return\n\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\n const containerSize =\n navScroll$.value[`offset${capitalize(sizeName.value)}`]\n const currentOffset = navOffset.value\n\n if (navSize - currentOffset <= containerSize) return\n\n const newOffset =\n navSize - currentOffset > containerSize * 2\n ? currentOffset + containerSize\n : navSize - containerSize\n\n navOffset.value = newOffset\n }\n\n const scrollToActiveTab = async () => {\n const nav = nav$.value\n if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return\n\n await nextTick()\n\n const activeTab = el$.value.querySelector('.is-active')\n if (!activeTab) return\n\n const navScroll = navScroll$.value\n const isHorizontal = ['top', 'bottom'].includes(\n rootTabs.props.tabPosition\n )\n const activeTabBounding = activeTab.getBoundingClientRect()\n const navScrollBounding = navScroll.getBoundingClientRect()\n const maxOffset = isHorizontal\n ? nav.offsetWidth - navScrollBounding.width\n : nav.offsetHeight - navScrollBounding.height\n const currentOffset = navOffset.value\n let newOffset = currentOffset\n\n if (isHorizontal) {\n if (activeTabBounding.left < navScrollBounding.left) {\n newOffset =\n currentOffset - (navScrollBounding.left - activeTabBounding.left)\n }\n if (activeTabBounding.right > navScrollBounding.right) {\n newOffset =\n currentOffset + activeTabBounding.right - navScrollBounding.right\n }\n } else {\n if (activeTabBounding.top < navScrollBounding.top) {\n newOffset =\n currentOffset - (navScrollBounding.top - activeTabBounding.top)\n }\n if (activeTabBounding.bottom > navScrollBounding.bottom) {\n newOffset =\n currentOffset +\n (activeTabBounding.bottom - navScrollBounding.bottom)\n }\n }\n newOffset = Math.max(newOffset, 0)\n navOffset.value = Math.min(newOffset, maxOffset)\n }\n\n const update = () => {\n if (!nav$.value || !navScroll$.value) return\n\n props.stretch && tabBarRef.value?.update()\n\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\n const containerSize =\n navScroll$.value[`offset${capitalize(sizeName.value)}`]\n const currentOffset = navOffset.value\n\n if (containerSize < navSize) {\n scrollable.value = scrollable.value || {}\n scrollable.value.prev = currentOffset\n scrollable.value.next = currentOffset + containerSize < navSize\n if (navSize - currentOffset < containerSize) {\n navOffset.value = navSize - containerSize\n }\n } else {\n scrollable.value = false\n if (currentOffset > 0) {\n navOffset.value = 0\n }\n }\n }\n\n const changeTab = (e: KeyboardEvent) => {\n const code = e.code\n\n const { up, down, left, right } = EVENT_CODE\n if (![up, down, left, right].includes(code)) return\n\n // 左右上下键更换tab\n const tabList = Array.from(\n (e.currentTarget as HTMLDivElement).querySelectorAll<HTMLDivElement>(\n '[role=tab]:not(.is-disabled)'\n )\n )\n const currentIndex = tabList.indexOf(e.target as HTMLDivElement)\n\n let nextIndex: number\n if (code === left || code === up) {\n // left\n if (currentIndex === 0) {\n // first\n nextIndex = tabList.length - 1\n } else {\n nextIndex = currentIndex - 1\n }\n } else {\n // right\n if (currentIndex < tabList.length - 1) {\n // not last\n nextIndex = currentIndex + 1\n } else {\n nextIndex = 0\n }\n }\n tabList[nextIndex].focus({ preventScroll: true }) // 改变焦点元素\n tabList[nextIndex].click() // 选中下一个tab\n setFocus()\n }\n\n const setFocus = () => {\n if (focusable.value) isFocus.value = true\n }\n const removeFocus = () => (isFocus.value = false)\n\n watch(visibility, (visibility) => {\n if (visibility === 'hidden') {\n focusable.value = false\n } else if (visibility === 'visible') {\n setTimeout(() => (focusable.value = true), 50)\n }\n })\n watch(focused, (focused) => {\n if (focused) {\n setTimeout(() => (focusable.value = true), 50)\n } else {\n focusable.value = false\n }\n })\n\n useResizeObserver(el$, update)\n\n onMounted(() => setTimeout(() => scrollToActiveTab(), 0))\n onUpdated(() => update())\n\n expose({\n scrollToActiveTab,\n removeFocus,\n })\n\n return () => {\n const scrollBtn = scrollable.value\n ? [\n <span\n class={[\n ns.e('nav-prev'),\n ns.is('disabled', !scrollable.value.prev),\n ]}\n onClick={scrollPrev}\n >\n <ElIcon>\n <ArrowLeft />\n </ElIcon>\n </span>,\n <span\n class={[\n ns.e('nav-next'),\n ns.is('disabled', !scrollable.value.next),\n ]}\n onClick={scrollNext}\n >\n <ElIcon>\n <ArrowRight />\n </ElIcon>\n </span>,\n ]\n : null\n\n const tabs = props.panes.map((pane, index) => {\n const uid = pane.uid\n const disabled = pane.props.disabled\n const tabName = pane.props.name ?? pane.index ?? `${index}`\n const closable = !disabled && (pane.isClosable || props.editable)\n pane.index = `${index}`\n\n const btnClose = closable ? (\n <ElIcon\n class=\"is-icon-close\"\n // `onClick` not exist when generate dts\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n onClick={(ev: MouseEvent) => emit('tabRemove', pane, ev)}\n >\n <Close />\n </ElIcon>\n ) : null\n\n const tabLabelContent = pane.slots.label?.() || pane.props.label\n const tabindex = !disabled && pane.active ? 0 : -1\n\n return (\n <div\n ref={`tab-${uid}`}\n class={[\n ns.e('item'),\n ns.is(rootTabs.props.tabPosition),\n ns.is('active', pane.active),\n ns.is('disabled', disabled),\n ns.is('closable', closable),\n ns.is('focus', isFocus.value),\n ]}\n id={`tab-${tabName}`}\n key={`tab-${uid}`}\n aria-controls={`pane-${tabName}`}\n role=\"tab\"\n aria-selected={pane.active}\n tabindex={tabindex}\n onFocus={() => setFocus()}\n onBlur={() => removeFocus()}\n onClick={(ev: MouseEvent) => {\n removeFocus()\n emit('tabClick', pane, tabName, ev)\n }}\n onKeydown={(ev: KeyboardEvent) => {\n if (\n closable &&\n (ev.code === EVENT_CODE.delete ||\n ev.code === EVENT_CODE.backspace)\n ) {\n emit('tabRemove', pane, ev)\n }\n }}\n >\n {...[tabLabelContent, btnClose]}\n </div>\n )\n })\n\n return (\n <div\n ref={el$}\n class={[\n ns.e('nav-wrap'),\n ns.is('scrollable', !!scrollable.value),\n ns.is(rootTabs.props.tabPosition),\n ]}\n >\n {scrollBtn}\n <div class={ns.e('nav-scroll')} ref={navScroll$}>\n <div\n class={[\n ns.e('nav'),\n ns.is(rootTabs.props.tabPosition),\n ns.is(\n 'stretch',\n props.stretch &&\n ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ),\n ]}\n ref={nav$}\n style={navStyle.value}\n role=\"tablist\"\n onKeydown={changeTab}\n >\n {...[\n !props.type ? (\n <TabBar ref={tabBarRef} tabs={[...props.panes]} />\n ) : null,\n tabs,\n ]}\n </div>\n </div>\n </div>\n )\n }\n },\n})\n\nexport type TabNavInstance = InstanceType<typeof TabNav> & {\n scrollToActiveTab: () => Promise<void>\n removeFocus: () => void\n}\nexport default TabNav\n"],"names":["tabNavProps","buildProps","panes","type","definePropType","Array","default","mutable","currentName","String","Number","editable","Boolean","values","stretch","tabNavEmits","tabClick","tab","tabName","ev","Event","tabRemove","COMPONENT_NAME","TabNav","defineComponent","name","props","emits","expose","emit","ns","useNamespace","visibility","useDocumentVisibility","focused","useWindowFocus","navScroll$","ref","nav$","el$","tabBarRef","scrollable","navOffset","isFocus","focusable","sizeName","computed","includes","rootTabs","tabPosition","navStyle","dir","value","transform","scrollPrev","containerSize","capitalize","currentOffset","newOffset","scrollNext","scrollToActiveTab","activeTab","navScroll","navScrollBounding","maxOffset","isHorizontal","offsetWidth","activeTabBounding","right","top","bottom","max","update","navSize","prev","changeTab","code","left","down","tabList","currentIndex","nextIndex","preventScroll","click","setFocus","watch","_createVNode","setTimeout","useResizeObserver","onU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AAA;aACD,EAAA,GAAA;AAlBZ,QAAA,OAAA,EAAA,CAAA,EAAA,CAmBcnE,EAAD,UAAoB,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,YAAA,EAAA,CAAA,CAAA,UAAA,CAAA,KAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,QAAA,CAAA,KAAA,CAAA,WAAA,CAAA,CAAA;mBAChB,EAAAmE,WAAA,CAAA,KAAA,EAAA;eACP,EAAC,kBAAkBpE;aArB7B,EAAA,UAAA;AAAA,OAAA,EAAA,CAAAoE,WAAA,CAuBgBnE,KAAsB,EAAA;AAChC,QAAA,OAAA,aAEGA,CAAAA,EAAE,EAAF,CAAA,EAAA,CAAA,cAAsB,CAAC8E,WACtB9E,CAAE,EAAF,EAAA,CAAA,EAAA,CAAA,gBAAuB+E,CAAAA,OACzB,IAAA,CAAA,KAAA,EAAA,QAAA,CAAA,CAAA,QAAA,CAAA,QAAA,CAAA,KAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACArE,QAAAA,KAAAA,EAAAA,IAAK;AACN,QAAA,OAAA,EAAA,QAAA,CAAA,KAAA;AACF,QAAA,MAAA,EAAA,SAAA;AA/BL,QAAA,WAiCSsE,EAAAA,SAAAA;AAGV,OA1DY,EAAb,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,IAAA,GAAAb,WAAA,CAAA,MAAA,EAAA;AA4DA,QAAA,KAAA,EAAA,SAAA;AAAA,QAAA,MAAA,EAAA,CAAA,GAAA,KAAA,CAAA,KAAA,CAAA;AAAA,OAAA,EAAA,IAAA,CAAA,GAGW,IACFK,EAAE,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAL,CADK,CAAA;AAHX,KAAA,CAAA;AAAA,GAAA;;;;;"}
1
+ {"version":3,"file":"tab-nav.mjs","sources":["../../../../../../packages/components/tabs/src/tab-nav.tsx"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n nextTick,\n onMounted,\n onUpdated,\n ref,\n watch,\n} from 'vue'\nimport {\n useDocumentVisibility,\n useResizeObserver,\n useWindowFocus,\n} from '@vueuse/core'\nimport {\n buildProps,\n capitalize,\n definePropType,\n mutable,\n throwError,\n} from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport TabBar from './tab-bar.vue'\nimport { tabsRootContextKey } from './constants'\n\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\nimport type { TabsPaneContext } from './constants'\nimport type { TabPaneName } from './tabs'\n\ninterface Scrollable {\n next?: boolean\n prev?: number\n}\n\nexport const tabNavProps = buildProps({\n panes: {\n type: definePropType<TabsPaneContext[]>(Array),\n default: () => mutable([] as const),\n },\n currentName: {\n type: [String, Number],\n default: '',\n },\n editable: Boolean,\n type: {\n type: String,\n values: ['card', 'border-card', ''],\n default: '',\n },\n stretch: Boolean,\n} as const)\n\nexport const tabNavEmits = {\n tabClick: (tab: TabsPaneContext, tabName: TabPaneName, ev: Event) =>\n ev instanceof Event,\n tabRemove: (tab: TabsPaneContext, ev: Event) => ev instanceof Event,\n}\n\nexport type TabNavProps = ExtractPropTypes<typeof tabNavProps>\nexport type TabNavEmits = typeof tabNavEmits\n\nconst COMPONENT_NAME = 'ElTabNav'\nconst TabNav = defineComponent({\n name: COMPONENT_NAME,\n props: tabNavProps,\n emits: tabNavEmits,\n setup(props, { expose, emit }) {\n const rootTabs = inject(tabsRootContextKey)\n if (!rootTabs) throwError(COMPONENT_NAME, `<el-tabs><tab-nav /></el-tabs>`)\n\n const ns = useNamespace('tabs')\n const visibility = useDocumentVisibility()\n const focused = useWindowFocus()\n\n const navScroll$ = ref<HTMLDivElement>()\n const nav$ = ref<HTMLDivElement>()\n const el$ = ref<HTMLDivElement>()\n\n const tabBarRef = ref<InstanceType<typeof TabBar>>()\n\n const scrollable = ref<false | Scrollable>(false)\n const navOffset = ref(0)\n const isFocus = ref(false)\n const focusable = ref(true)\n\n const sizeName = computed(() =>\n ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ? 'width'\n : 'height'\n )\n const navStyle = computed<CSSProperties>(() => {\n const dir = sizeName.value === 'width' ? 'X' : 'Y'\n return {\n transform: `translate${dir}(-${navOffset.value}px)`,\n }\n })\n\n const scrollPrev = () => {\n if (!navScroll$.value) return\n\n const containerSize =\n navScroll$.value[`offset${capitalize(sizeName.value)}`]\n const currentOffset = navOffset.value\n\n if (!currentOffset) return\n\n const newOffset =\n currentOffset > containerSize ? currentOffset - containerSize : 0\n\n navOffset.value = newOffset\n }\n\n const scrollNext = () => {\n if (!navScroll$.value || !nav$.value) return\n\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\n const containerSize =\n navScroll$.value[`offset${capitalize(sizeName.value)}`]\n const currentOffset = navOffset.value\n\n if (navSize - currentOffset <= containerSize) return\n\n const newOffset =\n navSize - currentOffset > containerSize * 2\n ? currentOffset + containerSize\n : navSize - containerSize\n\n navOffset.value = newOffset\n }\n\n const scrollToActiveTab = async () => {\n const nav = nav$.value\n if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return\n\n await nextTick()\n\n const activeTab = el$.value.querySelector('.is-active')\n if (!activeTab) return\n\n const navScroll = navScroll$.value\n const isHorizontal = ['top', 'bottom'].includes(\n rootTabs.props.tabPosition\n )\n const activeTabBounding = activeTab.getBoundingClientRect()\n const navScrollBounding = navScroll.getBoundingClientRect()\n const maxOffset = isHorizontal\n ? nav.offsetWidth - navScrollBounding.width\n : nav.offsetHeight - navScrollBounding.height\n const currentOffset = navOffset.value\n let newOffset = currentOffset\n\n if (isHorizontal) {\n if (activeTabBounding.left < navScrollBounding.left) {\n newOffset =\n currentOffset - (navScrollBounding.left - activeTabBounding.left)\n }\n if (activeTabBounding.right > navScrollBounding.right) {\n newOffset =\n currentOffset + activeTabBounding.right - navScrollBounding.right\n }\n } else {\n if (activeTabBounding.top < navScrollBounding.top) {\n newOffset =\n currentOffset - (navScrollBounding.top - activeTabBounding.top)\n }\n if (activeTabBounding.bottom > navScrollBounding.bottom) {\n newOffset =\n currentOffset +\n (activeTabBounding.bottom - navScrollBounding.bottom)\n }\n }\n newOffset = Math.max(newOffset, 0)\n navOffset.value = Math.min(newOffset, maxOffset)\n }\n\n const update = () => {\n if (!nav$.value || !navScroll$.value) return\n\n props.stretch && tabBarRef.value?.update()\n\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\n const containerSize =\n navScroll$.value[`offset${capitalize(sizeName.value)}`]\n const currentOffset = navOffset.value\n\n if (containerSize < navSize) {\n scrollable.value = scrollable.value || {}\n scrollable.value.prev = currentOffset\n scrollable.value.next = currentOffset + containerSize < navSize\n if (navSize - currentOffset < containerSize) {\n navOffset.value = navSize - containerSize\n }\n } else {\n scrollable.value = false\n if (currentOffset > 0) {\n navOffset.value = 0\n }\n }\n }\n\n const changeTab = (event: KeyboardEvent) => {\n let step = 0\n\n switch (event.code) {\n case EVENT_CODE.left:\n case EVENT_CODE.up:\n step = -1\n break\n case EVENT_CODE.right:\n case EVENT_CODE.down:\n step = 1\n break\n default:\n return\n }\n\n const tabList = Array.from(\n (\n event.currentTarget as HTMLDivElement\n ).querySelectorAll<HTMLDivElement>('[role=tab]:not(.is-disabled)')\n )\n const currentIndex = tabList.indexOf(event.target as HTMLDivElement)\n let nextIndex = currentIndex + step\n\n if (nextIndex < 0) {\n nextIndex = tabList.length - 1\n } else if (nextIndex >= tabList.length) {\n nextIndex = 0\n }\n\n tabList[nextIndex].focus({ preventScroll: true }) // 改变焦点元素\n tabList[nextIndex].click() // 选中下一个tab\n setFocus()\n }\n\n const setFocus = () => {\n if (focusable.value) isFocus.value = true\n }\n const removeFocus = () => (isFocus.value = false)\n\n watch(visibility, (visibility) => {\n if (visibility === 'hidden') {\n focusable.value = false\n } else if (visibility === 'visible') {\n setTimeout(() => (focusable.value = true), 50)\n }\n })\n watch(focused, (focused) => {\n if (focused) {\n setTimeout(() => (focusable.value = true), 50)\n } else {\n focusable.value = false\n }\n })\n\n useResizeObserver(el$, update)\n\n onMounted(() => setTimeout(() => scrollToActiveTab(), 0))\n onUpdated(() => update())\n\n expose({\n scrollToActiveTab,\n removeFocus,\n })\n\n return () => {\n const scrollBtn = scrollable.value\n ? [\n <span\n class={[\n ns.e('nav-prev'),\n ns.is('disabled', !scrollable.value.prev),\n ]}\n onClick={scrollPrev}\n >\n <ElIcon>\n <ArrowLeft />\n </ElIcon>\n </span>,\n <span\n class={[\n ns.e('nav-next'),\n ns.is('disabled', !scrollable.value.next),\n ]}\n onClick={scrollNext}\n >\n <ElIcon>\n <ArrowRight />\n </ElIcon>\n </span>,\n ]\n : null\n\n const tabs = props.panes.map((pane, index) => {\n const uid = pane.uid\n const disabled = pane.props.disabled\n const tabName = pane.props.name ?? pane.index ?? `${index}`\n const closable = !disabled && (pane.isClosable || props.editable)\n pane.index = `${index}`\n\n const btnClose = closable ? (\n <ElIcon\n class=\"is-icon-close\"\n // `onClick` not exist when generate dts\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n onClick={(ev: MouseEvent) => emit('tabRemove', pane, ev)}\n >\n <Close />\n </ElIcon>\n ) : null\n\n const tabLabelContent = pane.slots.label?.() || pane.props.label\n const tabindex = !disabled && pane.active ? 0 : -1\n\n return (\n <div\n ref={`tab-${uid}`}\n class={[\n ns.e('item'),\n ns.is(rootTabs.props.tabPosition),\n ns.is('active', pane.active),\n ns.is('disabled', disabled),\n ns.is('closable', closable),\n ns.is('focus', isFocus.value),\n ]}\n id={`tab-${tabName}`}\n key={`tab-${uid}`}\n aria-controls={`pane-${tabName}`}\n role=\"tab\"\n aria-selected={pane.active}\n tabindex={tabindex}\n onFocus={() => setFocus()}\n onBlur={() => removeFocus()}\n onClick={(ev: MouseEvent) => {\n removeFocus()\n emit('tabClick', pane, tabName, ev)\n }}\n onKeydown={(ev: KeyboardEvent) => {\n if (\n closable &&\n (ev.code === EVENT_CODE.delete ||\n ev.code === EVENT_CODE.backspace)\n ) {\n emit('tabRemove', pane, ev)\n }\n }}\n >\n {...[tabLabelContent, btnClose]}\n </div>\n )\n })\n\n return (\n <div\n ref={el$}\n class={[\n ns.e('nav-wrap'),\n ns.is('scrollable', !!scrollable.value),\n ns.is(rootTabs.props.tabPosition),\n ]}\n >\n {scrollBtn}\n <div class={ns.e('nav-scroll')} ref={navScroll$}>\n <div\n class={[\n ns.e('nav'),\n ns.is(rootTabs.props.tabPosition),\n ns.is(\n 'stretch',\n props.stretch &&\n ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ),\n ]}\n ref={nav$}\n style={navStyle.value}\n role=\"tablist\"\n onKeydown={changeTab}\n >\n {...[\n !props.type ? (\n <TabBar ref={tabBarRef} tabs={[...props.panes]} />\n ) : null,\n tabs,\n ]}\n </div>\n </div>\n </div>\n )\n }\n },\n})\n\nexport type TabNavInstance = InstanceType<typeof TabNav> & {\n scrollToActiveTab: () => Promise<void>\n removeFocus: () => void\n}\nexport default TabNav\n"],"names":["tabNavProps","buildProps","panes","type","definePropType","Array","default","mutable","currentName","String","Number","editable","Boolean","values","stretch","tabNavEmits","tabClick","tab","tabName","ev","Event","tabRemove","COMPONENT_NAME","TabNav","defineComponent","name","props","emits","expose","emit","ns","useNamespace","visibility","useDocumentVisibility","focused","useWindowFocus","navScroll$","ref","nav$","el$","tabBarRef","scrollable","navOffset","isFocus","focusable","sizeName","computed","includes","rootTabs","tabPosition","navStyle","dir","value","transform","scrollPrev","containerSize","capitalize","currentOffset","newOffset","scrollNext","scrollToActiveTab","activeTab","navScroll","navScrollBounding","maxOffset","isHorizontal","offsetWidth","activeTabBounding","right","top","bottom","max","update","navSize","prev","changeTab","event","step","EVENT_CODE","left","currentIndex","tabList","nextIndex","preventScroll","click","setFocus","watch","_createVNode","setTimeout","useResizeObserver","onUpdated","removeFocus","e","pane","index","closable","disabled","btnClose","delete","backspace","tabLabelContent"],"mappings":";;;;;;;;;;;;;;;;AAsCaA,MA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AA,CAAA,KAAA,EAAA;eACP,EAAC,kBAAkBrE;aArB7B,EAAA,UAAA;AAAA,OAAA,EAAA,CAAAqE,WAAA,CAuBgBpE,KAAsB,EAAA;AAChC,QAAA,OAAA,aAEGA,CAAAA,EAAE,EAAF,CAAA,EAAA,CAAA,cAAsB,CAAC+E,WACtB/E,CAAE,EAAF,EAAA,CAAA,EAAA,CAAA,gBAAuBgF,CAAAA,OACzB,IAAA,CAAA,KAAA,EAAA,QAAA,CAAA,CAAA,QAAA,CAAA,QAAA,CAAA,KAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACAtE,QAAAA,KAAAA,EAAAA,IAAK;AACN,QAAA,OAAA,EAAA,QAAA,CAAA,KAAA;AACF,QAAA,MAAA,EAAA,SAAA;AA/BL,QAAA,WAiCSuE,EAAAA,SAAAA;AAGV,OA1DY,EAAb,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,IAAA,GAAAb,WAAA,CAAA,MAAA,EAAA;AA4DA,QAAA,KAAA,EAAA,SAAA;AAAA,QAAA,MAAA,EAAA,CAAA,GAAA,KAAA,CAAA,KAAA,CAAA;AAAA,OAAA,EAAA,IAAA,CAAA,GAGW,IACFK,EAAE,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAL,CADK,CAAA;AAHX,KAAA,CAAA;AAAA,GAAA;;;;;"}
@@ -129,7 +129,7 @@ const Tabs = defineComponent({
129
129
  "tabindex": "0",
130
130
  "onClick": handleTabAdd,
131
131
  "onKeydown": (ev) => {
132
- if (ev.code === EVENT_CODE.enter)
132
+ if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(ev.code))
133
133
  handleTabAdd();
134
134
  }
135
135
  }, [addSlot ? renderSlot(slots, "add-icon") : createVNode(ElIcon, {
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.mjs","sources":["../../../../../../packages/components/tabs/src/tabs.tsx"],"sourcesContent":["import {\n computed,\n createVNode,\n defineComponent,\n getCurrentInstance,\n nextTick,\n provide,\n ref,\n renderSlot,\n watch,\n} from 'vue'\nimport {\n buildProps,\n definePropType,\n isNumber,\n isString,\n isUndefined,\n} from '@element-plus/utils'\nimport { EVENT_CODE, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElIcon from '@element-plus/components/icon'\nimport { Plus } from '@element-plus/icons-vue'\nimport { useNamespace, useOrderedChildren } from '@element-plus/hooks'\nimport { tabsRootContextKey } from './constants'\nimport TabNav from './tab-nav'\n\nimport type { TabNavInstance } from './tab-nav'\nimport type { TabsPaneContext } from './constants'\nimport type { ExtractPropTypes, FunctionalComponent, VNode } from 'vue'\nimport type { Awaitable } from '@element-plus/utils'\n\nexport type TabPaneName = string | number\n\nexport const tabsProps = buildProps({\n /**\n * @description type of Tab\n */\n type: {\n type: String,\n values: ['card', 'border-card', ''],\n default: '',\n },\n /**\n * @description whether Tab is closable\n */\n closable: Boolean,\n /**\n * @description whether Tab is addable\n */\n addable: Boolean,\n /**\n * @description binding value, name of the selected tab\n */\n modelValue: {\n type: [String, Number],\n },\n /**\n * @description whether Tab is addable and closable\n */\n editable: Boolean,\n /**\n * @description position of tabs\n */\n tabPosition: {\n type: String,\n values: ['top', 'right', 'bottom', 'left'],\n default: 'top',\n },\n /**\n * @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented\n */\n beforeLeave: {\n type: definePropType<\n (newName: TabPaneName, oldName: TabPaneName) => Awaitable<void | boolean>\n >(Function),\n default: () => true,\n },\n /**\n * @description whether width of tab automatically fits its container\n */\n stretch: Boolean,\n} as const)\nexport type TabsProps = ExtractPropTypes<typeof tabsProps>\n\nconst isPaneName = (value: unknown): value is string | number =>\n isString(value) || isNumber(value)\n\nexport const tabsEmits = {\n [UPDATE_MODEL_EVENT]: (name: TabPaneName) => isPaneName(name),\n tabClick: (pane: TabsPaneContext, ev: Event) => ev instanceof Event,\n tabChange: (name: TabPaneName) => isPaneName(name),\n edit: (paneName: TabPaneName | undefined, action: 'remove' | 'add') =>\n ['remove', 'add'].includes(action),\n tabRemove: (name: TabPaneName) => isPaneName(name),\n tabAdd: () => true,\n}\nexport type TabsEmits = typeof tabsEmits\n\nexport type TabsPanes = Record<number, TabsPaneContext>\n\nconst Tabs = defineComponent({\n name: 'ElTabs',\n\n props: tabsProps,\n emits: tabsEmits,\n\n setup(props, { emit, slots, expose }) {\n const ns = useNamespace('tabs')\n\n const isVertical = computed(() =>\n ['left', 'right'].includes(props.tabPosition)\n )\n\n const {\n children: panes,\n addChild: sortPane,\n removeChild: unregisterPane,\n } = useOrderedChildren<TabsPaneContext>(getCurrentInstance()!, 'ElTabPane')\n\n const nav$ = ref<TabNavInstance>()\n const currentName = ref<TabPaneName>(props.modelValue ?? '0')\n\n const setCurrentName = async (value?: TabPaneName, trigger = false) => {\n // should do nothing.\n if (currentName.value === value || isUndefined(value)) return\n\n try {\n const canLeave = await props.beforeLeave?.(value, currentName.value)\n if (canLeave !== false) {\n currentName.value = value\n if (trigger) {\n emit(UPDATE_MODEL_EVENT, value)\n emit('tabChange', value)\n }\n\n nav$.value?.removeFocus?.()\n }\n } catch {}\n }\n\n const handleTabClick = (\n tab: TabsPaneContext,\n tabName: TabPaneName,\n event: Event\n ) => {\n if (tab.props.disabled) return\n setCurrentName(tabName, true)\n emit('tabClick', tab, event)\n }\n\n const handleTabRemove = (pane: TabsPaneContext, ev: Event) => {\n if (pane.props.disabled || isUndefined(pane.props.name)) return\n ev.stopPropagation()\n emit('edit', pane.props.name, 'remove')\n emit('tabRemove', pane.props.name)\n }\n\n const handleTabAdd = () => {\n emit('edit', undefined, 'add')\n emit('tabAdd')\n }\n\n watch(\n () => props.modelValue,\n (modelValue) => setCurrentName(modelValue)\n )\n\n watch(currentName, async () => {\n await nextTick()\n nav$.value?.scrollToActiveTab()\n })\n\n provide(tabsRootContextKey, {\n props,\n currentName,\n registerPane: (pane: TabsPaneContext) => {\n panes.value.push(pane)\n },\n sortPane,\n unregisterPane,\n })\n\n expose({\n currentName,\n })\n const TabNavRenderer: FunctionalComponent<{ render: () => VNode }> = ({\n render,\n }) => {\n return render()\n }\n return () => {\n const addSlot = slots['add-icon']\n const newButton =\n props.editable || props.addable ? (\n <div\n class={[\n ns.e('new-tab'),\n isVertical.value && ns.e('new-tab-vertical'),\n ]}\n tabindex=\"0\"\n onClick={handleTabAdd}\n onKeydown={(ev: KeyboardEvent) => {\n if (ev.code === EVENT_CODE.enter) handleTabAdd()\n }}\n >\n {addSlot ? (\n renderSlot(slots, 'add-icon')\n ) : (\n <ElIcon class={ns.is('icon-plus')}>\n <Plus />\n </ElIcon>\n )}\n </div>\n ) : null\n\n const header = (\n <div\n class={[\n ns.e('header'),\n isVertical.value && ns.e('header-vertical'),\n ns.is(props.tabPosition),\n ]}\n >\n <TabNavRenderer\n render={() => {\n const hasLabelSlot = panes.value.some((pane) => pane.slots.label)\n return createVNode(\n TabNav,\n {\n ref: nav$,\n currentName: currentName.value,\n editable: props.editable,\n type: props.type,\n panes: panes.value,\n stretch: props.stretch,\n onTabClick: handleTabClick,\n onTabRemove: handleTabRemove,\n },\n { $stable: !hasLabelSlot }\n )\n }}\n />\n {newButton}\n </div>\n )\n\n const panels = (\n <div class={ns.e('content')}>{renderSlot(slots, 'default')}</div>\n )\n\n return (\n <div\n class={[\n ns.b(),\n ns.m(props.tabPosition),\n {\n [ns.m('card')]: props.type === 'card',\n [ns.m('border-card')]: props.type === 'border-card',\n },\n ]}\n >\n {panels}\n {header}\n </div>\n )\n }\n },\n})\n\nexport type TabsInstance = InstanceType<typeof Tabs> & {\n currentName: TabPaneName\n}\n\nexport default Tabs\n"],"names":["tabsProps","buildProps","type","values","default","closable","addable","modelValue","editable","tabPosition","beforeLeave","definePropType","stretch","Boolean","isPaneName","name","ev","tabChange","edit","tabRemove","tabAdd","Tabs","defineComponent","props","emits","expose","ns","useNamespace","children","addChild","removeChild","getCurrentInstance","nav$","ref","currentName","setCurrentName","value","canLeave","trigger","emit","handleTabClick","pane","handleTabAdd","_createVNode","undefined","watch","scrollToActiveTab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AA,KAAA,CAAA,CAAA;UAKO,yBAAqB,EAAA;YAAA,GAAA,EAAA,IAAA;YAAA,WAAA,EAAA,WAAA,CAAA,KAAA;YAGd,QAAGL,OAA0B,CAAA,QAAA;AACvCM,YAAAA,IAAMX,EAAAA,KAAMY,CAAZ,IAAA;YAJwB,KAAA,EAAA,KAAA,CAAA,KAAA;YAAA,OAAA,EAAA,KAAA,CAAA,OAAA;AAO1BC,YAAAA,UAAAA,EAAAA,cAAAA;AAP0B,YAA5B,WAAA,EAAA,eAAA;AAUAxB,WAAO,EAAA;AACLS,YAAAA,OAAAA,EAAAA,CAAAA,YAAAA;AADK,WAAP,CAAA,CAAA;;OAGMgB,EAAAA,IAAAA,CAAAA,EAAAA,WAA+D,CAAC;AACpEC,MAAAA,MAAAA,MAAAA,GAAAA,WAAAA,CAAAA,KAAAA,EAAAA;AADoE,QAEhE,OAAA,EAAA,EAAA,CAAA,CAAA,CAAA,SAAA,CAAA;AACJ,OAAA,EAAA,CAAA,UAAA,CAAA,KAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA;MAHF,OAAAR,WAAA,CAAA,KAAA,EAAA;;AAKA,UAAA,CAAO,EAAM,CAAA,CAAA,CAAA,MAAA,CAAA,GAAA,KAAA,CAAA,IAAA,KAAA,MAAA;AACX,UAAA,CAAA,EAAa,CAAA,CAAA,CAAA,sBAAQ,CAArB,IAAA,KAAA,aAAA;SACMS,CAAAA;AACJ,OAAA,EAAA,CAAA,MAAA,EAGM1B,MAAK,CAAA,CAAA,CAAA;AAHX,KAAA,CAAA;AAAA,GAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"tabs.mjs","sources":["../../../../../../packages/components/tabs/src/tabs.tsx"],"sourcesContent":["import {\n computed,\n createVNode,\n defineComponent,\n getCurrentInstance,\n nextTick,\n provide,\n ref,\n renderSlot,\n watch,\n} from 'vue'\nimport {\n buildProps,\n definePropType,\n isNumber,\n isString,\n isUndefined,\n} from '@element-plus/utils'\nimport { EVENT_CODE, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElIcon from '@element-plus/components/icon'\nimport { Plus } from '@element-plus/icons-vue'\nimport { useNamespace, useOrderedChildren } from '@element-plus/hooks'\nimport { tabsRootContextKey } from './constants'\nimport TabNav from './tab-nav'\n\nimport type { TabNavInstance } from './tab-nav'\nimport type { TabsPaneContext } from './constants'\nimport type { ExtractPropTypes, FunctionalComponent, VNode } from 'vue'\nimport type { Awaitable } from '@element-plus/utils'\n\nexport type TabPaneName = string | number\n\nexport const tabsProps = buildProps({\n /**\n * @description type of Tab\n */\n type: {\n type: String,\n values: ['card', 'border-card', ''],\n default: '',\n },\n /**\n * @description whether Tab is closable\n */\n closable: Boolean,\n /**\n * @description whether Tab is addable\n */\n addable: Boolean,\n /**\n * @description binding value, name of the selected tab\n */\n modelValue: {\n type: [String, Number],\n },\n /**\n * @description whether Tab is addable and closable\n */\n editable: Boolean,\n /**\n * @description position of tabs\n */\n tabPosition: {\n type: String,\n values: ['top', 'right', 'bottom', 'left'],\n default: 'top',\n },\n /**\n * @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented\n */\n beforeLeave: {\n type: definePropType<\n (newName: TabPaneName, oldName: TabPaneName) => Awaitable<void | boolean>\n >(Function),\n default: () => true,\n },\n /**\n * @description whether width of tab automatically fits its container\n */\n stretch: Boolean,\n} as const)\nexport type TabsProps = ExtractPropTypes<typeof tabsProps>\n\nconst isPaneName = (value: unknown): value is string | number =>\n isString(value) || isNumber(value)\n\nexport const tabsEmits = {\n [UPDATE_MODEL_EVENT]: (name: TabPaneName) => isPaneName(name),\n tabClick: (pane: TabsPaneContext, ev: Event) => ev instanceof Event,\n tabChange: (name: TabPaneName) => isPaneName(name),\n edit: (paneName: TabPaneName | undefined, action: 'remove' | 'add') =>\n ['remove', 'add'].includes(action),\n tabRemove: (name: TabPaneName) => isPaneName(name),\n tabAdd: () => true,\n}\nexport type TabsEmits = typeof tabsEmits\n\nexport type TabsPanes = Record<number, TabsPaneContext>\n\nconst Tabs = defineComponent({\n name: 'ElTabs',\n\n props: tabsProps,\n emits: tabsEmits,\n\n setup(props, { emit, slots, expose }) {\n const ns = useNamespace('tabs')\n\n const isVertical = computed(() =>\n ['left', 'right'].includes(props.tabPosition)\n )\n\n const {\n children: panes,\n addChild: sortPane,\n removeChild: unregisterPane,\n } = useOrderedChildren<TabsPaneContext>(getCurrentInstance()!, 'ElTabPane')\n\n const nav$ = ref<TabNavInstance>()\n const currentName = ref<TabPaneName>(props.modelValue ?? '0')\n\n const setCurrentName = async (value?: TabPaneName, trigger = false) => {\n // should do nothing.\n if (currentName.value === value || isUndefined(value)) return\n\n try {\n const canLeave = await props.beforeLeave?.(value, currentName.value)\n if (canLeave !== false) {\n currentName.value = value\n if (trigger) {\n emit(UPDATE_MODEL_EVENT, value)\n emit('tabChange', value)\n }\n\n nav$.value?.removeFocus?.()\n }\n } catch {}\n }\n\n const handleTabClick = (\n tab: TabsPaneContext,\n tabName: TabPaneName,\n event: Event\n ) => {\n if (tab.props.disabled) return\n setCurrentName(tabName, true)\n emit('tabClick', tab, event)\n }\n\n const handleTabRemove = (pane: TabsPaneContext, ev: Event) => {\n if (pane.props.disabled || isUndefined(pane.props.name)) return\n ev.stopPropagation()\n emit('edit', pane.props.name, 'remove')\n emit('tabRemove', pane.props.name)\n }\n\n const handleTabAdd = () => {\n emit('edit', undefined, 'add')\n emit('tabAdd')\n }\n\n watch(\n () => props.modelValue,\n (modelValue) => setCurrentName(modelValue)\n )\n\n watch(currentName, async () => {\n await nextTick()\n nav$.value?.scrollToActiveTab()\n })\n\n provide(tabsRootContextKey, {\n props,\n currentName,\n registerPane: (pane: TabsPaneContext) => {\n panes.value.push(pane)\n },\n sortPane,\n unregisterPane,\n })\n\n expose({\n currentName,\n })\n const TabNavRenderer: FunctionalComponent<{ render: () => VNode }> = ({\n render,\n }) => {\n return render()\n }\n return () => {\n const addSlot = slots['add-icon']\n const newButton =\n props.editable || props.addable ? (\n <div\n class={[\n ns.e('new-tab'),\n isVertical.value && ns.e('new-tab-vertical'),\n ]}\n tabindex=\"0\"\n onClick={handleTabAdd}\n onKeydown={(ev: KeyboardEvent) => {\n if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(ev.code))\n handleTabAdd()\n }}\n >\n {addSlot ? (\n renderSlot(slots, 'add-icon')\n ) : (\n <ElIcon class={ns.is('icon-plus')}>\n <Plus />\n </ElIcon>\n )}\n </div>\n ) : null\n\n const header = (\n <div\n class={[\n ns.e('header'),\n isVertical.value && ns.e('header-vertical'),\n ns.is(props.tabPosition),\n ]}\n >\n <TabNavRenderer\n render={() => {\n const hasLabelSlot = panes.value.some((pane) => pane.slots.label)\n return createVNode(\n TabNav,\n {\n ref: nav$,\n currentName: currentName.value,\n editable: props.editable,\n type: props.type,\n panes: panes.value,\n stretch: props.stretch,\n onTabClick: handleTabClick,\n onTabRemove: handleTabRemove,\n },\n { $stable: !hasLabelSlot }\n )\n }}\n />\n {newButton}\n </div>\n )\n\n const panels = (\n <div class={ns.e('content')}>{renderSlot(slots, 'default')}</div>\n )\n\n return (\n <div\n class={[\n ns.b(),\n ns.m(props.tabPosition),\n {\n [ns.m('card')]: props.type === 'card',\n [ns.m('border-card')]: props.type === 'border-card',\n },\n ]}\n >\n {panels}\n {header}\n </div>\n )\n }\n },\n})\n\nexport type TabsInstance = InstanceType<typeof Tabs> & {\n currentName: TabPaneName\n}\n\nexport default Tabs\n"],"names":["tabsProps","buildProps","type","values","default","closable","addable","modelValue","editable","tabPosition","beforeLeave","definePropType","stretch","Boolean","isPaneName","name","ev","tabChange","edit","tabRemove","tabAdd","Tabs","defineComponent","props","emits","expose","ns","useNamespace","children","addChild","removeChild","getCurrentInstance","nav$","ref","currentName","setCurrentName","value","canLeave","trigger","emit","handleTabClick","pane","handleTabAdd","_createVNode","undefined","watch","scrollToActiveTab","panes","push","unregisterPane","TabNavRenderer","render","newButton"],"mappings":";;;;;;;;;;;;;;;;AAgCaA,MAAAA,SAAS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KAAA,CAAA,CAAA;UAKO,yBAAqB,EAAA;YAAA,GAAA,EAAA,IAAA;YAAA,WAAA,EAAA,WAAA,CAAA,KAAA;YAGd,QAAGL,OAA0B,CAAA,QAAA;AACvCM,YAAAA,IAAMX,EAAAA,KAAMY,CAAZ,IAAA;YAJwB,KAAA,EAAA,KAAA,CAAA,KAAA;YAAA,OAAA,EAAA,KAAA,CAAA,OAAA;AAO1BC,YAAAA,UAAAA,EAAAA,cAAAA;AAP0B,YAA5B,WAAA,EAAA,eAAA;AAUAxB,WAAO,EAAA;AACLS,YAAAA,OAAAA,EAAAA,CAAAA,YAAAA;AADK,WAAP,CAAA,CAAA;;OAGMgB,EAAAA,IAAAA,CAAAA,EAAAA,WAA+D,CAAC;AACpEC,MAAAA,MAAAA,MAAAA,GAAAA,WAAAA,CAAAA,KAAAA,EAAAA;AADoE,QAEhE,OAAA,EAAA,EAAA,CAAA,CAAA,CAAA,SAAA,CAAA;AACJ,OAAA,EAAA,CAAA,UAAA,CAAA,KAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA;MAHF,OAAAR,WAAA,CAAA,KAAA,EAAA;;AAKA,UAAA,CAAO,EAAM,CAAA,CAAA,CAAA,MAAA,CAAA,GAAA,KAAA,CAAA,IAAA,KAAA,MAAA;AACX,UAAA,CAAA,EAAa,CAAA,CAAA,CAAA,sBAAQ,CAArB,IAAA,KAAA,aAAA;SACMS,CAAAA;AACJ,OAAA,EAAA,CAAA,MAAA,EAGM1B,MAAK,CAAA,CAAA,CAAA;AAHX,KAAA,CAAA;AAAA,GAAA;AAAA,CAAA;;;;"}
@@ -14,7 +14,7 @@ const useTooltipTriggerProps = buildProps({
14
14
  },
15
15
  triggerKeys: {
16
16
  type: definePropType(Array),
17
- default: () => [EVENT_CODE.enter, EVENT_CODE.space]
17
+ default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space]
18
18
  }
19
19
  });
20
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"trigger.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { popperTriggerProps } from '@element-plus/components/popper'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport type TooltipTriggerType = 'hover' | 'focus' | 'click' | 'contextmenu'\n\nexport const useTooltipTriggerProps = buildProps({\n ...popperTriggerProps,\n /**\n * @description whether Tooltip is disabled\n */\n disabled: Boolean,\n /**\n * @description How should the tooltip be triggered (to show)\n */\n trigger: {\n type: definePropType<Arrayable<TooltipTriggerType>>([String, Array]),\n default: 'hover',\n },\n /**\n * @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard\n */\n triggerKeys: {\n type: definePropType<string[]>(Array),\n default: () => [EVENT_CODE.enter, EVENT_CODE.space],\n },\n} as const)\n\nexport type ElTooltipTriggerProps = ExtractPropTypes<\n typeof useTooltipTriggerProps\n>\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,sBAAsB,GAAG,UAAU,CAAC;AACjD,EAAE,GAAG,kBAAkB;AACvB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;AACvD,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"trigger.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { popperTriggerProps } from '@element-plus/components/popper'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport type TooltipTriggerType = 'hover' | 'focus' | 'click' | 'contextmenu'\n\nexport const useTooltipTriggerProps = buildProps({\n ...popperTriggerProps,\n /**\n * @description whether Tooltip is disabled\n */\n disabled: Boolean,\n /**\n * @description How should the tooltip be triggered (to show)\n */\n trigger: {\n type: definePropType<Arrayable<TooltipTriggerType>>([String, Array]),\n default: 'hover',\n },\n /**\n * @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard\n */\n triggerKeys: {\n type: definePropType<string[]>(Array),\n default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space],\n },\n} as const)\n\nexport type ElTooltipTriggerProps = ExtractPropTypes<\n typeof useTooltipTriggerProps\n>\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,sBAAsB,GAAG,UAAU,CAAC;AACjD,EAAE,GAAG,kBAAkB;AACvB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,CAAC;AAC/E,GAAG;AACH,CAAC;;;;"}
@@ -69,7 +69,7 @@ function useKeydown({ el$ }, store) {
69
69
  currentItem.click();
70
70
  }
71
71
  const hasInput = currentItem.querySelector('[type="checkbox"]');
72
- if ([EVENT_CODE.enter, EVENT_CODE.space].includes(code) && hasInput) {
72
+ if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space].includes(code) && hasInput) {
73
73
  ev.preventDefault();
74
74
  hasInput.click();
75
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useKeydown.mjs","sources":["../../../../../../../packages/components/tree/src/model/useKeydown.ts"],"sourcesContent":["// @ts-nocheck\nimport { onMounted, onUpdated, shallowRef, watch } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport type TreeStore from './tree-store'\n\nimport type { Ref } from 'vue'\nimport type { Nullable } from '@element-plus/utils'\n\ninterface UseKeydownOption {\n el$: Ref<HTMLElement>\n}\nexport function useKeydown({ el$ }: UseKeydownOption, store: Ref<TreeStore>) {\n const ns = useNamespace('tree')\n\n const treeItems = shallowRef<Nullable<HTMLElement>[]>([])\n const checkboxItems = shallowRef<Nullable<HTMLElement>[]>([])\n\n onMounted(() => {\n initTabIndex()\n })\n\n onUpdated(() => {\n treeItems.value = Array.from(el$.value.querySelectorAll('[role=treeitem]'))\n checkboxItems.value = Array.from(\n el$.value.querySelectorAll('input[type=checkbox]')\n )\n })\n\n watch(checkboxItems, (val) => {\n val.forEach((checkbox) => {\n checkbox.setAttribute('tabindex', '-1')\n })\n })\n\n const handleKeydown = (ev: KeyboardEvent): void => {\n const currentItem = ev.target as HTMLElement\n if (!currentItem.className.includes(ns.b('node'))) return\n const code = ev.code\n treeItems.value = Array.from(\n el$.value.querySelectorAll(`.${ns.is('focusable')}[role=treeitem]`)\n )\n const currentIndex = treeItems.value.indexOf(currentItem)\n let nextIndex\n if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {\n ev.preventDefault()\n if (code === EVENT_CODE.up) {\n nextIndex =\n currentIndex === -1\n ? 0\n : currentIndex !== 0\n ? currentIndex - 1\n : treeItems.value.length - 1\n const startIndex = nextIndex\n while (true) {\n if (\n store.value.getNode(treeItems.value[nextIndex].dataset.key).canFocus\n )\n break\n nextIndex--\n if (nextIndex === startIndex) {\n nextIndex = -1\n break\n }\n if (nextIndex < 0) {\n nextIndex = treeItems.value.length - 1\n }\n }\n } else {\n nextIndex =\n currentIndex === -1\n ? 0\n : currentIndex < treeItems.value.length - 1\n ? currentIndex + 1\n : 0\n const startIndex = nextIndex\n while (true) {\n if (\n store.value.getNode(treeItems.value[nextIndex].dataset.key).canFocus\n )\n break\n nextIndex++\n if (nextIndex === startIndex) {\n nextIndex = -1\n break\n }\n if (nextIndex >= treeItems.value.length) {\n nextIndex = 0\n }\n }\n }\n nextIndex !== -1 && treeItems.value[nextIndex].focus()\n }\n if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {\n ev.preventDefault()\n currentItem.click()\n }\n const hasInput = currentItem.querySelector(\n '[type=\"checkbox\"]'\n ) as Nullable<HTMLInputElement>\n if ([EVENT_CODE.enter, EVENT_CODE.space].includes(code) && hasInput) {\n ev.preventDefault()\n hasInput.click()\n }\n }\n\n useEventListener(el$, 'keydown', handleKeydown)\n\n const initTabIndex = (): void => {\n treeItems.value = Array.from(\n el$.value.querySelectorAll(`.${ns.is('focusable')}[role=treeitem]`)\n )\n checkboxItems.value = Array.from(\n el$.value.querySelectorAll('input[type=checkbox]')\n )\n const checkedItem = el$.value.querySelectorAll(\n `.${ns.is('checked')}[role=treeitem]`\n )\n if (checkedItem.length) {\n checkedItem[0].setAttribute('tabindex', '0')\n return\n }\n treeItems.value[0]?.setAttribute('tabindex', '0')\n }\n}\n"],"names":[],"mappings":";;;;;;;AAIO,SAAS,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE;AAC3C,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAClC,EAAE,MAAM,SAAS,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AACnC,EAAE,MAAM,aAAa,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AACvC,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,YAAY,EAAE,CAAC;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI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AAsB,CAAC,CAAC,CAAC;AACzF,IAAI,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;AAC1F,IAAI,IAAI,WAAW,CAAC,MAAM,EAAE;AAC5B,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AACnD,MAAM,OAAO;AACb,KAAK;AACL,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AAClF,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"useKeydown.mjs","sources":["../../../../../../../packages/components/tree/src/model/useKeydown.ts"],"sourcesContent":["// @ts-nocheck\nimport { onMounted, onUpdated, shallowRef, watch } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport type TreeStore from './tree-store'\n\nimport type { Ref } from 'vue'\nimport type { Nullable } from '@element-plus/utils'\n\ninterface UseKeydownOption {\n el$: Ref<HTMLElement>\n}\nexport function useKeydown({ el$ }: UseKeydownOption, store: Ref<TreeStore>) {\n const ns = useNamespace('tree')\n\n const treeItems = shallowRef<Nullable<HTMLElement>[]>([])\n const checkboxItems = shallowRef<Nullable<HTMLElement>[]>([])\n\n onMounted(() => {\n initTabIndex()\n })\n\n onUpdated(() => {\n treeItems.value = Array.from(el$.value.querySelectorAll('[role=treeitem]'))\n checkboxItems.value = Array.from(\n el$.value.querySelectorAll('input[type=checkbox]')\n )\n })\n\n watch(checkboxItems, (val) => {\n val.forEach((checkbox) => {\n checkbox.setAttribute('tabindex', '-1')\n })\n })\n\n const handleKeydown = (ev: KeyboardEvent): void => {\n const currentItem = ev.target as HTMLElement\n if (!currentItem.className.includes(ns.b('node'))) return\n const code = ev.code\n treeItems.value = Array.from(\n el$.value.querySelectorAll(`.${ns.is('focusable')}[role=treeitem]`)\n )\n const currentIndex = treeItems.value.indexOf(currentItem)\n let nextIndex\n if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {\n ev.preventDefault()\n if (code === EVENT_CODE.up) {\n nextIndex =\n currentIndex === -1\n ? 0\n : currentIndex !== 0\n ? currentIndex - 1\n : treeItems.value.length - 1\n const startIndex = nextIndex\n while (true) {\n if (\n store.value.getNode(treeItems.value[nextIndex].dataset.key).canFocus\n )\n break\n nextIndex--\n if (nextIndex === startIndex) {\n nextIndex = -1\n break\n }\n if (nextIndex < 0) {\n nextIndex = treeItems.value.length - 1\n }\n }\n } else {\n nextIndex =\n currentIndex === -1\n ? 0\n : currentIndex < treeItems.value.length - 1\n ? currentIndex + 1\n : 0\n const startIndex = nextIndex\n while (true) {\n if (\n store.value.getNode(treeItems.value[nextIndex].dataset.key).canFocus\n )\n break\n nextIndex++\n if (nextIndex === startIndex) {\n nextIndex = -1\n break\n }\n if (nextIndex >= treeItems.value.length) {\n nextIndex = 0\n }\n }\n }\n nextIndex !== -1 && treeItems.value[nextIndex].focus()\n }\n if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {\n ev.preventDefault()\n currentItem.click()\n }\n const hasInput = currentItem.querySelector(\n '[type=\"checkbox\"]'\n ) as Nullable<HTMLInputElement>\n if (\n [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space].includes(\n code\n ) &&\n hasInput\n ) {\n ev.preventDefault()\n hasInput.click()\n }\n }\n\n useEventListener(el$, 'keydown', handleKeydown)\n\n const initTabIndex = (): void => {\n treeItems.value = Array.from(\n el$.value.querySelectorAll(`.${ns.is('focusable')}[role=treeitem]`)\n )\n checkboxItems.value = Array.from(\n el$.value.querySelectorAll('input[type=checkbox]')\n )\n const checkedItem = el$.value.querySelectorAll(\n `.${ns.is('checked')}[role=treeitem]`\n )\n if (checkedItem.length) {\n checkedItem[0].setAttribute('tabindex', '0')\n return\n }\n treeItems.value[0]?.setAttribute('tabindex', '0')\n }\n}\n"],"names":[],"mappings":";;;;;;;AAIO,SAAS,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE;AAC3C,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAClC,EAAE,MAAM,SAAS,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AACnC,EAAE,MAAM,aAAa,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AACvC,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,YAAY,EAAE,CAAC;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAChF,IAAI,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC;AACzF,GAAG,CAAC,CAAC;AACL,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,GAAG,KAAK;AAChC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK;AAC9B,MAAM,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC9C,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK;AAChC,IAAI,MAAM,WAAW,GAAG,EAAE,CAAC,MAAM,CAAC;AAClC,IAAI,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,OAAO;AACb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;AACjG,MAAM,EAAE,CAAC,cAAc,EAAE,CAAC;AAC1B,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AAClD,EAAE,MAAM,YAAY,GAAG,MAAM;AAC7B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AACtG,IAAI,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC;AACzF,IAAI,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;AAC1F,IAAI,IAAI,WAAW,CAAC,MAAM,EAAE;AAC5B,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AACnD,MAAM,OAAO;AACb,KAAK;AACL,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AAClF,GAAG,CAAC;AACJ;;;;"}
@@ -5,9 +5,8 @@ import { EVENT_CODE } from '../../constants/aria.mjs';
5
5
  import { isClient } from '@vueuse/core';
6
6
 
7
7
  let registeredEscapeHandlers = [];
8
- const cachedHandler = (e) => {
9
- const event = e;
10
- if (event.key === EVENT_CODE.esc) {
8
+ const cachedHandler = (event) => {
9
+ if (event.code === EVENT_CODE.esc) {
11
10
  registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event));
12
11
  }
13
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-escape-keydown/index.ts"],"sourcesContent":["import { onBeforeUnmount, onMounted } from 'vue'\nimport { isClient } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nlet registeredEscapeHandlers: ((e: KeyboardEvent) => void)[] = []\n\nconst cachedHandler = (e: Event) => {\n const event = e as KeyboardEvent\n if (event.key === EVENT_CODE.esc) {\n registeredEscapeHandlers.forEach((registeredHandler) =>\n registeredHandler(event)\n )\n }\n}\n\nexport const useEscapeKeydown = (handler: (e: KeyboardEvent) => void) => {\n onMounted(() => {\n if (registeredEscapeHandlers.length === 0) {\n document.addEventListener('keydown', cachedHandler)\n }\n if (isClient) registeredEscapeHandlers.push(handler)\n })\n\n onBeforeUnmount(() => {\n registeredEscapeHandlers = registeredEscapeHandlers.filter(\n (registeredHandler) => registeredHandler !== handler\n )\n if (registeredEscapeHandlers.length === 0) {\n if (isClient) document.removeEventListener('keydown', cachedHandler)\n }\n })\n}\n"],"names":[],"mappings":";;;;;;AAGA,IAAI,wBAAwB,GAAG,EAAE,CAAC;AAClC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK;AAC7B,EAAE,MAAM,KAAK,GAAG,CAAC,CAAC;AAClB,EAAE,IAAI,KAAK,CAAC,GAAG,KAAK,UAAU,CAAC,GAAG,EAAE;AACpC,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC,iBAAiB,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,GAAG;AACH,CAAC,CAAC;AACU,MAAC,gBAAgB,GAAG,CAAC,OAAO,KAAK;AAC7C,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,IAAI,wBAAwB,CAAC,MAAM,KAAK,CAAC,EAAE;AAC/C,MAAM,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC1D,KAAK;AACL,IAAI,IAAI,QAAQ;AAChB,MAAM,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7C,GAAG,CAAC,CAAC;AACL,EAAE,eAAe,CAAC,MAAM;AACxB,IAAI,wBAAwB,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,iBAAiB,KAAK,iBAAiB,KAAK,OAAO,CAAC,CAAC;AACrH,IAAI,IAAI,wBAAwB,CAAC,MAAM,KAAK,CAAC,EAAE;AAC/C,MAAM,IAAI,QAAQ;AAClB,QAAQ,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC/D,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-escape-keydown/index.ts"],"sourcesContent":["import { onBeforeUnmount, onMounted } from 'vue'\nimport { isClient } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nlet registeredEscapeHandlers: ((e: KeyboardEvent) => void)[] = []\n\nconst cachedHandler = (event: KeyboardEvent) => {\n if (event.code === EVENT_CODE.esc) {\n registeredEscapeHandlers.forEach((registeredHandler) =>\n registeredHandler(event)\n )\n }\n}\n\nexport const useEscapeKeydown = (handler: (e: KeyboardEvent) => void) => {\n onMounted(() => {\n if (registeredEscapeHandlers.length === 0) {\n document.addEventListener('keydown', cachedHandler)\n }\n if (isClient) registeredEscapeHandlers.push(handler)\n })\n\n onBeforeUnmount(() => {\n registeredEscapeHandlers = registeredEscapeHandlers.filter(\n (registeredHandler) => registeredHandler !== handler\n )\n if (registeredEscapeHandlers.length === 0) {\n if (isClient) document.removeEventListener('keydown', cachedHandler)\n }\n })\n}\n"],"names":[],"mappings":";;;;;;AAGA,IAAI,wBAAwB,GAAG,EAAE,CAAC;AAClC,MAAM,aAAa,GAAG,CAAC,KAAK,KAAK;AACjC,EAAE,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,GAAG,EAAE;AACrC,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC,iBAAiB,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,GAAG;AACH,CAAC,CAAC;AACU,MAAC,gBAAgB,GAAG,CAAC,OAAO,KAAK;AAC7C,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,IAAI,wBAAwB,CAAC,MAAM,KAAK,CAAC,EAAE;AAC/C,MAAM,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC1D,KAAK;AACL,IAAI,IAAI,QAAQ;AAChB,MAAM,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7C,GAAG,CAAC,CAAC;AACL,EAAE,eAAe,CAAC,MAAM;AACxB,IAAI,wBAAwB,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,iBAAiB,KAAK,iBAAiB,KAAK,OAAO,CAAC,CAAC;AACrH,IAAI,IAAI,wBAAwB,CAAC,MAAM,KAAK,CAAC,EAAE;AAC/C,MAAM,IAAI,QAAQ;AAClB,QAAQ,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC/D,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
package/es/index.mjs CHANGED
@@ -30,10 +30,10 @@ export { ElCalendar } from './components/calendar/index.mjs';
30
30
  export { cardProps } from './components/card/src/card.mjs';
31
31
  export { ElCard } from './components/card/index.mjs';
32
32
  export { carouselEmits, carouselProps } from './components/carousel/src/carousel.mjs';
33
- export { carouselItemProps } from './components/carousel/src/carousel-item2.mjs';
33
+ export { carouselItemProps } from './components/carousel/src/carousel-item.mjs';
34
34
  export { CAROUSEL_ITEM_NAME, carouselContextKey } from './components/carousel/src/constants.mjs';
35
35
  export { ElCarousel, ElCarouselItem } from './components/carousel/index.mjs';
36
- export { cascaderEmits, cascaderProps } from './components/cascader/src/cascader2.mjs';
36
+ export { cascaderEmits, cascaderProps } from './components/cascader/src/cascader.mjs';
37
37
  export { ElCascader } from './components/cascader/index.mjs';
38
38
  export { CASCADER_PANEL_INJECTION_KEY } from './components/cascader-panel/src/types.mjs';
39
39
  export { CommonProps, DefaultProps, useCascaderConfig } from './components/cascader-panel/src/config.mjs';
@@ -46,7 +46,7 @@ export { checkboxGroupContextKey } from './components/checkbox/src/constants.mjs
46
46
  export { ElCheckbox, ElCheckboxButton, ElCheckboxGroup } from './components/checkbox/index.mjs';
47
47
  export { colProps } from './components/col/src/col.mjs';
48
48
  export { ElCol } from './components/col/index.mjs';
49
- export { collapseEmits, collapseProps, emitChangeFn } from './components/collapse/src/collapse2.mjs';
49
+ export { collapseEmits, collapseProps, emitChangeFn } from './components/collapse/src/collapse.mjs';
50
50
  export { collapseItemProps } from './components/collapse/src/collapse-item.mjs';
51
51
  export { collapseContextKey } from './components/collapse/src/constants.mjs';
52
52
  export { ElCollapse, ElCollapseItem } from './components/collapse/index.mjs';
@@ -59,7 +59,7 @@ export { configProviderContextKey } from './components/config-provider/src/const
59
59
  export { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig } from './components/config-provider/src/hooks/use-global-config.mjs';
60
60
  export { ElConfigProvider } from './components/config-provider/index.mjs';
61
61
  export { ElAside, ElContainer, ElFooter, ElHeader, ElMain } from './components/container/index.mjs';
62
- export { countdownEmits, countdownProps } from './components/countdown/src/countdown.mjs';
62
+ export { countdownEmits, countdownProps } from './components/countdown/src/countdown2.mjs';
63
63
  export { ElCountdown } from './components/countdown/index.mjs';
64
64
  export { ROOT_PICKER_INJECTION_KEY } from './components/date-picker/src/constants.mjs';
65
65
  export { datePickerProps } from './components/date-picker/src/props/date-picker.mjs';
@@ -136,7 +136,7 @@ export { RowAlign, RowJustify, rowProps } from './components/row/src/row.mjs';
136
136
  export { rowContextKey } from './components/row/src/constants.mjs';
137
137
  export { ElRow } from './components/row/index.mjs';
138
138
  export { BAR_MAP, GAP, renderThumbStyle } from './components/scrollbar/src/util.mjs';
139
- export { scrollbarEmits, scrollbarProps } from './components/scrollbar/src/scrollbar2.mjs';
139
+ export { scrollbarEmits, scrollbarProps } from './components/scrollbar/src/scrollbar.mjs';
140
140
  export { thumbProps } from './components/scrollbar/src/thumb.mjs';
141
141
  export { scrollbarContextKey } from './components/scrollbar/src/constants.mjs';
142
142
  export { ElScrollbar } from './components/scrollbar/index.mjs';
@@ -156,7 +156,7 @@ export { useSpace } from './components/space/src/use-space.mjs';
156
156
  export { ElSpace } from './components/space/index.mjs';
157
157
  export { statisticProps } from './components/statistic/src/statistic.mjs';
158
158
  export { ElStatistic } from './components/statistic/index.mjs';
159
- export { stepProps } from './components/steps/src/item.mjs';
159
+ export { stepProps } from './components/steps/src/item2.mjs';
160
160
  export { stepsEmits, stepsProps } from './components/steps/src/steps.mjs';
161
161
  export { ElStep, ElSteps } from './components/steps/index.mjs';
162
162
  export { switchEmits, switchProps } from './components/switch/src/switch.mjs';
@@ -218,7 +218,7 @@ export { tourContentEmits, tourContentProps, tourPlacements, tourStrategies } fr
218
218
  export { ElTour, ElTourStep } from './components/tour/index.mjs';
219
219
  export { anchorEmits, anchorProps } from './components/anchor/src/anchor.mjs';
220
220
  export { ElAnchor, ElAnchorLink } from './components/anchor/index.mjs';
221
- export { segmentedEmits, segmentedProps } from './components/segmented/src/segmented2.mjs';
221
+ export { segmentedEmits, segmentedProps } from './components/segmented/src/segmented.mjs';
222
222
  export { ElSegmented } from './components/segmented/index.mjs';
223
223
  export { mentionEmits, mentionProps } from './components/mention/src/mention.mjs';
224
224
  export { ElMention } from './components/mention/index.mjs';
package/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20241113";
1
+ export declare const version = "0.0.20241115";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "0.0.20241113";
1
+ const version = "0.0.20241115";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20241113'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20241115'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
6
  var carousel$1 = require('./src/carousel2.js');
7
- var carouselItem$1 = require('./src/carousel-item.js');
7
+ var carouselItem$1 = require('./src/carousel-item2.js');
8
8
  var carousel = require('./src/carousel.js');
9
- var carouselItem = require('./src/carousel-item2.js');
9
+ var carouselItem = require('./src/carousel-item.js');
10
10
  var constants = require('./src/constants.js');
11
11
  var install = require('../../utils/vue/install.js');
12
12
 
@@ -2,78 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- require('../../../hooks/index.js');
7
- var carouselItem = require('./carousel-item2.js');
8
- var useCarouselItem = require('./use-carousel-item.js');
9
- var constants = require('./constants.js');
10
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
- var index = require('../../../hooks/use-namespace/index.js');
5
+ require('../../../utils/index.js');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
12
7
 
13
- const __default__ = vue.defineComponent({
14
- name: constants.CAROUSEL_ITEM_NAME
15
- });
16
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
- ...__default__,
18
- props: carouselItem.carouselItemProps,
19
- setup(__props) {
20
- const props = __props;
21
- const ns = index.useNamespace("carousel");
22
- const {
23
- carouselItemRef,
24
- active,
25
- animating,
26
- hover,
27
- inStage,
28
- isVertical,
29
- translate,
30
- isCardType,
31
- scale,
32
- ready,
33
- handleItemClick
34
- } = useCarouselItem.useCarouselItem(props);
35
- const itemKls = vue.computed(() => [
36
- ns.e("item"),
37
- ns.is("active", active.value),
38
- ns.is("in-stage", inStage.value),
39
- ns.is("hover", hover.value),
40
- ns.is("animating", animating.value),
41
- {
42
- [ns.em("item", "card")]: isCardType.value,
43
- [ns.em("item", "card-vertical")]: isCardType.value && isVertical.value
44
- }
45
- ]);
46
- const itemStyle = vue.computed(() => {
47
- const translateType = `translate${vue.unref(isVertical) ? "Y" : "X"}`;
48
- const _translate = `${translateType}(${vue.unref(translate)}px)`;
49
- const _scale = `scale(${vue.unref(scale)})`;
50
- const transform = [_translate, _scale].join(" ");
51
- return {
52
- transform
53
- };
54
- });
55
- return (_ctx, _cache) => {
56
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
57
- ref_key: "carouselItemRef",
58
- ref: carouselItemRef,
59
- class: vue.normalizeClass(vue.unref(itemKls)),
60
- style: vue.normalizeStyle(vue.unref(itemStyle)),
61
- onClick: vue.unref(handleItemClick)
62
- }, [
63
- vue.unref(isCardType) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
64
- key: 0,
65
- class: vue.normalizeClass(vue.unref(ns).e("mask"))
66
- }, null, 2)), [
67
- [vue.vShow, !vue.unref(active)]
68
- ]) : vue.createCommentVNode("v-if", true),
69
- vue.renderSlot(_ctx.$slots, "default")
70
- ], 14, ["onClick"])), [
71
- [vue.vShow, vue.unref(ready)]
72
- ]);
73
- };
8
+ const carouselItemProps = runtime.buildProps({
9
+ name: { type: String, default: "" },
10
+ label: {
11
+ type: [String, Number],
12
+ default: ""
74
13
  }
75
14
  });
76
- var CarouselItem = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "carousel-item.vue"]]);
77
15
 
78
- exports["default"] = CarouselItem;
16
+ exports.carouselItemProps = carouselItemProps;
79
17
  //# sourceMappingURL=carousel-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel-item.js","sources":["../../../../../../packages/components/carousel/src/carousel-item.vue"],"sourcesContent":["<template>\n <div\n v-show=\"ready\"\n ref=\"carouselItemRef\"\n :class=\"itemKls\"\n :style=\"itemStyle\"\n @click=\"handleItemClick\"\n >\n <div v-if=\"isCardType\" v-show=\"!active\" :class=\"ns.e('mask')\" />\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, unref } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { carouselItemProps } from './carousel-item'\nimport { useCarouselItem } from './use-carousel-item'\nimport { CAROUSEL_ITEM_NAME } from './constants'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: CAROUSEL_ITEM_NAME,\n})\n\nconst props = defineProps(carouselItemProps)\nconst ns = useNamespace('carousel')\n\n// inject\nconst {\n carouselItemRef,\n active,\n animating,\n hover,\n inStage,\n isVertical,\n translate,\n isCardType,\n scale,\n ready,\n handleItemClick,\n} = useCarouselItem(props)\n\nconst itemKls = computed(() => [\n ns.e('item'),\n ns.is('active', active.value),\n ns.is('in-stage', inStage.value),\n ns.is('hover', hover.value),\n ns.is('animating', animating.value),\n {\n [ns.em('item', 'card')]: isCardType.value,\n [ns.em('item', 'card-vertical')]: isCardType.value && isVertical.value,\n },\n])\n\nconst itemStyle = computed<CSSProperties>(() => {\n const translateType = `translate${unref(isVertical) ? 'Y' : 'X'}`\n const _translate = `${translateType}(${unref(translate)}px)`\n const _scale = `scale(${unref(scale)})`\n const transform = [_translate, _scale].join(' ')\n\n return {\n transform,\n }\n})\n</script>\n"],"names":["CAROUSEL_ITEM_NAME","useNamespace","useCarouselItem","computed","unref"],"mappings":";;;;;;;;;;;;uCAsBc,CAAA;AAAA,EACZ,IAAM,EAAAA,4BAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAKC,mBAAa,UAAU,CAAA,CAAA;AAGlC,IAAM,MAAA;AAAA,MACJ,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,KAAA;AAAA,MACA,OAA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AA,QACL,SAAA;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"carousel-item.js","sources":["../../../../../../packages/components/carousel/src/carousel-item.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const carouselItemProps = buildProps({\n /**\n * @description name of the item, can be used in `setActiveItem`\n */\n name: { type: String, default: '' },\n /**\n * @description text content for the corresponding indicator\n */\n label: {\n type: [String, Number],\n default: '',\n },\n} as const)\n\nexport type CarouselItemProps = ExtractPropTypes<typeof carouselItemProps>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,iBAAiB,GAAGA,kBAAU,CAAC;AAC5C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}