@element-plus/nightly 0.0.20250109 → 0.0.20250111

Sign up to get free protection for your applications and to get access to all the features.
Files changed (611) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +26 -9
  4. package/dist/index.full.min.js +19 -19
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +19 -19
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +26 -10
  9. package/dist/locale/af.js +1 -1
  10. package/dist/locale/af.min.js +1 -1
  11. package/dist/locale/af.min.mjs +1 -1
  12. package/dist/locale/af.mjs +1 -1
  13. package/dist/locale/ar-eg.js +1 -1
  14. package/dist/locale/ar-eg.min.js +1 -1
  15. package/dist/locale/ar-eg.min.mjs +1 -1
  16. package/dist/locale/ar-eg.mjs +1 -1
  17. package/dist/locale/ar.js +1 -1
  18. package/dist/locale/ar.min.js +1 -1
  19. package/dist/locale/ar.min.mjs +1 -1
  20. package/dist/locale/ar.mjs +1 -1
  21. package/dist/locale/az.js +1 -1
  22. package/dist/locale/az.min.js +1 -1
  23. package/dist/locale/az.min.mjs +1 -1
  24. package/dist/locale/az.mjs +1 -1
  25. package/dist/locale/bg.js +1 -1
  26. package/dist/locale/bg.min.js +1 -1
  27. package/dist/locale/bg.min.mjs +1 -1
  28. package/dist/locale/bg.mjs +1 -1
  29. package/dist/locale/bn.js +1 -1
  30. package/dist/locale/bn.min.js +1 -1
  31. package/dist/locale/bn.min.mjs +1 -1
  32. package/dist/locale/bn.mjs +1 -1
  33. package/dist/locale/ca.js +1 -1
  34. package/dist/locale/ca.min.js +1 -1
  35. package/dist/locale/ca.min.mjs +1 -1
  36. package/dist/locale/ca.mjs +1 -1
  37. package/dist/locale/ckb.js +1 -1
  38. package/dist/locale/ckb.min.js +1 -1
  39. package/dist/locale/ckb.min.mjs +1 -1
  40. package/dist/locale/ckb.mjs +1 -1
  41. package/dist/locale/cs.js +1 -1
  42. package/dist/locale/cs.min.js +1 -1
  43. package/dist/locale/cs.min.mjs +1 -1
  44. package/dist/locale/cs.mjs +1 -1
  45. package/dist/locale/da.js +1 -1
  46. package/dist/locale/da.min.js +1 -1
  47. package/dist/locale/da.min.mjs +1 -1
  48. package/dist/locale/da.mjs +1 -1
  49. package/dist/locale/de.js +1 -1
  50. package/dist/locale/de.min.js +1 -1
  51. package/dist/locale/de.min.mjs +1 -1
  52. package/dist/locale/de.mjs +1 -1
  53. package/dist/locale/el.js +1 -1
  54. package/dist/locale/el.min.js +1 -1
  55. package/dist/locale/el.min.mjs +1 -1
  56. package/dist/locale/el.mjs +1 -1
  57. package/dist/locale/en.js +1 -1
  58. package/dist/locale/en.min.js +1 -1
  59. package/dist/locale/en.min.mjs +1 -1
  60. package/dist/locale/en.mjs +1 -1
  61. package/dist/locale/eo.js +1 -1
  62. package/dist/locale/eo.min.js +1 -1
  63. package/dist/locale/eo.min.mjs +1 -1
  64. package/dist/locale/eo.mjs +1 -1
  65. package/dist/locale/es.js +1 -1
  66. package/dist/locale/es.min.js +1 -1
  67. package/dist/locale/es.min.mjs +1 -1
  68. package/dist/locale/es.mjs +1 -1
  69. package/dist/locale/et.js +1 -1
  70. package/dist/locale/et.min.js +1 -1
  71. package/dist/locale/et.min.mjs +1 -1
  72. package/dist/locale/et.mjs +1 -1
  73. package/dist/locale/eu.js +1 -1
  74. package/dist/locale/eu.min.js +1 -1
  75. package/dist/locale/eu.min.mjs +1 -1
  76. package/dist/locale/eu.mjs +1 -1
  77. package/dist/locale/fa.js +1 -1
  78. package/dist/locale/fa.min.js +1 -1
  79. package/dist/locale/fa.min.mjs +1 -1
  80. package/dist/locale/fa.mjs +1 -1
  81. package/dist/locale/fi.js +1 -1
  82. package/dist/locale/fi.min.js +1 -1
  83. package/dist/locale/fi.min.mjs +1 -1
  84. package/dist/locale/fi.mjs +1 -1
  85. package/dist/locale/fr.js +1 -1
  86. package/dist/locale/fr.min.js +1 -1
  87. package/dist/locale/fr.min.mjs +1 -1
  88. package/dist/locale/fr.mjs +1 -1
  89. package/dist/locale/he.js +1 -1
  90. package/dist/locale/he.min.js +1 -1
  91. package/dist/locale/he.min.mjs +1 -1
  92. package/dist/locale/he.mjs +1 -1
  93. package/dist/locale/hi.js +1 -1
  94. package/dist/locale/hi.min.js +1 -1
  95. package/dist/locale/hi.min.mjs +1 -1
  96. package/dist/locale/hi.mjs +1 -1
  97. package/dist/locale/hr.js +1 -1
  98. package/dist/locale/hr.min.js +1 -1
  99. package/dist/locale/hr.min.mjs +1 -1
  100. package/dist/locale/hr.mjs +1 -1
  101. package/dist/locale/hu.js +1 -1
  102. package/dist/locale/hu.min.js +1 -1
  103. package/dist/locale/hu.min.mjs +1 -1
  104. package/dist/locale/hu.mjs +1 -1
  105. package/dist/locale/hy-am.js +1 -1
  106. package/dist/locale/hy-am.min.js +1 -1
  107. package/dist/locale/hy-am.min.mjs +1 -1
  108. package/dist/locale/hy-am.mjs +1 -1
  109. package/dist/locale/id.js +1 -1
  110. package/dist/locale/id.min.js +1 -1
  111. package/dist/locale/id.min.mjs +1 -1
  112. package/dist/locale/id.mjs +1 -1
  113. package/dist/locale/it.js +1 -1
  114. package/dist/locale/it.min.js +1 -1
  115. package/dist/locale/it.min.mjs +1 -1
  116. package/dist/locale/it.mjs +1 -1
  117. package/dist/locale/ja.js +1 -1
  118. package/dist/locale/ja.min.js +1 -1
  119. package/dist/locale/ja.min.mjs +1 -1
  120. package/dist/locale/ja.mjs +1 -1
  121. package/dist/locale/kk.js +1 -1
  122. package/dist/locale/kk.min.js +1 -1
  123. package/dist/locale/kk.min.mjs +1 -1
  124. package/dist/locale/kk.mjs +1 -1
  125. package/dist/locale/km.js +1 -1
  126. package/dist/locale/km.min.js +1 -1
  127. package/dist/locale/km.min.mjs +1 -1
  128. package/dist/locale/km.mjs +1 -1
  129. package/dist/locale/ko.js +1 -1
  130. package/dist/locale/ko.min.js +1 -1
  131. package/dist/locale/ko.min.mjs +1 -1
  132. package/dist/locale/ko.mjs +1 -1
  133. package/dist/locale/ku.js +1 -1
  134. package/dist/locale/ku.min.js +1 -1
  135. package/dist/locale/ku.min.mjs +1 -1
  136. package/dist/locale/ku.mjs +1 -1
  137. package/dist/locale/ky.js +1 -1
  138. package/dist/locale/ky.min.js +1 -1
  139. package/dist/locale/ky.min.mjs +1 -1
  140. package/dist/locale/ky.mjs +1 -1
  141. package/dist/locale/lt.js +1 -1
  142. package/dist/locale/lt.min.js +1 -1
  143. package/dist/locale/lt.min.mjs +1 -1
  144. package/dist/locale/lt.mjs +1 -1
  145. package/dist/locale/lv.js +1 -1
  146. package/dist/locale/lv.min.js +1 -1
  147. package/dist/locale/lv.min.mjs +1 -1
  148. package/dist/locale/lv.mjs +1 -1
  149. package/dist/locale/mg.js +1 -1
  150. package/dist/locale/mg.min.js +1 -1
  151. package/dist/locale/mg.min.mjs +1 -1
  152. package/dist/locale/mg.mjs +1 -1
  153. package/dist/locale/mn.js +1 -1
  154. package/dist/locale/mn.min.js +1 -1
  155. package/dist/locale/mn.min.mjs +1 -1
  156. package/dist/locale/mn.mjs +1 -1
  157. package/dist/locale/ms.js +1 -1
  158. package/dist/locale/ms.min.js +1 -1
  159. package/dist/locale/ms.min.mjs +1 -1
  160. package/dist/locale/ms.mjs +1 -1
  161. package/dist/locale/my.js +1 -1
  162. package/dist/locale/my.min.js +1 -1
  163. package/dist/locale/my.min.mjs +1 -1
  164. package/dist/locale/my.mjs +1 -1
  165. package/dist/locale/nb-no.js +1 -1
  166. package/dist/locale/nb-no.min.js +1 -1
  167. package/dist/locale/nb-no.min.mjs +1 -1
  168. package/dist/locale/nb-no.mjs +1 -1
  169. package/dist/locale/nl.js +1 -1
  170. package/dist/locale/nl.min.js +1 -1
  171. package/dist/locale/nl.min.mjs +1 -1
  172. package/dist/locale/nl.mjs +1 -1
  173. package/dist/locale/no.js +1 -1
  174. package/dist/locale/no.min.js +1 -1
  175. package/dist/locale/no.min.mjs +1 -1
  176. package/dist/locale/no.mjs +1 -1
  177. package/dist/locale/pa.js +1 -1
  178. package/dist/locale/pa.min.js +1 -1
  179. package/dist/locale/pa.min.mjs +1 -1
  180. package/dist/locale/pa.mjs +1 -1
  181. package/dist/locale/pl.js +1 -1
  182. package/dist/locale/pl.min.js +1 -1
  183. package/dist/locale/pl.min.mjs +1 -1
  184. package/dist/locale/pl.mjs +1 -1
  185. package/dist/locale/pt-br.js +1 -1
  186. package/dist/locale/pt-br.min.js +1 -1
  187. package/dist/locale/pt-br.min.mjs +1 -1
  188. package/dist/locale/pt-br.mjs +1 -1
  189. package/dist/locale/pt.js +1 -1
  190. package/dist/locale/pt.min.js +1 -1
  191. package/dist/locale/pt.min.mjs +1 -1
  192. package/dist/locale/pt.mjs +1 -1
  193. package/dist/locale/ro.js +1 -1
  194. package/dist/locale/ro.min.js +1 -1
  195. package/dist/locale/ro.min.mjs +1 -1
  196. package/dist/locale/ro.mjs +1 -1
  197. package/dist/locale/ru.js +1 -1
  198. package/dist/locale/ru.min.js +1 -1
  199. package/dist/locale/ru.min.mjs +1 -1
  200. package/dist/locale/ru.mjs +1 -1
  201. package/dist/locale/sk.js +1 -1
  202. package/dist/locale/sk.min.js +1 -1
  203. package/dist/locale/sk.min.mjs +1 -1
  204. package/dist/locale/sk.mjs +1 -1
  205. package/dist/locale/sl.js +1 -1
  206. package/dist/locale/sl.min.js +1 -1
  207. package/dist/locale/sl.min.mjs +1 -1
  208. package/dist/locale/sl.mjs +1 -1
  209. package/dist/locale/sr.js +1 -1
  210. package/dist/locale/sr.min.js +1 -1
  211. package/dist/locale/sr.min.mjs +1 -1
  212. package/dist/locale/sr.mjs +1 -1
  213. package/dist/locale/sv.js +1 -1
  214. package/dist/locale/sv.min.js +1 -1
  215. package/dist/locale/sv.min.mjs +1 -1
  216. package/dist/locale/sv.mjs +1 -1
  217. package/dist/locale/sw.js +1 -1
  218. package/dist/locale/sw.min.js +1 -1
  219. package/dist/locale/sw.min.mjs +1 -1
  220. package/dist/locale/sw.mjs +1 -1
  221. package/dist/locale/ta.js +1 -1
  222. package/dist/locale/ta.min.js +1 -1
  223. package/dist/locale/ta.min.mjs +1 -1
  224. package/dist/locale/ta.mjs +1 -1
  225. package/dist/locale/th.js +1 -1
  226. package/dist/locale/th.min.js +1 -1
  227. package/dist/locale/th.min.mjs +1 -1
  228. package/dist/locale/th.mjs +1 -1
  229. package/dist/locale/tk.js +1 -1
  230. package/dist/locale/tk.min.js +1 -1
  231. package/dist/locale/tk.min.mjs +1 -1
  232. package/dist/locale/tk.mjs +1 -1
  233. package/dist/locale/tr.js +1 -1
  234. package/dist/locale/tr.min.js +1 -1
  235. package/dist/locale/tr.min.mjs +1 -1
  236. package/dist/locale/tr.mjs +1 -1
  237. package/dist/locale/ug-cn.js +1 -1
  238. package/dist/locale/ug-cn.min.js +1 -1
  239. package/dist/locale/ug-cn.min.mjs +1 -1
  240. package/dist/locale/ug-cn.mjs +1 -1
  241. package/dist/locale/uk.js +1 -1
  242. package/dist/locale/uk.min.js +1 -1
  243. package/dist/locale/uk.min.mjs +1 -1
  244. package/dist/locale/uk.mjs +1 -1
  245. package/dist/locale/uz-uz.js +1 -1
  246. package/dist/locale/uz-uz.min.js +1 -1
  247. package/dist/locale/uz-uz.min.mjs +1 -1
  248. package/dist/locale/uz-uz.mjs +1 -1
  249. package/dist/locale/vi.js +1 -1
  250. package/dist/locale/vi.min.js +1 -1
  251. package/dist/locale/vi.min.mjs +1 -1
  252. package/dist/locale/vi.mjs +1 -1
  253. package/dist/locale/zh-cn.js +1 -1
  254. package/dist/locale/zh-cn.min.js +1 -1
  255. package/dist/locale/zh-cn.min.mjs +1 -1
  256. package/dist/locale/zh-cn.mjs +1 -1
  257. package/dist/locale/zh-tw.js +1 -1
  258. package/dist/locale/zh-tw.min.js +1 -1
  259. package/dist/locale/zh-tw.min.mjs +1 -1
  260. package/dist/locale/zh-tw.mjs +1 -1
  261. package/es/components/alert/index.mjs +2 -2
  262. package/es/components/alert/src/alert.mjs +89 -36
  263. package/es/components/alert/src/alert.mjs.map +1 -1
  264. package/es/components/alert/src/alert2.mjs +36 -89
  265. package/es/components/alert/src/alert2.mjs.map +1 -1
  266. package/es/components/anchor/index.mjs +3 -3
  267. package/es/components/anchor/src/anchor-link.mjs +5 -81
  268. package/es/components/anchor/src/anchor-link.mjs.map +1 -1
  269. package/es/components/anchor/src/anchor-link2.mjs +81 -5
  270. package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
  271. package/es/components/anchor/src/anchor.mjs +42 -192
  272. package/es/components/anchor/src/anchor.mjs.map +1 -1
  273. package/es/components/anchor/src/anchor2.mjs +192 -42
  274. package/es/components/anchor/src/anchor2.mjs.map +1 -1
  275. package/es/components/autocomplete/index.mjs +2 -2
  276. package/es/components/autocomplete/src/autocomplete.mjs +364 -79
  277. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  278. package/es/components/autocomplete/src/autocomplete2.mjs +79 -364
  279. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  280. package/es/components/card/index.mjs +2 -2
  281. package/es/components/card/src/card.mjs +20 -42
  282. package/es/components/card/src/card.mjs.map +1 -1
  283. package/es/components/card/src/card2.mjs +42 -20
  284. package/es/components/card/src/card2.mjs.map +1 -1
  285. package/es/components/carousel/index.mjs +2 -2
  286. package/es/components/carousel/src/carousel.mjs +61 -204
  287. package/es/components/carousel/src/carousel.mjs.map +1 -1
  288. package/es/components/carousel/src/carousel2.mjs +204 -61
  289. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  290. package/es/components/check-tag/index.mjs +2 -2
  291. package/es/components/check-tag/src/check-tag.mjs +14 -38
  292. package/es/components/check-tag/src/check-tag.mjs.map +1 -1
  293. package/es/components/check-tag/src/check-tag2.mjs +38 -14
  294. package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
  295. package/es/components/collection/index.mjs +1 -1
  296. package/es/components/collection/src/collection.mjs +62 -10
  297. package/es/components/collection/src/collection.mjs.map +1 -1
  298. package/es/components/collection/src/collection2.mjs +10 -62
  299. package/es/components/collection/src/collection2.mjs.map +1 -1
  300. package/es/components/color-picker/index.mjs +2 -2
  301. package/es/components/color-picker/src/color-picker.mjs +40 -402
  302. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  303. package/es/components/color-picker/src/color-picker2.mjs +402 -40
  304. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  305. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  306. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  307. package/es/components/dropdown/src/dropdown.mjs +1 -1
  308. package/es/components/empty/index.mjs +2 -2
  309. package/es/components/empty/src/empty.mjs +52 -11
  310. package/es/components/empty/src/empty.mjs.map +1 -1
  311. package/es/components/empty/src/empty2.mjs +11 -52
  312. package/es/components/empty/src/empty2.mjs.map +1 -1
  313. package/es/components/form/index.mjs +2 -2
  314. package/es/components/form/src/form-item.mjs +47 -319
  315. package/es/components/form/src/form-item.mjs.map +1 -1
  316. package/es/components/form/src/form-item2.mjs +319 -47
  317. package/es/components/form/src/form-item2.mjs.map +1 -1
  318. package/es/components/image/index.mjs +2 -2
  319. package/es/components/image/src/image.d.ts +2 -0
  320. package/es/components/image/src/image.mjs +64 -232
  321. package/es/components/image/src/image.mjs.map +1 -1
  322. package/es/components/image/src/image.vue.d.ts +5 -1
  323. package/es/components/image/src/image2.mjs +235 -64
  324. package/es/components/image/src/image2.mjs.map +1 -1
  325. package/es/components/image-viewer/index.mjs +2 -2
  326. package/es/components/image-viewer/src/image-viewer.mjs +45 -412
  327. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  328. package/es/components/image-viewer/src/image-viewer2.mjs +412 -45
  329. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  330. package/es/components/index.mjs +24 -24
  331. package/es/components/input/index.mjs +2 -2
  332. package/es/components/input/src/input.mjs +102 -431
  333. package/es/components/input/src/input.mjs.map +1 -1
  334. package/es/components/input/src/input2.mjs +431 -102
  335. package/es/components/input/src/input2.mjs.map +1 -1
  336. package/es/components/mention/src/mention.mjs +1 -1
  337. package/es/components/mention/src/mention2.mjs +1 -1
  338. package/es/components/pagination/src/components/prev.mjs +17 -35
  339. package/es/components/pagination/src/components/prev.mjs.map +1 -1
  340. package/es/components/pagination/src/components/prev2.mjs +35 -17
  341. package/es/components/pagination/src/components/prev2.mjs.map +1 -1
  342. package/es/components/pagination/src/pagination.mjs +1 -1
  343. package/es/components/popper/index.mjs +2 -2
  344. package/es/components/popper/src/arrow.mjs +36 -7
  345. package/es/components/popper/src/arrow.mjs.map +1 -1
  346. package/es/components/popper/src/arrow2.mjs +7 -36
  347. package/es/components/popper/src/arrow2.mjs.map +1 -1
  348. package/es/components/progress/index.mjs +2 -2
  349. package/es/components/progress/src/progress.mjs +53 -207
  350. package/es/components/progress/src/progress.mjs.map +1 -1
  351. package/es/components/progress/src/progress2.mjs +207 -53
  352. package/es/components/progress/src/progress2.mjs.map +1 -1
  353. package/es/components/result/index.mjs +2 -2
  354. package/es/components/result/src/result.mjs +28 -62
  355. package/es/components/result/src/result.mjs.map +1 -1
  356. package/es/components/result/src/result2.mjs +62 -28
  357. package/es/components/result/src/result2.mjs.map +1 -1
  358. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  359. package/es/components/scrollbar/index.mjs +1 -1
  360. package/es/components/scrollbar/src/bar.mjs +10 -64
  361. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  362. package/es/components/scrollbar/src/bar2.mjs +64 -10
  363. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  364. package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
  365. package/es/components/scrollbar/src/thumb.mjs +129 -11
  366. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  367. package/es/components/scrollbar/src/thumb2.mjs +11 -129
  368. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  369. package/es/components/slider/index.mjs +2 -2
  370. package/es/components/slider/src/slider.mjs +88 -238
  371. package/es/components/slider/src/slider.mjs.map +1 -1
  372. package/es/components/slider/src/slider2.mjs +238 -88
  373. package/es/components/slider/src/slider2.mjs.map +1 -1
  374. package/es/components/text/index.mjs +2 -2
  375. package/es/components/text/src/text.mjs +67 -21
  376. package/es/components/text/src/text.mjs.map +1 -1
  377. package/es/components/text/src/text2.mjs +21 -67
  378. package/es/components/text/src/text2.mjs.map +1 -1
  379. package/es/components/time-picker/index.mjs +1 -1
  380. package/es/components/time-picker/src/common/picker-range-trigger.mjs +2 -2
  381. package/es/components/time-picker/src/common/picker-range-trigger.mjs.map +1 -1
  382. package/es/components/time-picker/src/common/props.d.ts +25 -0
  383. package/es/components/time-picker/src/common/props.mjs +3 -2
  384. package/es/components/time-picker/src/common/props.mjs.map +1 -1
  385. package/es/components/time-select/src/time-select.d.ts +1 -0
  386. package/es/components/time-select/src/time-select.mjs +4 -0
  387. package/es/components/time-select/src/time-select.mjs.map +1 -1
  388. package/es/components/time-select/src/time-select.vue.d.ts +3 -0
  389. package/es/components/time-select/src/time-select2.mjs +12 -4
  390. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  391. package/es/components/tooltip/src/tooltip.mjs +1 -1
  392. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  393. package/es/components/tooltip-v2/index.mjs +2 -2
  394. package/es/components/tooltip-v2/src/content.mjs +110 -48
  395. package/es/components/tooltip-v2/src/content.mjs.map +1 -1
  396. package/es/components/tooltip-v2/src/content2.mjs +48 -110
  397. package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
  398. package/es/components/tooltip-v2/src/root.mjs +79 -17
  399. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  400. package/es/components/tooltip-v2/src/root2.mjs +17 -79
  401. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  402. package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
  403. package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
  404. package/es/components/tour/index.mjs +3 -3
  405. package/es/components/tour/src/content.mjs +67 -43
  406. package/es/components/tour/src/content.mjs.map +1 -1
  407. package/es/components/tour/src/content2.mjs +43 -67
  408. package/es/components/tour/src/content2.mjs.map +1 -1
  409. package/es/components/tour/src/mask.mjs +75 -18
  410. package/es/components/tour/src/mask.mjs.map +1 -1
  411. package/es/components/tour/src/mask2.mjs +18 -75
  412. package/es/components/tour/src/mask2.mjs.map +1 -1
  413. package/es/components/tour/src/step.mjs +1 -1
  414. package/es/components/tour/src/tour.mjs +68 -153
  415. package/es/components/tour/src/tour.mjs.map +1 -1
  416. package/es/components/tour/src/tour2.mjs +153 -68
  417. package/es/components/tour/src/tour2.mjs.map +1 -1
  418. package/es/components/upload/index.mjs +2 -2
  419. package/es/components/upload/src/upload-content.mjs +196 -33
  420. package/es/components/upload/src/upload-content.mjs.map +1 -1
  421. package/es/components/upload/src/upload-content2.mjs +33 -196
  422. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  423. package/es/components/upload/src/upload-dragger.mjs +10 -47
  424. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  425. package/es/components/upload/src/upload-dragger2.mjs +47 -10
  426. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  427. package/es/components/upload/src/upload2.mjs +1 -1
  428. package/es/index.mjs +24 -24
  429. package/es/version.d.ts +1 -1
  430. package/es/version.mjs +1 -1
  431. package/es/version.mjs.map +1 -1
  432. package/lib/components/alert/index.js +2 -2
  433. package/lib/components/alert/src/alert.js +88 -37
  434. package/lib/components/alert/src/alert.js.map +1 -1
  435. package/lib/components/alert/src/alert2.js +37 -88
  436. package/lib/components/alert/src/alert2.js.map +1 -1
  437. package/lib/components/anchor/index.js +3 -3
  438. package/lib/components/anchor/src/anchor-link.js +5 -81
  439. package/lib/components/anchor/src/anchor-link.js.map +1 -1
  440. package/lib/components/anchor/src/anchor-link2.js +81 -5
  441. package/lib/components/anchor/src/anchor-link2.js.map +1 -1
  442. package/lib/components/anchor/src/anchor.js +42 -191
  443. package/lib/components/anchor/src/anchor.js.map +1 -1
  444. package/lib/components/anchor/src/anchor2.js +191 -42
  445. package/lib/components/anchor/src/anchor2.js.map +1 -1
  446. package/lib/components/autocomplete/index.js +2 -2
  447. package/lib/components/autocomplete/src/autocomplete.js +363 -79
  448. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  449. package/lib/components/autocomplete/src/autocomplete2.js +79 -363
  450. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  451. package/lib/components/card/index.js +2 -2
  452. package/lib/components/card/src/card.js +20 -42
  453. package/lib/components/card/src/card.js.map +1 -1
  454. package/lib/components/card/src/card2.js +42 -20
  455. package/lib/components/card/src/card2.js.map +1 -1
  456. package/lib/components/carousel/index.js +2 -2
  457. package/lib/components/carousel/src/carousel.js +62 -204
  458. package/lib/components/carousel/src/carousel.js.map +1 -1
  459. package/lib/components/carousel/src/carousel2.js +204 -62
  460. package/lib/components/carousel/src/carousel2.js.map +1 -1
  461. package/lib/components/check-tag/index.js +2 -2
  462. package/lib/components/check-tag/src/check-tag.js +15 -38
  463. package/lib/components/check-tag/src/check-tag.js.map +1 -1
  464. package/lib/components/check-tag/src/check-tag2.js +38 -15
  465. package/lib/components/check-tag/src/check-tag2.js.map +1 -1
  466. package/lib/components/collection/index.js +1 -1
  467. package/lib/components/collection/src/collection.js +62 -9
  468. package/lib/components/collection/src/collection.js.map +1 -1
  469. package/lib/components/collection/src/collection2.js +9 -62
  470. package/lib/components/collection/src/collection2.js.map +1 -1
  471. package/lib/components/color-picker/index.js +2 -2
  472. package/lib/components/color-picker/src/color-picker.js +40 -400
  473. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  474. package/lib/components/color-picker/src/color-picker2.js +400 -40
  475. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  476. package/lib/components/color-picker/src/components/predefine.js +1 -1
  477. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  478. package/lib/components/dropdown/src/dropdown.js +1 -1
  479. package/lib/components/empty/index.js +2 -2
  480. package/lib/components/empty/src/empty.js +52 -11
  481. package/lib/components/empty/src/empty.js.map +1 -1
  482. package/lib/components/empty/src/empty2.js +11 -52
  483. package/lib/components/empty/src/empty2.js.map +1 -1
  484. package/lib/components/form/index.js +2 -2
  485. package/lib/components/form/src/form-item.js +48 -323
  486. package/lib/components/form/src/form-item.js.map +1 -1
  487. package/lib/components/form/src/form-item2.js +323 -48
  488. package/lib/components/form/src/form-item2.js.map +1 -1
  489. package/lib/components/image/index.js +2 -2
  490. package/lib/components/image/src/image.d.ts +2 -0
  491. package/lib/components/image/src/image.js +64 -231
  492. package/lib/components/image/src/image.js.map +1 -1
  493. package/lib/components/image/src/image.vue.d.ts +5 -1
  494. package/lib/components/image/src/image2.js +234 -64
  495. package/lib/components/image/src/image2.js.map +1 -1
  496. package/lib/components/image-viewer/index.js +2 -2
  497. package/lib/components/image-viewer/src/image-viewer.js +46 -412
  498. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  499. package/lib/components/image-viewer/src/image-viewer2.js +412 -46
  500. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  501. package/lib/components/index.js +24 -23
  502. package/lib/components/index.js.map +1 -1
  503. package/lib/components/input/index.js +2 -2
  504. package/lib/components/input/src/input.js +102 -430
  505. package/lib/components/input/src/input.js.map +1 -1
  506. package/lib/components/input/src/input2.js +430 -102
  507. package/lib/components/input/src/input2.js.map +1 -1
  508. package/lib/components/mention/src/mention.js +1 -1
  509. package/lib/components/mention/src/mention2.js +1 -1
  510. package/lib/components/pagination/src/components/prev.js +18 -35
  511. package/lib/components/pagination/src/components/prev.js.map +1 -1
  512. package/lib/components/pagination/src/components/prev2.js +35 -18
  513. package/lib/components/pagination/src/components/prev2.js.map +1 -1
  514. package/lib/components/pagination/src/pagination.js +1 -1
  515. package/lib/components/popper/index.js +2 -2
  516. package/lib/components/popper/src/arrow.js +36 -8
  517. package/lib/components/popper/src/arrow.js.map +1 -1
  518. package/lib/components/popper/src/arrow2.js +8 -36
  519. package/lib/components/popper/src/arrow2.js.map +1 -1
  520. package/lib/components/progress/index.js +2 -2
  521. package/lib/components/progress/src/progress.js +53 -207
  522. package/lib/components/progress/src/progress.js.map +1 -1
  523. package/lib/components/progress/src/progress2.js +207 -53
  524. package/lib/components/progress/src/progress2.js.map +1 -1
  525. package/lib/components/result/index.js +2 -2
  526. package/lib/components/result/src/result.js +30 -62
  527. package/lib/components/result/src/result.js.map +1 -1
  528. package/lib/components/result/src/result2.js +62 -30
  529. package/lib/components/result/src/result2.js.map +1 -1
  530. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  531. package/lib/components/scrollbar/index.js +1 -1
  532. package/lib/components/scrollbar/src/bar.js +10 -64
  533. package/lib/components/scrollbar/src/bar.js.map +1 -1
  534. package/lib/components/scrollbar/src/bar2.js +64 -10
  535. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  536. package/lib/components/scrollbar/src/scrollbar2.js +1 -1
  537. package/lib/components/scrollbar/src/thumb.js +129 -11
  538. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  539. package/lib/components/scrollbar/src/thumb2.js +11 -129
  540. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  541. package/lib/components/slider/index.js +2 -2
  542. package/lib/components/slider/src/slider.js +89 -238
  543. package/lib/components/slider/src/slider.js.map +1 -1
  544. package/lib/components/slider/src/slider2.js +238 -89
  545. package/lib/components/slider/src/slider2.js.map +1 -1
  546. package/lib/components/text/index.js +2 -2
  547. package/lib/components/text/src/text.js +67 -21
  548. package/lib/components/text/src/text.js.map +1 -1
  549. package/lib/components/text/src/text2.js +21 -67
  550. package/lib/components/text/src/text2.js.map +1 -1
  551. package/lib/components/time-picker/index.js +1 -0
  552. package/lib/components/time-picker/index.js.map +1 -1
  553. package/lib/components/time-picker/src/common/picker-range-trigger.js +1 -1
  554. package/lib/components/time-picker/src/common/picker-range-trigger.js.map +1 -1
  555. package/lib/components/time-picker/src/common/props.d.ts +25 -0
  556. package/lib/components/time-picker/src/common/props.js +3 -1
  557. package/lib/components/time-picker/src/common/props.js.map +1 -1
  558. package/lib/components/time-select/src/time-select.d.ts +1 -0
  559. package/lib/components/time-select/src/time-select.js +4 -0
  560. package/lib/components/time-select/src/time-select.js.map +1 -1
  561. package/lib/components/time-select/src/time-select.vue.d.ts +3 -0
  562. package/lib/components/time-select/src/time-select2.js +12 -4
  563. package/lib/components/time-select/src/time-select2.js.map +1 -1
  564. package/lib/components/tooltip/src/tooltip.js +1 -1
  565. package/lib/components/tooltip/src/tooltip2.js +1 -1
  566. package/lib/components/tooltip-v2/index.js +2 -2
  567. package/lib/components/tooltip-v2/src/content.js +110 -48
  568. package/lib/components/tooltip-v2/src/content.js.map +1 -1
  569. package/lib/components/tooltip-v2/src/content2.js +48 -110
  570. package/lib/components/tooltip-v2/src/content2.js.map +1 -1
  571. package/lib/components/tooltip-v2/src/root.js +79 -17
  572. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  573. package/lib/components/tooltip-v2/src/root2.js +17 -79
  574. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  575. package/lib/components/tooltip-v2/src/tooltip.js +2 -2
  576. package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
  577. package/lib/components/tour/index.js +3 -3
  578. package/lib/components/tour/src/content.js +67 -46
  579. package/lib/components/tour/src/content.js.map +1 -1
  580. package/lib/components/tour/src/content2.js +46 -67
  581. package/lib/components/tour/src/content2.js.map +1 -1
  582. package/lib/components/tour/src/mask.js +75 -18
  583. package/lib/components/tour/src/mask.js.map +1 -1
  584. package/lib/components/tour/src/mask2.js +18 -75
  585. package/lib/components/tour/src/mask2.js.map +1 -1
  586. package/lib/components/tour/src/step.js +1 -1
  587. package/lib/components/tour/src/tour.js +67 -151
  588. package/lib/components/tour/src/tour.js.map +1 -1
  589. package/lib/components/tour/src/tour2.js +151 -67
  590. package/lib/components/tour/src/tour2.js.map +1 -1
  591. package/lib/components/upload/index.js +2 -2
  592. package/lib/components/upload/src/upload-content.js +194 -31
  593. package/lib/components/upload/src/upload-content.js.map +1 -1
  594. package/lib/components/upload/src/upload-content2.js +31 -194
  595. package/lib/components/upload/src/upload-content2.js.map +1 -1
  596. package/lib/components/upload/src/upload-dragger.js +11 -47
  597. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  598. package/lib/components/upload/src/upload-dragger2.js +47 -11
  599. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  600. package/lib/components/upload/src/upload2.js +1 -1
  601. package/lib/index.js +24 -23
  602. package/lib/index.js.map +1 -1
  603. package/lib/version.d.ts +1 -1
  604. package/lib/version.js +1 -1
  605. package/lib/version.js.map +1 -1
  606. package/package.json +2 -2
  607. package/tags.json +1 -1
  608. package/theme-chalk/el-dialog.css +1 -1
  609. package/theme-chalk/index.css +1 -1
  610. package/theme-chalk/src/dialog.scss +1 -0
  611. package/web-types.json +1 -1
@@ -2,72 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var util = require('./util.js');
7
- var thumb = require('./thumb2.js');
8
- var bar = require('./bar2.js');
9
- var constants = require('./constants.js');
10
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
5
+ var runtime = require('../../../utils/vue/props/runtime.js');
11
6
 
12
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
13
- __name: "bar",
14
- props: bar.barProps,
15
- setup(__props, { expose }) {
16
- const props = __props;
17
- const scrollbar = vue.inject(constants.scrollbarContextKey);
18
- const moveX = vue.ref(0);
19
- const moveY = vue.ref(0);
20
- const sizeWidth = vue.ref("");
21
- const sizeHeight = vue.ref("");
22
- const ratioY = vue.ref(1);
23
- const ratioX = vue.ref(1);
24
- const handleScroll = (wrap) => {
25
- if (wrap) {
26
- const offsetHeight = wrap.offsetHeight - util.GAP;
27
- const offsetWidth = wrap.offsetWidth - util.GAP;
28
- moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
29
- moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
30
- }
31
- };
32
- const update = () => {
33
- const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
34
- if (!wrap)
35
- return;
36
- const offsetHeight = wrap.offsetHeight - util.GAP;
37
- const offsetWidth = wrap.offsetWidth - util.GAP;
38
- const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
39
- const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
40
- const height = Math.max(originalHeight, props.minSize);
41
- const width = Math.max(originalWidth, props.minSize);
42
- ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
43
- ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
44
- sizeHeight.value = height + util.GAP < offsetHeight ? `${height}px` : "";
45
- sizeWidth.value = width + util.GAP < offsetWidth ? `${width}px` : "";
46
- };
47
- expose({
48
- handleScroll,
49
- update
50
- });
51
- return (_ctx, _cache) => {
52
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
53
- vue.createVNode(thumb["default"], {
54
- move: moveX.value,
55
- ratio: ratioX.value,
56
- size: sizeWidth.value,
57
- always: _ctx.always
58
- }, null, 8, ["move", "ratio", "size", "always"]),
59
- vue.createVNode(thumb["default"], {
60
- move: moveY.value,
61
- ratio: ratioY.value,
62
- size: sizeHeight.value,
63
- vertical: "",
64
- always: _ctx.always
65
- }, null, 8, ["move", "ratio", "size", "always"])
66
- ], 64);
67
- };
7
+ const barProps = runtime.buildProps({
8
+ always: {
9
+ type: Boolean,
10
+ default: true
11
+ },
12
+ minSize: {
13
+ type: Number,
14
+ required: true
68
15
  }
69
16
  });
70
- var Bar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "bar.vue"]]);
71
17
 
72
- exports["default"] = Bar;
18
+ exports.barProps = barProps;
73
19
  //# sourceMappingURL=bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar.js","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"sizeWidth\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"sizeHeight\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\" setup>\nimport { inject, ref } from 'vue'\nimport { GAP } from './util'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\nimport { scrollbarContextKey } from './constants'\n\nconst props = defineProps(barProps)\n\nconst scrollbar = inject(scrollbarContextKey)\n\nconst moveX = ref(0)\nconst moveY = ref(0)\nconst sizeWidth = ref('')\nconst sizeHeight = ref('')\nconst ratioY = ref(1)\nconst ratioX = ref(1)\n\nconst handleScroll = (wrap: HTMLDivElement) => {\n if (wrap) {\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n moveY.value = ((wrap.scrollTop * 100) / offsetHeight) * ratioY.value\n moveX.value = ((wrap.scrollLeft * 100) / offsetWidth) * ratioX.value\n }\n}\n\nconst update = () => {\n const wrap = scrollbar?.wrapElement\n if (!wrap) return\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap.scrollWidth\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n ratioY.value =\n originalHeight /\n (offsetHeight - originalHeight) /\n (height / (offsetHeight - height))\n ratioX.value =\n originalWidth /\n (offsetWidth - originalWidth) /\n (width / (offsetWidth - width))\n\n sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ''\n sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ''\n}\n\ndefineExpose({\n handleScroll,\n update,\n})\n</script>\n"],"names":["inject","scrollbarContextKey","ref","GAP"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAM,MAAA,SAAA,GAAYA,WAAOC,6BAAmB,CAAA,CAAA;AAE5C,IAAM,MAAA,KAAA,GAAQC,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQA,QAAI,CAAC,CAAA,CAAA;AACnB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AA,GAAA,CAAA,aACgB,EAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AAElB,MAAA,MAAA,CAAO,KACL,GAAA,cAAA,IACe,YAAA,GAAA,cAAA,CAAA,UACL,IAAc,YAAA,GAAA,MAAA,CAAA,CAAA,CAAA;AAE1B,MAAA,MAAA,CAAA,qBAA4B,IAAA,WAAqB,GAAA,aAAgB,CAAA,IAAA,KAAA,IAAA,WAAA,GAAA,KAAA,CAAA,CAAA,CAAA;AACjE,MAAA,UAAU,SAAgB,MAAA,GAAAA,QAAA,GAAoB,YAAA,GAAG,SAAY,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AAAA,MAC/D,SAAA,CAAA,KAAA,GAAA,KAAA,GAAAA,QAAA,GAAA,WAAA,GAAA,CAAA,EAAA,KAAA,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AAEA,KAAa,CAAA;AAAA,IACX,MAAA,CAAA;AAAA,MACA,YAAA;AAAA,MACD,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"bar.js","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Bar from './bar.vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n minSize: {\n type: Number,\n required: true,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\n\nexport type BarInstance = InstanceType<typeof Bar>\n"],"names":["buildProps"],"mappings":";;;;;;AACY,MAAC,QAAQ,GAAGA,kBAAU,CAAC;AACnC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,CAAC;;;;"}
@@ -2,18 +2,72 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ var util = require('./util.js');
7
+ var thumb = require('./thumb.js');
8
+ var bar = require('./bar.js');
9
+ var constants = require('./constants.js');
10
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
6
11
 
7
- const barProps = runtime.buildProps({
8
- always: {
9
- type: Boolean,
10
- default: true
11
- },
12
- minSize: {
13
- type: Number,
14
- required: true
12
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
13
+ __name: "bar",
14
+ props: bar.barProps,
15
+ setup(__props, { expose }) {
16
+ const props = __props;
17
+ const scrollbar = vue.inject(constants.scrollbarContextKey);
18
+ const moveX = vue.ref(0);
19
+ const moveY = vue.ref(0);
20
+ const sizeWidth = vue.ref("");
21
+ const sizeHeight = vue.ref("");
22
+ const ratioY = vue.ref(1);
23
+ const ratioX = vue.ref(1);
24
+ const handleScroll = (wrap) => {
25
+ if (wrap) {
26
+ const offsetHeight = wrap.offsetHeight - util.GAP;
27
+ const offsetWidth = wrap.offsetWidth - util.GAP;
28
+ moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
29
+ moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
30
+ }
31
+ };
32
+ const update = () => {
33
+ const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
34
+ if (!wrap)
35
+ return;
36
+ const offsetHeight = wrap.offsetHeight - util.GAP;
37
+ const offsetWidth = wrap.offsetWidth - util.GAP;
38
+ const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
39
+ const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
40
+ const height = Math.max(originalHeight, props.minSize);
41
+ const width = Math.max(originalWidth, props.minSize);
42
+ ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
43
+ ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
44
+ sizeHeight.value = height + util.GAP < offsetHeight ? `${height}px` : "";
45
+ sizeWidth.value = width + util.GAP < offsetWidth ? `${width}px` : "";
46
+ };
47
+ expose({
48
+ handleScroll,
49
+ update
50
+ });
51
+ return (_ctx, _cache) => {
52
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
53
+ vue.createVNode(thumb["default"], {
54
+ move: moveX.value,
55
+ ratio: ratioX.value,
56
+ size: sizeWidth.value,
57
+ always: _ctx.always
58
+ }, null, 8, ["move", "ratio", "size", "always"]),
59
+ vue.createVNode(thumb["default"], {
60
+ move: moveY.value,
61
+ ratio: ratioY.value,
62
+ size: sizeHeight.value,
63
+ vertical: "",
64
+ always: _ctx.always
65
+ }, null, 8, ["move", "ratio", "size", "always"])
66
+ ], 64);
67
+ };
15
68
  }
16
69
  });
70
+ var Bar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "bar.vue"]]);
17
71
 
18
- exports.barProps = barProps;
72
+ exports["default"] = Bar;
19
73
  //# sourceMappingURL=bar2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar2.js","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Bar from './bar.vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n minSize: {\n type: Number,\n required: true,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\n\nexport type BarInstance = InstanceType<typeof Bar>\n"],"names":["buildProps"],"mappings":";;;;;;AACY,MAAC,QAAQ,GAAGA,kBAAU,CAAC;AACnC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"bar2.js","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"sizeWidth\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"sizeHeight\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\" setup>\nimport { inject, ref } from 'vue'\nimport { GAP } from './util'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\nimport { scrollbarContextKey } from './constants'\n\nconst props = defineProps(barProps)\n\nconst scrollbar = inject(scrollbarContextKey)\n\nconst moveX = ref(0)\nconst moveY = ref(0)\nconst sizeWidth = ref('')\nconst sizeHeight = ref('')\nconst ratioY = ref(1)\nconst ratioX = ref(1)\n\nconst handleScroll = (wrap: HTMLDivElement) => {\n if (wrap) {\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n moveY.value = ((wrap.scrollTop * 100) / offsetHeight) * ratioY.value\n moveX.value = ((wrap.scrollLeft * 100) / offsetWidth) * ratioX.value\n }\n}\n\nconst update = () => {\n const wrap = scrollbar?.wrapElement\n if (!wrap) return\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap.scrollWidth\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n ratioY.value =\n originalHeight /\n (offsetHeight - originalHeight) /\n (height / (offsetHeight - height))\n ratioX.value =\n originalWidth /\n (offsetWidth - originalWidth) /\n (width / (offsetWidth - width))\n\n sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ''\n sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ''\n}\n\ndefineExpose({\n handleScroll,\n update,\n})\n</script>\n"],"names":["inject","scrollbarContextKey","ref","GAP"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAM,M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,IAAA,CAAA,QAAsB,WAAO,CAAA;AACrD,MAAA,MAAM,MAAQ,GAAA,IAAK,CAAI,GAAA,CAAA,cAAe,OAAa,CAAA,OAAA,CAAA,CAAA;AAEnD,MAAA,MAAA,KACE,GAAA,IAAA,CAAA,GAAA,CAAA,aACgB,EAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AAElB,MAAA,MAAA,CAAO,KACL,GAAA,cAAA,IACe,YAAA,GAAA,cAAA,CAAA,UACL,IAAc,YAAA,GAAA,MAAA,CAAA,CAAA,CAAA;AAE1B,MAAA,MAAA,CAAA,qBAA4B,IAAA,WAAqB,GAAA,aAAgB,CAAA,IAAA,KAAA,IAAA,WAAA,GAAA,KAAA,CAAA,CAAA,CAAA;AACjE,MAAA,UAAU,SAAgB,MAAA,GAAAA,QAAA,GAAoB,YAAA,GAAG,SAAY,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AAAA,MAC/D,SAAA,CAAA,KAAA,GAAA,KAAA,GAAAA,QAAA,GAAA,WAAA,GAAA,CAAA,EAAA,KAAA,CAAA,EAAA,CAAA,GAAA,EAAA,CAAA;AAEA,KAAa,CAAA;AAAA,IACX,MAAA,CAAA;AAAA,MACA,YAAA;AAAA,MACD,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var core = require('@vueuse/core');
7
- var bar = require('./bar.js');
7
+ var bar = require('./bar2.js');
8
8
  var constants = require('./constants.js');
9
9
  var scrollbar = require('./scrollbar.js');
10
10
  var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
@@ -2,18 +2,136 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ var core = require('@vueuse/core');
7
+ var constants = require('./constants.js');
8
+ var util = require('./util.js');
9
+ var thumb = require('./thumb2.js');
10
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
+ var index = require('../../../hooks/use-namespace/index.js');
12
+ var error = require('../../../utils/error.js');
6
13
 
7
- const thumbProps = runtime.buildProps({
8
- vertical: Boolean,
9
- size: String,
10
- move: Number,
11
- ratio: {
12
- type: Number,
13
- required: true
14
- },
15
- always: Boolean
14
+ const COMPONENT_NAME = "Thumb";
15
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
16
+ __name: "thumb",
17
+ props: thumb.thumbProps,
18
+ setup(__props) {
19
+ const props = __props;
20
+ const scrollbar = vue.inject(constants.scrollbarContextKey);
21
+ const ns = index.useNamespace("scrollbar");
22
+ if (!scrollbar)
23
+ error.throwError(COMPONENT_NAME, "can not inject scrollbar context");
24
+ const instance = vue.ref();
25
+ const thumb = vue.ref();
26
+ const thumbState = vue.ref({});
27
+ const visible = vue.ref(false);
28
+ let cursorDown = false;
29
+ let cursorLeave = false;
30
+ let originalOnSelectStart = core.isClient ? document.onselectstart : null;
31
+ const bar = vue.computed(() => util.BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
32
+ const thumbStyle = vue.computed(() => util.renderThumbStyle({
33
+ size: props.size,
34
+ move: props.move,
35
+ bar: bar.value
36
+ }));
37
+ const offsetRatio = vue.computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
38
+ const clickThumbHandler = (e) => {
39
+ var _a;
40
+ e.stopPropagation();
41
+ if (e.ctrlKey || [1, 2].includes(e.button))
42
+ return;
43
+ (_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();
44
+ startDrag(e);
45
+ const el = e.currentTarget;
46
+ if (!el)
47
+ return;
48
+ thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
49
+ };
50
+ const clickTrackHandler = (e) => {
51
+ if (!thumb.value || !instance.value || !scrollbar.wrapElement)
52
+ return;
53
+ const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
54
+ const thumbHalf = thumb.value[bar.value.offset] / 2;
55
+ const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
56
+ scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
57
+ };
58
+ const startDrag = (e) => {
59
+ e.stopImmediatePropagation();
60
+ cursorDown = true;
61
+ document.addEventListener("mousemove", mouseMoveDocumentHandler);
62
+ document.addEventListener("mouseup", mouseUpDocumentHandler);
63
+ originalOnSelectStart = document.onselectstart;
64
+ document.onselectstart = () => false;
65
+ };
66
+ const mouseMoveDocumentHandler = (e) => {
67
+ if (!instance.value || !thumb.value)
68
+ return;
69
+ if (cursorDown === false)
70
+ return;
71
+ const prevPage = thumbState.value[bar.value.axis];
72
+ if (!prevPage)
73
+ return;
74
+ const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
75
+ const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
76
+ const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
77
+ scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
78
+ };
79
+ const mouseUpDocumentHandler = () => {
80
+ cursorDown = false;
81
+ thumbState.value[bar.value.axis] = 0;
82
+ document.removeEventListener("mousemove", mouseMoveDocumentHandler);
83
+ document.removeEventListener("mouseup", mouseUpDocumentHandler);
84
+ restoreOnselectstart();
85
+ if (cursorLeave)
86
+ visible.value = false;
87
+ };
88
+ const mouseMoveScrollbarHandler = () => {
89
+ cursorLeave = false;
90
+ visible.value = !!props.size;
91
+ };
92
+ const mouseLeaveScrollbarHandler = () => {
93
+ cursorLeave = true;
94
+ visible.value = cursorDown;
95
+ };
96
+ vue.onBeforeUnmount(() => {
97
+ restoreOnselectstart();
98
+ document.removeEventListener("mouseup", mouseUpDocumentHandler);
99
+ });
100
+ const restoreOnselectstart = () => {
101
+ if (document.onselectstart !== originalOnSelectStart)
102
+ document.onselectstart = originalOnSelectStart;
103
+ };
104
+ core.useEventListener(vue.toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
105
+ core.useEventListener(vue.toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
106
+ return (_ctx, _cache) => {
107
+ return vue.openBlock(), vue.createBlock(vue.Transition, {
108
+ name: vue.unref(ns).b("fade"),
109
+ persisted: ""
110
+ }, {
111
+ default: vue.withCtx(() => [
112
+ vue.withDirectives(vue.createElementVNode("div", {
113
+ ref_key: "instance",
114
+ ref: instance,
115
+ class: vue.normalizeClass([vue.unref(ns).e("bar"), vue.unref(ns).is(vue.unref(bar).key)]),
116
+ onMousedown: clickTrackHandler
117
+ }, [
118
+ vue.createElementVNode("div", {
119
+ ref_key: "thumb",
120
+ ref: thumb,
121
+ class: vue.normalizeClass(vue.unref(ns).e("thumb")),
122
+ style: vue.normalizeStyle(vue.unref(thumbStyle)),
123
+ onMousedown: clickThumbHandler
124
+ }, null, 38)
125
+ ], 34), [
126
+ [vue.vShow, _ctx.always || visible.value]
127
+ ])
128
+ ]),
129
+ _: 1
130
+ }, 8, ["name"]);
131
+ };
132
+ }
16
133
  });
134
+ var Thumb = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "thumb.vue"]]);
17
135
 
18
- exports.thumbProps = thumbProps;
136
+ exports["default"] = Thumb;
19
137
  //# sourceMappingURL=thumb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"thumb.js","sources":["../../../../../../packages/components/scrollbar/src/thumb.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Thumb from './thumb.vue'\n\nexport const thumbProps = buildProps({\n vertical: Boolean,\n size: String,\n move: Number,\n ratio: {\n type: Number,\n required: true,\n },\n always: Boolean,\n} as const)\nexport type ThumbProps = ExtractPropTypes<typeof thumbProps>\n\nexport type ThumbInstance = InstanceType<typeof Thumb>\n"],"names":["buildProps"],"mappings":";;;;;;AACY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,CAAC;;;;"}
1
+ {"version":3,"file":"thumb.js","sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n />\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, ref, toRef } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { isClient, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { scrollbarContextKey } from './constants'\nimport { BAR_MAP, renderThumbStyle } from './util'\nimport { thumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nconst props = defineProps(thumbProps)\n\nconst scrollbar = inject(scrollbarContextKey)\nconst ns = useNamespace('scrollbar')\n\nif (!scrollbar) throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\nconst instance = ref<HTMLDivElement>()\nconst thumb = ref<HTMLDivElement>()\n\nconst thumbState = ref<Partial<Record<'X' | 'Y', number>>>({})\nconst visible = ref(false)\n\nlet cursorDown = false\nlet cursorLeave = false\nlet originalOnSelectStart:\n | ((this: GlobalEventHandlers, ev: Event) => any)\n | null = isClient ? document.onselectstart : null\n\nconst bar = computed(() => BAR_MAP[props.vertical ? 'vertical' : 'horizontal'])\n\nconst thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n)\n\nconst offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n)\n\nconst clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n}\n\nconst clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n}\n\nconst mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n}\n\nconst mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n}\n\nconst mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n}\n\nonBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n})\n\nconst restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n}\n\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n)\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n)\n</script>\n"],"names":["inject","scrollbarContextKey","useNamespace","throwError","ref","isClient","computed","BAR_MAP","renderThumbStyle","onBeforeUnmount","useEventListener","toRef","_createBlock","_Transition","_unref","_withCtx","_withDirectives","_createElementVNode","_normalizeClass"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,MAAA,SAAA,GAAYA,WAAOC,6BAAmB,CAAA,CAAA;AAC5C,IAAM,MAAA,EAAA,GAAKC,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,CAAC,SAAA;AAEL,MAAAC,+BAAqC,EAAA,k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eAAA,CAAAC,cAAA,EAAA;AAAA,QACnC,IAAA,EAAAC,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA;AAAA,QACA,SAAA,EAAA,EAAA;AAAA,OACF,EAAA;AACA,QAAA,OAAA,EAAAC,WAAA,CAAA,MAAA;AAAA,UACEC,kBAAmC,CAAAC,sBAAA,CAAA,KAAA,EAAA;AAAA,YACnC,OAAA,EAAA,UAAA;AAAA,YACA,GAAA,EAAA,QAAA;AAAA,YACF,KAAA,EAAAC,kBAAA,CAAA,CAAAJ,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,EAAAA,SAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,136 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var core = require('@vueuse/core');
7
- var constants = require('./constants.js');
8
- var util = require('./util.js');
9
- var thumb = require('./thumb.js');
10
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
- var index = require('../../../hooks/use-namespace/index.js');
12
- var error = require('../../../utils/error.js');
5
+ var runtime = require('../../../utils/vue/props/runtime.js');
13
6
 
14
- const COMPONENT_NAME = "Thumb";
15
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
16
- __name: "thumb",
17
- props: thumb.thumbProps,
18
- setup(__props) {
19
- const props = __props;
20
- const scrollbar = vue.inject(constants.scrollbarContextKey);
21
- const ns = index.useNamespace("scrollbar");
22
- if (!scrollbar)
23
- error.throwError(COMPONENT_NAME, "can not inject scrollbar context");
24
- const instance = vue.ref();
25
- const thumb = vue.ref();
26
- const thumbState = vue.ref({});
27
- const visible = vue.ref(false);
28
- let cursorDown = false;
29
- let cursorLeave = false;
30
- let originalOnSelectStart = core.isClient ? document.onselectstart : null;
31
- const bar = vue.computed(() => util.BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
32
- const thumbStyle = vue.computed(() => util.renderThumbStyle({
33
- size: props.size,
34
- move: props.move,
35
- bar: bar.value
36
- }));
37
- const offsetRatio = vue.computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
38
- const clickThumbHandler = (e) => {
39
- var _a;
40
- e.stopPropagation();
41
- if (e.ctrlKey || [1, 2].includes(e.button))
42
- return;
43
- (_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();
44
- startDrag(e);
45
- const el = e.currentTarget;
46
- if (!el)
47
- return;
48
- thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
49
- };
50
- const clickTrackHandler = (e) => {
51
- if (!thumb.value || !instance.value || !scrollbar.wrapElement)
52
- return;
53
- const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
54
- const thumbHalf = thumb.value[bar.value.offset] / 2;
55
- const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
56
- scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
57
- };
58
- const startDrag = (e) => {
59
- e.stopImmediatePropagation();
60
- cursorDown = true;
61
- document.addEventListener("mousemove", mouseMoveDocumentHandler);
62
- document.addEventListener("mouseup", mouseUpDocumentHandler);
63
- originalOnSelectStart = document.onselectstart;
64
- document.onselectstart = () => false;
65
- };
66
- const mouseMoveDocumentHandler = (e) => {
67
- if (!instance.value || !thumb.value)
68
- return;
69
- if (cursorDown === false)
70
- return;
71
- const prevPage = thumbState.value[bar.value.axis];
72
- if (!prevPage)
73
- return;
74
- const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
75
- const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
76
- const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
77
- scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
78
- };
79
- const mouseUpDocumentHandler = () => {
80
- cursorDown = false;
81
- thumbState.value[bar.value.axis] = 0;
82
- document.removeEventListener("mousemove", mouseMoveDocumentHandler);
83
- document.removeEventListener("mouseup", mouseUpDocumentHandler);
84
- restoreOnselectstart();
85
- if (cursorLeave)
86
- visible.value = false;
87
- };
88
- const mouseMoveScrollbarHandler = () => {
89
- cursorLeave = false;
90
- visible.value = !!props.size;
91
- };
92
- const mouseLeaveScrollbarHandler = () => {
93
- cursorLeave = true;
94
- visible.value = cursorDown;
95
- };
96
- vue.onBeforeUnmount(() => {
97
- restoreOnselectstart();
98
- document.removeEventListener("mouseup", mouseUpDocumentHandler);
99
- });
100
- const restoreOnselectstart = () => {
101
- if (document.onselectstart !== originalOnSelectStart)
102
- document.onselectstart = originalOnSelectStart;
103
- };
104
- core.useEventListener(vue.toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
105
- core.useEventListener(vue.toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
106
- return (_ctx, _cache) => {
107
- return vue.openBlock(), vue.createBlock(vue.Transition, {
108
- name: vue.unref(ns).b("fade"),
109
- persisted: ""
110
- }, {
111
- default: vue.withCtx(() => [
112
- vue.withDirectives(vue.createElementVNode("div", {
113
- ref_key: "instance",
114
- ref: instance,
115
- class: vue.normalizeClass([vue.unref(ns).e("bar"), vue.unref(ns).is(vue.unref(bar).key)]),
116
- onMousedown: clickTrackHandler
117
- }, [
118
- vue.createElementVNode("div", {
119
- ref_key: "thumb",
120
- ref: thumb,
121
- class: vue.normalizeClass(vue.unref(ns).e("thumb")),
122
- style: vue.normalizeStyle(vue.unref(thumbStyle)),
123
- onMousedown: clickThumbHandler
124
- }, null, 38)
125
- ], 34), [
126
- [vue.vShow, _ctx.always || visible.value]
127
- ])
128
- ]),
129
- _: 1
130
- }, 8, ["name"]);
131
- };
132
- }
7
+ const thumbProps = runtime.buildProps({
8
+ vertical: Boolean,
9
+ size: String,
10
+ move: Number,
11
+ ratio: {
12
+ type: Number,
13
+ required: true
14
+ },
15
+ always: Boolean
133
16
  });
134
- var Thumb = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "thumb.vue"]]);
135
17
 
136
- exports["default"] = Thumb;
18
+ exports.thumbProps = thumbProps;
137
19
  //# sourceMappingURL=thumb2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"thumb2.js","sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n />\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, ref, toRef } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { isClient, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { scrollbarContextKey } from './constants'\nimport { BAR_MAP, renderThumbStyle } from './util'\nimport { thumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nconst props = defineProps(thumbProps)\n\nconst scrollbar = inject(scrollbarContextKey)\nconst ns = useNamespace('scrollbar')\n\nif (!scrollbar) throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\nconst instance = ref<HTMLDivElement>()\nconst thumb = ref<HTMLDivElement>()\n\nconst thumbState = ref<Partial<Record<'X' | 'Y', number>>>({})\nconst visible = ref(false)\n\nlet cursorDown = false\nlet cursorLeave = false\nlet originalOnSelectStart:\n | ((this: GlobalEventHandlers, ev: Event) => any)\n | null = isClient ? document.onselectstart : null\n\nconst bar = computed(() => BAR_MAP[props.vertical ? 'vertical' : 'horizontal'])\n\nconst thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n)\n\nconst offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n)\n\nconst clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n}\n\nconst clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n}\n\nconst mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n}\n\nconst mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n}\n\nconst mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n}\n\nconst mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n}\n\nonBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n})\n\nconst restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n}\n\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n)\nuseEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n)\n</script>\n"],"names":["inject","scrollbarContextKey","useNamespace","throwError","ref","isClient","computed","BAR_MAP","renderThumbStyle","onBeforeUnmount","useEventListener","toRef","_createBlock","_Transition","_unref","_withCtx","_withDirectives","_createElementVNode","_normalizeClass"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,MAAA,SAAA,GAAYA,WAAOC,6BAAmB,CAAA,CAAA;AAC5C,IAAM,MAAA,EAAA,GAAKC,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,CAAC,SAAA;AAEL,MAAAC,+BAAqC,EAAA,kCAAA,CAAA,CAAA;A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EAAA;AAAA,QACnC,IAAA,EAAAC,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA;AAAA,QACA,SAAA,EAAA,EAAA;AAAA,OACF,EAAA;AACA,QAAA,OAAA,EAAAC,WAAA,CAAA,MAAA;AAAA,UACEC,kBAAmC,CAAAC,sBAAA,CAAA,KAAA,EAAA;AAAA,YACnC,OAAA,EAAA,UAAA;AAAA,YACA,GAAA,EAAA,QAAA;AAAA,YACF,KAAA,EAAAC,kBAAA,CAAA,CAAAJ,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,EAAAA,SAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"thumb2.js","sources":["../../../../../../packages/components/scrollbar/src/thumb.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Thumb from './thumb.vue'\n\nexport const thumbProps = buildProps({\n vertical: Boolean,\n size: String,\n move: Number,\n ratio: {\n type: Number,\n required: true,\n },\n always: Boolean,\n} as const)\nexport type ThumbProps = ExtractPropTypes<typeof thumbProps>\n\nexport type ThumbInstance = InstanceType<typeof Thumb>\n"],"names":["buildProps"],"mappings":";;;;;;AACY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,CAAC;;;;"}
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var slider$1 = require('./src/slider.js');
6
- var slider = require('./src/slider2.js');
5
+ var slider$1 = require('./src/slider2.js');
6
+ var slider = require('./src/slider.js');
7
7
  var constants = require('./src/constants.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9