element-pe 2.0.3 → 2.0.4

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 (490) hide show
  1. package/dist/index.full.js +1 -1
  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 +1 -1
  7. package/es/components/autocomplete/index.d.ts +51 -51
  8. package/es/components/autocomplete/src/autocomplete.vue.d.ts +51 -51
  9. package/es/components/backtop/index.mjs +2 -2
  10. package/es/components/backtop/src/backtop.mjs +100 -21
  11. package/es/components/backtop/src/backtop.mjs.map +1 -1
  12. package/es/components/backtop/src/backtop2.mjs +21 -100
  13. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  14. package/es/components/button/index.mjs +3 -3
  15. package/es/components/button/src/button-group.mjs +30 -5
  16. package/es/components/button/src/button-group.mjs.map +1 -1
  17. package/es/components/button/src/button-group2.mjs +5 -30
  18. package/es/components/button/src/button-group2.mjs.map +1 -1
  19. package/es/components/button/src/button.mjs +106 -51
  20. package/es/components/button/src/button.mjs.map +1 -1
  21. package/es/components/button/src/button2.mjs +51 -106
  22. package/es/components/button/src/button2.mjs.map +1 -1
  23. package/es/components/calendar/index.mjs +2 -2
  24. package/es/components/calendar/src/calendar.mjs +237 -15
  25. package/es/components/calendar/src/calendar.mjs.map +1 -1
  26. package/es/components/calendar/src/calendar2.mjs +15 -237
  27. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  28. package/es/components/calendar/src/date-table.mjs +152 -31
  29. package/es/components/calendar/src/date-table.mjs.map +1 -1
  30. package/es/components/calendar/src/date-table2.mjs +31 -152
  31. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  32. package/es/components/card/index.mjs +2 -2
  33. package/es/components/card/src/card.mjs +35 -15
  34. package/es/components/card/src/card.mjs.map +1 -1
  35. package/es/components/card/src/card2.mjs +15 -35
  36. package/es/components/card/src/card2.mjs.map +1 -1
  37. package/es/components/carousel/index.mjs +4 -4
  38. package/es/components/carousel/src/carousel-item.mjs +155 -7
  39. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  40. package/es/components/carousel/src/carousel-item2.mjs +7 -155
  41. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  42. package/es/components/carousel/src/carousel.mjs +319 -48
  43. package/es/components/carousel/src/carousel.mjs.map +1 -1
  44. package/es/components/carousel/src/carousel2.mjs +48 -319
  45. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  46. package/es/components/cascader/index.d.ts +68 -68
  47. package/es/components/cascader/src/index.mjs +1 -1
  48. package/es/components/cascader/src/index.vue.d.ts +34 -34
  49. package/es/components/cascader-panel/src/config.mjs +1 -1
  50. package/es/components/cascader-panel/src/index.mjs +1 -1
  51. package/es/components/cascader-panel/src/menu.mjs +1 -1
  52. package/es/components/cascader-panel/src/node.mjs +120 -209
  53. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  54. package/es/components/cascader-panel/src/node2.mjs +209 -120
  55. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  56. package/es/components/cascader-panel/src/store.mjs +1 -1
  57. package/es/components/collapse/index.mjs +2 -2
  58. package/es/components/collapse/src/collapse.mjs +61 -14
  59. package/es/components/collapse/src/collapse.mjs.map +1 -1
  60. package/es/components/collapse/src/collapse2.mjs +14 -61
  61. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  62. package/es/components/collection/index.mjs +1 -1
  63. package/es/components/collection/src/collection.mjs +10 -63
  64. package/es/components/collection/src/collection.mjs.map +1 -1
  65. package/es/components/collection/src/collection2.mjs +63 -10
  66. package/es/components/collection/src/collection2.mjs.map +1 -1
  67. package/es/components/dialog/index.mjs +2 -2
  68. package/es/components/dialog/src/dialog.mjs +70 -113
  69. package/es/components/dialog/src/dialog.mjs.map +1 -1
  70. package/es/components/dialog/src/dialog2.mjs +113 -70
  71. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  72. package/es/components/divider/index.mjs +2 -2
  73. package/es/components/divider/src/divider.mjs +34 -17
  74. package/es/components/divider/src/divider.mjs.map +1 -1
  75. package/es/components/divider/src/divider2.mjs +17 -34
  76. package/es/components/divider/src/divider2.mjs.map +1 -1
  77. package/es/components/drawer/src/drawer2.mjs +1 -1
  78. package/es/components/dropdown/index.d.ts +10 -10
  79. package/es/components/dropdown/index.mjs +2 -2
  80. package/es/components/dropdown/src/dropdown-item-impl.mjs +3 -3
  81. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +1 -1
  82. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  83. package/es/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
  84. package/es/components/dropdown/src/dropdown-menu.mjs +2 -2
  85. package/es/components/dropdown/src/dropdown.d.ts +1 -1
  86. package/es/components/dropdown/src/dropdown.mjs +100 -247
  87. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  88. package/es/components/dropdown/src/dropdown.vue.d.ts +8 -8
  89. package/es/components/dropdown/src/dropdown2.mjs +247 -100
  90. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  91. package/es/components/icon/index.mjs +2 -2
  92. package/es/components/icon/src/icon.mjs +35 -8
  93. package/es/components/icon/src/icon.mjs.map +1 -1
  94. package/es/components/icon/src/icon2.mjs +8 -35
  95. package/es/components/icon/src/icon2.mjs.map +1 -1
  96. package/es/components/image/index.d.ts +1 -1
  97. package/es/components/image/src/image.vue.d.ts +1 -1
  98. package/es/components/image-viewer/index.d.ts +1 -1
  99. package/es/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  100. package/es/components/index.mjs +29 -29
  101. package/es/components/input/index.d.ts +11 -11
  102. package/es/components/input/src/input.vue.d.ts +11 -11
  103. package/es/components/input-number/index.d.ts +22 -22
  104. package/es/components/input-number/index.mjs +2 -2
  105. package/es/components/input-number/src/input-number.mjs +53 -284
  106. package/es/components/input-number/src/input-number.mjs.map +1 -1
  107. package/es/components/input-number/src/input-number.vue.d.ts +22 -22
  108. package/es/components/input-number/src/input-number2.mjs +284 -53
  109. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  110. package/es/components/link/index.mjs +2 -2
  111. package/es/components/link/src/link.mjs +49 -22
  112. package/es/components/link/src/link.mjs.map +1 -1
  113. package/es/components/link/src/link2.mjs +22 -49
  114. package/es/components/link/src/link2.mjs.map +1 -1
  115. package/es/components/menu/index.mjs +2 -2
  116. package/es/components/menu/src/menu-item.mjs +14 -94
  117. package/es/components/menu/src/menu-item.mjs.map +1 -1
  118. package/es/components/menu/src/menu-item2.mjs +94 -14
  119. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  120. package/es/components/message/index.mjs +1 -1
  121. package/es/components/message/src/message-method.mjs +2 -2
  122. package/es/components/message/src/message.mjs +67 -151
  123. package/es/components/message/src/message.mjs.map +1 -1
  124. package/es/components/message/src/message2.mjs +151 -67
  125. package/es/components/message/src/message2.mjs.map +1 -1
  126. package/es/components/notification/index.mjs +1 -1
  127. package/es/components/notification/src/notification.mjs +68 -150
  128. package/es/components/notification/src/notification.mjs.map +1 -1
  129. package/es/components/notification/src/notification2.mjs +150 -68
  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 +60 -17
  134. package/es/components/page-header/src/page-header.mjs.map +1 -1
  135. package/es/components/page-header/src/page-header2.mjs +17 -60
  136. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  137. package/es/components/popconfirm/index.mjs +2 -2
  138. package/es/components/popconfirm/src/popconfirm.mjs +119 -52
  139. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  140. package/es/components/popconfirm/src/popconfirm2.mjs +52 -119
  141. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  142. package/es/components/popover/index.d.ts +16 -16
  143. package/es/components/popover/src/index.vue.d.ts +8 -8
  144. package/es/components/popover/src/popover.d.ts +1 -1
  145. package/es/components/popover/src/popover.mjs +1 -1
  146. package/es/components/popper/index.mjs +2 -2
  147. package/es/components/popper/src/arrow.mjs +37 -7
  148. package/es/components/popper/src/arrow.mjs.map +1 -1
  149. package/es/components/popper/src/arrow2.mjs +7 -37
  150. package/es/components/popper/src/arrow2.mjs.map +1 -1
  151. package/es/components/popper/src/content.vue.d.ts +3 -3
  152. package/es/components/radio/index.mjs +2 -2
  153. package/es/components/radio/src/radio-button.mjs +85 -9
  154. package/es/components/radio/src/radio-button.mjs.map +1 -1
  155. package/es/components/radio/src/radio-button2.mjs +9 -85
  156. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  157. package/es/components/rate/index.mjs +2 -2
  158. package/es/components/rate/src/rate.mjs +239 -88
  159. package/es/components/rate/src/rate.mjs.map +1 -1
  160. package/es/components/rate/src/rate2.mjs +88 -239
  161. package/es/components/rate/src/rate2.mjs.map +1 -1
  162. package/es/components/roving-focus-group/index.mjs +3 -3
  163. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  164. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
  165. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  166. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
  167. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  168. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  169. package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
  170. package/es/components/scrollbar/index.mjs +2 -2
  171. package/es/components/scrollbar/src/bar.mjs +22 -45
  172. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  173. package/es/components/scrollbar/src/bar2.mjs +45 -22
  174. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  175. package/es/components/scrollbar/src/scrollbar.mjs +175 -49
  176. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  177. package/es/components/scrollbar/src/scrollbar2.mjs +49 -175
  178. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  179. package/es/components/select/index.d.ts +7 -7
  180. package/es/components/select/src/select.mjs +1 -1
  181. package/es/components/select/src/select.vue.d.ts +7 -7
  182. package/es/components/select/src/useSelect.d.ts +5 -5
  183. package/es/components/select-v2/index.d.ts +14 -14
  184. package/es/components/select-v2/src/option-item.vue.d.ts +1 -1
  185. package/es/components/select-v2/src/select.vue.d.ts +7 -7
  186. package/es/components/select-v2/src/useSelect.d.ts +5 -5
  187. package/es/components/skeleton/index.mjs +2 -2
  188. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  189. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  190. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  191. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  192. package/es/components/skeleton/src/skeleton.mjs +1 -1
  193. package/es/components/switch/index.mjs +2 -2
  194. package/es/components/switch/src/switch.mjs +250 -87
  195. package/es/components/switch/src/switch.mjs.map +1 -1
  196. package/es/components/switch/src/switch2.mjs +87 -250
  197. package/es/components/switch/src/switch2.mjs.map +1 -1
  198. package/es/components/table/index.d.ts +1 -1
  199. package/es/components/table/src/filter-panel.vue.d.ts +5 -5
  200. package/es/components/table/src/table.vue.d.ts +1 -1
  201. package/es/components/tag/index.d.ts +1 -1
  202. package/es/components/tag/index.mjs +2 -2
  203. package/es/components/tag/src/tag.mjs +93 -33
  204. package/es/components/tag/src/tag.mjs.map +1 -1
  205. package/es/components/tag/src/tag.vue.d.ts +1 -1
  206. package/es/components/tag/src/tag2.mjs +33 -93
  207. package/es/components/tag/src/tag2.mjs.map +1 -1
  208. package/es/components/teleport/index.mjs +2 -2
  209. package/es/components/teleport/src/teleport.mjs +43 -18
  210. package/es/components/teleport/src/teleport.mjs.map +1 -1
  211. package/es/components/teleport/src/teleport2.mjs +18 -43
  212. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  213. package/es/components/time-picker/src/common/picker.vue.d.ts +6 -6
  214. package/es/components/time-select/index.d.ts +2 -2
  215. package/es/components/time-select/src/time-select.vue.d.ts +1 -1
  216. package/es/components/timeline/index.mjs +2 -2
  217. package/es/components/timeline/src/timeline-item.mjs +39 -73
  218. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  219. package/es/components/timeline/src/timeline-item2.mjs +73 -39
  220. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  221. package/es/components/tooltip/index.d.ts +3 -3
  222. package/es/components/tooltip/src/content.vue.d.ts +5 -5
  223. package/es/components/tooltip/src/tooltip.d.ts +1 -1
  224. package/es/components/tooltip/src/tooltip.mjs +2 -2
  225. package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
  226. package/es/components/tooltip/src/trigger.vue.d.ts +3 -3
  227. package/es/components/tooltip-v2/index.mjs +2 -2
  228. package/es/components/tooltip-v2/src/tooltip.mjs +73 -20
  229. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  230. package/es/components/tooltip-v2/src/tooltip2.mjs +20 -73
  231. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  232. package/es/components/upload/index.d.ts +1 -1
  233. package/es/components/upload/index.mjs +3 -3
  234. package/es/components/upload/src/upload-content.mjs +1 -1
  235. package/es/components/upload/src/upload-content2.mjs +2 -2
  236. package/es/components/upload/src/upload-dragger.mjs +70 -11
  237. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  238. package/es/components/upload/src/upload-dragger2.mjs +11 -70
  239. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  240. package/es/components/upload/src/upload-list2.mjs +1 -1
  241. package/es/components/upload/src/upload.mjs +106 -121
  242. package/es/components/upload/src/upload.mjs.map +1 -1
  243. package/es/components/upload/src/upload.vue.d.ts +1 -1
  244. package/es/components/upload/src/upload2.mjs +121 -106
  245. package/es/components/upload/src/upload2.mjs.map +1 -1
  246. package/es/components/upload/src/use-handlers.mjs +1 -1
  247. package/es/index.mjs +29 -29
  248. package/lib/components/autocomplete/index.d.ts +51 -51
  249. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +51 -51
  250. package/lib/components/backtop/index.js +2 -2
  251. package/lib/components/backtop/src/backtop.js +100 -22
  252. package/lib/components/backtop/src/backtop.js.map +1 -1
  253. package/lib/components/backtop/src/backtop2.js +22 -100
  254. package/lib/components/backtop/src/backtop2.js.map +1 -1
  255. package/lib/components/button/index.js +3 -3
  256. package/lib/components/button/src/button-group.js +30 -5
  257. package/lib/components/button/src/button-group.js.map +1 -1
  258. package/lib/components/button/src/button-group2.js +5 -30
  259. package/lib/components/button/src/button-group2.js.map +1 -1
  260. package/lib/components/button/src/button.js +106 -54
  261. package/lib/components/button/src/button.js.map +1 -1
  262. package/lib/components/button/src/button2.js +54 -106
  263. package/lib/components/button/src/button2.js.map +1 -1
  264. package/lib/components/calendar/index.js +2 -2
  265. package/lib/components/calendar/src/calendar.js +241 -16
  266. package/lib/components/calendar/src/calendar.js.map +1 -1
  267. package/lib/components/calendar/src/calendar2.js +16 -241
  268. package/lib/components/calendar/src/calendar2.js.map +1 -1
  269. package/lib/components/calendar/src/date-table.js +157 -35
  270. package/lib/components/calendar/src/date-table.js.map +1 -1
  271. package/lib/components/calendar/src/date-table2.js +35 -157
  272. package/lib/components/calendar/src/date-table2.js.map +1 -1
  273. package/lib/components/card/index.js +2 -2
  274. package/lib/components/card/src/card.js +35 -15
  275. package/lib/components/card/src/card.js.map +1 -1
  276. package/lib/components/card/src/card2.js +15 -35
  277. package/lib/components/card/src/card2.js.map +1 -1
  278. package/lib/components/carousel/index.js +4 -4
  279. package/lib/components/carousel/src/carousel-item.js +155 -7
  280. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  281. package/lib/components/carousel/src/carousel-item2.js +7 -155
  282. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  283. package/lib/components/carousel/src/carousel.js +319 -49
  284. package/lib/components/carousel/src/carousel.js.map +1 -1
  285. package/lib/components/carousel/src/carousel2.js +49 -319
  286. package/lib/components/carousel/src/carousel2.js.map +1 -1
  287. package/lib/components/cascader/index.d.ts +68 -68
  288. package/lib/components/cascader/src/index.js +1 -1
  289. package/lib/components/cascader/src/index.vue.d.ts +34 -34
  290. package/lib/components/cascader-panel/src/config.js +1 -1
  291. package/lib/components/cascader-panel/src/index.js +1 -1
  292. package/lib/components/cascader-panel/src/menu.js +1 -1
  293. package/lib/components/cascader-panel/src/node.js +121 -209
  294. package/lib/components/cascader-panel/src/node.js.map +1 -1
  295. package/lib/components/cascader-panel/src/node2.js +209 -121
  296. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  297. package/lib/components/cascader-panel/src/store.js +1 -1
  298. package/lib/components/collapse/index.js +2 -2
  299. package/lib/components/collapse/src/collapse.js +61 -16
  300. package/lib/components/collapse/src/collapse.js.map +1 -1
  301. package/lib/components/collapse/src/collapse2.js +16 -61
  302. package/lib/components/collapse/src/collapse2.js.map +1 -1
  303. package/lib/components/collection/index.js +1 -1
  304. package/lib/components/collection/src/collection.js +9 -63
  305. package/lib/components/collection/src/collection.js.map +1 -1
  306. package/lib/components/collection/src/collection2.js +63 -9
  307. package/lib/components/collection/src/collection2.js.map +1 -1
  308. package/lib/components/dialog/index.js +2 -2
  309. package/lib/components/dialog/src/dialog.js +71 -113
  310. package/lib/components/dialog/src/dialog.js.map +1 -1
  311. package/lib/components/dialog/src/dialog2.js +113 -71
  312. package/lib/components/dialog/src/dialog2.js.map +1 -1
  313. package/lib/components/divider/index.js +2 -2
  314. package/lib/components/divider/src/divider.js +34 -17
  315. package/lib/components/divider/src/divider.js.map +1 -1
  316. package/lib/components/divider/src/divider2.js +17 -34
  317. package/lib/components/divider/src/divider2.js.map +1 -1
  318. package/lib/components/drawer/src/drawer2.js +1 -1
  319. package/lib/components/dropdown/index.d.ts +10 -10
  320. package/lib/components/dropdown/index.js +2 -2
  321. package/lib/components/dropdown/src/dropdown-item-impl.js +3 -3
  322. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +1 -1
  323. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  324. package/lib/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
  325. package/lib/components/dropdown/src/dropdown-menu.js +2 -2
  326. package/lib/components/dropdown/src/dropdown.d.ts +1 -1
  327. package/lib/components/dropdown/src/dropdown.js +108 -246
  328. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  329. package/lib/components/dropdown/src/dropdown.vue.d.ts +8 -8
  330. package/lib/components/dropdown/src/dropdown2.js +246 -108
  331. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  332. package/lib/components/icon/index.js +2 -2
  333. package/lib/components/icon/src/icon.js +35 -8
  334. package/lib/components/icon/src/icon.js.map +1 -1
  335. package/lib/components/icon/src/icon2.js +8 -35
  336. package/lib/components/icon/src/icon2.js.map +1 -1
  337. package/lib/components/image/index.d.ts +1 -1
  338. package/lib/components/image/src/image.vue.d.ts +1 -1
  339. package/lib/components/image-viewer/index.d.ts +1 -1
  340. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  341. package/lib/components/index.js +29 -29
  342. package/lib/components/input/index.d.ts +11 -11
  343. package/lib/components/input/src/input.vue.d.ts +11 -11
  344. package/lib/components/input-number/index.d.ts +22 -22
  345. package/lib/components/input-number/index.js +2 -2
  346. package/lib/components/input-number/src/input-number.js +54 -284
  347. package/lib/components/input-number/src/input-number.js.map +1 -1
  348. package/lib/components/input-number/src/input-number.vue.d.ts +22 -22
  349. package/lib/components/input-number/src/input-number2.js +284 -54
  350. package/lib/components/input-number/src/input-number2.js.map +1 -1
  351. package/lib/components/link/index.js +2 -2
  352. package/lib/components/link/src/link.js +49 -23
  353. package/lib/components/link/src/link.js.map +1 -1
  354. package/lib/components/link/src/link2.js +23 -49
  355. package/lib/components/link/src/link2.js.map +1 -1
  356. package/lib/components/menu/index.js +2 -2
  357. package/lib/components/menu/src/menu-item.js +15 -94
  358. package/lib/components/menu/src/menu-item.js.map +1 -1
  359. package/lib/components/menu/src/menu-item2.js +94 -15
  360. package/lib/components/menu/src/menu-item2.js.map +1 -1
  361. package/lib/components/message/index.js +1 -1
  362. package/lib/components/message/src/message-method.js +2 -2
  363. package/lib/components/message/src/message.js +68 -150
  364. package/lib/components/message/src/message.js.map +1 -1
  365. package/lib/components/message/src/message2.js +150 -68
  366. package/lib/components/message/src/message2.js.map +1 -1
  367. package/lib/components/notification/index.js +1 -1
  368. package/lib/components/notification/src/notification.js +70 -150
  369. package/lib/components/notification/src/notification.js.map +1 -1
  370. package/lib/components/notification/src/notification2.js +150 -70
  371. package/lib/components/notification/src/notification2.js.map +1 -1
  372. package/lib/components/notification/src/notify.js +2 -2
  373. package/lib/components/page-header/index.js +2 -2
  374. package/lib/components/page-header/src/page-header.js +60 -18
  375. package/lib/components/page-header/src/page-header.js.map +1 -1
  376. package/lib/components/page-header/src/page-header2.js +18 -60
  377. package/lib/components/page-header/src/page-header2.js.map +1 -1
  378. package/lib/components/popconfirm/index.js +2 -2
  379. package/lib/components/popconfirm/src/popconfirm.js +119 -52
  380. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  381. package/lib/components/popconfirm/src/popconfirm2.js +52 -119
  382. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  383. package/lib/components/popover/index.d.ts +16 -16
  384. package/lib/components/popover/src/index.vue.d.ts +8 -8
  385. package/lib/components/popover/src/popover.d.ts +1 -1
  386. package/lib/components/popover/src/popover.js +1 -1
  387. package/lib/components/popper/index.js +2 -2
  388. package/lib/components/popper/src/arrow.js +37 -7
  389. package/lib/components/popper/src/arrow.js.map +1 -1
  390. package/lib/components/popper/src/arrow2.js +7 -37
  391. package/lib/components/popper/src/arrow2.js.map +1 -1
  392. package/lib/components/popper/src/content.vue.d.ts +3 -3
  393. package/lib/components/radio/index.js +2 -2
  394. package/lib/components/radio/src/radio-button.js +84 -8
  395. package/lib/components/radio/src/radio-button.js.map +1 -1
  396. package/lib/components/radio/src/radio-button2.js +8 -84
  397. package/lib/components/radio/src/radio-button2.js.map +1 -1
  398. package/lib/components/rate/index.js +2 -2
  399. package/lib/components/rate/src/rate.js +239 -89
  400. package/lib/components/rate/src/rate.js.map +1 -1
  401. package/lib/components/rate/src/rate2.js +89 -239
  402. package/lib/components/rate/src/rate2.js.map +1 -1
  403. package/lib/components/roving-focus-group/index.js +2 -2
  404. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  405. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
  406. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  407. package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
  408. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  409. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  410. package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
  411. package/lib/components/scrollbar/index.js +2 -2
  412. package/lib/components/scrollbar/src/bar.js +22 -45
  413. package/lib/components/scrollbar/src/bar.js.map +1 -1
  414. package/lib/components/scrollbar/src/bar2.js +45 -22
  415. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  416. package/lib/components/scrollbar/src/scrollbar.js +175 -50
  417. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  418. package/lib/components/scrollbar/src/scrollbar2.js +50 -175
  419. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  420. package/lib/components/select/index.d.ts +7 -7
  421. package/lib/components/select/src/select.js +1 -1
  422. package/lib/components/select/src/select.vue.d.ts +7 -7
  423. package/lib/components/select/src/useSelect.d.ts +5 -5
  424. package/lib/components/select-v2/index.d.ts +14 -14
  425. package/lib/components/select-v2/src/option-item.vue.d.ts +1 -1
  426. package/lib/components/select-v2/src/select.vue.d.ts +7 -7
  427. package/lib/components/select-v2/src/useSelect.d.ts +5 -5
  428. package/lib/components/skeleton/index.js +2 -2
  429. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  430. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  431. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  432. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  433. package/lib/components/skeleton/src/skeleton.js +1 -1
  434. package/lib/components/switch/index.js +2 -2
  435. package/lib/components/switch/src/switch.js +249 -87
  436. package/lib/components/switch/src/switch.js.map +1 -1
  437. package/lib/components/switch/src/switch2.js +87 -249
  438. package/lib/components/switch/src/switch2.js.map +1 -1
  439. package/lib/components/table/index.d.ts +1 -1
  440. package/lib/components/table/src/filter-panel.vue.d.ts +5 -5
  441. package/lib/components/table/src/table.vue.d.ts +1 -1
  442. package/lib/components/tag/index.d.ts +1 -1
  443. package/lib/components/tag/index.js +2 -2
  444. package/lib/components/tag/src/tag.js +93 -34
  445. package/lib/components/tag/src/tag.js.map +1 -1
  446. package/lib/components/tag/src/tag.vue.d.ts +1 -1
  447. package/lib/components/tag/src/tag2.js +34 -93
  448. package/lib/components/tag/src/tag2.js.map +1 -1
  449. package/lib/components/teleport/index.js +2 -2
  450. package/lib/components/teleport/src/teleport.js +43 -18
  451. package/lib/components/teleport/src/teleport.js.map +1 -1
  452. package/lib/components/teleport/src/teleport2.js +18 -43
  453. package/lib/components/teleport/src/teleport2.js.map +1 -1
  454. package/lib/components/time-picker/src/common/picker.vue.d.ts +6 -6
  455. package/lib/components/time-select/index.d.ts +2 -2
  456. package/lib/components/time-select/src/time-select.vue.d.ts +1 -1
  457. package/lib/components/timeline/index.js +2 -2
  458. package/lib/components/timeline/src/timeline-item.js +39 -73
  459. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  460. package/lib/components/timeline/src/timeline-item2.js +73 -39
  461. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  462. package/lib/components/tooltip/index.d.ts +3 -3
  463. package/lib/components/tooltip/src/content.vue.d.ts +5 -5
  464. package/lib/components/tooltip/src/tooltip.d.ts +1 -1
  465. package/lib/components/tooltip/src/tooltip.js +2 -2
  466. package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
  467. package/lib/components/tooltip/src/trigger.vue.d.ts +3 -3
  468. package/lib/components/tooltip-v2/index.js +2 -2
  469. package/lib/components/tooltip-v2/src/tooltip.js +73 -20
  470. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  471. package/lib/components/tooltip-v2/src/tooltip2.js +20 -73
  472. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  473. package/lib/components/upload/index.d.ts +1 -1
  474. package/lib/components/upload/index.js +3 -3
  475. package/lib/components/upload/src/upload-content.js +1 -1
  476. package/lib/components/upload/src/upload-content2.js +2 -2
  477. package/lib/components/upload/src/upload-dragger.js +70 -12
  478. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  479. package/lib/components/upload/src/upload-dragger2.js +12 -70
  480. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  481. package/lib/components/upload/src/upload-list2.js +1 -1
  482. package/lib/components/upload/src/upload.js +109 -121
  483. package/lib/components/upload/src/upload.js.map +1 -1
  484. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  485. package/lib/components/upload/src/upload2.js +121 -109
  486. package/lib/components/upload/src/upload2.js.map +1 -1
  487. package/lib/components/upload/src/use-handlers.js +1 -1
  488. package/lib/index.js +29 -29
  489. package/package.json +1 -1
  490. package/web-types.json +1 -1
@@ -1,24 +1,103 @@
1
- const backtopProps = {
2
- visibilityHeight: {
3
- type: Number,
4
- default: 200
5
- },
6
- target: {
7
- type: String,
8
- default: ""
9
- },
10
- right: {
11
- type: Number,
12
- default: 40
13
- },
14
- bottom: {
15
- type: Number,
16
- default: 40
17
- }
18
- };
19
- const backtopEmits = {
20
- click: (evt) => evt instanceof MouseEvent
1
+ import { defineComponent, shallowRef, ref, computed, onMounted, openBlock, createBlock, Transition, unref, withCtx, createElementBlock, normalizeStyle, normalizeClass, withModifiers, renderSlot, createVNode, createCommentVNode } from 'vue';
2
+ import { useThrottleFn, useEventListener } from '@vueuse/core';
3
+ import { ElIcon } from '../../icon/index.mjs';
4
+ import '../../../utils/index.mjs';
5
+ import { CaretTop } from '@element-plus/icons-vue';
6
+ import '../../../hooks/index.mjs';
7
+ import { backtopProps, backtopEmits } from './backtop2.mjs';
8
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
9
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
10
+ import { easeInOutCubic } from '../../../utils/animation.mjs';
11
+ import { throwError } from '../../../utils/error.mjs';
12
+
13
+ const _hoisted_1 = ["onClick"];
14
+ const __default__ = {
15
+ name: "ElBacktop"
21
16
  };
17
+ const _sfc_main = /* @__PURE__ */ defineComponent({
18
+ ...__default__,
19
+ props: backtopProps,
20
+ emits: backtopEmits,
21
+ setup(__props, { emit }) {
22
+ const props = __props;
23
+ const COMPONENT_NAME = "ElBacktop";
24
+ const ns = useNamespace("backtop");
25
+ const el = shallowRef();
26
+ const container = shallowRef();
27
+ const visible = ref(false);
28
+ const backTopStyle = computed(() => ({
29
+ right: `${props.right}px`,
30
+ bottom: `${props.bottom}px`
31
+ }));
32
+ const scrollToTop = () => {
33
+ if (!el.value)
34
+ return;
35
+ const beginTime = Date.now();
36
+ const beginValue = el.value.scrollTop;
37
+ const frameFunc = () => {
38
+ if (!el.value)
39
+ return;
40
+ const progress = (Date.now() - beginTime) / 500;
41
+ if (progress < 1) {
42
+ el.value.scrollTop = beginValue * (1 - easeInOutCubic(progress));
43
+ requestAnimationFrame(frameFunc);
44
+ } else {
45
+ el.value.scrollTop = 0;
46
+ }
47
+ };
48
+ requestAnimationFrame(frameFunc);
49
+ };
50
+ const handleScroll = () => {
51
+ if (el.value)
52
+ visible.value = el.value.scrollTop >= props.visibilityHeight;
53
+ };
54
+ const handleClick = (event) => {
55
+ scrollToTop();
56
+ emit("click", event);
57
+ };
58
+ const handleScrollThrottled = useThrottleFn(handleScroll, 300);
59
+ onMounted(() => {
60
+ var _a;
61
+ container.value = document;
62
+ el.value = document.documentElement;
63
+ if (props.target) {
64
+ el.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
65
+ if (!el.value) {
66
+ throwError(COMPONENT_NAME, `target is not existed: ${props.target}`);
67
+ }
68
+ container.value = el.value;
69
+ }
70
+ useEventListener(container, "scroll", handleScrollThrottled);
71
+ });
72
+ return (_ctx, _cache) => {
73
+ return openBlock(), createBlock(Transition, {
74
+ name: `${unref(ns).namespace.value}-fade-in`
75
+ }, {
76
+ default: withCtx(() => [
77
+ visible.value ? (openBlock(), createElementBlock("div", {
78
+ key: 0,
79
+ style: normalizeStyle(unref(backTopStyle)),
80
+ class: normalizeClass(unref(ns).b()),
81
+ onClick: withModifiers(handleClick, ["stop"])
82
+ }, [
83
+ renderSlot(_ctx.$slots, "default", {}, () => [
84
+ createVNode(unref(ElIcon), {
85
+ class: normalizeClass(unref(ns).e("icon"))
86
+ }, {
87
+ default: withCtx(() => [
88
+ createVNode(unref(CaretTop))
89
+ ]),
90
+ _: 1
91
+ }, 8, ["class"])
92
+ ])
93
+ ], 14, _hoisted_1)) : createCommentVNode("v-if", true)
94
+ ]),
95
+ _: 3
96
+ }, 8, ["name"]);
97
+ };
98
+ }
99
+ });
100
+ var Backtop = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/backtop/src/backtop.vue"]]);
22
101
 
23
- export { backtopEmits, backtopProps };
102
+ export { Backtop as default };
24
103
  //# sourceMappingURL=backtop.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"backtop.mjs","sources":["../../../../../../packages/components/backtop/src/backtop.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const backtopProps = {\n visibilityHeight: {\n type: Number,\n default: 200,\n },\n target: {\n type: String,\n default: '',\n },\n right: {\n type: Number,\n default: 40,\n },\n bottom: {\n type: Number,\n default: 40,\n },\n} as const\nexport type BacktopProps = ExtractPropTypes<typeof backtopProps>\n\nexport const backtopEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type BacktopEmits = typeof backtopEmits\n"],"names":[],"mappings":"AAAY,MAAC,YAAY,GAAG;AAC5B,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE;AACU,MAAC,YAAY,GAAG;AAC5B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}
1
+ {"version":3,"file":"backtop.mjs","sources":["../../../../../../packages/components/backtop/src/backtop.vue"],"sourcesContent":["<template>\n <transition :name=\"`${ns.namespace.value}-fade-in`\">\n <div\n v-if=\"visible\"\n :style=\"backTopStyle\"\n :class=\"ns.b()\"\n @click.stop=\"handleClick\"\n >\n <slot>\n <el-icon :class=\"ns.e('icon')\"><caret-top /></el-icon>\n </slot>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef } from 'vue'\nimport { useEventListener, useThrottleFn } from '@vueuse/core'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { easeInOutCubic, throwError } from '@element-plus/utils'\nimport { CaretTop } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport { backtopEmits, backtopProps } from './backtop'\n\nconst COMPONENT_NAME = 'ElBacktop'\n\ndefineOptions({\n name: 'ElBacktop',\n})\n\nconst props = defineProps(backtopProps)\nconst emit = defineEmits(backtopEmits)\n\nconst ns = useNamespace('backtop')\nconst el = shallowRef<HTMLElement>()\nconst container = shallowRef<Document | HTMLElement>()\nconst visible = ref(false)\n\nconst backTopStyle = computed(() => ({\n right: `${props.right}px`,\n bottom: `${props.bottom}px`,\n}))\n\nconst scrollToTop = () => {\n if (!el.value) return\n const beginTime = Date.now()\n const beginValue = el.value.scrollTop\n const frameFunc = () => {\n if (!el.value) return\n const progress = (Date.now() - beginTime) / 500\n if (progress < 1) {\n el.value.scrollTop = beginValue * (1 - easeInOutCubic(progress))\n requestAnimationFrame(frameFunc)\n } else {\n el.value.scrollTop = 0\n }\n }\n requestAnimationFrame(frameFunc)\n}\nconst handleScroll = () => {\n if (el.value) visible.value = el.value.scrollTop >= props.visibilityHeight\n}\nconst handleClick = (event: MouseEvent) => {\n scrollToTop()\n emit('click', event)\n}\n\nconst handleScrollThrottled = useThrottleFn(handleScroll, 300)\n\nonMounted(() => {\n container.value = document\n el.value = document.documentElement\n\n if (props.target) {\n el.value = document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!el.value) {\n throwError(COMPONENT_NAME, `target is not existed: ${props.target}`)\n }\n container.value = el.value\n }\n\n useEventListener(container, 'scroll', handleScrollThrottled)\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAA,MAAA,cAAA,GAAA,WAAA,CAAA;AASA,IAAA,MAAA,EAAA,GAAA,aAAA,SAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA,UAAA,EAAA,CAAA;AACA,IAAA,MAAA,YAAA,UAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAA,YAAA,GAAA,SAAA,OAAA;AAAA,MACA,KAAA,EAAA,GAAA,KAAA,CAAA,KAAA,CAAA,EAAA,CAAA;AAAA,MACA,MAAA,EAAA,GAAA,KAAA,CAAA,MAAA,CAAA,EAAA,CAAA;AAAA,KACA,CAAA,CAAA,CAAA;AAEA,IAAA,MAAA,cAAA,MAAA;AACA,MAAA,IAAA,CAAA,EAAA,CAAA,KAAA;AAAA,QAAA,OAAA;AACA,MAAA,MAAA,SAAA,GAAA,KAAA,GAAA,EAAA,CAAA;AACA,MAAA,MAAA,UAAA,GAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACA,MAAA,MAAA,YAAA,MAAA;AACA,QAAA,IAAA,CAAA,EAAA,CAAA,KAAA;AAAA,UAAA,OAAA;AACA,QAAA,MAAA,QAAA,GAAA,CAAA,IAAA,CAAA,GAAA,EAAA,GAAA,SAAA,IAAA,GAAA,CAAA;AACA,QAAA,IAAA,WAAA,CAAA,EAAA;AACA,UAAA,EAAA,CAAA,KAAA,CAAA,SAAA,GAAA,UAAA,IAAA,CAAA,GAAA,eAAA,QAAA,CAAA,CAAA,CAAA;AACA,UAAA,qBAAA,CAAA,SAAA,CAAA,CAAA;AAAA,SACA,MAAA;AACA,UAAA,EAAA,CAAA,MAAA,SAAA,GAAA,CAAA,CAAA;AAAA,SACA;AAAA,OACA,CAAA;AACA,MAAA,qBAAA,CAAA,SAAA,CAAA,CAAA;AAAA,KACA,CAAA;AACA,IAAA,MAAA,eAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA,KAAA;AAAA,QAAA,OAAA,CAAA,KAAA,GAAA,EAAA,CAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,gBAAA,CAAA;AAAA,KACA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,CAAA,KAAA,KAAA;AACA,MAAA,WAAA,EAAA,CAAA;AACA,MAAA,IAAA,CAAA,SAAA,KAAA,CAAA,CAAA;AAAA,KACA,CAAA;AAEA,IAAA,MAAA,qBAAA,GAAA,aAAA,CAAA,YAAA,EAAA,GAAA,CAAA,CAAA;AAEA,IAAA,SAAA,CAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA;AACA,MAAA,eAAA,GAAA,QAAA,CAAA;AAEA,MAAA,EAAA,CAAA,QAAA,QAAA,CAAA,eAAA,CAAA;AACA,MAAA,IAAA,KAAA,CAAA,MAAA,EAAA;AACA,QAAA,EAAA,CAAA,KAAA,GAAA,CAAA,EAAA,GAAA,QAAA,CAAA,aAAA,CAAA,KAAA,CAAA,MAAA,CAAA,KAAA,IAAA,GAAA,EAAA,GAAA,KAAA,CAAA,CAAA;AACA,QAAA,IAAA,CAAA,EAAA,CAAA,KAAA,EAAA;AAAA,UACA,UAAA,CAAA,cAAA,EAAA,CAAA,uBAAA,EAAA,KAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,SAAA;AAAA,QACA,SAAA,CAAA,KAAA,GAAA,EAAA,CAAA,KAAA,CAAA;AAEA,OAAA;AAAA,MACA,gBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,qBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,103 +1,24 @@
1
- import { defineComponent, shallowRef, ref, computed, onMounted, openBlock, createBlock, Transition, unref, withCtx, createElementBlock, normalizeStyle, normalizeClass, withModifiers, renderSlot, createVNode, createCommentVNode } from 'vue';
2
- import { useThrottleFn, useEventListener } from '@vueuse/core';
3
- import { ElIcon } from '../../icon/index.mjs';
4
- import '../../../utils/index.mjs';
5
- import { CaretTop } from '@element-plus/icons-vue';
6
- import '../../../hooks/index.mjs';
7
- import { backtopProps, backtopEmits } from './backtop.mjs';
8
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
9
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
10
- import { easeInOutCubic } from '../../../utils/animation.mjs';
11
- import { throwError } from '../../../utils/error.mjs';
12
-
13
- const _hoisted_1 = ["onClick"];
14
- const __default__ = {
15
- name: "ElBacktop"
16
- };
17
- const _sfc_main = /* @__PURE__ */ defineComponent({
18
- ...__default__,
19
- props: backtopProps,
20
- emits: backtopEmits,
21
- setup(__props, { emit }) {
22
- const props = __props;
23
- const COMPONENT_NAME = "ElBacktop";
24
- const ns = useNamespace("backtop");
25
- const el = shallowRef();
26
- const container = shallowRef();
27
- const visible = ref(false);
28
- const backTopStyle = computed(() => ({
29
- right: `${props.right}px`,
30
- bottom: `${props.bottom}px`
31
- }));
32
- const scrollToTop = () => {
33
- if (!el.value)
34
- return;
35
- const beginTime = Date.now();
36
- const beginValue = el.value.scrollTop;
37
- const frameFunc = () => {
38
- if (!el.value)
39
- return;
40
- const progress = (Date.now() - beginTime) / 500;
41
- if (progress < 1) {
42
- el.value.scrollTop = beginValue * (1 - easeInOutCubic(progress));
43
- requestAnimationFrame(frameFunc);
44
- } else {
45
- el.value.scrollTop = 0;
46
- }
47
- };
48
- requestAnimationFrame(frameFunc);
49
- };
50
- const handleScroll = () => {
51
- if (el.value)
52
- visible.value = el.value.scrollTop >= props.visibilityHeight;
53
- };
54
- const handleClick = (event) => {
55
- scrollToTop();
56
- emit("click", event);
57
- };
58
- const handleScrollThrottled = useThrottleFn(handleScroll, 300);
59
- onMounted(() => {
60
- var _a;
61
- container.value = document;
62
- el.value = document.documentElement;
63
- if (props.target) {
64
- el.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
65
- if (!el.value) {
66
- throwError(COMPONENT_NAME, `target is not existed: ${props.target}`);
67
- }
68
- container.value = el.value;
69
- }
70
- useEventListener(container, "scroll", handleScrollThrottled);
71
- });
72
- return (_ctx, _cache) => {
73
- return openBlock(), createBlock(Transition, {
74
- name: `${unref(ns).namespace.value}-fade-in`
75
- }, {
76
- default: withCtx(() => [
77
- visible.value ? (openBlock(), createElementBlock("div", {
78
- key: 0,
79
- style: normalizeStyle(unref(backTopStyle)),
80
- class: normalizeClass(unref(ns).b()),
81
- onClick: withModifiers(handleClick, ["stop"])
82
- }, [
83
- renderSlot(_ctx.$slots, "default", {}, () => [
84
- createVNode(unref(ElIcon), {
85
- class: normalizeClass(unref(ns).e("icon"))
86
- }, {
87
- default: withCtx(() => [
88
- createVNode(unref(CaretTop))
89
- ]),
90
- _: 1
91
- }, 8, ["class"])
92
- ])
93
- ], 14, _hoisted_1)) : createCommentVNode("v-if", true)
94
- ]),
95
- _: 3
96
- }, 8, ["name"]);
97
- };
1
+ const backtopProps = {
2
+ visibilityHeight: {
3
+ type: Number,
4
+ default: 200
5
+ },
6
+ target: {
7
+ type: String,
8
+ default: ""
9
+ },
10
+ right: {
11
+ type: Number,
12
+ default: 40
13
+ },
14
+ bottom: {
15
+ type: Number,
16
+ default: 40
98
17
  }
99
- });
100
- var Backtop = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/backtop/src/backtop.vue"]]);
18
+ };
19
+ const backtopEmits = {
20
+ click: (evt) => evt instanceof MouseEvent
21
+ };
101
22
 
102
- export { Backtop as default };
23
+ export { backtopEmits, backtopProps };
103
24
  //# sourceMappingURL=backtop2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"backtop2.mjs","sources":["../../../../../../packages/components/backtop/src/backtop.vue"],"sourcesContent":["<template>\n <transition :name=\"`${ns.namespace.value}-fade-in`\">\n <div\n v-if=\"visible\"\n :style=\"backTopStyle\"\n :class=\"ns.b()\"\n @click.stop=\"handleClick\"\n >\n <slot>\n <el-icon :class=\"ns.e('icon')\"><caret-top /></el-icon>\n </slot>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef } from 'vue'\nimport { useEventListener, useThrottleFn } from '@vueuse/core'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { easeInOutCubic, throwError } from '@element-plus/utils'\nimport { CaretTop } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport { backtopEmits, backtopProps } from './backtop'\n\nconst COMPONENT_NAME = 'ElBacktop'\n\ndefineOptions({\n name: 'ElBacktop',\n})\n\nconst props = defineProps(backtopProps)\nconst emit = defineEmits(backtopEmits)\n\nconst ns = useNamespace('backtop')\nconst el = shallowRef<HTMLElement>()\nconst container = shallowRef<Document | HTMLElement>()\nconst visible = ref(false)\n\nconst backTopStyle = computed(() => ({\n right: `${props.right}px`,\n bottom: `${props.bottom}px`,\n}))\n\nconst scrollToTop = () => {\n if (!el.value) return\n const beginTime = Date.now()\n const beginValue = el.value.scrollTop\n const frameFunc = () => {\n if (!el.value) return\n const progress = (Date.now() - beginTime) / 500\n if (progress < 1) {\n el.value.scrollTop = beginValue * (1 - easeInOutCubic(progress))\n requestAnimationFrame(frameFunc)\n } else {\n el.value.scrollTop = 0\n }\n }\n requestAnimationFrame(frameFunc)\n}\nconst handleScroll = () => {\n if (el.value) visible.value = el.value.scrollTop >= props.visibilityHeight\n}\nconst handleClick = (event: MouseEvent) => {\n scrollToTop()\n emit('click', event)\n}\n\nconst handleScrollThrottled = useThrottleFn(handleScroll, 300)\n\nonMounted(() => {\n container.value = document\n el.value = document.documentElement\n\n if (props.target) {\n el.value = document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!el.value) {\n throwError(COMPONENT_NAME, `target is not existed: ${props.target}`)\n }\n container.value = el.value\n }\n\n useEventListener(container, 'scroll', handleScrollThrottled)\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAA,MAAA,cAAA,GAAA,WAAA,CAAA;AASA,IAAA,MAAA,EAAA,GAAA,aAAA,SAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA,UAAA,EAAA,CAAA;AACA,IAAA,MAAA,YAAA,UAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAA,YAAA,GAAA,SAAA,OAAA;AAAA,MACA,KAAA,EAAA,GAAA,KAAA,CAAA,KAAA,CAAA,EAAA,CAAA;AAAA,MACA,MAAA,EAAA,GAAA,KAAA,CAAA,MAAA,CAAA,EAAA,CAAA;AAAA,KACA,CAAA,CAAA,CAAA;AAEA,IAAA,MAAA,cAAA,MAAA;AACA,MAAA,IAAA,CAAA,EAAA,CAAA,KAAA;AAAA,QAAA,OAAA;AACA,MAAA,MAAA,SAAA,GAAA,KAAA,GAAA,EAAA,CAAA;AACA,MAAA,MAAA,UAAA,GAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACA,MAAA,MAAA,YAAA,MAAA;AACA,QAAA,IAAA,CAAA,EAAA,CAAA,KAAA;AAAA,UAAA,OAAA;AACA,QAAA,MAAA,QAAA,GAAA,CAAA,IAAA,CAAA,GAAA,EAAA,GAAA,SAAA,IAAA,GAAA,CAAA;AACA,QAAA,IAAA,WAAA,CAAA,EAAA;AACA,UAAA,EAAA,CAAA,KAAA,CAAA,SAAA,GAAA,UAAA,IAAA,CAAA,GAAA,eAAA,QAAA,CAAA,CAAA,CAAA;AACA,UAAA,qBAAA,CAAA,SAAA,CAAA,CAAA;AAAA,SACA,MAAA;AACA,UAAA,EAAA,CAAA,MAAA,SAAA,GAAA,CAAA,CAAA;AAAA,SACA;AAAA,OACA,CAAA;AACA,MAAA,qBAAA,CAAA,SAAA,CAAA,CAAA;AAAA,KACA,CAAA;AACA,IAAA,MAAA,eAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA,KAAA;AAAA,QAAA,OAAA,CAAA,KAAA,GAAA,EAAA,CAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,gBAAA,CAAA;AAAA,KACA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,CAAA,KAAA,KAAA;AACA,MAAA,WAAA,EAAA,CAAA;AACA,MAAA,IAAA,CAAA,SAAA,KAAA,CAAA,CAAA;AAAA,KACA,CAAA;AAEA,IAAA,MAAA,qBAAA,GAAA,aAAA,CAAA,YAAA,EAAA,GAAA,CAAA,CAAA;AAEA,IAAA,SAAA,CAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA;AACA,MAAA,eAAA,GAAA,QAAA,CAAA;AAEA,MAAA,EAAA,CAAA,QAAA,QAAA,CAAA,eAAA,CAAA;AACA,MAAA,IAAA,KAAA,CAAA,MAAA,EAAA;AACA,QAAA,EAAA,CAAA,KAAA,GAAA,CAAA,EAAA,GAAA,QAAA,CAAA,aAAA,CAAA,KAAA,CAAA,MAAA,CAAA,KAAA,IAAA,GAAA,EAAA,GAAA,KAAA,CAAA,CAAA;AACA,QAAA,IAAA,CAAA,EAAA,CAAA,KAAA,EAAA;AAAA,UACA,UAAA,CAAA,cAAA,EAAA,CAAA,uBAAA,EAAA,KAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,SAAA;AAAA,QACA,SAAA,CAAA,KAAA,GAAA,EAAA,CAAA,KAAA,CAAA;AAEA,OAAA;AAAA,MACA,gBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,qBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"backtop2.mjs","sources":["../../../../../../packages/components/backtop/src/backtop.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const backtopProps = {\n visibilityHeight: {\n type: Number,\n default: 200,\n },\n target: {\n type: String,\n default: '',\n },\n right: {\n type: Number,\n default: 40,\n },\n bottom: {\n type: Number,\n default: 40,\n },\n} as const\nexport type BacktopProps = ExtractPropTypes<typeof backtopProps>\n\nexport const backtopEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type BacktopEmits = typeof backtopEmits\n"],"names":[],"mappings":"AAAY,MAAC,YAAY,GAAG;AAC5B,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE;AACU,MAAC,YAAY,GAAG;AAC5B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}
@@ -1,7 +1,7 @@
1
1
  import '../../utils/index.mjs';
2
- import Button from './src/button2.mjs';
3
- import ButtonGroup from './src/button-group2.mjs';
4
- export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './src/button.mjs';
2
+ import Button from './src/button.mjs';
3
+ import ButtonGroup from './src/button-group.mjs';
4
+ export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './src/button2.mjs';
5
5
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
6
6
 
7
7
  const ElButton = withInstall(Button, {
@@ -1,9 +1,34 @@
1
- import { buttonProps } from './button.mjs';
1
+ import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
+ import '../../../tokens/index.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { buttonGroupProps } from './button-group2.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { buttonGroupContextKey } from '../../../tokens/button.mjs';
7
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
2
8
 
3
- const buttonGroupProps = {
4
- size: buttonProps.size,
5
- type: buttonProps.type
9
+ const __default__ = {
10
+ name: "ElButtonGroup"
6
11
  };
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ ...__default__,
14
+ props: buttonGroupProps,
15
+ setup(__props) {
16
+ const props = __props;
17
+ provide(buttonGroupContextKey, reactive({
18
+ size: toRef(props, "size"),
19
+ type: toRef(props, "type")
20
+ }));
21
+ const ns = useNamespace("button");
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createElementBlock("div", {
24
+ class: normalizeClass(`${unref(ns).b("group")}`)
25
+ }, [
26
+ renderSlot(_ctx.$slots, "default")
27
+ ], 2);
28
+ };
29
+ }
30
+ });
31
+ var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/button/src/button-group.vue"]]);
7
32
 
8
- export { buttonGroupProps };
33
+ export { ButtonGroup as default };
9
34
  //# sourceMappingURL=button-group.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.mjs","sources":["../../../../../../packages/components/button/src/button-group.ts"],"sourcesContent":["import { buttonProps } from './button'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type buttonGroup from './button-group.vue'\n\nexport const buttonGroupProps = {\n size: buttonProps.size,\n type: buttonProps.type,\n} as const\nexport type ButtonGroupProps = ExtractPropTypes<typeof buttonGroupProps>\n\nexport type ButtonGroupInstance = InstanceType<typeof buttonGroup>\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG;AAChC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB;;;;"}
1
+ {"version":3,"file":"button-group.mjs","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { provide, reactive, toRef } from 'vue'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\n\ndefineOptions({\n name: 'ElButtonGroup',\n})\nconst props = defineProps(buttonGroupProps)\nprovide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n)\nconst ns = useNamespace('button')\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAA,OAAA,CACA,uBACA,QAAA,CAAA;AAAA,MACA,IAAA,EAAA,KAAA,CAAA,KAAA,EAAA,MAAA,CAAA;AAAA,MACA,IAAA,EAAA,KAAA,CAAA,KAAA,EAAA,MAAA,CAAA;AAAA,KACA,CACA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;;;;;;;;;;;;;;"}
@@ -1,34 +1,9 @@
1
- import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
- import '../../../tokens/index.mjs';
3
- import '../../../hooks/index.mjs';
4
- import { buttonGroupProps } from './button-group.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { buttonGroupContextKey } from '../../../tokens/button.mjs';
7
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
1
+ import { buttonProps } from './button2.mjs';
8
2
 
9
- const __default__ = {
10
- name: "ElButtonGroup"
3
+ const buttonGroupProps = {
4
+ size: buttonProps.size,
5
+ type: buttonProps.type
11
6
  };
12
- const _sfc_main = /* @__PURE__ */ defineComponent({
13
- ...__default__,
14
- props: buttonGroupProps,
15
- setup(__props) {
16
- const props = __props;
17
- provide(buttonGroupContextKey, reactive({
18
- size: toRef(props, "size"),
19
- type: toRef(props, "type")
20
- }));
21
- const ns = useNamespace("button");
22
- return (_ctx, _cache) => {
23
- return openBlock(), createElementBlock("div", {
24
- class: normalizeClass(`${unref(ns).b("group")}`)
25
- }, [
26
- renderSlot(_ctx.$slots, "default")
27
- ], 2);
28
- };
29
- }
30
- });
31
- var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/button/src/button-group.vue"]]);
32
7
 
33
- export { ButtonGroup as default };
8
+ export { buttonGroupProps };
34
9
  //# sourceMappingURL=button-group2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group2.mjs","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { provide, reactive, toRef } from 'vue'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\n\ndefineOptions({\n name: 'ElButtonGroup',\n})\nconst props = defineProps(buttonGroupProps)\nprovide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n)\nconst ns = useNamespace('button')\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAA,OAAA,CACA,uBACA,QAAA,CAAA;AAAA,MACA,IAAA,EAAA,KAAA,CAAA,KAAA,EAAA,MAAA,CAAA;AAAA,MACA,IAAA,EAAA,KAAA,CAAA,KAAA,EAAA,MAAA,CAAA;AAAA,KACA,CACA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-group2.mjs","sources":["../../../../../../packages/components/button/src/button-group.ts"],"sourcesContent":["import { buttonProps } from './button'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type buttonGroup from './button-group.vue'\n\nexport const buttonGroupProps = {\n size: buttonProps.size,\n type: buttonProps.type,\n} as const\nexport type ButtonGroupProps = ExtractPropTypes<typeof buttonGroupProps>\n\nexport type ButtonGroupInstance = InstanceType<typeof buttonGroup>\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG;AAChC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB;;;;"}
@@ -1,57 +1,112 @@
1
+ import { defineComponent, useSlots, inject, computed, ref, Text, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderSlot, createBlock, withCtx, resolveDynamicComponent, createCommentVNode } from 'vue';
2
+ import { ElIcon } from '../../icon/index.mjs';
1
3
  import '../../../hooks/index.mjs';
2
- import '../../../utils/index.mjs';
3
- import { Loading } from '@element-plus/icons-vue';
4
- import { buildProps } from '../../../utils/vue/props.mjs';
5
- import { useSizeProp } from '../../../hooks/use-common-props/index.mjs';
6
- import { iconPropType } from '../../../utils/vue/icon.mjs';
4
+ import '../../../tokens/index.mjs';
5
+ import { buttonProps, buttonEmits } from './button2.mjs';
6
+ import { useButtonCustomStyle } from './button-custom.mjs';
7
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
+ import { buttonGroupContextKey } from '../../../tokens/button.mjs';
9
+ import { useGlobalConfig } from '../../../hooks/use-global-config/index.mjs';
10
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { useFormItem } from '../../../hooks/use-form-item/index.mjs';
12
+ import { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
7
13
 
8
- const buttonTypes = [
9
- "default",
10
- "primary",
11
- "success",
12
- "warning",
13
- "info",
14
- "danger",
15
- "text",
16
- ""
17
- ];
18
- const buttonNativeTypes = ["button", "submit", "reset"];
19
- const buttonProps = buildProps({
20
- size: useSizeProp,
21
- disabled: Boolean,
22
- type: {
23
- type: String,
24
- values: buttonTypes,
25
- default: ""
26
- },
27
- icon: {
28
- type: iconPropType,
29
- default: ""
30
- },
31
- nativeType: {
32
- type: String,
33
- values: buttonNativeTypes,
34
- default: "button"
35
- },
36
- loading: Boolean,
37
- loadingIcon: {
38
- type: iconPropType,
39
- default: () => Loading
40
- },
41
- plain: Boolean,
42
- autofocus: Boolean,
43
- round: Boolean,
44
- circle: Boolean,
45
- color: String,
46
- dark: Boolean,
47
- autoInsertSpace: {
48
- type: Boolean,
49
- default: void 0
14
+ const _hoisted_1 = ["disabled", "autofocus", "type"];
15
+ const __default__ = {
16
+ name: "ElButton"
17
+ };
18
+ const _sfc_main = /* @__PURE__ */ defineComponent({
19
+ ...__default__,
20
+ props: buttonProps,
21
+ emits: buttonEmits,
22
+ setup(__props, { expose, emit }) {
23
+ const props = __props;
24
+ const slots = useSlots();
25
+ const buttonGroupContext = inject(buttonGroupContextKey, void 0);
26
+ const globalConfig = useGlobalConfig("button");
27
+ const ns = useNamespace("button");
28
+ const { form } = useFormItem();
29
+ const _size = useSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
30
+ const _disabled = useDisabled();
31
+ const _ref = ref();
32
+ const _type = computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
33
+ const autoInsertSpace = computed(() => {
34
+ var _a, _b, _c;
35
+ return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
36
+ });
37
+ const shouldAddSpace = computed(() => {
38
+ var _a;
39
+ const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
40
+ if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
41
+ const slot = defaultSlot[0];
42
+ if ((slot == null ? void 0 : slot.type) === Text) {
43
+ const text = slot.children;
44
+ return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
45
+ }
46
+ }
47
+ return false;
48
+ });
49
+ const buttonStyle = useButtonCustomStyle(props);
50
+ const handleClick = (evt) => {
51
+ if (props.nativeType === "reset") {
52
+ form == null ? void 0 : form.resetFields();
53
+ }
54
+ emit("click", evt);
55
+ };
56
+ expose({
57
+ ref: _ref,
58
+ size: _size,
59
+ type: _type,
60
+ disabled: _disabled,
61
+ shouldAddSpace
62
+ });
63
+ return (_ctx, _cache) => {
64
+ return openBlock(), createElementBlock("button", {
65
+ ref_key: "_ref",
66
+ ref: _ref,
67
+ class: normalizeClass([
68
+ unref(ns).b(),
69
+ unref(ns).m(unref(_type)),
70
+ unref(ns).m(unref(_size)),
71
+ unref(ns).is("disabled", unref(_disabled)),
72
+ unref(ns).is("loading", _ctx.loading),
73
+ unref(ns).is("plain", _ctx.plain),
74
+ unref(ns).is("round", _ctx.round),
75
+ unref(ns).is("circle", _ctx.circle)
76
+ ]),
77
+ disabled: unref(_disabled) || _ctx.loading,
78
+ autofocus: _ctx.autofocus,
79
+ type: _ctx.nativeType,
80
+ style: normalizeStyle(unref(buttonStyle)),
81
+ onClick: handleClick
82
+ }, [
83
+ _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
84
+ _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
85
+ key: 1,
86
+ class: normalizeClass(unref(ns).is("loading"))
87
+ }, {
88
+ default: withCtx(() => [
89
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
90
+ ]),
91
+ _: 1
92
+ }, 8, ["class"]))
93
+ ], 2112)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
94
+ default: withCtx(() => [
95
+ _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
96
+ ]),
97
+ _: 3
98
+ })) : createCommentVNode("v-if", true),
99
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
100
+ key: 2,
101
+ class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
102
+ }, [
103
+ renderSlot(_ctx.$slots, "default")
104
+ ], 2)) : createCommentVNode("v-if", true)
105
+ ], 14, _hoisted_1);
106
+ };
50
107
  }
51
108
  });
52
- const buttonEmits = {
53
- click: (evt) => evt instanceof MouseEvent
54
- };
109
+ var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/button/src/button.vue"]]);
55
110
 
56
- export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes };
111
+ export { Button as default };
57
112
  //# sourceMappingURL=button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\nimport { buildProps, iconPropType } from '@element-plus/utils'\nimport { Loading } from '@element-plus/icons-vue'\nimport type { ExtractPropTypes } from 'vue'\nimport type button from './button.vue'\n\nexport const buttonTypes = [\n 'default',\n 'primary',\n 'success',\n 'warning',\n 'info',\n 'danger',\n 'text',\n '',\n] as const\nexport const buttonNativeTypes = ['button', 'submit', 'reset'] as const\n\nexport const buttonProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n type: {\n type: String,\n values: buttonTypes,\n default: '',\n },\n icon: {\n type: iconPropType,\n default: '',\n },\n nativeType: {\n type: String,\n values: buttonNativeTypes,\n default: 'button',\n },\n loading: Boolean,\n loadingIcon: {\n type: iconPropType,\n default: () => Loading,\n },\n plain: Boolean,\n autofocus: Boolean,\n round: Boolean,\n circle: Boolean,\n color: String,\n dark: Boolean,\n autoInsertSpace: {\n type: Boolean,\n default: undefined,\n },\n} as const)\nexport const buttonEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\nexport type ButtonEmits = typeof buttonEmits\n\nexport type ButtonType = ButtonProps['type']\nexport type ButtonNativeType = ButtonProps['nativeType']\n\nexport type ButtonInstance = InstanceType<typeof button>\n\nexport interface ButtonConfigContext {\n autoInsertSpace?: boolean\n}\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,WAAW,GAAG;AAC3B,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,EAAE;AACJ,EAAE;AACU,MAAC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;AACnD,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,WAAW;AACvB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,iBAAiB;AAC7B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,MAAM,OAAO;AAC1B,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}
1
+ {"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\" />\n <el-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </el-icon>\n </template>\n <el-icon v-else-if=\"icon || $slots.icon\">\n <component :is=\"icon\" v-if=\"icon\" />\n <slot v-else name=\"icon\" />\n </el-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Text, computed, inject, ref, useSlots } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useDisabled,\n useFormItem,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { buttonEmits, buttonProps } from './button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'ElButton',\n})\n\nconst props = defineProps(buttonProps)\nconst emit = defineEmits(buttonEmits)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst { form } = useFormItem()\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children as string\n return /^\\p{Unified_Ideograph}{2}$/u.test(text.trim())\n }\n }\n return false\n})\n\nconst buttonStyle = useButtonCustomStyle(props)\n\nconst handleClick = (evt: MouseEvent) => {\n if (props.nativeType === 'reset') {\n form?.resetFields()\n }\n emit('click', evt)\n}\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0DA,IAAA,MAAA,QAAA,QAAA,EAAA,CAAA;AAEA,IAAA,MAAA,kBAAA,GAAA,MAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,GAAA,gBAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,SAAA,WAAA,EAAA,CAAA;AACA,IAAA,MAAA,QAAA,OAAA,CAAA,QAAA,CAAA,MAAA,kBAAA,QAAA,GAAA,KAAA,CAAA,GAAA,kBAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,WAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,EAAA,CAAA;AAEA,IAAA,MAAA,QAAA,QAAA,CAAA,MAAA,MAAA,IAAA,KAAA,kBAAA,WAAA,KAAA,CAAA,GAAA,kBAAA,CAAA,IAAA,CAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAA,SACA,MAAA;AAIA,MAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AACA,MAAA,OAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,qBAAA,KAAA,IAAA,GAAA,EAAA,GAAA,CAAA,EAAA,GAAA,YAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,eAAA,KAAA,IAAA,GAAA,EAAA,GAAA,KAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,QAAA,CAAA,MAAA;AACA,MAAA,IAAA,EAAA,CAAA;AACA,MAAA,MAAA,WAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,MAAA,IAAA,eAAA,CAAA,KAAA,IAAA,CAAA,WAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,WAAA,CAAA,MAAA,MAAA,CAAA,EAAA;AAAA,QACA,MAAA,IAAA,GAAA,WAAA,CAAA,CAAA,CAAA,CAAA;AAAA,QACA,IAAA,CAAA,IAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,IAAA,CAAA,IAAA,MAAA,IAAA,EAAA;AACA,UAAA,MAAA,IAAA,GAAA,IAAA,CAAA,QAAA,CAAA;AAAA,UACA,OAAA,6BAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,CAAA,CAAA;AAEA,SAAA;AAEA,OAAA;AACA,MAAA,OAAA;AACA,KAAA,CAAA,CAAA;AAAA,IACA,MAAA,WAAA,GAAA,oBAAA,CAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,CAAA,GAAA,KAAA;AAAA,MACA,IAAA,KAAA,CAAA,UAAA,KAAA,OAAA,EAAA;AAEA,QAAA,IAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,IAAA,CAAA,WAAA,EAAA,CAAA;AAAA,OAEA;AAAA,MAEA,IAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA;AAAA,KAAA,CAEA;AAAA,IAAA,MAEA,CAAA;AAAA,MAEA,GAAA,EAAA,IAAA;AAAA,MACA,IAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}