element-pe 2.2.46 → 2.2.47

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 (648) hide show
  1. package/dist/index.full.js +3 -3
  2. package/dist/index.full.min.js +1 -1
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +9 -9
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +3 -3
  7. package/es/components/alert/index.d.ts +4 -4
  8. package/es/components/alert/src/alert.d.ts +1 -1
  9. package/es/components/alert/src/alert.vue.d.ts +4 -4
  10. package/es/components/autocomplete/index.d.ts +65 -65
  11. package/es/components/autocomplete/src/autocomplete.vue.d.ts +65 -65
  12. package/es/components/autocomplete/src/autocomplete2.mjs +1 -1
  13. package/es/components/avatar/index.mjs +2 -2
  14. package/es/components/avatar/src/avatar.mjs +69 -32
  15. package/es/components/avatar/src/avatar.mjs.map +1 -1
  16. package/es/components/avatar/src/avatar2.mjs +32 -69
  17. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  18. package/es/components/backtop/index.mjs +2 -2
  19. package/es/components/backtop/src/backtop.mjs +61 -23
  20. package/es/components/backtop/src/backtop.mjs.map +1 -1
  21. package/es/components/backtop/src/backtop2.mjs +23 -61
  22. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  23. package/es/components/breadcrumb/index.mjs +2 -2
  24. package/es/components/breadcrumb/src/breadcrumb.mjs +11 -36
  25. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  26. package/es/components/breadcrumb/src/breadcrumb2.mjs +36 -11
  27. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  28. package/es/components/button/index.d.ts +5 -5
  29. package/es/components/button/src/button.d.ts +1 -1
  30. package/es/components/button/src/button.vue.d.ts +5 -5
  31. package/es/components/button/src/use-button.d.ts +1 -1
  32. package/es/components/calendar/index.d.ts +5 -5
  33. package/es/components/calendar/src/calendar.vue.d.ts +5 -5
  34. package/es/components/card/index.mjs +2 -2
  35. package/es/components/card/src/card.mjs +16 -35
  36. package/es/components/card/src/card.mjs.map +1 -1
  37. package/es/components/card/src/card2.mjs +35 -16
  38. package/es/components/card/src/card2.mjs.map +1 -1
  39. package/es/components/carousel/index.d.ts +5 -5
  40. package/es/components/carousel/src/carousel.d.ts +1 -1
  41. package/es/components/carousel/src/carousel.vue.d.ts +5 -5
  42. package/es/components/cascader/index.d.ts +128 -128
  43. package/es/components/cascader/index.mjs +2 -2
  44. package/es/components/cascader/src/cascader.mjs +622 -63
  45. package/es/components/cascader/src/cascader.mjs.map +1 -1
  46. package/es/components/cascader/src/cascader.vue.d.ts +64 -64
  47. package/es/components/cascader/src/cascader2.mjs +63 -622
  48. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  49. package/es/components/collection/index.mjs +1 -1
  50. package/es/components/collection/src/collection.mjs +62 -10
  51. package/es/components/collection/src/collection.mjs.map +1 -1
  52. package/es/components/collection/src/collection2.mjs +10 -62
  53. package/es/components/collection/src/collection2.mjs.map +1 -1
  54. package/es/components/color-picker/index.d.ts +35 -35
  55. package/es/components/color-picker/src/color-picker.vue.d.ts +35 -35
  56. package/es/components/countdown/index.mjs +2 -2
  57. package/es/components/countdown/src/countdown.mjs +76 -23
  58. package/es/components/countdown/src/countdown.mjs.map +1 -1
  59. package/es/components/countdown/src/countdown2.mjs +23 -76
  60. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  61. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +17 -17
  62. package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +17 -17
  63. package/es/components/date-picker/src/panel-utils.d.ts +34 -34
  64. package/es/components/descriptions/index.mjs +2 -2
  65. package/es/components/descriptions/src/description.mjs +27 -120
  66. package/es/components/descriptions/src/description.mjs.map +1 -1
  67. package/es/components/descriptions/src/description2.mjs +120 -27
  68. package/es/components/descriptions/src/description2.mjs.map +1 -1
  69. package/es/components/dialog/index.d.ts +1 -1
  70. package/es/components/dialog/src/dialog.vue.d.ts +1 -1
  71. package/es/components/dropdown/index.d.ts +14 -14
  72. package/es/components/dropdown/index.mjs +2 -2
  73. package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -2
  74. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +1 -1
  75. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  76. package/es/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
  77. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  78. package/es/components/dropdown/src/dropdown.mjs +310 -105
  79. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  80. package/es/components/dropdown/src/dropdown.vue.d.ts +12 -12
  81. package/es/components/dropdown/src/dropdown2.mjs +105 -310
  82. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  83. package/es/components/focus-trap/src/focus-trap.mjs +1 -2
  84. package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
  85. package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
  86. package/es/components/form/index.d.ts +12 -12
  87. package/es/components/form/index.mjs +2 -2
  88. package/es/components/form/src/form-item.d.ts +1 -1
  89. package/es/components/form/src/form-item.mjs +46 -326
  90. package/es/components/form/src/form-item.mjs.map +1 -1
  91. package/es/components/form/src/form-item.vue.d.ts +5 -5
  92. package/es/components/form/src/form-item2.mjs +326 -46
  93. package/es/components/form/src/form-item2.mjs.map +1 -1
  94. package/es/components/image/index.d.ts +1 -1
  95. package/es/components/image/index.mjs +2 -2
  96. package/es/components/image/src/image.mjs +226 -65
  97. package/es/components/image/src/image.mjs.map +1 -1
  98. package/es/components/image/src/image.vue.d.ts +1 -1
  99. package/es/components/image/src/image2.mjs +65 -226
  100. package/es/components/image/src/image2.mjs.map +1 -1
  101. package/es/components/index.mjs +36 -36
  102. package/es/components/input/index.d.ts +12 -12
  103. package/es/components/input/src/input.vue.d.ts +12 -12
  104. package/es/components/input-number/index.d.ts +45 -45
  105. package/es/components/input-number/src/input-number.vue.d.ts +45 -45
  106. package/es/components/link/index.mjs +2 -2
  107. package/es/components/link/src/link.mjs +21 -50
  108. package/es/components/link/src/link.mjs.map +1 -1
  109. package/es/components/link/src/link2.mjs +50 -21
  110. package/es/components/link/src/link2.mjs.map +1 -1
  111. package/es/components/menu/index.d.ts +3 -3
  112. package/es/components/menu/index.mjs +4 -4
  113. package/es/components/menu/src/menu-item-group.mjs +4 -35
  114. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  115. package/es/components/menu/src/menu-item-group2.mjs +35 -4
  116. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  117. package/es/components/menu/src/menu-item.mjs +14 -97
  118. package/es/components/menu/src/menu-item.mjs.map +1 -1
  119. package/es/components/menu/src/menu-item2.mjs +97 -14
  120. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  121. package/es/components/menu/src/menu.d.ts +4 -4
  122. package/es/components/message/src/message.d.ts +1 -1
  123. package/es/components/message/src/message.vue.d.ts +4 -4
  124. package/es/components/notification/index.mjs +1 -1
  125. package/es/components/notification/src/notification.d.ts +1 -1
  126. package/es/components/notification/src/notification.mjs +149 -69
  127. package/es/components/notification/src/notification.mjs.map +1 -1
  128. package/es/components/notification/src/notification.vue.d.ts +4 -4
  129. package/es/components/notification/src/notification2.mjs +69 -149
  130. package/es/components/notification/src/notification2.mjs.map +1 -1
  131. package/es/components/notification/src/notify.mjs +2 -2
  132. package/es/components/page-header/index.mjs +2 -2
  133. package/es/components/page-header/src/page-header.mjs +17 -103
  134. package/es/components/page-header/src/page-header.mjs.map +1 -1
  135. package/es/components/page-header/src/page-header2.mjs +103 -17
  136. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  137. package/es/components/pagination/src/components/jumper.mjs +9 -60
  138. package/es/components/pagination/src/components/jumper.mjs.map +1 -1
  139. package/es/components/pagination/src/components/jumper.vue.d.ts +12 -12
  140. package/es/components/pagination/src/components/jumper2.mjs +60 -9
  141. package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
  142. package/es/components/pagination/src/components/next.mjs +38 -19
  143. package/es/components/pagination/src/components/next.mjs.map +1 -1
  144. package/es/components/pagination/src/components/next2.mjs +19 -38
  145. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  146. package/es/components/pagination/src/components/pager.mjs +216 -17
  147. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  148. package/es/components/pagination/src/components/pager2.mjs +17 -216
  149. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  150. package/es/components/pagination/src/components/sizes.vue.d.ts +14 -14
  151. package/es/components/pagination/src/components/total.mjs +7 -28
  152. package/es/components/pagination/src/components/total.mjs.map +1 -1
  153. package/es/components/pagination/src/components/total2.mjs +28 -7
  154. package/es/components/pagination/src/components/total2.mjs.map +1 -1
  155. package/es/components/pagination/src/pagination.mjs +4 -4
  156. package/es/components/popconfirm/index.d.ts +23 -23
  157. package/es/components/popconfirm/index.mjs +2 -2
  158. package/es/components/popconfirm/src/popconfirm.mjs +47 -110
  159. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  160. package/es/components/popconfirm/src/popconfirm.vue.d.ts +23 -23
  161. package/es/components/popconfirm/src/popconfirm2.mjs +110 -47
  162. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  163. package/es/components/popover/index.d.ts +18 -18
  164. package/es/components/popover/src/popover.mjs +2 -2
  165. package/es/components/popover/src/popover.vue.d.ts +18 -18
  166. package/es/components/popper/index.mjs +6 -6
  167. package/es/components/popper/src/content.mjs +139 -94
  168. package/es/components/popper/src/content.mjs.map +1 -1
  169. package/es/components/popper/src/content.vue.d.ts +6 -6
  170. package/es/components/popper/src/content2.mjs +94 -139
  171. package/es/components/popper/src/content2.mjs.map +1 -1
  172. package/es/components/popper/src/popper.mjs +32 -25
  173. package/es/components/popper/src/popper.mjs.map +1 -1
  174. package/es/components/popper/src/popper2.mjs +25 -32
  175. package/es/components/popper/src/popper2.mjs.map +1 -1
  176. package/es/components/popper/src/trigger.mjs +31 -121
  177. package/es/components/popper/src/trigger.mjs.map +1 -1
  178. package/es/components/popper/src/trigger2.mjs +121 -31
  179. package/es/components/popper/src/trigger2.mjs.map +1 -1
  180. package/es/components/radio/index.mjs +6 -6
  181. package/es/components/radio/src/radio-button.mjs +64 -9
  182. package/es/components/radio/src/radio-button.mjs.map +1 -1
  183. package/es/components/radio/src/radio-button2.mjs +9 -64
  184. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  185. package/es/components/radio/src/radio-group.mjs +36 -70
  186. package/es/components/radio/src/radio-group.mjs.map +1 -1
  187. package/es/components/radio/src/radio-group2.mjs +70 -36
  188. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  189. package/es/components/radio/src/radio.mjs +30 -71
  190. package/es/components/radio/src/radio.mjs.map +1 -1
  191. package/es/components/radio/src/radio2.mjs +71 -30
  192. package/es/components/radio/src/radio2.mjs.map +1 -1
  193. package/es/components/rate/index.mjs +2 -2
  194. package/es/components/rate/src/rate.mjs +87 -257
  195. package/es/components/rate/src/rate.mjs.map +1 -1
  196. package/es/components/rate/src/rate2.mjs +257 -87
  197. package/es/components/rate/src/rate2.mjs.map +1 -1
  198. package/es/components/result/index.d.ts +4 -4
  199. package/es/components/result/index.mjs +2 -2
  200. package/es/components/result/src/result.d.ts +1 -1
  201. package/es/components/result/src/result.mjs +29 -63
  202. package/es/components/result/src/result.mjs.map +1 -1
  203. package/es/components/result/src/result.vue.d.ts +4 -4
  204. package/es/components/result/src/result2.mjs +63 -29
  205. package/es/components/result/src/result2.mjs.map +1 -1
  206. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  207. package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
  208. package/es/components/row/index.mjs +2 -2
  209. package/es/components/row/src/row.mjs +30 -45
  210. package/es/components/row/src/row.mjs.map +1 -1
  211. package/es/components/row/src/row2.mjs +45 -30
  212. package/es/components/row/src/row2.mjs.map +1 -1
  213. package/es/components/select/index.d.ts +14 -14
  214. package/es/components/select/src/select.mjs +1 -1
  215. package/es/components/select/src/select.vue.d.ts +14 -14
  216. package/es/components/select/src/useSelect.d.ts +12 -12
  217. package/es/components/select-v2/index.d.ts +30 -30
  218. package/es/components/select-v2/src/defaults.mjs +1 -1
  219. package/es/components/select-v2/src/option-item.vue.d.ts +1 -1
  220. package/es/components/select-v2/src/select.vue.d.ts +15 -15
  221. package/es/components/select-v2/src/useSelect.d.ts +13 -13
  222. package/es/components/skeleton/index.mjs +2 -2
  223. package/es/components/skeleton/src/skeleton.mjs +49 -22
  224. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  225. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  226. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  227. package/es/components/slider/index.d.ts +75 -75
  228. package/es/components/slider/index.mjs +2 -2
  229. package/es/components/slider/src/button.mjs +21 -93
  230. package/es/components/slider/src/button.mjs.map +1 -1
  231. package/es/components/slider/src/button.vue.d.ts +6 -6
  232. package/es/components/slider/src/button2.mjs +93 -21
  233. package/es/components/slider/src/button2.mjs.map +1 -1
  234. package/es/components/slider/src/composables/use-slide.d.ts +24 -24
  235. package/es/components/slider/src/slider.mjs +91 -233
  236. package/es/components/slider/src/slider.mjs.map +1 -1
  237. package/es/components/slider/src/slider.vue.d.ts +75 -75
  238. package/es/components/slider/src/slider2.mjs +233 -91
  239. package/es/components/slider/src/slider2.mjs.map +1 -1
  240. package/es/components/steps/index.d.ts +16 -16
  241. package/es/components/steps/index.mjs +2 -2
  242. package/es/components/steps/src/item.d.ts +1 -1
  243. package/es/components/steps/src/item.mjs +190 -19
  244. package/es/components/steps/src/item.mjs.map +1 -1
  245. package/es/components/steps/src/item.vue.d.ts +4 -4
  246. package/es/components/steps/src/item2.mjs +19 -190
  247. package/es/components/steps/src/item2.mjs.map +1 -1
  248. package/es/components/steps/src/steps.d.ts +2 -2
  249. package/es/components/steps/src/steps.vue.d.ts +8 -8
  250. package/es/components/switch/index.mjs +2 -2
  251. package/es/components/switch/src/switch.mjs +88 -243
  252. package/es/components/switch/src/switch.mjs.map +1 -1
  253. package/es/components/switch/src/switch2.mjs +243 -88
  254. package/es/components/switch/src/switch2.mjs.map +1 -1
  255. package/es/components/table/index.d.ts +1 -1
  256. package/es/components/table/src/filter-panel.vue.d.ts +12 -12
  257. package/es/components/table/src/table.vue.d.ts +1 -1
  258. package/es/components/tabs/index.mjs +2 -2
  259. package/es/components/tabs/src/tab-pane.mjs +73 -14
  260. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  261. package/es/components/tabs/src/tab-pane2.mjs +14 -73
  262. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  263. package/es/components/tag/index.d.ts +1 -1
  264. package/es/components/tag/src/tag.vue.d.ts +1 -1
  265. package/es/components/text/index.mjs +2 -2
  266. package/es/components/text/src/text.mjs +22 -35
  267. package/es/components/text/src/text.mjs.map +1 -1
  268. package/es/components/text/src/text2.mjs +35 -22
  269. package/es/components/text/src/text2.mjs.map +1 -1
  270. package/es/components/time-picker/src/common/picker.vue.d.ts +34 -34
  271. package/es/components/time-select/index.d.ts +62 -62
  272. package/es/components/time-select/src/time-select.vue.d.ts +31 -31
  273. package/es/components/tooltip/index.d.ts +6 -6
  274. package/es/components/tooltip/index.mjs +3 -3
  275. package/es/components/tooltip/src/content.mjs +31 -179
  276. package/es/components/tooltip/src/content.mjs.map +1 -1
  277. package/es/components/tooltip/src/content.vue.d.ts +6 -6
  278. package/es/components/tooltip/src/content2.mjs +179 -31
  279. package/es/components/tooltip/src/content2.mjs.map +1 -1
  280. package/es/components/tooltip/src/tooltip.mjs +31 -174
  281. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  282. package/es/components/tooltip/src/tooltip.vue.d.ts +6 -6
  283. package/es/components/tooltip/src/tooltip2.mjs +174 -31
  284. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  285. package/es/components/tooltip/src/trigger.mjs +1 -1
  286. package/es/components/tooltip/src/trigger2.mjs +1 -1
  287. package/es/components/tooltip-v2/index.d.ts +4 -4
  288. package/es/components/tooltip-v2/index.mjs +3 -3
  289. package/es/components/tooltip-v2/src/arrow.mjs +22 -37
  290. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  291. package/es/components/tooltip-v2/src/arrow2.mjs +37 -22
  292. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  293. package/es/components/tooltip-v2/src/content2.mjs +1 -1
  294. package/es/components/tooltip-v2/src/root.mjs +17 -82
  295. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  296. package/es/components/tooltip-v2/src/root2.mjs +82 -17
  297. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  298. package/es/components/tooltip-v2/src/tooltip.mjs +3 -3
  299. package/es/components/tooltip-v2/src/tooltip.vue.d.ts +4 -4
  300. package/es/components/tooltip-v2/src/tooltip2.mjs +6 -6
  301. package/es/components/tooltip-v2/src/trigger.mjs +12 -91
  302. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  303. package/es/components/tooltip-v2/src/trigger2.mjs +91 -12
  304. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  305. package/es/components/transfer/index.d.ts +65 -65
  306. package/es/components/transfer/index.mjs +2 -2
  307. package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
  308. package/es/components/transfer/src/transfer-panel.vue.d.ts +12 -12
  309. package/es/components/transfer/src/transfer-panel2.mjs +1 -1
  310. package/es/components/transfer/src/transfer.mjs +162 -69
  311. package/es/components/transfer/src/transfer.mjs.map +1 -1
  312. package/es/components/transfer/src/transfer.vue.d.ts +65 -65
  313. package/es/components/transfer/src/transfer2.mjs +69 -162
  314. package/es/components/transfer/src/transfer2.mjs.map +1 -1
  315. package/es/components/tree-v2/index.d.ts +1 -1
  316. package/es/components/tree-v2/src/tree-node.vue.d.ts +1 -1
  317. package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
  318. package/es/components/upload/index.d.ts +5 -5
  319. package/es/components/upload/src/upload-content.vue.d.ts +1 -1
  320. package/es/components/upload/src/upload.vue.d.ts +5 -5
  321. package/es/components/visual-hidden/index.mjs +3 -3
  322. package/es/components/visual-hidden/src/visual-hidden.mjs +7 -35
  323. package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
  324. package/es/components/visual-hidden/src/visual-hidden2.mjs +35 -7
  325. package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
  326. package/es/index.mjs +36 -36
  327. package/lib/components/alert/index.d.ts +4 -4
  328. package/lib/components/alert/src/alert.d.ts +1 -1
  329. package/lib/components/alert/src/alert.vue.d.ts +4 -4
  330. package/lib/components/autocomplete/index.d.ts +65 -65
  331. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +65 -65
  332. package/lib/components/autocomplete/src/autocomplete2.js +1 -1
  333. package/lib/components/avatar/index.js +2 -2
  334. package/lib/components/avatar/src/avatar.js +69 -33
  335. package/lib/components/avatar/src/avatar.js.map +1 -1
  336. package/lib/components/avatar/src/avatar2.js +33 -69
  337. package/lib/components/avatar/src/avatar2.js.map +1 -1
  338. package/lib/components/backtop/index.js +2 -2
  339. package/lib/components/backtop/src/backtop.js +61 -24
  340. package/lib/components/backtop/src/backtop.js.map +1 -1
  341. package/lib/components/backtop/src/backtop2.js +24 -61
  342. package/lib/components/backtop/src/backtop2.js.map +1 -1
  343. package/lib/components/breadcrumb/index.js +2 -2
  344. package/lib/components/breadcrumb/src/breadcrumb.js +11 -36
  345. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  346. package/lib/components/breadcrumb/src/breadcrumb2.js +36 -11
  347. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  348. package/lib/components/button/index.d.ts +5 -5
  349. package/lib/components/button/src/button.d.ts +1 -1
  350. package/lib/components/button/src/button.vue.d.ts +5 -5
  351. package/lib/components/button/src/use-button.d.ts +1 -1
  352. package/lib/components/calendar/index.d.ts +5 -5
  353. package/lib/components/calendar/src/calendar.vue.d.ts +5 -5
  354. package/lib/components/card/index.js +2 -2
  355. package/lib/components/card/src/card.js +16 -35
  356. package/lib/components/card/src/card.js.map +1 -1
  357. package/lib/components/card/src/card2.js +35 -16
  358. package/lib/components/card/src/card2.js.map +1 -1
  359. package/lib/components/carousel/index.d.ts +5 -5
  360. package/lib/components/carousel/src/carousel.d.ts +1 -1
  361. package/lib/components/carousel/src/carousel.vue.d.ts +5 -5
  362. package/lib/components/cascader/index.d.ts +128 -128
  363. package/lib/components/cascader/index.js +2 -2
  364. package/lib/components/cascader/src/cascader.js +622 -64
  365. package/lib/components/cascader/src/cascader.js.map +1 -1
  366. package/lib/components/cascader/src/cascader.vue.d.ts +64 -64
  367. package/lib/components/cascader/src/cascader2.js +64 -622
  368. package/lib/components/cascader/src/cascader2.js.map +1 -1
  369. package/lib/components/collection/index.js +1 -1
  370. package/lib/components/collection/src/collection.js +62 -9
  371. package/lib/components/collection/src/collection.js.map +1 -1
  372. package/lib/components/collection/src/collection2.js +9 -62
  373. package/lib/components/collection/src/collection2.js.map +1 -1
  374. package/lib/components/color-picker/index.d.ts +35 -35
  375. package/lib/components/color-picker/src/color-picker.vue.d.ts +35 -35
  376. package/lib/components/countdown/index.js +2 -2
  377. package/lib/components/countdown/src/countdown.js +76 -24
  378. package/lib/components/countdown/src/countdown.js.map +1 -1
  379. package/lib/components/countdown/src/countdown2.js +24 -76
  380. package/lib/components/countdown/src/countdown2.js.map +1 -1
  381. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +17 -17
  382. package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +17 -17
  383. package/lib/components/date-picker/src/panel-utils.d.ts +34 -34
  384. package/lib/components/descriptions/index.js +2 -2
  385. package/lib/components/descriptions/src/description.js +27 -120
  386. package/lib/components/descriptions/src/description.js.map +1 -1
  387. package/lib/components/descriptions/src/description2.js +120 -27
  388. package/lib/components/descriptions/src/description2.js.map +1 -1
  389. package/lib/components/dialog/index.d.ts +1 -1
  390. package/lib/components/dialog/src/dialog.vue.d.ts +1 -1
  391. package/lib/components/dropdown/index.d.ts +14 -14
  392. package/lib/components/dropdown/index.js +2 -2
  393. package/lib/components/dropdown/src/dropdown-item-impl.js +2 -2
  394. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +1 -1
  395. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  396. package/lib/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
  397. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  398. package/lib/components/dropdown/src/dropdown.js +310 -114
  399. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  400. package/lib/components/dropdown/src/dropdown.vue.d.ts +12 -12
  401. package/lib/components/dropdown/src/dropdown2.js +114 -310
  402. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  403. package/lib/components/focus-trap/src/focus-trap.js +5 -6
  404. package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
  405. package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
  406. package/lib/components/form/index.d.ts +12 -12
  407. package/lib/components/form/index.js +2 -2
  408. package/lib/components/form/src/form-item.d.ts +1 -1
  409. package/lib/components/form/src/form-item.js +47 -330
  410. package/lib/components/form/src/form-item.js.map +1 -1
  411. package/lib/components/form/src/form-item.vue.d.ts +5 -5
  412. package/lib/components/form/src/form-item2.js +330 -47
  413. package/lib/components/form/src/form-item2.js.map +1 -1
  414. package/lib/components/image/index.d.ts +1 -1
  415. package/lib/components/image/index.js +2 -2
  416. package/lib/components/image/src/image.js +225 -65
  417. package/lib/components/image/src/image.js.map +1 -1
  418. package/lib/components/image/src/image.vue.d.ts +1 -1
  419. package/lib/components/image/src/image2.js +65 -225
  420. package/lib/components/image/src/image2.js.map +1 -1
  421. package/lib/components/index.js +36 -36
  422. package/lib/components/input/index.d.ts +12 -12
  423. package/lib/components/input/src/input.vue.d.ts +12 -12
  424. package/lib/components/input-number/index.d.ts +45 -45
  425. package/lib/components/input-number/src/input-number.vue.d.ts +45 -45
  426. package/lib/components/link/index.js +2 -2
  427. package/lib/components/link/src/link.js +22 -50
  428. package/lib/components/link/src/link.js.map +1 -1
  429. package/lib/components/link/src/link2.js +50 -22
  430. package/lib/components/link/src/link2.js.map +1 -1
  431. package/lib/components/menu/index.d.ts +3 -3
  432. package/lib/components/menu/index.js +4 -4
  433. package/lib/components/menu/src/menu-item-group.js +4 -35
  434. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  435. package/lib/components/menu/src/menu-item-group2.js +35 -4
  436. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  437. package/lib/components/menu/src/menu-item.js +15 -97
  438. package/lib/components/menu/src/menu-item.js.map +1 -1
  439. package/lib/components/menu/src/menu-item2.js +97 -15
  440. package/lib/components/menu/src/menu-item2.js.map +1 -1
  441. package/lib/components/menu/src/menu.d.ts +4 -4
  442. package/lib/components/message/src/message.d.ts +1 -1
  443. package/lib/components/message/src/message.vue.d.ts +4 -4
  444. package/lib/components/notification/index.js +1 -1
  445. package/lib/components/notification/src/notification.d.ts +1 -1
  446. package/lib/components/notification/src/notification.js +148 -70
  447. package/lib/components/notification/src/notification.js.map +1 -1
  448. package/lib/components/notification/src/notification.vue.d.ts +4 -4
  449. package/lib/components/notification/src/notification2.js +70 -148
  450. package/lib/components/notification/src/notification2.js.map +1 -1
  451. package/lib/components/notification/src/notify.js +2 -2
  452. package/lib/components/page-header/index.js +2 -2
  453. package/lib/components/page-header/src/page-header.js +18 -103
  454. package/lib/components/page-header/src/page-header.js.map +1 -1
  455. package/lib/components/page-header/src/page-header2.js +103 -18
  456. package/lib/components/page-header/src/page-header2.js.map +1 -1
  457. package/lib/components/pagination/src/components/jumper.js +9 -60
  458. package/lib/components/pagination/src/components/jumper.js.map +1 -1
  459. package/lib/components/pagination/src/components/jumper.vue.d.ts +12 -12
  460. package/lib/components/pagination/src/components/jumper2.js +60 -9
  461. package/lib/components/pagination/src/components/jumper2.js.map +1 -1
  462. package/lib/components/pagination/src/components/next.js +38 -19
  463. package/lib/components/pagination/src/components/next.js.map +1 -1
  464. package/lib/components/pagination/src/components/next2.js +19 -38
  465. package/lib/components/pagination/src/components/next2.js.map +1 -1
  466. package/lib/components/pagination/src/components/pager.js +216 -17
  467. package/lib/components/pagination/src/components/pager.js.map +1 -1
  468. package/lib/components/pagination/src/components/pager2.js +17 -216
  469. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  470. package/lib/components/pagination/src/components/sizes.vue.d.ts +14 -14
  471. package/lib/components/pagination/src/components/total.js +7 -28
  472. package/lib/components/pagination/src/components/total.js.map +1 -1
  473. package/lib/components/pagination/src/components/total2.js +28 -7
  474. package/lib/components/pagination/src/components/total2.js.map +1 -1
  475. package/lib/components/pagination/src/pagination.js +4 -4
  476. package/lib/components/popconfirm/index.d.ts +23 -23
  477. package/lib/components/popconfirm/index.js +2 -2
  478. package/lib/components/popconfirm/src/popconfirm.js +48 -110
  479. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  480. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +23 -23
  481. package/lib/components/popconfirm/src/popconfirm2.js +110 -48
  482. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  483. package/lib/components/popover/index.d.ts +18 -18
  484. package/lib/components/popover/src/popover.js +2 -2
  485. package/lib/components/popover/src/popover.vue.d.ts +18 -18
  486. package/lib/components/popper/index.js +6 -6
  487. package/lib/components/popper/src/content.js +139 -99
  488. package/lib/components/popper/src/content.js.map +1 -1
  489. package/lib/components/popper/src/content.vue.d.ts +6 -6
  490. package/lib/components/popper/src/content2.js +99 -139
  491. package/lib/components/popper/src/content2.js.map +1 -1
  492. package/lib/components/popper/src/popper.js +32 -28
  493. package/lib/components/popper/src/popper.js.map +1 -1
  494. package/lib/components/popper/src/popper2.js +28 -32
  495. package/lib/components/popper/src/popper2.js.map +1 -1
  496. package/lib/components/popper/src/trigger.js +32 -121
  497. package/lib/components/popper/src/trigger.js.map +1 -1
  498. package/lib/components/popper/src/trigger2.js +121 -32
  499. package/lib/components/popper/src/trigger2.js.map +1 -1
  500. package/lib/components/radio/index.js +6 -6
  501. package/lib/components/radio/src/radio-button.js +64 -9
  502. package/lib/components/radio/src/radio-button.js.map +1 -1
  503. package/lib/components/radio/src/radio-button2.js +9 -64
  504. package/lib/components/radio/src/radio-button2.js.map +1 -1
  505. package/lib/components/radio/src/radio-group.js +37 -70
  506. package/lib/components/radio/src/radio-group.js.map +1 -1
  507. package/lib/components/radio/src/radio-group2.js +70 -37
  508. package/lib/components/radio/src/radio-group2.js.map +1 -1
  509. package/lib/components/radio/src/radio.js +32 -71
  510. package/lib/components/radio/src/radio.js.map +1 -1
  511. package/lib/components/radio/src/radio2.js +71 -32
  512. package/lib/components/radio/src/radio2.js.map +1 -1
  513. package/lib/components/rate/index.js +2 -2
  514. package/lib/components/rate/src/rate.js +87 -256
  515. package/lib/components/rate/src/rate.js.map +1 -1
  516. package/lib/components/rate/src/rate2.js +256 -87
  517. package/lib/components/rate/src/rate2.js.map +1 -1
  518. package/lib/components/result/index.d.ts +4 -4
  519. package/lib/components/result/index.js +2 -2
  520. package/lib/components/result/src/result.d.ts +1 -1
  521. package/lib/components/result/src/result.js +31 -63
  522. package/lib/components/result/src/result.js.map +1 -1
  523. package/lib/components/result/src/result.vue.d.ts +4 -4
  524. package/lib/components/result/src/result2.js +63 -31
  525. package/lib/components/result/src/result2.js.map +1 -1
  526. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  527. package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
  528. package/lib/components/row/index.js +2 -2
  529. package/lib/components/row/src/row.js +32 -45
  530. package/lib/components/row/src/row.js.map +1 -1
  531. package/lib/components/row/src/row2.js +45 -32
  532. package/lib/components/row/src/row2.js.map +1 -1
  533. package/lib/components/select/index.d.ts +14 -14
  534. package/lib/components/select/src/select.js +1 -1
  535. package/lib/components/select/src/select.vue.d.ts +14 -14
  536. package/lib/components/select/src/useSelect.d.ts +12 -12
  537. package/lib/components/select-v2/index.d.ts +30 -30
  538. package/lib/components/select-v2/src/defaults.js +1 -1
  539. package/lib/components/select-v2/src/option-item.vue.d.ts +1 -1
  540. package/lib/components/select-v2/src/select.vue.d.ts +15 -15
  541. package/lib/components/select-v2/src/useSelect.d.ts +13 -13
  542. package/lib/components/skeleton/index.js +2 -2
  543. package/lib/components/skeleton/src/skeleton.js +49 -22
  544. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  545. package/lib/components/skeleton/src/skeleton2.js +22 -49
  546. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  547. package/lib/components/slider/index.d.ts +75 -75
  548. package/lib/components/slider/index.js +2 -2
  549. package/lib/components/slider/src/button.js +22 -93
  550. package/lib/components/slider/src/button.js.map +1 -1
  551. package/lib/components/slider/src/button.vue.d.ts +6 -6
  552. package/lib/components/slider/src/button2.js +93 -22
  553. package/lib/components/slider/src/button2.js.map +1 -1
  554. package/lib/components/slider/src/composables/use-slide.d.ts +24 -24
  555. package/lib/components/slider/src/slider.js +92 -233
  556. package/lib/components/slider/src/slider.js.map +1 -1
  557. package/lib/components/slider/src/slider.vue.d.ts +75 -75
  558. package/lib/components/slider/src/slider2.js +233 -92
  559. package/lib/components/slider/src/slider2.js.map +1 -1
  560. package/lib/components/steps/index.d.ts +16 -16
  561. package/lib/components/steps/index.js +2 -2
  562. package/lib/components/steps/src/item.d.ts +1 -1
  563. package/lib/components/steps/src/item.js +190 -19
  564. package/lib/components/steps/src/item.js.map +1 -1
  565. package/lib/components/steps/src/item.vue.d.ts +4 -4
  566. package/lib/components/steps/src/item2.js +19 -190
  567. package/lib/components/steps/src/item2.js.map +1 -1
  568. package/lib/components/steps/src/steps.d.ts +2 -2
  569. package/lib/components/steps/src/steps.vue.d.ts +8 -8
  570. package/lib/components/switch/index.js +2 -2
  571. package/lib/components/switch/src/switch.js +88 -242
  572. package/lib/components/switch/src/switch.js.map +1 -1
  573. package/lib/components/switch/src/switch2.js +242 -88
  574. package/lib/components/switch/src/switch2.js.map +1 -1
  575. package/lib/components/table/index.d.ts +1 -1
  576. package/lib/components/table/src/filter-panel.vue.d.ts +12 -12
  577. package/lib/components/table/src/table.vue.d.ts +1 -1
  578. package/lib/components/tabs/index.js +2 -2
  579. package/lib/components/tabs/src/tab-pane.js +73 -14
  580. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  581. package/lib/components/tabs/src/tab-pane2.js +14 -73
  582. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  583. package/lib/components/tag/index.d.ts +1 -1
  584. package/lib/components/tag/src/tag.vue.d.ts +1 -1
  585. package/lib/components/text/index.js +2 -2
  586. package/lib/components/text/src/text.js +22 -35
  587. package/lib/components/text/src/text.js.map +1 -1
  588. package/lib/components/text/src/text2.js +35 -22
  589. package/lib/components/text/src/text2.js.map +1 -1
  590. package/lib/components/time-picker/src/common/picker.vue.d.ts +34 -34
  591. package/lib/components/time-select/index.d.ts +62 -62
  592. package/lib/components/time-select/src/time-select.vue.d.ts +31 -31
  593. package/lib/components/tooltip/index.d.ts +6 -6
  594. package/lib/components/tooltip/index.js +3 -3
  595. package/lib/components/tooltip/src/content.js +31 -179
  596. package/lib/components/tooltip/src/content.js.map +1 -1
  597. package/lib/components/tooltip/src/content.vue.d.ts +6 -6
  598. package/lib/components/tooltip/src/content2.js +179 -31
  599. package/lib/components/tooltip/src/content2.js.map +1 -1
  600. package/lib/components/tooltip/src/tooltip.js +34 -173
  601. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  602. package/lib/components/tooltip/src/tooltip.vue.d.ts +6 -6
  603. package/lib/components/tooltip/src/tooltip2.js +173 -34
  604. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  605. package/lib/components/tooltip/src/trigger.js +1 -1
  606. package/lib/components/tooltip/src/trigger2.js +1 -1
  607. package/lib/components/tooltip-v2/index.d.ts +4 -4
  608. package/lib/components/tooltip-v2/index.js +3 -3
  609. package/lib/components/tooltip-v2/src/arrow.js +23 -37
  610. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  611. package/lib/components/tooltip-v2/src/arrow2.js +37 -23
  612. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  613. package/lib/components/tooltip-v2/src/content2.js +1 -1
  614. package/lib/components/tooltip-v2/src/root.js +17 -82
  615. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  616. package/lib/components/tooltip-v2/src/root2.js +82 -17
  617. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  618. package/lib/components/tooltip-v2/src/tooltip.js +3 -3
  619. package/lib/components/tooltip-v2/src/tooltip.vue.d.ts +4 -4
  620. package/lib/components/tooltip-v2/src/tooltip2.js +6 -6
  621. package/lib/components/tooltip-v2/src/trigger.js +12 -91
  622. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  623. package/lib/components/tooltip-v2/src/trigger2.js +91 -12
  624. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  625. package/lib/components/transfer/index.d.ts +65 -65
  626. package/lib/components/transfer/index.js +2 -2
  627. package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
  628. package/lib/components/transfer/src/transfer-panel.vue.d.ts +12 -12
  629. package/lib/components/transfer/src/transfer-panel2.js +1 -1
  630. package/lib/components/transfer/src/transfer.js +162 -73
  631. package/lib/components/transfer/src/transfer.js.map +1 -1
  632. package/lib/components/transfer/src/transfer.vue.d.ts +65 -65
  633. package/lib/components/transfer/src/transfer2.js +73 -162
  634. package/lib/components/transfer/src/transfer2.js.map +1 -1
  635. package/lib/components/tree-v2/index.d.ts +1 -1
  636. package/lib/components/tree-v2/src/tree-node.vue.d.ts +1 -1
  637. package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
  638. package/lib/components/upload/index.d.ts +5 -5
  639. package/lib/components/upload/src/upload-content.vue.d.ts +1 -1
  640. package/lib/components/upload/src/upload.vue.d.ts +5 -5
  641. package/lib/components/visual-hidden/index.js +2 -2
  642. package/lib/components/visual-hidden/src/visual-hidden.js +7 -35
  643. package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
  644. package/lib/components/visual-hidden/src/visual-hidden2.js +35 -7
  645. package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
  646. package/lib/index.js +36 -36
  647. package/package.json +1 -1
  648. package/web-types.json +1 -1
@@ -1,95 +1,265 @@
1
- import { StarFilled, Star } from '@element-plus/icons-vue';
1
+ import { defineComponent, inject, ref, computed, markRaw, openBlock, createElementBlock, unref, normalizeClass, normalizeStyle, Fragment, renderList, createVNode, withCtx, withDirectives, createBlock, resolveDynamicComponent, vShow, createCommentVNode, toDisplayString } from 'vue';
2
+ import '../../config-provider/index.mjs';
2
3
  import '../../../constants/index.mjs';
3
4
  import '../../../utils/index.mjs';
5
+ import '../../form/index.mjs';
6
+ import { ElIcon } from '../../icon/index.mjs';
4
7
  import '../../../hooks/index.mjs';
5
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
6
- import { mutable } from '../../../utils/typescript.mjs';
7
- import { iconPropType } from '../../../utils/vue/icon.mjs';
8
- import { useSizeProp } from '../../../hooks/use-size/index.mjs';
9
- import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
10
- import { isNumber } from '../../../utils/types.mjs';
8
+ import { rateProps, rateEmits } from './rate.mjs';
9
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
+ import { isObject, isArray, isString } from '@vue/shared';
11
+ import { formContextKey, formItemContextKey } from '../../form/src/constants.mjs';
12
+ import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
13
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
14
+ import { useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
15
+ import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
16
+ import { EVENT_CODE } from '../../../constants/aria.mjs';
17
+ import { hasClass } from '../../../utils/dom/style.mjs';
18
+ import { watch } from '../../config-provider/src/for-editor.mjs';
11
19
 
12
- const rateProps = buildProps({
13
- modelValue: {
14
- type: Number,
15
- default: 0
16
- },
17
- id: {
18
- type: String,
19
- default: void 0
20
- },
21
- lowThreshold: {
22
- type: Number,
23
- default: 2
24
- },
25
- highThreshold: {
26
- type: Number,
27
- default: 4
28
- },
29
- max: {
30
- type: Number,
31
- default: 5
32
- },
33
- colors: {
34
- type: definePropType([Array, Object]),
35
- default: () => mutable(["", "", ""])
36
- },
37
- voidColor: {
38
- type: String,
39
- default: ""
40
- },
41
- disabledVoidColor: {
42
- type: String,
43
- default: ""
44
- },
45
- icons: {
46
- type: definePropType([Array, Object]),
47
- default: () => [StarFilled, StarFilled, StarFilled]
48
- },
49
- voidIcon: {
50
- type: iconPropType,
51
- default: () => Star
52
- },
53
- disabledVoidIcon: {
54
- type: iconPropType,
55
- default: () => StarFilled
56
- },
57
- disabled: Boolean,
58
- allowHalf: Boolean,
59
- showText: Boolean,
60
- showScore: Boolean,
61
- textColor: {
62
- type: String,
63
- default: ""
64
- },
65
- texts: {
66
- type: definePropType(Array),
67
- default: () => mutable([
68
- "Extremely bad",
69
- "Disappointed",
70
- "Fair",
71
- "Satisfied",
72
- "Surprise"
73
- ])
74
- },
75
- scoreTemplate: {
76
- type: String,
77
- default: "{value}"
78
- },
79
- size: useSizeProp,
80
- label: {
81
- type: String,
82
- default: void 0
83
- },
84
- clearable: {
85
- type: Boolean,
86
- default: false
20
+ const _hoisted_1 = ["id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax"];
21
+ const _hoisted_2 = ["onMousemove", "onClick"];
22
+ const __default__ = defineComponent({
23
+ name: "ElRate"
24
+ });
25
+ const _sfc_main = /* @__PURE__ */ defineComponent({
26
+ ...__default__,
27
+ props: rateProps,
28
+ emits: rateEmits,
29
+ setup(__props, { expose, emit }) {
30
+ const props = __props;
31
+ function getValueFromMap(value, map) {
32
+ const isExcludedObject = (val) => isObject(val);
33
+ const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
34
+ const val = map[key];
35
+ const excluded = isExcludedObject(val) ? val.excluded : false;
36
+ return excluded ? value < key : value <= key;
37
+ }).sort((a, b) => a - b);
38
+ const matchedValue = map[matchedKeys[0]];
39
+ return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
40
+ }
41
+ const formContext = inject(formContextKey, void 0);
42
+ const formItemContext = inject(formItemContextKey, void 0);
43
+ const rateSize = useFormSize();
44
+ const ns = useNamespace("rate");
45
+ const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
46
+ formItemContext
47
+ });
48
+ const currentValue = ref(props.modelValue);
49
+ const hoverIndex = ref(-1);
50
+ const pointerAtLeftHalf = ref(true);
51
+ const rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)]);
52
+ const rateDisabled = computed(() => props.disabled || (formContext == null ? void 0 : formContext.disabled));
53
+ const rateStyles = computed(() => {
54
+ return ns.cssVarBlock({
55
+ "void-color": props.voidColor,
56
+ "disabled-void-color": props.disabledVoidColor,
57
+ "fill-color": activeColor.value
58
+ });
59
+ });
60
+ const text = computed(() => {
61
+ let result = "";
62
+ if (props.showScore) {
63
+ result = props.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`);
64
+ } else if (props.showText) {
65
+ result = props.texts[Math.ceil(currentValue.value) - 1];
66
+ }
67
+ return result;
68
+ });
69
+ const valueDecimal = computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
70
+ const colorMap = computed(() => isArray(props.colors) ? {
71
+ [props.lowThreshold]: props.colors[0],
72
+ [props.highThreshold]: { value: props.colors[1], excluded: true },
73
+ [props.max]: props.colors[2]
74
+ } : props.colors);
75
+ const activeColor = computed(() => {
76
+ const color = getValueFromMap(currentValue.value, colorMap.value);
77
+ return isObject(color) ? "" : color;
78
+ });
79
+ const decimalStyle = computed(() => {
80
+ let width = "";
81
+ if (rateDisabled.value) {
82
+ width = `${valueDecimal.value}%`;
83
+ } else if (props.allowHalf) {
84
+ width = "50%";
85
+ }
86
+ return {
87
+ color: activeColor.value,
88
+ width
89
+ };
90
+ });
91
+ const componentMap = computed(() => {
92
+ let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons };
93
+ icons = markRaw(icons);
94
+ return isArray(icons) ? {
95
+ [props.lowThreshold]: icons[0],
96
+ [props.highThreshold]: {
97
+ value: icons[1],
98
+ excluded: true
99
+ },
100
+ [props.max]: icons[2]
101
+ } : icons;
102
+ });
103
+ const decimalIconComponent = computed(() => getValueFromMap(props.modelValue, componentMap.value));
104
+ const voidComponent = computed(() => rateDisabled.value ? isString(props.disabledVoidIcon) ? props.disabledVoidIcon : markRaw(props.disabledVoidIcon) : isString(props.voidIcon) ? props.voidIcon : markRaw(props.voidIcon));
105
+ const activeComponent = computed(() => getValueFromMap(currentValue.value, componentMap.value));
106
+ function showDecimalIcon(item) {
107
+ const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
108
+ const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
109
+ return showWhenDisabled || showWhenAllowHalf;
110
+ }
111
+ function emitValue(value) {
112
+ if (props.clearable && value === props.modelValue) {
113
+ value = 0;
114
+ }
115
+ emit(UPDATE_MODEL_EVENT, value);
116
+ if (props.modelValue !== value) {
117
+ emit("change", value);
118
+ }
119
+ }
120
+ function selectValue(value) {
121
+ if (rateDisabled.value) {
122
+ return;
123
+ }
124
+ if (props.allowHalf && pointerAtLeftHalf.value) {
125
+ emitValue(currentValue.value);
126
+ } else {
127
+ emitValue(value);
128
+ }
129
+ }
130
+ function handleKey(e) {
131
+ if (rateDisabled.value) {
132
+ return;
133
+ }
134
+ let _currentValue = currentValue.value;
135
+ const code = e.code;
136
+ if (code === EVENT_CODE.up || code === EVENT_CODE.right) {
137
+ if (props.allowHalf) {
138
+ _currentValue += 0.5;
139
+ } else {
140
+ _currentValue += 1;
141
+ }
142
+ e.stopPropagation();
143
+ e.preventDefault();
144
+ } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {
145
+ if (props.allowHalf) {
146
+ _currentValue -= 0.5;
147
+ } else {
148
+ _currentValue -= 1;
149
+ }
150
+ e.stopPropagation();
151
+ e.preventDefault();
152
+ }
153
+ _currentValue = _currentValue < 0 ? 0 : _currentValue;
154
+ _currentValue = _currentValue > props.max ? props.max : _currentValue;
155
+ emit(UPDATE_MODEL_EVENT, _currentValue);
156
+ emit("change", _currentValue);
157
+ return _currentValue;
158
+ }
159
+ function setCurrentValue(value, event) {
160
+ if (rateDisabled.value) {
161
+ return;
162
+ }
163
+ if (props.allowHalf && event) {
164
+ let target = event.target;
165
+ if (hasClass(target, ns.e("item"))) {
166
+ target = target.querySelector(`.${ns.e("icon")}`);
167
+ }
168
+ if (target.clientWidth === 0 || hasClass(target, ns.e("decimal"))) {
169
+ target = target.parentNode;
170
+ }
171
+ pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
172
+ currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value;
173
+ } else {
174
+ currentValue.value = value;
175
+ }
176
+ hoverIndex.value = value;
177
+ }
178
+ function resetCurrentValue() {
179
+ if (rateDisabled.value) {
180
+ return;
181
+ }
182
+ if (props.allowHalf) {
183
+ pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
184
+ }
185
+ currentValue.value = props.modelValue;
186
+ hoverIndex.value = -1;
187
+ }
188
+ watch(() => props.modelValue, (val) => {
189
+ currentValue.value = val;
190
+ pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
191
+ });
192
+ if (!props.modelValue) {
193
+ emit(UPDATE_MODEL_EVENT, 0);
194
+ }
195
+ expose({
196
+ setCurrentValue,
197
+ resetCurrentValue
198
+ });
199
+ return (_ctx, _cache) => {
200
+ var _a;
201
+ return openBlock(), createElementBlock("div", {
202
+ id: unref(inputId),
203
+ class: normalizeClass([unref(rateClasses), unref(ns).is("disabled", unref(rateDisabled))]),
204
+ role: "slider",
205
+ "aria-label": !unref(isLabeledByFormItem) ? _ctx.label || "rating" : void 0,
206
+ "aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItemContext)) == null ? void 0 : _a.labelId : void 0,
207
+ "aria-valuenow": currentValue.value,
208
+ "aria-valuetext": unref(text) || void 0,
209
+ "aria-valuemin": "0",
210
+ "aria-valuemax": _ctx.max,
211
+ tabindex: "0",
212
+ style: normalizeStyle(unref(rateStyles)),
213
+ onKeydown: handleKey
214
+ }, [
215
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.max, (item, key) => {
216
+ return openBlock(), createElementBlock("span", {
217
+ key,
218
+ class: normalizeClass(unref(ns).e("item")),
219
+ onMousemove: ($event) => setCurrentValue(item, $event),
220
+ onMouseleave: resetCurrentValue,
221
+ onClick: ($event) => selectValue(item)
222
+ }, [
223
+ createVNode(unref(ElIcon), {
224
+ class: normalizeClass([
225
+ unref(ns).e("icon"),
226
+ { hover: hoverIndex.value === item },
227
+ unref(ns).is("active", item <= currentValue.value)
228
+ ])
229
+ }, {
230
+ default: withCtx(() => [
231
+ !showDecimalIcon(item) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
232
+ withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(activeComponent)), null, null, 512)), [
233
+ [vShow, item <= currentValue.value]
234
+ ]),
235
+ withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(voidComponent)), null, null, 512)), [
236
+ [vShow, !(item <= currentValue.value)]
237
+ ])
238
+ ], 64)) : createCommentVNode("v-if", true),
239
+ showDecimalIcon(item) ? (openBlock(), createBlock(unref(ElIcon), {
240
+ key: 1,
241
+ style: normalizeStyle(unref(decimalStyle)),
242
+ class: normalizeClass([unref(ns).e("icon"), unref(ns).e("decimal")])
243
+ }, {
244
+ default: withCtx(() => [
245
+ (openBlock(), createBlock(resolveDynamicComponent(unref(decimalIconComponent))))
246
+ ]),
247
+ _: 1
248
+ }, 8, ["style", "class"])) : createCommentVNode("v-if", true)
249
+ ]),
250
+ _: 2
251
+ }, 1032, ["class"])
252
+ ], 42, _hoisted_2);
253
+ }), 128)),
254
+ _ctx.showText || _ctx.showScore ? (openBlock(), createElementBlock("span", {
255
+ key: 0,
256
+ class: normalizeClass(unref(ns).e("text"))
257
+ }, toDisplayString(unref(text)), 3)) : createCommentVNode("v-if", true)
258
+ ], 46, _hoisted_1);
259
+ };
87
260
  }
88
261
  });
89
- const rateEmits = {
90
- [CHANGE_EVENT]: (value) => isNumber(value),
91
- [UPDATE_MODEL_EVENT]: (value) => isNumber(value)
92
- };
262
+ var Rate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/rate/src/rate.vue"]]);
93
263
 
94
- export { rateEmits, rateProps };
264
+ export { Rate as default };
95
265
  //# sourceMappingURL=rate2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rate2.mjs","sources":["../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons-vue'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isNumber,\n mutable,\n} from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport type { Component, ExtractPropTypes } from 'vue'\nimport type Rate from './rate.vue'\n\nexport const rateProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: Number,\n default: 0,\n },\n /**\n * @description native `id` attribute\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description threshold value between low and medium level. The value itself will be included in low level\n */\n lowThreshold: {\n type: Number,\n default: 2,\n },\n /**\n * @description threshold value between medium and high level. The value itself will be included in high level\n */\n highThreshold: {\n type: Number,\n default: 4,\n },\n /**\n * @description max rating score\n */\n max: {\n type: Number,\n default: 5,\n },\n /**\n * @description colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color\n */\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['', '', ''] as const),\n },\n /**\n * @description color of unselected icons\n */\n voidColor: {\n type: String,\n default: '',\n },\n /**\n * @description color of unselected read-only icons\n */\n disabledVoidColor: {\n type: String,\n default: '',\n },\n /**\n * @description icon components. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon component\n */\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n /**\n * @description component of unselected icons\n */\n voidIcon: {\n type: iconPropType,\n default: () => Star,\n },\n /**\n * @description component of unselected read-only icons\n */\n disabledVoidIcon: {\n type: iconPropType,\n default: () => StarFilled,\n },\n /**\n * @description whether Rate is read-only\n */\n disabled: Boolean,\n /**\n * @description whether picking half start is allowed\n */\n allowHalf: Boolean,\n /**\n * @description whether to display texts\n */\n showText: Boolean,\n /**\n * @description whether to display current score. show-score and show-text cannot be true at the same time\n */\n showScore: Boolean,\n /**\n * @description color of texts\n */\n textColor: {\n type: String,\n default: '',\n },\n /**\n * @description text array\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 /**\n * @description score template\n */\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n /**\n * @description size of Rate\n */\n size: useSizeProp,\n /**\n * @description same as `aria-label` in Rate\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description whether value can be reset to `0`\n */\n clearable: {\n type: Boolean,\n default: false,\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n [CHANGE_EVENT]: (value: number) => isNumber(value),\n [UPDATE_MODEL_EVENT]: (value: number) => isNumber(value),\n}\nexport type RateEmits = typeof rateEmits\n\nexport type RateInstance = InstanceType<typeof Rate>\n"],"names":[],"mappings":";;;;;;;;;;;AAUY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAA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AE,SAAS,EAAE,OAAO;AACpB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,OAAO,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,WAAW;AACnB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC5C,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD;;;;"}
1
+ {"version":3,"file":"rate2.mjs","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :id=\"inputId\"\n :class=\"[rateClasses, ns.is('disabled', rateDisabled)]\"\n role=\"slider\"\n :aria-label=\"!isLabeledByFormItem ? label || 'rating' : undefined\"\n :aria-labelledby=\"\n isLabeledByFormItem ? formItemContext?.labelId : undefined\n \"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text || undefined\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n :style=\"rateStyles\"\n @keydown=\"handleKey\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n @mousemove=\"setCurrentValue(item, $event)\"\n @mouseleave=\"resetCurrentValue\"\n @click=\"selectValue(item)\"\n >\n <el-icon\n :class=\"[\n ns.e('icon'),\n { hover: hoverIndex === item },\n ns.is('active', item <= currentValue),\n ]\"\n >\n <template v-if=\"!showDecimalIcon(item)\">\n <component :is=\"activeComponent\" v-show=\"item <= currentValue\" />\n <component :is=\"voidComponent\" v-show=\"!(item <= currentValue)\" />\n </template>\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 v-if=\"showText || showScore\" :class=\"ns.e('text')\">\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, inject, markRaw, ref } from 'vue'\nimport { watch } from '../../config-provider'\nimport { EVENT_CODE, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { hasClass, isArray, isObject, isString } from '@element-plus/utils'\nimport {\n formContextKey,\n formItemContextKey,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rateEmits, rateProps } from './rate'\nimport type { iconPropType } from '@element-plus/utils'\nimport type { CSSProperties, Component } from 'vue'\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\ndefineOptions({\n name: 'ElRate',\n})\n\nconst props = defineProps(rateProps)\nconst emit = defineEmits(rateEmits)\n\nconst formContext = inject(formContextKey, undefined)\nconst formItemContext = inject(formItemContextKey, undefined)\nconst rateSize = useFormSize()\nconst ns = useNamespace('rate')\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext,\n})\n\nconst currentValue = ref(props.modelValue)\nconst hoverIndex = ref(-1)\nconst pointerAtLeftHalf = ref(true)\n\nconst rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)])\nconst rateDisabled = computed(() => props.disabled || formContext?.disabled)\nconst rateStyles = computed(() => {\n return ns.cssVarBlock({\n 'void-color': props.voidColor,\n 'disabled-void-color': props.disabledVoidColor,\n 'fill-color': activeColor.value,\n }) as CSSProperties\n})\n\nconst 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})\nconst valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n)\nconst 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)\nconst activeColor = computed(() => {\n const color = getValueFromMap(currentValue.value, colorMap.value)\n // {value: '', excluded: true} returned\n return isObject(color) ? '' : color\n})\nconst 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})\nconst componentMap = computed(() => {\n let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons }\n icons = markRaw(icons) as\n | Array<string | Component>\n | Record<number, string | Component>\n return isArray(icons)\n ? {\n [props.lowThreshold]: icons[0],\n [props.highThreshold]: {\n value: icons[1],\n excluded: true,\n },\n [props.max]: icons[2],\n }\n : icons\n})\nconst decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n)\nconst voidComponent = computed(() =>\n rateDisabled.value\n ? isString(props.disabledVoidIcon)\n ? props.disabledVoidIcon\n : (markRaw(props.disabledVoidIcon) as typeof iconPropType)\n : isString(props.voidIcon)\n ? props.voidIcon\n : (markRaw(props.voidIcon) as typeof iconPropType)\n)\nconst activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n)\n\nfunction 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\nfunction emitValue(value: number) {\n // if allow clear, and selected value is same as modelValue, reset value to 0\n if (props.clearable && value === props.modelValue) {\n value = 0\n }\n\n emit(UPDATE_MODEL_EVENT, value)\n if (props.modelValue !== value) {\n emit('change', value)\n }\n}\n\nfunction selectValue(value: number) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && pointerAtLeftHalf.value) {\n emitValue(currentValue.value)\n } else {\n emitValue(value)\n }\n}\n\nfunction 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\nfunction setCurrentValue(value: number, event?: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf && event) {\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\nfunction resetCurrentValue() {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n currentValue.value = props.modelValue\n hoverIndex.value = -1\n}\n\nwatch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue)\n }\n)\n\nif (!props.modelValue) {\n emit(UPDATE_MODEL_EVENT, 0)\n}\n\ndefineExpose({\n /** @description set current value */\n setCurrentValue,\n /** @description reset current value */\n resetCurrentValue,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;mCAuFc,CAAA;AAAA,EACZ,IAAM,EAAA,QAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAtBA,IAAA,SAAA,eAAA,CACE,OACA,GACA,EAAA;AACA,MAAA,MAAM,gBAAmB,GAAA,CACvB,GACyD,KAAA,QAAA,CAAS,GAAG,CAAA,CAAA;AAEvE,MAAA,MAAM,WAAc,GAAA,MAAA,CAAO,IAAK,CAAA,GAAG,CAChC,CAAA,GAAA,CAAI,CAAC,GAAA,KAAQ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
  readonly title: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
3
3
  readonly subTitle: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
4
- readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
4
+ readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
5
5
  }, {
6
6
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
7
7
  readonly title: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
8
8
  readonly subTitle: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
9
- readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
9
+ readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
10
10
  }>> & {
11
11
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
12
12
  }>>;
@@ -35,10 +35,10 @@ export declare const ElResult: import("element-pe/es/utils").SFCWithInstall<impo
35
35
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
36
  readonly title: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
37
37
  readonly subTitle: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
38
- readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
38
+ readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
39
39
  }>>, {
40
40
  readonly title: string;
41
- readonly icon: import("element-pe/es/utils").EpPropMergeType<StringConstructor, "error" | "success" | "warning" | "info", unknown>;
41
+ readonly icon: import("element-pe/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown>;
42
42
  readonly subTitle: string;
43
43
  }>> & Record<string, any>;
44
44
  export default ElResult;
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Result from './src/result.mjs';
3
- export { IconComponentMap, IconMap, resultProps } from './src/result2.mjs';
2
+ import Result from './src/result2.mjs';
3
+ export { IconComponentMap, IconMap, resultProps } from './src/result.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElResult = withInstall(Result);
@@ -10,7 +10,7 @@ export declare const IconComponentMap: Record<typeof IconMap[keyof typeof IconMa
10
10
  export declare const resultProps: {
11
11
  readonly title: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
12
12
  readonly subTitle: import("element-pe/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
13
- readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
13
+ readonly icon: import("element-pe/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
14
14
  };
15
15
  export declare type ResultProps = ExtractPropTypes<typeof resultProps>;
16
16
  export declare type ResultInstance = InstanceType<typeof Result>;
@@ -1,68 +1,34 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';
2
- import '../../../hooks/index.mjs';
3
- import { resultProps, IconMap, IconComponentMap } from './result2.mjs';
4
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
5
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
1
+ import '../../../utils/index.mjs';
2
+ import { CircleCheckFilled, WarningFilled, CircleCloseFilled, InfoFilled } from '@element-plus/icons-vue';
3
+ import { buildProps } from '../../../utils/vue/props/runtime.mjs';
6
4
 
7
- const __default__ = defineComponent({
8
- name: "ElResult"
9
- });
10
- const _sfc_main = /* @__PURE__ */ defineComponent({
11
- ...__default__,
12
- props: resultProps,
13
- setup(__props) {
14
- const props = __props;
15
- const ns = useNamespace("result");
16
- const resultIcon = computed(() => {
17
- const icon = props.icon;
18
- const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
19
- const iconComponent = IconComponentMap[iconClass] || IconComponentMap["icon-info"];
20
- return {
21
- class: iconClass,
22
- component: iconComponent
23
- };
24
- });
25
- return (_ctx, _cache) => {
26
- return openBlock(), createElementBlock("div", {
27
- class: normalizeClass(unref(ns).b())
28
- }, [
29
- createElementVNode("div", {
30
- class: normalizeClass(unref(ns).e("icon"))
31
- }, [
32
- renderSlot(_ctx.$slots, "icon", {}, () => [
33
- unref(resultIcon).component ? (openBlock(), createBlock(resolveDynamicComponent(unref(resultIcon).component), {
34
- key: 0,
35
- class: normalizeClass(unref(resultIcon).class)
36
- }, null, 8, ["class"])) : createCommentVNode("v-if", true)
37
- ])
38
- ], 2),
39
- _ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
40
- key: 0,
41
- class: normalizeClass(unref(ns).e("title"))
42
- }, [
43
- renderSlot(_ctx.$slots, "title", {}, () => [
44
- createElementVNode("p", null, toDisplayString(_ctx.title), 1)
45
- ])
46
- ], 2)) : createCommentVNode("v-if", true),
47
- _ctx.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", {
48
- key: 1,
49
- class: normalizeClass(unref(ns).e("subtitle"))
50
- }, [
51
- renderSlot(_ctx.$slots, "sub-title", {}, () => [
52
- createElementVNode("p", null, toDisplayString(_ctx.subTitle), 1)
53
- ])
54
- ], 2)) : createCommentVNode("v-if", true),
55
- _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
56
- key: 2,
57
- class: normalizeClass(unref(ns).e("extra"))
58
- }, [
59
- renderSlot(_ctx.$slots, "extra")
60
- ], 2)) : createCommentVNode("v-if", true)
61
- ], 2);
62
- };
5
+ const IconMap = {
6
+ success: "icon-success",
7
+ warning: "icon-warning",
8
+ error: "icon-error",
9
+ info: "icon-info"
10
+ };
11
+ const IconComponentMap = {
12
+ [IconMap.success]: CircleCheckFilled,
13
+ [IconMap.warning]: WarningFilled,
14
+ [IconMap.error]: CircleCloseFilled,
15
+ [IconMap.info]: InfoFilled
16
+ };
17
+ const resultProps = buildProps({
18
+ title: {
19
+ type: String,
20
+ default: ""
21
+ },
22
+ subTitle: {
23
+ type: String,
24
+ default: ""
25
+ },
26
+ icon: {
27
+ type: String,
28
+ values: ["success", "warning", "info", "error"],
29
+ default: "info"
63
30
  }
64
31
  });
65
- var Result = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/result/src/result.vue"]]);
66
32
 
67
- export { Result as default };
33
+ export { IconComponentMap, IconMap, resultProps };
68
34
  //# sourceMappingURL=result.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"result.mjs","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['sub-title']\" :class=\"ns.e('subtitle')\">\n <slot name=\"sub-title\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\" />\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { IconComponentMap, IconMap, resultProps } from './result'\n\ndefineOptions({\n name: 'ElResult',\n})\n\nconst props = defineProps(resultProps)\n\nconst ns = useNamespace('result')\n\nconst 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</script>\n"],"names":[],"mappings":";;;;;;mCA+Bc,CAAA;AAAA,EACZ,IAAM,EAAA,UAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAM,MAAA,UAAA,GAAa,SAAS,MAAM;AAChC,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAA,MAAM,SAAY,GAAA,IAAA,IAAQ,OAAQ,CAAA,IAAA,CAAA,GAAQ,QAAQ,IAAQ,CAAA,GAAA,WAAA,CAAA;AAC1D,MAAM,MAAA,aAAA,GACJ,gBAAiB,CAAA,SAAA,CAAA,IAAc,gBAAiB,CAAA,WAAA,CAAA,CAAA;AAElD,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,QACP,SAAW,EAAA,aAAA;AAAA,OACb,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"result.mjs","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport {\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n WarningFilled,\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 type: String,\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":[],"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,GAAG,iBAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,aAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,iBAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,UAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAG,UAAU,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,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AACnD,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}
@@ -1,12 +1,12 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  readonly title: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
3
3
  readonly subTitle: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
4
- readonly icon: import("../../../utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
4
+ readonly icon: import("../../../utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
5
5
  }, {
6
6
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
7
7
  readonly title: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
8
8
  readonly subTitle: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
9
- readonly icon: import("../../../utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
9
+ readonly icon: import("../../../utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
10
10
  }>> & {
11
11
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
12
12
  }>>;
@@ -35,10 +35,10 @@ declare const _default: import("vue").DefineComponent<{
35
35
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
36
  readonly title: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
37
37
  readonly subTitle: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
38
- readonly icon: import("../../../utils").EpPropFinalized<StringConstructor, "error" | "success" | "warning" | "info", unknown, "info", boolean>;
38
+ readonly icon: import("../../../utils").EpPropFinalized<StringConstructor, "success" | "warning" | "error" | "info", unknown, "info", boolean>;
39
39
  }>>, {
40
40
  readonly title: string;
41
- readonly icon: import("../../../utils").EpPropMergeType<StringConstructor, "error" | "success" | "warning" | "info", unknown>;
41
+ readonly icon: import("../../../utils").EpPropMergeType<StringConstructor, "success" | "warning" | "error" | "info", unknown>;
42
42
  readonly subTitle: string;
43
43
  }>;
44
44
  export default _default;