@element-plus/nightly 0.0.20220220 → 0.0.20220224

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 (599) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +3347 -6119
  4. package/dist/index.full.min.js +11 -11
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +11 -11
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +3348 -6120
  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/bg.js +1 -1
  18. package/dist/locale/bg.min.js +1 -1
  19. package/dist/locale/bg.min.mjs +1 -1
  20. package/dist/locale/bg.mjs +1 -1
  21. package/dist/locale/bn.js +1 -1
  22. package/dist/locale/bn.min.js +1 -1
  23. package/dist/locale/bn.min.mjs +1 -1
  24. package/dist/locale/bn.mjs +1 -1
  25. package/dist/locale/ca.js +1 -1
  26. package/dist/locale/ca.min.js +1 -1
  27. package/dist/locale/ca.min.mjs +1 -1
  28. package/dist/locale/ca.mjs +1 -1
  29. package/dist/locale/cs.js +1 -1
  30. package/dist/locale/cs.min.js +1 -1
  31. package/dist/locale/cs.min.mjs +1 -1
  32. package/dist/locale/cs.mjs +1 -1
  33. package/dist/locale/da.js +1 -1
  34. package/dist/locale/da.min.js +1 -1
  35. package/dist/locale/da.min.mjs +1 -1
  36. package/dist/locale/da.mjs +1 -1
  37. package/dist/locale/de.js +1 -1
  38. package/dist/locale/de.min.js +1 -1
  39. package/dist/locale/de.min.mjs +1 -1
  40. package/dist/locale/de.mjs +1 -1
  41. package/dist/locale/el.js +1 -1
  42. package/dist/locale/el.min.js +1 -1
  43. package/dist/locale/el.min.mjs +1 -1
  44. package/dist/locale/el.mjs +1 -1
  45. package/dist/locale/en.js +1 -1
  46. package/dist/locale/en.min.js +1 -1
  47. package/dist/locale/en.min.mjs +1 -1
  48. package/dist/locale/en.mjs +1 -1
  49. package/dist/locale/eo.js +1 -1
  50. package/dist/locale/eo.min.js +1 -1
  51. package/dist/locale/eo.min.mjs +1 -1
  52. package/dist/locale/eo.mjs +1 -1
  53. package/dist/locale/es.js +1 -1
  54. package/dist/locale/es.min.js +1 -1
  55. package/dist/locale/es.min.mjs +1 -1
  56. package/dist/locale/es.mjs +1 -1
  57. package/dist/locale/et.js +1 -1
  58. package/dist/locale/et.min.js +1 -1
  59. package/dist/locale/et.min.mjs +1 -1
  60. package/dist/locale/et.mjs +1 -1
  61. package/dist/locale/eu.js +1 -1
  62. package/dist/locale/eu.min.js +1 -1
  63. package/dist/locale/eu.min.mjs +1 -1
  64. package/dist/locale/eu.mjs +1 -1
  65. package/dist/locale/fa.js +1 -1
  66. package/dist/locale/fa.min.js +1 -1
  67. package/dist/locale/fa.min.mjs +1 -1
  68. package/dist/locale/fa.mjs +1 -1
  69. package/dist/locale/fi.js +1 -1
  70. package/dist/locale/fi.min.js +1 -1
  71. package/dist/locale/fi.min.mjs +1 -1
  72. package/dist/locale/fi.mjs +1 -1
  73. package/dist/locale/fr.js +1 -1
  74. package/dist/locale/fr.min.js +1 -1
  75. package/dist/locale/fr.min.mjs +1 -1
  76. package/dist/locale/fr.mjs +1 -1
  77. package/dist/locale/he.js +1 -1
  78. package/dist/locale/he.min.js +1 -1
  79. package/dist/locale/he.min.mjs +1 -1
  80. package/dist/locale/he.mjs +1 -1
  81. package/dist/locale/hr.js +1 -1
  82. package/dist/locale/hr.min.js +1 -1
  83. package/dist/locale/hr.min.mjs +1 -1
  84. package/dist/locale/hr.mjs +1 -1
  85. package/dist/locale/hu.js +1 -1
  86. package/dist/locale/hu.min.js +1 -1
  87. package/dist/locale/hu.min.mjs +1 -1
  88. package/dist/locale/hu.mjs +1 -1
  89. package/dist/locale/hy-am.js +1 -1
  90. package/dist/locale/hy-am.min.js +1 -1
  91. package/dist/locale/hy-am.min.mjs +1 -1
  92. package/dist/locale/hy-am.mjs +1 -1
  93. package/dist/locale/id.js +1 -1
  94. package/dist/locale/id.min.js +1 -1
  95. package/dist/locale/id.min.mjs +1 -1
  96. package/dist/locale/id.mjs +1 -1
  97. package/dist/locale/it.js +1 -1
  98. package/dist/locale/it.min.js +1 -1
  99. package/dist/locale/it.min.mjs +1 -1
  100. package/dist/locale/it.mjs +1 -1
  101. package/dist/locale/ja.js +1 -1
  102. package/dist/locale/ja.min.js +1 -1
  103. package/dist/locale/ja.min.mjs +1 -1
  104. package/dist/locale/ja.mjs +1 -1
  105. package/dist/locale/kk.js +1 -1
  106. package/dist/locale/kk.min.js +1 -1
  107. package/dist/locale/kk.min.mjs +1 -1
  108. package/dist/locale/kk.mjs +1 -1
  109. package/dist/locale/km.js +1 -1
  110. package/dist/locale/km.min.js +1 -1
  111. package/dist/locale/km.min.mjs +1 -1
  112. package/dist/locale/km.mjs +1 -1
  113. package/dist/locale/ko.js +1 -1
  114. package/dist/locale/ko.min.js +1 -1
  115. package/dist/locale/ko.min.mjs +1 -1
  116. package/dist/locale/ko.mjs +1 -1
  117. package/dist/locale/ku.js +1 -1
  118. package/dist/locale/ku.min.js +1 -1
  119. package/dist/locale/ku.min.mjs +1 -1
  120. package/dist/locale/ku.mjs +1 -1
  121. package/dist/locale/ky.js +1 -1
  122. package/dist/locale/ky.min.js +1 -1
  123. package/dist/locale/ky.min.mjs +1 -1
  124. package/dist/locale/ky.mjs +1 -1
  125. package/dist/locale/lt.js +1 -1
  126. package/dist/locale/lt.min.js +1 -1
  127. package/dist/locale/lt.min.mjs +1 -1
  128. package/dist/locale/lt.mjs +1 -1
  129. package/dist/locale/lv.js +1 -1
  130. package/dist/locale/lv.min.js +1 -1
  131. package/dist/locale/lv.min.mjs +1 -1
  132. package/dist/locale/lv.mjs +1 -1
  133. package/dist/locale/mg.js +1 -1
  134. package/dist/locale/mg.min.js +1 -1
  135. package/dist/locale/mg.min.mjs +1 -1
  136. package/dist/locale/mg.mjs +1 -1
  137. package/dist/locale/mn.js +1 -1
  138. package/dist/locale/mn.min.js +1 -1
  139. package/dist/locale/mn.min.mjs +1 -1
  140. package/dist/locale/mn.mjs +1 -1
  141. package/dist/locale/nb-no.js +1 -1
  142. package/dist/locale/nb-no.min.js +1 -1
  143. package/dist/locale/nb-no.min.mjs +1 -1
  144. package/dist/locale/nb-no.mjs +1 -1
  145. package/dist/locale/nl.js +1 -1
  146. package/dist/locale/nl.min.js +1 -1
  147. package/dist/locale/nl.min.mjs +1 -1
  148. package/dist/locale/nl.mjs +1 -1
  149. package/dist/locale/pa.js +1 -1
  150. package/dist/locale/pa.min.js +1 -1
  151. package/dist/locale/pa.min.mjs +1 -1
  152. package/dist/locale/pa.mjs +1 -1
  153. package/dist/locale/pl.js +1 -1
  154. package/dist/locale/pl.min.js +1 -1
  155. package/dist/locale/pl.min.mjs +1 -1
  156. package/dist/locale/pl.mjs +1 -1
  157. package/dist/locale/pt-br.js +1 -1
  158. package/dist/locale/pt-br.min.js +1 -1
  159. package/dist/locale/pt-br.min.mjs +1 -1
  160. package/dist/locale/pt-br.mjs +1 -1
  161. package/dist/locale/pt.js +1 -1
  162. package/dist/locale/pt.min.js +1 -1
  163. package/dist/locale/pt.min.mjs +1 -1
  164. package/dist/locale/pt.mjs +1 -1
  165. package/dist/locale/ro.js +1 -1
  166. package/dist/locale/ro.min.js +1 -1
  167. package/dist/locale/ro.min.mjs +1 -1
  168. package/dist/locale/ro.mjs +1 -1
  169. package/dist/locale/ru.js +1 -1
  170. package/dist/locale/ru.min.js +1 -1
  171. package/dist/locale/ru.min.mjs +1 -1
  172. package/dist/locale/ru.mjs +1 -1
  173. package/dist/locale/sk.js +1 -1
  174. package/dist/locale/sk.min.js +1 -1
  175. package/dist/locale/sk.min.mjs +1 -1
  176. package/dist/locale/sk.mjs +1 -1
  177. package/dist/locale/sl.js +1 -1
  178. package/dist/locale/sl.min.js +1 -1
  179. package/dist/locale/sl.min.mjs +1 -1
  180. package/dist/locale/sl.mjs +1 -1
  181. package/dist/locale/sr.js +1 -1
  182. package/dist/locale/sr.min.js +1 -1
  183. package/dist/locale/sr.min.mjs +1 -1
  184. package/dist/locale/sr.mjs +1 -1
  185. package/dist/locale/sv.js +1 -1
  186. package/dist/locale/sv.min.js +1 -1
  187. package/dist/locale/sv.min.mjs +1 -1
  188. package/dist/locale/sv.mjs +1 -1
  189. package/dist/locale/ta.js +1 -1
  190. package/dist/locale/ta.min.js +1 -1
  191. package/dist/locale/ta.min.mjs +1 -1
  192. package/dist/locale/ta.mjs +1 -1
  193. package/dist/locale/th.js +1 -1
  194. package/dist/locale/th.min.js +1 -1
  195. package/dist/locale/th.min.mjs +1 -1
  196. package/dist/locale/th.mjs +1 -1
  197. package/dist/locale/tk.js +1 -1
  198. package/dist/locale/tk.min.js +1 -1
  199. package/dist/locale/tk.min.mjs +1 -1
  200. package/dist/locale/tk.mjs +1 -1
  201. package/dist/locale/tr.js +1 -1
  202. package/dist/locale/tr.min.js +1 -1
  203. package/dist/locale/tr.min.mjs +1 -1
  204. package/dist/locale/tr.mjs +1 -1
  205. package/dist/locale/ug-cn.js +1 -1
  206. package/dist/locale/ug-cn.min.js +1 -1
  207. package/dist/locale/ug-cn.min.mjs +1 -1
  208. package/dist/locale/ug-cn.mjs +1 -1
  209. package/dist/locale/uk.js +1 -1
  210. package/dist/locale/uk.min.js +1 -1
  211. package/dist/locale/uk.min.mjs +1 -1
  212. package/dist/locale/uk.mjs +1 -1
  213. package/dist/locale/uz-uz.js +1 -1
  214. package/dist/locale/uz-uz.min.js +1 -1
  215. package/dist/locale/uz-uz.min.mjs +1 -1
  216. package/dist/locale/uz-uz.mjs +1 -1
  217. package/dist/locale/vi.js +1 -1
  218. package/dist/locale/vi.min.js +1 -1
  219. package/dist/locale/vi.min.mjs +1 -1
  220. package/dist/locale/vi.mjs +1 -1
  221. package/dist/locale/zh-cn.js +1 -1
  222. package/dist/locale/zh-cn.min.js +1 -1
  223. package/dist/locale/zh-cn.min.mjs +1 -1
  224. package/dist/locale/zh-cn.mjs +1 -1
  225. package/dist/locale/zh-tw.js +1 -1
  226. package/dist/locale/zh-tw.min.js +1 -1
  227. package/dist/locale/zh-tw.min.mjs +1 -1
  228. package/dist/locale/zh-tw.mjs +1 -1
  229. package/es/components/affix/index.d.ts +6 -8
  230. package/es/components/affix/src/affix.vue.d.ts +6 -8
  231. package/es/components/affix/src/affix2.mjs +35 -34
  232. package/es/components/affix/src/affix2.mjs.map +1 -1
  233. package/es/components/avatar/index.d.ts +58 -0
  234. package/es/components/avatar/index.mjs +2 -2
  235. package/es/components/avatar/index.mjs.map +1 -1
  236. package/es/components/avatar/src/avatar.vue.d.ts +58 -0
  237. package/es/components/avatar/src/avatar2.mjs +29 -38
  238. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  239. package/es/components/badge/src/badge2.mjs +4 -1
  240. package/es/components/badge/src/badge2.mjs.map +1 -1
  241. package/es/components/button/index.d.ts +12 -1
  242. package/es/components/button/index.mjs +3 -3
  243. package/es/components/button/index.mjs.map +1 -1
  244. package/es/components/button/src/button-group.vue.d.ts +6 -0
  245. package/es/components/button/src/button-group2.mjs +15 -16
  246. package/es/components/button/src/button-group2.mjs.map +1 -1
  247. package/es/components/button/src/button.vue.d.ts +0 -1
  248. package/es/components/button/src/button2.mjs +3 -5
  249. package/es/components/button/src/button2.mjs.map +1 -1
  250. package/es/components/calendar/index.d.ts +1 -1
  251. package/es/components/card/index.mjs +2 -2
  252. package/es/components/card/index.mjs.map +1 -1
  253. package/es/components/card/src/card2.mjs +27 -29
  254. package/es/components/card/src/card2.mjs.map +1 -1
  255. package/es/components/cascader/index.d.ts +22 -12
  256. package/es/components/cascader/src/index.vue.d.ts +11 -6
  257. package/es/components/config-provider/index.d.ts +3 -3
  258. package/es/components/config-provider/src/config-provider.d.ts +2 -1
  259. package/es/components/date-picker/src/date-picker-com/basic-date-table.vue.d.ts +3 -3
  260. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +1 -1
  261. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -2
  262. package/es/components/date-picker/src/date-picker-com/panel-month-range.vue.d.ts +2 -2
  263. package/es/components/descriptions/index.d.ts +2 -2
  264. package/es/components/descriptions/src/description-item.d.ts +1 -1
  265. package/es/components/dialog/index.d.ts +200 -32
  266. package/es/components/dialog/index.mjs +2 -2
  267. package/es/components/dialog/index.mjs.map +1 -1
  268. package/es/components/dialog/src/dialog-content.d.ts +12 -0
  269. package/es/components/dialog/src/dialog-content.mjs +40 -0
  270. package/es/components/dialog/src/dialog-content.mjs.map +1 -0
  271. package/es/components/dialog/src/dialog-content.vue.d.ts +84 -0
  272. package/es/components/dialog/src/dialog-content2.mjs +84 -0
  273. package/es/components/dialog/src/dialog-content2.mjs.map +1 -0
  274. package/es/components/dialog/src/dialog.d.ts +9 -7
  275. package/es/components/dialog/src/dialog.mjs +5 -30
  276. package/es/components/dialog/src/dialog.mjs.map +1 -1
  277. package/es/components/dialog/src/dialog.vue.d.ts +236 -67
  278. package/es/components/dialog/src/dialog2.mjs +96 -122
  279. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  280. package/es/components/dialog/src/token.d.ts +10 -0
  281. package/es/components/dialog/src/token.mjs +4 -0
  282. package/es/components/dialog/src/token.mjs.map +1 -0
  283. package/es/components/drawer/index.d.ts +22 -18
  284. package/es/components/drawer/src/drawer.d.ts +9 -7
  285. package/es/components/drawer/src/drawer.vue.d.ts +22 -18
  286. package/es/components/dropdown/index.d.ts +8 -3
  287. package/es/components/dropdown/src/dropdown-item-impl.mjs +5 -5
  288. package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
  289. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -1
  290. package/es/components/dropdown/src/dropdown-item.mjs +2 -2
  291. package/es/components/dropdown/src/dropdown-item.mjs.map +1 -1
  292. package/es/components/dropdown/src/dropdown.vue.d.ts +8 -3
  293. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  294. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  295. package/es/components/focus-trap/src/focus-trap.mjs +19 -15
  296. package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
  297. package/es/components/message/index.d.ts +1 -1
  298. package/es/components/message/src/message-method.d.ts +1 -1
  299. package/es/components/message/src/message-method.mjs +10 -7
  300. package/es/components/message/src/message-method.mjs.map +1 -1
  301. package/es/components/message/src/message.d.ts +3 -3
  302. package/es/components/message/src/message.mjs.map +1 -1
  303. package/es/components/notification/index.d.ts +1 -1
  304. package/es/components/popconfirm/index.d.ts +3 -0
  305. package/es/components/popconfirm/src/popconfirm.d.ts +1 -0
  306. package/es/components/popconfirm/src/popconfirm.mjs +2 -1
  307. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  308. package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -0
  309. package/es/components/popconfirm/src/popconfirm2.mjs +2 -2
  310. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  311. package/es/components/popover/index.d.ts +30 -10
  312. package/es/components/popover/src/index.mjs +19 -3
  313. package/es/components/popover/src/index.mjs.map +1 -1
  314. package/es/components/popover/src/index.vue.d.ts +15 -5
  315. package/es/components/popover/src/popover.d.ts +1 -0
  316. package/es/components/popover/src/popover.mjs +4 -0
  317. package/es/components/popover/src/popover.mjs.map +1 -1
  318. package/es/components/popper/src/content.mjs +9 -0
  319. package/es/components/popper/src/content.mjs.map +1 -1
  320. package/es/components/popper/src/content.vue.d.ts +3 -0
  321. package/es/components/popper/src/popper.d.ts +1 -0
  322. package/es/components/popper/src/popper.mjs +3 -0
  323. package/es/components/popper/src/popper.mjs.map +1 -1
  324. package/es/components/row/index.d.ts +3 -3
  325. package/es/components/row/src/row.d.ts +4 -4
  326. package/es/components/row/src/row.mjs +8 -1
  327. package/es/components/row/src/row.mjs.map +1 -1
  328. package/es/components/scrollbar/index.d.ts +1 -1
  329. package/es/components/scrollbar/src/bar.vue.d.ts +2 -2
  330. package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
  331. package/es/components/select/index.d.ts +8 -3
  332. package/es/components/select/src/select.vue.d.ts +8 -3
  333. package/es/components/select/src/useSelect.d.ts +8 -3
  334. package/es/components/select-v2/index.d.ts +18 -8
  335. package/es/components/select-v2/src/select.vue.d.ts +9 -4
  336. package/es/components/select-v2/src/useSelect.d.ts +8 -3
  337. package/es/components/slider/index.d.ts +2 -2
  338. package/es/components/slider/src/index.vue.d.ts +1 -1
  339. package/es/components/slot/src/only-child.mjs +3 -1
  340. package/es/components/slot/src/only-child.mjs.map +1 -1
  341. package/es/components/switch/src/switch2.mjs +2 -2
  342. package/es/components/switch/src/switch2.mjs.map +1 -1
  343. package/es/components/table/src/filter-panel.vue.d.ts +8 -3
  344. package/es/components/table/src/store/watcher.mjs +4 -8
  345. package/es/components/table/src/store/watcher.mjs.map +1 -1
  346. package/es/components/table/src/table/style-helper.mjs +2 -2
  347. package/es/components/table/src/table/style-helper.mjs.map +1 -1
  348. package/es/components/table/src/table-footer/index.mjs +3 -1
  349. package/es/components/table/src/table-footer/index.mjs.map +1 -1
  350. package/es/components/table/src/table-layout.mjs +2 -5
  351. package/es/components/table/src/table-layout.mjs.map +1 -1
  352. package/es/components/table/src/table.mjs +1 -0
  353. package/es/components/table/src/table.mjs.map +1 -1
  354. package/es/components/time-picker/src/common/picker.mjs +6 -2
  355. package/es/components/time-picker/src/common/picker.mjs.map +1 -1
  356. package/es/components/time-picker/src/common/picker.vue.d.ts +9 -3
  357. package/es/components/time-picker/src/time-picker-com/useTimePicker.d.ts +2 -2
  358. package/es/components/tooltip/index.d.ts +4 -1
  359. package/es/components/tooltip/src/content.mjs +22 -4
  360. package/es/components/tooltip/src/content.mjs.map +1 -1
  361. package/es/components/tooltip/src/content.vue.d.ts +8 -2
  362. package/es/components/tooltip/src/tokens.d.ts +2 -0
  363. package/es/components/tooltip/src/tokens.mjs.map +1 -1
  364. package/es/components/tooltip/src/tooltip.vue.d.ts +4 -1
  365. package/es/components/tooltip/src/tooltip2.mjs +7 -1
  366. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  367. package/es/components/transfer/index.d.ts +4 -4
  368. package/es/components/transfer/src/index.vue.d.ts +2 -2
  369. package/es/components/tree-v2/index.d.ts +1 -1
  370. package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
  371. package/es/components/virtual-list/src/builders/build-grid.d.ts +1 -1
  372. package/es/components/virtual-list/src/builders/build-list.d.ts +1 -1
  373. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
  374. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  375. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
  376. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  377. package/es/defaults.d.ts +1 -1
  378. package/es/hooks/use-global-config/index.d.ts +1 -1
  379. package/es/hooks/use-model-toggle/index.d.ts +10 -7
  380. package/es/hooks/use-model-toggle/index.mjs +9 -7
  381. package/es/hooks/use-model-toggle/index.mjs.map +1 -1
  382. package/es/index.d.ts +1 -1
  383. package/es/{locale.d.ts → locales.d.ts} +0 -0
  384. package/es/{locale.mjs → locales.mjs} +1 -1
  385. package/es/locales.mjs.map +1 -0
  386. package/es/utils/vue/install.d.ts +2 -2
  387. package/es/utils/vue/install.mjs +2 -0
  388. package/es/utils/vue/install.mjs.map +1 -1
  389. package/es/utils/vue/typescript.d.ts +4 -1
  390. package/es/version.d.ts +1 -1
  391. package/es/version.mjs +1 -1
  392. package/es/version.mjs.map +1 -1
  393. package/lib/components/affix/index.d.ts +6 -8
  394. package/lib/components/affix/src/affix.vue.d.ts +6 -8
  395. package/lib/components/affix/src/affix2.js +34 -33
  396. package/lib/components/affix/src/affix2.js.map +1 -1
  397. package/lib/components/avatar/index.d.ts +58 -0
  398. package/lib/components/avatar/src/avatar.vue.d.ts +58 -0
  399. package/lib/components/avatar/src/avatar2.js +31 -40
  400. package/lib/components/avatar/src/avatar2.js.map +1 -1
  401. package/lib/components/badge/src/badge2.js +4 -1
  402. package/lib/components/badge/src/badge2.js.map +1 -1
  403. package/lib/components/button/index.d.ts +12 -1
  404. package/lib/components/button/src/button-group.vue.d.ts +6 -0
  405. package/lib/components/button/src/button-group2.js +14 -15
  406. package/lib/components/button/src/button-group2.js.map +1 -1
  407. package/lib/components/button/src/button.vue.d.ts +0 -1
  408. package/lib/components/button/src/button2.js +3 -5
  409. package/lib/components/button/src/button2.js.map +1 -1
  410. package/lib/components/calendar/index.d.ts +1 -1
  411. package/lib/components/card/src/card2.js +26 -28
  412. package/lib/components/card/src/card2.js.map +1 -1
  413. package/lib/components/cascader/index.d.ts +22 -12
  414. package/lib/components/cascader/src/index.vue.d.ts +11 -6
  415. package/lib/components/config-provider/index.d.ts +3 -3
  416. package/lib/components/config-provider/src/config-provider.d.ts +2 -1
  417. package/lib/components/date-picker/src/date-picker-com/basic-date-table.vue.d.ts +3 -3
  418. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +1 -1
  419. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -2
  420. package/lib/components/date-picker/src/date-picker-com/panel-month-range.vue.d.ts +2 -2
  421. package/lib/components/descriptions/index.d.ts +2 -2
  422. package/lib/components/descriptions/src/description-item.d.ts +1 -1
  423. package/lib/components/dialog/index.d.ts +200 -32
  424. package/lib/components/dialog/src/dialog-content.d.ts +12 -0
  425. package/lib/components/dialog/src/dialog-content.js +45 -0
  426. package/lib/components/dialog/src/dialog-content.js.map +1 -0
  427. package/lib/components/dialog/src/dialog-content.vue.d.ts +84 -0
  428. package/lib/components/dialog/src/dialog-content2.js +88 -0
  429. package/lib/components/dialog/src/dialog-content2.js.map +1 -0
  430. package/lib/components/dialog/src/dialog.d.ts +9 -7
  431. package/lib/components/dialog/src/dialog.js +5 -30
  432. package/lib/components/dialog/src/dialog.js.map +1 -1
  433. package/lib/components/dialog/src/dialog.vue.d.ts +236 -67
  434. package/lib/components/dialog/src/dialog2.js +101 -127
  435. package/lib/components/dialog/src/dialog2.js.map +1 -1
  436. package/lib/components/dialog/src/token.d.ts +10 -0
  437. package/lib/components/dialog/src/token.js +8 -0
  438. package/lib/components/dialog/src/token.js.map +1 -0
  439. package/lib/components/drawer/index.d.ts +22 -18
  440. package/lib/components/drawer/src/drawer.d.ts +9 -7
  441. package/lib/components/drawer/src/drawer.vue.d.ts +22 -18
  442. package/lib/components/dropdown/index.d.ts +8 -3
  443. package/lib/components/dropdown/src/dropdown-item-impl.js +5 -5
  444. package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
  445. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -1
  446. package/lib/components/dropdown/src/dropdown-item.js +2 -2
  447. package/lib/components/dropdown/src/dropdown-item.js.map +1 -1
  448. package/lib/components/dropdown/src/dropdown.vue.d.ts +8 -3
  449. package/lib/components/dropdown/src/dropdown2.js +1 -1
  450. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  451. package/lib/components/focus-trap/src/focus-trap.js +18 -14
  452. package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
  453. package/lib/components/message/index.d.ts +1 -1
  454. package/lib/components/message/src/message-method.d.ts +1 -1
  455. package/lib/components/message/src/message-method.js +10 -7
  456. package/lib/components/message/src/message-method.js.map +1 -1
  457. package/lib/components/message/src/message.d.ts +3 -3
  458. package/lib/components/message/src/message.js.map +1 -1
  459. package/lib/components/notification/index.d.ts +1 -1
  460. package/lib/components/popconfirm/index.d.ts +3 -0
  461. package/lib/components/popconfirm/src/popconfirm.d.ts +1 -0
  462. package/lib/components/popconfirm/src/popconfirm.js +2 -1
  463. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  464. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -0
  465. package/lib/components/popconfirm/src/popconfirm2.js +2 -2
  466. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  467. package/lib/components/popover/index.d.ts +30 -10
  468. package/lib/components/popover/src/index.js +19 -3
  469. package/lib/components/popover/src/index.js.map +1 -1
  470. package/lib/components/popover/src/index.vue.d.ts +15 -5
  471. package/lib/components/popover/src/popover.d.ts +1 -0
  472. package/lib/components/popover/src/popover.js +4 -0
  473. package/lib/components/popover/src/popover.js.map +1 -1
  474. package/lib/components/popper/src/content.js +9 -0
  475. package/lib/components/popper/src/content.js.map +1 -1
  476. package/lib/components/popper/src/content.vue.d.ts +3 -0
  477. package/lib/components/popper/src/popper.d.ts +1 -0
  478. package/lib/components/popper/src/popper.js +3 -0
  479. package/lib/components/popper/src/popper.js.map +1 -1
  480. package/lib/components/row/index.d.ts +3 -3
  481. package/lib/components/row/src/row.d.ts +4 -4
  482. package/lib/components/row/src/row.js +8 -1
  483. package/lib/components/row/src/row.js.map +1 -1
  484. package/lib/components/scrollbar/index.d.ts +1 -1
  485. package/lib/components/scrollbar/src/bar.vue.d.ts +2 -2
  486. package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
  487. package/lib/components/select/index.d.ts +8 -3
  488. package/lib/components/select/src/select.vue.d.ts +8 -3
  489. package/lib/components/select/src/useSelect.d.ts +8 -3
  490. package/lib/components/select-v2/index.d.ts +18 -8
  491. package/lib/components/select-v2/src/select.vue.d.ts +9 -4
  492. package/lib/components/select-v2/src/useSelect.d.ts +8 -3
  493. package/lib/components/slider/index.d.ts +2 -2
  494. package/lib/components/slider/src/index.vue.d.ts +1 -1
  495. package/lib/components/slot/src/only-child.js +2 -0
  496. package/lib/components/slot/src/only-child.js.map +1 -1
  497. package/lib/components/switch/src/switch2.js +2 -2
  498. package/lib/components/switch/src/switch2.js.map +1 -1
  499. package/lib/components/table/src/filter-panel.vue.d.ts +8 -3
  500. package/lib/components/table/src/store/watcher.js +4 -8
  501. package/lib/components/table/src/store/watcher.js.map +1 -1
  502. package/lib/components/table/src/table/style-helper.js +2 -2
  503. package/lib/components/table/src/table/style-helper.js.map +1 -1
  504. package/lib/components/table/src/table-footer/index.js +3 -1
  505. package/lib/components/table/src/table-footer/index.js.map +1 -1
  506. package/lib/components/table/src/table-layout.js +2 -5
  507. package/lib/components/table/src/table-layout.js.map +1 -1
  508. package/lib/components/table/src/table.js +1 -0
  509. package/lib/components/table/src/table.js.map +1 -1
  510. package/lib/components/time-picker/src/common/picker.js +6 -2
  511. package/lib/components/time-picker/src/common/picker.js.map +1 -1
  512. package/lib/components/time-picker/src/common/picker.vue.d.ts +9 -3
  513. package/lib/components/time-picker/src/time-picker-com/useTimePicker.d.ts +2 -2
  514. package/lib/components/tooltip/index.d.ts +4 -1
  515. package/lib/components/tooltip/src/content.js +22 -4
  516. package/lib/components/tooltip/src/content.js.map +1 -1
  517. package/lib/components/tooltip/src/content.vue.d.ts +8 -2
  518. package/lib/components/tooltip/src/tokens.d.ts +2 -0
  519. package/lib/components/tooltip/src/tokens.js.map +1 -1
  520. package/lib/components/tooltip/src/tooltip.vue.d.ts +4 -1
  521. package/lib/components/tooltip/src/tooltip2.js +7 -1
  522. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  523. package/lib/components/transfer/index.d.ts +4 -4
  524. package/lib/components/transfer/src/index.vue.d.ts +2 -2
  525. package/lib/components/tree-v2/index.d.ts +1 -1
  526. package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
  527. package/lib/components/virtual-list/src/builders/build-grid.d.ts +1 -1
  528. package/lib/components/virtual-list/src/builders/build-list.d.ts +1 -1
  529. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
  530. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  531. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
  532. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  533. package/lib/defaults.d.ts +1 -1
  534. package/lib/hooks/use-global-config/index.d.ts +1 -1
  535. package/lib/hooks/use-model-toggle/index.d.ts +10 -7
  536. package/lib/hooks/use-model-toggle/index.js +9 -7
  537. package/lib/hooks/use-model-toggle/index.js.map +1 -1
  538. package/lib/index.d.ts +1 -1
  539. package/lib/{locale.d.ts → locales.d.ts} +0 -0
  540. package/lib/{locale.js → locales.js} +1 -1
  541. package/lib/locales.js.map +1 -0
  542. package/lib/utils/vue/install.d.ts +2 -2
  543. package/lib/utils/vue/install.js +2 -0
  544. package/lib/utils/vue/install.js.map +1 -1
  545. package/lib/utils/vue/typescript.d.ts +4 -1
  546. package/lib/version.d.ts +1 -1
  547. package/lib/version.js +1 -1
  548. package/lib/version.js.map +1 -1
  549. package/package.json +6 -6
  550. package/tags.json +1 -1
  551. package/theme-chalk/base.css +1 -1
  552. package/theme-chalk/display.css +1 -1
  553. package/theme-chalk/el-button.css +1 -1
  554. package/theme-chalk/el-cascader.css +1 -1
  555. package/theme-chalk/el-check-tag.css +1 -1
  556. package/theme-chalk/el-checkbox-button.css +1 -1
  557. package/theme-chalk/el-date-picker.css +1 -1
  558. package/theme-chalk/el-dialog.css +1 -1
  559. package/theme-chalk/el-dropdown.css +1 -1
  560. package/theme-chalk/el-form.css +1 -1
  561. package/theme-chalk/el-input-number.css +1 -1
  562. package/theme-chalk/el-input.css +1 -1
  563. package/theme-chalk/el-reset.css +1 -1
  564. package/theme-chalk/el-row.css +1 -1
  565. package/theme-chalk/el-select-v2.css +1 -1
  566. package/theme-chalk/el-select.css +1 -1
  567. package/theme-chalk/el-switch.css +1 -1
  568. package/theme-chalk/el-table-column.css +1 -1
  569. package/theme-chalk/el-tag.css +1 -1
  570. package/theme-chalk/el-time-picker.css +1 -1
  571. package/theme-chalk/el-time-select.css +1 -1
  572. package/theme-chalk/el-var.css +1 -1
  573. package/theme-chalk/index.css +1 -1
  574. package/theme-chalk/src/button.scss +1 -1
  575. package/theme-chalk/src/cascader.scss +13 -12
  576. package/theme-chalk/src/check-tag.scss +7 -5
  577. package/theme-chalk/src/checkbox-button.scss +1 -1
  578. package/theme-chalk/src/common/var.scss +37 -21
  579. package/theme-chalk/src/dark/vars.scss +6 -0
  580. package/theme-chalk/src/date-picker/date-table.scss +14 -14
  581. package/theme-chalk/src/date-picker/picker.scss +3 -4
  582. package/theme-chalk/src/dialog.scss +6 -2
  583. package/theme-chalk/src/form.scss +2 -2
  584. package/theme-chalk/src/input-number.scss +6 -4
  585. package/theme-chalk/src/input.scss +146 -40
  586. package/theme-chalk/src/mixins/_button.scss +119 -15
  587. package/theme-chalk/src/mixins/_var.scss +21 -8
  588. package/theme-chalk/src/mixins/function.scss +17 -0
  589. package/theme-chalk/src/mixins/mixins.scss +8 -0
  590. package/theme-chalk/src/reset.scss +1 -1
  591. package/theme-chalk/src/row.scss +3 -1
  592. package/theme-chalk/src/select-v2.scss +2 -1
  593. package/theme-chalk/src/select.scss +15 -4
  594. package/theme-chalk/src/switch.scss +2 -0
  595. package/theme-chalk/src/tag.scss +64 -66
  596. package/theme-chalk/src/var.scss +6 -0
  597. package/web-types.json +1 -1
  598. package/es/locale.mjs.map +0 -1
  599. package/lib/locale.js.map +0 -1
@@ -17,37 +17,35 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  ...__default__,
18
18
  props: affix.affixProps,
19
19
  emits: affix.affixEmits,
20
- setup(__props, { emit }) {
20
+ setup(__props, { expose, emit }) {
21
21
  const props = __props;
22
22
  const ns = index.useNamespace("affix");
23
23
  const target = vue.shallowRef();
24
24
  const root = vue.shallowRef();
25
25
  const scrollContainer = vue.shallowRef();
26
- const state = vue.reactive({
27
- fixed: false,
28
- height: 0,
29
- width: 0,
30
- scrollTop: 0,
31
- clientHeight: 0,
32
- transform: 0
33
- });
26
+ const fixed = vue.ref(false);
27
+ const height = vue.ref(0);
28
+ const width = vue.ref(0);
29
+ const scrollTop = vue.ref(0);
30
+ const clientHeight = vue.ref(0);
31
+ const transform = vue.ref(0);
34
32
  const rootStyle = vue.computed(() => {
35
33
  return {
36
- height: state.fixed ? `${state.height}px` : "",
37
- width: state.fixed ? `${state.width}px` : ""
34
+ height: fixed.value ? `${height.value}px` : "",
35
+ width: fixed.value ? `${width.value}px` : ""
38
36
  };
39
37
  });
40
38
  const affixStyle = vue.computed(() => {
41
- if (!state.fixed)
39
+ if (!fixed.value)
42
40
  return;
43
41
  const offset = props.offset ? `${props.offset}px` : 0;
44
- const transform = state.transform ? `translateY(${state.transform}px)` : "";
42
+ const _transform = transform.value ? `translateY(${transform.value}px)` : "";
45
43
  return {
46
- height: `${state.height}px`,
47
- width: `${state.width}px`,
44
+ height: `${height.value}px`,
45
+ width: `${width.value}px`,
48
46
  top: props.position === "top" ? offset : "",
49
47
  bottom: props.position === "bottom" ? offset : "",
50
- transform,
48
+ transform: _transform,
51
49
  zIndex: props.zIndex
52
50
  };
53
51
  });
@@ -56,37 +54,37 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
56
54
  return;
57
55
  const rootRect = root.value.getBoundingClientRect();
58
56
  const targetRect = target.value.getBoundingClientRect();
59
- state.height = rootRect.height;
60
- state.width = rootRect.width;
61
- state.scrollTop = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
62
- state.clientHeight = document.documentElement.clientHeight;
57
+ height.value = rootRect.height;
58
+ width.value = rootRect.width;
59
+ scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
60
+ clientHeight.value = document.documentElement.clientHeight;
63
61
  if (props.position === "top") {
64
62
  if (props.target) {
65
- const difference = targetRect.bottom - props.offset - state.height;
66
- state.fixed = props.offset > rootRect.top && targetRect.bottom > 0;
67
- state.transform = difference < 0 ? difference : 0;
63
+ const difference = targetRect.bottom - props.offset - height.value;
64
+ fixed.value = props.offset > rootRect.top && targetRect.bottom > 0;
65
+ transform.value = difference < 0 ? difference : 0;
68
66
  } else {
69
- state.fixed = props.offset > rootRect.top;
67
+ fixed.value = props.offset > rootRect.top;
70
68
  }
71
69
  } else {
72
70
  if (props.target) {
73
- const difference = state.clientHeight - targetRect.top - props.offset - state.height;
74
- state.fixed = state.clientHeight - props.offset < rootRect.bottom && state.clientHeight > targetRect.top;
75
- state.transform = difference < 0 ? -difference : 0;
71
+ const difference = clientHeight.value - targetRect.top - props.offset - height.value;
72
+ fixed.value = clientHeight.value - props.offset < rootRect.bottom && clientHeight.value > targetRect.top;
73
+ transform.value = difference < 0 ? -difference : 0;
76
74
  } else {
77
- state.fixed = state.clientHeight - props.offset < rootRect.bottom;
75
+ fixed.value = clientHeight.value - props.offset < rootRect.bottom;
78
76
  }
79
77
  }
80
78
  };
81
79
  const onScroll = () => {
82
80
  update();
83
81
  emit("scroll", {
84
- scrollTop: state.scrollTop,
85
- fixed: state.fixed
82
+ scrollTop: scrollTop.value,
83
+ fixed: fixed.value
86
84
  });
87
85
  };
88
- vue.watch(() => state.fixed, () => {
89
- emit("change", state.fixed);
86
+ vue.watch(fixed, (fixed2) => {
87
+ emit("change", fixed2);
90
88
  });
91
89
  vue.onMounted(() => {
92
90
  var _a;
@@ -103,6 +101,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
103
101
  core.useEventListener(scrollContainer, "scroll", onScroll);
104
102
  core.useResizeObserver(root, () => update());
105
103
  core.useResizeObserver(target, () => update());
104
+ expose({
105
+ update
106
+ });
106
107
  return (_ctx, _cache) => {
107
108
  return vue.openBlock(), vue.createElementBlock("div", {
108
109
  ref_key: "root",
@@ -111,7 +112,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
111
112
  style: vue.normalizeStyle(vue.unref(rootStyle))
112
113
  }, [
113
114
  vue.createElementVNode("div", {
114
- class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: vue.unref(state).fixed }),
115
+ class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
115
116
  style: vue.normalizeStyle(vue.unref(affixStyle))
116
117
  }, [
117
118
  vue.renderSlot(_ctx.$slots, "default")
@@ -1 +1 @@
1
- {"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: state.fixed }\" :style=\"affixStyle\">\n <slot></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, reactive, shallowRef, watch } from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { getScrollContainer } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { affixEmits, affixProps } from './affix'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElAffix',\n})\n\nconst props = defineProps(affixProps)\nconst emit = defineEmits(affixEmits)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\n\nconst state = reactive({\n fixed: false,\n height: 0, // height of root\n width: 0, // width of root\n scrollTop: 0, // scrollTop of documentElement\n clientHeight: 0, // clientHeight of documentElement\n transform: 0,\n})\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: state.fixed ? `${state.height}px` : '',\n width: state.fixed ? `${state.width}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties | undefined>(() => {\n if (!state.fixed) return\n\n const offset = props.offset ? `${props.offset}px` : 0\n const transform = state.transform ? `translateY(${state.transform}px)` : ''\n\n return {\n height: `${state.height}px`,\n width: `${state.width}px`,\n top: props.position === 'top' ? offset : '',\n bottom: props.position === 'bottom' ? offset : '',\n transform,\n zIndex: props.zIndex,\n }\n})\n\nconst update = () => {\n if (!root.value || !target.value || !scrollContainer.value) return\n\n const rootRect = root.value.getBoundingClientRect()\n const targetRect = target.value.getBoundingClientRect()\n state.height = rootRect.height\n state.width = rootRect.width\n state.scrollTop =\n scrollContainer.value instanceof Window\n ? document.documentElement.scrollTop\n : scrollContainer.value.scrollTop || 0\n state.clientHeight = document.documentElement.clientHeight\n\n if (props.position === 'top') {\n if (props.target) {\n const difference = targetRect.bottom - props.offset - state.height\n state.fixed = props.offset > rootRect.top && targetRect.bottom > 0\n state.transform = difference < 0 ? difference : 0\n } else {\n state.fixed = props.offset > rootRect.top\n }\n } else {\n if (props.target) {\n const difference =\n state.clientHeight - targetRect.top - props.offset - state.height\n state.fixed =\n state.clientHeight - props.offset < rootRect.bottom &&\n state.clientHeight > targetRect.top\n state.transform = difference < 0 ? -difference : 0\n } else {\n state.fixed = state.clientHeight - props.offset < rootRect.bottom\n }\n }\n}\n\nconst onScroll = () => {\n update()\n\n emit('scroll', {\n scrollTop: state.scrollTop,\n fixed: state.fixed,\n })\n}\n\nwatch(\n () => state.fixed,\n () => {\n emit('change', state.fixed)\n }\n)\n\nonMounted(() => {\n if (props.target) {\n target.value =\n document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!target.value) {\n throw new Error(`Target is not existed: ${props.target}`)\n }\n } else {\n target.value = document.documentElement\n }\n scrollContainer.value = getScrollContainer(root.value!, true)\n})\n\nuseEventListener(scrollContainer, 'scroll', onScroll)\nuseResizeObserver(root, () => update())\nuseResizeObserver(target, () => update())\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA;AAEA;AACA;AACA;AAEA;;;;;;;;AASA;;;;;;AAOA;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;AASA;;;AAOA;;;;;;;;;;;AAaA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: fixed }\" :style=\"affixStyle\">\n <slot></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef, watch } from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { getScrollContainer } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { affixEmits, affixProps } from './affix'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElAffix',\n})\n\nconst props = defineProps(affixProps)\nconst emit = defineEmits(affixEmits)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\n\nconst fixed = ref(false)\nconst height = ref(0) // height of root\nconst width = ref(0) // width of root\nconst scrollTop = ref(0) // scrollTop of documentElement\nconst clientHeight = ref(0) // clientHeight of documentElement\nconst transform = ref(0)\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: fixed.value ? `${height.value}px` : '',\n width: fixed.value ? `${width.value}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties | undefined>(() => {\n if (!fixed.value) return\n\n const offset = props.offset ? `${props.offset}px` : 0\n const _transform = transform.value ? `translateY(${transform.value}px)` : ''\n\n return {\n height: `${height.value}px`,\n width: `${width.value}px`,\n top: props.position === 'top' ? offset : '',\n bottom: props.position === 'bottom' ? offset : '',\n transform: _transform,\n zIndex: props.zIndex,\n }\n})\n\nconst update = () => {\n if (!root.value || !target.value || !scrollContainer.value) return\n\n const rootRect = root.value.getBoundingClientRect()\n const targetRect = target.value.getBoundingClientRect()\n height.value = rootRect.height\n width.value = rootRect.width\n scrollTop.value =\n scrollContainer.value instanceof Window\n ? document.documentElement.scrollTop\n : scrollContainer.value.scrollTop || 0\n clientHeight.value = document.documentElement.clientHeight\n\n if (props.position === 'top') {\n if (props.target) {\n const difference = targetRect.bottom - props.offset - height.value\n fixed.value = props.offset > rootRect.top && targetRect.bottom > 0\n transform.value = difference < 0 ? difference : 0\n } else {\n fixed.value = props.offset > rootRect.top\n }\n } else {\n if (props.target) {\n const difference =\n clientHeight.value - targetRect.top - props.offset - height.value\n fixed.value =\n clientHeight.value - props.offset < rootRect.bottom &&\n clientHeight.value > targetRect.top\n transform.value = difference < 0 ? -difference : 0\n } else {\n fixed.value = clientHeight.value - props.offset < rootRect.bottom\n }\n }\n}\n\nconst onScroll = () => {\n update()\n\n emit('scroll', {\n scrollTop: scrollTop.value,\n fixed: fixed.value,\n })\n}\n\nwatch(fixed, (fixed) => {\n emit('change', fixed)\n})\n\nonMounted(() => {\n if (props.target) {\n target.value =\n document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!target.value) {\n throw new Error(`Target is not existed: ${props.target}`)\n }\n } else {\n target.value = document.documentElement\n }\n scrollContainer.value = getScrollContainer(root.value!, true)\n})\n\nuseEventListener(scrollContainer, 'scroll', onScroll)\nuseResizeObserver(root, () => update())\nuseResizeObserver(target, () => update())\n\ndefineExpose({\n /** @description update affix status */\n update,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAOA;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;AASA;;;AAIA;;;;;;;;;;;AAaA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,11 +7,69 @@ export declare const ElAvatar: import("element-plus/es/utils").SFCWithInstall<im
7
7
  readonly srcSet: StringConstructor;
8
8
  readonly fit: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("csstype").ObjectFitProperty>, "cover", unknown, unknown, unknown>;
9
9
  }, {
10
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
11
+ readonly size: import("element-plus/es/utils").BuildPropReturn<readonly [NumberConstructor, StringConstructor], "default", unknown, "default" | "small" | "large", number>;
12
+ readonly shape: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "circle", unknown, "circle" | "square", unknown>;
13
+ readonly icon: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, unknown, unknown, unknown, unknown>;
14
+ readonly src: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
15
+ readonly alt: StringConstructor;
16
+ readonly srcSet: StringConstructor;
17
+ readonly fit: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("csstype").ObjectFitProperty>, "cover", unknown, unknown, unknown>;
18
+ }>> & {
19
+ onError?: ((evt: Event) => any) | undefined;
20
+ }>>;
21
+ emit: (event: "error", evt: Event) => void;
22
+ ns: {
23
+ namespace: import("vue").ComputedRef<string>;
24
+ b: (blockSuffix?: string) => string;
25
+ e: (element?: string | undefined) => string;
26
+ m: (modifier?: string | undefined) => string;
27
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
28
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
29
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
30
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
31
+ is: {
32
+ (name: string, state: boolean | undefined): string;
33
+ (name: string): string;
34
+ };
35
+ };
10
36
  hasLoadError: import("vue").Ref<boolean>;
11
37
  avatarClass: import("vue").ComputedRef<string[]>;
12
38
  sizeStyle: import("vue").ComputedRef<import("vue").CSSProperties | undefined>;
13
39
  fitStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
14
40
  handleError: (e: Event) => void;
41
+ ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
42
+ readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
43
+ readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
44
+ }, {
45
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
46
+ readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
47
+ readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
48
+ }>> & {
49
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
50
+ }>>;
51
+ ns: {
52
+ namespace: import("vue").ComputedRef<string>;
53
+ b: (blockSuffix?: string) => string;
54
+ e: (element?: string | undefined) => string;
55
+ m: (modifier?: string | undefined) => string;
56
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
57
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
58
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
59
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
60
+ is: {
61
+ (name: string, state: boolean | undefined): string;
62
+ (name: string): string;
63
+ };
64
+ };
65
+ style: import("vue").ComputedRef<import("vue").CSSProperties>;
66
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
67
+ readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
68
+ readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
69
+ }>>, {
70
+ size: import("element-plus/es/utils").BuildPropType<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown>;
71
+ color: string;
72
+ }>> & Record<string, any>;
15
73
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
74
  error: (evt: Event) => boolean;
17
75
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -8,11 +8,69 @@ declare const _default: import("vue").DefineComponent<{
8
8
  readonly srcSet: StringConstructor;
9
9
  readonly fit: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("csstype").ObjectFitProperty>, "cover", unknown, unknown, unknown>;
10
10
  }, {
11
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
+ readonly size: import("element-plus/es/utils").BuildPropReturn<readonly [NumberConstructor, StringConstructor], "default", unknown, "default" | "small" | "large", number>;
13
+ readonly shape: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "circle", unknown, "circle" | "square", unknown>;
14
+ readonly icon: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, unknown, unknown, unknown, unknown>;
15
+ readonly src: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
16
+ readonly alt: StringConstructor;
17
+ readonly srcSet: StringConstructor;
18
+ readonly fit: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<import("csstype").ObjectFitProperty>, "cover", unknown, unknown, unknown>;
19
+ }>> & {
20
+ onError?: ((evt: Event) => any) | undefined;
21
+ }>>;
22
+ emit: (event: "error", evt: Event) => void;
23
+ ns: {
24
+ namespace: import("vue").ComputedRef<string>;
25
+ b: (blockSuffix?: string) => string;
26
+ e: (element?: string | undefined) => string;
27
+ m: (modifier?: string | undefined) => string;
28
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
29
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
30
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
31
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
32
+ is: {
33
+ (name: string, state: boolean | undefined): string;
34
+ (name: string): string;
35
+ };
36
+ };
11
37
  hasLoadError: import("vue").Ref<boolean>;
12
38
  avatarClass: import("vue").ComputedRef<string[]>;
13
39
  sizeStyle: import("vue").ComputedRef<CSSProperties | undefined>;
14
40
  fitStyle: import("vue").ComputedRef<CSSProperties>;
15
41
  handleError: (e: Event) => void;
42
+ ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
43
+ readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
44
+ readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
45
+ }, {
46
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
47
+ readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
48
+ readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
49
+ }>> & {
50
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
51
+ }>>;
52
+ ns: {
53
+ namespace: import("vue").ComputedRef<string>;
54
+ b: (blockSuffix?: string) => string;
55
+ e: (element?: string | undefined) => string;
56
+ m: (modifier?: string | undefined) => string;
57
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
58
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
59
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
60
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
61
+ is: {
62
+ (name: string, state: boolean | undefined): string;
63
+ (name: string): string;
64
+ };
65
+ };
66
+ style: import("vue").ComputedRef<CSSProperties>;
67
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
68
+ readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
69
+ readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
70
+ }>>, {
71
+ size: import("element-plus/es/utils").BuildPropType<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown>;
72
+ color: string;
73
+ }>> & Record<string, any>;
16
74
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
75
  error: (evt: Event) => boolean;
18
76
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -3,25 +3,26 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var index = require('../../icon/index.js');
6
+ var index$1 = require('../../icon/index.js');
7
7
  require('../../../hooks/index.js');
8
8
  require('../../../utils/index.js');
9
9
  var avatar = require('./avatar.js');
10
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
- var index$1 = require('../../../hooks/use-namespace/index.js');
10
+ var index = require('../../../hooks/use-namespace/index.js');
12
11
  var shared = require('@vue/shared');
13
12
  var core = require('@vueuse/core');
14
13
  var style = require('../../../utils/vue/style.js');
15
14
 
16
- const _sfc_main = vue.defineComponent({
17
- name: "ElAvatar",
18
- components: {
19
- ElIcon: index.ElIcon
20
- },
15
+ const _hoisted_1 = ["src", "alt", "srcset"];
16
+ const __default__ = {
17
+ name: "ElAvatar"
18
+ };
19
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20
+ ...__default__,
21
21
  props: avatar.avatarProps,
22
22
  emits: avatar.avatarEmits,
23
- setup(props, { emit }) {
24
- const ns = index$1.useNamespace("avatar");
23
+ setup(__props, { emit }) {
24
+ const props = __props;
25
+ const ns = index.useNamespace("avatar");
25
26
  const hasLoadError = vue.ref(false);
26
27
  const avatarClass = vue.computed(() => {
27
28
  const { size, icon, shape } = props;
@@ -48,38 +49,28 @@ const _sfc_main = vue.defineComponent({
48
49
  hasLoadError.value = true;
49
50
  emit("error", e);
50
51
  }
51
- return {
52
- hasLoadError,
53
- avatarClass,
54
- sizeStyle,
55
- fitStyle,
56
- handleError
52
+ return (_ctx, _cache) => {
53
+ return vue.openBlock(), vue.createElementBlock("span", {
54
+ class: vue.normalizeClass(vue.unref(avatarClass)),
55
+ style: vue.normalizeStyle(vue.unref(sizeStyle))
56
+ }, [
57
+ (_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("img", {
58
+ key: 0,
59
+ src: _ctx.src,
60
+ alt: _ctx.alt,
61
+ srcset: _ctx.srcSet,
62
+ style: vue.normalizeStyle(vue.unref(fitStyle)),
63
+ onError: handleError
64
+ }, null, 44, _hoisted_1)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
65
+ default: vue.withCtx(() => [
66
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
67
+ ]),
68
+ _: 1
69
+ })) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
70
+ ], 6);
57
71
  };
58
72
  }
59
73
  });
60
- const _hoisted_1 = ["src", "alt", "srcset"];
61
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
62
- const _component_el_icon = vue.resolveComponent("el-icon");
63
- return vue.openBlock(), vue.createElementBlock("span", {
64
- class: vue.normalizeClass(_ctx.avatarClass),
65
- style: vue.normalizeStyle(_ctx.sizeStyle)
66
- }, [
67
- (_ctx.src || _ctx.srcSet) && !_ctx.hasLoadError ? (vue.openBlock(), vue.createElementBlock("img", {
68
- key: 0,
69
- src: _ctx.src,
70
- alt: _ctx.alt,
71
- srcset: _ctx.srcSet,
72
- style: vue.normalizeStyle(_ctx.fitStyle),
73
- onError: _cache[0] || (_cache[0] = (...args) => _ctx.handleError && _ctx.handleError(...args))
74
- }, null, 44, _hoisted_1)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 1 }, {
75
- default: vue.withCtx(() => [
76
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
77
- ]),
78
- _: 1
79
- })) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
80
- ], 6);
81
- }
82
- var Avatar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
83
74
 
84
- exports["default"] = Avatar;
75
+ exports["default"] = _sfc_main;
85
76
  //# sourceMappingURL=avatar2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar2.js","sources":["../../../../../../packages/components/avatar/src/avatar.vue"],"sourcesContent":["<template>\n <span :class=\"avatarClass\" :style=\"sizeStyle\">\n <img\n v-if=\"(src || srcSet) && !hasLoadError\"\n :src=\"src\"\n :alt=\"alt\"\n :srcset=\"srcSet\"\n :style=\"fitStyle\"\n @error=\"handleError\"\n />\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <slot v-else></slot>\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, watch } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isNumber, isString, addUnit } from '@element-plus/utils'\nimport { avatarEmits, avatarProps } from './avatar'\n\nimport type { CSSProperties } from 'vue'\n\nexport default defineComponent({\n name: 'ElAvatar',\n components: {\n ElIcon,\n },\n props: avatarProps,\n emits: avatarEmits,\n\n setup(props, { emit }) {\n const ns = useNamespace('avatar')\n\n const hasLoadError = ref(false)\n\n const avatarClass = computed(() => {\n const { size, icon, shape } = props\n const classList = [ns.b()]\n if (isString(size)) classList.push(ns.m(size))\n if (icon) classList.push(ns.m('icon'))\n if (shape) classList.push(ns.m(shape))\n return classList\n })\n\n const sizeStyle = computed(() => {\n const { size } = props\n return isNumber(size)\n ? ({\n '--el-avatar-size': addUnit(size),\n } as CSSProperties)\n : undefined\n })\n\n const fitStyle = computed<CSSProperties>(() => ({\n objectFit: props.fit,\n }))\n\n // need reset hasLoadError to false if src changed\n watch(\n () => props.src,\n () => (hasLoadError.value = false)\n )\n\n function handleError(e: Event) {\n hasLoadError.value = true\n emit('error', e)\n }\n\n return {\n hasLoadError,\n avatarClass,\n sizeStyle,\n fitStyle,\n handleError,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElIcon","avatarProps","avatarEmits","useNamespace","ref","computed","isString","isNumber","addUnit","_createElementBlock","_normalizeClass","_normalizeStyle","_createBlock","_resolveDynamicComponent","_renderSlot"],"mappings":";;;;;;;;;;;;;;;AA0BA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,YACVC;AAAA;AAAA,EAEF,OAAOC;AAAA,EACP,OAAOC;AAAA,EAEP,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,KAAKC,qBAAa;AAExB,UAAM,eAAeC,QAAI;AAEzB,UAAM,cAAcC,aAAS,MAAM;AACjC,YAAM,EAAE,MAAM,MAAM,UAAU;AAC9B,YAAM,YAAY,CAAC,GAAG;AACtB,UAAIC,gBAAS;AAAO,kBAAU,KAAK,GAAG,EAAE;AACxC,UAAI;AAAM,kBAAU,KAAK,GAAG,EAAE;AAC9B,UAAI;AAAO,kBAAU,KAAK,GAAG,EAAE;AAC/B,aAAO;AAAA;AAGT,UAAM,YAAYD,aAAS,MAAM;AAC/B,YAAM,EAAE,SAAS;AACjB,aAAOE,cAAS,QACX;AAAA,QACC,oBAAoBC,cAAQ;AAAA,UAE9B;AAAA;AAGN,UAAM,WAAWH,aAAwB;AAAO,MAC9C,WAAW,MAAM;AAAA;AAInB,cACE,MAAM,MAAM,KACZ,MAAO,aAAa,QAAQ;AAG9B,yBAAqB,GAAU;AAC7B,mBAAa,QAAQ;AACrB,WAAK,SAAS;AAAA;AAGhB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;0BA5EJI,uBAaO;AAAA,IAbA,OAAKC,mBAAE;AAAA,IAAc,OAAKC,mBAAE;AAAA;IAExB,aAAO,gBAAM,CAAM,sCAD5BF,uBAOE;AAAA;MALC,KAAK;AAAA,MACL,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAKE,mBAAE;AAAA,MACP,SAAK,uCAAE;AAAA,gCAEU,8BAApBC,gBAEU;AAAA,2BADR,MAAwB;AAAA,0BAAxBA,gBAAwBC,4BAAR;AAAA;AAAA;UAElBC,eAAoB;AAAA;;;;;;"}
1
+ {"version":3,"file":"avatar2.js","sources":["../../../../../../packages/components/avatar/src/avatar.vue"],"sourcesContent":["<template>\n <span :class=\"avatarClass\" :style=\"sizeStyle\">\n <img\n v-if=\"(src || srcSet) && !hasLoadError\"\n :src=\"src\"\n :alt=\"alt\"\n :srcset=\"srcSet\"\n :style=\"fitStyle\"\n @error=\"handleError\"\n />\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <slot v-else></slot>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isNumber, isString, addUnit } from '@element-plus/utils'\nimport { avatarEmits, avatarProps } from './avatar'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElAvatar',\n})\n\nconst props = defineProps(avatarProps)\nconst emit = defineEmits(avatarEmits)\n\nconst ns = useNamespace('avatar')\n\nconst hasLoadError = ref(false)\n\nconst avatarClass = computed(() => {\n const { size, icon, shape } = props\n const classList = [ns.b()]\n if (isString(size)) classList.push(ns.m(size))\n if (icon) classList.push(ns.m('icon'))\n if (shape) classList.push(ns.m(shape))\n return classList\n})\n\nconst sizeStyle = computed(() => {\n const { size } = props\n return isNumber(size)\n ? ({\n '--el-avatar-size': addUnit(size),\n } as CSSProperties)\n : undefined\n})\n\nconst fitStyle = computed<CSSProperties>(() => ({\n objectFit: props.fit,\n}))\n\n// need reset hasLoadError to false if src changed\nwatch(\n () => props.src,\n () => (hasLoadError.value = false)\n)\n\nfunction handleError(e: Event) {\n hasLoadError.value = true\n emit('error', e)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiCA;AAEA;AAEA;;;;;;;;;;;AASA;;;;;;AASA;;;AAKA;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,7 +16,7 @@ const __default__ = {
16
16
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  ...__default__,
18
18
  props: badge.badgeProps,
19
- setup(__props) {
19
+ setup(__props, { expose }) {
20
20
  const props = __props;
21
21
  const ns = index.useNamespace("badge");
22
22
  const content = vue.computed(() => {
@@ -27,6 +27,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
27
27
  }
28
28
  return `${props.value}`;
29
29
  });
30
+ expose({
31
+ content
32
+ });
30
33
  return (_ctx, _cache) => {
31
34
  return vue.openBlock(), vue.createElementBlock("div", {
32
35
  class: vue.normalizeClass(vue.unref(ns).b())
@@ -1 +1 @@
1
- {"version":3,"file":"badge2.js","sources":["../../../../../../packages/components/badge/src/badge.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <slot></slot>\n <transition :name=\"`${ns.namespace.value}-zoom-in-center`\">\n <sup\n v-show=\"!hidden && (content || content === '0' || isDot)\"\n :class=\"[\n ns.e('content'),\n ns.em('content', type),\n ns.is('fixed', !!$slots.default),\n ns.is('dot', isDot),\n ]\"\n v-text=\"content\"\n >\n </sup>\n </transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isNumber } from '@element-plus/utils'\nimport { badgeProps } from './badge'\n\ndefineOptions({\n name: 'ElBadge',\n})\n\nconst props = defineProps(badgeProps)\n\nconst ns = useNamespace('badge')\n\nconst content = computed<string>(() => {\n if (props.isDot) return ''\n\n if (isNumber(props.value) && isNumber(props.max)) {\n return props.max < props.value ? `${props.max}+` : `${props.value}`\n }\n return `${props.value}`\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"badge2.js","sources":["../../../../../../packages/components/badge/src/badge.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <slot></slot>\n <transition :name=\"`${ns.namespace.value}-zoom-in-center`\">\n <sup\n v-show=\"!hidden && (content || content === '0' || isDot)\"\n :class=\"[\n ns.e('content'),\n ns.em('content', type),\n ns.is('fixed', !!$slots.default),\n ns.is('dot', isDot),\n ]\"\n v-text=\"content\"\n >\n </sup>\n </transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isNumber } from '@element-plus/utils'\nimport { badgeProps } from './badge'\n\ndefineOptions({\n name: 'ElBadge',\n})\n\nconst props = defineProps(badgeProps)\n\nconst ns = useNamespace('badge')\n\nconst content = computed<string>(() => {\n if (props.isDot) return ''\n\n if (isNumber(props.value) && isNumber(props.max)) {\n return props.max < props.value ? `${props.max}+` : `${props.value}`\n }\n return `${props.value}`\n})\n\ndefineExpose({\n /** @description badge content */\n content,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA;AAEA;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -57,7 +57,6 @@ export declare const ElButton: import("element-plus/es/utils").SFCWithInstall<im
57
57
  _type: import("vue").ComputedRef<"default" | "" | "primary" | "success" | "warning" | "info" | "danger" | "text">;
58
58
  autoInsertSpace: import("vue").ComputedRef<import("element-plus/es/utils").BuildPropType<BooleanConstructor, unknown, unknown>>;
59
59
  shouldAddSpace: import("vue").ComputedRef<boolean>;
60
- typeColor: import("vue").ComputedRef<string>;
61
60
  buttonStyle: import("vue").ComputedRef<Record<string, string>>;
62
61
  handleClick: (evt: MouseEvent) => void;
63
62
  ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
@@ -128,6 +127,12 @@ export declare const ElButton: import("element-plus/es/utils").SFCWithInstall<im
128
127
  readonly size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
129
128
  readonly type: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
130
129
  }, {
130
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
131
+ readonly size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
132
+ readonly type: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
133
+ }>> & {
134
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
135
+ }>>;
131
136
  ns: {
132
137
  namespace: import("vue").ComputedRef<string>;
133
138
  b: (blockSuffix?: string) => string;
@@ -154,6 +159,12 @@ export declare const ElButtonGroup: import("element-plus/es/utils").SFCWithInsta
154
159
  readonly size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
155
160
  readonly type: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
156
161
  }, {
162
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
163
+ readonly size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
164
+ readonly type: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
165
+ }>> & {
166
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
167
+ }>>;
157
168
  ns: {
158
169
  namespace: import("vue").ComputedRef<string>;
159
170
  b: (blockSuffix?: string) => string;
@@ -2,6 +2,12 @@ declare const _default: import("vue").DefineComponent<{
2
2
  readonly size: import("../../../utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
3
3
  readonly type: import("../../../utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
4
4
  }, {
5
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
6
+ readonly size: import("../../../utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
7
+ readonly type: import("../../../utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
8
+ }>> & {
9
+ [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
10
+ }>>;
5
11
  ns: {
6
12
  namespace: import("vue").ComputedRef<string>;
7
13
  b: (blockSuffix?: string) => string;
@@ -6,32 +6,31 @@ var vue = require('vue');
6
6
  require('../../../tokens/index.js');
7
7
  require('../../../hooks/index.js');
8
8
  var buttonGroup = require('./button-group.js');
9
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
9
  var button = require('../../../tokens/button.js');
11
10
  var index = require('../../../hooks/use-namespace/index.js');
12
11
 
13
- const _sfc_main = vue.defineComponent({
14
- name: "ElButtonGroup",
12
+ const __default__ = {
13
+ name: "ElButtonGroup"
14
+ };
15
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
16
+ ...__default__,
15
17
  props: buttonGroup.buttonGroupProps,
16
- setup(props) {
18
+ setup(__props) {
19
+ const props = __props;
17
20
  vue.provide(button.buttonGroupContextKey, vue.reactive({
18
21
  size: vue.toRef(props, "size"),
19
22
  type: vue.toRef(props, "type")
20
23
  }));
21
24
  const ns = index.useNamespace("button");
22
- return {
23
- ns
25
+ return (_ctx, _cache) => {
26
+ return vue.openBlock(), vue.createElementBlock("div", {
27
+ class: vue.normalizeClass(`${vue.unref(ns).b("group")}`)
28
+ }, [
29
+ vue.renderSlot(_ctx.$slots, "default")
30
+ ], 2);
24
31
  };
25
32
  }
26
33
  });
27
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
28
- return vue.openBlock(), vue.createElementBlock("div", {
29
- class: vue.normalizeClass(`${_ctx.ns.b("group")}`)
30
- }, [
31
- vue.renderSlot(_ctx.$slots, "default")
32
- ], 2);
33
- }
34
- var ButtonGroup = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
35
34
 
36
- exports["default"] = ButtonGroup;
35
+ exports["default"] = _sfc_main;
37
36
  //# sourceMappingURL=button-group2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group2.js","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot></slot>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, provide, reactive, toRef } from 'vue'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\n\nexport default defineComponent({\n name: 'ElButtonGroup',\n props: buttonGroupProps,\n\n setup(props) {\n provide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n )\n const ns = useNamespace('button')\n return {\n ns,\n }\n },\n})\n</script>\n"],"names":["defineComponent","buttonGroupProps","buttonGroupContextKey","reactive","toRef","useNamespace","_createElementBlock","_normalizeClass","_renderSlot"],"mappings":";;;;;;;;;;;;AAWA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,OAAOC;AAAA,EAEP,MAAM,OAAO;AACX,gBACEC,8BACAC,aAAS;AAAA,MACP,MAAMC,UAAM,OAAO;AAAA,MACnB,MAAMA,UAAM,OAAO;AAAA;AAGvB,UAAM,KAAKC,mBAAa;AACxB,WAAO;AAAA,MACL;AAAA;AAAA;AAAA;;0BAxBJC,uBAEM;AAAA,IAFA,OAAKC,sBAAK,QAAG,EAAC;AAAA;IAClBC,eAAa;AAAA;;;;;;"}
1
+ {"version":3,"file":"button-group2.js","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot></slot>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { provide, reactive, toRef } from 'vue'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\n\ndefineOptions({\n name: 'ElButtonGroup',\n})\nconst props = defineProps(buttonGroupProps)\nprovide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n)\nconst ns = useNamespace('button')\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAeA;;;;AAOA;;;;;;;;;;;;;"}
@@ -57,7 +57,6 @@ declare const _default: import("vue").DefineComponent<{
57
57
  _type: import("vue").ComputedRef<"default" | "" | "primary" | "success" | "warning" | "info" | "danger" | "text">;
58
58
  autoInsertSpace: import("vue").ComputedRef<import("../../../utils").BuildPropType<BooleanConstructor, unknown, unknown>>;
59
59
  shouldAddSpace: import("vue").ComputedRef<boolean>;
60
- typeColor: import("vue").ComputedRef<string>;
61
60
  buttonStyle: import("vue").ComputedRef<Record<string, string>>;
62
61
  handleClick: (evt: MouseEvent) => void;
63
62
  ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var core = require('@vueuse/core');
7
6
  var tinycolor = require('@ctrl/tinycolor');
8
7
  var index$4 = require('../../icon/index.js');
9
8
  require('../../../hooks/index.js');
@@ -50,13 +49,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
50
49
  }
51
50
  return false;
52
51
  });
53
- const typeColor = vue.computed(() => core.useCssVar(`--el-color-${props.type}`).value);
54
52
  const buttonStyle = vue.computed(() => {
55
53
  let styles = {};
56
- const buttonColor = props.color || typeColor.value;
54
+ const buttonColor = props.color;
57
55
  if (buttonColor) {
58
56
  const color = new tinycolor.TinyColor(buttonColor);
59
- const shadeBgColor = color.shade(10).toString();
57
+ const shadeBgColor = color.shade(20).toString();
60
58
  if (props.plain) {
61
59
  styles = {
62
60
  "--el-button-bg-color": color.tint(90).toString(),
@@ -69,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
69
67
  "--el-button-active-border-color": shadeBgColor
70
68
  };
71
69
  } else {
72
- const tintBgColor = color.tint(20).toString();
70
+ const tintBgColor = color.tint(30).toString();
73
71
  styles = {
74
72
  "--el-button-bg-color": buttonColor,
75
73
  "--el-button-border-color": buttonColor,
@@ -1 +1 @@
1
- {"version":3,"file":"button2.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\"></slot>\n <el-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </el-icon>\n </template>\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, Text, ref, useSlots } from 'vue'\nimport { useCssVar } from '@vueuse/core'\nimport { TinyColor } from '@ctrl/tinycolor'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useDisabled,\n useFormItem,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { buttonEmits, buttonProps } from './button'\n\ndefineOptions({\n name: 'ElButton',\n})\n\nconst props = defineProps(buttonProps)\nconst emit = defineEmits(buttonEmits)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst { form } = useFormItem()\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n})\n\n// calculate hover & active color by color\nconst typeColor = computed(() => useCssVar(`--el-color-${props.type}`).value)\nconst buttonStyle = computed(() => {\n let styles: Record<string, string> = {}\n\n const buttonColor = props.color || typeColor.value\n\n if (buttonColor) {\n const color = new TinyColor(buttonColor)\n const shadeBgColor = color.shade(10).toString()\n if (props.plain) {\n styles = {\n '--el-button-bg-color': color.tint(90).toString(),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': shadeBgColor,\n }\n } else {\n const tintBgColor = color.tint(20).toString()\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': tintBgColor,\n '--el-button-hover-border-color': tintBgColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-border-color': shadeBgColor,\n }\n }\n\n if (_disabled.value) {\n const disabledButtonColor = color.tint(50).toString()\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n})\n\nconst handleClick = (evt: MouseEvent) => {\n if (props.nativeType === 'reset') {\n form?.resetFields()\n }\n emit('click', evt)\n}\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAKA;;;;;;;;;;;AAaA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button2.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\"></slot>\n <el-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </el-icon>\n </template>\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, Text, ref, useSlots } from 'vue'\nimport { TinyColor } from '@ctrl/tinycolor'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useDisabled,\n useFormItem,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { buttonEmits, buttonProps } from './button'\n\ndefineOptions({\n name: 'ElButton',\n})\n\nconst props = defineProps(buttonProps)\nconst emit = defineEmits(buttonEmits)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst { form } = useFormItem()\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n})\n\n// calculate hover & active color by custom color\n// only work when custom color\nconst buttonStyle = computed(() => {\n let styles: Record<string, string> = {}\n\n const buttonColor = props.color\n\n if (buttonColor) {\n const color = new TinyColor(buttonColor)\n const shadeBgColor = color.shade(20).toString()\n if (props.plain) {\n styles = {\n '--el-button-bg-color': color.tint(90).toString(),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': shadeBgColor,\n }\n } else {\n const tintBgColor = color.tint(30).toString()\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': tintBgColor,\n '--el-button-hover-border-color': tintBgColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-border-color': shadeBgColor,\n }\n }\n\n if (_disabled.value) {\n const disabledButtonColor = color.tint(50).toString()\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n})\n\nconst handleClick = (evt: MouseEvent) => {\n if (props.nativeType === 'reset') {\n form?.resetFields()\n }\n emit('click', evt)\n}\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAKA;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}