element-pe 2.2.57 → 2.2.58

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 (410) hide show
  1. package/dist/index.full.js +9 -5
  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 +1 -1
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +9 -5
  7. package/es/components/alert/index.mjs +2 -2
  8. package/es/components/alert/src/alert.mjs +38 -103
  9. package/es/components/alert/src/alert.mjs.map +1 -1
  10. package/es/components/alert/src/alert2.mjs +103 -38
  11. package/es/components/alert/src/alert2.mjs.map +1 -1
  12. package/es/components/avatar/index.mjs +2 -2
  13. package/es/components/avatar/src/avatar.mjs +35 -76
  14. package/es/components/avatar/src/avatar.mjs.map +1 -1
  15. package/es/components/avatar/src/avatar2.mjs +76 -35
  16. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  17. package/es/components/badge/index.mjs +2 -2
  18. package/es/components/badge/src/badge.mjs +59 -17
  19. package/es/components/badge/src/badge.mjs.map +1 -1
  20. package/es/components/badge/src/badge2.mjs +17 -59
  21. package/es/components/badge/src/badge2.mjs.map +1 -1
  22. package/es/components/breadcrumb/index.mjs +4 -4
  23. package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
  24. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  25. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
  26. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  27. package/es/components/breadcrumb/src/breadcrumb.mjs +11 -36
  28. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  29. package/es/components/breadcrumb/src/breadcrumb2.mjs +36 -11
  30. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  31. package/es/components/calendar/src/calendar2.mjs +1 -1
  32. package/es/components/calendar/src/date-table.mjs +87 -33
  33. package/es/components/calendar/src/date-table.mjs.map +1 -1
  34. package/es/components/calendar/src/date-table2.mjs +33 -87
  35. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  36. package/es/components/calendar/src/use-date-table.mjs +1 -1
  37. package/es/components/carousel/index.mjs +2 -2
  38. package/es/components/carousel/src/carousel.mjs +56 -169
  39. package/es/components/carousel/src/carousel.mjs.map +1 -1
  40. package/es/components/carousel/src/carousel2.mjs +169 -56
  41. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  42. package/es/components/cascader/index.mjs +2 -2
  43. package/es/components/cascader/src/cascader.mjs +622 -63
  44. package/es/components/cascader/src/cascader.mjs.map +1 -1
  45. package/es/components/cascader/src/cascader2.mjs +63 -622
  46. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  47. package/es/components/checkbox/index.mjs +2 -2
  48. package/es/components/checkbox/src/checkbox-button.mjs +1 -1
  49. package/es/components/checkbox/src/checkbox.mjs +49 -117
  50. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  51. package/es/components/checkbox/src/checkbox2.mjs +117 -49
  52. package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
  53. package/es/components/col/index.mjs +2 -2
  54. package/es/components/col/src/col.mjs +66 -43
  55. package/es/components/col/src/col.mjs.map +1 -1
  56. package/es/components/col/src/col2.mjs +43 -66
  57. package/es/components/col/src/col2.mjs.map +1 -1
  58. package/es/components/collection/src/collection.mjs +9 -5
  59. package/es/components/collection/src/collection.mjs.map +1 -1
  60. package/es/components/descriptions/src/description.mjs +1 -1
  61. package/es/components/descriptions/src/descriptions-row.mjs +64 -7
  62. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  63. package/es/components/descriptions/src/descriptions-row2.mjs +7 -64
  64. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  65. package/es/components/dialog/index.mjs +2 -2
  66. package/es/components/dialog/src/dialog.mjs +174 -73
  67. package/es/components/dialog/src/dialog.mjs.map +1 -1
  68. package/es/components/dialog/src/dialog2.mjs +73 -174
  69. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  70. package/es/components/divider/index.mjs +2 -2
  71. package/es/components/divider/src/divider.mjs +17 -35
  72. package/es/components/divider/src/divider.mjs.map +1 -1
  73. package/es/components/divider/src/divider2.mjs +35 -17
  74. package/es/components/divider/src/divider2.mjs.map +1 -1
  75. package/es/components/drawer/index.mjs +2 -2
  76. package/es/components/drawer/src/drawer.mjs +25 -186
  77. package/es/components/drawer/src/drawer.mjs.map +1 -1
  78. package/es/components/drawer/src/drawer2.mjs +186 -25
  79. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  80. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  81. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  82. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  83. package/es/components/form/index.mjs +2 -2
  84. package/es/components/form/src/form.mjs +57 -150
  85. package/es/components/form/src/form.mjs.map +1 -1
  86. package/es/components/form/src/form2.mjs +150 -57
  87. package/es/components/form/src/form2.mjs.map +1 -1
  88. package/es/components/image-viewer/index.mjs +2 -2
  89. package/es/components/image-viewer/src/image-viewer.mjs +38 -401
  90. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  91. package/es/components/image-viewer/src/image-viewer2.mjs +401 -38
  92. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  93. package/es/components/index.mjs +31 -31
  94. package/es/components/input/index.mjs +2 -2
  95. package/es/components/input/src/input.mjs +458 -108
  96. package/es/components/input/src/input.mjs.map +1 -1
  97. package/es/components/input/src/input2.mjs +108 -458
  98. package/es/components/input/src/input2.mjs.map +1 -1
  99. package/es/components/input-number/index.mjs +2 -2
  100. package/es/components/input-number/src/input-number.mjs +58 -318
  101. package/es/components/input-number/src/input-number.mjs.map +1 -1
  102. package/es/components/input-number/src/input-number2.mjs +318 -58
  103. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  104. package/es/components/link/index.mjs +2 -2
  105. package/es/components/link/src/link.mjs +21 -50
  106. package/es/components/link/src/link.mjs.map +1 -1
  107. package/es/components/link/src/link2.mjs +50 -21
  108. package/es/components/link/src/link2.mjs.map +1 -1
  109. package/es/components/pagination/src/components/sizes.mjs +70 -22
  110. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  111. package/es/components/pagination/src/components/sizes2.mjs +22 -70
  112. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  113. package/es/components/pagination/src/pagination.mjs +1 -1
  114. package/es/components/popconfirm/index.mjs +2 -2
  115. package/es/components/popconfirm/src/popconfirm.mjs +110 -47
  116. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  117. package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
  118. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  119. package/es/components/popper/index.mjs +2 -2
  120. package/es/components/popper/src/arrow.mjs +39 -8
  121. package/es/components/popper/src/arrow.mjs.map +1 -1
  122. package/es/components/popper/src/arrow2.mjs +8 -39
  123. package/es/components/popper/src/arrow2.mjs.map +1 -1
  124. package/es/components/radio/index.mjs +2 -2
  125. package/es/components/radio/src/radio-button.mjs +1 -1
  126. package/es/components/radio/src/radio-group.mjs +1 -1
  127. package/es/components/radio/src/radio.mjs +30 -71
  128. package/es/components/radio/src/radio.mjs.map +1 -1
  129. package/es/components/radio/src/radio2.mjs +71 -30
  130. package/es/components/radio/src/radio2.mjs.map +1 -1
  131. package/es/components/rate/index.mjs +2 -2
  132. package/es/components/rate/src/rate.mjs +87 -257
  133. package/es/components/rate/src/rate.mjs.map +1 -1
  134. package/es/components/rate/src/rate2.mjs +257 -87
  135. package/es/components/rate/src/rate2.mjs.map +1 -1
  136. package/es/components/result/index.mjs +2 -2
  137. package/es/components/result/src/result.mjs +63 -29
  138. package/es/components/result/src/result.mjs.map +1 -1
  139. package/es/components/result/src/result2.mjs +29 -63
  140. package/es/components/result/src/result2.mjs.map +1 -1
  141. package/es/components/roving-focus-group/index.mjs +3 -3
  142. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  143. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
  144. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  145. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
  146. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  147. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  148. package/es/components/skeleton/index.mjs +2 -2
  149. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  150. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  151. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  152. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  153. package/es/components/skeleton/src/skeleton2.mjs +1 -1
  154. package/es/components/slider/index.mjs +2 -2
  155. package/es/components/slider/src/button.mjs +93 -21
  156. package/es/components/slider/src/button.mjs.map +1 -1
  157. package/es/components/slider/src/button2.mjs +21 -93
  158. package/es/components/slider/src/button2.mjs.map +1 -1
  159. package/es/components/slider/src/slider.mjs +91 -233
  160. package/es/components/slider/src/slider.mjs.map +1 -1
  161. package/es/components/slider/src/slider2.mjs +233 -91
  162. package/es/components/slider/src/slider2.mjs.map +1 -1
  163. package/es/components/steps/index.mjs +2 -2
  164. package/es/components/steps/src/item.mjs +19 -193
  165. package/es/components/steps/src/item.mjs.map +1 -1
  166. package/es/components/steps/src/item2.mjs +193 -19
  167. package/es/components/steps/src/item2.mjs.map +1 -1
  168. package/es/components/switch/index.mjs +2 -2
  169. package/es/components/switch/src/switch.mjs +243 -88
  170. package/es/components/switch/src/switch.mjs.map +1 -1
  171. package/es/components/switch/src/switch2.mjs +88 -243
  172. package/es/components/switch/src/switch2.mjs.map +1 -1
  173. package/es/components/tabs/index.mjs +3 -3
  174. package/es/components/tabs/src/tab-bar.mjs +7 -75
  175. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  176. package/es/components/tabs/src/tab-bar2.mjs +75 -7
  177. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  178. package/es/components/tabs/src/tab-nav.mjs +1 -1
  179. package/es/components/tabs/src/tab-pane.mjs +73 -14
  180. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  181. package/es/components/tabs/src/tab-pane2.mjs +14 -73
  182. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  183. package/es/components/text/index.mjs +2 -2
  184. package/es/components/text/src/text.mjs +35 -22
  185. package/es/components/text/src/text.mjs.map +1 -1
  186. package/es/components/text/src/text2.mjs +22 -35
  187. package/es/components/text/src/text2.mjs.map +1 -1
  188. package/es/components/tooltip/src/tooltip.mjs +1 -1
  189. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  190. package/es/components/tooltip-v2/index.mjs +2 -2
  191. package/es/components/tooltip-v2/src/content2.mjs +1 -1
  192. package/es/components/tooltip-v2/src/tooltip.mjs +20 -77
  193. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  194. package/es/components/tooltip-v2/src/tooltip2.mjs +77 -20
  195. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  196. package/es/components/upload/index.mjs +1 -1
  197. package/es/components/upload/src/upload-content.mjs +33 -182
  198. package/es/components/upload/src/upload-content.mjs.map +1 -1
  199. package/es/components/upload/src/upload-content2.mjs +182 -33
  200. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  201. package/es/components/upload/src/upload2.mjs +1 -1
  202. package/es/components/visual-hidden/index.mjs +3 -3
  203. package/es/components/visual-hidden/src/visual-hidden.mjs +35 -7
  204. package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
  205. package/es/components/visual-hidden/src/visual-hidden2.mjs +7 -35
  206. package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
  207. package/es/index.mjs +31 -31
  208. package/lib/components/alert/index.js +2 -2
  209. package/lib/components/alert/src/alert.js +39 -102
  210. package/lib/components/alert/src/alert.js.map +1 -1
  211. package/lib/components/alert/src/alert2.js +102 -39
  212. package/lib/components/alert/src/alert2.js.map +1 -1
  213. package/lib/components/avatar/index.js +2 -2
  214. package/lib/components/avatar/src/avatar.js +35 -75
  215. package/lib/components/avatar/src/avatar.js.map +1 -1
  216. package/lib/components/avatar/src/avatar2.js +75 -35
  217. package/lib/components/avatar/src/avatar2.js.map +1 -1
  218. package/lib/components/badge/index.js +2 -2
  219. package/lib/components/badge/src/badge.js +59 -17
  220. package/lib/components/badge/src/badge.js.map +1 -1
  221. package/lib/components/badge/src/badge2.js +17 -59
  222. package/lib/components/badge/src/badge2.js.map +1 -1
  223. package/lib/components/breadcrumb/index.js +4 -4
  224. package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
  225. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  226. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
  227. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  228. package/lib/components/breadcrumb/src/breadcrumb.js +11 -36
  229. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  230. package/lib/components/breadcrumb/src/breadcrumb2.js +36 -11
  231. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  232. package/lib/components/calendar/src/calendar2.js +1 -1
  233. package/lib/components/calendar/src/date-table.js +87 -37
  234. package/lib/components/calendar/src/date-table.js.map +1 -1
  235. package/lib/components/calendar/src/date-table2.js +37 -87
  236. package/lib/components/calendar/src/date-table2.js.map +1 -1
  237. package/lib/components/calendar/src/use-date-table.js +1 -1
  238. package/lib/components/carousel/index.js +2 -2
  239. package/lib/components/carousel/src/carousel.js +57 -169
  240. package/lib/components/carousel/src/carousel.js.map +1 -1
  241. package/lib/components/carousel/src/carousel2.js +169 -57
  242. package/lib/components/carousel/src/carousel2.js.map +1 -1
  243. package/lib/components/cascader/index.js +2 -2
  244. package/lib/components/cascader/src/cascader.js +622 -64
  245. package/lib/components/cascader/src/cascader.js.map +1 -1
  246. package/lib/components/cascader/src/cascader2.js +64 -622
  247. package/lib/components/cascader/src/cascader2.js.map +1 -1
  248. package/lib/components/checkbox/index.js +2 -2
  249. package/lib/components/checkbox/src/checkbox-button.js +1 -1
  250. package/lib/components/checkbox/src/checkbox.js +50 -117
  251. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  252. package/lib/components/checkbox/src/checkbox2.js +117 -50
  253. package/lib/components/checkbox/src/checkbox2.js.map +1 -1
  254. package/lib/components/col/index.js +2 -2
  255. package/lib/components/col/src/col.js +66 -43
  256. package/lib/components/col/src/col.js.map +1 -1
  257. package/lib/components/col/src/col2.js +43 -66
  258. package/lib/components/col/src/col2.js.map +1 -1
  259. package/lib/components/collection/src/collection.js +9 -5
  260. package/lib/components/collection/src/collection.js.map +1 -1
  261. package/lib/components/descriptions/src/description.js +1 -1
  262. package/lib/components/descriptions/src/descriptions-row.js +64 -7
  263. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  264. package/lib/components/descriptions/src/descriptions-row2.js +7 -64
  265. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  266. package/lib/components/dialog/index.js +2 -2
  267. package/lib/components/dialog/src/dialog.js +174 -74
  268. package/lib/components/dialog/src/dialog.js.map +1 -1
  269. package/lib/components/dialog/src/dialog2.js +74 -174
  270. package/lib/components/dialog/src/dialog2.js.map +1 -1
  271. package/lib/components/divider/index.js +2 -2
  272. package/lib/components/divider/src/divider.js +17 -35
  273. package/lib/components/divider/src/divider.js.map +1 -1
  274. package/lib/components/divider/src/divider2.js +35 -17
  275. package/lib/components/divider/src/divider2.js.map +1 -1
  276. package/lib/components/drawer/index.js +2 -2
  277. package/lib/components/drawer/src/drawer.js +26 -186
  278. package/lib/components/drawer/src/drawer.js.map +1 -1
  279. package/lib/components/drawer/src/drawer2.js +186 -26
  280. package/lib/components/drawer/src/drawer2.js.map +1 -1
  281. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  282. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  283. package/lib/components/dropdown/src/dropdown2.js +1 -1
  284. package/lib/components/form/index.js +2 -2
  285. package/lib/components/form/src/form.js +57 -149
  286. package/lib/components/form/src/form.js.map +1 -1
  287. package/lib/components/form/src/form2.js +149 -57
  288. package/lib/components/form/src/form2.js.map +1 -1
  289. package/lib/components/image-viewer/index.js +2 -2
  290. package/lib/components/image-viewer/src/image-viewer.js +39 -401
  291. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  292. package/lib/components/image-viewer/src/image-viewer2.js +401 -39
  293. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  294. package/lib/components/index.js +31 -31
  295. package/lib/components/input/index.js +2 -2
  296. package/lib/components/input/src/input.js +457 -108
  297. package/lib/components/input/src/input.js.map +1 -1
  298. package/lib/components/input/src/input2.js +108 -457
  299. package/lib/components/input/src/input2.js.map +1 -1
  300. package/lib/components/input-number/index.js +2 -2
  301. package/lib/components/input-number/src/input-number.js +57 -316
  302. package/lib/components/input-number/src/input-number.js.map +1 -1
  303. package/lib/components/input-number/src/input-number2.js +316 -57
  304. package/lib/components/input-number/src/input-number2.js.map +1 -1
  305. package/lib/components/link/index.js +2 -2
  306. package/lib/components/link/src/link.js +22 -50
  307. package/lib/components/link/src/link.js.map +1 -1
  308. package/lib/components/link/src/link2.js +50 -22
  309. package/lib/components/link/src/link2.js.map +1 -1
  310. package/lib/components/pagination/src/components/sizes.js +70 -22
  311. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  312. package/lib/components/pagination/src/components/sizes2.js +22 -70
  313. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  314. package/lib/components/pagination/src/pagination.js +1 -1
  315. package/lib/components/popconfirm/index.js +2 -2
  316. package/lib/components/popconfirm/src/popconfirm.js +110 -48
  317. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  318. package/lib/components/popconfirm/src/popconfirm2.js +48 -110
  319. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  320. package/lib/components/popper/index.js +2 -2
  321. package/lib/components/popper/src/arrow.js +39 -9
  322. package/lib/components/popper/src/arrow.js.map +1 -1
  323. package/lib/components/popper/src/arrow2.js +9 -39
  324. package/lib/components/popper/src/arrow2.js.map +1 -1
  325. package/lib/components/radio/index.js +2 -2
  326. package/lib/components/radio/src/radio-button.js +1 -1
  327. package/lib/components/radio/src/radio-group.js +1 -1
  328. package/lib/components/radio/src/radio.js +32 -71
  329. package/lib/components/radio/src/radio.js.map +1 -1
  330. package/lib/components/radio/src/radio2.js +71 -32
  331. package/lib/components/radio/src/radio2.js.map +1 -1
  332. package/lib/components/rate/index.js +2 -2
  333. package/lib/components/rate/src/rate.js +87 -256
  334. package/lib/components/rate/src/rate.js.map +1 -1
  335. package/lib/components/rate/src/rate2.js +256 -87
  336. package/lib/components/rate/src/rate2.js.map +1 -1
  337. package/lib/components/result/index.js +2 -2
  338. package/lib/components/result/src/result.js +63 -31
  339. package/lib/components/result/src/result.js.map +1 -1
  340. package/lib/components/result/src/result2.js +31 -63
  341. package/lib/components/result/src/result2.js.map +1 -1
  342. package/lib/components/roving-focus-group/index.js +2 -2
  343. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  344. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
  345. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  346. package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
  347. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  348. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  349. package/lib/components/skeleton/index.js +2 -2
  350. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  351. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  352. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  353. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  354. package/lib/components/skeleton/src/skeleton2.js +1 -1
  355. package/lib/components/slider/index.js +2 -2
  356. package/lib/components/slider/src/button.js +93 -22
  357. package/lib/components/slider/src/button.js.map +1 -1
  358. package/lib/components/slider/src/button2.js +22 -93
  359. package/lib/components/slider/src/button2.js.map +1 -1
  360. package/lib/components/slider/src/slider.js +92 -233
  361. package/lib/components/slider/src/slider.js.map +1 -1
  362. package/lib/components/slider/src/slider2.js +233 -92
  363. package/lib/components/slider/src/slider2.js.map +1 -1
  364. package/lib/components/steps/index.js +2 -2
  365. package/lib/components/steps/src/item.js +19 -193
  366. package/lib/components/steps/src/item.js.map +1 -1
  367. package/lib/components/steps/src/item2.js +193 -19
  368. package/lib/components/steps/src/item2.js.map +1 -1
  369. package/lib/components/switch/index.js +2 -2
  370. package/lib/components/switch/src/switch.js +242 -88
  371. package/lib/components/switch/src/switch.js.map +1 -1
  372. package/lib/components/switch/src/switch2.js +88 -242
  373. package/lib/components/switch/src/switch2.js.map +1 -1
  374. package/lib/components/tabs/index.js +3 -3
  375. package/lib/components/tabs/src/tab-bar.js +7 -75
  376. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  377. package/lib/components/tabs/src/tab-bar2.js +75 -7
  378. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  379. package/lib/components/tabs/src/tab-nav.js +1 -1
  380. package/lib/components/tabs/src/tab-pane.js +73 -14
  381. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  382. package/lib/components/tabs/src/tab-pane2.js +14 -73
  383. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  384. package/lib/components/text/index.js +2 -2
  385. package/lib/components/text/src/text.js +35 -22
  386. package/lib/components/text/src/text.js.map +1 -1
  387. package/lib/components/text/src/text2.js +22 -35
  388. package/lib/components/text/src/text2.js.map +1 -1
  389. package/lib/components/tooltip/src/tooltip.js +1 -1
  390. package/lib/components/tooltip/src/tooltip2.js +1 -1
  391. package/lib/components/tooltip-v2/index.js +2 -2
  392. package/lib/components/tooltip-v2/src/content2.js +1 -1
  393. package/lib/components/tooltip-v2/src/tooltip.js +20 -77
  394. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  395. package/lib/components/tooltip-v2/src/tooltip2.js +77 -20
  396. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  397. package/lib/components/upload/index.js +1 -1
  398. package/lib/components/upload/src/upload-content.js +31 -180
  399. package/lib/components/upload/src/upload-content.js.map +1 -1
  400. package/lib/components/upload/src/upload-content2.js +180 -31
  401. package/lib/components/upload/src/upload-content2.js.map +1 -1
  402. package/lib/components/upload/src/upload2.js +1 -1
  403. package/lib/components/visual-hidden/index.js +2 -2
  404. package/lib/components/visual-hidden/src/visual-hidden.js +35 -7
  405. package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
  406. package/lib/components/visual-hidden/src/visual-hidden2.js +7 -35
  407. package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
  408. package/lib/index.js +31 -31
  409. package/package.json +1 -1
  410. 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", "D:\\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,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,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,EAAE,cAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACxC,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAA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AE,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,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AAA,KAE9E,CAAA,CAAA;AAEA,IAAI,IAAA,CAAC,MAAM,UAAY,EAAA;AACrB,MAAA,IAAA,CAAK,oBAAoB,CAAC,CAAA,CAAA;AAAA,KAC5B;AAEA,IAAa,MAAA,CAAA;AAAA,MAEX,eAAA;AAAA,MAEA,iBAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Result from './src/result2.mjs';
3
- export { IconComponentMap, IconMap, resultProps } from './src/result.mjs';
2
+ import Result from './src/result.mjs';
3
+ export { IconComponentMap, IconMap, resultProps } from './src/result2.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElResult = withInstall(Result);
@@ -1,34 +1,68 @@
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';
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';
4
6
 
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"
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
+ };
30
63
  }
31
64
  });
65
+ var Result = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\result\\src\\result.vue"]]);
32
66
 
33
- export { IconComponentMap, IconMap, resultProps };
67
+ export { Result as default };
34
68
  //# sourceMappingURL=result.mjs.map
@@ -1 +1 @@
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 /**\n * @description title of result\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description sub title of result\n */\n subTitle: {\n type: String,\n default: '',\n },\n /**\n * @description icon type of result\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
+ {"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,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 './result.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", "D:\\workspace\\element-pe\\packages\\components\\result\\src\\result.vue"]]);
66
32
 
67
- export { Result as default };
33
+ export { IconComponentMap, IconMap, resultProps };
68
34
  //# sourceMappingURL=result2.mjs.map