element-ps 2.0.32 → 2.0.35

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 (326) hide show
  1. package/dist/index.full.js +74 -406
  2. package/dist/index.full.min.js +5 -5
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +5 -5
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +74 -406
  7. package/es/components/alert/index.mjs +2 -2
  8. package/es/components/alert/src/alert.mjs +33 -83
  9. package/es/components/alert/src/alert.mjs.map +1 -1
  10. package/es/components/alert/src/alert2.mjs +83 -33
  11. package/es/components/alert/src/alert2.mjs.map +1 -1
  12. package/es/components/backtop/index.mjs +2 -2
  13. package/es/components/backtop/src/backtop.mjs +59 -18
  14. package/es/components/backtop/src/backtop.mjs.map +1 -1
  15. package/es/components/backtop/src/backtop2.mjs +18 -59
  16. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  17. package/es/components/breadcrumb/index.mjs +2 -2
  18. package/es/components/breadcrumb/src/breadcrumb-item.mjs +46 -11
  19. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  20. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -46
  21. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  22. package/es/components/button/index.mjs +3 -3
  23. package/es/components/button/src/button-group.mjs +30 -5
  24. package/es/components/button/src/button-group.mjs.map +1 -1
  25. package/es/components/button/src/button-group2.mjs +5 -30
  26. package/es/components/button/src/button-group2.mjs.map +1 -1
  27. package/es/components/button/src/button.mjs +96 -48
  28. package/es/components/button/src/button.mjs.map +1 -1
  29. package/es/components/button/src/button2.mjs +48 -96
  30. package/es/components/button/src/button2.mjs.map +1 -1
  31. package/es/components/calendar/index.mjs +2 -2
  32. package/es/components/calendar/src/calendar.mjs +9 -188
  33. package/es/components/calendar/src/calendar.mjs.map +1 -1
  34. package/es/components/calendar/src/calendar2.mjs +188 -9
  35. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  36. package/es/components/cascader/src/index.mjs +1 -1
  37. package/es/components/empty/index.mjs +2 -2
  38. package/es/components/empty/src/empty.mjs +11 -56
  39. package/es/components/empty/src/empty.mjs.map +1 -1
  40. package/es/components/empty/src/empty2.mjs +56 -11
  41. package/es/components/empty/src/empty2.mjs.map +1 -1
  42. package/es/components/form/src/form-item2.mjs +2 -8
  43. package/es/components/form/src/form-item2.mjs.map +1 -1
  44. package/es/components/image/index.mjs +2 -2
  45. package/es/components/image/src/image.mjs +50 -127
  46. package/es/components/image/src/image.mjs.map +1 -1
  47. package/es/components/image/src/image2.mjs +127 -50
  48. package/es/components/image/src/image2.mjs.map +1 -1
  49. package/es/components/image-viewer/index.mjs +2 -2
  50. package/es/components/image-viewer/src/image-viewer.mjs +210 -31
  51. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  52. package/es/components/image-viewer/src/image-viewer2.mjs +31 -210
  53. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  54. package/es/components/index.mjs +24 -24
  55. package/es/components/input/index.mjs +2 -2
  56. package/es/components/input/src/input.mjs +295 -85
  57. package/es/components/input/src/input.mjs.map +1 -1
  58. package/es/components/input/src/input2.mjs +85 -295
  59. package/es/components/input/src/input2.mjs.map +1 -1
  60. package/es/components/link/index.mjs +2 -2
  61. package/es/components/link/src/link.mjs +19 -43
  62. package/es/components/link/src/link.mjs.map +1 -1
  63. package/es/components/link/src/link2.mjs +43 -19
  64. package/es/components/link/src/link2.mjs.map +1 -1
  65. package/es/components/menu/index.d.ts +6 -16
  66. package/es/components/menu/src/menu-item.mjs +8 -35
  67. package/es/components/menu/src/menu-item.mjs.map +1 -1
  68. package/es/components/menu/src/menu-item.vue.d.ts +10 -15
  69. package/es/components/menu/src/menu.mjs +2 -1
  70. package/es/components/menu/src/menu.mjs.map +1 -1
  71. package/es/components/popconfirm/index.mjs +2 -2
  72. package/es/components/popconfirm/src/popconfirm.mjs +20 -53
  73. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  74. package/es/components/popconfirm/src/popconfirm2.mjs +53 -20
  75. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  76. package/es/components/popper/index.mjs +2 -2
  77. package/es/components/popper/src/arrow.mjs +31 -7
  78. package/es/components/popper/src/arrow.mjs.map +1 -1
  79. package/es/components/popper/src/arrow2.mjs +7 -31
  80. package/es/components/popper/src/arrow2.mjs.map +1 -1
  81. package/es/components/radio/index.mjs +6 -6
  82. package/es/components/radio/src/radio-button.mjs +9 -80
  83. package/es/components/radio/src/radio-button.mjs.map +1 -1
  84. package/es/components/radio/src/radio-button2.mjs +80 -9
  85. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  86. package/es/components/radio/src/radio-group.mjs +37 -18
  87. package/es/components/radio/src/radio-group.mjs.map +1 -1
  88. package/es/components/radio/src/radio-group2.mjs +18 -37
  89. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  90. package/es/components/radio/src/radio.mjs +74 -62
  91. package/es/components/radio/src/radio.mjs.map +1 -1
  92. package/es/components/radio/src/radio2.mjs +62 -74
  93. package/es/components/radio/src/radio2.mjs.map +1 -1
  94. package/es/components/rate/index.mjs +2 -2
  95. package/es/components/rate/src/rate.mjs +84 -169
  96. package/es/components/rate/src/rate.mjs.map +1 -1
  97. package/es/components/rate/src/rate2.mjs +169 -84
  98. package/es/components/rate/src/rate2.mjs.map +1 -1
  99. package/es/components/result/index.mjs +2 -2
  100. package/es/components/result/src/result.mjs +73 -28
  101. package/es/components/result/src/result.mjs.map +1 -1
  102. package/es/components/result/src/result2.mjs +28 -73
  103. package/es/components/result/src/result2.mjs.map +1 -1
  104. package/es/components/roving-focus-group/index.mjs +3 -3
  105. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  106. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
  107. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  108. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
  109. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  110. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  111. package/es/components/scrollbar/index.mjs +2 -2
  112. package/es/components/scrollbar/src/bar.mjs +22 -35
  113. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  114. package/es/components/scrollbar/src/bar2.mjs +35 -22
  115. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  116. package/es/components/scrollbar/src/scrollbar.mjs +112 -42
  117. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  118. package/es/components/scrollbar/src/scrollbar2.mjs +42 -112
  119. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  120. package/es/components/select/src/select.mjs +1 -1
  121. package/es/components/skeleton/index.mjs +2 -2
  122. package/es/components/skeleton/src/skeleton.mjs +49 -22
  123. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  124. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  125. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  126. package/es/components/switch/index.mjs +2 -2
  127. package/es/components/switch/src/switch.mjs +81 -176
  128. package/es/components/switch/src/switch.mjs.map +1 -1
  129. package/es/components/switch/src/switch2.mjs +176 -81
  130. package/es/components/switch/src/switch2.mjs.map +1 -1
  131. package/es/components/tabs/index.mjs +2 -2
  132. package/es/components/tabs/src/tab-pane.mjs +61 -15
  133. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  134. package/es/components/tabs/src/tab-pane2.mjs +15 -61
  135. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  136. package/es/components/tag/index.mjs +2 -2
  137. package/es/components/tag/src/tag.mjs +33 -81
  138. package/es/components/tag/src/tag.mjs.map +1 -1
  139. package/es/components/tag/src/tag2.mjs +81 -33
  140. package/es/components/tag/src/tag2.mjs.map +1 -1
  141. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  142. package/es/components/tooltip-v2/index.mjs +5 -5
  143. package/es/components/tooltip-v2/src/content.mjs +113 -50
  144. package/es/components/tooltip-v2/src/content.mjs.map +1 -1
  145. package/es/components/tooltip-v2/src/content2.mjs +50 -113
  146. package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
  147. package/es/components/tooltip-v2/src/root.mjs +17 -81
  148. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  149. package/es/components/tooltip-v2/src/root2.mjs +81 -17
  150. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  151. package/es/components/tooltip-v2/src/tooltip.mjs +21 -74
  152. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  153. package/es/components/tooltip-v2/src/tooltip2.mjs +74 -21
  154. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  155. package/es/components/tooltip-v2/src/trigger.mjs +11 -89
  156. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  157. package/es/components/tooltip-v2/src/trigger2.mjs +89 -11
  158. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  159. package/es/components/upload/index.mjs +1 -1
  160. package/es/components/upload/src/upload-list.mjs +155 -26
  161. package/es/components/upload/src/upload-list.mjs.map +1 -1
  162. package/es/components/upload/src/upload-list2.mjs +26 -155
  163. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  164. package/es/components/upload/src/upload2.mjs +1 -1
  165. package/es/index.mjs +24 -24
  166. package/lib/components/alert/index.js +2 -2
  167. package/lib/components/alert/src/alert.js +33 -82
  168. package/lib/components/alert/src/alert.js.map +1 -1
  169. package/lib/components/alert/src/alert2.js +82 -33
  170. package/lib/components/alert/src/alert2.js.map +1 -1
  171. package/lib/components/backtop/index.js +2 -2
  172. package/lib/components/backtop/src/backtop.js +59 -18
  173. package/lib/components/backtop/src/backtop.js.map +1 -1
  174. package/lib/components/backtop/src/backtop2.js +18 -59
  175. package/lib/components/backtop/src/backtop2.js.map +1 -1
  176. package/lib/components/breadcrumb/index.js +2 -2
  177. package/lib/components/breadcrumb/src/breadcrumb-item.js +46 -11
  178. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  179. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -46
  180. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  181. package/lib/components/button/index.js +3 -3
  182. package/lib/components/button/src/button-group.js +30 -5
  183. package/lib/components/button/src/button-group.js.map +1 -1
  184. package/lib/components/button/src/button-group2.js +5 -30
  185. package/lib/components/button/src/button-group2.js.map +1 -1
  186. package/lib/components/button/src/button.js +96 -50
  187. package/lib/components/button/src/button.js.map +1 -1
  188. package/lib/components/button/src/button2.js +50 -96
  189. package/lib/components/button/src/button2.js.map +1 -1
  190. package/lib/components/calendar/index.js +2 -2
  191. package/lib/components/calendar/src/calendar.js +9 -192
  192. package/lib/components/calendar/src/calendar.js.map +1 -1
  193. package/lib/components/calendar/src/calendar2.js +192 -9
  194. package/lib/components/calendar/src/calendar2.js.map +1 -1
  195. package/lib/components/cascader/src/index.js +1 -1
  196. package/lib/components/empty/index.js +2 -2
  197. package/lib/components/empty/src/empty.js +11 -56
  198. package/lib/components/empty/src/empty.js.map +1 -1
  199. package/lib/components/empty/src/empty2.js +56 -11
  200. package/lib/components/empty/src/empty2.js.map +1 -1
  201. package/lib/components/form/src/form-item2.js +1 -7
  202. package/lib/components/form/src/form-item2.js.map +1 -1
  203. package/lib/components/image/index.js +2 -2
  204. package/lib/components/image/src/image.js +50 -127
  205. package/lib/components/image/src/image.js.map +1 -1
  206. package/lib/components/image/src/image2.js +127 -50
  207. package/lib/components/image/src/image2.js.map +1 -1
  208. package/lib/components/image-viewer/index.js +2 -2
  209. package/lib/components/image-viewer/src/image-viewer.js +210 -31
  210. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  211. package/lib/components/image-viewer/src/image-viewer2.js +31 -210
  212. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  213. package/lib/components/index.js +24 -24
  214. package/lib/components/input/index.js +2 -2
  215. package/lib/components/input/src/input.js +294 -84
  216. package/lib/components/input/src/input.js.map +1 -1
  217. package/lib/components/input/src/input2.js +84 -294
  218. package/lib/components/input/src/input2.js.map +1 -1
  219. package/lib/components/link/index.js +2 -2
  220. package/lib/components/link/src/link.js +19 -43
  221. package/lib/components/link/src/link.js.map +1 -1
  222. package/lib/components/link/src/link2.js +43 -19
  223. package/lib/components/link/src/link2.js.map +1 -1
  224. package/lib/components/menu/index.d.ts +6 -16
  225. package/lib/components/menu/src/menu-item.js +6 -33
  226. package/lib/components/menu/src/menu-item.js.map +1 -1
  227. package/lib/components/menu/src/menu-item.vue.d.ts +10 -15
  228. package/lib/components/menu/src/menu.js +2 -1
  229. package/lib/components/menu/src/menu.js.map +1 -1
  230. package/lib/components/popconfirm/index.js +2 -2
  231. package/lib/components/popconfirm/src/popconfirm.js +20 -53
  232. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  233. package/lib/components/popconfirm/src/popconfirm2.js +53 -20
  234. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  235. package/lib/components/popper/index.js +2 -2
  236. package/lib/components/popper/src/arrow.js +31 -7
  237. package/lib/components/popper/src/arrow.js.map +1 -1
  238. package/lib/components/popper/src/arrow2.js +7 -31
  239. package/lib/components/popper/src/arrow2.js.map +1 -1
  240. package/lib/components/radio/index.js +6 -6
  241. package/lib/components/radio/src/radio-button.js +9 -80
  242. package/lib/components/radio/src/radio-button.js.map +1 -1
  243. package/lib/components/radio/src/radio-button2.js +80 -9
  244. package/lib/components/radio/src/radio-button2.js.map +1 -1
  245. package/lib/components/radio/src/radio-group.js +37 -18
  246. package/lib/components/radio/src/radio-group.js.map +1 -1
  247. package/lib/components/radio/src/radio-group2.js +18 -37
  248. package/lib/components/radio/src/radio-group2.js.map +1 -1
  249. package/lib/components/radio/src/radio.js +73 -64
  250. package/lib/components/radio/src/radio.js.map +1 -1
  251. package/lib/components/radio/src/radio2.js +64 -73
  252. package/lib/components/radio/src/radio2.js.map +1 -1
  253. package/lib/components/rate/index.js +2 -2
  254. package/lib/components/rate/src/rate.js +84 -169
  255. package/lib/components/rate/src/rate.js.map +1 -1
  256. package/lib/components/rate/src/rate2.js +169 -84
  257. package/lib/components/rate/src/rate2.js.map +1 -1
  258. package/lib/components/result/index.js +2 -2
  259. package/lib/components/result/src/result.js +73 -30
  260. package/lib/components/result/src/result.js.map +1 -1
  261. package/lib/components/result/src/result2.js +30 -73
  262. package/lib/components/result/src/result2.js.map +1 -1
  263. package/lib/components/roving-focus-group/index.js +2 -2
  264. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  265. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
  266. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  267. package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
  268. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  269. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  270. package/lib/components/scrollbar/index.js +2 -2
  271. package/lib/components/scrollbar/src/bar.js +22 -35
  272. package/lib/components/scrollbar/src/bar.js.map +1 -1
  273. package/lib/components/scrollbar/src/bar2.js +35 -22
  274. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  275. package/lib/components/scrollbar/src/scrollbar.js +112 -42
  276. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  277. package/lib/components/scrollbar/src/scrollbar2.js +42 -112
  278. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  279. package/lib/components/select/src/select.js +1 -1
  280. package/lib/components/skeleton/index.js +2 -2
  281. package/lib/components/skeleton/src/skeleton.js +49 -22
  282. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  283. package/lib/components/skeleton/src/skeleton2.js +22 -49
  284. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  285. package/lib/components/switch/index.js +2 -2
  286. package/lib/components/switch/src/switch.js +81 -176
  287. package/lib/components/switch/src/switch.js.map +1 -1
  288. package/lib/components/switch/src/switch2.js +176 -81
  289. package/lib/components/switch/src/switch2.js.map +1 -1
  290. package/lib/components/tabs/index.js +2 -2
  291. package/lib/components/tabs/src/tab-pane.js +61 -15
  292. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  293. package/lib/components/tabs/src/tab-pane2.js +15 -61
  294. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  295. package/lib/components/tag/index.js +2 -2
  296. package/lib/components/tag/src/tag.js +34 -81
  297. package/lib/components/tag/src/tag.js.map +1 -1
  298. package/lib/components/tag/src/tag2.js +81 -34
  299. package/lib/components/tag/src/tag2.js.map +1 -1
  300. package/lib/components/tooltip/src/tooltip2.js +1 -1
  301. package/lib/components/tooltip-v2/index.js +5 -5
  302. package/lib/components/tooltip-v2/src/content.js +113 -50
  303. package/lib/components/tooltip-v2/src/content.js.map +1 -1
  304. package/lib/components/tooltip-v2/src/content2.js +50 -113
  305. package/lib/components/tooltip-v2/src/content2.js.map +1 -1
  306. package/lib/components/tooltip-v2/src/root.js +17 -81
  307. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  308. package/lib/components/tooltip-v2/src/root2.js +81 -17
  309. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  310. package/lib/components/tooltip-v2/src/tooltip.js +21 -74
  311. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  312. package/lib/components/tooltip-v2/src/tooltip2.js +74 -21
  313. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  314. package/lib/components/tooltip-v2/src/trigger.js +11 -89
  315. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  316. package/lib/components/tooltip-v2/src/trigger2.js +89 -11
  317. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  318. package/lib/components/upload/index.js +1 -1
  319. package/lib/components/upload/src/upload-list.js +155 -27
  320. package/lib/components/upload/src/upload-list.js.map +1 -1
  321. package/lib/components/upload/src/upload-list2.js +27 -155
  322. package/lib/components/upload/src/upload-list2.js.map +1 -1
  323. package/lib/components/upload/src/upload2.js +1 -1
  324. package/lib/index.js +24 -24
  325. package/package.json +1 -1
  326. package/web-types.json +1 -1
@@ -1,51 +1,16 @@
1
- import { defineComponent, inject, ref, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, withCtx, resolveDynamicComponent, toDisplayString } from 'vue';
2
- import { PsIcon } from '../../icon/index.mjs';
3
- import '../../../tokens/index.mjs';
4
- import '../../../hooks/index.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { breadcrumbKey } from '../../../tokens/breadcrumb.mjs';
7
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
1
+ import '../../../utils/index.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
8
3
 
9
- const __default__ = {
10
- name: "PsBreadcrumbItem"
11
- };
12
- const _sfc_main = /* @__PURE__ */ defineComponent({
13
- ...__default__,
14
- setup(__props) {
15
- const breadcrumbInjection = inject(breadcrumbKey, {});
16
- const ns = useNamespace("breadcrumb");
17
- const { separator, separatorIcon } = breadcrumbInjection;
18
- const link = ref();
19
- return (_ctx, _cache) => {
20
- return openBlock(), createElementBlock("span", {
21
- class: normalizeClass(unref(ns).e("item"))
22
- }, [
23
- createElementVNode("span", {
24
- ref_key: "link",
25
- ref: link,
26
- class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!_ctx.to)]),
27
- role: "link"
28
- }, [
29
- renderSlot(_ctx.$slots, "default")
30
- ], 2),
31
- unref(separatorIcon) ? (openBlock(), createBlock(unref(PsIcon), {
32
- key: 0,
33
- class: normalizeClass(unref(ns).e("separator"))
34
- }, {
35
- default: withCtx(() => [
36
- (openBlock(), createBlock(resolveDynamicComponent(unref(separatorIcon))))
37
- ]),
38
- _: 1
39
- }, 8, ["class"])) : (openBlock(), createElementBlock("span", {
40
- key: 1,
41
- class: normalizeClass(unref(ns).e("separator")),
42
- role: "presentation"
43
- }, toDisplayString(unref(separator)), 3))
44
- ], 2);
45
- };
4
+ const breadcrumbItemProps = buildProps({
5
+ to: {
6
+ type: definePropType([String, Object]),
7
+ default: ""
8
+ },
9
+ replace: {
10
+ type: Boolean,
11
+ default: false
46
12
  }
47
13
  });
48
- var BreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/breadcrumb/src/breadcrumb-item.vue"]]);
49
14
 
50
- export { BreadcrumbItem as default };
15
+ export { breadcrumbItemProps };
51
16
  //# sourceMappingURL=breadcrumb-item2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb-item2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('item')\">\n <span\n ref=\"link\"\n :class=\"[ns.e('inner'), ns.is('link', !!to)]\"\n role=\"link\"\n >\n <slot />\n </span>\n <ps-icon v-if=\"separatorIcon\" :class=\"ns.e('separator')\">\n <component :is=\"separatorIcon\" />\n </ps-icon>\n <span v-else :class=\"ns.e('separator')\" role=\"presentation\">\n {{ separator }}\n </span>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { inject, ref } from 'vue'\nimport PsIcon from '@element-ps/components/icon'\nimport { breadcrumbKey } from '@element-ps/tokens'\nimport { useNamespace } from '@element-ps/hooks'\nimport type { BreadcrumbProps } from './breadcrumb'\n\ndefineOptions({\n name: 'PsBreadcrumbItem',\n})\n\nconst breadcrumbInjection = inject(breadcrumbKey, {} as BreadcrumbProps)!\n\nconst ns = useNamespace('breadcrumb')\n\nconst { separator, separatorIcon } = breadcrumbInjection\n\nconst link = ref<HTMLSpanElement>()\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BA,IAAA,MAAA,mBAAA,GAAA,MAAA,CAAA,aAAA,EAAA,EAAA,CAAA,CAAA;AAEA,IAAA,MAAA,EAAA,GAAA,aAAA,YAAA,CAAA,CAAA;AAEA,IAAA,MAAA,EAAA,WAAA,aAAA,EAAA,GAAA,mBAAA,CAAA;AAEA,IAAA,MAAA,OAAA,GAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"breadcrumb-item2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport type BreadcrumbItem from './breadcrumb-item.vue'\n\nexport const breadcrumbItemProps = buildProps({\n to: {\n type: definePropType<RouteLocationRaw>([String, Object]),\n default: '',\n },\n replace: {\n type: Boolean,\n default: false,\n },\n} as const)\nexport type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>\n\nexport type BreadcrumbItemInstance = InstanceType<typeof BreadcrumbItem>\n"],"names":[],"mappings":";;;AACY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;"}
@@ -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 { buttonNativeTypes, buttonProps, buttonTypes } from './src/button.mjs';
2
+ import Button from './src/button.mjs';
3
+ import ButtonGroup from './src/button-group.mjs';
4
+ export { buttonNativeTypes, buttonProps, buttonTypes } from './src/button2.mjs';
5
5
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
6
6
 
7
7
  const PsButton = 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: "PsButtonGroup"
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-ps/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-ps/tokens'\nimport { useNamespace } from '@element-ps/hooks'\nimport { buttonGroupProps } from './button-group'\n\ndefineOptions({\n name: 'PsButtonGroup',\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: "PsButtonGroup"
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-ps/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-ps/tokens'\nimport { useNamespace } from '@element-ps/hooks'\nimport { buttonGroupProps } from './button-group'\n\ndefineOptions({\n name: 'PsButtonGroup',\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,54 +1,102 @@
1
+ import { defineComponent, useSlots, inject, computed, ref, Text, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderSlot, createBlock, withCtx, resolveDynamicComponent, createCommentVNode } from 'vue';
2
+ import { PsIcon } 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 } 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 { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
7
12
 
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
13
+ const _hoisted_1 = ["disabled", "autofocus", "type"];
14
+ const __default__ = {
15
+ name: "PsButton"
16
+ };
17
+ const _sfc_main = /* @__PURE__ */ defineComponent({
18
+ ...__default__,
19
+ props: buttonProps,
20
+ setup(__props, { expose }) {
21
+ const props = __props;
22
+ const slots = useSlots();
23
+ const buttonGroupContext = inject(buttonGroupContextKey, void 0);
24
+ const globalConfig = useGlobalConfig("button");
25
+ const ns = useNamespace("button");
26
+ const _size = useSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
27
+ const _disabled = useDisabled();
28
+ const _ref = ref();
29
+ const _type = computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
30
+ const autoInsertSpace = computed(() => {
31
+ var _a, _b, _c;
32
+ return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
33
+ });
34
+ const shouldAddSpace = computed(() => {
35
+ var _a;
36
+ const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
37
+ if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
38
+ const slot = defaultSlot[0];
39
+ if ((slot == null ? void 0 : slot.type) === Text) {
40
+ const text = slot.children;
41
+ return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
42
+ }
43
+ }
44
+ return false;
45
+ });
46
+ const buttonStyle = useButtonCustomStyle(props);
47
+ expose({
48
+ ref: _ref,
49
+ size: _size,
50
+ type: _type,
51
+ disabled: _disabled,
52
+ shouldAddSpace
53
+ });
54
+ return (_ctx, _cache) => {
55
+ return openBlock(), createElementBlock("button", {
56
+ ref_key: "_ref",
57
+ ref: _ref,
58
+ class: normalizeClass([
59
+ unref(ns).b(),
60
+ unref(ns).m(unref(_type)),
61
+ unref(ns).m(unref(_size)),
62
+ unref(ns).is("disabled", unref(_disabled)),
63
+ unref(ns).is("loading", _ctx.loading),
64
+ unref(ns).is("plain", _ctx.plain),
65
+ unref(ns).is("round", _ctx.round),
66
+ unref(ns).is("circle", _ctx.circle)
67
+ ]),
68
+ disabled: unref(_disabled) || _ctx.loading,
69
+ autofocus: _ctx.autofocus,
70
+ type: _ctx.nativeType,
71
+ style: normalizeStyle(unref(buttonStyle))
72
+ }, [
73
+ _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
74
+ _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(PsIcon), {
75
+ key: 1,
76
+ class: normalizeClass(unref(ns).is("loading"))
77
+ }, {
78
+ default: withCtx(() => [
79
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
80
+ ]),
81
+ _: 1
82
+ }, 8, ["class"]))
83
+ ], 2112)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(PsIcon), { key: 1 }, {
84
+ default: withCtx(() => [
85
+ _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
86
+ ]),
87
+ _: 3
88
+ })) : createCommentVNode("v-if", true),
89
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
90
+ key: 2,
91
+ class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
92
+ }, [
93
+ renderSlot(_ctx.$slots, "default")
94
+ ], 2)) : createCommentVNode("v-if", true)
95
+ ], 14, _hoisted_1);
96
+ };
50
97
  }
51
98
  });
99
+ var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/button/src/button.vue"]]);
52
100
 
53
- export { buttonNativeTypes, buttonProps, buttonTypes };
101
+ export { Button as default };
54
102
  //# sourceMappingURL=button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useSizeProp } from '@element-ps/hooks'\nimport { buildProps, iconPropType } from '@element-ps/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)\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\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;;;;"}
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 >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\" />\n <ps-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </ps-icon>\n </template>\n <ps-icon v-else-if=\"icon || $slots.icon\">\n <component :is=\"icon\" v-if=\"icon\" />\n <slot v-else name=\"icon\" />\n </ps-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 { PsIcon } from '@element-ps/components/icon'\nimport {\n useDisabled,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-ps/hooks'\nimport { buttonGroupContextKey } from '@element-ps/tokens'\nimport { buttonProps } from './button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'PsButton',\n})\n\nconst props = defineProps(buttonProps)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\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\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":";;;;;;;;;;;;;;;;;;;;;AAuDA,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,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;AAAA,MAEA,OAAA,KAAA,CAAA;AAAA,KAAA,CAEA,CAAA;AAAA,IAAA,MAEA,WAAA,GAAA,oBAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,MAEA,CAAA;AAAA,MAEA,GAAA,EAAA,IAAA;AAAA,MACA,IAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,102 +1,54 @@
1
- import { defineComponent, useSlots, inject, computed, ref, Text, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderSlot, createBlock, withCtx, resolveDynamicComponent, createCommentVNode } from 'vue';
2
- import { PsIcon } from '../../icon/index.mjs';
3
1
  import '../../../hooks/index.mjs';
4
- import '../../../tokens/index.mjs';
5
- import { buttonProps } from './button.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 { useSize, useDisabled } from '../../../hooks/use-common-props/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';
12
7
 
13
- const _hoisted_1 = ["disabled", "autofocus", "type"];
14
- const __default__ = {
15
- name: "PsButton"
16
- };
17
- const _sfc_main = /* @__PURE__ */ defineComponent({
18
- ...__default__,
19
- props: buttonProps,
20
- setup(__props, { expose }) {
21
- const props = __props;
22
- const slots = useSlots();
23
- const buttonGroupContext = inject(buttonGroupContextKey, void 0);
24
- const globalConfig = useGlobalConfig("button");
25
- const ns = useNamespace("button");
26
- const _size = useSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
27
- const _disabled = useDisabled();
28
- const _ref = ref();
29
- const _type = computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
30
- const autoInsertSpace = computed(() => {
31
- var _a, _b, _c;
32
- return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
33
- });
34
- const shouldAddSpace = computed(() => {
35
- var _a;
36
- const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
37
- if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
38
- const slot = defaultSlot[0];
39
- if ((slot == null ? void 0 : slot.type) === Text) {
40
- const text = slot.children;
41
- return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
42
- }
43
- }
44
- return false;
45
- });
46
- const buttonStyle = useButtonCustomStyle(props);
47
- expose({
48
- ref: _ref,
49
- size: _size,
50
- type: _type,
51
- disabled: _disabled,
52
- shouldAddSpace
53
- });
54
- return (_ctx, _cache) => {
55
- return openBlock(), createElementBlock("button", {
56
- ref_key: "_ref",
57
- ref: _ref,
58
- class: normalizeClass([
59
- unref(ns).b(),
60
- unref(ns).m(unref(_type)),
61
- unref(ns).m(unref(_size)),
62
- unref(ns).is("disabled", unref(_disabled)),
63
- unref(ns).is("loading", _ctx.loading),
64
- unref(ns).is("plain", _ctx.plain),
65
- unref(ns).is("round", _ctx.round),
66
- unref(ns).is("circle", _ctx.circle)
67
- ]),
68
- disabled: unref(_disabled) || _ctx.loading,
69
- autofocus: _ctx.autofocus,
70
- type: _ctx.nativeType,
71
- style: normalizeStyle(unref(buttonStyle))
72
- }, [
73
- _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
74
- _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(PsIcon), {
75
- key: 1,
76
- class: normalizeClass(unref(ns).is("loading"))
77
- }, {
78
- default: withCtx(() => [
79
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
80
- ]),
81
- _: 1
82
- }, 8, ["class"]))
83
- ], 2112)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(PsIcon), { key: 1 }, {
84
- default: withCtx(() => [
85
- _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
86
- ]),
87
- _: 3
88
- })) : createCommentVNode("v-if", true),
89
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
90
- key: 2,
91
- class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
92
- }, [
93
- renderSlot(_ctx.$slots, "default")
94
- ], 2)) : createCommentVNode("v-if", true)
95
- ], 14, _hoisted_1);
96
- };
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
97
50
  }
98
51
  });
99
- var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/button/src/button.vue"]]);
100
52
 
101
- export { Button as default };
53
+ export { buttonNativeTypes, buttonProps, buttonTypes };
102
54
  //# sourceMappingURL=button2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button2.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 >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\" />\n <ps-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </ps-icon>\n </template>\n <ps-icon v-else-if=\"icon || $slots.icon\">\n <component :is=\"icon\" v-if=\"icon\" />\n <slot v-else name=\"icon\" />\n </ps-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 { PsIcon } from '@element-ps/components/icon'\nimport {\n useDisabled,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-ps/hooks'\nimport { buttonGroupContextKey } from '@element-ps/tokens'\nimport { buttonProps } from './button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'PsButton',\n})\n\nconst props = defineProps(buttonProps)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\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\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":";;;;;;;;;;;;;;;;;;;;;AAuDA,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,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;AAAA,MAEA,OAAA,KAAA,CAAA;AAAA,KAAA,CAEA,CAAA;AAAA,IAAA,MAEA,WAAA,GAAA,oBAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,MAEA,CAAA;AAAA,MAEA,GAAA,EAAA,IAAA;AAAA,MACA,IAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useSizeProp } from '@element-ps/hooks'\nimport { buildProps, iconPropType } from '@element-ps/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)\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\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;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Calendar from './src/calendar.mjs';
3
- export { calendarProps } from './src/calendar2.mjs';
2
+ import Calendar from './src/calendar2.mjs';
3
+ export { calendarProps } from './src/calendar.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const PsCalendar = withInstall(Calendar);