element-ps 2.0.21 → 2.0.22

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 (338) hide show
  1. package/dist/index.full.js +1 -56
  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 +1 -56
  7. package/es/components/alert/index.mjs +2 -2
  8. package/es/components/alert/src/alert.mjs +83 -33
  9. package/es/components/alert/src/alert.mjs.map +1 -1
  10. package/es/components/alert/src/alert2.mjs +33 -83
  11. package/es/components/alert/src/alert2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.mjs +2 -2
  13. package/es/components/autocomplete/src/autocomplete.mjs +58 -94
  14. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  15. package/es/components/autocomplete/src/autocomplete2.mjs +94 -58
  16. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  17. package/es/components/avatar/index.mjs +2 -2
  18. package/es/components/avatar/src/avatar.mjs +61 -29
  19. package/es/components/avatar/src/avatar.mjs.map +1 -1
  20. package/es/components/avatar/src/avatar2.mjs +29 -61
  21. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  22. package/es/components/badge/index.mjs +2 -2
  23. package/es/components/badge/src/badge.mjs +17 -54
  24. package/es/components/badge/src/badge.mjs.map +1 -1
  25. package/es/components/badge/src/badge2.mjs +54 -17
  26. package/es/components/badge/src/badge2.mjs.map +1 -1
  27. package/es/components/button/index.mjs +2 -2
  28. package/es/components/button/src/button-group.mjs +1 -1
  29. package/es/components/button/src/button.mjs +96 -48
  30. package/es/components/button/src/button.mjs.map +1 -1
  31. package/es/components/button/src/button2.mjs +48 -96
  32. package/es/components/button/src/button2.mjs.map +1 -1
  33. package/es/components/card/index.mjs +2 -2
  34. package/es/components/card/src/card.mjs +15 -35
  35. package/es/components/card/src/card.mjs.map +1 -1
  36. package/es/components/card/src/card2.mjs +35 -15
  37. package/es/components/card/src/card2.mjs.map +1 -1
  38. package/es/components/cascader/src/index.mjs +1 -1
  39. package/es/components/cascader-panel/src/config.mjs +1 -1
  40. package/es/components/cascader-panel/src/index.mjs +1 -1
  41. package/es/components/cascader-panel/src/menu.mjs +1 -1
  42. package/es/components/cascader-panel/src/node.mjs +120 -200
  43. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  44. package/es/components/cascader-panel/src/node2.mjs +200 -120
  45. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  46. package/es/components/cascader-panel/src/store.mjs +1 -1
  47. package/es/components/collapse/index.mjs +2 -2
  48. package/es/components/collapse/src/collapse.mjs +61 -14
  49. package/es/components/collapse/src/collapse.mjs.map +1 -1
  50. package/es/components/collapse/src/collapse2.mjs +14 -61
  51. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  52. package/es/components/collection/index.mjs +1 -1
  53. package/es/components/collection/src/collection.mjs +10 -30
  54. package/es/components/collection/src/collection.mjs.map +1 -1
  55. package/es/components/collection/src/collection2.mjs +30 -10
  56. package/es/components/collection/src/collection2.mjs.map +1 -1
  57. package/es/components/divider/index.mjs +2 -2
  58. package/es/components/divider/src/divider.mjs +17 -34
  59. package/es/components/divider/src/divider.mjs.map +1 -1
  60. package/es/components/divider/src/divider2.mjs +34 -17
  61. package/es/components/divider/src/divider2.mjs.map +1 -1
  62. package/es/components/drawer/index.mjs +2 -2
  63. package/es/components/drawer/src/drawer.mjs +23 -117
  64. package/es/components/drawer/src/drawer.mjs.map +1 -1
  65. package/es/components/drawer/src/drawer2.mjs +117 -23
  66. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  67. package/es/components/dropdown/src/dropdown.mjs +2 -2
  68. package/es/components/empty/index.mjs +2 -2
  69. package/es/components/empty/src/empty.mjs +56 -11
  70. package/es/components/empty/src/empty.mjs.map +1 -1
  71. package/es/components/empty/src/empty2.mjs +11 -56
  72. package/es/components/empty/src/empty2.mjs.map +1 -1
  73. package/es/components/image/index.mjs +2 -2
  74. package/es/components/image/src/image.mjs +46 -170
  75. package/es/components/image/src/image.mjs.map +1 -1
  76. package/es/components/image/src/image2.mjs +170 -46
  77. package/es/components/image/src/image2.mjs.map +1 -1
  78. package/es/components/index.mjs +25 -25
  79. package/es/components/input/index.mjs +2 -2
  80. package/es/components/input/src/input.mjs +85 -296
  81. package/es/components/input/src/input.mjs.map +1 -1
  82. package/es/components/input/src/input2.mjs +296 -85
  83. package/es/components/input/src/input2.mjs.map +1 -1
  84. package/es/components/popconfirm/src/popconfirm2.mjs +2 -2
  85. package/es/components/popover/src/popover.mjs +1 -1
  86. package/es/components/popper/index.mjs +2 -2
  87. package/es/components/popper/src/content.mjs +52 -64
  88. package/es/components/popper/src/content.mjs.map +1 -1
  89. package/es/components/popper/src/content2.mjs +64 -52
  90. package/es/components/popper/src/content2.mjs.map +1 -1
  91. package/es/components/rate/index.mjs +2 -2
  92. package/es/components/rate/src/rate.mjs +169 -84
  93. package/es/components/rate/src/rate.mjs.map +1 -1
  94. package/es/components/rate/src/rate2.mjs +84 -169
  95. package/es/components/rate/src/rate2.mjs.map +1 -1
  96. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  97. package/es/components/scrollbar/index.mjs +2 -2
  98. package/es/components/scrollbar/src/scrollbar.mjs +42 -112
  99. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  100. package/es/components/scrollbar/src/scrollbar2.mjs +112 -42
  101. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  102. package/es/components/select/src/select.mjs +1 -1
  103. package/es/components/select-v2/src/defaults.mjs +1 -1
  104. package/es/components/select-v2/src/select.mjs +1 -12
  105. package/es/components/select-v2/src/select.mjs.map +1 -1
  106. package/es/components/select-v2/src/useSelect.mjs +1 -25
  107. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  108. package/es/components/skeleton/index.mjs +2 -2
  109. package/es/components/skeleton/src/skeleton.mjs +49 -22
  110. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  111. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  112. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  113. package/es/components/tabs/index.mjs +3 -3
  114. package/es/components/tabs/src/tab-bar.mjs +7 -76
  115. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  116. package/es/components/tabs/src/tab-bar2.mjs +76 -7
  117. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  118. package/es/components/tabs/src/tab-nav.mjs +1 -1
  119. package/es/components/tabs/src/tab-pane.mjs +60 -14
  120. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  121. package/es/components/tabs/src/tab-pane2.mjs +14 -60
  122. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  123. package/es/components/timeline/index.mjs +2 -2
  124. package/es/components/timeline/src/timeline-item.mjs +73 -39
  125. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  126. package/es/components/timeline/src/timeline-item2.mjs +39 -73
  127. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  128. package/es/components/tooltip/index.mjs +2 -2
  129. package/es/components/tooltip/src/tooltip.mjs +64 -51
  130. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  131. package/es/components/tooltip/src/tooltip2.mjs +51 -64
  132. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  133. package/es/components/tooltip/src/trigger.mjs +1 -1
  134. package/es/components/tooltip-v2/index.mjs +5 -5
  135. package/es/components/tooltip-v2/src/arrow.mjs +38 -22
  136. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  137. package/es/components/tooltip-v2/src/arrow2.mjs +22 -38
  138. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  139. package/es/components/tooltip-v2/src/root.mjs +17 -81
  140. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  141. package/es/components/tooltip-v2/src/root2.mjs +81 -17
  142. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  143. package/es/components/tooltip-v2/src/tooltip.mjs +74 -21
  144. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  145. package/es/components/tooltip-v2/src/tooltip2.mjs +21 -74
  146. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  147. package/es/components/tooltip-v2/src/trigger.mjs +11 -89
  148. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  149. package/es/components/tooltip-v2/src/trigger2.mjs +89 -11
  150. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  151. package/es/components/upload/index.mjs +5 -5
  152. package/es/components/upload/src/upload-content.mjs +15 -46
  153. package/es/components/upload/src/upload-content.mjs.map +1 -1
  154. package/es/components/upload/src/upload-content2.mjs +46 -15
  155. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  156. package/es/components/upload/src/upload-dragger.mjs +11 -32
  157. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  158. package/es/components/upload/src/upload-dragger2.mjs +32 -11
  159. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  160. package/es/components/upload/src/upload-list.mjs +26 -155
  161. package/es/components/upload/src/upload-list.mjs.map +1 -1
  162. package/es/components/upload/src/upload-list2.mjs +155 -26
  163. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  164. package/es/components/upload/src/upload.mjs +106 -99
  165. package/es/components/upload/src/upload.mjs.map +1 -1
  166. package/es/components/upload/src/upload2.mjs +99 -106
  167. package/es/components/upload/src/upload2.mjs.map +1 -1
  168. package/es/index.mjs +25 -25
  169. package/lib/components/alert/index.js +2 -2
  170. package/lib/components/alert/src/alert.js +82 -33
  171. package/lib/components/alert/src/alert.js.map +1 -1
  172. package/lib/components/alert/src/alert2.js +33 -82
  173. package/lib/components/alert/src/alert2.js.map +1 -1
  174. package/lib/components/autocomplete/index.js +2 -2
  175. package/lib/components/autocomplete/src/autocomplete.js +58 -94
  176. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  177. package/lib/components/autocomplete/src/autocomplete2.js +94 -58
  178. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  179. package/lib/components/avatar/index.js +2 -2
  180. package/lib/components/avatar/src/avatar.js +61 -29
  181. package/lib/components/avatar/src/avatar.js.map +1 -1
  182. package/lib/components/avatar/src/avatar2.js +29 -61
  183. package/lib/components/avatar/src/avatar2.js.map +1 -1
  184. package/lib/components/badge/index.js +2 -2
  185. package/lib/components/badge/src/badge.js +17 -54
  186. package/lib/components/badge/src/badge.js.map +1 -1
  187. package/lib/components/badge/src/badge2.js +54 -17
  188. package/lib/components/badge/src/badge2.js.map +1 -1
  189. package/lib/components/button/index.js +2 -2
  190. package/lib/components/button/src/button-group.js +1 -1
  191. package/lib/components/button/src/button.js +96 -50
  192. package/lib/components/button/src/button.js.map +1 -1
  193. package/lib/components/button/src/button2.js +50 -96
  194. package/lib/components/button/src/button2.js.map +1 -1
  195. package/lib/components/card/index.js +2 -2
  196. package/lib/components/card/src/card.js +15 -35
  197. package/lib/components/card/src/card.js.map +1 -1
  198. package/lib/components/card/src/card2.js +35 -15
  199. package/lib/components/card/src/card2.js.map +1 -1
  200. package/lib/components/cascader/src/index.js +1 -1
  201. package/lib/components/cascader-panel/src/config.js +1 -1
  202. package/lib/components/cascader-panel/src/index.js +1 -1
  203. package/lib/components/cascader-panel/src/menu.js +1 -1
  204. package/lib/components/cascader-panel/src/node.js +121 -200
  205. package/lib/components/cascader-panel/src/node.js.map +1 -1
  206. package/lib/components/cascader-panel/src/node2.js +200 -121
  207. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  208. package/lib/components/cascader-panel/src/store.js +1 -1
  209. package/lib/components/collapse/index.js +2 -2
  210. package/lib/components/collapse/src/collapse.js +61 -16
  211. package/lib/components/collapse/src/collapse.js.map +1 -1
  212. package/lib/components/collapse/src/collapse2.js +16 -61
  213. package/lib/components/collapse/src/collapse2.js.map +1 -1
  214. package/lib/components/collection/index.js +1 -1
  215. package/lib/components/collection/src/collection.js +9 -30
  216. package/lib/components/collection/src/collection.js.map +1 -1
  217. package/lib/components/collection/src/collection2.js +30 -9
  218. package/lib/components/collection/src/collection2.js.map +1 -1
  219. package/lib/components/divider/index.js +2 -2
  220. package/lib/components/divider/src/divider.js +17 -34
  221. package/lib/components/divider/src/divider.js.map +1 -1
  222. package/lib/components/divider/src/divider2.js +34 -17
  223. package/lib/components/divider/src/divider2.js.map +1 -1
  224. package/lib/components/drawer/index.js +2 -2
  225. package/lib/components/drawer/src/drawer.js +23 -117
  226. package/lib/components/drawer/src/drawer.js.map +1 -1
  227. package/lib/components/drawer/src/drawer2.js +117 -23
  228. package/lib/components/drawer/src/drawer2.js.map +1 -1
  229. package/lib/components/dropdown/src/dropdown.js +2 -2
  230. package/lib/components/empty/index.js +2 -2
  231. package/lib/components/empty/src/empty.js +56 -11
  232. package/lib/components/empty/src/empty.js.map +1 -1
  233. package/lib/components/empty/src/empty2.js +11 -56
  234. package/lib/components/empty/src/empty2.js.map +1 -1
  235. package/lib/components/image/index.js +2 -2
  236. package/lib/components/image/src/image.js +46 -170
  237. package/lib/components/image/src/image.js.map +1 -1
  238. package/lib/components/image/src/image2.js +170 -46
  239. package/lib/components/image/src/image2.js.map +1 -1
  240. package/lib/components/index.js +25 -25
  241. package/lib/components/input/index.js +2 -2
  242. package/lib/components/input/src/input.js +84 -295
  243. package/lib/components/input/src/input.js.map +1 -1
  244. package/lib/components/input/src/input2.js +295 -84
  245. package/lib/components/input/src/input2.js.map +1 -1
  246. package/lib/components/popconfirm/src/popconfirm2.js +2 -2
  247. package/lib/components/popover/src/popover.js +1 -1
  248. package/lib/components/popper/index.js +2 -2
  249. package/lib/components/popper/src/content.js +52 -65
  250. package/lib/components/popper/src/content.js.map +1 -1
  251. package/lib/components/popper/src/content2.js +65 -52
  252. package/lib/components/popper/src/content2.js.map +1 -1
  253. package/lib/components/rate/index.js +2 -2
  254. package/lib/components/rate/src/rate.js +169 -84
  255. package/lib/components/rate/src/rate.js.map +1 -1
  256. package/lib/components/rate/src/rate2.js +84 -169
  257. package/lib/components/rate/src/rate2.js.map +1 -1
  258. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  259. package/lib/components/scrollbar/index.js +2 -2
  260. package/lib/components/scrollbar/src/scrollbar.js +42 -112
  261. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  262. package/lib/components/scrollbar/src/scrollbar2.js +112 -42
  263. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  264. package/lib/components/select/src/select.js +1 -1
  265. package/lib/components/select-v2/src/defaults.js +1 -1
  266. package/lib/components/select-v2/src/select.js +0 -11
  267. package/lib/components/select-v2/src/select.js.map +1 -1
  268. package/lib/components/select-v2/src/useSelect.js +1 -25
  269. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  270. package/lib/components/skeleton/index.js +2 -2
  271. package/lib/components/skeleton/src/skeleton.js +49 -22
  272. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  273. package/lib/components/skeleton/src/skeleton2.js +22 -49
  274. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  275. package/lib/components/tabs/index.js +3 -3
  276. package/lib/components/tabs/src/tab-bar.js +7 -76
  277. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  278. package/lib/components/tabs/src/tab-bar2.js +76 -7
  279. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  280. package/lib/components/tabs/src/tab-nav.js +1 -1
  281. package/lib/components/tabs/src/tab-pane.js +60 -14
  282. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  283. package/lib/components/tabs/src/tab-pane2.js +14 -60
  284. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  285. package/lib/components/timeline/index.js +2 -2
  286. package/lib/components/timeline/src/timeline-item.js +73 -39
  287. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  288. package/lib/components/timeline/src/timeline-item2.js +39 -73
  289. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  290. package/lib/components/tooltip/index.js +2 -2
  291. package/lib/components/tooltip/src/tooltip.js +65 -50
  292. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  293. package/lib/components/tooltip/src/tooltip2.js +50 -65
  294. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  295. package/lib/components/tooltip/src/trigger.js +1 -1
  296. package/lib/components/tooltip-v2/index.js +5 -5
  297. package/lib/components/tooltip-v2/src/arrow.js +38 -23
  298. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  299. package/lib/components/tooltip-v2/src/arrow2.js +23 -38
  300. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  301. package/lib/components/tooltip-v2/src/root.js +17 -81
  302. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  303. package/lib/components/tooltip-v2/src/root2.js +81 -17
  304. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  305. package/lib/components/tooltip-v2/src/tooltip.js +74 -21
  306. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  307. package/lib/components/tooltip-v2/src/tooltip2.js +21 -74
  308. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  309. package/lib/components/tooltip-v2/src/trigger.js +11 -89
  310. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  311. package/lib/components/tooltip-v2/src/trigger2.js +89 -11
  312. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  313. package/lib/components/upload/index.js +5 -5
  314. package/lib/components/upload/src/upload-content.js +15 -46
  315. package/lib/components/upload/src/upload-content.js.map +1 -1
  316. package/lib/components/upload/src/upload-content2.js +46 -15
  317. package/lib/components/upload/src/upload-content2.js.map +1 -1
  318. package/lib/components/upload/src/upload-dragger.js +12 -32
  319. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  320. package/lib/components/upload/src/upload-dragger2.js +32 -12
  321. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  322. package/lib/components/upload/src/upload-list.js +27 -155
  323. package/lib/components/upload/src/upload-list.js.map +1 -1
  324. package/lib/components/upload/src/upload-list2.js +155 -27
  325. package/lib/components/upload/src/upload-list2.js.map +1 -1
  326. package/lib/components/upload/src/upload.js +109 -99
  327. package/lib/components/upload/src/upload.js.map +1 -1
  328. package/lib/components/upload/src/upload2.js +99 -109
  329. package/lib/components/upload/src/upload2.js.map +1 -1
  330. package/lib/index.js +25 -25
  331. package/package.json +1 -1
  332. package/web-types.json +1 -1
  333. package/es/components/select-v2/src/util.d.ts +0 -2
  334. package/es/components/select-v2/src/util.mjs +0 -26
  335. package/es/components/select-v2/src/util.mjs.map +0 -1
  336. package/lib/components/select-v2/src/util.d.ts +0 -2
  337. package/lib/components/select-v2/src/util.js +0 -30
  338. package/lib/components/select-v2/src/util.js.map +0 -1
@@ -1,175 +1,90 @@
1
- import { defineComponent, inject, ref, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderList, createVNode, withCtx, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';
1
+ import { StarFilled, Star } from '@element-plus/icons-vue';
2
2
  import '../../../utils/index.mjs';
3
- import '../../../tokens/index.mjs';
4
- import { PsIcon } from '../../icon/index.mjs';
5
- import '../../../hooks/index.mjs';
6
- import { rateProps } from './rate.mjs';
7
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
- import { isObject, isArray } from '@vue/shared';
9
- import { formContextKey } from '../../../tokens/form.mjs';
10
- import { useSize } from '../../../hooks/use-common-props/index.mjs';
11
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
12
- import { hasClass } from '../../../utils/dom/style.mjs';
3
+ import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
4
+ import { mutable } from '../../../utils/typescript.mjs';
5
+ import { iconPropType } from '../../../utils/vue/icon.mjs';
6
+ import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
13
7
 
14
- const _hoisted_1 = ["aria-valuenow", "aria-valuetext", "aria-valuemax"];
15
- const __default__ = {
16
- name: "PsRate"
17
- };
18
- const _sfc_main = /* @__PURE__ */ defineComponent({
19
- ...__default__,
20
- props: rateProps,
21
- setup(__props, { expose }) {
22
- const props = __props;
23
- function getValueFromMap(value, map) {
24
- const isExcludedObject = (val) => isObject(val);
25
- const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
26
- const val = map[key];
27
- const excluded = isExcludedObject(val) ? val.excluded : false;
28
- return excluded ? value < key : value <= key;
29
- }).sort((a, b) => a - b);
30
- const matchedValue = map[matchedKeys[0]];
31
- return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
32
- }
33
- const formContext = inject(formContextKey, void 0);
34
- const rateSize = useSize();
35
- const ns = useNamespace("rate");
36
- const currentValue = ref(props.modelValue);
37
- const hoverIndex = ref(-1);
38
- const pointerAtLeftHalf = ref(true);
39
- const rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)]);
40
- const rateDisabled = computed(() => props.disabled || (formContext == null ? void 0 : formContext.disabled));
41
- const rateStyles = computed(() => {
42
- return {
43
- "--el-rate-void-color": props.voidColor,
44
- "--el-rate-disabled-void-color": props.disabledVoidColor,
45
- "--el-rate-fill-color": activeColor.value
46
- };
47
- });
48
- const text = computed(() => {
49
- let result = "";
50
- if (props.showScore) {
51
- result = props.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`);
52
- } else if (props.showText) {
53
- result = props.texts[Math.ceil(currentValue.value) - 1];
54
- }
55
- return result;
56
- });
57
- const valueDecimal = computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
58
- const colorMap = computed(() => isArray(props.colors) ? {
59
- [props.lowThreshold]: props.colors[0],
60
- [props.highThreshold]: { value: props.colors[1], excluded: true },
61
- [props.max]: props.colors[2]
62
- } : props.colors);
63
- const activeColor = computed(() => {
64
- const color = getValueFromMap(currentValue.value, colorMap.value);
65
- return isObject(color) ? "" : color;
66
- });
67
- const decimalStyle = computed(() => {
68
- let width = "";
69
- if (rateDisabled.value) {
70
- width = `${valueDecimal.value}%`;
71
- } else if (props.allowHalf) {
72
- width = "50%";
73
- }
74
- return {
75
- color: activeColor.value,
76
- width
77
- };
78
- });
79
- const componentMap = computed(() => isArray(props.icons) ? {
80
- [props.lowThreshold]: props.icons[0],
81
- [props.highThreshold]: {
82
- value: props.icons[1],
83
- excluded: true
84
- },
85
- [props.max]: props.icons[2]
86
- } : props.icons);
87
- const decimalIconComponent = computed(() => getValueFromMap(props.modelValue, componentMap.value));
88
- const voidComponent = computed(() => rateDisabled.value ? props.disabledVoidIcon : props.voidIcon);
89
- const activeComponent = computed(() => getValueFromMap(currentValue.value, componentMap.value));
90
- const iconComponents = computed(() => {
91
- const result = Array.from({ length: props.max });
92
- const threshold = currentValue.value;
93
- result.fill(activeComponent.value, 0, threshold);
94
- result.fill(voidComponent.value, threshold, props.max);
95
- return result;
96
- });
97
- function showDecimalIcon(item) {
98
- const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
99
- const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
100
- return showWhenDisabled || showWhenAllowHalf;
101
- }
102
- function setCurrentValue(value, event) {
103
- if (rateDisabled.value) {
104
- return;
105
- }
106
- if (props.allowHalf) {
107
- let target = event.target;
108
- if (hasClass(target, ns.e("item"))) {
109
- target = target.querySelector(`.${ns.e("icon")}`);
110
- }
111
- if (target.clientWidth === 0 || hasClass(target, ns.e("decimal"))) {
112
- target = target.parentNode;
113
- }
114
- pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
115
- currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value;
116
- } else {
117
- currentValue.value = value;
118
- }
119
- hoverIndex.value = value;
120
- }
121
- expose({
122
- setCurrentValue
123
- });
124
- return (_ctx, _cache) => {
125
- return openBlock(), createElementBlock("div", {
126
- class: normalizeClass([unref(rateClasses), unref(ns).is("disabled", unref(rateDisabled))]),
127
- role: "slider",
128
- "aria-valuenow": currentValue.value,
129
- "aria-valuetext": unref(text),
130
- "aria-valuemin": "0",
131
- "aria-valuemax": _ctx.max,
132
- tabindex: "0",
133
- style: normalizeStyle(unref(rateStyles))
134
- }, [
135
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.max, (item, key) => {
136
- return openBlock(), createElementBlock("span", {
137
- key,
138
- class: normalizeClass(unref(ns).e("item"))
139
- }, [
140
- createVNode(unref(PsIcon), {
141
- class: normalizeClass([
142
- unref(ns).e("icon"),
143
- { hover: hoverIndex.value === item },
144
- unref(ns).is("active", item <= currentValue.value)
145
- ])
146
- }, {
147
- default: withCtx(() => [
148
- !showDecimalIcon(item) ? (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponents)[item - 1]), { key: 0 })) : createCommentVNode("v-if", true),
149
- showDecimalIcon(item) ? (openBlock(), createBlock(unref(PsIcon), {
150
- key: 1,
151
- style: normalizeStyle(unref(decimalStyle)),
152
- class: normalizeClass([unref(ns).e("icon"), unref(ns).e("decimal")])
153
- }, {
154
- default: withCtx(() => [
155
- (openBlock(), createBlock(resolveDynamicComponent(unref(decimalIconComponent))))
156
- ]),
157
- _: 1
158
- }, 8, ["style", "class"])) : createCommentVNode("v-if", true)
159
- ]),
160
- _: 2
161
- }, 1032, ["class"])
162
- ], 2);
163
- }), 128)),
164
- _ctx.showText || _ctx.showScore ? (openBlock(), createElementBlock("span", {
165
- key: 0,
166
- class: normalizeClass(unref(ns).e("text"))
167
- }, toDisplayString(unref(text)), 3)) : createCommentVNode("v-if", true)
168
- ], 14, _hoisted_1);
169
- };
8
+ const rateProps = buildProps({
9
+ modelValue: {
10
+ type: Number,
11
+ default: 0
12
+ },
13
+ lowThreshold: {
14
+ type: Number,
15
+ default: 2
16
+ },
17
+ highThreshold: {
18
+ type: Number,
19
+ default: 4
20
+ },
21
+ max: {
22
+ type: Number,
23
+ default: 5
24
+ },
25
+ colors: {
26
+ type: definePropType([Array, Object]),
27
+ default: () => mutable(["", "", ""])
28
+ },
29
+ voidColor: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ disabledVoidColor: {
34
+ type: String,
35
+ default: ""
36
+ },
37
+ icons: {
38
+ type: definePropType([Array, Object]),
39
+ default: () => [StarFilled, StarFilled, StarFilled]
40
+ },
41
+ voidIcon: {
42
+ type: iconPropType,
43
+ default: () => Star
44
+ },
45
+ disabledVoidIcon: {
46
+ type: iconPropType,
47
+ default: () => StarFilled
48
+ },
49
+ disabled: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ allowHalf: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ showText: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ showScore: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ textColor: {
66
+ type: String,
67
+ default: ""
68
+ },
69
+ texts: {
70
+ type: definePropType(Array),
71
+ default: () => mutable([
72
+ "Extremely bad",
73
+ "Disappointed",
74
+ "Fair",
75
+ "Satisfied",
76
+ "Surprise"
77
+ ])
78
+ },
79
+ scoreTemplate: {
80
+ type: String,
81
+ default: "{value}"
82
+ },
83
+ size: {
84
+ type: String,
85
+ validator: isValidComponentSize
170
86
  }
171
87
  });
172
- var Rate = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/rate/src/rate.vue"]]);
173
88
 
174
- export { Rate as default };
89
+ export { rateProps };
175
90
  //# sourceMappingURL=rate2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rate2.mjs","sources":["../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"[rateClasses, ns.is('disabled', rateDisabled)]\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n :style=\"rateStyles\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n :class=\"ns.e('item')\"\n >\n <ps-icon\n :class=\"[\n ns.e('icon'),\n { hover: hoverIndex === item },\n ns.is('active', item <= currentValue),\n ]\"\n >\n <component\n :is=\"iconComponents[item - 1]\"\n v-if=\"!showDecimalIcon(item)\"\n />\n <ps-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n :class=\"[ns.e('icon'), ns.e('decimal')]\"\n >\n <component :is=\"decimalIconComponent\" />\n </ps-icon>\n </ps-icon>\n </span>\n <span v-if=\"showText || showScore\" :class=\"ns.e('text')\">\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { type CSSProperties, computed, inject, ref } from 'vue'\nimport { EVENT_CODE, UPDATE_MODEL_EVENT } from '@element-ps/constants'\nimport { hasClass, isArray, isObject } from '@element-ps/utils'\nimport { formContextKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { useNamespace, useSize } from '@element-ps/hooks'\nimport { rateProps } from './rate'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\ndefineOptions({\n name: 'PsRate',\n})\n\nconst props = defineProps(rateProps)\n\nconst formContext = inject(formContextKey, undefined)\nconst rateSize = useSize()\nconst ns = useNamespace('rate')\n\nconst currentValue = ref(props.modelValue)\nconst hoverIndex = ref(-1)\nconst pointerAtLeftHalf = ref(true)\n\nconst rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)])\nconst rateDisabled = computed(() => props.disabled || formContext?.disabled)\nconst rateStyles = computed(() => {\n return {\n '--el-rate-void-color': props.voidColor,\n '--el-rate-disabled-void-color': props.disabledVoidColor,\n '--el-rate-fill-color': activeColor.value,\n } as CSSProperties\n})\n\nconst text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n})\nconst valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n)\nconst colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n)\nconst activeColor = computed(() => {\n const color = getValueFromMap(currentValue.value, colorMap.value)\n // {value: '', excluded: true} returned\n return isObject(color) ? '' : color\n})\nconst decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n})\nconst componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n)\nconst decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n)\nconst voidComponent = computed(() =>\n rateDisabled.value ? props.disabledVoidIcon : props.voidIcon\n)\nconst activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n)\nconst iconComponents = computed(() => {\n const result = Array.from({ length: props.max })\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n})\n\nfunction showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n}\n\nfunction setCurrentValue(value: number, event: MouseEvent) {\n if (rateDisabled.value) {\n return\n }\n if (props.allowHalf) {\n // TODO: use cache via computed https://github.com/element-ps/element-ps/pull/5456#discussion_r786472092\n let target = event.target as HTMLElement\n if (hasClass(target, ns.e('item'))) {\n target = target.querySelector(`.${ns.e('icon')}`)!\n }\n if (target.clientWidth === 0 || hasClass(target, ns.e('decimal'))) {\n target = target.parentNode as HTMLElement\n }\n pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth\n currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value\n } else {\n currentValue.value = value\n }\n hoverIndex.value = value\n}\n\ndefineExpose({\n /** @description set current value */\n setCurrentValue,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAA,SAAA,eAAA,CACA,OACA,GACA,EAAA;AACA,MAAA,MAAA,gBAAA,GAAA,CACA,GACA,KAAA,QAAA,CAAA,GAAA,CAAA,CAAA;AAEA,MAAA,MAAA,WAAA,GAAA,MAAA,CAAA,IAAA,CAAA,GAAA,CACA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CACA,CAAA,MAAA,CAAA,CAAA,GAAA,KAAA;AACA,QAAA,MAAA,MAAA,GAAA,CAAA,GAAA,CAAA,CAAA;AACA,QAAA,MAAA,QAAA,GAAA,gBAAA,CAAA,GAAA,CAAA,GAAA,IAAA,QAAA,GAAA,KAAA,CAAA;AACA,QAAA,OAAA,QAAA,GAAA,KAAA,GAAA,GAAA,GAAA,KAAA,IAAA,GAAA,CAAA;AAAA,OACA,CACA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,CAAA,KAAA,IAAA,CAAA,CAAA,CAAA;AACA,MAAA,MAAA,YAAA,GAAA,IAAA,WAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,MAAA,OAAA,gBAAA,CAAA,YAAA,CAAA,IAAA,YAAA,CAAA,KAAA,IAAA,YAAA,CAAA;AAAA,KACA;AAQA,IAAA,MAAA,WAAA,G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KAAA,CAAA;AAAA,KACA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,eAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rate2.mjs","sources":["../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons-vue'\nimport { UPDATE_MODEL_EVENT } from '@element-ps/constants'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isValidComponentSize,\n mutable,\n} from '@element-ps/utils'\nimport type { ComponentSize } from '@element-ps/constants'\nimport type { Component, ExtractPropTypes, PropType } from 'vue'\nimport type Rate from './rate.vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['', '', ''] as const),\n },\n voidColor: {\n type: String,\n default: '',\n },\n disabledVoidColor: {\n type: String,\n default: '',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: iconPropType,\n default: () => Star,\n },\n disabledVoidIcon: {\n type: iconPropType,\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '',\n },\n texts: {\n type: definePropType<string[]>(Array),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport type RateInstance = InstanceType<typeof Rate>\n"],"names":[],"mappings":";;;;;;;AAQY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACxC,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;AACvD,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,MAAM,IAAI;AACvB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,MAAM,UAAU;AAC7B,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3B,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,MAAM;AACZ,MAAM,WAAW;AACjB,MAAM,UAAU;AAChB,KAAK,CAAC;AACN,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
1
  import '../../../utils/index.mjs';
2
2
  import '../../collection/index.mjs';
3
3
  import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
4
- import { createCollectionWithScope } from '../../collection/src/collection.mjs';
4
+ import { createCollectionWithScope } from '../../collection/src/collection2.mjs';
5
5
 
6
6
  const rovingFocusGroupProps = buildProps({
7
7
  style: { type: definePropType([String, Array, Object]) },
@@ -1,7 +1,7 @@
1
1
  import '../../utils/index.mjs';
2
- import Scrollbar from './src/scrollbar.mjs';
2
+ import Scrollbar from './src/scrollbar2.mjs';
3
3
  export { BAR_MAP, renderThumbStyle } from './src/util.mjs';
4
- export { scrollbarProps } from './src/scrollbar2.mjs';
4
+ export { scrollbarProps } from './src/scrollbar.mjs';
5
5
  export { thumbProps } from './src/thumb2.mjs';
6
6
  import { withInstall } from '../../utils/vue/install.mjs';
7
7
 
@@ -1,119 +1,49 @@
1
- import { defineComponent, ref, computed, provide, reactive, onMounted, nextTick, onUpdated, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createBlock, resolveDynamicComponent, withCtx, renderSlot, createCommentVNode } from 'vue';
2
1
  import '../../../utils/index.mjs';
3
- import '../../../tokens/index.mjs';
4
- import '../../../hooks/index.mjs';
5
- import Bar from './bar.mjs';
6
- import { scrollbarProps } from './scrollbar2.mjs';
7
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
9
- import { addUnit } from '../../../utils/dom/style.mjs';
10
- import { scrollbarContextKey } from '../../../tokens/scrollbar.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
11
3
 
12
- const _sfc_main = defineComponent({
13
- name: "PsScrollbar",
14
- components: {
15
- Bar
4
+ const scrollbarProps = buildProps({
5
+ height: {
6
+ type: [String, Number],
7
+ default: ""
16
8
  },
17
- props: scrollbarProps,
18
- setup(props) {
19
- const ns = useNamespace("scrollbar");
20
- const scrollbar$ = ref();
21
- const wrap$ = ref();
22
- const resize$ = ref();
23
- const sizeWidth = ref("0");
24
- const sizeHeight = ref("0");
25
- const barRef = ref();
26
- const moveX = ref(0);
27
- const moveY = ref(0);
28
- const ratioY = ref(1);
29
- const ratioX = ref(1);
30
- const GAP = 4;
31
- const style = computed(() => {
32
- const style2 = {};
33
- if (props.height)
34
- style2.height = addUnit(props.height);
35
- if (props.maxHeight)
36
- style2.maxHeight = addUnit(props.maxHeight);
37
- return [props.wrapStyle, style2];
38
- });
39
- const update = () => {
40
- if (!wrap$.value)
41
- return;
42
- const offsetHeight = wrap$.value.offsetHeight - GAP;
43
- const offsetWidth = wrap$.value.offsetWidth - GAP;
44
- const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight;
45
- const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth;
46
- const height = Math.max(originalHeight, props.minSize);
47
- const width = Math.max(originalWidth, props.minSize);
48
- ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
49
- ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
50
- sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
51
- sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
52
- };
53
- provide(scrollbarContextKey, reactive({
54
- scrollbarElement: scrollbar$,
55
- wrapElement: wrap$
56
- }));
57
- onMounted(() => {
58
- if (!props.native)
59
- nextTick(() => update());
60
- });
61
- onUpdated(() => update());
62
- return {
63
- ns,
64
- scrollbar$,
65
- wrap$,
66
- resize$,
67
- barRef,
68
- moveX,
69
- moveY,
70
- ratioX,
71
- ratioY,
72
- sizeWidth,
73
- sizeHeight,
74
- style,
75
- update
76
- };
9
+ maxHeight: {
10
+ type: [String, Number],
11
+ default: ""
12
+ },
13
+ native: {
14
+ type: Boolean,
15
+ default: false
16
+ },
17
+ wrapStyle: {
18
+ type: definePropType([String, Object, Array]),
19
+ default: ""
20
+ },
21
+ wrapClass: {
22
+ type: [String, Array],
23
+ default: ""
24
+ },
25
+ viewClass: {
26
+ type: [String, Array],
27
+ default: ""
28
+ },
29
+ viewStyle: {
30
+ type: [String, Array, Object],
31
+ default: ""
32
+ },
33
+ noresize: Boolean,
34
+ tag: {
35
+ type: String,
36
+ default: "div"
37
+ },
38
+ always: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ minSize: {
43
+ type: Number,
44
+ default: 20
77
45
  }
78
46
  });
79
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
80
- const _component_bar = resolveComponent("bar");
81
- return openBlock(), createElementBlock("div", {
82
- ref: "scrollbar$",
83
- class: normalizeClass(_ctx.ns.b())
84
- }, [
85
- createElementVNode("div", {
86
- ref: "wrap$",
87
- class: normalizeClass([
88
- _ctx.wrapClass,
89
- _ctx.ns.e("wrap"),
90
- { [_ctx.ns.em("wrap", "hidden-default")]: !_ctx.native }
91
- ]),
92
- style: normalizeStyle(_ctx.style)
93
- }, [
94
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
95
- ref: "resize$",
96
- class: normalizeClass([_ctx.ns.e("view"), _ctx.viewClass]),
97
- style: normalizeStyle(_ctx.viewStyle)
98
- }, {
99
- default: withCtx(() => [
100
- renderSlot(_ctx.$slots, "default")
101
- ]),
102
- _: 3
103
- }, 8, ["class", "style"]))
104
- ], 6),
105
- !_ctx.native ? (openBlock(), createBlock(_component_bar, {
106
- key: 0,
107
- ref: "barRef",
108
- height: _ctx.sizeHeight,
109
- width: _ctx.sizeWidth,
110
- always: _ctx.always,
111
- "ratio-x": _ctx.ratioX,
112
- "ratio-y": _ctx.ratioY
113
- }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
114
- ], 2);
115
- }
116
- var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/scrollbar.vue"]]);
117
47
 
118
- export { Scrollbar as default };
48
+ export { scrollbarProps };
119
49
  //# sourceMappingURL=scrollbar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbar$\" :class=\"ns.b()\">\n <div\n ref=\"wrap$\"\n :class=\"[\n wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !native },\n ]\"\n :style=\"style\"\n >\n <component\n :is=\"tag\"\n ref=\"resize$\"\n :class=\"[ns.e('view'), viewClass]\"\n :style=\"viewStyle\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar\n ref=\"barRef\"\n :height=\"sizeHeight\"\n :width=\"sizeWidth\"\n :always=\"always\"\n :ratio-x=\"ratioX\"\n :ratio-y=\"ratioY\"\n />\n </template>\n </div>\n</template>\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n reactive,\n ref,\n} from 'vue'\nimport { addUnit } from '@element-ps/utils'\nimport { scrollbarContextKey } from '@element-ps/tokens'\nimport { useNamespace } from '@element-ps/hooks'\nimport Bar from './bar.vue'\n\nimport { scrollbarProps } from './scrollbar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nexport default defineComponent({\n name: 'PsScrollbar',\n components: {\n Bar,\n },\n props: scrollbarProps,\n\n setup(props) {\n const ns = useNamespace('scrollbar')\n\n const scrollbar$ = ref<HTMLDivElement>()\n const wrap$ = ref<HTMLDivElement>()\n const resize$ = ref<HTMLElement>()\n\n const sizeWidth = ref('0')\n const sizeHeight = ref('0')\n const barRef = ref()\n const moveX = ref(0)\n const moveY = ref(0)\n const ratioY = ref(1)\n const ratioX = ref(1)\n const GAP = 4 // top 2 + bottom 2 of bar instance\n\n const style = computed<StyleValue>(() => {\n const style: CSSProperties = {}\n if (props.height) style.height = addUnit(props.height)\n if (props.maxHeight) style.maxHeight = addUnit(props.maxHeight)\n return [props.wrapStyle, style]\n })\n\n const update = () => {\n if (!wrap$.value) return\n const offsetHeight = wrap$.value.offsetHeight - GAP\n const offsetWidth = wrap$.value.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n ratioY.value =\n originalHeight /\n (offsetHeight - originalHeight) /\n (height / (offsetHeight - height))\n ratioX.value =\n originalWidth /\n (offsetWidth - originalWidth) /\n (width / (offsetWidth - width))\n\n sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ''\n sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ''\n }\n\n provide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbar$,\n wrapElement: wrap$,\n })\n )\n\n onMounted(() => {\n if (!props.native) nextTick(() => update())\n })\n onUpdated(() => update())\n\n return {\n ns,\n scrollbar$,\n wrap$,\n resize$,\n barRef,\n moveX,\n moveY,\n ratioX,\n ratioY,\n sizeWidth,\n sizeHeight,\n style,\n update,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_openBlock","_createBlock","_resolveDynamicComponent","_renderSlot","_createCommentVNode"],"mappings":";;;;;;;;;;;AAmDA,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,aAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,GAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA,cAAA;AAAA,EAEP,MAAM,KAAO,EAAA;AACX,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,aAAa,GAAoB,EAAA,CAAA;AACvC,IAAA,MAAM,QAAQ,GAAoB,EAAA,CAAA;AAClC,IAAA,MAAM,UAAU,GAAiB,EAAA,CAAA;AAEjC,IAAM,MAAA,SAAA,GAAY,IAAI,GAAG,CAAA,CAAA;AACzB,IAAM,MAAA,UAAA,GAAa,IAAI,GAAG,CAAA,CAAA;AAC1B,IAAA,MAAM,SAAS,GAAI,EAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,MAAA,GAAS,IAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAA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bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-ps/utils'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\n\nexport const scrollbarProps = buildProps({\n height: {\n type: [String, Number],\n default: '',\n },\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n native: {\n type: Boolean,\n default: false,\n },\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n viewClass: {\n type: [String, Array],\n default: '',\n },\n viewStyle: {\n type: [String, Array, Object],\n default: '',\n },\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n tag: {\n type: String,\n default: 'div',\n },\n always: {\n type: Boolean,\n default: false,\n },\n minSize: {\n type: Number,\n default: 20,\n },\n} as const)\n\nexport type ScrollbarProps = ExtractPropTypes<typeof scrollbarProps>\n"],"names":[],"mappings":";;;AACY,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;A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