element-plus 2.2.12 → 2.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +926 -725
  4. package/dist/index.full.min.js +16 -16
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +17 -17
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +927 -726
  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.js +1 -1
  14. package/dist/locale/ar.min.js +1 -1
  15. package/dist/locale/ar.min.mjs +1 -1
  16. package/dist/locale/ar.mjs +1 -1
  17. package/dist/locale/az.js +1 -1
  18. package/dist/locale/az.min.js +1 -1
  19. package/dist/locale/az.min.mjs +1 -1
  20. package/dist/locale/az.mjs +1 -1
  21. package/dist/locale/bg.js +1 -1
  22. package/dist/locale/bg.min.js +1 -1
  23. package/dist/locale/bg.min.mjs +1 -1
  24. package/dist/locale/bg.mjs +1 -1
  25. package/dist/locale/bn.js +1 -1
  26. package/dist/locale/bn.min.js +1 -1
  27. package/dist/locale/bn.min.mjs +1 -1
  28. package/dist/locale/bn.mjs +1 -1
  29. package/dist/locale/ca.js +1 -1
  30. package/dist/locale/ca.min.js +1 -1
  31. package/dist/locale/ca.min.mjs +1 -1
  32. package/dist/locale/ca.mjs +1 -1
  33. package/dist/locale/cs.js +1 -1
  34. package/dist/locale/cs.min.js +1 -1
  35. package/dist/locale/cs.min.mjs +1 -1
  36. package/dist/locale/cs.mjs +1 -1
  37. package/dist/locale/da.js +1 -1
  38. package/dist/locale/da.min.js +1 -1
  39. package/dist/locale/da.min.mjs +1 -1
  40. package/dist/locale/da.mjs +1 -1
  41. package/dist/locale/de.js +1 -1
  42. package/dist/locale/de.min.js +1 -1
  43. package/dist/locale/de.min.mjs +1 -1
  44. package/dist/locale/de.mjs +1 -1
  45. package/dist/locale/el.js +1 -1
  46. package/dist/locale/el.min.js +1 -1
  47. package/dist/locale/el.min.mjs +1 -1
  48. package/dist/locale/el.mjs +1 -1
  49. package/dist/locale/en.js +1 -1
  50. package/dist/locale/en.min.js +1 -1
  51. package/dist/locale/en.min.mjs +1 -1
  52. package/dist/locale/en.mjs +1 -1
  53. package/dist/locale/eo.js +1 -1
  54. package/dist/locale/eo.min.js +1 -1
  55. package/dist/locale/eo.min.mjs +1 -1
  56. package/dist/locale/eo.mjs +1 -1
  57. package/dist/locale/es.js +1 -1
  58. package/dist/locale/es.min.js +1 -1
  59. package/dist/locale/es.min.mjs +1 -1
  60. package/dist/locale/es.mjs +1 -1
  61. package/dist/locale/et.js +1 -1
  62. package/dist/locale/et.min.js +1 -1
  63. package/dist/locale/et.min.mjs +1 -1
  64. package/dist/locale/et.mjs +1 -1
  65. package/dist/locale/eu.js +1 -1
  66. package/dist/locale/eu.min.js +1 -1
  67. package/dist/locale/eu.min.mjs +1 -1
  68. package/dist/locale/eu.mjs +1 -1
  69. package/dist/locale/fa.js +1 -1
  70. package/dist/locale/fa.min.js +1 -1
  71. package/dist/locale/fa.min.mjs +1 -1
  72. package/dist/locale/fa.mjs +1 -1
  73. package/dist/locale/fi.js +1 -1
  74. package/dist/locale/fi.min.js +1 -1
  75. package/dist/locale/fi.min.mjs +1 -1
  76. package/dist/locale/fi.mjs +1 -1
  77. package/dist/locale/fr.js +1 -1
  78. package/dist/locale/fr.min.js +1 -1
  79. package/dist/locale/fr.min.mjs +1 -1
  80. package/dist/locale/fr.mjs +1 -1
  81. package/dist/locale/he.js +1 -1
  82. package/dist/locale/he.min.js +1 -1
  83. package/dist/locale/he.min.mjs +1 -1
  84. package/dist/locale/he.mjs +1 -1
  85. package/dist/locale/hr.js +1 -1
  86. package/dist/locale/hr.min.js +1 -1
  87. package/dist/locale/hr.min.mjs +1 -1
  88. package/dist/locale/hr.mjs +1 -1
  89. package/dist/locale/hu.js +1 -1
  90. package/dist/locale/hu.min.js +1 -1
  91. package/dist/locale/hu.min.mjs +1 -1
  92. package/dist/locale/hu.mjs +1 -1
  93. package/dist/locale/hy-am.js +1 -1
  94. package/dist/locale/hy-am.min.js +1 -1
  95. package/dist/locale/hy-am.min.mjs +1 -1
  96. package/dist/locale/hy-am.mjs +1 -1
  97. package/dist/locale/id.js +1 -1
  98. package/dist/locale/id.min.js +1 -1
  99. package/dist/locale/id.min.mjs +1 -1
  100. package/dist/locale/id.mjs +1 -1
  101. package/dist/locale/it.js +1 -1
  102. package/dist/locale/it.min.js +1 -1
  103. package/dist/locale/it.min.mjs +1 -1
  104. package/dist/locale/it.mjs +1 -1
  105. package/dist/locale/ja.js +1 -1
  106. package/dist/locale/ja.min.js +1 -1
  107. package/dist/locale/ja.min.mjs +1 -1
  108. package/dist/locale/ja.mjs +1 -1
  109. package/dist/locale/kk.js +1 -1
  110. package/dist/locale/kk.min.js +1 -1
  111. package/dist/locale/kk.min.mjs +1 -1
  112. package/dist/locale/kk.mjs +1 -1
  113. package/dist/locale/km.js +1 -1
  114. package/dist/locale/km.min.js +1 -1
  115. package/dist/locale/km.min.mjs +1 -1
  116. package/dist/locale/km.mjs +1 -1
  117. package/dist/locale/ko.js +1 -1
  118. package/dist/locale/ko.min.js +1 -1
  119. package/dist/locale/ko.min.mjs +1 -1
  120. package/dist/locale/ko.mjs +1 -1
  121. package/dist/locale/ku.js +1 -1
  122. package/dist/locale/ku.min.js +1 -1
  123. package/dist/locale/ku.min.mjs +1 -1
  124. package/dist/locale/ku.mjs +1 -1
  125. package/dist/locale/ky.js +1 -1
  126. package/dist/locale/ky.min.js +1 -1
  127. package/dist/locale/ky.min.mjs +1 -1
  128. package/dist/locale/ky.mjs +1 -1
  129. package/dist/locale/lt.js +1 -1
  130. package/dist/locale/lt.min.js +1 -1
  131. package/dist/locale/lt.min.mjs +1 -1
  132. package/dist/locale/lt.mjs +1 -1
  133. package/dist/locale/lv.js +1 -1
  134. package/dist/locale/lv.min.js +1 -1
  135. package/dist/locale/lv.min.mjs +1 -1
  136. package/dist/locale/lv.mjs +1 -1
  137. package/dist/locale/mg.js +1 -1
  138. package/dist/locale/mg.min.js +1 -1
  139. package/dist/locale/mg.min.mjs +1 -1
  140. package/dist/locale/mg.mjs +1 -1
  141. package/dist/locale/mn.js +1 -1
  142. package/dist/locale/mn.min.js +1 -1
  143. package/dist/locale/mn.min.mjs +1 -1
  144. package/dist/locale/mn.mjs +1 -1
  145. package/dist/locale/nb-no.js +1 -1
  146. package/dist/locale/nb-no.min.js +1 -1
  147. package/dist/locale/nb-no.min.mjs +1 -1
  148. package/dist/locale/nb-no.mjs +1 -1
  149. package/dist/locale/nl.js +1 -1
  150. package/dist/locale/nl.min.js +1 -1
  151. package/dist/locale/nl.min.mjs +1 -1
  152. package/dist/locale/nl.mjs +1 -1
  153. package/dist/locale/pa.js +1 -1
  154. package/dist/locale/pa.min.js +1 -1
  155. package/dist/locale/pa.min.mjs +1 -1
  156. package/dist/locale/pa.mjs +1 -1
  157. package/dist/locale/pl.js +1 -1
  158. package/dist/locale/pl.min.js +1 -1
  159. package/dist/locale/pl.min.mjs +1 -1
  160. package/dist/locale/pl.mjs +1 -1
  161. package/dist/locale/pt-br.js +1 -1
  162. package/dist/locale/pt-br.min.js +1 -1
  163. package/dist/locale/pt-br.min.mjs +1 -1
  164. package/dist/locale/pt-br.mjs +1 -1
  165. package/dist/locale/pt.js +1 -1
  166. package/dist/locale/pt.min.js +1 -1
  167. package/dist/locale/pt.min.mjs +1 -1
  168. package/dist/locale/pt.mjs +1 -1
  169. package/dist/locale/ro.js +1 -1
  170. package/dist/locale/ro.min.js +1 -1
  171. package/dist/locale/ro.min.mjs +1 -1
  172. package/dist/locale/ro.mjs +1 -1
  173. package/dist/locale/ru.js +1 -1
  174. package/dist/locale/ru.min.js +1 -1
  175. package/dist/locale/ru.min.mjs +1 -1
  176. package/dist/locale/ru.mjs +1 -1
  177. package/dist/locale/sk.js +1 -1
  178. package/dist/locale/sk.min.js +1 -1
  179. package/dist/locale/sk.min.mjs +1 -1
  180. package/dist/locale/sk.mjs +1 -1
  181. package/dist/locale/sl.js +1 -1
  182. package/dist/locale/sl.min.js +1 -1
  183. package/dist/locale/sl.min.mjs +1 -1
  184. package/dist/locale/sl.mjs +1 -1
  185. package/dist/locale/sr.js +1 -1
  186. package/dist/locale/sr.min.js +1 -1
  187. package/dist/locale/sr.min.mjs +1 -1
  188. package/dist/locale/sr.mjs +1 -1
  189. package/dist/locale/sv.js +1 -1
  190. package/dist/locale/sv.min.js +1 -1
  191. package/dist/locale/sv.min.mjs +1 -1
  192. package/dist/locale/sv.mjs +1 -1
  193. package/dist/locale/ta.js +1 -1
  194. package/dist/locale/ta.min.js +1 -1
  195. package/dist/locale/ta.min.mjs +1 -1
  196. package/dist/locale/ta.mjs +1 -1
  197. package/dist/locale/th.js +1 -1
  198. package/dist/locale/th.min.js +1 -1
  199. package/dist/locale/th.min.mjs +1 -1
  200. package/dist/locale/th.mjs +1 -1
  201. package/dist/locale/tk.js +1 -1
  202. package/dist/locale/tk.min.js +1 -1
  203. package/dist/locale/tk.min.mjs +1 -1
  204. package/dist/locale/tk.mjs +1 -1
  205. package/dist/locale/tr.js +1 -1
  206. package/dist/locale/tr.min.js +1 -1
  207. package/dist/locale/tr.min.mjs +1 -1
  208. package/dist/locale/tr.mjs +1 -1
  209. package/dist/locale/ug-cn.js +1 -1
  210. package/dist/locale/ug-cn.min.js +1 -1
  211. package/dist/locale/ug-cn.min.mjs +1 -1
  212. package/dist/locale/ug-cn.mjs +1 -1
  213. package/dist/locale/uk.js +1 -1
  214. package/dist/locale/uk.min.js +1 -1
  215. package/dist/locale/uk.min.mjs +1 -1
  216. package/dist/locale/uk.mjs +1 -1
  217. package/dist/locale/uz-uz.js +1 -1
  218. package/dist/locale/uz-uz.min.js +1 -1
  219. package/dist/locale/uz-uz.min.mjs +1 -1
  220. package/dist/locale/uz-uz.mjs +1 -1
  221. package/dist/locale/vi.js +1 -1
  222. package/dist/locale/vi.min.js +1 -1
  223. package/dist/locale/vi.min.mjs +1 -1
  224. package/dist/locale/vi.mjs +1 -1
  225. package/dist/locale/zh-cn.js +1 -1
  226. package/dist/locale/zh-cn.min.js +1 -1
  227. package/dist/locale/zh-cn.min.mjs +1 -1
  228. package/dist/locale/zh-cn.mjs +1 -1
  229. package/dist/locale/zh-tw.js +47 -12
  230. package/dist/locale/zh-tw.min.js +1 -1
  231. package/dist/locale/zh-tw.min.js.map +1 -1
  232. package/dist/locale/zh-tw.min.mjs +1 -1
  233. package/dist/locale/zh-tw.min.mjs.map +1 -1
  234. package/dist/locale/zh-tw.mjs +47 -12
  235. package/es/components/carousel/index.d.ts +1 -1
  236. package/es/components/carousel/src/carousel.vue.d.ts +1 -1
  237. package/es/components/cascader/index.d.ts +2 -2
  238. package/es/components/cascader/src/index.mjs +15 -12
  239. package/es/components/cascader/src/index.mjs.map +1 -1
  240. package/es/components/cascader/src/index.vue.d.ts +42 -43
  241. package/es/components/checkbox/index.d.ts +2 -2
  242. package/es/components/checkbox/src/checkbox-group.mjs +3 -3
  243. package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
  244. package/es/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
  245. package/es/components/checkbox/src/checkbox.d.ts +4 -5
  246. package/es/components/checkbox/src/checkbox.mjs +6 -10
  247. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  248. package/es/components/color-picker/src/index.mjs +10 -15
  249. package/es/components/color-picker/src/index.mjs.map +1 -1
  250. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +1 -0
  251. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +1 -0
  252. package/es/components/date-picker/src/panel-utils.d.ts +2 -0
  253. package/es/components/dialog/src/use-dialog.mjs +1 -1
  254. package/es/components/dialog/src/use-dialog.mjs.map +1 -1
  255. package/es/components/form/index.d.ts +4 -0
  256. package/es/components/form/src/form-item2.mjs +1 -0
  257. package/es/components/form/src/form-item2.mjs.map +1 -1
  258. package/es/components/form/src/form.d.ts +1 -0
  259. package/es/components/form/src/form.mjs +5 -0
  260. package/es/components/form/src/form.mjs.map +1 -1
  261. package/es/components/form/src/form.vue.d.ts +4 -0
  262. package/es/components/index.mjs +1 -1
  263. package/es/components/menu/index.d.ts +224 -0
  264. package/es/components/menu/src/menu.mjs +39 -17
  265. package/es/components/menu/src/menu.mjs.map +1 -1
  266. package/es/components/menu/src/sub-menu.d.ts +138 -2
  267. package/es/components/menu/src/sub-menu.mjs +18 -3
  268. package/es/components/menu/src/sub-menu.mjs.map +1 -1
  269. package/es/components/message/src/instance.mjs +1 -1
  270. package/es/components/message/src/instance.mjs.map +1 -1
  271. package/es/components/message/src/method.mjs +1 -1
  272. package/es/components/message/src/method.mjs.map +1 -1
  273. package/es/components/message-box/src/message-box.type.d.ts +1 -1
  274. package/es/components/message-box/src/messageBox.mjs +10 -9
  275. package/es/components/message-box/src/messageBox.mjs.map +1 -1
  276. package/es/components/notification/src/notification.d.ts +2 -0
  277. package/es/components/notification/src/notification.mjs.map +1 -1
  278. package/es/components/notification/src/notification.vue.d.ts +111 -5
  279. package/es/components/notification/src/notification2.mjs +84 -91
  280. package/es/components/notification/src/notification2.mjs.map +1 -1
  281. package/es/components/notification/src/notify.mjs +2 -2
  282. package/es/components/notification/src/notify.mjs.map +1 -1
  283. package/es/components/page-header/index.d.ts +46 -0
  284. package/es/components/page-header/src/page-header.vue.d.ts +46 -0
  285. package/es/components/page-header/src/page-header2.mjs +70 -28
  286. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  287. package/es/components/pagination/index.d.ts +6 -0
  288. package/es/components/pagination/src/components/next.d.ts +6 -0
  289. package/es/components/pagination/src/components/next.mjs +4 -0
  290. package/es/components/pagination/src/components/next.mjs.map +1 -1
  291. package/es/components/pagination/src/components/next.vue.d.ts +18 -1
  292. package/es/components/pagination/src/components/next2.mjs +2 -3
  293. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  294. package/es/components/pagination/src/components/prev.d.ts +6 -0
  295. package/es/components/pagination/src/components/prev.mjs +4 -0
  296. package/es/components/pagination/src/components/prev.mjs.map +1 -1
  297. package/es/components/pagination/src/components/prev.vue.d.ts +18 -1
  298. package/es/components/pagination/src/components/prev2.mjs +2 -3
  299. package/es/components/pagination/src/components/prev2.mjs.map +1 -1
  300. package/es/components/pagination/src/pagination.d.ts +8 -0
  301. package/es/components/pagination/src/pagination.mjs +12 -0
  302. package/es/components/pagination/src/pagination.mjs.map +1 -1
  303. package/es/components/popconfirm/index.d.ts +7 -0
  304. package/es/components/popconfirm/src/popconfirm.d.ts +1 -0
  305. package/es/components/popconfirm/src/popconfirm.mjs +5 -1
  306. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  307. package/es/components/popconfirm/src/popconfirm.vue.d.ts +454 -447
  308. package/es/components/popconfirm/src/popconfirm2.mjs +14 -5
  309. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  310. package/es/components/popover/src/popover2.mjs +1 -1
  311. package/es/components/popover/src/popover2.mjs.map +1 -1
  312. package/es/components/scrollbar/index.mjs +2 -2
  313. package/es/components/scrollbar/src/scrollbar.mjs +169 -44
  314. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  315. package/es/components/scrollbar/src/scrollbar2.mjs +44 -169
  316. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  317. package/es/components/select/src/useOption.mjs +2 -2
  318. package/es/components/select/src/useOption.mjs.map +1 -1
  319. package/es/components/select/src/useSelect.d.ts +31 -32
  320. package/es/components/select/src/useSelect.mjs +8 -11
  321. package/es/components/select/src/useSelect.mjs.map +1 -1
  322. package/es/components/slider/src/composables/use-marks.mjs +1 -1
  323. package/es/components/slider/src/composables/use-marks.mjs.map +1 -1
  324. package/es/components/slot/src/only-child.mjs +3 -1
  325. package/es/components/slot/src/only-child.mjs.map +1 -1
  326. package/es/components/space/index.d.ts +3 -3
  327. package/es/components/space/src/space.d.ts +5 -4
  328. package/es/components/space/src/space.mjs.map +1 -1
  329. package/es/components/space/src/use-space.d.ts +1 -1
  330. package/es/components/switch/src/switch2.mjs +2 -1
  331. package/es/components/switch/src/switch2.mjs.map +1 -1
  332. package/es/components/table/src/table/style-helper.mjs +11 -9
  333. package/es/components/table/src/table/style-helper.mjs.map +1 -1
  334. package/es/components/table/src/table-body/events-helper.d.ts +1 -3
  335. package/es/components/table/src/table-body/events-helper.mjs +2 -2
  336. package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
  337. package/es/components/table/src/table-body/index.mjs +1 -5
  338. package/es/components/table/src/table-body/index.mjs.map +1 -1
  339. package/es/components/table/src/table-body/render-helper.mjs +2 -2
  340. package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
  341. package/es/components/table/src/table-header/index.mjs +1 -2
  342. package/es/components/table/src/table-header/index.mjs.map +1 -1
  343. package/es/components/table/src/util.mjs +1 -0
  344. package/es/components/table/src/util.mjs.map +1 -1
  345. package/es/components/time-picker/src/common/picker.mjs +6 -9
  346. package/es/components/time-picker/src/common/picker.mjs.map +1 -1
  347. package/es/components/time-picker/src/common/picker.vue.d.ts +21 -22
  348. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.mjs +12 -4
  349. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.mjs.map +1 -1
  350. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -0
  351. package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -0
  352. package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -0
  353. package/es/components/transfer/index.d.ts +10 -10
  354. package/es/components/transfer/src/transfer-panel.vue.d.ts +2 -2
  355. package/es/components/transfer/src/transfer.vue.d.ts +10 -10
  356. package/es/components/tree/src/model/node.mjs +3 -3
  357. package/es/components/tree/src/model/node.mjs.map +1 -1
  358. package/es/components/tree/src/model/tree-store.mjs +2 -2
  359. package/es/components/tree/src/model/tree-store.mjs.map +1 -1
  360. package/es/components/tree-v2/src/composables/useTree.d.ts +4 -0
  361. package/es/components/tree-v2/src/composables/useTree.mjs +21 -7
  362. package/es/components/tree-v2/src/composables/useTree.mjs.map +1 -1
  363. package/es/components/tree-v2/src/tree.mjs +10 -2
  364. package/es/components/tree-v2/src/tree.mjs.map +1 -1
  365. package/es/components/virtual-list/src/builders/build-list.mjs +3 -3
  366. package/es/components/virtual-list/src/builders/build-list.mjs.map +1 -1
  367. package/es/hooks/use-id/index.mjs +4 -1
  368. package/es/hooks/use-id/index.mjs.map +1 -1
  369. package/es/hooks/use-lockscreen/index.mjs +4 -6
  370. package/es/hooks/use-lockscreen/index.mjs.map +1 -1
  371. package/es/index.mjs +1 -1
  372. package/es/locale/lang/zh-tw.d.ts +35 -0
  373. package/es/locale/lang/zh-tw.mjs +46 -11
  374. package/es/locale/lang/zh-tw.mjs.map +1 -1
  375. package/es/utils/dom/index.d.ts +0 -1
  376. package/es/utils/dom/index.mjs +0 -1
  377. package/es/utils/dom/index.mjs.map +1 -1
  378. package/es/utils/index.mjs +0 -1
  379. package/es/utils/index.mjs.map +1 -1
  380. package/es/version.d.ts +1 -1
  381. package/es/version.mjs +1 -1
  382. package/es/version.mjs.map +1 -1
  383. package/lib/components/carousel/index.d.ts +1 -1
  384. package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
  385. package/lib/components/cascader/index.d.ts +2 -2
  386. package/lib/components/cascader/src/index.js +16 -13
  387. package/lib/components/cascader/src/index.js.map +1 -1
  388. package/lib/components/cascader/src/index.vue.d.ts +42 -43
  389. package/lib/components/checkbox/index.d.ts +2 -2
  390. package/lib/components/checkbox/src/checkbox-group.js +3 -3
  391. package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
  392. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
  393. package/lib/components/checkbox/src/checkbox.d.ts +4 -5
  394. package/lib/components/checkbox/src/checkbox.js +4 -8
  395. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  396. package/lib/components/color-picker/src/index.js +8 -13
  397. package/lib/components/color-picker/src/index.js.map +1 -1
  398. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +1 -0
  399. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +1 -0
  400. package/lib/components/date-picker/src/panel-utils.d.ts +2 -0
  401. package/lib/components/dialog/src/use-dialog.js +1 -1
  402. package/lib/components/dialog/src/use-dialog.js.map +1 -1
  403. package/lib/components/form/index.d.ts +4 -0
  404. package/lib/components/form/src/form-item2.js +1 -0
  405. package/lib/components/form/src/form-item2.js.map +1 -1
  406. package/lib/components/form/src/form.d.ts +1 -0
  407. package/lib/components/form/src/form.js +5 -0
  408. package/lib/components/form/src/form.js.map +1 -1
  409. package/lib/components/form/src/form.vue.d.ts +4 -0
  410. package/lib/components/index.js +1 -1
  411. package/lib/components/menu/index.d.ts +224 -0
  412. package/lib/components/menu/src/menu.js +39 -17
  413. package/lib/components/menu/src/menu.js.map +1 -1
  414. package/lib/components/menu/src/sub-menu.d.ts +138 -2
  415. package/lib/components/menu/src/sub-menu.js +17 -2
  416. package/lib/components/menu/src/sub-menu.js.map +1 -1
  417. package/lib/components/message/src/instance.js +1 -1
  418. package/lib/components/message/src/instance.js.map +1 -1
  419. package/lib/components/message/src/method.js +1 -1
  420. package/lib/components/message/src/method.js.map +1 -1
  421. package/lib/components/message-box/src/message-box.type.d.ts +1 -1
  422. package/lib/components/message-box/src/messageBox.js +10 -9
  423. package/lib/components/message-box/src/messageBox.js.map +1 -1
  424. package/lib/components/notification/src/notification.d.ts +2 -0
  425. package/lib/components/notification/src/notification.js.map +1 -1
  426. package/lib/components/notification/src/notification.vue.d.ts +111 -5
  427. package/lib/components/notification/src/notification2.js +85 -92
  428. package/lib/components/notification/src/notification2.js.map +1 -1
  429. package/lib/components/notification/src/notify.js +2 -2
  430. package/lib/components/notification/src/notify.js.map +1 -1
  431. package/lib/components/page-header/index.d.ts +46 -0
  432. package/lib/components/page-header/src/page-header.vue.d.ts +46 -0
  433. package/lib/components/page-header/src/page-header2.js +69 -27
  434. package/lib/components/page-header/src/page-header2.js.map +1 -1
  435. package/lib/components/pagination/index.d.ts +6 -0
  436. package/lib/components/pagination/src/components/next.d.ts +6 -0
  437. package/lib/components/pagination/src/components/next.js +4 -0
  438. package/lib/components/pagination/src/components/next.js.map +1 -1
  439. package/lib/components/pagination/src/components/next.vue.d.ts +18 -1
  440. package/lib/components/pagination/src/components/next2.js +1 -2
  441. package/lib/components/pagination/src/components/next2.js.map +1 -1
  442. package/lib/components/pagination/src/components/prev.d.ts +6 -0
  443. package/lib/components/pagination/src/components/prev.js +4 -0
  444. package/lib/components/pagination/src/components/prev.js.map +1 -1
  445. package/lib/components/pagination/src/components/prev.vue.d.ts +18 -1
  446. package/lib/components/pagination/src/components/prev2.js +1 -2
  447. package/lib/components/pagination/src/components/prev2.js.map +1 -1
  448. package/lib/components/pagination/src/pagination.d.ts +8 -0
  449. package/lib/components/pagination/src/pagination.js +12 -0
  450. package/lib/components/pagination/src/pagination.js.map +1 -1
  451. package/lib/components/popconfirm/index.d.ts +7 -0
  452. package/lib/components/popconfirm/src/popconfirm.d.ts +1 -0
  453. package/lib/components/popconfirm/src/popconfirm.js +5 -1
  454. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  455. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +454 -447
  456. package/lib/components/popconfirm/src/popconfirm2.js +13 -4
  457. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  458. package/lib/components/popover/src/popover2.js +1 -1
  459. package/lib/components/popover/src/popover2.js.map +1 -1
  460. package/lib/components/scrollbar/index.js +2 -2
  461. package/lib/components/scrollbar/src/scrollbar.js +169 -45
  462. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  463. package/lib/components/scrollbar/src/scrollbar2.js +45 -169
  464. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  465. package/lib/components/select/src/useOption.js +1 -1
  466. package/lib/components/select/src/useOption.js.map +1 -1
  467. package/lib/components/select/src/useSelect.d.ts +31 -32
  468. package/lib/components/select/src/useSelect.js +9 -12
  469. package/lib/components/select/src/useSelect.js.map +1 -1
  470. package/lib/components/slider/src/composables/use-marks.js +1 -1
  471. package/lib/components/slider/src/composables/use-marks.js.map +1 -1
  472. package/lib/components/slot/src/only-child.js +3 -1
  473. package/lib/components/slot/src/only-child.js.map +1 -1
  474. package/lib/components/space/index.d.ts +3 -3
  475. package/lib/components/space/src/space.d.ts +5 -4
  476. package/lib/components/space/src/space.js.map +1 -1
  477. package/lib/components/space/src/use-space.d.ts +1 -1
  478. package/lib/components/switch/src/switch2.js +2 -1
  479. package/lib/components/switch/src/switch2.js.map +1 -1
  480. package/lib/components/table/src/table/style-helper.js +11 -9
  481. package/lib/components/table/src/table/style-helper.js.map +1 -1
  482. package/lib/components/table/src/table-body/events-helper.d.ts +1 -3
  483. package/lib/components/table/src/table-body/events-helper.js +2 -2
  484. package/lib/components/table/src/table-body/events-helper.js.map +1 -1
  485. package/lib/components/table/src/table-body/index.js +0 -4
  486. package/lib/components/table/src/table-body/index.js.map +1 -1
  487. package/lib/components/table/src/table-body/render-helper.js +2 -2
  488. package/lib/components/table/src/table-body/render-helper.js.map +1 -1
  489. package/lib/components/table/src/table-header/index.js +1 -2
  490. package/lib/components/table/src/table-header/index.js.map +1 -1
  491. package/lib/components/table/src/util.js +1 -0
  492. package/lib/components/table/src/util.js.map +1 -1
  493. package/lib/components/time-picker/src/common/picker.js +17 -20
  494. package/lib/components/time-picker/src/common/picker.js.map +1 -1
  495. package/lib/components/time-picker/src/common/picker.vue.d.ts +21 -22
  496. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.js +12 -4
  497. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.js.map +1 -1
  498. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -0
  499. package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -0
  500. package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -0
  501. package/lib/components/transfer/index.d.ts +10 -10
  502. package/lib/components/transfer/src/transfer-panel.vue.d.ts +2 -2
  503. package/lib/components/transfer/src/transfer.vue.d.ts +10 -10
  504. package/lib/components/tree/src/model/node.js +3 -3
  505. package/lib/components/tree/src/model/node.js.map +1 -1
  506. package/lib/components/tree/src/model/tree-store.js +1 -1
  507. package/lib/components/tree/src/model/tree-store.js.map +1 -1
  508. package/lib/components/tree-v2/src/composables/useTree.d.ts +4 -0
  509. package/lib/components/tree-v2/src/composables/useTree.js +21 -7
  510. package/lib/components/tree-v2/src/composables/useTree.js.map +1 -1
  511. package/lib/components/tree-v2/src/tree.js +10 -2
  512. package/lib/components/tree-v2/src/tree.js.map +1 -1
  513. package/lib/components/virtual-list/src/builders/build-list.js +2 -2
  514. package/lib/components/virtual-list/src/builders/build-list.js.map +1 -1
  515. package/lib/hooks/use-id/index.js +4 -1
  516. package/lib/hooks/use-id/index.js.map +1 -1
  517. package/lib/hooks/use-lockscreen/index.js +4 -6
  518. package/lib/hooks/use-lockscreen/index.js.map +1 -1
  519. package/lib/index.js +1 -1
  520. package/lib/locale/lang/zh-tw.d.ts +35 -0
  521. package/lib/locale/lang/zh-tw.js +46 -11
  522. package/lib/locale/lang/zh-tw.js.map +1 -1
  523. package/lib/utils/dom/index.d.ts +0 -1
  524. package/lib/utils/dom/index.js +0 -3
  525. package/lib/utils/dom/index.js.map +1 -1
  526. package/lib/utils/index.js +0 -3
  527. package/lib/utils/index.js.map +1 -1
  528. package/lib/version.d.ts +1 -1
  529. package/lib/version.js +1 -1
  530. package/lib/version.js.map +1 -1
  531. package/package.json +6 -4
  532. package/tags.json +1 -1
  533. package/theme-chalk/el-form.css +1 -1
  534. package/theme-chalk/el-input.css +1 -1
  535. package/theme-chalk/el-menu.css +1 -1
  536. package/theme-chalk/el-message.css +1 -1
  537. package/theme-chalk/el-page-header.css +1 -1
  538. package/theme-chalk/el-popover.css +1 -1
  539. package/theme-chalk/el-rate.css +1 -1
  540. package/theme-chalk/el-select-v2.css +1 -1
  541. package/theme-chalk/el-select.css +1 -1
  542. package/theme-chalk/el-table.css +1 -1
  543. package/theme-chalk/index.css +1 -1
  544. package/theme-chalk/src/common/var.scss +0 -2
  545. package/theme-chalk/src/form.scss +17 -6
  546. package/theme-chalk/src/input.scss +1 -0
  547. package/theme-chalk/src/menu.scss +0 -11
  548. package/theme-chalk/src/message.scss +1 -0
  549. package/theme-chalk/src/page-header.scss +40 -26
  550. package/theme-chalk/src/popover.scss +8 -0
  551. package/theme-chalk/src/rate.scss +1 -1
  552. package/theme-chalk/src/select/common.scss +3 -5
  553. package/theme-chalk/src/select.scss +1 -0
  554. package/theme-chalk/src/table.scss +15 -25
  555. package/web-types.json +1 -1
  556. package/es/utils/dom/resize-event.d.ts +0 -9
  557. package/es/utils/dom/resize-event.mjs +0 -34
  558. package/es/utils/dom/resize-event.mjs.map +0 -1
  559. package/lib/utils/dom/resize-event.d.ts +0 -9
  560. package/lib/utils/dom/resize-event.js +0 -39
  561. package/lib/utils/dom/resize-event.js.map +0 -1
@@ -1,12 +1,14 @@
1
- import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, normalizeStyle, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, renderSlot } from 'vue';
1
+ import { defineComponent, ref, computed, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, normalizeClass, normalizeStyle, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, renderSlot } from 'vue';
2
2
  import { ElButton } from '../../button/index.mjs';
3
3
  import { ElIcon } from '../../icon/index.mjs';
4
4
  import { ElTooltip } from '../../tooltip/index.mjs';
5
5
  import '../../../hooks/index.mjs';
6
+ import '../../../utils/index.mjs';
6
7
  import { popconfirmProps } from './popconfirm.mjs';
7
8
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
9
  import { useLocale } from '../../../hooks/use-locale/index.mjs';
9
10
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { addUnit } from '../../../utils/dom/style.mjs';
10
12
 
11
13
  const __default__ = {
12
14
  name: "ElPopconfirm"
@@ -23,6 +25,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
25
  var _a, _b;
24
26
  (_b = (_a = tooltipRef.value) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
25
27
  };
28
+ const style = computed(() => {
29
+ return {
30
+ width: addUnit(props.width)
31
+ };
32
+ });
26
33
  const confirm = (e) => {
27
34
  var _a;
28
35
  (_a = props.onConfirm) == null ? void 0 : _a.call(props, e);
@@ -36,17 +43,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
43
  const finalConfirmButtonText = computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
37
44
  const finalCancelButtonText = computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
38
45
  return (_ctx, _cache) => {
39
- return openBlock(), createBlock(unref(ElTooltip), {
46
+ return openBlock(), createBlock(unref(ElTooltip), mergeProps({
40
47
  ref_key: "tooltipRef",
41
48
  ref: tooltipRef,
42
49
  trigger: "click",
43
- effect: "light",
50
+ effect: "light"
51
+ }, _ctx.$attrs, {
44
52
  "popper-class": `${unref(ns).namespace.value}-popover`,
53
+ "popper-style": unref(style),
45
54
  teleported: _ctx.teleported,
46
55
  "fallback-placements": ["bottom", "top", "right", "left"],
47
56
  "hide-after": _ctx.hideAfter,
48
57
  persistent: _ctx.persistent
49
- }, {
58
+ }), {
50
59
  content: withCtx(() => [
51
60
  createElementVNode("div", {
52
61
  class: normalizeClass(unref(ns).b())
@@ -98,7 +107,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
98
107
  _ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
99
108
  ]),
100
109
  _: 3
101
- }, 8, ["popper-class", "teleported", "hide-after", "persistent"]);
110
+ }, 16, ["popper-class", "popper-style", "teleported", "hide-after", "persistent"]);
102
111
  };
103
112
  }
104
113
  });
@@ -1 +1 @@
1
- {"version":3,"file":"popconfirm2.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n trigger=\"click\"\n effect=\"light\"\n :popper-class=\"`${ns.namespace.value}-popover`\"\n :teleported=\"teleported\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :hide-after=\"hideAfter\"\n :persistent=\"persistent\"\n >\n <template #content>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('main')\">\n <el-icon\n v-if=\"!hideIcon && icon\"\n :class=\"ns.e('icon')\"\n :style=\"{ color: iconColor }\"\n >\n <component :is=\"icon\" />\n </el-icon>\n {{ title }}\n </div>\n <div :class=\"ns.e('action')\">\n <el-button\n size=\"small\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n @click=\"cancel\"\n >\n {{ finalCancelButtonText }}\n </el-button>\n <el-button\n size=\"small\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n @click=\"confirm\"\n >\n {{ finalConfirmButtonText }}\n </el-button>\n </div>\n </div>\n </template>\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport ElIcon from '@element-plus/components/icon'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { popconfirmProps } from './popconfirm'\n\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElPopconfirm',\n})\n\nconst props = defineProps(popconfirmProps)\n\nconst { t } = useLocale()\nconst ns = useNamespace('popconfirm')\nconst tooltipRef = ref<TooltipInstance>()\n\nconst hidePopper = () => {\n tooltipRef.value?.onClose?.()\n}\n\nconst confirm = (e: Event) => {\n props.onConfirm?.(e)\n hidePopper()\n}\nconst cancel = (e: Event) => {\n props.onCancel?.(e)\n hidePopper()\n}\n\nconst finalConfirmButtonText = computed(\n () => props.confirmButtonText || t('el.popconfirm.confirmButtonText')\n)\nconst finalCancelButtonText = computed(\n () => props.cancelButtonText || t('el.popconfirm.cancelButtonText')\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAiEA,IAAA,MAAA,EAAA,MAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,YAAA,CAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,EAAA,CAAA;AAEA,IAAA,MAAA,aAAA,MAAA;AACA,MAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAAA,MACA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,UAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAEA,KAAA,CAAA;AACA,IAAA,MAAA,iBAAA;AACA,MAAA,IAAA,EAAA,CAAA;AAAA,MACA,CAAA,EAAA,GAAA,KAAA,CAAA,SAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AACA,MAAA,UAAA,EAAA,CAAA;AACA,KAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,CAAA,CAAA,KAAA;AAAA,MACA,IAAA,EAAA,CAAA;AAEA,MAAA,CAAA,EAAA,0BAAA,GACA,KAAA,CAAA,GAAA,EAAA,CAAA,UAAA,EAAA,CAAA,CAAA,CAAA;AAEA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"popconfirm2.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n trigger=\"click\"\n effect=\"light\"\n v-bind=\"$attrs\"\n :popper-class=\"`${ns.namespace.value}-popover`\"\n :popper-style=\"style\"\n :teleported=\"teleported\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :hide-after=\"hideAfter\"\n :persistent=\"persistent\"\n >\n <template #content>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('main')\">\n <el-icon\n v-if=\"!hideIcon && icon\"\n :class=\"ns.e('icon')\"\n :style=\"{ color: iconColor }\"\n >\n <component :is=\"icon\" />\n </el-icon>\n {{ title }}\n </div>\n <div :class=\"ns.e('action')\">\n <el-button\n size=\"small\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n @click=\"cancel\"\n >\n {{ finalCancelButtonText }}\n </el-button>\n <el-button\n size=\"small\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n @click=\"confirm\"\n >\n {{ finalConfirmButtonText }}\n </el-button>\n </div>\n </div>\n </template>\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport ElIcon from '@element-plus/components/icon'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { addUnit } from '@element-plus/utils'\nimport { popconfirmProps } from './popconfirm'\n\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElPopconfirm',\n})\n\nconst props = defineProps(popconfirmProps)\n\nconst { t } = useLocale()\nconst ns = useNamespace('popconfirm')\nconst tooltipRef = ref<TooltipInstance>()\n\nconst hidePopper = () => {\n tooltipRef.value?.onClose?.()\n}\n\nconst style = computed(() => {\n return {\n width: addUnit(props.width),\n }\n})\n\nconst confirm = (e: Event) => {\n props.onConfirm?.(e)\n hidePopper()\n}\nconst cancel = (e: Event) => {\n props.onCancel?.(e)\n hidePopper()\n}\n\nconst finalConfirmButtonText = computed(\n () => props.confirmButtonText || t('el.popconfirm.confirmButtonText')\n)\nconst finalCancelButtonText = computed(\n () => props.cancelButtonText || t('el.popconfirm.cancelButtonText')\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAoEA,IAAA,MAAA,EAAA,MAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,YAAA,CAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,EAAA,CAAA;AAEA,IAAA,MAAA,aAAA,MAAA;AACA,MAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAAA,MACA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,UAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAEA,KAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,QAAA,CAAA,MAAA;AAAA,MACA,OAAA;AAAA,QACA,KAAA,EAAA,OAAA,CAAA,KAAA,CAAA,KAAA,CAAA;AAAA,OACA,CAAA;AAEA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,iBAAA;AACA,MAAA,IAAA,EAAA,CAAA;AAAA,MACA,CAAA,EAAA,GAAA,KAAA,CAAA,SAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AACA,MAAA,UAAA,EAAA,CAAA;AACA,KAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,CAAA,CAAA,KAAA;AAAA,MACA,IAAA,EAAA,CAAA;AAEA,MAAA,CAAA,EAAA,0BAAA,GACA,KAAA,CAAA,GAAA,EAAA,CAAA,UAAA,EAAA,CAAA,CAAA,CAAA;AAEA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -38,7 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  return [ns.b(), props.popperClass, { [ns.m("plain")]: !!props.content }];
39
39
  });
40
40
  const gpuAcceleration = computed(() => {
41
- return props.transition === "el-fade-in-linear";
41
+ return props.transition === `${ns.namespace.value}-fade-in-linear`;
42
42
  });
43
43
  const hide = () => {
44
44
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"popover2.mjs","sources":["../../../../../../packages/components/popover/src/popover.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :trigger=\"trigger\"\n :placement=\"placement\"\n :disabled=\"disabled\"\n :visible=\"visible\"\n :transition=\"transition\"\n :popper-options=\"popperOptions\"\n :tabindex=\"tabindex\"\n :content=\"content\"\n :offset=\"offset\"\n :show-after=\"showAfter\"\n :hide-after=\"hideAfter\"\n :auto-close=\"autoClose\"\n :show-arrow=\"showArrow\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n :teleported=\"teleported\"\n :persistent=\"persistent\"\n :gpu-acceleration=\"gpuAcceleration\"\n @update:visible=\"onUpdateVisible\"\n @before-show=\"beforeEnter\"\n @before-hide=\"beforeLeave\"\n @show=\"afterEnter\"\n @hide=\"afterLeave\"\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" :class=\"ns.e('title')\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, unref } from 'vue'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { popoverEmits, popoverProps } from './popover'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElPopover',\n})\n\nconst props = defineProps(popoverProps)\nconst emit = defineEmits(popoverEmits)\n\nconst updateEventKeyRaw = `onUpdate:visible` as const\n\nconst onUpdateVisible = computed(() => {\n return props[updateEventKeyRaw]\n})\n\nconst ns = useNamespace('popover')\nconst tooltipRef = ref<TooltipInstance>()\nconst popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n})\n\nconst style = computed(() => {\n return [\n {\n width: addUnit(props.width),\n },\n props.popperStyle!,\n ]\n})\n\nconst kls = computed(() => {\n return [ns.b(), props.popperClass!, { [ns.m('plain')]: !!props.content }]\n})\n\nconst gpuAcceleration = computed(() => {\n return props.transition === 'el-fade-in-linear'\n})\n\nconst hide = () => {\n tooltipRef.value?.hide()\n}\n\nconst beforeEnter = () => {\n emit('before-enter')\n}\nconst beforeLeave = () => {\n emit('before-leave')\n}\n\nconst afterEnter = () => {\n emit('after-enter')\n}\n\nconst afterLeave = () => {\n emit('update:visible', false)\n emit('after-leave')\n}\n\ndefineExpose({\n /** @description popper ref */\n popperRef,\n /** @description hide popover */\n hide,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA4DA,IAAA,MAAA,iBAAA,GAAA,CAAA,gBAAA,CAAA,CAAA;AAEA,IAAA,MAAA,eAAA,GAAA,SAAA,MAAA;AACA,MAAA,OAAA,KAAA,CAAA,iBAAA,CAAA,CAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,EAAA,GAAA,aAAA,SAAA,CAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,SAAA,GAAA,SAAA,MAAA;AACA,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AAA,CAAA,gBAAA,EAAA,KAAA,CAAA,CAAA;AAEA,MAAA,IAAA,CAAA,aAAA,CAAA,CAAA;AAAA,KAEA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MACA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"popover2.mjs","sources":["../../../../../../packages/components/popover/src/popover.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :trigger=\"trigger\"\n :placement=\"placement\"\n :disabled=\"disabled\"\n :visible=\"visible\"\n :transition=\"transition\"\n :popper-options=\"popperOptions\"\n :tabindex=\"tabindex\"\n :content=\"content\"\n :offset=\"offset\"\n :show-after=\"showAfter\"\n :hide-after=\"hideAfter\"\n :auto-close=\"autoClose\"\n :show-arrow=\"showArrow\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n :teleported=\"teleported\"\n :persistent=\"persistent\"\n :gpu-acceleration=\"gpuAcceleration\"\n @update:visible=\"onUpdateVisible\"\n @before-show=\"beforeEnter\"\n @before-hide=\"beforeLeave\"\n @show=\"afterEnter\"\n @hide=\"afterLeave\"\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" :class=\"ns.e('title')\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, unref } from 'vue'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { popoverEmits, popoverProps } from './popover'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElPopover',\n})\n\nconst props = defineProps(popoverProps)\nconst emit = defineEmits(popoverEmits)\n\nconst updateEventKeyRaw = `onUpdate:visible` as const\n\nconst onUpdateVisible = computed(() => {\n return props[updateEventKeyRaw]\n})\n\nconst ns = useNamespace('popover')\nconst tooltipRef = ref<TooltipInstance>()\nconst popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n})\n\nconst style = computed(() => {\n return [\n {\n width: addUnit(props.width),\n },\n props.popperStyle!,\n ]\n})\n\nconst kls = computed(() => {\n return [ns.b(), props.popperClass!, { [ns.m('plain')]: !!props.content }]\n})\n\nconst gpuAcceleration = computed(() => {\n return props.transition === `${ns.namespace.value}-fade-in-linear`\n})\n\nconst hide = () => {\n tooltipRef.value?.hide()\n}\n\nconst beforeEnter = () => {\n emit('before-enter')\n}\nconst beforeLeave = () => {\n emit('before-leave')\n}\n\nconst afterEnter = () => {\n emit('after-enter')\n}\n\nconst afterLeave = () => {\n emit('update:visible', false)\n emit('after-leave')\n}\n\ndefineExpose({\n /** @description popper ref */\n popperRef,\n /** @description hide popover */\n hide,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA4DA,IAAA,MAAA,iBAAA,GAAA,CAAA,gBAAA,CAAA,CAAA;AAEA,IAAA,MAAA,eAAA,GAAA,SAAA,MAAA;AACA,MAAA,OAAA,KAAA,CAAA,iBAAA,CAAA,CAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,EAAA,GAAA,aAAA,SAAA,CAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,SAAA,GAAA,SAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA;AAAA,MACA,OAAA,CAAA,EAAA,GAAA,KAAA,CAAA,UAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,SAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,QAAA,CAAA,MAAA;AAAA,MACA,OAAA;AAAA,QACA;AAAA,UACA,KAAA,EA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;;"}
@@ -1,7 +1,7 @@
1
1
  import '../../utils/index.mjs';
2
- import Scrollbar from './src/scrollbar2.mjs';
2
+ import Scrollbar from './src/scrollbar.mjs';
3
3
  export { BAR_MAP, GAP, renderThumbStyle } from './src/util.mjs';
4
- export { scrollbarEmits, scrollbarProps } from './src/scrollbar.mjs';
4
+ export { scrollbarEmits, scrollbarProps } from './src/scrollbar2.mjs';
5
5
  export { thumbProps } from './src/thumb.mjs';
6
6
  import { withInstall } from '../../utils/vue/install.mjs';
7
7
 
@@ -1,50 +1,175 @@
1
+ import { defineComponent, ref, computed, watch, nextTick, provide, reactive, onMounted, onUpdated, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, createBlock, resolveDynamicComponent, withCtx, renderSlot, createCommentVNode } from 'vue';
2
+ import { isNumber, useResizeObserver, useEventListener } from '@vueuse/core';
1
3
  import '../../../utils/index.mjs';
2
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
- import { isNumber } from '@vueuse/core';
4
+ import '../../../tokens/index.mjs';
5
+ import '../../../hooks/index.mjs';
6
+ import { GAP } from './util.mjs';
7
+ import Bar from './bar2.mjs';
8
+ import { scrollbarProps, scrollbarEmits } from './scrollbar2.mjs';
9
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { addUnit } from '../../../utils/dom/style.mjs';
12
+ import { isObject } from '@vue/shared';
13
+ import { debugWarn } from '../../../utils/error.mjs';
14
+ import { scrollbarContextKey } from '../../../tokens/scrollbar.mjs';
4
15
 
5
- const scrollbarProps = buildProps({
6
- height: {
7
- type: [String, Number],
8
- default: ""
9
- },
10
- maxHeight: {
11
- type: [String, Number],
12
- default: ""
13
- },
14
- native: Boolean,
15
- wrapStyle: {
16
- type: definePropType([String, Object, Array]),
17
- default: ""
18
- },
19
- wrapClass: {
20
- type: [String, Array],
21
- default: ""
22
- },
23
- viewClass: {
24
- type: [String, Array],
25
- default: ""
26
- },
27
- viewStyle: {
28
- type: [String, Array, Object],
29
- default: ""
30
- },
31
- noresize: Boolean,
32
- tag: {
33
- type: String,
34
- default: "div"
35
- },
36
- always: Boolean,
37
- minSize: {
38
- type: Number,
39
- default: 20
16
+ const __default__ = {
17
+ name: "ElScrollbar"
18
+ };
19
+ const _sfc_main = /* @__PURE__ */ defineComponent({
20
+ ...__default__,
21
+ props: scrollbarProps,
22
+ emits: scrollbarEmits,
23
+ setup(__props, { expose, emit }) {
24
+ const props = __props;
25
+ const ns = useNamespace("scrollbar");
26
+ let stopResizeObserver = void 0;
27
+ let stopResizeListener = void 0;
28
+ const scrollbar$ = ref();
29
+ const wrap$ = ref();
30
+ const resize$ = ref();
31
+ const sizeWidth = ref("0");
32
+ const sizeHeight = ref("0");
33
+ const barRef = ref();
34
+ const ratioY = ref(1);
35
+ const ratioX = ref(1);
36
+ const SCOPE = "ElScrollbar";
37
+ const style = computed(() => {
38
+ const style2 = {};
39
+ if (props.height)
40
+ style2.height = addUnit(props.height);
41
+ if (props.maxHeight)
42
+ style2.maxHeight = addUnit(props.maxHeight);
43
+ return [props.wrapStyle, style2];
44
+ });
45
+ const handleScroll = () => {
46
+ var _a;
47
+ if (wrap$.value) {
48
+ (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrap$.value);
49
+ emit("scroll", {
50
+ scrollTop: wrap$.value.scrollTop,
51
+ scrollLeft: wrap$.value.scrollLeft
52
+ });
53
+ }
54
+ };
55
+ function scrollTo(arg1, arg2) {
56
+ if (isObject(arg1)) {
57
+ wrap$.value.scrollTo(arg1);
58
+ } else if (isNumber(arg1) && isNumber(arg2)) {
59
+ wrap$.value.scrollTo(arg1, arg2);
60
+ }
61
+ }
62
+ const setScrollTop = (value) => {
63
+ if (!isNumber(value)) {
64
+ debugWarn(SCOPE, "value must be a number");
65
+ return;
66
+ }
67
+ wrap$.value.scrollTop = value;
68
+ };
69
+ const setScrollLeft = (value) => {
70
+ if (!isNumber(value)) {
71
+ debugWarn(SCOPE, "value must be a number");
72
+ return;
73
+ }
74
+ wrap$.value.scrollLeft = value;
75
+ };
76
+ const update = () => {
77
+ if (!wrap$.value)
78
+ return;
79
+ const offsetHeight = wrap$.value.offsetHeight - GAP;
80
+ const offsetWidth = wrap$.value.offsetWidth - GAP;
81
+ const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight;
82
+ const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth;
83
+ const height = Math.max(originalHeight, props.minSize);
84
+ const width = Math.max(originalWidth, props.minSize);
85
+ ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
86
+ ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
87
+ sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
88
+ sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
89
+ };
90
+ watch(() => props.noresize, (noresize) => {
91
+ if (noresize) {
92
+ stopResizeObserver == null ? void 0 : stopResizeObserver();
93
+ stopResizeListener == null ? void 0 : stopResizeListener();
94
+ } else {
95
+ ;
96
+ ({ stop: stopResizeObserver } = useResizeObserver(resize$, update));
97
+ stopResizeListener = useEventListener("resize", update);
98
+ }
99
+ }, { immediate: true });
100
+ watch(() => [props.maxHeight, props.height], () => {
101
+ if (!props.native)
102
+ nextTick(() => {
103
+ var _a;
104
+ update();
105
+ if (wrap$.value) {
106
+ (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrap$.value);
107
+ }
108
+ });
109
+ });
110
+ provide(scrollbarContextKey, reactive({
111
+ scrollbarElement: scrollbar$,
112
+ wrapElement: wrap$
113
+ }));
114
+ onMounted(() => {
115
+ if (!props.native)
116
+ nextTick(() => {
117
+ update();
118
+ });
119
+ });
120
+ onUpdated(() => update());
121
+ expose({
122
+ wrap$,
123
+ update,
124
+ scrollTo,
125
+ setScrollTop,
126
+ setScrollLeft,
127
+ handleScroll
128
+ });
129
+ return (_ctx, _cache) => {
130
+ return openBlock(), createElementBlock("div", {
131
+ ref_key: "scrollbar$",
132
+ ref: scrollbar$,
133
+ class: normalizeClass(unref(ns).b())
134
+ }, [
135
+ createElementVNode("div", {
136
+ ref_key: "wrap$",
137
+ ref: wrap$,
138
+ class: normalizeClass([
139
+ _ctx.wrapClass,
140
+ unref(ns).e("wrap"),
141
+ { [unref(ns).em("wrap", "hidden-default")]: !_ctx.native }
142
+ ]),
143
+ style: normalizeStyle(unref(style)),
144
+ onScroll: handleScroll
145
+ }, [
146
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
147
+ ref_key: "resize$",
148
+ ref: resize$,
149
+ class: normalizeClass([unref(ns).e("view"), _ctx.viewClass]),
150
+ style: normalizeStyle(_ctx.viewStyle)
151
+ }, {
152
+ default: withCtx(() => [
153
+ renderSlot(_ctx.$slots, "default")
154
+ ]),
155
+ _: 3
156
+ }, 8, ["class", "style"]))
157
+ ], 38),
158
+ !_ctx.native ? (openBlock(), createBlock(Bar, {
159
+ key: 0,
160
+ ref_key: "barRef",
161
+ ref: barRef,
162
+ height: sizeHeight.value,
163
+ width: sizeWidth.value,
164
+ always: _ctx.always,
165
+ "ratio-x": ratioX.value,
166
+ "ratio-y": ratioY.value
167
+ }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
168
+ ], 2);
169
+ };
40
170
  }
41
171
  });
42
- const scrollbarEmits = {
43
- scroll: ({
44
- scrollTop,
45
- scrollLeft
46
- }) => [scrollTop, scrollLeft].every(isNumber)
47
- };
172
+ var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
48
173
 
49
- export { scrollbarEmits, scrollbarProps };
174
+ export { Scrollbar as default };
50
175
  //# sourceMappingURL=scrollbar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type Scrollbar from './scrollbar.vue'\n\nexport const scrollbarProps = buildProps({\n height: {\n type: [String, Number],\n default: '',\n },\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n native: Boolean,\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n viewClass: {\n type: [String, Array],\n default: '',\n },\n viewStyle: {\n type: [String, Array, Object],\n default: '',\n },\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n tag: {\n type: String,\n default: 'div',\n },\n always: Boolean,\n minSize: {\n type: Number,\n default: 20,\n },\n} as const)\nexport type ScrollbarProps = ExtractPropTypes<typeof scrollbarProps>\n\nexport const scrollbarEmits = {\n scroll: ({\n scrollTop,\n scrollLeft,\n }: {\n scrollTop: number\n scrollLeft: number\n }) => [scrollTop, scrollLeft].every(isNumber),\n}\nexport type ScrollbarEmits = typeof scrollbarEmits\n\nexport type ScrollbarInstance = InstanceType<typeof Scrollbar>\n"],"names":[],"mappings":";;;;AACY,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AACjC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,MAAM,EAAE,CAAC;AACX,IAAI,SAAS;AACb,IAAI,UAAU;AACd,GAAG,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;AAC/C;;;;"}
1
+ {"version":3,"file":"scrollbar.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbar$\" :class=\"ns.b()\">\n <div\n ref=\"wrap$\"\n :class=\"[\n wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !native },\n ]\"\n :style=\"style\"\n @scroll=\"handleScroll\"\n >\n <component\n :is=\"tag\"\n ref=\"resize$\"\n :class=\"[ns.e('view'), viewClass]\"\n :style=\"viewStyle\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar\n ref=\"barRef\"\n :height=\"sizeHeight\"\n :width=\"sizeWidth\"\n :always=\"always\"\n :ratio-x=\"ratioX\"\n :ratio-y=\"ratioY\"\n />\n </template>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { addUnit, debugWarn, isNumber, isObject } from '@element-plus/utils'\nimport { scrollbarContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { GAP } from './util'\nimport Bar from './bar.vue'\nimport { scrollbarEmits, scrollbarProps } from './scrollbar'\nimport type { BarInstance } from './bar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\ndefineOptions({\n name: 'ElScrollbar',\n})\n\nconst props = defineProps(scrollbarProps)\nconst emit = defineEmits(scrollbarEmits)\n\nconst ns = useNamespace('scrollbar')\n\nlet stopResizeObserver: (() => void) | undefined = undefined\nlet stopResizeListener: (() => void) | undefined = undefined\n\nconst scrollbar$ = ref<HTMLDivElement>()\nconst wrap$ = ref<HTMLDivElement>()\nconst resize$ = ref<HTMLElement>()\n\nconst sizeWidth = ref('0')\nconst sizeHeight = ref('0')\nconst barRef = ref<BarInstance>()\nconst ratioY = ref(1)\nconst ratioX = ref(1)\nconst SCOPE = 'ElScrollbar'\n\nconst style = computed<StyleValue>(() => {\n const style: CSSProperties = {}\n if (props.height) style.height = addUnit(props.height)\n if (props.maxHeight) style.maxHeight = addUnit(props.maxHeight)\n return [props.wrapStyle, style]\n})\n\nconst handleScroll = () => {\n if (wrap$.value) {\n barRef.value?.handleScroll(wrap$.value)\n\n emit('scroll', {\n scrollTop: wrap$.value.scrollTop,\n scrollLeft: wrap$.value.scrollLeft,\n })\n }\n}\n\n// TODO: refactor method overrides, due to script setup dts\n// @ts-nocheck\nfunction scrollTo(xCord: number, yCord?: number): void\nfunction scrollTo(options: ScrollToOptions): void\nfunction scrollTo(arg1: unknown, arg2?: number) {\n if (isObject(arg1)) {\n wrap$.value!.scrollTo(arg1)\n } else if (isNumber(arg1) && isNumber(arg2)) {\n wrap$.value!.scrollTo(arg1, arg2)\n }\n}\n\nconst setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(SCOPE, 'value must be a number')\n return\n }\n wrap$.value!.scrollTop = value\n}\n\nconst setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(SCOPE, 'value must be a number')\n return\n }\n wrap$.value!.scrollLeft = value\n}\n\nconst update = () => {\n if (!wrap$.value) return\n const offsetHeight = wrap$.value.offsetHeight - GAP\n const offsetWidth = wrap$.value.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap$.value.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\nwatch(\n () => props.noresize,\n (noresize) => {\n if (noresize) {\n stopResizeObserver?.()\n stopResizeListener?.()\n } else {\n ;({ stop: stopResizeObserver } = useResizeObserver(resize$, update))\n stopResizeListener = useEventListener('resize', update)\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => [props.maxHeight, props.height],\n () => {\n if (!props.native)\n nextTick(() => {\n update()\n if (wrap$.value) {\n barRef.value?.handleScroll(wrap$.value)\n }\n })\n }\n)\n\nprovide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbar$,\n wrapElement: wrap$,\n })\n)\n\nonMounted(() => {\n if (!props.native)\n nextTick(() => {\n update()\n })\n})\nonUpdated(() => update())\n\ndefineExpose({\n /** @description scrollbar wrap ref */\n wrap$,\n /** @description update scrollbar state manually */\n update,\n /** @description scrolls to a particular set of coordinates */\n scrollTo,\n /** @description set distance to scroll top */\n setScrollTop,\n /** @description set distance to scroll left */\n setScrollLeft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A,OAAA,EAAA,MAAA,CAAA,EAAA;AAAA,QACA,kBAAA,GAAA,gBAAA,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AAAA,OAEA;AAGA,KAAA,EAAA,EAAA,SACA,EAAA;AAEA,IAAA,KAAA,CAAA,MAAA,CAAA,KAAA,CAAA,SAAA,EAAA,KAAA,CAAA,MAAA,CAAA,EAAA,MAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,MAAA;AACA,QAAA,QAAA,CAAA,MAAA;AACA,UAAA,IAAA;AACA,UAAA,MAAA,EAAA,CAAA;AAAA,UACA,IAAA,KAAA,CAAA,KAAA,EAAA;AAAA,YACA,CAAA,EAAA,GAAA,MAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAA,CAAA,KAAA,CAAA,KAAA,CAAA,CAAA;AAAA,WAEA;AAEA,SAAA,CAAA,CAAA;AAEA,KAAA,CACA,CAAA;AAAA,IAAA,OACA,CAAA,mBAAA,EAAA,QAAA,CAAA;AAAA,MAEA,gBAAA,EAAA,UAAA;AAEA,MAAA,WAAA,EAAA,KAAA;AACA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,SAAA,CAAA,MAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,MAAA;AAAA,QACA,QAAA,CAAA,MAAA;AAAA,UACA,MAAA,EAAA,CAAA;AACA,SAAA,CAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AAAA,IAEA,SAAA,CAAA,MAAA,MAAA,EAAA,CAAA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MAEA,KAAA;AAAA,MAEA,MAAA;AAAA,MAEA,QAAA;AAAA,MAEA,YAAA;AAAA,MACA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,175 +1,50 @@
1
- import { defineComponent, ref, computed, watch, nextTick, provide, reactive, onMounted, onUpdated, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, createBlock, resolveDynamicComponent, withCtx, renderSlot, createCommentVNode } from 'vue';
2
- import { isNumber, useResizeObserver, useEventListener } from '@vueuse/core';
3
1
  import '../../../utils/index.mjs';
4
- import '../../../tokens/index.mjs';
5
- import '../../../hooks/index.mjs';
6
- import { GAP } from './util.mjs';
7
- import Bar from './bar2.mjs';
8
- import { scrollbarProps, scrollbarEmits } from './scrollbar.mjs';
9
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
- import { addUnit } from '../../../utils/dom/style.mjs';
12
- import { isObject } from '@vue/shared';
13
- import { debugWarn } from '../../../utils/error.mjs';
14
- import { scrollbarContextKey } from '../../../tokens/scrollbar.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
+ import { isNumber } from '@vueuse/core';
15
4
 
16
- const __default__ = {
17
- name: "ElScrollbar"
18
- };
19
- const _sfc_main = /* @__PURE__ */ defineComponent({
20
- ...__default__,
21
- props: scrollbarProps,
22
- emits: scrollbarEmits,
23
- setup(__props, { expose, emit }) {
24
- const props = __props;
25
- const ns = useNamespace("scrollbar");
26
- let stopResizeObserver = void 0;
27
- let stopResizeListener = void 0;
28
- const scrollbar$ = ref();
29
- const wrap$ = ref();
30
- const resize$ = ref();
31
- const sizeWidth = ref("0");
32
- const sizeHeight = ref("0");
33
- const barRef = ref();
34
- const ratioY = ref(1);
35
- const ratioX = ref(1);
36
- const SCOPE = "ElScrollbar";
37
- const style = computed(() => {
38
- const style2 = {};
39
- if (props.height)
40
- style2.height = addUnit(props.height);
41
- if (props.maxHeight)
42
- style2.maxHeight = addUnit(props.maxHeight);
43
- return [props.wrapStyle, style2];
44
- });
45
- const handleScroll = () => {
46
- var _a;
47
- if (wrap$.value) {
48
- (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrap$.value);
49
- emit("scroll", {
50
- scrollTop: wrap$.value.scrollTop,
51
- scrollLeft: wrap$.value.scrollLeft
52
- });
53
- }
54
- };
55
- function scrollTo(arg1, arg2) {
56
- if (isObject(arg1)) {
57
- wrap$.value.scrollTo(arg1);
58
- } else if (isNumber(arg1) && isNumber(arg2)) {
59
- wrap$.value.scrollTo(arg1, arg2);
60
- }
61
- }
62
- const setScrollTop = (value) => {
63
- if (!isNumber(value)) {
64
- debugWarn(SCOPE, "value must be a number");
65
- return;
66
- }
67
- wrap$.value.scrollTop = value;
68
- };
69
- const setScrollLeft = (value) => {
70
- if (!isNumber(value)) {
71
- debugWarn(SCOPE, "value must be a number");
72
- return;
73
- }
74
- wrap$.value.scrollLeft = value;
75
- };
76
- const update = () => {
77
- if (!wrap$.value)
78
- return;
79
- const offsetHeight = wrap$.value.offsetHeight - GAP;
80
- const offsetWidth = wrap$.value.offsetWidth - GAP;
81
- const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight;
82
- const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth;
83
- const height = Math.max(originalHeight, props.minSize);
84
- const width = Math.max(originalWidth, props.minSize);
85
- ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
86
- ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
87
- sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
88
- sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
89
- };
90
- watch(() => props.noresize, (noresize) => {
91
- if (noresize) {
92
- stopResizeObserver == null ? void 0 : stopResizeObserver();
93
- stopResizeListener == null ? void 0 : stopResizeListener();
94
- } else {
95
- ;
96
- ({ stop: stopResizeObserver } = useResizeObserver(resize$, update));
97
- stopResizeListener = useEventListener("resize", update);
98
- }
99
- }, { immediate: true });
100
- watch(() => [props.maxHeight, props.height], () => {
101
- if (!props.native)
102
- nextTick(() => {
103
- var _a;
104
- update();
105
- if (wrap$.value) {
106
- (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrap$.value);
107
- }
108
- });
109
- });
110
- provide(scrollbarContextKey, reactive({
111
- scrollbarElement: scrollbar$,
112
- wrapElement: wrap$
113
- }));
114
- onMounted(() => {
115
- if (!props.native)
116
- nextTick(() => {
117
- update();
118
- });
119
- });
120
- onUpdated(() => update());
121
- expose({
122
- wrap$,
123
- update,
124
- scrollTo,
125
- setScrollTop,
126
- setScrollLeft,
127
- handleScroll
128
- });
129
- return (_ctx, _cache) => {
130
- return openBlock(), createElementBlock("div", {
131
- ref_key: "scrollbar$",
132
- ref: scrollbar$,
133
- class: normalizeClass(unref(ns).b())
134
- }, [
135
- createElementVNode("div", {
136
- ref_key: "wrap$",
137
- ref: wrap$,
138
- class: normalizeClass([
139
- _ctx.wrapClass,
140
- unref(ns).e("wrap"),
141
- { [unref(ns).em("wrap", "hidden-default")]: !_ctx.native }
142
- ]),
143
- style: normalizeStyle(unref(style)),
144
- onScroll: handleScroll
145
- }, [
146
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
147
- ref_key: "resize$",
148
- ref: resize$,
149
- class: normalizeClass([unref(ns).e("view"), _ctx.viewClass]),
150
- style: normalizeStyle(_ctx.viewStyle)
151
- }, {
152
- default: withCtx(() => [
153
- renderSlot(_ctx.$slots, "default")
154
- ]),
155
- _: 3
156
- }, 8, ["class", "style"]))
157
- ], 38),
158
- !_ctx.native ? (openBlock(), createBlock(Bar, {
159
- key: 0,
160
- ref_key: "barRef",
161
- ref: barRef,
162
- height: sizeHeight.value,
163
- width: sizeWidth.value,
164
- always: _ctx.always,
165
- "ratio-x": ratioX.value,
166
- "ratio-y": ratioY.value
167
- }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
168
- ], 2);
169
- };
5
+ const scrollbarProps = buildProps({
6
+ height: {
7
+ type: [String, Number],
8
+ default: ""
9
+ },
10
+ maxHeight: {
11
+ type: [String, Number],
12
+ default: ""
13
+ },
14
+ native: Boolean,
15
+ wrapStyle: {
16
+ type: definePropType([String, Object, Array]),
17
+ default: ""
18
+ },
19
+ wrapClass: {
20
+ type: [String, Array],
21
+ default: ""
22
+ },
23
+ viewClass: {
24
+ type: [String, Array],
25
+ default: ""
26
+ },
27
+ viewStyle: {
28
+ type: [String, Array, Object],
29
+ default: ""
30
+ },
31
+ noresize: Boolean,
32
+ tag: {
33
+ type: String,
34
+ default: "div"
35
+ },
36
+ always: Boolean,
37
+ minSize: {
38
+ type: Number,
39
+ default: 20
170
40
  }
171
41
  });
172
- var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
42
+ const scrollbarEmits = {
43
+ scroll: ({
44
+ scrollTop,
45
+ scrollLeft
46
+ }) => [scrollTop, scrollLeft].every(isNumber)
47
+ };
173
48
 
174
- export { Scrollbar as default };
49
+ export { scrollbarEmits, scrollbarProps };
175
50
  //# sourceMappingURL=scrollbar2.mjs.map