element-plus 2.3.6 → 2.3.7

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 (481) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +171 -152
  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 +18 -18
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +171 -152
  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/ckb.js +1 -1
  34. package/dist/locale/ckb.min.js +1 -1
  35. package/dist/locale/ckb.min.mjs +1 -1
  36. package/dist/locale/ckb.mjs +1 -1
  37. package/dist/locale/cs.js +1 -1
  38. package/dist/locale/cs.min.js +1 -1
  39. package/dist/locale/cs.min.mjs +1 -1
  40. package/dist/locale/cs.mjs +1 -1
  41. package/dist/locale/da.js +1 -1
  42. package/dist/locale/da.min.js +1 -1
  43. package/dist/locale/da.min.mjs +1 -1
  44. package/dist/locale/da.mjs +1 -1
  45. package/dist/locale/de.js +1 -1
  46. package/dist/locale/de.min.js +1 -1
  47. package/dist/locale/de.min.mjs +1 -1
  48. package/dist/locale/de.mjs +1 -1
  49. package/dist/locale/el.js +1 -1
  50. package/dist/locale/el.min.js +1 -1
  51. package/dist/locale/el.min.mjs +1 -1
  52. package/dist/locale/el.mjs +1 -1
  53. package/dist/locale/en.js +1 -1
  54. package/dist/locale/en.min.js +1 -1
  55. package/dist/locale/en.min.mjs +1 -1
  56. package/dist/locale/en.mjs +1 -1
  57. package/dist/locale/eo.js +1 -1
  58. package/dist/locale/eo.min.js +1 -1
  59. package/dist/locale/eo.min.mjs +1 -1
  60. package/dist/locale/eo.mjs +1 -1
  61. package/dist/locale/es.js +1 -1
  62. package/dist/locale/es.min.js +1 -1
  63. package/dist/locale/es.min.mjs +1 -1
  64. package/dist/locale/es.mjs +1 -1
  65. package/dist/locale/et.js +1 -1
  66. package/dist/locale/et.min.js +1 -1
  67. package/dist/locale/et.min.mjs +1 -1
  68. package/dist/locale/et.mjs +1 -1
  69. package/dist/locale/eu.js +1 -1
  70. package/dist/locale/eu.min.js +1 -1
  71. package/dist/locale/eu.min.mjs +1 -1
  72. package/dist/locale/eu.mjs +1 -1
  73. package/dist/locale/fa.js +1 -1
  74. package/dist/locale/fa.min.js +1 -1
  75. package/dist/locale/fa.min.mjs +1 -1
  76. package/dist/locale/fa.mjs +1 -1
  77. package/dist/locale/fi.js +1 -1
  78. package/dist/locale/fi.min.js +1 -1
  79. package/dist/locale/fi.min.mjs +1 -1
  80. package/dist/locale/fi.mjs +1 -1
  81. package/dist/locale/fr.js +1 -1
  82. package/dist/locale/fr.min.js +1 -1
  83. package/dist/locale/fr.min.mjs +1 -1
  84. package/dist/locale/fr.mjs +1 -1
  85. package/dist/locale/he.js +1 -1
  86. package/dist/locale/he.min.js +1 -1
  87. package/dist/locale/he.min.mjs +1 -1
  88. package/dist/locale/he.mjs +1 -1
  89. package/dist/locale/hr.js +1 -1
  90. package/dist/locale/hr.min.js +1 -1
  91. package/dist/locale/hr.min.mjs +1 -1
  92. package/dist/locale/hr.mjs +1 -1
  93. package/dist/locale/hu.js +1 -1
  94. package/dist/locale/hu.min.js +1 -1
  95. package/dist/locale/hu.min.mjs +1 -1
  96. package/dist/locale/hu.mjs +1 -1
  97. package/dist/locale/hy-am.js +1 -1
  98. package/dist/locale/hy-am.min.js +1 -1
  99. package/dist/locale/hy-am.min.mjs +1 -1
  100. package/dist/locale/hy-am.mjs +1 -1
  101. package/dist/locale/id.js +1 -1
  102. package/dist/locale/id.min.js +1 -1
  103. package/dist/locale/id.min.mjs +1 -1
  104. package/dist/locale/id.mjs +1 -1
  105. package/dist/locale/it.js +1 -1
  106. package/dist/locale/it.min.js +1 -1
  107. package/dist/locale/it.min.mjs +1 -1
  108. package/dist/locale/it.mjs +1 -1
  109. package/dist/locale/ja.js +1 -1
  110. package/dist/locale/ja.min.js +1 -1
  111. package/dist/locale/ja.min.mjs +1 -1
  112. package/dist/locale/ja.mjs +1 -1
  113. package/dist/locale/kk.js +1 -1
  114. package/dist/locale/kk.min.js +1 -1
  115. package/dist/locale/kk.min.mjs +1 -1
  116. package/dist/locale/kk.mjs +1 -1
  117. package/dist/locale/km.js +1 -1
  118. package/dist/locale/km.min.js +1 -1
  119. package/dist/locale/km.min.mjs +1 -1
  120. package/dist/locale/km.mjs +1 -1
  121. package/dist/locale/ko.js +1 -1
  122. package/dist/locale/ko.min.js +1 -1
  123. package/dist/locale/ko.min.mjs +1 -1
  124. package/dist/locale/ko.mjs +1 -1
  125. package/dist/locale/ku.js +1 -1
  126. package/dist/locale/ku.min.js +1 -1
  127. package/dist/locale/ku.min.mjs +1 -1
  128. package/dist/locale/ku.mjs +1 -1
  129. package/dist/locale/ky.js +1 -1
  130. package/dist/locale/ky.min.js +1 -1
  131. package/dist/locale/ky.min.mjs +1 -1
  132. package/dist/locale/ky.mjs +1 -1
  133. package/dist/locale/lt.js +1 -1
  134. package/dist/locale/lt.min.js +1 -1
  135. package/dist/locale/lt.min.mjs +1 -1
  136. package/dist/locale/lt.mjs +1 -1
  137. package/dist/locale/lv.js +1 -1
  138. package/dist/locale/lv.min.js +1 -1
  139. package/dist/locale/lv.min.mjs +1 -1
  140. package/dist/locale/lv.mjs +1 -1
  141. package/dist/locale/mg.js +1 -1
  142. package/dist/locale/mg.min.js +1 -1
  143. package/dist/locale/mg.min.mjs +1 -1
  144. package/dist/locale/mg.mjs +1 -1
  145. package/dist/locale/mn.js +1 -1
  146. package/dist/locale/mn.min.js +1 -1
  147. package/dist/locale/mn.min.mjs +1 -1
  148. package/dist/locale/mn.mjs +1 -1
  149. package/dist/locale/nb-no.js +1 -1
  150. package/dist/locale/nb-no.min.js +1 -1
  151. package/dist/locale/nb-no.min.mjs +1 -1
  152. package/dist/locale/nb-no.mjs +1 -1
  153. package/dist/locale/nl.js +1 -1
  154. package/dist/locale/nl.min.js +1 -1
  155. package/dist/locale/nl.min.mjs +1 -1
  156. package/dist/locale/nl.mjs +1 -1
  157. package/dist/locale/pa.js +1 -1
  158. package/dist/locale/pa.min.js +1 -1
  159. package/dist/locale/pa.min.mjs +1 -1
  160. package/dist/locale/pa.mjs +1 -1
  161. package/dist/locale/pl.js +1 -1
  162. package/dist/locale/pl.min.js +1 -1
  163. package/dist/locale/pl.min.mjs +1 -1
  164. package/dist/locale/pl.mjs +1 -1
  165. package/dist/locale/pt-br.js +1 -1
  166. package/dist/locale/pt-br.min.js +1 -1
  167. package/dist/locale/pt-br.min.mjs +1 -1
  168. package/dist/locale/pt-br.mjs +1 -1
  169. package/dist/locale/pt.js +1 -1
  170. package/dist/locale/pt.min.js +1 -1
  171. package/dist/locale/pt.min.mjs +1 -1
  172. package/dist/locale/pt.mjs +1 -1
  173. package/dist/locale/ro.js +1 -1
  174. package/dist/locale/ro.min.js +1 -1
  175. package/dist/locale/ro.min.mjs +1 -1
  176. package/dist/locale/ro.mjs +1 -1
  177. package/dist/locale/ru.js +1 -1
  178. package/dist/locale/ru.min.js +1 -1
  179. package/dist/locale/ru.min.mjs +1 -1
  180. package/dist/locale/ru.mjs +1 -1
  181. package/dist/locale/sk.js +1 -1
  182. package/dist/locale/sk.min.js +1 -1
  183. package/dist/locale/sk.min.mjs +1 -1
  184. package/dist/locale/sk.mjs +1 -1
  185. package/dist/locale/sl.js +1 -1
  186. package/dist/locale/sl.min.js +1 -1
  187. package/dist/locale/sl.min.mjs +1 -1
  188. package/dist/locale/sl.mjs +1 -1
  189. package/dist/locale/sr.js +10 -10
  190. package/dist/locale/sr.min.js +1 -1
  191. package/dist/locale/sr.min.js.map +1 -1
  192. package/dist/locale/sr.min.mjs +1 -1
  193. package/dist/locale/sr.min.mjs.map +1 -1
  194. package/dist/locale/sr.mjs +10 -10
  195. package/dist/locale/sv.js +1 -1
  196. package/dist/locale/sv.min.js +1 -1
  197. package/dist/locale/sv.min.mjs +1 -1
  198. package/dist/locale/sv.mjs +1 -1
  199. package/dist/locale/ta.js +1 -1
  200. package/dist/locale/ta.min.js +1 -1
  201. package/dist/locale/ta.min.mjs +1 -1
  202. package/dist/locale/ta.mjs +1 -1
  203. package/dist/locale/th.js +1 -1
  204. package/dist/locale/th.min.js +1 -1
  205. package/dist/locale/th.min.mjs +1 -1
  206. package/dist/locale/th.mjs +1 -1
  207. package/dist/locale/tk.js +1 -1
  208. package/dist/locale/tk.min.js +1 -1
  209. package/dist/locale/tk.min.mjs +1 -1
  210. package/dist/locale/tk.mjs +1 -1
  211. package/dist/locale/tr.js +1 -1
  212. package/dist/locale/tr.min.js +1 -1
  213. package/dist/locale/tr.min.mjs +1 -1
  214. package/dist/locale/tr.mjs +1 -1
  215. package/dist/locale/ug-cn.js +1 -1
  216. package/dist/locale/ug-cn.min.js +1 -1
  217. package/dist/locale/ug-cn.min.mjs +1 -1
  218. package/dist/locale/ug-cn.mjs +1 -1
  219. package/dist/locale/uk.js +1 -1
  220. package/dist/locale/uk.min.js +1 -1
  221. package/dist/locale/uk.min.mjs +1 -1
  222. package/dist/locale/uk.mjs +1 -1
  223. package/dist/locale/uz-uz.js +1 -1
  224. package/dist/locale/uz-uz.min.js +1 -1
  225. package/dist/locale/uz-uz.min.mjs +1 -1
  226. package/dist/locale/uz-uz.mjs +1 -1
  227. package/dist/locale/vi.js +1 -1
  228. package/dist/locale/vi.min.js +1 -1
  229. package/dist/locale/vi.min.mjs +1 -1
  230. package/dist/locale/vi.mjs +1 -1
  231. package/dist/locale/zh-cn.js +1 -1
  232. package/dist/locale/zh-cn.min.js +1 -1
  233. package/dist/locale/zh-cn.min.mjs +1 -1
  234. package/dist/locale/zh-cn.mjs +1 -1
  235. package/dist/locale/zh-tw.js +1 -1
  236. package/dist/locale/zh-tw.min.js +1 -1
  237. package/dist/locale/zh-tw.min.mjs +1 -1
  238. package/dist/locale/zh-tw.mjs +1 -1
  239. package/es/components/backtop/src/use-backtop.mjs +1 -0
  240. package/es/components/backtop/src/use-backtop.mjs.map +1 -1
  241. package/es/components/calendar/index.d.ts +1 -1
  242. package/es/components/calendar/index.mjs.map +1 -1
  243. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  244. package/es/components/form/index.d.ts +4 -4
  245. package/es/components/form/src/form.d.ts +1 -1
  246. package/es/components/form/src/form.mjs +1 -4
  247. package/es/components/form/src/form.mjs.map +1 -1
  248. package/es/components/form/src/form.vue.d.ts +4 -4
  249. package/es/components/form/src/types.d.ts +62 -1
  250. package/es/components/image/index.d.ts +24 -21
  251. package/es/components/image/src/image.d.ts +3 -3
  252. package/es/components/image/src/image.mjs +3 -12
  253. package/es/components/image/src/image.mjs.map +1 -1
  254. package/es/components/image/src/image.vue.d.ts +24 -21
  255. package/es/components/image/src/image2.mjs +6 -5
  256. package/es/components/image/src/image2.mjs.map +1 -1
  257. package/es/components/image-viewer/index.d.ts +10 -8
  258. package/es/components/image-viewer/src/image-viewer.d.ts +2 -2
  259. package/es/components/image-viewer/src/image-viewer.mjs +2 -8
  260. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  261. package/es/components/image-viewer/src/image-viewer.vue.d.ts +10 -8
  262. package/es/components/image-viewer/src/image-viewer2.mjs +12 -10
  263. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  264. package/es/components/index.mjs +2 -2
  265. package/es/components/input/src/input2.mjs +3 -3
  266. package/es/components/input/src/input2.mjs.map +1 -1
  267. package/es/components/pagination/src/components/sizes.vue.d.ts +0 -1
  268. package/es/components/radio/index.mjs +2 -2
  269. package/es/components/radio/src/radio-button.mjs +1 -1
  270. package/es/components/radio/src/radio-group.mjs +1 -1
  271. package/es/components/radio/src/radio.mjs +30 -71
  272. package/es/components/radio/src/radio.mjs.map +1 -1
  273. package/es/components/radio/src/radio2.mjs +71 -30
  274. package/es/components/radio/src/radio2.mjs.map +1 -1
  275. package/es/components/scrollbar/index.mjs +2 -2
  276. package/es/components/scrollbar/src/scrollbar.mjs +174 -46
  277. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  278. package/es/components/scrollbar/src/scrollbar2.mjs +46 -174
  279. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  280. package/es/components/select/index.d.ts +0 -1
  281. package/es/components/select/src/select.mjs +7 -8
  282. package/es/components/select/src/select.mjs.map +1 -1
  283. package/es/components/select/src/select.vue.d.ts +0 -1
  284. package/es/components/select/src/useSelect.d.ts +0 -1
  285. package/es/components/select/src/useSelect.mjs +1 -4
  286. package/es/components/select/src/useSelect.mjs.map +1 -1
  287. package/es/components/select-v2/src/useSelect.mjs +19 -10
  288. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  289. package/es/components/switch/index.d.ts +38 -35
  290. package/es/components/switch/src/switch.d.ts +26 -11
  291. package/es/components/switch/src/switch.mjs +21 -21
  292. package/es/components/switch/src/switch.mjs.map +1 -1
  293. package/es/components/switch/src/switch.vue.d.ts +38 -35
  294. package/es/components/switch/src/switch2.mjs +33 -21
  295. package/es/components/switch/src/switch2.mjs.map +1 -1
  296. package/es/components/table/index.d.ts +21 -5
  297. package/es/components/table/src/store/watcher.mjs +1 -1
  298. package/es/components/table/src/store/watcher.mjs.map +1 -1
  299. package/es/components/table/src/table/defaults.d.ts +3 -0
  300. package/es/components/table/src/table/defaults.mjs +2 -1
  301. package/es/components/table/src/table/defaults.mjs.map +1 -1
  302. package/es/components/table/src/table/style-helper.mjs +4 -2
  303. package/es/components/table/src/table/style-helper.mjs.map +1 -1
  304. package/es/components/table/src/table/utils-helper.d.ts +1 -1
  305. package/es/components/table/src/table/utils-helper.mjs.map +1 -1
  306. package/es/components/table/src/table-column/defaults.d.ts +4 -1
  307. package/es/components/table/src/table-column/defaults.mjs +4 -1
  308. package/es/components/table/src/table-column/defaults.mjs.map +1 -1
  309. package/es/components/table/src/table-column/index.d.ts +9 -2
  310. package/es/components/table/src/table-column/index.mjs +3 -1
  311. package/es/components/table/src/table-column/index.mjs.map +1 -1
  312. package/es/components/table/src/table.vue.d.ts +3 -1
  313. package/es/components/teleport/index.mjs +2 -2
  314. package/es/components/teleport/src/teleport.mjs +18 -44
  315. package/es/components/teleport/src/teleport.mjs.map +1 -1
  316. package/es/components/teleport/src/teleport2.mjs +44 -18
  317. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  318. package/es/components/time-picker/src/common/picker.mjs +19 -18
  319. package/es/components/time-picker/src/common/picker.mjs.map +1 -1
  320. package/es/components/time-picker/src/common/picker.vue.d.ts +5 -0
  321. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.mjs +7 -1
  322. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.mjs.map +1 -1
  323. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +526 -526
  324. package/es/components/time-picker/src/time-picker-com/panel-time-range.mjs +14 -12
  325. package/es/components/time-picker/src/time-picker-com/panel-time-range.mjs.map +1 -1
  326. package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -0
  327. package/es/components/time-select/index.d.ts +0 -4
  328. package/es/components/time-select/src/time-select.vue.d.ts +0 -2
  329. package/es/components/tooltip-v2/index.mjs +1 -1
  330. package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
  331. package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
  332. package/es/components/tooltip-v2/src/trigger.mjs +89 -12
  333. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  334. package/es/components/tooltip-v2/src/trigger2.mjs +12 -89
  335. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  336. package/es/components/upload/src/upload-list2.mjs +7 -5
  337. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  338. package/es/index.mjs +2 -2
  339. package/es/locale/lang/sr.mjs +9 -9
  340. package/es/locale/lang/sr.mjs.map +1 -1
  341. package/es/version.d.ts +1 -1
  342. package/es/version.mjs +1 -1
  343. package/es/version.mjs.map +1 -1
  344. package/lib/components/backtop/src/use-backtop.js +1 -0
  345. package/lib/components/backtop/src/use-backtop.js.map +1 -1
  346. package/lib/components/calendar/index.d.ts +1 -1
  347. package/lib/components/calendar/index.js.map +1 -1
  348. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  349. package/lib/components/form/index.d.ts +4 -4
  350. package/lib/components/form/src/form.d.ts +1 -1
  351. package/lib/components/form/src/form.js +1 -4
  352. package/lib/components/form/src/form.js.map +1 -1
  353. package/lib/components/form/src/form.vue.d.ts +4 -4
  354. package/lib/components/form/src/types.d.ts +62 -1
  355. package/lib/components/image/index.d.ts +24 -21
  356. package/lib/components/image/src/image.d.ts +3 -3
  357. package/lib/components/image/src/image.js +3 -12
  358. package/lib/components/image/src/image.js.map +1 -1
  359. package/lib/components/image/src/image.vue.d.ts +24 -21
  360. package/lib/components/image/src/image2.js +6 -5
  361. package/lib/components/image/src/image2.js.map +1 -1
  362. package/lib/components/image-viewer/index.d.ts +10 -8
  363. package/lib/components/image-viewer/src/image-viewer.d.ts +2 -2
  364. package/lib/components/image-viewer/src/image-viewer.js +2 -8
  365. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  366. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +10 -8
  367. package/lib/components/image-viewer/src/image-viewer2.js +12 -10
  368. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  369. package/lib/components/index.js +2 -2
  370. package/lib/components/input/src/input2.js +3 -3
  371. package/lib/components/input/src/input2.js.map +1 -1
  372. package/lib/components/pagination/src/components/sizes.vue.d.ts +0 -1
  373. package/lib/components/radio/index.js +2 -2
  374. package/lib/components/radio/src/radio-button.js +1 -1
  375. package/lib/components/radio/src/radio-group.js +1 -1
  376. package/lib/components/radio/src/radio.js +32 -71
  377. package/lib/components/radio/src/radio.js.map +1 -1
  378. package/lib/components/radio/src/radio2.js +71 -32
  379. package/lib/components/radio/src/radio2.js.map +1 -1
  380. package/lib/components/scrollbar/index.js +2 -2
  381. package/lib/components/scrollbar/src/scrollbar.js +174 -47
  382. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  383. package/lib/components/scrollbar/src/scrollbar2.js +47 -174
  384. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  385. package/lib/components/select/index.d.ts +0 -1
  386. package/lib/components/select/src/select.js +7 -8
  387. package/lib/components/select/src/select.js.map +1 -1
  388. package/lib/components/select/src/select.vue.d.ts +0 -1
  389. package/lib/components/select/src/useSelect.d.ts +0 -1
  390. package/lib/components/select/src/useSelect.js +1 -4
  391. package/lib/components/select/src/useSelect.js.map +1 -1
  392. package/lib/components/select-v2/src/useSelect.js +19 -10
  393. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  394. package/lib/components/switch/index.d.ts +38 -35
  395. package/lib/components/switch/src/switch.d.ts +26 -11
  396. package/lib/components/switch/src/switch.js +21 -21
  397. package/lib/components/switch/src/switch.js.map +1 -1
  398. package/lib/components/switch/src/switch.vue.d.ts +38 -35
  399. package/lib/components/switch/src/switch2.js +33 -21
  400. package/lib/components/switch/src/switch2.js.map +1 -1
  401. package/lib/components/table/index.d.ts +21 -5
  402. package/lib/components/table/src/store/watcher.js +1 -1
  403. package/lib/components/table/src/store/watcher.js.map +1 -1
  404. package/lib/components/table/src/table/defaults.d.ts +3 -0
  405. package/lib/components/table/src/table/defaults.js +2 -1
  406. package/lib/components/table/src/table/defaults.js.map +1 -1
  407. package/lib/components/table/src/table/style-helper.js +4 -2
  408. package/lib/components/table/src/table/style-helper.js.map +1 -1
  409. package/lib/components/table/src/table/utils-helper.d.ts +1 -1
  410. package/lib/components/table/src/table/utils-helper.js.map +1 -1
  411. package/lib/components/table/src/table-column/defaults.d.ts +4 -1
  412. package/lib/components/table/src/table-column/defaults.js +4 -1
  413. package/lib/components/table/src/table-column/defaults.js.map +1 -1
  414. package/lib/components/table/src/table-column/index.d.ts +9 -2
  415. package/lib/components/table/src/table-column/index.js +3 -1
  416. package/lib/components/table/src/table-column/index.js.map +1 -1
  417. package/lib/components/table/src/table.vue.d.ts +3 -1
  418. package/lib/components/teleport/index.js +2 -2
  419. package/lib/components/teleport/src/teleport.js +18 -44
  420. package/lib/components/teleport/src/teleport.js.map +1 -1
  421. package/lib/components/teleport/src/teleport2.js +44 -18
  422. package/lib/components/teleport/src/teleport2.js.map +1 -1
  423. package/lib/components/time-picker/src/common/picker.js +18 -17
  424. package/lib/components/time-picker/src/common/picker.js.map +1 -1
  425. package/lib/components/time-picker/src/common/picker.vue.d.ts +5 -0
  426. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.js +7 -1
  427. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.js.map +1 -1
  428. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +526 -526
  429. package/lib/components/time-picker/src/time-picker-com/panel-time-range.js +14 -12
  430. package/lib/components/time-picker/src/time-picker-com/panel-time-range.js.map +1 -1
  431. package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -0
  432. package/lib/components/time-select/index.d.ts +0 -4
  433. package/lib/components/time-select/src/time-select.vue.d.ts +0 -2
  434. package/lib/components/tooltip-v2/index.js +1 -1
  435. package/lib/components/tooltip-v2/src/tooltip.js +1 -1
  436. package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
  437. package/lib/components/tooltip-v2/src/trigger.js +89 -12
  438. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  439. package/lib/components/tooltip-v2/src/trigger2.js +12 -89
  440. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  441. package/lib/components/upload/src/upload-list2.js +7 -5
  442. package/lib/components/upload/src/upload-list2.js.map +1 -1
  443. package/lib/index.js +2 -2
  444. package/lib/locale/lang/sr.js +9 -9
  445. package/lib/locale/lang/sr.js.map +1 -1
  446. package/lib/version.d.ts +1 -1
  447. package/lib/version.js +1 -1
  448. package/lib/version.js.map +1 -1
  449. package/package.json +2 -2
  450. package/tags.json +1 -1
  451. package/theme-chalk/el-checkbox-button.css +1 -1
  452. package/theme-chalk/el-date-picker.css +1 -1
  453. package/theme-chalk/el-form.css +1 -1
  454. package/theme-chalk/el-input-number.css +1 -1
  455. package/theme-chalk/el-input.css +1 -1
  456. package/theme-chalk/el-tag.css +1 -1
  457. package/theme-chalk/el-time-picker.css +1 -1
  458. package/theme-chalk/el-time-select.css +1 -1
  459. package/theme-chalk/index.css +1 -1
  460. package/theme-chalk/src/alert.scss +0 -2
  461. package/theme-chalk/src/badge.scss +0 -3
  462. package/theme-chalk/src/carousel.scss +0 -2
  463. package/theme-chalk/src/check-tag.scss +0 -2
  464. package/theme-chalk/src/checkbox-button.scss +1 -1
  465. package/theme-chalk/src/common/var.scss +2 -0
  466. package/theme-chalk/src/dark/css-vars.scss +0 -2
  467. package/theme-chalk/src/date-picker/picker.scss +0 -1
  468. package/theme-chalk/src/form.scss +7 -0
  469. package/theme-chalk/src/icon.scss +0 -2
  470. package/theme-chalk/src/input-number.scss +1 -1
  471. package/theme-chalk/src/input.scss +1 -1
  472. package/theme-chalk/src/loading.scss +0 -2
  473. package/theme-chalk/src/message.scss +0 -2
  474. package/theme-chalk/src/mixins/_button.scss +0 -2
  475. package/theme-chalk/src/pagination.scss +0 -2
  476. package/theme-chalk/src/table-v2.scss +0 -2
  477. package/theme-chalk/src/tag.scss +1 -1
  478. package/theme-chalk/src/timeline-item.scss +0 -1
  479. package/theme-chalk/src/transfer.scss +0 -3
  480. package/theme-chalk/src/var.scss +0 -2
  481. package/web-types.json +1 -1
@@ -2,57 +2,184 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var vue = require('vue');
6
+ var core = require('@vueuse/core');
5
7
  require('../../../utils/index.js');
6
- var runtime = require('../../../utils/vue/props/runtime.js');
8
+ require('../../../hooks/index.js');
9
+ var util = require('./util.js');
10
+ var bar = require('./bar2.js');
11
+ var constants = require('./constants.js');
12
+ var scrollbar = require('./scrollbar2.js');
13
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
14
+ var index = require('../../../hooks/use-namespace/index.js');
15
+ var style = require('../../../utils/dom/style.js');
16
+ var shared = require('@vue/shared');
7
17
  var types = require('../../../utils/types.js');
18
+ var error = require('../../../utils/error.js');
8
19
 
9
- const scrollbarProps = runtime.buildProps({
10
- height: {
11
- type: [String, Number],
12
- default: ""
13
- },
14
- maxHeight: {
15
- type: [String, Number],
16
- default: ""
17
- },
18
- native: {
19
- type: Boolean,
20
- default: false
21
- },
22
- wrapStyle: {
23
- type: runtime.definePropType([String, Object, Array]),
24
- default: ""
25
- },
26
- wrapClass: {
27
- type: [String, Array],
28
- default: ""
29
- },
30
- viewClass: {
31
- type: [String, Array],
32
- default: ""
33
- },
34
- viewStyle: {
35
- type: [String, Array, Object],
36
- default: ""
37
- },
38
- noresize: Boolean,
39
- tag: {
40
- type: String,
41
- default: "div"
42
- },
43
- always: Boolean,
44
- minSize: {
45
- type: Number,
46
- default: 20
20
+ const COMPONENT_NAME = "ElScrollbar";
21
+ const __default__ = vue.defineComponent({
22
+ name: COMPONENT_NAME
23
+ });
24
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
+ ...__default__,
26
+ props: scrollbar.scrollbarProps,
27
+ emits: scrollbar.scrollbarEmits,
28
+ setup(__props, { expose, emit }) {
29
+ const props = __props;
30
+ const ns = index.useNamespace("scrollbar");
31
+ let stopResizeObserver = void 0;
32
+ let stopResizeListener = void 0;
33
+ const scrollbarRef = vue.ref();
34
+ const wrapRef = vue.ref();
35
+ const resizeRef = vue.ref();
36
+ const sizeWidth = vue.ref("0");
37
+ const sizeHeight = vue.ref("0");
38
+ const barRef = vue.ref();
39
+ const ratioY = vue.ref(1);
40
+ const ratioX = vue.ref(1);
41
+ const style$1 = vue.computed(() => {
42
+ const style2 = {};
43
+ if (props.height)
44
+ style2.height = style.addUnit(props.height);
45
+ if (props.maxHeight)
46
+ style2.maxHeight = style.addUnit(props.maxHeight);
47
+ return [props.wrapStyle, style2];
48
+ });
49
+ const wrapKls = vue.computed(() => {
50
+ return [
51
+ props.wrapClass,
52
+ ns.e("wrap"),
53
+ { [ns.em("wrap", "hidden-default")]: !props.native }
54
+ ];
55
+ });
56
+ const resizeKls = vue.computed(() => {
57
+ return [ns.e("view"), props.viewClass];
58
+ });
59
+ const handleScroll = () => {
60
+ var _a;
61
+ if (wrapRef.value) {
62
+ (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
63
+ emit("scroll", {
64
+ scrollTop: wrapRef.value.scrollTop,
65
+ scrollLeft: wrapRef.value.scrollLeft
66
+ });
67
+ }
68
+ };
69
+ function scrollTo(arg1, arg2) {
70
+ if (shared.isObject(arg1)) {
71
+ wrapRef.value.scrollTo(arg1);
72
+ } else if (types.isNumber(arg1) && types.isNumber(arg2)) {
73
+ wrapRef.value.scrollTo(arg1, arg2);
74
+ }
75
+ }
76
+ const setScrollTop = (value) => {
77
+ if (!types.isNumber(value)) {
78
+ error.debugWarn(COMPONENT_NAME, "value must be a number");
79
+ return;
80
+ }
81
+ wrapRef.value.scrollTop = value;
82
+ };
83
+ const setScrollLeft = (value) => {
84
+ if (!types.isNumber(value)) {
85
+ error.debugWarn(COMPONENT_NAME, "value must be a number");
86
+ return;
87
+ }
88
+ wrapRef.value.scrollLeft = value;
89
+ };
90
+ const update = () => {
91
+ if (!wrapRef.value)
92
+ return;
93
+ const offsetHeight = wrapRef.value.offsetHeight - util.GAP;
94
+ const offsetWidth = wrapRef.value.offsetWidth - util.GAP;
95
+ const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
96
+ const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
97
+ const height = Math.max(originalHeight, props.minSize);
98
+ const width = Math.max(originalWidth, props.minSize);
99
+ ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
100
+ ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
101
+ sizeHeight.value = height + util.GAP < offsetHeight ? `${height}px` : "";
102
+ sizeWidth.value = width + util.GAP < offsetWidth ? `${width}px` : "";
103
+ };
104
+ vue.watch(() => props.noresize, (noresize) => {
105
+ if (noresize) {
106
+ stopResizeObserver == null ? void 0 : stopResizeObserver();
107
+ stopResizeListener == null ? void 0 : stopResizeListener();
108
+ } else {
109
+ ;
110
+ ({ stop: stopResizeObserver } = core.useResizeObserver(resizeRef, update));
111
+ stopResizeListener = core.useEventListener("resize", update);
112
+ }
113
+ }, { immediate: true });
114
+ vue.watch(() => [props.maxHeight, props.height], () => {
115
+ if (!props.native)
116
+ vue.nextTick(() => {
117
+ var _a;
118
+ update();
119
+ if (wrapRef.value) {
120
+ (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
121
+ }
122
+ });
123
+ });
124
+ vue.provide(constants.scrollbarContextKey, vue.reactive({
125
+ scrollbarElement: scrollbarRef,
126
+ wrapElement: wrapRef
127
+ }));
128
+ vue.onMounted(() => {
129
+ if (!props.native)
130
+ vue.nextTick(() => {
131
+ update();
132
+ });
133
+ });
134
+ vue.onUpdated(() => update());
135
+ expose({
136
+ wrapRef,
137
+ update,
138
+ scrollTo,
139
+ setScrollTop,
140
+ setScrollLeft,
141
+ handleScroll
142
+ });
143
+ return (_ctx, _cache) => {
144
+ return vue.openBlock(), vue.createElementBlock("div", {
145
+ ref_key: "scrollbarRef",
146
+ ref: scrollbarRef,
147
+ class: vue.normalizeClass(vue.unref(ns).b())
148
+ }, [
149
+ vue.createElementVNode("div", {
150
+ ref_key: "wrapRef",
151
+ ref: wrapRef,
152
+ class: vue.normalizeClass(vue.unref(wrapKls)),
153
+ style: vue.normalizeStyle(vue.unref(style$1)),
154
+ onScroll: handleScroll
155
+ }, [
156
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
157
+ ref_key: "resizeRef",
158
+ ref: resizeRef,
159
+ class: vue.normalizeClass(vue.unref(resizeKls)),
160
+ style: vue.normalizeStyle(_ctx.viewStyle)
161
+ }, {
162
+ default: vue.withCtx(() => [
163
+ vue.renderSlot(_ctx.$slots, "default")
164
+ ]),
165
+ _: 3
166
+ }, 8, ["class", "style"]))
167
+ ], 38),
168
+ !_ctx.native ? (vue.openBlock(), vue.createBlock(bar["default"], {
169
+ key: 0,
170
+ ref_key: "barRef",
171
+ ref: barRef,
172
+ height: sizeHeight.value,
173
+ width: sizeWidth.value,
174
+ always: _ctx.always,
175
+ "ratio-x": ratioX.value,
176
+ "ratio-y": ratioY.value
177
+ }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : vue.createCommentVNode("v-if", true)
178
+ ], 2);
179
+ };
47
180
  }
48
181
  });
49
- const scrollbarEmits = {
50
- scroll: ({
51
- scrollTop,
52
- scrollLeft
53
- }) => [scrollTop, scrollLeft].every(types.isNumber)
54
- };
182
+ var Scrollbar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
55
183
 
56
- exports.scrollbarEmits = scrollbarEmits;
57
- exports.scrollbarProps = scrollbarProps;
184
+ exports["default"] = Scrollbar;
58
185
  //# sourceMappingURL=scrollbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.js","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 /**\n * @description height of scrollbar\n */\n height: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description max height of scrollbar\n */\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether to use the native scrollbar\n */\n native: {\n type: Boolean,\n default: false,\n },\n /**\n * @description style of wrap\n */\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n /**\n * @description class of wrap\n */\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description class of view\n */\n viewClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description style of view\n */\n viewStyle: {\n type: [String, Array, Object],\n default: '',\n },\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n /**\n * @description element tag of the view\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description always show\n */\n always: Boolean,\n /**\n * @description minimum size of scrollbar\n */\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":["buildProps","definePropType","isNumber"],"mappings":";;;;;;;;AACY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,CAAC,MA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
1
+ {"version":3,"file":"scrollbar.js","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbarRef\" :class=\"ns.b()\">\n <div ref=\"wrapRef\" :class=\"wrapKls\" :style=\"style\" @scroll=\"handleScroll\">\n <component\n :is=\"tag\"\n ref=\"resizeRef\"\n :class=\"resizeKls\"\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 { useNamespace } from '@element-plus/hooks'\nimport { GAP } from './util'\nimport Bar from './bar.vue'\nimport { scrollbarContextKey } from './constants'\nimport { scrollbarEmits, scrollbarProps } from './scrollbar'\nimport type { BarInstance } from './bar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nconst COMPONENT_NAME = 'ElScrollbar'\n\ndefineOptions({\n name: COMPONENT_NAME,\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 scrollbarRef = ref<HTMLDivElement>()\nconst wrapRef = ref<HTMLDivElement>()\nconst resizeRef = ref<HTMLElement>()\n\nconst sizeWidth = ref('0')\nconst sizeHeight = ref('0')\nconst barRef = ref<BarInstance>()\nconst ratioY = ref(1)\nconst ratioX = ref(1)\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 wrapKls = computed(() => {\n return [\n props.wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !props.native },\n ]\n})\n\nconst resizeKls = computed(() => {\n return [ns.e('view'), props.viewClass]\n})\n\nconst handleScroll = () => {\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n\n emit('scroll', {\n scrollTop: wrapRef.value.scrollTop,\n scrollLeft: wrapRef.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 wrapRef.value!.scrollTo(arg1)\n } else if (isNumber(arg1) && isNumber(arg2)) {\n wrapRef.value!.scrollTo(arg1, arg2)\n }\n}\n\nconst setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollTop = value\n}\n\nconst setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollLeft = value\n}\n\nconst update = () => {\n if (!wrapRef.value) return\n const offsetHeight = wrapRef.value.offsetHeight - GAP\n const offsetWidth = wrapRef.value.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrapRef.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(resizeRef, 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 (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n }\n })\n }\n)\n\nprovide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbarRef,\n wrapElement: wrapRef,\n })\n)\n\nonMounted(() => {\n if (!props.native)\n nextTick(() => {\n update()\n })\n})\nonUpdated(() => update())\n\ndefineExpose({\n /** @description scrollbar wrap ref */\n wrapRef,\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,\n /** @description handle scroll event */\n handleScroll,\n})\n</script>\n"],"names":["useNamespace","ref","style","computed","addUnit","isObject","isNumber","debugWarn","GAP","watch","useResizeObserver","useEventListener","nextTick","provide","scrollbarContextKey","reactive","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;uCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AACnD,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AAEnD,IAAA,MAAM,eAAeC,OAAoB,EAAA,CAAA;AACzC,IAAA,MAAM,UAAUA,OAAoB,EAAA,CAAA;AACpC,IAAA,MAAM,YAAYA,OAAiB,EAAA,CAAA;AAEnC,IAAM,MAAA,SAAA,GAAYA,QAAI,GAAG,CAAA,CAAA;AACzB,IAAM,MAAA,UAAA,GAAaA,QAAI,GAAG,CA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 
5
- var vue = require('vue');
6
- var core = require('@vueuse/core');
7
5
  require('../../../utils/index.js');
8
- require('../../../hooks/index.js');
9
- var util = require('./util.js');
10
- var bar = require('./bar2.js');
11
- var constants = require('./constants.js');
12
- var scrollbar = require('./scrollbar.js');
13
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
14
- var index = require('../../../hooks/use-namespace/index.js');
15
- var style = require('../../../utils/dom/style.js');
16
- var shared = require('@vue/shared');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
17
7
  var types = require('../../../utils/types.js');
18
- var error = require('../../../utils/error.js');
19
8
 
20
- const COMPONENT_NAME = "ElScrollbar";
21
- const __default__ = vue.defineComponent({
22
- name: COMPONENT_NAME
23
- });
24
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
- ...__default__,
26
- props: scrollbar.scrollbarProps,
27
- emits: scrollbar.scrollbarEmits,
28
- setup(__props, { expose, emit }) {
29
- const props = __props;
30
- const ns = index.useNamespace("scrollbar");
31
- let stopResizeObserver = void 0;
32
- let stopResizeListener = void 0;
33
- const scrollbarRef = vue.ref();
34
- const wrapRef = vue.ref();
35
- const resizeRef = vue.ref();
36
- const sizeWidth = vue.ref("0");
37
- const sizeHeight = vue.ref("0");
38
- const barRef = vue.ref();
39
- const ratioY = vue.ref(1);
40
- const ratioX = vue.ref(1);
41
- const style$1 = vue.computed(() => {
42
- const style2 = {};
43
- if (props.height)
44
- style2.height = style.addUnit(props.height);
45
- if (props.maxHeight)
46
- style2.maxHeight = style.addUnit(props.maxHeight);
47
- return [props.wrapStyle, style2];
48
- });
49
- const wrapKls = vue.computed(() => {
50
- return [
51
- props.wrapClass,
52
- ns.e("wrap"),
53
- { [ns.em("wrap", "hidden-default")]: !props.native }
54
- ];
55
- });
56
- const resizeKls = vue.computed(() => {
57
- return [ns.e("view"), props.viewClass];
58
- });
59
- const handleScroll = () => {
60
- var _a;
61
- if (wrapRef.value) {
62
- (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
63
- emit("scroll", {
64
- scrollTop: wrapRef.value.scrollTop,
65
- scrollLeft: wrapRef.value.scrollLeft
66
- });
67
- }
68
- };
69
- function scrollTo(arg1, arg2) {
70
- if (shared.isObject(arg1)) {
71
- wrapRef.value.scrollTo(arg1);
72
- } else if (types.isNumber(arg1) && types.isNumber(arg2)) {
73
- wrapRef.value.scrollTo(arg1, arg2);
74
- }
75
- }
76
- const setScrollTop = (value) => {
77
- if (!types.isNumber(value)) {
78
- error.debugWarn(COMPONENT_NAME, "value must be a number");
79
- return;
80
- }
81
- wrapRef.value.scrollTop = value;
82
- };
83
- const setScrollLeft = (value) => {
84
- if (!types.isNumber(value)) {
85
- error.debugWarn(COMPONENT_NAME, "value must be a number");
86
- return;
87
- }
88
- wrapRef.value.scrollLeft = value;
89
- };
90
- const update = () => {
91
- if (!wrapRef.value)
92
- return;
93
- const offsetHeight = wrapRef.value.offsetHeight - util.GAP;
94
- const offsetWidth = wrapRef.value.offsetWidth - util.GAP;
95
- const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
96
- const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
97
- const height = Math.max(originalHeight, props.minSize);
98
- const width = Math.max(originalWidth, props.minSize);
99
- ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
100
- ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
101
- sizeHeight.value = height + util.GAP < offsetHeight ? `${height}px` : "";
102
- sizeWidth.value = width + util.GAP < offsetWidth ? `${width}px` : "";
103
- };
104
- vue.watch(() => props.noresize, (noresize) => {
105
- if (noresize) {
106
- stopResizeObserver == null ? void 0 : stopResizeObserver();
107
- stopResizeListener == null ? void 0 : stopResizeListener();
108
- } else {
109
- ;
110
- ({ stop: stopResizeObserver } = core.useResizeObserver(resizeRef, update));
111
- stopResizeListener = core.useEventListener("resize", update);
112
- }
113
- }, { immediate: true });
114
- vue.watch(() => [props.maxHeight, props.height], () => {
115
- if (!props.native)
116
- vue.nextTick(() => {
117
- var _a;
118
- update();
119
- if (wrapRef.value) {
120
- (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
121
- }
122
- });
123
- });
124
- vue.provide(constants.scrollbarContextKey, vue.reactive({
125
- scrollbarElement: scrollbarRef,
126
- wrapElement: wrapRef
127
- }));
128
- vue.onMounted(() => {
129
- if (!props.native)
130
- vue.nextTick(() => {
131
- update();
132
- });
133
- });
134
- vue.onUpdated(() => update());
135
- expose({
136
- wrapRef,
137
- update,
138
- scrollTo,
139
- setScrollTop,
140
- setScrollLeft,
141
- handleScroll
142
- });
143
- return (_ctx, _cache) => {
144
- return vue.openBlock(), vue.createElementBlock("div", {
145
- ref_key: "scrollbarRef",
146
- ref: scrollbarRef,
147
- class: vue.normalizeClass(vue.unref(ns).b())
148
- }, [
149
- vue.createElementVNode("div", {
150
- ref_key: "wrapRef",
151
- ref: wrapRef,
152
- class: vue.normalizeClass(vue.unref(wrapKls)),
153
- style: vue.normalizeStyle(vue.unref(style$1)),
154
- onScroll: handleScroll
155
- }, [
156
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
157
- ref_key: "resizeRef",
158
- ref: resizeRef,
159
- class: vue.normalizeClass(vue.unref(resizeKls)),
160
- style: vue.normalizeStyle(_ctx.viewStyle)
161
- }, {
162
- default: vue.withCtx(() => [
163
- vue.renderSlot(_ctx.$slots, "default")
164
- ]),
165
- _: 3
166
- }, 8, ["class", "style"]))
167
- ], 38),
168
- !_ctx.native ? (vue.openBlock(), vue.createBlock(bar["default"], {
169
- key: 0,
170
- ref_key: "barRef",
171
- ref: barRef,
172
- height: sizeHeight.value,
173
- width: sizeWidth.value,
174
- always: _ctx.always,
175
- "ratio-x": ratioX.value,
176
- "ratio-y": ratioY.value
177
- }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : vue.createCommentVNode("v-if", true)
178
- ], 2);
179
- };
9
+ const scrollbarProps = runtime.buildProps({
10
+ height: {
11
+ type: [String, Number],
12
+ default: ""
13
+ },
14
+ maxHeight: {
15
+ type: [String, Number],
16
+ default: ""
17
+ },
18
+ native: {
19
+ type: Boolean,
20
+ default: false
21
+ },
22
+ wrapStyle: {
23
+ type: runtime.definePropType([String, Object, Array]),
24
+ default: ""
25
+ },
26
+ wrapClass: {
27
+ type: [String, Array],
28
+ default: ""
29
+ },
30
+ viewClass: {
31
+ type: [String, Array],
32
+ default: ""
33
+ },
34
+ viewStyle: {
35
+ type: [String, Array, Object],
36
+ default: ""
37
+ },
38
+ noresize: Boolean,
39
+ tag: {
40
+ type: String,
41
+ default: "div"
42
+ },
43
+ always: Boolean,
44
+ minSize: {
45
+ type: Number,
46
+ default: 20
180
47
  }
181
48
  });
182
- var Scrollbar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
49
+ const scrollbarEmits = {
50
+ scroll: ({
51
+ scrollTop,
52
+ scrollLeft
53
+ }) => [scrollTop, scrollLeft].every(types.isNumber)
54
+ };
183
55
 
184
- exports["default"] = Scrollbar;
56
+ exports.scrollbarEmits = scrollbarEmits;
57
+ exports.scrollbarProps = scrollbarProps;
185
58
  //# sourceMappingURL=scrollbar2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar2.js","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbarRef\" :class=\"ns.b()\">\n <div ref=\"wrapRef\" :class=\"wrapKls\" :style=\"style\" @scroll=\"handleScroll\">\n <component\n :is=\"tag\"\n ref=\"resizeRef\"\n :class=\"resizeKls\"\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 { useNamespace } from '@element-plus/hooks'\nimport { GAP } from './util'\nimport Bar from './bar.vue'\nimport { scrollbarContextKey } from './constants'\nimport { scrollbarEmits, scrollbarProps } from './scrollbar'\nimport type { BarInstance } from './bar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nconst COMPONENT_NAME = 'ElScrollbar'\n\ndefineOptions({\n name: COMPONENT_NAME,\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 scrollbarRef = ref<HTMLDivElement>()\nconst wrapRef = ref<HTMLDivElement>()\nconst resizeRef = ref<HTMLElement>()\n\nconst sizeWidth = ref('0')\nconst sizeHeight = ref('0')\nconst barRef = ref<BarInstance>()\nconst ratioY = ref(1)\nconst ratioX = ref(1)\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 wrapKls = computed(() => {\n return [\n props.wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !props.native },\n ]\n})\n\nconst resizeKls = computed(() => {\n return [ns.e('view'), props.viewClass]\n})\n\nconst handleScroll = () => {\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n\n emit('scroll', {\n scrollTop: wrapRef.value.scrollTop,\n scrollLeft: wrapRef.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 wrapRef.value!.scrollTo(arg1)\n } else if (isNumber(arg1) && isNumber(arg2)) {\n wrapRef.value!.scrollTo(arg1, arg2)\n }\n}\n\nconst setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollTop = value\n}\n\nconst setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollLeft = value\n}\n\nconst update = () => {\n if (!wrapRef.value) return\n const offsetHeight = wrapRef.value.offsetHeight - GAP\n const offsetWidth = wrapRef.value.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrapRef.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(resizeRef, 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 (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n }\n })\n }\n)\n\nprovide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbarRef,\n wrapElement: wrapRef,\n })\n)\n\nonMounted(() => {\n if (!props.native)\n nextTick(() => {\n update()\n })\n})\nonUpdated(() => update())\n\ndefineExpose({\n /** @description scrollbar wrap ref */\n wrapRef,\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,\n /** @description handle scroll event */\n handleScroll,\n})\n</script>\n"],"names":["useNamespace","ref","style","computed","addUnit","isObject","isNumber","debugWarn","GAP","watch","useResizeObserver","useEventListener","nextTick","provide","scrollbarContextKey","reactive","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;uCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AACnD,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AAEnD,IAAA,MAAM,eAAeC,OAAoB,EAAA,CAAA;AACzC,IAAA,MAAM,UAAUA,OAAoB,EAAA,CAAA;AACpC,IAAA,MAAM,YAAYA,OAAiB,EAAA,CAAA;AAEnC,IAAM,MAAA,SAAA,GAAYA,QAAI,GAAG,CAAA,CAAA;AACzB,IAAM,MAAA,UAAA,GAAaA,QAAI,GAAG,CAAA,CAAA;AAC1B,IAAA,MAAM,SAASA,OAAiB,EAAA,CAAA;AAChC,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AAEpB,IAAM,MAAAC,OAAA,GAAQC,aAAqB,MAAM;AACvC,MAAA,MAAM,SAAuB,EAAC,CAAA;AAC9B,MAAA,IAAI,KAAM,CAAA,MAAA;AAAQ,QAAM,MAAA,CAAA,MAAA,GAASC,aAAQ,CAAA,KAAA,CAAM,MAAM,CAAA,CAAA;AACrD,MAAA,IAAI,KAAM,CAAA,SAAA;AAAW,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KAAA,EAAA;AAAA,YACD,CAAA,EAAA,GAAA,MAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAA,CAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AAAA,WAEP;AAEA,SAAA,CAAA,CAAA;AAEW,KAAA,CACP,CAAkB;AAAA,IAAAC,WACL,CAAAC,6BAAA,EAAAC,YAAA,CAAA;AAAA,MAEjB,gBAAA,EAAA,YAAA;AAEA,MAAA,WAAgB,EAAA,OAAA;AACd,KAAA,CAAA,CAAA,CAAA;AACE,IAAAC,aAAA,CAAA,MAAe;AACb,MAAO,IAAA,CAAA,KAAA,CAAA,MAAA;AAAA,QACTJ,YAAC,CAAA,MAAA;AAAA,UACJ,MAAA,EAAA,CAAA;AACD,SAAU,CAAA,CAAA;AAEV,KAAa,CAAA,CAAA;AAAA,IAEXK,aAAA,CAAA,MAAA,MAAA,EAAA,CAAA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MAEA,OAAA;AAAA,MAEA,MAAA;AAAA,MAEA,QAAA;AAAA,MAEA,YAAA;AAAA,MACD,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"scrollbar2.js","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 /**\n * @description height of scrollbar\n */\n height: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description max height of scrollbar\n */\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether to use the native scrollbar\n */\n native: {\n type: Boolean,\n default: false,\n },\n /**\n * @description style of wrap\n */\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n /**\n * @description class of wrap\n */\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description class of view\n */\n viewClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description style of view\n */\n viewStyle: {\n type: [String, Array, Object],\n default: '',\n },\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n /**\n * @description element tag of the view\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description always show\n */\n always: Boolean,\n /**\n * @description minimum size of scrollbar\n */\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":["buildProps","definePropType","isNumber"],"mappings":";;;;;;;;AACY,MAAC,cAAc,GAAGA,kBAAU,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;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,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,CAACC,cAAQ,CAAC;AAC/C;;;;;"}
@@ -107,7 +107,6 @@ export declare const ElSelect: import("element-plus/es/utils").SFCWithInstall<im
107
107
  }, {
108
108
  isIOS: boolean | "";
109
109
  onOptionsRendered: (v: any) => void;
110
- tagInMultiLine: import("vue").Ref<boolean>;
111
110
  prefixWidth: import("vue").Ref<number>;
112
111
  selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
113
112
  readonly: import("vue").ComputedRef<any>;
@@ -232,8 +232,7 @@ const _sfc_main = vue.defineComponent({
232
232
  options,
233
233
  cachedOptions,
234
234
  optionsCount,
235
- prefixWidth,
236
- tagInMultiLine
235
+ prefixWidth
237
236
  } = vue.toRefs(states);
238
237
  const wrapperKls = vue.computed(() => {
239
238
  const classList = [nsSelect.b()];
@@ -287,7 +286,7 @@ const _sfc_main = vue.defineComponent({
287
286
  inputWidth.value = refEl.getBoundingClientRect().width;
288
287
  if (ctx.slots.prefix) {
289
288
  const prefix = refEl.querySelector(`.${nsInput.e("prefix")}`);
290
- prefixWidth.value = Math.max(prefix.getBoundingClientRect().width + 5, 30);
289
+ prefixWidth.value = Math.max(prefix.getBoundingClientRect().width + 11, 30);
291
290
  }
292
291
  });
293
292
  setSelected();
@@ -308,7 +307,6 @@ const _sfc_main = vue.defineComponent({
308
307
  return {
309
308
  isIOS: core$1.isIOS,
310
309
  onOptionsRendered,
311
- tagInMultiLine,
312
310
  prefixWidth,
313
311
  selectSize,
314
312
  readonly,
@@ -534,7 +532,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
534
532
  class: vue.normalizeClass([
535
533
  _ctx.nsSelect.b("tags-wrapper"),
536
534
  { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
537
- ])
535
+ ]),
536
+ style: vue.normalizeStyle(_ctx.prefixWidth && _ctx.selected.length ? { marginLeft: `${_ctx.prefixWidth}px` } : "")
538
537
  }, [
539
538
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.selected, (item) => {
540
539
  return vue.openBlock(), vue.createBlock(_component_el_tag, {
@@ -555,11 +554,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
555
554
  _: 2
556
555
  }, 1032, ["closable", "size", "hit", "type", "onClose"]);
557
556
  }), 128))
558
- ], 2)
557
+ ], 6)
559
558
  ]),
560
559
  _: 1
561
560
  }, 8, ["onAfterLeave"])) : vue.createCommentVNode("v-if", true),
562
- _ctx.filterable ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
561
+ _ctx.filterable && !_ctx.selectDisabled ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
563
562
  key: 2,
564
563
  ref: "input",
565
564
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.query = $event),
@@ -572,7 +571,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
572
571
  disabled: _ctx.selectDisabled,
573
572
  autocomplete: _ctx.autocomplete,
574
573
  style: vue.normalizeStyle({
575
- marginLeft: _ctx.prefixWidth && !_ctx.selected.length || _ctx.tagInMultiLine ? `${_ctx.prefixWidth}px` : "",
574
+ marginLeft: `${_ctx.prefixWidth}px`,
576
575
  flexGrow: 1,
577
576
  width: `${_ctx.inputLength / (_ctx.inputWidth - 32)}%`,
578
577
  maxWidth: `${_ctx.inputWidth - 42}px`