@element-plus/nightly 0.0.20220117 → 0.0.20220118

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 (663) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +2196 -3407
  4. package/dist/index.full.min.js +8 -10
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +8 -10
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +2189 -3403
  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/mn.js +1 -1
  134. package/dist/locale/mn.min.js +1 -1
  135. package/dist/locale/mn.min.mjs +1 -1
  136. package/dist/locale/mn.mjs +1 -1
  137. package/dist/locale/nb-no.js +1 -1
  138. package/dist/locale/nb-no.min.js +1 -1
  139. package/dist/locale/nb-no.min.mjs +1 -1
  140. package/dist/locale/nb-no.mjs +1 -1
  141. package/dist/locale/nl.js +1 -1
  142. package/dist/locale/nl.min.js +1 -1
  143. package/dist/locale/nl.min.mjs +1 -1
  144. package/dist/locale/nl.mjs +1 -1
  145. package/dist/locale/pa.js +1 -1
  146. package/dist/locale/pa.min.js +1 -1
  147. package/dist/locale/pa.min.mjs +1 -1
  148. package/dist/locale/pa.mjs +1 -1
  149. package/dist/locale/pl.js +1 -1
  150. package/dist/locale/pl.min.js +1 -1
  151. package/dist/locale/pl.min.mjs +1 -1
  152. package/dist/locale/pl.mjs +1 -1
  153. package/dist/locale/pt-br.js +1 -1
  154. package/dist/locale/pt-br.min.js +1 -1
  155. package/dist/locale/pt-br.min.mjs +1 -1
  156. package/dist/locale/pt-br.mjs +1 -1
  157. package/dist/locale/pt.js +1 -1
  158. package/dist/locale/pt.min.js +1 -1
  159. package/dist/locale/pt.min.mjs +1 -1
  160. package/dist/locale/pt.mjs +1 -1
  161. package/dist/locale/ro.js +1 -1
  162. package/dist/locale/ro.min.js +1 -1
  163. package/dist/locale/ro.min.mjs +1 -1
  164. package/dist/locale/ro.mjs +1 -1
  165. package/dist/locale/ru.js +1 -1
  166. package/dist/locale/ru.min.js +1 -1
  167. package/dist/locale/ru.min.mjs +1 -1
  168. package/dist/locale/ru.mjs +1 -1
  169. package/dist/locale/sk.js +1 -1
  170. package/dist/locale/sk.min.js +1 -1
  171. package/dist/locale/sk.min.mjs +1 -1
  172. package/dist/locale/sk.mjs +1 -1
  173. package/dist/locale/sl.js +1 -1
  174. package/dist/locale/sl.min.js +1 -1
  175. package/dist/locale/sl.min.mjs +1 -1
  176. package/dist/locale/sl.mjs +1 -1
  177. package/dist/locale/sr.js +1 -1
  178. package/dist/locale/sr.min.js +1 -1
  179. package/dist/locale/sr.min.mjs +1 -1
  180. package/dist/locale/sr.mjs +1 -1
  181. package/dist/locale/sv.js +1 -1
  182. package/dist/locale/sv.min.js +1 -1
  183. package/dist/locale/sv.min.mjs +1 -1
  184. package/dist/locale/sv.mjs +1 -1
  185. package/dist/locale/ta.js +1 -1
  186. package/dist/locale/ta.min.js +1 -1
  187. package/dist/locale/ta.min.mjs +1 -1
  188. package/dist/locale/ta.mjs +1 -1
  189. package/dist/locale/th.js +1 -1
  190. package/dist/locale/th.min.js +1 -1
  191. package/dist/locale/th.min.mjs +1 -1
  192. package/dist/locale/th.mjs +1 -1
  193. package/dist/locale/tk.js +1 -1
  194. package/dist/locale/tk.min.js +1 -1
  195. package/dist/locale/tk.min.mjs +1 -1
  196. package/dist/locale/tk.mjs +1 -1
  197. package/dist/locale/tr.js +1 -1
  198. package/dist/locale/tr.min.js +1 -1
  199. package/dist/locale/tr.min.mjs +1 -1
  200. package/dist/locale/tr.mjs +1 -1
  201. package/dist/locale/ug-cn.js +1 -1
  202. package/dist/locale/ug-cn.min.js +1 -1
  203. package/dist/locale/ug-cn.min.mjs +1 -1
  204. package/dist/locale/ug-cn.mjs +1 -1
  205. package/dist/locale/uk.js +1 -1
  206. package/dist/locale/uk.min.js +1 -1
  207. package/dist/locale/uk.min.mjs +1 -1
  208. package/dist/locale/uk.mjs +1 -1
  209. package/dist/locale/uz-uz.js +1 -1
  210. package/dist/locale/uz-uz.min.js +1 -1
  211. package/dist/locale/uz-uz.min.mjs +1 -1
  212. package/dist/locale/uz-uz.mjs +1 -1
  213. package/dist/locale/vi.js +1 -1
  214. package/dist/locale/vi.min.js +1 -1
  215. package/dist/locale/vi.min.mjs +1 -1
  216. package/dist/locale/vi.mjs +1 -1
  217. package/dist/locale/zh-cn.js +1 -1
  218. package/dist/locale/zh-cn.min.js +1 -1
  219. package/dist/locale/zh-cn.min.mjs +1 -1
  220. package/dist/locale/zh-cn.mjs +1 -1
  221. package/dist/locale/zh-tw.js +1 -1
  222. package/dist/locale/zh-tw.min.js +1 -1
  223. package/dist/locale/zh-tw.min.mjs +1 -1
  224. package/dist/locale/zh-tw.mjs +1 -1
  225. package/es/components/alert/index.d.ts +5 -5
  226. package/es/components/alert/src/alert.d.ts +1 -1
  227. package/es/components/alert/src/alert.vue.d.ts +5 -5
  228. package/es/components/avatar/index.d.ts +1 -1
  229. package/es/components/avatar/src/avatar.d.ts +3 -1
  230. package/es/components/avatar/src/avatar.mjs +1 -1
  231. package/es/components/avatar/src/avatar.mjs.map +1 -1
  232. package/es/components/avatar/src/avatar.vue.d.ts +1 -1
  233. package/es/components/avatar/src/avatar.vue_vue_type_script_lang.mjs +13 -8
  234. package/es/components/avatar/src/avatar.vue_vue_type_script_lang.mjs.map +1 -1
  235. package/es/components/avatar/src/avatar.vue_vue_type_template_id_46e3f365_lang.mjs.map +1 -1
  236. package/es/components/button/index.d.ts +6 -0
  237. package/es/components/button/src/button-group.vue.d.ts +2 -0
  238. package/es/components/button/src/button.vue.d.ts +2 -0
  239. package/es/components/card/index.d.ts +13 -1
  240. package/es/components/card/src/card.d.ts +2 -0
  241. package/es/components/card/src/card.mjs.map +1 -1
  242. package/es/components/card/src/card.vue.d.ts +13 -1
  243. package/es/components/card/src/card.vue_vue_type_script_lang.mjs +9 -1
  244. package/es/components/card/src/card.vue_vue_type_script_lang.mjs.map +1 -1
  245. package/es/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.mjs +8 -9
  246. package/es/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.mjs.map +1 -1
  247. package/es/components/cascader/index.d.ts +38 -34
  248. package/es/components/cascader/src/index.vue.d.ts +19 -17
  249. package/es/components/check-tag/index.d.ts +21 -9
  250. package/es/components/check-tag/index.mjs +3 -2
  251. package/es/components/check-tag/index.mjs.map +1 -1
  252. package/es/components/check-tag/src/check-tag.d.ts +12 -0
  253. package/es/components/check-tag/src/check-tag.mjs +16 -0
  254. package/es/components/check-tag/src/check-tag.mjs.map +1 -0
  255. package/es/components/check-tag/src/check-tag.vue.d.ts +29 -0
  256. package/es/components/check-tag/src/check-tag.vue_vue_type_script_lang.mjs +25 -0
  257. package/es/components/check-tag/src/check-tag.vue_vue_type_script_lang.mjs.map +1 -0
  258. package/es/components/check-tag/src/{index.vue_vue_type_template_id_58558910_lang.mjs → check-tag.vue_vue_type_template_id_d949910a_lang.mjs} +2 -5
  259. package/es/components/check-tag/src/check-tag.vue_vue_type_template_id_d949910a_lang.mjs.map +1 -0
  260. package/es/components/check-tag/src/check-tag2.mjs +7 -0
  261. package/es/components/check-tag/src/check-tag2.mjs.map +1 -0
  262. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -1
  263. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.mjs +10 -1
  264. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.mjs.map +1 -1
  265. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_template_id_78e07aa7_lang.mjs.map +1 -1
  266. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -1
  267. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.mjs +12 -1
  268. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.mjs.map +1 -1
  269. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_template_id_62b45ab2_lang.mjs.map +1 -1
  270. package/es/components/descriptions/index.d.ts +4 -4
  271. package/es/components/descriptions/src/index.vue.d.ts +4 -4
  272. package/es/components/divider/index.d.ts +14 -1
  273. package/es/components/divider/src/divider.d.ts +2 -0
  274. package/es/components/divider/src/divider.mjs.map +1 -1
  275. package/es/components/divider/src/divider.vue.d.ts +15 -1
  276. package/es/components/divider/src/divider.vue_vue_type_script_lang.mjs +16 -2
  277. package/es/components/divider/src/divider.vue_vue_type_script_lang.mjs.map +1 -1
  278. package/es/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.mjs +3 -3
  279. package/es/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.mjs.map +1 -1
  280. package/es/components/dropdown/index.d.ts +13 -11
  281. package/es/components/dropdown/src/dropdown.vue.d.ts +13 -11
  282. package/es/components/empty/index.d.ts +11 -0
  283. package/es/components/empty/src/empty.d.ts +2 -0
  284. package/es/components/empty/src/empty.mjs.map +1 -1
  285. package/es/components/empty/src/empty.vue.d.ts +11 -0
  286. package/es/components/empty/src/empty.vue_vue_type_script_lang.mjs +3 -0
  287. package/es/components/empty/src/empty.vue_vue_type_script_lang.mjs.map +1 -1
  288. package/es/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.mjs +20 -19
  289. package/es/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.mjs.map +1 -1
  290. package/es/components/icon/index.d.ts +11 -0
  291. package/es/components/icon/src/icon.d.ts +2 -0
  292. package/es/components/icon/src/icon.mjs.map +1 -1
  293. package/es/components/icon/src/icon.vue.d.ts +11 -0
  294. package/es/components/icon/src/icon.vue_vue_type_script_lang.mjs +14 -15
  295. package/es/components/icon/src/icon.vue_vue_type_script_lang.mjs.map +1 -1
  296. package/es/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.mjs +1 -1
  297. package/es/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.mjs.map +1 -1
  298. package/es/components/image/src/image.vue_vue_type_script_lang.mjs +14 -3
  299. package/es/components/image/src/image.vue_vue_type_script_lang.mjs.map +1 -1
  300. package/es/components/image/src/image.vue_vue_type_template_id_34467287_lang.mjs.map +1 -1
  301. package/es/components/index.mjs +2 -0
  302. package/es/components/index.mjs.map +1 -1
  303. package/es/components/input-number/src/input-number.vue_vue_type_script_lang.mjs +1 -1
  304. package/es/components/input-number/src/input-number.vue_vue_type_script_lang.mjs.map +1 -1
  305. package/es/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.mjs.map +1 -1
  306. package/es/components/link/index.d.ts +11 -0
  307. package/es/components/link/src/link.d.ts +2 -0
  308. package/es/components/link/src/link.mjs.map +1 -1
  309. package/es/components/link/src/link.vue.d.ts +11 -0
  310. package/es/components/link/src/link.vue_vue_type_script_lang.mjs +4 -0
  311. package/es/components/link/src/link.vue_vue_type_script_lang.mjs.map +1 -1
  312. package/es/components/link/src/link.vue_vue_type_template_id_6a422645_lang.mjs +7 -8
  313. package/es/components/link/src/link.vue_vue_type_template_id_6a422645_lang.mjs.map +1 -1
  314. package/es/components/menu/index.d.ts +2 -2
  315. package/es/components/menu/src/menu.d.ts +2 -2
  316. package/es/components/pagination/index.d.ts +2 -2
  317. package/es/components/pagination/src/pagination.d.ts +2 -2
  318. package/es/components/popover/index.d.ts +32 -26
  319. package/es/components/popover/src/index.vue.d.ts +16 -13
  320. package/es/components/popover/src/index.vue_vue_type_script_lang.mjs +6 -1
  321. package/es/components/popover/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  322. package/es/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.mjs.map +1 -1
  323. package/es/components/rate/index.d.ts +11 -0
  324. package/es/components/rate/src/rate.d.ts +2 -0
  325. package/es/components/rate/src/rate.mjs +1 -1
  326. package/es/components/rate/src/rate.mjs.map +1 -1
  327. package/es/components/rate/src/rate.vue.d.ts +11 -0
  328. package/es/components/rate/src/rate.vue_vue_type_script_lang.mjs +7 -5
  329. package/es/components/rate/src/rate.vue_vue_type_script_lang.mjs.map +1 -1
  330. package/es/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.mjs +7 -7
  331. package/es/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.mjs.map +1 -1
  332. package/es/components/result/index.d.ts +11 -0
  333. package/es/components/result/src/result.d.ts +2 -0
  334. package/es/components/result/src/result.mjs.map +1 -1
  335. package/es/components/result/src/result.vue.d.ts +11 -0
  336. package/es/components/result/src/result.vue_vue_type_script_lang.mjs +4 -0
  337. package/es/components/result/src/result.vue_vue_type_script_lang.mjs.map +1 -1
  338. package/es/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.mjs +24 -25
  339. package/es/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.mjs.map +1 -1
  340. package/es/components/row/index.d.ts +3 -3
  341. package/es/components/row/src/row.d.ts +7 -6
  342. package/es/components/row/src/row.mjs +9 -6
  343. package/es/components/row/src/row.mjs.map +1 -1
  344. package/es/components/scrollbar/index.d.ts +2 -2
  345. package/es/components/scrollbar/src/bar.vue_vue_type_script_lang.mjs +11 -4
  346. package/es/components/scrollbar/src/bar.vue_vue_type_script_lang.mjs.map +1 -1
  347. package/es/components/scrollbar/src/bar.vue_vue_type_template_id_2f63f10a_lang.mjs.map +1 -1
  348. package/es/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
  349. package/es/components/select/index.d.ts +15 -13
  350. package/es/components/select/src/select.vue.d.ts +15 -13
  351. package/es/components/select/src/useSelect.d.ts +13 -11
  352. package/es/components/select-v2/index.d.ts +38 -28
  353. package/es/components/select-v2/src/defaults.d.ts +4 -1
  354. package/es/components/select-v2/src/defaults.mjs +4 -1
  355. package/es/components/select-v2/src/defaults.mjs.map +1 -1
  356. package/es/components/select-v2/src/select.vue.d.ts +19 -14
  357. package/es/components/select-v2/src/useSelect.d.ts +13 -11
  358. package/es/components/select-v2/src/useSelect.mjs +1 -1
  359. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  360. package/es/components/space/index.d.ts +2 -2
  361. package/es/components/space/src/space.d.ts +2 -2
  362. package/es/components/steps/index.d.ts +2 -2
  363. package/es/components/steps/src/index.vue.d.ts +2 -2
  364. package/es/components/switch/index.d.ts +11 -0
  365. package/es/components/switch/src/switch.vue.d.ts +11 -0
  366. package/es/components/switch/src/switch.vue_vue_type_script_lang.mjs +5 -3
  367. package/es/components/switch/src/switch.vue_vue_type_script_lang.mjs.map +1 -1
  368. package/es/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.mjs +21 -21
  369. package/es/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.mjs.map +1 -1
  370. package/es/components/table/index.d.ts +2 -2
  371. package/es/components/table/src/filter-panel.vue.d.ts +13 -11
  372. package/es/components/table/src/store/index.mjs +1 -1
  373. package/es/components/table/src/store/index.mjs.map +1 -1
  374. package/es/components/table/src/store/watcher.mjs +0 -5
  375. package/es/components/table/src/store/watcher.mjs.map +1 -1
  376. package/es/components/table/src/table.vue.d.ts +2 -2
  377. package/es/components/table/src/util.mjs +1 -1
  378. package/es/components/table/src/util.mjs.map +1 -1
  379. package/es/components/tag/index.d.ts +3 -3
  380. package/es/components/tag/src/tag.d.ts +1 -1
  381. package/es/components/tag/src/tag.vue.d.ts +3 -3
  382. package/es/components/time-picker/src/common/picker.vue.d.ts +16 -12
  383. package/es/components/time-picker/src/common/picker.vue_vue_type_script_lang.mjs +12 -1
  384. package/es/components/time-picker/src/common/picker.vue_vue_type_script_lang.mjs.map +1 -1
  385. package/es/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.mjs +5 -4
  386. package/es/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.mjs.map +1 -1
  387. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
  388. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.mjs +10 -10
  389. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.mjs.map +1 -1
  390. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.mjs +1 -1
  391. package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.mjs.map +1 -1
  392. package/es/components/timeline/index.d.ts +78 -106
  393. package/es/components/timeline/index.mjs +7 -7
  394. package/es/components/timeline/index.mjs.map +1 -1
  395. package/es/components/timeline/src/timeline-item.d.ts +15 -0
  396. package/es/components/timeline/src/timeline-item.mjs +43 -0
  397. package/es/components/timeline/src/timeline-item.mjs.map +1 -0
  398. package/es/components/timeline/src/timeline-item.vue.d.ts +54 -0
  399. package/es/components/timeline/src/timeline-item.vue_vue_type_script_lang.mjs +22 -0
  400. package/es/components/timeline/src/timeline-item.vue_vue_type_script_lang.mjs.map +1 -0
  401. package/es/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.mjs +60 -0
  402. package/es/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.mjs.map +1 -0
  403. package/es/components/timeline/src/timeline-item2.mjs +7 -0
  404. package/es/components/timeline/src/timeline-item2.mjs.map +1 -0
  405. package/es/components/timeline/src/{index.vue.d.ts → timeline.d.ts} +3 -2
  406. package/es/components/timeline/src/timeline.mjs +17 -0
  407. package/es/components/timeline/src/timeline.mjs.map +1 -0
  408. package/es/components/tooltip/index.d.ts +5 -4
  409. package/es/components/tooltip/src/content.vue.d.ts +4 -4
  410. package/es/components/tooltip/src/tooltip.vue.d.ts +5 -4
  411. package/es/components/tooltip/src/tooltip.vue_vue_type_script_lang.mjs +1 -0
  412. package/es/components/tooltip/src/tooltip.vue_vue_type_script_lang.mjs.map +1 -1
  413. package/es/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.mjs.map +1 -1
  414. package/es/components/virtual-list/src/builders/build-list.d.ts +2 -2
  415. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +2 -2
  416. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +2 -2
  417. package/es/hooks/use-namespace/index.d.ts +2 -0
  418. package/es/hooks/use-namespace/index.mjs +16 -11
  419. package/es/hooks/use-namespace/index.mjs.map +1 -1
  420. package/es/index.mjs +2 -0
  421. package/es/index.mjs.map +1 -1
  422. package/es/version.d.ts +1 -1
  423. package/es/version.mjs +1 -1
  424. package/es/version.mjs.map +1 -1
  425. package/lib/components/alert/index.d.ts +5 -5
  426. package/lib/components/alert/src/alert.d.ts +1 -1
  427. package/lib/components/alert/src/alert.vue.d.ts +5 -5
  428. package/lib/components/avatar/index.d.ts +1 -1
  429. package/lib/components/avatar/src/avatar.d.ts +3 -1
  430. package/lib/components/avatar/src/avatar.js +1 -1
  431. package/lib/components/avatar/src/avatar.js.map +1 -1
  432. package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
  433. package/lib/components/avatar/src/avatar.vue_vue_type_script_lang.js +13 -8
  434. package/lib/components/avatar/src/avatar.vue_vue_type_script_lang.js.map +1 -1
  435. package/lib/components/avatar/src/avatar.vue_vue_type_template_id_46e3f365_lang.js.map +1 -1
  436. package/lib/components/button/index.d.ts +6 -0
  437. package/lib/components/button/src/button-group.vue.d.ts +2 -0
  438. package/lib/components/button/src/button.vue.d.ts +2 -0
  439. package/lib/components/card/index.d.ts +13 -1
  440. package/lib/components/card/src/card.d.ts +2 -0
  441. package/lib/components/card/src/card.js.map +1 -1
  442. package/lib/components/card/src/card.vue.d.ts +13 -1
  443. package/lib/components/card/src/card.vue_vue_type_script_lang.js +9 -1
  444. package/lib/components/card/src/card.vue_vue_type_script_lang.js.map +1 -1
  445. package/lib/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.js +8 -9
  446. package/lib/components/card/src/card.vue_vue_type_template_id_7a6bdf05_lang.js.map +1 -1
  447. package/lib/components/cascader/index.d.ts +38 -34
  448. package/lib/components/cascader/src/index.vue.d.ts +19 -17
  449. package/lib/components/check-tag/index.d.ts +21 -9
  450. package/lib/components/check-tag/index.js +6 -3
  451. package/lib/components/check-tag/index.js.map +1 -1
  452. package/lib/components/check-tag/src/check-tag.d.ts +12 -0
  453. package/lib/components/check-tag/src/check-tag.js +21 -0
  454. package/lib/components/check-tag/src/check-tag.js.map +1 -0
  455. package/lib/components/check-tag/src/check-tag.vue.d.ts +29 -0
  456. package/lib/components/check-tag/src/{index.vue_vue_type_script_lang.js → check-tag.vue_vue_type_script_lang.js} +8 -10
  457. package/lib/components/check-tag/src/check-tag.vue_vue_type_script_lang.js.map +1 -0
  458. package/lib/components/check-tag/src/{index.vue_vue_type_template_id_58558910_lang.js → check-tag.vue_vue_type_template_id_d949910a_lang.js} +2 -5
  459. package/lib/components/check-tag/src/check-tag.vue_vue_type_template_id_d949910a_lang.js.map +1 -0
  460. package/lib/components/check-tag/src/check-tag2.js +12 -0
  461. package/lib/components/check-tag/src/check-tag2.js.map +1 -0
  462. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -1
  463. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.js +10 -1
  464. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_script_lang.js.map +1 -1
  465. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue_vue_type_template_id_78e07aa7_lang.js.map +1 -1
  466. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -1
  467. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.js +12 -1
  468. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_script_lang.js.map +1 -1
  469. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue_vue_type_template_id_62b45ab2_lang.js.map +1 -1
  470. package/lib/components/descriptions/index.d.ts +4 -4
  471. package/lib/components/descriptions/src/index.vue.d.ts +4 -4
  472. package/lib/components/divider/index.d.ts +14 -1
  473. package/lib/components/divider/src/divider.d.ts +2 -0
  474. package/lib/components/divider/src/divider.js.map +1 -1
  475. package/lib/components/divider/src/divider.vue.d.ts +15 -1
  476. package/lib/components/divider/src/divider.vue_vue_type_script_lang.js +15 -1
  477. package/lib/components/divider/src/divider.vue_vue_type_script_lang.js.map +1 -1
  478. package/lib/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.js +3 -3
  479. package/lib/components/divider/src/divider.vue_vue_type_template_id_6ddd3543_lang.js.map +1 -1
  480. package/lib/components/dropdown/index.d.ts +13 -11
  481. package/lib/components/dropdown/src/dropdown.vue.d.ts +13 -11
  482. package/lib/components/empty/index.d.ts +11 -0
  483. package/lib/components/empty/src/empty.d.ts +2 -0
  484. package/lib/components/empty/src/empty.js.map +1 -1
  485. package/lib/components/empty/src/empty.vue.d.ts +11 -0
  486. package/lib/components/empty/src/empty.vue_vue_type_script_lang.js +3 -0
  487. package/lib/components/empty/src/empty.vue_vue_type_script_lang.js.map +1 -1
  488. package/lib/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.js +19 -18
  489. package/lib/components/empty/src/empty.vue_vue_type_template_id_10d211eb_lang.js.map +1 -1
  490. package/lib/components/icon/index.d.ts +11 -0
  491. package/lib/components/icon/src/icon.d.ts +2 -0
  492. package/lib/components/icon/src/icon.js.map +1 -1
  493. package/lib/components/icon/src/icon.vue.d.ts +11 -0
  494. package/lib/components/icon/src/icon.vue_vue_type_script_lang.js +13 -14
  495. package/lib/components/icon/src/icon.vue_vue_type_script_lang.js.map +1 -1
  496. package/lib/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.js +1 -1
  497. package/lib/components/icon/src/icon.vue_vue_type_template_id_89b755b6_lang.js.map +1 -1
  498. package/lib/components/image/src/image.vue_vue_type_script_lang.js +14 -3
  499. package/lib/components/image/src/image.vue_vue_type_script_lang.js.map +1 -1
  500. package/lib/components/image/src/image.vue_vue_type_template_id_34467287_lang.js.map +1 -1
  501. package/lib/components/index.js +5 -0
  502. package/lib/components/index.js.map +1 -1
  503. package/lib/components/input-number/src/input-number.vue_vue_type_script_lang.js +1 -1
  504. package/lib/components/input-number/src/input-number.vue_vue_type_script_lang.js.map +1 -1
  505. package/lib/components/input-number/src/input-number.vue_vue_type_template_id_dec60af6_lang.js.map +1 -1
  506. package/lib/components/link/index.d.ts +11 -0
  507. package/lib/components/link/src/link.d.ts +2 -0
  508. package/lib/components/link/src/link.js.map +1 -1
  509. package/lib/components/link/src/link.vue.d.ts +11 -0
  510. package/lib/components/link/src/link.vue_vue_type_script_lang.js +4 -0
  511. package/lib/components/link/src/link.vue_vue_type_script_lang.js.map +1 -1
  512. package/lib/components/link/src/link.vue_vue_type_template_id_6a422645_lang.js +7 -8
  513. package/lib/components/link/src/link.vue_vue_type_template_id_6a422645_lang.js.map +1 -1
  514. package/lib/components/menu/index.d.ts +2 -2
  515. package/lib/components/menu/src/menu.d.ts +2 -2
  516. package/lib/components/pagination/index.d.ts +2 -2
  517. package/lib/components/pagination/src/pagination.d.ts +2 -2
  518. package/lib/components/popover/index.d.ts +32 -26
  519. package/lib/components/popover/src/index.vue.d.ts +16 -13
  520. package/lib/components/popover/src/index.vue_vue_type_script_lang.js +6 -1
  521. package/lib/components/popover/src/index.vue_vue_type_script_lang.js.map +1 -1
  522. package/lib/components/popover/src/index.vue_vue_type_template_id_15486cf0_lang.js.map +1 -1
  523. package/lib/components/rate/index.d.ts +11 -0
  524. package/lib/components/rate/src/rate.d.ts +2 -0
  525. package/lib/components/rate/src/rate.js +1 -1
  526. package/lib/components/rate/src/rate.js.map +1 -1
  527. package/lib/components/rate/src/rate.vue.d.ts +11 -0
  528. package/lib/components/rate/src/rate.vue_vue_type_script_lang.js +7 -5
  529. package/lib/components/rate/src/rate.vue_vue_type_script_lang.js.map +1 -1
  530. package/lib/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.js +7 -7
  531. package/lib/components/rate/src/rate.vue_vue_type_template_id_38c42df6_lang.js.map +1 -1
  532. package/lib/components/result/index.d.ts +11 -0
  533. package/lib/components/result/src/result.d.ts +2 -0
  534. package/lib/components/result/src/result.js.map +1 -1
  535. package/lib/components/result/src/result.vue.d.ts +11 -0
  536. package/lib/components/result/src/result.vue_vue_type_script_lang.js +4 -0
  537. package/lib/components/result/src/result.vue_vue_type_script_lang.js.map +1 -1
  538. package/lib/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.js +23 -24
  539. package/lib/components/result/src/result.vue_vue_type_template_id_263c10e5_lang.js.map +1 -1
  540. package/lib/components/row/index.d.ts +3 -3
  541. package/lib/components/row/src/row.d.ts +7 -6
  542. package/lib/components/row/src/row.js +9 -6
  543. package/lib/components/row/src/row.js.map +1 -1
  544. package/lib/components/scrollbar/index.d.ts +2 -2
  545. package/lib/components/scrollbar/src/bar.vue_vue_type_script_lang.js +10 -3
  546. package/lib/components/scrollbar/src/bar.vue_vue_type_script_lang.js.map +1 -1
  547. package/lib/components/scrollbar/src/bar.vue_vue_type_template_id_2f63f10a_lang.js.map +1 -1
  548. package/lib/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
  549. package/lib/components/select/index.d.ts +15 -13
  550. package/lib/components/select/src/select.vue.d.ts +15 -13
  551. package/lib/components/select/src/useSelect.d.ts +13 -11
  552. package/lib/components/select-v2/index.d.ts +38 -28
  553. package/lib/components/select-v2/src/defaults.d.ts +4 -1
  554. package/lib/components/select-v2/src/defaults.js +4 -1
  555. package/lib/components/select-v2/src/defaults.js.map +1 -1
  556. package/lib/components/select-v2/src/select.vue.d.ts +19 -14
  557. package/lib/components/select-v2/src/useSelect.d.ts +13 -11
  558. package/lib/components/select-v2/src/useSelect.js +1 -1
  559. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  560. package/lib/components/space/index.d.ts +2 -2
  561. package/lib/components/space/src/space.d.ts +2 -2
  562. package/lib/components/steps/index.d.ts +2 -2
  563. package/lib/components/steps/src/index.vue.d.ts +2 -2
  564. package/lib/components/switch/index.d.ts +11 -0
  565. package/lib/components/switch/src/switch.vue.d.ts +11 -0
  566. package/lib/components/switch/src/switch.vue_vue_type_script_lang.js +5 -3
  567. package/lib/components/switch/src/switch.vue_vue_type_script_lang.js.map +1 -1
  568. package/lib/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.js +21 -21
  569. package/lib/components/switch/src/switch.vue_vue_type_template_id_538fbc85_lang.js.map +1 -1
  570. package/lib/components/table/index.d.ts +2 -2
  571. package/lib/components/table/src/filter-panel.vue.d.ts +13 -11
  572. package/lib/components/table/src/store/index.js +1 -1
  573. package/lib/components/table/src/store/index.js.map +1 -1
  574. package/lib/components/table/src/store/watcher.js +0 -5
  575. package/lib/components/table/src/store/watcher.js.map +1 -1
  576. package/lib/components/table/src/table.vue.d.ts +2 -2
  577. package/lib/components/table/src/util.js +1 -1
  578. package/lib/components/table/src/util.js.map +1 -1
  579. package/lib/components/tag/index.d.ts +3 -3
  580. package/lib/components/tag/src/tag.d.ts +1 -1
  581. package/lib/components/tag/src/tag.vue.d.ts +3 -3
  582. package/lib/components/time-picker/src/common/picker.vue.d.ts +16 -12
  583. package/lib/components/time-picker/src/common/picker.vue_vue_type_script_lang.js +12 -1
  584. package/lib/components/time-picker/src/common/picker.vue_vue_type_script_lang.js.map +1 -1
  585. package/lib/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.js +5 -4
  586. package/lib/components/time-picker/src/common/picker.vue_vue_type_template_id_1d54be91_lang.js.map +1 -1
  587. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
  588. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.js +10 -10
  589. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_lang.js.map +1 -1
  590. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.js +1 -1
  591. package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_template_id_4fb3c576_lang.js.map +1 -1
  592. package/lib/components/timeline/index.d.ts +78 -106
  593. package/lib/components/timeline/index.js +8 -7
  594. package/lib/components/timeline/index.js.map +1 -1
  595. package/lib/components/timeline/src/timeline-item.d.ts +15 -0
  596. package/lib/components/timeline/src/timeline-item.js +47 -0
  597. package/lib/components/timeline/src/timeline-item.js.map +1 -0
  598. package/lib/components/timeline/src/timeline-item.vue.d.ts +54 -0
  599. package/lib/components/timeline/src/timeline-item.vue_vue_type_script_lang.js +26 -0
  600. package/lib/components/timeline/src/timeline-item.vue_vue_type_script_lang.js.map +1 -0
  601. package/lib/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.js +64 -0
  602. package/lib/components/timeline/src/timeline-item.vue_vue_type_template_id_1db6c36b_lang.js.map +1 -0
  603. package/lib/components/timeline/src/timeline-item2.js +12 -0
  604. package/lib/components/timeline/src/timeline-item2.js.map +1 -0
  605. package/lib/components/timeline/src/{index.vue.d.ts → timeline.d.ts} +3 -2
  606. package/lib/components/timeline/src/timeline.js +21 -0
  607. package/lib/components/timeline/src/timeline.js.map +1 -0
  608. package/lib/components/tooltip/index.d.ts +5 -4
  609. package/lib/components/tooltip/src/content.vue.d.ts +4 -4
  610. package/lib/components/tooltip/src/tooltip.vue.d.ts +5 -4
  611. package/lib/components/tooltip/src/tooltip.vue_vue_type_script_lang.js +1 -0
  612. package/lib/components/tooltip/src/tooltip.vue_vue_type_script_lang.js.map +1 -1
  613. package/lib/components/tooltip/src/tooltip.vue_vue_type_template_id_694d1617_lang.js.map +1 -1
  614. package/lib/components/virtual-list/src/builders/build-list.d.ts +2 -2
  615. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +2 -2
  616. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +2 -2
  617. package/lib/hooks/use-namespace/index.d.ts +2 -0
  618. package/lib/hooks/use-namespace/index.js +16 -15
  619. package/lib/hooks/use-namespace/index.js.map +1 -1
  620. package/lib/index.js +5 -0
  621. package/lib/index.js.map +1 -1
  622. package/lib/version.d.ts +1 -1
  623. package/lib/version.js +1 -1
  624. package/lib/version.js.map +1 -1
  625. package/package.json +2 -2
  626. package/tags.json +1 -1
  627. package/theme-chalk/el-popper.css +1 -1
  628. package/theme-chalk/index.css +1 -1
  629. package/theme-chalk/src/popper.scss +1 -1
  630. package/web-types.json +1 -1
  631. package/es/components/check-tag/src/index.mjs +0 -7
  632. package/es/components/check-tag/src/index.mjs.map +0 -1
  633. package/es/components/check-tag/src/index.vue.d.ts +0 -26
  634. package/es/components/check-tag/src/index.vue_vue_type_script_lang.mjs +0 -26
  635. package/es/components/check-tag/src/index.vue_vue_type_script_lang.mjs.map +0 -1
  636. package/es/components/check-tag/src/index.vue_vue_type_template_id_58558910_lang.mjs.map +0 -1
  637. package/es/components/timeline/src/index.mjs +0 -5
  638. package/es/components/timeline/src/index.mjs.map +0 -1
  639. package/es/components/timeline/src/index.vue_vue_type_script_lang.mjs +0 -17
  640. package/es/components/timeline/src/index.vue_vue_type_script_lang.mjs.map +0 -1
  641. package/es/components/timeline/src/item.mjs +0 -7
  642. package/es/components/timeline/src/item.mjs.map +0 -1
  643. package/es/components/timeline/src/item.vue.d.ts +0 -70
  644. package/es/components/timeline/src/item.vue_vue_type_script_lang.mjs +0 -53
  645. package/es/components/timeline/src/item.vue_vue_type_script_lang.mjs.map +0 -1
  646. package/es/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.mjs +0 -59
  647. package/es/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.mjs.map +0 -1
  648. package/lib/components/check-tag/src/index.js +0 -13
  649. package/lib/components/check-tag/src/index.js.map +0 -1
  650. package/lib/components/check-tag/src/index.vue.d.ts +0 -26
  651. package/lib/components/check-tag/src/index.vue_vue_type_script_lang.js.map +0 -1
  652. package/lib/components/check-tag/src/index.vue_vue_type_template_id_58558910_lang.js.map +0 -1
  653. package/lib/components/timeline/src/index.js +0 -10
  654. package/lib/components/timeline/src/index.js.map +0 -1
  655. package/lib/components/timeline/src/index.vue_vue_type_script_lang.js +0 -21
  656. package/lib/components/timeline/src/index.vue_vue_type_script_lang.js.map +0 -1
  657. package/lib/components/timeline/src/item.js +0 -12
  658. package/lib/components/timeline/src/item.js.map +0 -1
  659. package/lib/components/timeline/src/item.vue.d.ts +0 -70
  660. package/lib/components/timeline/src/item.vue_vue_type_script_lang.js +0 -57
  661. package/lib/components/timeline/src/item.vue_vue_type_script_lang.js.map +0 -1
  662. package/lib/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.js +0 -63
  663. package/lib/components/timeline/src/item.vue_vue_type_template_id_174d5b12_lang.js.map +0 -1
@@ -103,9 +103,8 @@ declare const _default: import("vue").DefineComponent<{
103
103
  style: StyleValue;
104
104
  transition: string;
105
105
  offset: number;
106
- visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
107
- content: string;
108
106
  effect: string;
107
+ visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
109
108
  arrowOffset: number;
110
109
  boundariesPadding: number;
111
110
  fallbackPlacements: import("@popperjs/core").Placement[];
@@ -168,6 +167,7 @@ declare const _default: import("vue").DefineComponent<{
168
167
  popperStyle: StyleValue;
169
168
  referenceEl: HTMLElement;
170
169
  stopPopperMouseEvent: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
170
+ content: string;
171
171
  showAfter: number;
172
172
  hideAfter: number;
173
173
  appendTo: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<string | HTMLElement>, unknown, unknown>;
@@ -221,9 +221,8 @@ declare const _default: import("vue").DefineComponent<{
221
221
  style: StyleValue;
222
222
  transition: string;
223
223
  offset: number;
224
- visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
225
- content: string;
226
224
  effect: string;
225
+ visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
227
226
  arrowOffset: number;
228
227
  boundariesPadding: number;
229
228
  fallbackPlacements: import("@popperjs/core").Placement[];
@@ -286,6 +285,7 @@ declare const _default: import("vue").DefineComponent<{
286
285
  popperStyle: StyleValue;
287
286
  referenceEl: HTMLElement;
288
287
  stopPopperMouseEvent: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
288
+ content: string;
289
289
  showAfter: number;
290
290
  hideAfter: number;
291
291
  appendTo: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<string | HTMLElement>, unknown, unknown>;
@@ -303,7 +303,7 @@ declare const _default: import("vue").DefineComponent<{
303
303
  virtualTriggering?: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown> | undefined;
304
304
  }> & {
305
305
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
306
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "style" | "transition" | "offset" | "visible" | "content" | "effect" | "arrowOffset" | "boundariesPadding" | "fallbackPlacements" | "gpuAcceleration" | "placement" | "popperOptions" | "strategy" | "className" | "enterable" | "pure" | "popperClass" | "popperStyle" | "referenceEl" | "stopPopperMouseEvent" | "showAfter" | "hideAfter" | "appendTo" | "rawContent" | "persistent" | "teleported" | "trigger" | "virtualRef" | "virtualTriggering" | "openDelay" | "visibleArrow" | "showArrow">;
306
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "style" | "transition" | "offset" | "effect" | "visible" | "arrowOffset" | "boundariesPadding" | "fallbackPlacements" | "gpuAcceleration" | "placement" | "popperOptions" | "strategy" | "className" | "enterable" | "pure" | "popperClass" | "popperStyle" | "referenceEl" | "stopPopperMouseEvent" | "content" | "showAfter" | "hideAfter" | "appendTo" | "rawContent" | "persistent" | "teleported" | "trigger" | "virtualRef" | "virtualTriggering" | "openDelay" | "visibleArrow" | "showArrow">;
307
307
  $attrs: {
308
308
  [x: string]: unknown;
309
309
  };
@@ -358,9 +358,8 @@ declare const _default: import("vue").DefineComponent<{
358
358
  style: StyleValue;
359
359
  transition: string;
360
360
  offset: number;
361
- visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
362
- content: string;
363
361
  effect: string;
362
+ visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
364
363
  arrowOffset: number;
365
364
  boundariesPadding: number;
366
365
  fallbackPlacements: import("@popperjs/core").Placement[];
@@ -423,6 +422,7 @@ declare const _default: import("vue").DefineComponent<{
423
422
  popperStyle: StyleValue;
424
423
  referenceEl: HTMLElement;
425
424
  stopPopperMouseEvent: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
425
+ content: string;
426
426
  showAfter: number;
427
427
  hideAfter: number;
428
428
  appendTo: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<string | HTMLElement>, unknown, unknown>;
@@ -482,6 +482,7 @@ declare const _default: import("vue").DefineComponent<{
482
482
  $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
483
483
  } & Readonly<{} & {} & {}> & import("vue").ShallowUnwrapRef<import("../..").ElPopperInjectionContext> & {} & {} & import("vue").ComponentCustomProperties) | null>;
484
484
  open: import("vue").Ref<boolean>;
485
+ hide: () => void;
485
486
  updatePopper: () => void;
486
487
  onOpen: () => void;
487
488
  onClose: () => void;
@@ -490,9 +491,8 @@ declare const _default: import("vue").DefineComponent<{
490
491
  style: StyleValue;
491
492
  transition: string;
492
493
  offset: number;
493
- visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
494
- content: string;
495
494
  effect: string;
495
+ visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
496
496
  arrowOffset: number;
497
497
  boundariesPadding: number;
498
498
  fallbackPlacements: import("@popperjs/core").Placement[];
@@ -555,6 +555,7 @@ declare const _default: import("vue").DefineComponent<{
555
555
  popperStyle: StyleValue;
556
556
  referenceEl: HTMLElement;
557
557
  stopPopperMouseEvent: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
558
+ content: string;
558
559
  showAfter: number;
559
560
  hideAfter: number;
560
561
  appendTo: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<string | HTMLElement>, unknown, unknown>;
@@ -628,9 +629,8 @@ declare const _default: import("vue").DefineComponent<{
628
629
  style: StyleValue;
629
630
  transition: string;
630
631
  offset: number;
631
- visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
632
- content: string;
633
632
  effect: string;
633
+ visible: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<boolean | null>, unknown, unknown>;
634
634
  arrowOffset: number;
635
635
  boundariesPadding: number;
636
636
  fallbackPlacements: import("@popperjs/core").Placement[];
@@ -693,6 +693,7 @@ declare const _default: import("vue").DefineComponent<{
693
693
  popperStyle: StyleValue;
694
694
  referenceEl: HTMLElement;
695
695
  stopPopperMouseEvent: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
696
+ content: string;
696
697
  showAfter: number;
697
698
  hideAfter: number;
698
699
  appendTo: import("../../../utils/props").BuildPropType<import("../../../utils/props").PropWrapper<string | HTMLElement>, unknown, unknown>;
@@ -752,6 +753,7 @@ declare const _default: import("vue").DefineComponent<{
752
753
  $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
753
754
  } & Readonly<{} & {} & {}> & import("vue").ShallowUnwrapRef<import("../..").ElPopperInjectionContext> & {} & {} & import("vue").ComponentCustomProperties) | null>;
754
755
  open: import("vue").Ref<boolean>;
756
+ hide: () => void;
755
757
  updatePopper: () => void;
756
758
  onOpen: () => void;
757
759
  onClose: () => void;
@@ -794,6 +796,7 @@ declare const _default: import("vue").DefineComponent<{
794
796
  $nextTick: typeof import("vue").nextTick;
795
797
  $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
796
798
  } & Readonly<{} & {} & {}> & import("vue").ShallowUnwrapRef<import("../..").ElPopperInjectionContext> & {} & {} & import("vue").ComponentCustomProperties) | null | undefined>;
799
+ hide: () => void;
797
800
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
798
801
  title?: unknown;
799
802
  hideAfter?: unknown;
@@ -805,7 +808,6 @@ declare const _default: import("vue").DefineComponent<{
805
808
  effect?: unknown;
806
809
  } & {
807
810
  width: import("../../../utils/props").BuildPropType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
808
- content: string;
809
811
  effect: string;
810
812
  enterable: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
811
813
  popperClass: string | {
@@ -834,6 +836,7 @@ declare const _default: import("vue").DefineComponent<{
834
836
  [x: string]: any;
835
837
  } | any)[])[])[])[])[])[])[])[])[])[])[];
836
838
  popperStyle: StyleValue;
839
+ content: string;
837
840
  hideAfter: number;
838
841
  } & {
839
842
  title?: string | undefined;
@@ -841,7 +844,6 @@ declare const _default: import("vue").DefineComponent<{
841
844
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
842
845
  }, {
843
846
  width: import("../../../utils/props").BuildPropType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
844
- content: string;
845
847
  effect: string;
846
848
  enterable: import("../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
847
849
  popperClass: string | {
@@ -870,6 +872,7 @@ declare const _default: import("vue").DefineComponent<{
870
872
  [x: string]: any;
871
873
  } | any)[])[])[])[])[])[])[])[])[])[])[];
872
874
  popperStyle: StyleValue;
875
+ content: string;
873
876
  hideAfter: number;
874
877
  }>;
875
878
  export default _default;
@@ -44,11 +44,16 @@ var script = vue.defineComponent({
44
44
  props.popperClass
45
45
  ];
46
46
  });
47
+ const hide = () => {
48
+ var _a;
49
+ (_a = tooltipRef.value) == null ? void 0 : _a.hide();
50
+ };
47
51
  return {
48
52
  kls,
49
53
  style,
50
54
  tooltipRef,
51
- popperRef
55
+ popperRef,
56
+ hide
52
57
  };
53
58
  }
54
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/popover/src/index.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n }\n },\n})\n</script>\n"],"names":["defineComponent","unref","isString","computed"],"mappings":";;;;;;;;;;AA6BA,WAAW,GAAG,CAAC,kBAAkB;;AAEjC,aAAeA,mBAAe;;AAE9B,EAAE,UAAU,EAAE;;AAEd,GAAG;;AAEH,EAAE,KAAK;EACL,MAAM;IACJ,MAAM;IACN,MAAM;;MAEJ,OAAO,CAAC,EAAE,GAAGC,SAAK;KACnB,CAAC,CAAC;IACH,MAAM,KAAK;MACT,IAAIC,eAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACzB,OAAO,KAAK,MAAM,CAAC;OACpB;;KAEF,CAAC,CAAC;UACG,KAAK,GAAGC,YAAQ,CAAC,MAAM;aACpB;;UAEH,KAAK,EAAE,KAAK,CAAC,KAAK;;;OAGrB,CAAC;MACF,CAAC;;aAEM;QACL;QACA,YAAY;QACZ,KAAK,CAAC;;;IAGV,OAAO;MACL,GAAG;WACE;gBACK;eACD;MACT;;;;;;"}
1
+ {"version":3,"file":"index.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/popover/src/index.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n const hide = () => {\n tooltipRef.value?.hide()\n }\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n hide,\n }\n },\n})\n</script>\n"],"names":["defineComponent","unref","isString","computed"],"mappings":";;;;;;;;;;AA6BA,WAAW,GAAG,CAAC,kBAAkB;;AAEjC,aAAeA,mBAAe;;AAE9B,EAAE,UAAU,EAAE;;AAEd,GAAG;;AAEH,EAAE,KAAK;EACL,MAAM;IACJ,MAAM;IACN,MAAM;;MAEJ,OAAO,CAAC,EAAE,GAAGC,SAAK;KACnB,CAAC,CAAC;IACH,MAAM,KAAK;MACT,IAAIC,eAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACzB,OAAO,KAAK,MAAM,CAAC;OACpB;;KAEF,CAAC,CAAC;UACG,KAAK,GAAGC,YAAQ,CAAC,MAAM;aACpB;;UAEH,KAAK,EAAE,KAAK,CAAC,KAAK;;;OAGrB,CAAC;MACF,CAAC;;aAEM;QACL;QACA,YAAY;QACZ,KAAK,CAAC;;;IAGV,MAAM,IAAI,GAAG,MAAM;MACjB,IAAI,GAAG;YACD,UAAU,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK;;WAElC;MACL;;;MAGA,SAAS;MACT,IAAI;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue_vue_type_template_id_15486cf0_lang.js","sources":["../../../../../../packages/components/popover/src/index.vue?vue&type=template&id=15486cf0&lang.js"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;EAgBwB;EAA0B;;;;;;;IAZ7C,cAAY,UAAK;IACjB;IACA;IACA;IACA;gBACD;;;OAOa;;;MAGX,2CAAA;;;;;;;;"}
1
+ {"version":3,"file":"index.vue_vue_type_template_id_15486cf0_lang.js","sources":["../../../../../../packages/components/popover/src/index.vue?vue&type=template&id=15486cf0&lang.js"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n const hide = () => {\n tooltipRef.value?.hide()\n }\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n hide,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;EAgBwB;EAA0B;;;;;;;IAZ7C,cAAY,UAAK;IACjB;IACA;IACA;IACA;gBACD;;;OAOa;;;MAGX,2CAAA;;;;;;;;"}
@@ -18,6 +18,17 @@ export declare const ElRate: import("../../utils/types").SFCWithInstall<import("
18
18
  readonly scoreTemplate: import("../../utils/props").BuildPropReturn<StringConstructor, "{value}", unknown, unknown, unknown>;
19
19
  readonly size: import("../../utils/props").BuildPropReturn<(new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../utils/types").ComponentSize & {}) | (() => import("../../utils/types").ComponentSize))[], unknown, unknown, unknown, unknown>;
20
20
  }, {
21
+ ns: {
22
+ namespace: import("vue").ComputedRef<string>;
23
+ b: (blockSuffix?: string) => string;
24
+ e: (element?: string | undefined) => string;
25
+ m: (modifier?: string | undefined) => string;
26
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
27
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
28
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
29
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
30
+ is: (name: string, state?: boolean) => string;
31
+ };
21
32
  hoverIndex: import("vue").Ref<number>;
22
33
  currentValue: import("vue").Ref<number>;
23
34
  rateDisabled: import("vue").ComputedRef<boolean | undefined>;
@@ -1,5 +1,6 @@
1
1
  import type { ComponentSize } from 'element-plus/es/utils/types';
2
2
  import type { Component, ExtractPropTypes } from 'vue';
3
+ import type Rate from './rate.vue';
3
4
  export declare const rateProps: {
4
5
  readonly modelValue: import("element-plus/es/utils/props").BuildPropReturn<NumberConstructor, 0, unknown, unknown, unknown>;
5
6
  readonly lowThreshold: import("element-plus/es/utils/props").BuildPropReturn<NumberConstructor, 2, unknown, unknown, unknown>;
@@ -26,3 +27,4 @@ export declare const rateEmits: {
26
27
  "update:modelValue": (value: number) => boolean;
27
28
  };
28
29
  export declare type RateEmits = typeof rateEmits;
30
+ export declare type RateInstance = InstanceType<typeof Rate>;
@@ -69,7 +69,7 @@ const rateProps = props.buildProps({
69
69
  default: "#1f2d3d"
70
70
  },
71
71
  texts: {
72
- type: props.definePropType([Array]),
72
+ type: props.definePropType(Array),
73
73
  default: () => props.mutable([
74
74
  "Extremely bad",
75
75
  "Disappointed",
@@ -1 +1 @@
1
- {"version":3,"file":"rate.js","sources":["../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons-vue'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type { Component, ExtractPropTypes, PropType } from 'vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['#F7BA2A', '#F7BA2A', '#F7BA2A'] as const),\n },\n voidColor: {\n type: String,\n default: '#C6D1DE',\n },\n disabledVoidColor: {\n type: String,\n default: '#EFF2F7',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Star,\n },\n disabledvoidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '#1f2d3d',\n },\n texts: {\n type: definePropType<string[]>([Array]),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n change: (value: number) => typeof value === 'number',\n [UPDATE_MODEL_EVENT]: (value: number) => typeof value === 'number',\n}\nexport type RateEmits = typeof rateEmits\n"],"names":["buildProps","definePropType","mutable","StarFilled","Star","isValidComponentSize","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;;AAIY,MAAC,SAAS,GAAGA,gBAAU,CAAC;AACpC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,oBAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,MAAMC,aAAO,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAC7D,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAED,oBAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,MAAM,CAACE,mBAAU,EAAEA,mBAAU,EAAEA,mBAAU,CAAC;AACvD,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEF,oBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAMG,aAAI;AACvB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAEH,oBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAME,mBAAU;AAC7B,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEF,oBAAc,CAAC,CAAC,KAAK,CAAC,CAAC;AACjC,IAAI,OAAO,EAAE,MAAMC,aAAO,CAAC;AAC3B,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,MAAM;AACZ,MAAM,WAAW;AACjB,MAAM,UAAU;AAChB,KAAK,CAAC;AACN,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAEG,+BAAoB;AACnC,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,OAAO,KAAK,KAAK,QAAQ;AAC9C,EAAE,CAACC,4BAAkB,GAAG,CAAC,KAAK,KAAK,OAAO,KAAK,KAAK,QAAQ;AAC5D;;;;;"}
1
+ {"version":3,"file":"rate.js","sources":["../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons-vue'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type { Component, ExtractPropTypes, PropType } from 'vue'\nimport type Rate from './rate.vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['#F7BA2A', '#F7BA2A', '#F7BA2A'] as const),\n },\n voidColor: {\n type: String,\n default: '#C6D1DE',\n },\n disabledVoidColor: {\n type: String,\n default: '#EFF2F7',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Star,\n },\n disabledvoidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '#1f2d3d',\n },\n texts: {\n type: definePropType<string[]>(Array),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n change: (value: number) => typeof value === 'number',\n [UPDATE_MODEL_EVENT]: (value: number) => typeof value === 'number',\n}\nexport type RateEmits = typeof rateEmits\n\nexport type RateInstance = InstanceType<typeof Rate>\n"],"names":["buildProps","definePropType","mutable","StarFilled","Star","isValidComponentSize","UPDATE_MODEL_EVENT"],"mappings":"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"}
@@ -18,6 +18,17 @@ declare const _default: import("vue").DefineComponent<{
18
18
  readonly scoreTemplate: import("../../../utils/props").BuildPropReturn<StringConstructor, "{value}", unknown, unknown, unknown>;
19
19
  readonly size: import("../../../utils/props").BuildPropReturn<(new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize) | ((new (...args: any[]) => import("../../../utils/types").ComponentSize & {}) | (() => import("../../../utils/types").ComponentSize))[], unknown, unknown, unknown, unknown>;
20
20
  }, {
21
+ ns: {
22
+ namespace: import("vue").ComputedRef<string>;
23
+ b: (blockSuffix?: string) => string;
24
+ e: (element?: string | undefined) => string;
25
+ m: (modifier?: string | undefined) => string;
26
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
27
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
28
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
29
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
30
+ is: (name: string, state?: boolean) => string;
31
+ };
21
32
  hoverIndex: import("vue").Ref<number>;
22
33
  currentValue: import("vue").Ref<number>;
23
34
  rateDisabled: import("vue").ComputedRef<boolean | undefined>;
@@ -14,6 +14,7 @@ require('../../../hooks/index.js');
14
14
  var rate = require('./rate.js');
15
15
  var form = require('../../../tokens/form.js');
16
16
  var index$1 = require('../../../hooks/use-common-props/index.js');
17
+ var index$2 = require('../../../hooks/use-namespace/index.js');
17
18
 
18
19
  function getValueFromMap(value, map) {
19
20
  const isExcludedObject = (val) => shared.isObject(val);
@@ -37,11 +38,11 @@ var script = vue.defineComponent({
37
38
  setup(props, { emit }) {
38
39
  const elForm = vue.inject(form.elFormKey, {});
39
40
  const rateSize = index$1.useSize();
41
+ const ns = index$2.useNamespace("rate");
40
42
  const currentValue = vue.ref(props.modelValue);
41
43
  const hoverIndex = vue.ref(-1);
42
44
  const pointerAtLeftHalf = vue.ref(true);
43
- const prefix = "el-rate";
44
- const rateKls = vue.computed(() => [prefix, `${prefix}--${rateSize.value}`]);
45
+ const rateKls = vue.computed(() => [ns.b(), ns.m(rateSize.value)]);
45
46
  const rateDisabled = vue.computed(() => props.disabled || elForm.disabled);
46
47
  const text = vue.computed(() => {
47
48
  let result = "";
@@ -151,10 +152,10 @@ var script = vue.defineComponent({
151
152
  }
152
153
  if (props.allowHalf) {
153
154
  let target = event.target;
154
- if (dom.hasClass(target, "el-rate__item")) {
155
- target = target.querySelector(".el-rate__icon");
155
+ if (dom.hasClass(target, ns.e("item"))) {
156
+ target = target.querySelector(`.${ns.e("icon")}`);
156
157
  }
157
- if (target.clientWidth === 0 || dom.hasClass(target, "el-rate__decimal")) {
158
+ if (target.clientWidth === 0 || dom.hasClass(target, ns.e("decimal"))) {
158
159
  target = target.parentNode;
159
160
  }
160
161
  pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
@@ -182,6 +183,7 @@ var script = vue.defineComponent({
182
183
  emit(constants.UPDATE_MODEL_EVENT, 0);
183
184
  }
184
185
  return {
186
+ ns,
185
187
  hoverIndex,
186
188
  currentValue,
187
189
  rateDisabled,
@@ -1 +1 @@
1
- {"version":3,"file":"rate.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const rateSize = useSize()\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const prefix = 'el-rate'\n const rateKls = computed(() => [prefix, `${prefix}--${rateSize.value}`])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n let target = event.target as HTMLElement\n if (hasClass(target, 'el-rate__item')) {\n target = target.querySelector('.el-rate__icon')!\n }\n if (target.clientWidth === 0 || hasClass(target, 'el-rate__decimal')) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElIcon","StarFilled","rateProps","inject","elFormKey","useSize","ref","computed","isArray","UPDATE_MODEL_EVENT","EVENT_CODE"],"mappings":"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"}
1
+ {"version":3,"file":"rate.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[ns.e('icon'), { hover: hoverIndex === item }]\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useNamespace, useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n const rateSize = useSize()\n const ns = useNamespace('rate')\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateKls = computed(() => [ns.b(), ns.m(rateSize.value)])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n // TODO: use cache via computed https://github.com/element-plus/element-plus/pull/5456#discussion_r786472092\n let target = event.target as HTMLElement\n if (hasClass(target, ns.e('item'))) {\n target = target.querySelector(`.${ns.e('icon')}`)!\n }\n if (target.clientWidth === 0 || hasClass(target, ns.e('decimal'))) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n ns,\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElIcon","StarFilled","rateProps","inject","elFormKey","useSize","ref","computed","UPDATE_MODEL_EVENT","EVENT_CODE"],"mappings":"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"}
@@ -21,14 +21,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
21
21
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.max, (item, key) => {
22
22
  return vue.openBlock(), vue.createElementBlock("span", {
23
23
  key,
24
- class: "el-rate__item",
24
+ class: vue.normalizeClass(_ctx.ns.e("item")),
25
25
  style: vue.normalizeStyle({ cursor: _ctx.rateDisabled ? "auto" : "pointer" }),
26
26
  onMousemove: ($event) => _ctx.setCurrentValue(item, $event),
27
27
  onMouseleave: _cache[0] || (_cache[0] = (...args) => _ctx.resetCurrentValue && _ctx.resetCurrentValue(...args)),
28
28
  onClick: ($event) => _ctx.selectValue(item)
29
29
  }, [
30
30
  vue.createVNode(_component_el_icon, {
31
- class: vue.normalizeClass([[{ hover: _ctx.hoverIndex === item }], "el-rate__icon"]),
31
+ class: vue.normalizeClass([_ctx.ns.e("icon"), { hover: _ctx.hoverIndex === item }]),
32
32
  style: vue.normalizeStyle(_ctx.getIconStyle(item))
33
33
  }, {
34
34
  default: vue.withCtx(() => [
@@ -36,23 +36,23 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
36
36
  _ctx.showDecimalIcon(item) ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
37
37
  key: 0,
38
38
  style: vue.normalizeStyle(_ctx.decimalStyle),
39
- class: "el-rate__icon el-rate__decimal"
39
+ class: vue.normalizeClass([_ctx.ns.e("icon"), _ctx.ns.e("decimal")])
40
40
  }, {
41
41
  default: vue.withCtx(() => [
42
42
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.decimalIconComponent)))
43
43
  ]),
44
44
  _: 1
45
- }, 8, ["style"])) : vue.createCommentVNode("v-if", true)
45
+ }, 8, ["style", "class"])) : vue.createCommentVNode("v-if", true)
46
46
  ]),
47
47
  _: 2
48
48
  }, 1032, ["class", "style"])
49
- ], 44, _hoisted_2);
49
+ ], 46, _hoisted_2);
50
50
  }), 128)),
51
51
  _ctx.showText || _ctx.showScore ? (vue.openBlock(), vue.createElementBlock("span", {
52
52
  key: 0,
53
- class: "el-rate__text",
53
+ class: vue.normalizeClass(_ctx.ns.e("text")),
54
54
  style: vue.normalizeStyle({ color: _ctx.textColor })
55
- }, vue.toDisplayString(_ctx.text), 5)) : vue.createCommentVNode("v-if", true)
55
+ }, vue.toDisplayString(_ctx.text), 7)) : vue.createCommentVNode("v-if", true)
56
56
  ], 42, _hoisted_1);
57
57
  }
58
58
 
@@ -1 +1 @@
1
- {"version":3,"file":"rate.vue_vue_type_template_id_38c42df6_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const rateSize = useSize()\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const prefix = 'el-rate'\n const rateKls = computed(() => [prefix, `${prefix}--${rateSize.value}`])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n let target = event.target as HTMLElement\n if (hasClass(target, 'el-rate__item')) {\n target = target.querySelector('.el-rate__icon')!\n }\n if (target.clientWidth === 0 || hasClass(target, 'el-rate__decimal')) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["_openBlock","_createVNode"],"mappings":";;;;;;;;;;;;;;IAEK,uBAAO;IACR;IACC,eAAa,EAAE;IACf;IACD,iBAAc;;;aAGNA,gDAAE;;;;QAIP;QACD;QACC;;QAEAC,eAAU;eACL,gCAAa,KAAK;;;UAGrB;;;;;;;;;;;;;;;;;;;;;;KAeG;;;;;"}
1
+ {"version":3,"file":"rate.vue_vue_type_template_id_38c42df6_lang.js","sources":["../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"rateKls\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[ns.e('icon'), { hover: hoverIndex === item }]\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <el-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </el-icon>\n </el-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n :class=\"ns.e('text')\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-plus/tokens'\nimport { hasClass } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\n\nimport { UPDATE_MODEL_EVENT } from '@element-plus/utils/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons-vue'\nimport { useNamespace, useSize } from '@element-plus/hooks'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-plus/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'ElRate',\n components: {\n ElIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n emits: rateEmits,\n\n setup(props, { emit }) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n const rateSize = useSize()\n const ns = useNamespace('rate')\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateKls = computed(() => [ns.b(), ns.m(rateSize.value)])\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n function selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emit(UPDATE_MODEL_EVENT, currentValue.value)\n if (props.modelValue !== currentValue.value) {\n emit('change', currentValue.value)\n }\n } else {\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n }\n }\n\n function handleKey(e: KeyboardEvent) {\n if (rateDisabled.value) {\n return\n }\n let _currentValue = currentValue.value\n const code = e.code\n if (code === EVENT_CODE.up || code === EVENT_CODE.right) {\n if (props.allowHalf) {\n _currentValue += 0.5\n } else {\n _currentValue += 1\n }\n e.stopPropagation()\n e.preventDefault()\n } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {\n if (props.allowHalf) {\n _currentValue -= 0.5\n } else {\n _currentValue -= 1\n }\n e.stopPropagation()\n e.preventDefault()\n }\n _currentValue = _currentValue < 0 ? 0 : _currentValue\n _currentValue = _currentValue > props.max ? props.max : _currentValue\n emit(UPDATE_MODEL_EVENT, _currentValue)\n emit('change', _currentValue)\n return _currentValue\n }\n\n function setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n // TODO: use cache via computed https://github.com/element-plus/element-plus/pull/5456#discussion_r786472092\n let target = event.target as HTMLElement\n if (hasClass(target, ns.e('item'))) {\n target = target.querySelector(`.${ns.e('icon')}`)!\n }\n if (target.clientWidth === 0 || hasClass(target, ns.e('decimal'))) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n }\n\n function resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n }\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value =\n props.modelValue !== Math.floor(props.modelValue)\n }\n )\n\n if (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n }\n\n return {\n ns,\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n rateKls,\n\n showDecimalIcon,\n getIconStyle,\n selectValue,\n handleKey,\n setCurrentValue,\n resetCurrentValue,\n }\n },\n})\n</script>\n"],"names":["_openBlock","_createVNode"],"mappings":";;;;;;;;;;;;;;IAEK,uBAAO;IACR;IACC,eAAa,EAAE;IACf;IACD,iBAAc;;;aAGNA,gDAAE;;;;QAIP;QACA,uBAAO;QACP;;QAEAC,eAAU;eACL,gCAAa;;;UAGhB,2BAAQ;;;;;yCAKmB;;;;;;oCAI1B;;;;;;;;;;;KAKE;;;;;"}
@@ -3,6 +3,17 @@ export declare const ElResult: import("../../utils/types").SFCWithInstall<import
3
3
  readonly subTitle: import("../../utils/props").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
4
4
  readonly icon: import("../../utils/props").BuildPropReturn<unknown, "info", unknown, "success" | "warning" | "info" | "error", unknown>;
5
5
  }, {
6
+ ns: {
7
+ namespace: import("vue").ComputedRef<string>;
8
+ b: (blockSuffix?: string) => string;
9
+ e: (element?: string | undefined) => string;
10
+ m: (modifier?: string | undefined) => string;
11
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
12
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
13
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
14
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
15
+ is: (name: string, state?: boolean) => string;
16
+ };
6
17
  resultIcon: import("vue").ComputedRef<{
7
18
  class: "icon-success" | "icon-warning" | "icon-error" | "icon-info";
8
19
  component: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
@@ -1,4 +1,5 @@
1
1
  import type { Component, ExtractPropTypes } from 'vue';
2
+ import type Result from './result.vue';
2
3
  export declare const IconMap: {
3
4
  readonly success: "icon-success";
4
5
  readonly warning: "icon-warning";
@@ -12,3 +13,4 @@ export declare const resultProps: {
12
13
  readonly icon: import("element-plus/es/utils/props").BuildPropReturn<unknown, "info", unknown, "success" | "warning" | "info" | "error", unknown>;
13
14
  };
14
15
  export declare type ResultProps = ExtractPropTypes<typeof resultProps>;
16
+ export declare type ResultInstance = InstanceType<typeof Result>;
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils/props'\nimport {\n WarningFilled,\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n} from '@element-plus/icons-vue'\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const IconMap = {\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n typeof IconMap[keyof typeof IconMap],\n Component\n> = {\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport const resultProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n subTitle: {\n type: String,\n default: '',\n },\n icon: {\n values: ['success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\nexport type ResultProps = ExtractPropTypes<typeof resultProps>\n"],"names":["CircleCheckFilled","WarningFilled","CircleCloseFilled","InfoFilled","buildProps"],"mappings":";;;;;;;AAOY,MAAC,OAAO,GAAG;AACvB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAGA,0BAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAGC,sBAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAGC,0BAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAGC,mBAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAGC,gBAAU,CAAC;AACtC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AACnD,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;;;"}
1
+ {"version":3,"file":"result.js","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils/props'\nimport {\n WarningFilled,\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n} from '@element-plus/icons-vue'\nimport type { Component, ExtractPropTypes } from 'vue'\nimport type Result from './result.vue'\n\nexport const IconMap = {\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n typeof IconMap[keyof typeof IconMap],\n Component\n> = {\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport const resultProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n subTitle: {\n type: String,\n default: '',\n },\n icon: {\n values: ['success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\nexport type ResultProps = ExtractPropTypes<typeof resultProps>\n\nexport type ResultInstance = InstanceType<typeof Result>\n"],"names":["CircleCheckFilled","WarningFilled","CircleCloseFilled","InfoFilled","buildProps"],"mappings":";;;;;;;AAOY,MAAC,OAAO,GAAG;AACvB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAGA,0BAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAGC,sBAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAGC,0BAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAGC,mBAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAGC,gBAAU,CAAC;AACtC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AACnD,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;;;"}
@@ -3,6 +3,17 @@ declare const _default: import("vue").DefineComponent<{
3
3
  readonly subTitle: import("../../../utils/props").BuildPropReturn<StringConstructor, "", unknown, unknown, unknown>;
4
4
  readonly icon: import("../../../utils/props").BuildPropReturn<unknown, "info", unknown, "success" | "warning" | "info" | "error", unknown>;
5
5
  }, {
6
+ ns: {
7
+ namespace: import("vue").ComputedRef<string>;
8
+ b: (blockSuffix?: string) => string;
9
+ e: (element?: string | undefined) => string;
10
+ m: (modifier?: string | undefined) => string;
11
+ be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
12
+ em: (element?: string | undefined, modifier?: string | undefined) => string;
13
+ bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
14
+ bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
15
+ is: (name: string, state?: boolean) => string;
16
+ };
6
17
  resultIcon: import("vue").ComputedRef<{
7
18
  class: "icon-success" | "icon-warning" | "icon-error" | "icon-info";
8
19
  component: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
@@ -3,12 +3,15 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ require('../../../hooks/index.js');
6
7
  var result = require('./result.js');
8
+ var index = require('../../../hooks/use-namespace/index.js');
7
9
 
8
10
  var script = vue.defineComponent({
9
11
  name: "ElResult",
10
12
  props: result.resultProps,
11
13
  setup(props) {
14
+ const ns = index.useNamespace("result");
12
15
  const resultIcon = vue.computed(() => {
13
16
  const icon = props.icon;
14
17
  const iconClass = icon && result.IconMap[icon] ? result.IconMap[icon] : "icon-info";
@@ -19,6 +22,7 @@ var script = vue.defineComponent({
19
22
  };
20
23
  });
21
24
  return {
25
+ ns,
22
26
  resultIcon
23
27
  };
24
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"result.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/result/src/result.vue"],"sourcesContent":["<template>\n <div class=\"el-result\">\n <div class=\"el-result__icon\">\n <slot name=\"icon\">\n <component\n :is=\"resultIcon.component\"\n v-if=\"resultIcon.component\"\n :class=\"resultIcon.class\"\n />\n </slot>\n </div>\n <div v-if=\"title || $slots.title\" class=\"el-result__title\">\n <slot name=\"title\">\n <p>{{ title }}</p>\n </slot>\n </div>\n <div v-if=\"subTitle || $slots.subTitle\" class=\"el-result__subtitle\">\n <slot name=\"subTitle\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" class=\"el-result__extra\">\n <slot name=\"extra\"></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { resultProps, IconComponentMap, IconMap } from './result'\n\nexport default defineComponent({\n name: 'ElResult',\n props: resultProps,\n setup(props) {\n const resultIcon = computed(() => {\n const icon = props.icon\n const iconClass = icon && IconMap[icon] ? IconMap[icon] : 'icon-info'\n const iconComponent =\n IconComponentMap[iconClass] || IconComponentMap['icon-info']\n\n return {\n class: iconClass,\n component: iconComponent,\n }\n })\n\n return {\n resultIcon,\n }\n },\n})\n</script>\n"],"names":["defineComponent","resultProps","IconMap","IconComponentMap"],"mappings":";;;;;;;AA4BA,aAAeA,mBAAe,CAAC;;AAE/B,EAAE,KAAK,EAAEC,kBAAW;EAClB,MAAM,KAAK,EAAE;IACX,MAAM,UAAU;MACd,MAAM;MACN,MAAM,SAAS,GAAG,IAAI,IAAIC;MAC1B,MAAM,aAAa,GAAGC;MACtB,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,aAAa;;MAE1B,CAAC;WACI;gBACK;MACV;;;;;;"}
1
+ {"version":3,"file":"result.vue_vue_type_script_lang.js","sources":["../../../../../../packages/components/result/src/result.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('icon')\">\n <slot name=\"icon\">\n <component\n :is=\"resultIcon.component\"\n v-if=\"resultIcon.component\"\n :class=\"resultIcon.class\"\n />\n </slot>\n </div>\n <div v-if=\"title || $slots.title\" :class=\"ns.e('title')\">\n <slot name=\"title\">\n <p>{{ title }}</p>\n </slot>\n </div>\n <div v-if=\"subTitle || $slots.subTitle\" :class=\"ns.e('subtitle')\">\n <slot name=\"subTitle\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\"></slot>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { resultProps, IconComponentMap, IconMap } from './result'\n\nexport default defineComponent({\n name: 'ElResult',\n props: resultProps,\n setup(props) {\n const ns = useNamespace('result')\n\n const resultIcon = computed(() => {\n const icon = props.icon\n const iconClass = icon && IconMap[icon] ? IconMap[icon] : 'icon-info'\n const iconComponent =\n IconComponentMap[iconClass] || IconComponentMap['icon-info']\n\n return {\n class: iconClass,\n component: iconComponent,\n }\n })\n\n return {\n ns,\n resultIcon,\n }\n },\n})\n</script>\n"],"names":["defineComponent","resultProps","useNamespace","IconComponentMap"],"mappings":";;;;;;;;;AA6BA,aAAeA,mBAAe,CAAC;;AAE/B,EAAE,KAAK,EAAEC,kBAAW;EAClB,MAAM,KAAK,EAAE;IACX,MAAM,EAAE,GAAGC;IACX,MAAM;MACJ,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;;MAExB,MAAM,aAAa,GAAGC;MACtB,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE;QACX;;WAEG;QACH;gBACQ;MACV;;;;;;"}