element-ps 2.0.16 → 2.0.19

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 (360) hide show
  1. package/dist/index.full.js +7 -42
  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 +7 -42
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +19 -82
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +82 -19
  11. package/es/components/affix/src/affix2.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 +29 -61
  19. package/es/components/avatar/src/avatar.mjs.map +1 -1
  20. package/es/components/avatar/src/avatar2.mjs +61 -29
  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/breadcrumb/index.mjs +4 -4
  28. package/es/components/breadcrumb/src/breadcrumb-item.mjs +46 -11
  29. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  30. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -46
  31. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  32. package/es/components/breadcrumb/src/breadcrumb.mjs +37 -12
  33. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  34. package/es/components/breadcrumb/src/breadcrumb2.mjs +12 -37
  35. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  36. package/es/components/calendar/index.mjs +2 -2
  37. package/es/components/calendar/src/calendar.mjs +9 -188
  38. package/es/components/calendar/src/calendar.mjs.map +1 -1
  39. package/es/components/calendar/src/calendar2.mjs +188 -9
  40. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  41. package/es/components/card/index.mjs +2 -2
  42. package/es/components/card/src/card.mjs +15 -35
  43. package/es/components/card/src/card.mjs.map +1 -1
  44. package/es/components/card/src/card2.mjs +35 -15
  45. package/es/components/card/src/card2.mjs.map +1 -1
  46. package/es/components/carousel/index.mjs +2 -2
  47. package/es/components/carousel/src/carousel-item.mjs +148 -7
  48. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  49. package/es/components/carousel/src/carousel-item2.mjs +7 -148
  50. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  51. package/es/components/cascader-panel/src/config.mjs +1 -1
  52. package/es/components/cascader-panel/src/index.mjs +1 -1
  53. package/es/components/cascader-panel/src/menu.mjs +1 -1
  54. package/es/components/cascader-panel/src/node.mjs +200 -120
  55. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  56. package/es/components/cascader-panel/src/node2.mjs +120 -200
  57. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  58. package/es/components/cascader-panel/src/store.mjs +1 -1
  59. package/es/components/check-tag/index.mjs +2 -2
  60. package/es/components/check-tag/src/check-tag.mjs +7 -20
  61. package/es/components/check-tag/src/check-tag.mjs.map +1 -1
  62. package/es/components/check-tag/src/check-tag2.mjs +20 -7
  63. package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
  64. package/es/components/collapse/index.mjs +2 -2
  65. package/es/components/collapse/src/collapse-item.mjs +12 -91
  66. package/es/components/collapse/src/collapse-item.mjs.map +1 -1
  67. package/es/components/collapse/src/collapse-item2.mjs +91 -12
  68. package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
  69. package/es/components/dropdown/index.d.ts +0 -6
  70. package/es/components/dropdown/index.mjs +2 -2
  71. package/es/components/dropdown/src/dropdown-item-impl.mjs +4 -15
  72. package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
  73. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +0 -2
  74. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  75. package/es/components/dropdown/src/dropdown-menu.mjs +4 -27
  76. package/es/components/dropdown/src/dropdown-menu.mjs.map +1 -1
  77. package/es/components/dropdown/src/dropdown-menu.vue.d.ts +0 -3
  78. package/es/components/dropdown/src/dropdown.mjs +100 -109
  79. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  80. package/es/components/dropdown/src/dropdown2.mjs +109 -100
  81. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  82. package/es/components/empty/index.mjs +2 -2
  83. package/es/components/empty/src/empty.mjs +11 -56
  84. package/es/components/empty/src/empty.mjs.map +1 -1
  85. package/es/components/empty/src/empty2.mjs +56 -11
  86. package/es/components/empty/src/empty2.mjs.map +1 -1
  87. package/es/components/image/index.mjs +2 -2
  88. package/es/components/image/src/image.mjs +46 -170
  89. package/es/components/image/src/image.mjs.map +1 -1
  90. package/es/components/image/src/image2.mjs +170 -46
  91. package/es/components/image/src/image2.mjs.map +1 -1
  92. package/es/components/image-viewer/index.mjs +2 -2
  93. package/es/components/image-viewer/src/image-viewer.mjs +31 -210
  94. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  95. package/es/components/image-viewer/src/image-viewer2.mjs +210 -31
  96. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  97. package/es/components/index.mjs +29 -29
  98. package/es/components/input-number/index.mjs +2 -2
  99. package/es/components/input-number/src/input-number.mjs +171 -46
  100. package/es/components/input-number/src/input-number.mjs.map +1 -1
  101. package/es/components/input-number/src/input-number2.mjs +46 -171
  102. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  103. package/es/components/menu/src/menu-item.mjs +1 -1
  104. package/es/components/page-header/index.mjs +2 -2
  105. package/es/components/page-header/src/page-header.mjs +14 -55
  106. package/es/components/page-header/src/page-header.mjs.map +1 -1
  107. package/es/components/page-header/src/page-header2.mjs +55 -14
  108. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  109. package/es/components/popconfirm/index.mjs +2 -2
  110. package/es/components/popconfirm/src/popconfirm.mjs +20 -53
  111. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  112. package/es/components/popconfirm/src/popconfirm2.mjs +53 -20
  113. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  114. package/es/components/popover/src/popover.mjs +1 -1
  115. package/es/components/popper/index.mjs +2 -2
  116. package/es/components/popper/src/popper.mjs +27 -20
  117. package/es/components/popper/src/popper.mjs.map +1 -1
  118. package/es/components/popper/src/popper2.mjs +20 -27
  119. package/es/components/popper/src/popper2.mjs.map +1 -1
  120. package/es/components/progress/index.mjs +2 -2
  121. package/es/components/progress/src/progress.mjs +230 -57
  122. package/es/components/progress/src/progress.mjs.map +1 -1
  123. package/es/components/progress/src/progress2.mjs +57 -230
  124. package/es/components/progress/src/progress2.mjs.map +1 -1
  125. package/es/components/rate/index.mjs +2 -2
  126. package/es/components/rate/src/rate.mjs +169 -84
  127. package/es/components/rate/src/rate.mjs.map +1 -1
  128. package/es/components/rate/src/rate2.mjs +84 -169
  129. package/es/components/rate/src/rate2.mjs.map +1 -1
  130. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -9
  131. package/es/components/roving-focus-group/src/roving-focus-item.mjs.map +1 -1
  132. package/es/components/scrollbar/index.mjs +3 -3
  133. package/es/components/scrollbar/src/bar.mjs +35 -22
  134. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  135. package/es/components/scrollbar/src/bar2.mjs +22 -35
  136. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  137. package/es/components/scrollbar/src/scrollbar.mjs +112 -42
  138. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  139. package/es/components/scrollbar/src/scrollbar2.mjs +42 -112
  140. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  141. package/es/components/scrollbar/src/thumb.mjs +11 -59
  142. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  143. package/es/components/scrollbar/src/thumb2.mjs +59 -11
  144. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  145. package/es/components/skeleton/index.mjs +2 -2
  146. package/es/components/skeleton/src/skeleton.mjs +22 -49
  147. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  148. package/es/components/skeleton/src/skeleton2.mjs +49 -22
  149. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  150. package/es/components/tabs/index.mjs +3 -3
  151. package/es/components/tabs/src/tab-bar.mjs +7 -76
  152. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  153. package/es/components/tabs/src/tab-bar2.mjs +76 -7
  154. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  155. package/es/components/tabs/src/tab-nav.mjs +1 -1
  156. package/es/components/tabs/src/tab-pane.mjs +14 -60
  157. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  158. package/es/components/tabs/src/tab-pane2.mjs +60 -14
  159. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  160. package/es/components/tooltip-v2/index.mjs +1 -1
  161. package/es/components/tooltip-v2/src/arrow.mjs +22 -38
  162. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  163. package/es/components/tooltip-v2/src/arrow2.mjs +38 -22
  164. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  165. package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
  166. package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
  167. package/es/components/upload/index.mjs +4 -4
  168. package/es/components/upload/src/upload-content.mjs +1 -1
  169. package/es/components/upload/src/upload-content2.mjs +1 -1
  170. package/es/components/upload/src/upload-dragger.mjs +11 -32
  171. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  172. package/es/components/upload/src/upload-dragger2.mjs +32 -11
  173. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  174. package/es/components/upload/src/upload-list.mjs +155 -26
  175. package/es/components/upload/src/upload-list.mjs.map +1 -1
  176. package/es/components/upload/src/upload-list2.mjs +26 -155
  177. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  178. package/es/components/upload/src/upload.mjs +106 -99
  179. package/es/components/upload/src/upload.mjs.map +1 -1
  180. package/es/components/upload/src/upload2.mjs +99 -106
  181. package/es/components/upload/src/upload2.mjs.map +1 -1
  182. package/es/index.mjs +29 -29
  183. package/lib/components/affix/index.js +2 -2
  184. package/lib/components/affix/src/affix.js +19 -82
  185. package/lib/components/affix/src/affix.js.map +1 -1
  186. package/lib/components/affix/src/affix2.js +82 -19
  187. package/lib/components/affix/src/affix2.js.map +1 -1
  188. package/lib/components/autocomplete/index.js +2 -2
  189. package/lib/components/autocomplete/src/autocomplete.js +58 -94
  190. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  191. package/lib/components/autocomplete/src/autocomplete2.js +94 -58
  192. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  193. package/lib/components/avatar/index.js +2 -2
  194. package/lib/components/avatar/src/avatar.js +29 -61
  195. package/lib/components/avatar/src/avatar.js.map +1 -1
  196. package/lib/components/avatar/src/avatar2.js +61 -29
  197. package/lib/components/avatar/src/avatar2.js.map +1 -1
  198. package/lib/components/badge/index.js +2 -2
  199. package/lib/components/badge/src/badge.js +17 -54
  200. package/lib/components/badge/src/badge.js.map +1 -1
  201. package/lib/components/badge/src/badge2.js +54 -17
  202. package/lib/components/badge/src/badge2.js.map +1 -1
  203. package/lib/components/breadcrumb/index.js +4 -4
  204. package/lib/components/breadcrumb/src/breadcrumb-item.js +46 -11
  205. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  206. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -46
  207. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  208. package/lib/components/breadcrumb/src/breadcrumb.js +37 -12
  209. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  210. package/lib/components/breadcrumb/src/breadcrumb2.js +12 -37
  211. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  212. package/lib/components/calendar/index.js +2 -2
  213. package/lib/components/calendar/src/calendar.js +9 -192
  214. package/lib/components/calendar/src/calendar.js.map +1 -1
  215. package/lib/components/calendar/src/calendar2.js +192 -9
  216. package/lib/components/calendar/src/calendar2.js.map +1 -1
  217. package/lib/components/card/index.js +2 -2
  218. package/lib/components/card/src/card.js +15 -35
  219. package/lib/components/card/src/card.js.map +1 -1
  220. package/lib/components/card/src/card2.js +35 -15
  221. package/lib/components/card/src/card2.js.map +1 -1
  222. package/lib/components/carousel/index.js +2 -2
  223. package/lib/components/carousel/src/carousel-item.js +148 -7
  224. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  225. package/lib/components/carousel/src/carousel-item2.js +7 -148
  226. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  227. package/lib/components/cascader-panel/src/config.js +1 -1
  228. package/lib/components/cascader-panel/src/index.js +1 -1
  229. package/lib/components/cascader-panel/src/menu.js +1 -1
  230. package/lib/components/cascader-panel/src/node.js +200 -121
  231. package/lib/components/cascader-panel/src/node.js.map +1 -1
  232. package/lib/components/cascader-panel/src/node2.js +121 -200
  233. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  234. package/lib/components/cascader-panel/src/store.js +1 -1
  235. package/lib/components/check-tag/index.js +2 -2
  236. package/lib/components/check-tag/src/check-tag.js +7 -20
  237. package/lib/components/check-tag/src/check-tag.js.map +1 -1
  238. package/lib/components/check-tag/src/check-tag2.js +20 -7
  239. package/lib/components/check-tag/src/check-tag2.js.map +1 -1
  240. package/lib/components/collapse/index.js +2 -2
  241. package/lib/components/collapse/src/collapse-item.js +12 -91
  242. package/lib/components/collapse/src/collapse-item.js.map +1 -1
  243. package/lib/components/collapse/src/collapse-item2.js +91 -12
  244. package/lib/components/collapse/src/collapse-item2.js.map +1 -1
  245. package/lib/components/dropdown/index.d.ts +0 -6
  246. package/lib/components/dropdown/index.js +2 -2
  247. package/lib/components/dropdown/src/dropdown-item-impl.js +4 -15
  248. package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
  249. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +0 -2
  250. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  251. package/lib/components/dropdown/src/dropdown-menu.js +3 -26
  252. package/lib/components/dropdown/src/dropdown-menu.js.map +1 -1
  253. package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +0 -3
  254. package/lib/components/dropdown/src/dropdown.js +109 -109
  255. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  256. package/lib/components/dropdown/src/dropdown2.js +109 -109
  257. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  258. package/lib/components/empty/index.js +2 -2
  259. package/lib/components/empty/src/empty.js +11 -56
  260. package/lib/components/empty/src/empty.js.map +1 -1
  261. package/lib/components/empty/src/empty2.js +56 -11
  262. package/lib/components/empty/src/empty2.js.map +1 -1
  263. package/lib/components/image/index.js +2 -2
  264. package/lib/components/image/src/image.js +46 -170
  265. package/lib/components/image/src/image.js.map +1 -1
  266. package/lib/components/image/src/image2.js +170 -46
  267. package/lib/components/image/src/image2.js.map +1 -1
  268. package/lib/components/image-viewer/index.js +2 -2
  269. package/lib/components/image-viewer/src/image-viewer.js +31 -210
  270. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  271. package/lib/components/image-viewer/src/image-viewer2.js +210 -31
  272. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  273. package/lib/components/index.js +29 -29
  274. package/lib/components/input-number/index.js +2 -2
  275. package/lib/components/input-number/src/input-number.js +171 -46
  276. package/lib/components/input-number/src/input-number.js.map +1 -1
  277. package/lib/components/input-number/src/input-number2.js +46 -171
  278. package/lib/components/input-number/src/input-number2.js.map +1 -1
  279. package/lib/components/menu/src/menu-item.js +1 -1
  280. package/lib/components/page-header/index.js +2 -2
  281. package/lib/components/page-header/src/page-header.js +14 -55
  282. package/lib/components/page-header/src/page-header.js.map +1 -1
  283. package/lib/components/page-header/src/page-header2.js +55 -14
  284. package/lib/components/page-header/src/page-header2.js.map +1 -1
  285. package/lib/components/popconfirm/index.js +2 -2
  286. package/lib/components/popconfirm/src/popconfirm.js +20 -53
  287. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  288. package/lib/components/popconfirm/src/popconfirm2.js +53 -20
  289. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  290. package/lib/components/popover/src/popover.js +1 -1
  291. package/lib/components/popper/index.js +2 -2
  292. package/lib/components/popper/src/popper.js +27 -21
  293. package/lib/components/popper/src/popper.js.map +1 -1
  294. package/lib/components/popper/src/popper2.js +21 -27
  295. package/lib/components/popper/src/popper2.js.map +1 -1
  296. package/lib/components/progress/index.js +2 -2
  297. package/lib/components/progress/src/progress.js +230 -57
  298. package/lib/components/progress/src/progress.js.map +1 -1
  299. package/lib/components/progress/src/progress2.js +57 -230
  300. package/lib/components/progress/src/progress2.js.map +1 -1
  301. package/lib/components/rate/index.js +2 -2
  302. package/lib/components/rate/src/rate.js +169 -84
  303. package/lib/components/rate/src/rate.js.map +1 -1
  304. package/lib/components/rate/src/rate2.js +84 -169
  305. package/lib/components/rate/src/rate2.js.map +1 -1
  306. package/lib/components/roving-focus-group/src/roving-focus-item.js +0 -8
  307. package/lib/components/roving-focus-group/src/roving-focus-item.js.map +1 -1
  308. package/lib/components/scrollbar/index.js +3 -3
  309. package/lib/components/scrollbar/src/bar.js +35 -22
  310. package/lib/components/scrollbar/src/bar.js.map +1 -1
  311. package/lib/components/scrollbar/src/bar2.js +22 -35
  312. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  313. package/lib/components/scrollbar/src/scrollbar.js +112 -42
  314. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  315. package/lib/components/scrollbar/src/scrollbar2.js +42 -112
  316. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  317. package/lib/components/scrollbar/src/thumb.js +11 -59
  318. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  319. package/lib/components/scrollbar/src/thumb2.js +59 -11
  320. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  321. package/lib/components/skeleton/index.js +2 -2
  322. package/lib/components/skeleton/src/skeleton.js +22 -49
  323. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  324. package/lib/components/skeleton/src/skeleton2.js +49 -22
  325. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  326. package/lib/components/tabs/index.js +3 -3
  327. package/lib/components/tabs/src/tab-bar.js +7 -76
  328. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  329. package/lib/components/tabs/src/tab-bar2.js +76 -7
  330. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  331. package/lib/components/tabs/src/tab-nav.js +1 -1
  332. package/lib/components/tabs/src/tab-pane.js +14 -60
  333. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  334. package/lib/components/tabs/src/tab-pane2.js +60 -14
  335. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  336. package/lib/components/tooltip-v2/index.js +1 -1
  337. package/lib/components/tooltip-v2/src/arrow.js +23 -38
  338. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  339. package/lib/components/tooltip-v2/src/arrow2.js +38 -23
  340. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  341. package/lib/components/tooltip-v2/src/tooltip.js +1 -1
  342. package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
  343. package/lib/components/upload/index.js +4 -4
  344. package/lib/components/upload/src/upload-content.js +1 -1
  345. package/lib/components/upload/src/upload-content2.js +1 -1
  346. package/lib/components/upload/src/upload-dragger.js +12 -32
  347. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  348. package/lib/components/upload/src/upload-dragger2.js +32 -12
  349. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  350. package/lib/components/upload/src/upload-list.js +155 -27
  351. package/lib/components/upload/src/upload-list.js.map +1 -1
  352. package/lib/components/upload/src/upload-list2.js +27 -155
  353. package/lib/components/upload/src/upload-list2.js.map +1 -1
  354. package/lib/components/upload/src/upload.js +109 -99
  355. package/lib/components/upload/src/upload.js.map +1 -1
  356. package/lib/components/upload/src/upload2.js +99 -109
  357. package/lib/components/upload/src/upload2.js.map +1 -1
  358. package/lib/index.js +29 -29
  359. package/package.json +5 -3
  360. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rate2.js","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":["isObject","inject","formContextKey","useSize","useNamespace","ref","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A,CAAA,OAAA,KAAA,EAAA;AACA,MAAA,IAAA,aAAA,KAAA,EAAA;AACA,QAAA,OAAA;AAAA,OACA;AACA,MAAA,IAAA,MAAA,SAAA,EAAA;AAEA,QAAA,IAAA,SAAA,KAAA,CAAA,MAAA,CAAA;AACA,QAAA,IAAAE,eAAA,MAAA,EAAA,EAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,EAAA;AACA,UAAA,MAAA,GAAA,OAAA,aAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,SACA;AACA,QAAA,IAAA,MAAA,CAAA,gBAAA,CAAA,IAAAA,cAAA,CAAA,QAAA,EAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAA,EAAA;AACA,UAAA,MAAA,GAAA,MAAA,CAAA,UAAA,CAAA;AAAA,SACA;AACA,QAAA,iBAAA,CAAA,KAAA,GAAA,KAAA,CAAA,OAAA,GAAA,CAAA,IAAA,MAAA,CAAA,WAAA,CAAA;AACA,QAAA,YAAA,CAAA,KAAA,GAAA,iBAAA,CAAA,KAAA,GAAA,KAAA,GAAA,GAAA,GAAA,KAAA,CAAA;AAAA,OACA,MAAA;AACA,QAAA,YAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AAAA,OACA;AACA,MAAA,UAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AAAA,KACA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,eAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rate2.js","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":["buildProps","definePropType","mutable","StarFilled","iconPropType","Star","isValidComponentSize"],"mappings":";;;;;;;;;;;AAQY,MAAC,SAAS,GAAGA,gBAAU,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,G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AAI,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,EAAEF,oBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAMC,kBAAO,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,EAAEI,8BAAoB;AACnC,GAAG;AACH,CAAC;;;;"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  require('../../../hooks/index.js');
7
7
  var rovingFocusGroup = require('./roving-focus-group.js');
8
- var tokens = require('./tokens.js');
9
8
  var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
9
  var index = require('../../../hooks/use-id/index.js');
11
10
 
@@ -24,14 +23,7 @@ const _sfc_main = vue.defineComponent({
24
23
  }
25
24
  },
26
25
  setup() {
27
- const { currentTabbedId } = vue.inject(tokens.ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
28
26
  const id = index.useId();
29
- const rovingFocusGroupItemRef = vue.ref(null);
30
- const isCurrentTab = vue.computed(() => currentTabbedId.value === vue.unref(id));
31
- vue.provide(tokens.ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {
32
- rovingFocusGroupItemRef,
33
- tabIndex: vue.computed(() => vue.unref(isCurrentTab) ? 0 : -1)
34
- });
35
27
  return {
36
28
  id
37
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"roving-focus-item.js","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-item.vue"],"sourcesContent":["<template>\n <ps-roving-focus-collection-item\n :id=\"id\"\n :focusable=\"focusable\"\n :active=\"active\"\n >\n <slot />\n </ps-roving-focus-collection-item>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n inject,\n nextTick,\n provide,\n ref,\n unref,\n} from 'vue'\nimport { useId } from '@element-ps/hooks'\nimport { composeEventHandlers } from '@element-ps/utils'\nimport { EVENT_CODE } from '@element-ps/constants'\nimport {\n PsCollectionItem as PsRovingFocusCollectionItem,\n ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n} from './roving-focus-group'\nimport {\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,\n} from './tokens'\nimport { focusFirst, getFocusIntent, reorderArray } from './utils'\n\nexport default defineComponent({\n components: {\n PsRovingFocusCollectionItem,\n },\n props: {\n focusable: {\n type: Boolean,\n default: true,\n },\n active: {\n type: Boolean,\n default: false,\n },\n },\n setup() {\n const { currentTabbedId } = inject(\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n undefined\n )!\n\n const id = useId()\n const rovingFocusGroupItemRef = ref<HTMLElement | null>(null)\n\n const isCurrentTab = computed(() => currentTabbedId.value === unref(id))\n\n provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {\n rovingFocusGroupItemRef,\n tabIndex: computed(() => (unref(isCurrentTab) ? 0 : -1)),\n })\n\n return {\n id,\n }\n },\n})\n</script>\n"],"names":["defineComponent","PsRovingFocusCollectionItem","inject","ROVING_FOCUS_GROUP_INJECTION_KEY","useId","ref","computed","unref","provide","ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY","_createBlock","_renderSlot"],"mappings":";;;;;;;;;;;AAiCA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,UAAY,EAAA;AAAA,iCACVC,iCAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,KACX;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,GACF;AAAA,EACA,KAAQ,GAAA;AACN,IAAA,MAAM,EAAE,eAAA,EAAA,GAAoBC,UAC1B,CAAAC,uCAAA,EACA,KACF,CAAA,CAAA,CAAA;AAEA,IAAA,MAAM,KAAKC,WAAM,EAAA,CAAA;AACjB,IAAM,MAAA,uBAAA,GAA0BC,QAAwB,IAAI,CAAA,CAAA;AAE5D,IAAA,MAAM,eAAeC,YAAS,CAAA,MAAM,gBAAgB,KAAU,KAAAC,SAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AAEvE,IAAAC,WAAA,CAAQC,4CAAuC,EAAA;AAAA,MAC7C,uBAAA;AAAA,MACA,UAAUH,YAAS,CAAA,MAAOC,UAAM,YAAY,CAAA,GAAI,IAAI,CAAG,CAAA,CAAA;AAAA,KACxD,CAAA,CAAA;AAED,IAAO,OAAA;AAAA,MACL,EAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;;0BAlECG,eAMkC,CAAA,0CAAA,EAAA;AAAA,IAL/B,EAAI,EAAA,IAAA,CAAA,EAAA;AAAA,IACJ,SAAW,EAAA,IAAA,CAAA,SAAA;AAAA,IACX,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,GAAA,EAAA;yBAET,MAAQ;AAAA,MAARC,cAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"roving-focus-item.js","sources":["../../../../../../packages/components/roving-focus-group/src/roving-focus-item.vue"],"sourcesContent":["<template>\n <ps-roving-focus-collection-item\n :id=\"id\"\n :focusable=\"focusable\"\n :active=\"active\"\n >\n <slot />\n </ps-roving-focus-collection-item>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n inject,\n nextTick,\n provide,\n ref,\n unref,\n} from 'vue'\nimport { useId } from '@element-ps/hooks'\nimport { composeEventHandlers } from '@element-ps/utils'\nimport { EVENT_CODE } from '@element-ps/constants'\nimport {\n PsCollectionItem as PsRovingFocusCollectionItem,\n ROVING_FOCUS_COLLECTION_INJECTION_KEY,\n} from './roving-focus-group'\nimport {\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY,\n} from './tokens'\nimport { focusFirst, getFocusIntent, reorderArray } from './utils'\n\nexport default defineComponent({\n components: {\n PsRovingFocusCollectionItem,\n },\n props: {\n focusable: {\n type: Boolean,\n default: true,\n },\n active: {\n type: Boolean,\n default: false,\n },\n },\n setup() {\n /*const { currentTabbedId } = inject(\n ROVING_FOCUS_GROUP_INJECTION_KEY,\n undefined\n )!*/\n\n const id = useId()\n // const rovingFocusGroupItemRef = ref<HTMLElement | null>(null)\n\n // const isCurrentTab = computed(() => currentTabbedId.value === unref(id))\n\n /*provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {\n rovingFocusGroupItemRef,\n tabIndex: computed(() => (unref(isCurrentTab) ? 0 : -1)),\n })*/\n\n return {\n id,\n }\n },\n})\n</script>\n"],"names":["defineComponent","PsRovingFocusCollectionItem","useId","_createBlock","_renderSlot"],"mappings":";;;;;;;;;;AAiCA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,UAAY,EAAA;AAAA,iCACVC,iCAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,KACX;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,GACF;AAAA,EACA,KAAQ,GAAA;AAMN,IAAA,MAAM,KAAKC,WAAM,EAAA,CAAA;AAUjB,IAAO,OAAA;AAAA,MACL,EAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;;0BAlECC,eAMkC,CAAA,0CAAA,EAAA;AAAA,IAL/B,EAAI,EAAA,IAAA,CAAA,EAAA;AAAA,IACJ,SAAW,EAAA,IAAA,CAAA,SAAA;AAAA,IACX,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,GAAA,EAAA;yBAET,MAAQ;AAAA,MAARC,cAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;"}
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var scrollbar$1 = require('./src/scrollbar2.js');
6
+ var scrollbar$1 = require('./src/scrollbar.js');
7
7
  var util = require('./src/util.js');
8
- var scrollbar = require('./src/scrollbar.js');
9
- var thumb = require('./src/thumb2.js');
8
+ var scrollbar = require('./src/scrollbar2.js');
9
+ var thumb = require('./src/thumb.js');
10
10
  var install = require('../../utils/vue/install.js');
11
11
 
12
12
  const PsScrollbar = install.withInstall(scrollbar$1["default"]);
@@ -2,31 +2,44 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
6
- var props = require('../../../utils/vue/props.js');
5
+ var vue = require('vue');
6
+ var thumb = require('./thumb2.js');
7
+ var bar = require('./bar2.js');
8
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
7
9
 
8
- const barProps = props.buildProps({
9
- always: {
10
- type: Boolean,
11
- default: true
10
+ const _sfc_main = vue.defineComponent({
11
+ components: {
12
+ Thumb: thumb["default"]
12
13
  },
13
- width: {
14
- type: String,
15
- default: ""
16
- },
17
- height: {
18
- type: String,
19
- default: ""
20
- },
21
- ratioX: {
22
- type: Number,
23
- default: 1
24
- },
25
- ratioY: {
26
- type: Number,
27
- default: 1
14
+ props: bar.barProps,
15
+ setup() {
16
+ const moveX = vue.ref(0);
17
+ const moveY = vue.ref(0);
18
+ return {
19
+ moveX,
20
+ moveY
21
+ };
28
22
  }
29
23
  });
24
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
25
+ const _component_thumb = vue.resolveComponent("thumb");
26
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
27
+ vue.createVNode(_component_thumb, {
28
+ move: _ctx.moveX,
29
+ ratio: _ctx.ratioX,
30
+ size: _ctx.width,
31
+ always: _ctx.always
32
+ }, null, 8, ["move", "ratio", "size", "always"]),
33
+ vue.createVNode(_component_thumb, {
34
+ move: _ctx.moveY,
35
+ ratio: _ctx.ratioY,
36
+ size: _ctx.height,
37
+ vertical: "",
38
+ always: _ctx.always
39
+ }, null, 8, ["move", "ratio", "size", "always"])
40
+ ], 64);
41
+ }
42
+ var Bar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/bar.vue"]]);
30
43
 
31
- exports.barProps = barProps;
44
+ exports["default"] = Bar;
32
45
  //# sourceMappingURL=bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar.js","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n width: {\n type: String,\n default: '',\n },\n height: {\n type: String,\n default: '',\n },\n ratioX: {\n type: Number,\n default: 1,\n },\n ratioY: {\n type: Number,\n default: 1,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,QAAQ,GAAGA,gBAAU,CAAC;AACnC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"bar.js","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"width\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"height\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\n\nexport default defineComponent({\n components: {\n Thumb,\n },\n props: barProps,\n setup() {\n const moveX = ref(0)\n const moveY = ref(0)\n\n return {\n moveX,\n moveY,\n }\n },\n})\n</script>\n"],"names":["defineComponent","Thumb","barProps","ref","_createVNode"],"mappings":";;;;;;;;;AAeA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,UAAY,EAAA;AAAA,WACVC,gBAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAAC,YAAA;AAAA,EACP,KAAQ,GAAA;AACN,IAAM,MAAA,KAAA,GAAQC,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQA,QAAI,CAAC,CAAA,CAAA;AAEnB,IAAO,OAAA;AAAA,MACL,KAAA;AAAA,MACA,KAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;;;IA5BCC,eAAsE,CAAA,gBAAA,EAAA;AAAA,MAA9D,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,KAAO,EAAA,IAAA,CAAA,MAAA;AAAA,MAAS,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,CAAA;IAC5DA,eAME,CAAA,gBAAA,EAAA;AAAA,MALC,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MACN,KAAO,EAAA,IAAA,CAAA,MAAA;AAAA,MACP,IAAM,EAAA,IAAA,CAAA,MAAA;AAAA,MACP,QAAA,EAAA,EAAA;AAAA,MACC,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,CAAA;;;;;;;"}
@@ -2,44 +2,31 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var thumb = require('./thumb.js');
7
- var bar = require('./bar.js');
8
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
5
+ require('../../../utils/index.js');
6
+ var props = require('../../../utils/vue/props.js');
9
7
 
10
- const _sfc_main = vue.defineComponent({
11
- components: {
12
- Thumb: thumb["default"]
8
+ const barProps = props.buildProps({
9
+ always: {
10
+ type: Boolean,
11
+ default: true
13
12
  },
14
- props: bar.barProps,
15
- setup() {
16
- const moveX = vue.ref(0);
17
- const moveY = vue.ref(0);
18
- return {
19
- moveX,
20
- moveY
21
- };
13
+ width: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ height: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ ratioX: {
22
+ type: Number,
23
+ default: 1
24
+ },
25
+ ratioY: {
26
+ type: Number,
27
+ default: 1
22
28
  }
23
29
  });
24
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
25
- const _component_thumb = vue.resolveComponent("thumb");
26
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
27
- vue.createVNode(_component_thumb, {
28
- move: _ctx.moveX,
29
- ratio: _ctx.ratioX,
30
- size: _ctx.width,
31
- always: _ctx.always
32
- }, null, 8, ["move", "ratio", "size", "always"]),
33
- vue.createVNode(_component_thumb, {
34
- move: _ctx.moveY,
35
- ratio: _ctx.ratioY,
36
- size: _ctx.height,
37
- vertical: "",
38
- always: _ctx.always
39
- }, null, 8, ["move", "ratio", "size", "always"])
40
- ], 64);
41
- }
42
- var Bar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/bar.vue"]]);
43
30
 
44
- exports["default"] = Bar;
31
+ exports.barProps = barProps;
45
32
  //# sourceMappingURL=bar2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar2.js","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"width\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"height\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\">\nimport { defineComponent, ref } from 'vue'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\n\nexport default defineComponent({\n components: {\n Thumb,\n },\n props: barProps,\n setup() {\n const moveX = ref(0)\n const moveY = ref(0)\n\n return {\n moveX,\n moveY,\n }\n },\n})\n</script>\n"],"names":["defineComponent","Thumb","barProps","ref","_createVNode"],"mappings":";;;;;;;;;AAeA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,UAAY,EAAA;AAAA,WACVC,gBAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAAC,YAAA;AAAA,EACP,KAAQ,GAAA;AACN,IAAM,MAAA,KAAA,GAAQC,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQA,QAAI,CAAC,CAAA,CAAA;AAEnB,IAAO,OAAA;AAAA,MACL,KAAA;AAAA,MACA,KAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;;;IA5BCC,eAAsE,CAAA,gBAAA,EAAA;AAAA,MAA9D,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,KAAO,EAAA,IAAA,CAAA,MAAA;AAAA,MAAS,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,CAAA;IAC5DA,eAME,CAAA,gBAAA,EAAA;AAAA,MALC,IAAM,EAAA,IAAA,CAAA,KAAA;AAAA,MACN,KAAO,EAAA,IAAA,CAAA,MAAA;AAAA,MACP,IAAM,EAAA,IAAA,CAAA,MAAA;AAAA,MACP,QAAA,EAAA,EAAA;AAAA,MACC,MAAQ,EAAA,IAAA,CAAA,MAAA;AAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,CAAA,CAAA;;;;;;;"}
1
+ {"version":3,"file":"bar2.js","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n width: {\n type: String,\n default: '',\n },\n height: {\n type: String,\n default: '',\n },\n ratioX: {\n type: Number,\n default: 1,\n },\n ratioY: {\n type: Number,\n default: 1,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,QAAQ,GAAGA,gBAAU,CAAC;AACnC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,CAAC;;;;"}
@@ -2,52 +2,122 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var vue = require('vue');
5
6
  require('../../../utils/index.js');
6
- var props = require('../../../utils/vue/props.js');
7
+ require('../../../tokens/index.js');
8
+ require('../../../hooks/index.js');
9
+ var bar = require('./bar.js');
10
+ var scrollbar = require('./scrollbar2.js');
11
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
12
+ var index = require('../../../hooks/use-namespace/index.js');
13
+ var style = require('../../../utils/dom/style.js');
14
+ var scrollbar$1 = require('../../../tokens/scrollbar.js');
7
15
 
8
- const scrollbarProps = props.buildProps({
9
- height: {
10
- type: [String, Number],
11
- default: ""
16
+ const _sfc_main = vue.defineComponent({
17
+ name: "PsScrollbar",
18
+ components: {
19
+ Bar: bar["default"]
12
20
  },
13
- maxHeight: {
14
- type: [String, Number],
15
- default: ""
16
- },
17
- native: {
18
- type: Boolean,
19
- default: false
20
- },
21
- wrapStyle: {
22
- type: props.definePropType([String, Object, Array]),
23
- default: ""
24
- },
25
- wrapClass: {
26
- type: [String, Array],
27
- default: ""
28
- },
29
- viewClass: {
30
- type: [String, Array],
31
- default: ""
32
- },
33
- viewStyle: {
34
- type: [String, Array, Object],
35
- default: ""
36
- },
37
- noresize: Boolean,
38
- tag: {
39
- type: String,
40
- default: "div"
41
- },
42
- always: {
43
- type: Boolean,
44
- default: false
45
- },
46
- minSize: {
47
- type: Number,
48
- default: 20
21
+ props: scrollbar.scrollbarProps,
22
+ setup(props) {
23
+ const ns = index.useNamespace("scrollbar");
24
+ const scrollbar$ = vue.ref();
25
+ const wrap$ = vue.ref();
26
+ const resize$ = vue.ref();
27
+ const sizeWidth = vue.ref("0");
28
+ const sizeHeight = vue.ref("0");
29
+ const barRef = vue.ref();
30
+ const moveX = vue.ref(0);
31
+ const moveY = vue.ref(0);
32
+ const ratioY = vue.ref(1);
33
+ const ratioX = vue.ref(1);
34
+ const GAP = 4;
35
+ const style$1 = vue.computed(() => {
36
+ const style2 = {};
37
+ if (props.height)
38
+ style2.height = style.addUnit(props.height);
39
+ if (props.maxHeight)
40
+ style2.maxHeight = style.addUnit(props.maxHeight);
41
+ return [props.wrapStyle, style2];
42
+ });
43
+ const update = () => {
44
+ if (!wrap$.value)
45
+ return;
46
+ const offsetHeight = wrap$.value.offsetHeight - GAP;
47
+ const offsetWidth = wrap$.value.offsetWidth - GAP;
48
+ const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight;
49
+ const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth;
50
+ const height = Math.max(originalHeight, props.minSize);
51
+ const width = Math.max(originalWidth, props.minSize);
52
+ ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
53
+ ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
54
+ sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
55
+ sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
56
+ };
57
+ vue.provide(scrollbar$1.scrollbarContextKey, vue.reactive({
58
+ scrollbarElement: scrollbar$,
59
+ wrapElement: wrap$
60
+ }));
61
+ vue.onMounted(() => {
62
+ if (!props.native)
63
+ vue.nextTick(() => update());
64
+ });
65
+ vue.onUpdated(() => update());
66
+ return {
67
+ ns,
68
+ scrollbar$,
69
+ wrap$,
70
+ resize$,
71
+ barRef,
72
+ moveX,
73
+ moveY,
74
+ ratioX,
75
+ ratioY,
76
+ sizeWidth,
77
+ sizeHeight,
78
+ style: style$1,
79
+ update
80
+ };
49
81
  }
50
82
  });
83
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
84
+ const _component_bar = vue.resolveComponent("bar");
85
+ return vue.openBlock(), vue.createElementBlock("div", {
86
+ ref: "scrollbar$",
87
+ class: vue.normalizeClass(_ctx.ns.b())
88
+ }, [
89
+ vue.createElementVNode("div", {
90
+ ref: "wrap$",
91
+ class: vue.normalizeClass([
92
+ _ctx.wrapClass,
93
+ _ctx.ns.e("wrap"),
94
+ { [_ctx.ns.em("wrap", "hidden-default")]: !_ctx.native }
95
+ ]),
96
+ style: vue.normalizeStyle(_ctx.style)
97
+ }, [
98
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
99
+ ref: "resize$",
100
+ class: vue.normalizeClass([_ctx.ns.e("view"), _ctx.viewClass]),
101
+ style: vue.normalizeStyle(_ctx.viewStyle)
102
+ }, {
103
+ default: vue.withCtx(() => [
104
+ vue.renderSlot(_ctx.$slots, "default")
105
+ ]),
106
+ _: 3
107
+ }, 8, ["class", "style"]))
108
+ ], 6),
109
+ !_ctx.native ? (vue.openBlock(), vue.createBlock(_component_bar, {
110
+ key: 0,
111
+ ref: "barRef",
112
+ height: _ctx.sizeHeight,
113
+ width: _ctx.sizeWidth,
114
+ always: _ctx.always,
115
+ "ratio-x": _ctx.ratioX,
116
+ "ratio-y": _ctx.ratioY
117
+ }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : vue.createCommentVNode("v-if", true)
118
+ ], 2);
119
+ }
120
+ var Scrollbar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/scrollbar.vue"]]);
51
121
 
52
- exports.scrollbarProps = scrollbarProps;
122
+ exports["default"] = Scrollbar;
53
123
  //# sourceMappingURL=scrollbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.js","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":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,cAAc,GAAGA,gBAAU,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,EAAEC,oBAAc,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;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AACjC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"scrollbar.js","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":["defineComponent","Bar","scrollbarProps","useNamespace","ref","style","computed","addUnit","provide","scrollbarContextKey","reactive","onMounted","nextTick","onUpdated","_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_openBlock","_createBlock","_resolveDynamicComponent","_renderSlot","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;AAmDA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,aAAA;AAAA,EACN,UAAY,EAAA;AAAA,SACVC,cAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAAC,wBAAA;AAAA,EAEP,MAAM,KAAO,EAAA;AACX,IAAM,MAAA,EAAA,GAAKC,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,MAAM,aAAaC,OAAoB,EAAA,CAAA;AACvC,IAAA,MAAM,QAAQA,OAAoB,EAAA,CAAA;AAClC,IAAA,MAAM,UAAUA,OAAiB,EAAA,CAAA;AAEjC,IAAM,MAAA,SAAA,GAAYA,QAAI,GAAG,CAAA,CAAA;AACzB,IAAM,MAAA,UAAA,GAAaA,QAAI,GAAG,CAAA,CAAA;AAC1B,IAAA,MAAM,SAASA,OAAI,EAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQA,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQA,QAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,MAAA,GAASA,QAAI,CAAC,CAAA,CAAA;AACp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'__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
5
  require('../../../utils/index.js');
7
- require('../../../tokens/index.js');
8
- require('../../../hooks/index.js');
9
- var bar = require('./bar2.js');
10
- var scrollbar = require('./scrollbar.js');
11
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
12
- var index = require('../../../hooks/use-namespace/index.js');
13
- var style = require('../../../utils/dom/style.js');
14
- var scrollbar$1 = require('../../../tokens/scrollbar.js');
6
+ var props = require('../../../utils/vue/props.js');
15
7
 
16
- const _sfc_main = vue.defineComponent({
17
- name: "PsScrollbar",
18
- components: {
19
- Bar: bar["default"]
8
+ const scrollbarProps = props.buildProps({
9
+ height: {
10
+ type: [String, Number],
11
+ default: ""
20
12
  },
21
- props: scrollbar.scrollbarProps,
22
- setup(props) {
23
- const ns = index.useNamespace("scrollbar");
24
- const scrollbar$ = vue.ref();
25
- const wrap$ = vue.ref();
26
- const resize$ = vue.ref();
27
- const sizeWidth = vue.ref("0");
28
- const sizeHeight = vue.ref("0");
29
- const barRef = vue.ref();
30
- const moveX = vue.ref(0);
31
- const moveY = vue.ref(0);
32
- const ratioY = vue.ref(1);
33
- const ratioX = vue.ref(1);
34
- const GAP = 4;
35
- const style$1 = vue.computed(() => {
36
- const style2 = {};
37
- if (props.height)
38
- style2.height = style.addUnit(props.height);
39
- if (props.maxHeight)
40
- style2.maxHeight = style.addUnit(props.maxHeight);
41
- return [props.wrapStyle, style2];
42
- });
43
- const update = () => {
44
- if (!wrap$.value)
45
- return;
46
- const offsetHeight = wrap$.value.offsetHeight - GAP;
47
- const offsetWidth = wrap$.value.offsetWidth - GAP;
48
- const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight;
49
- const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth;
50
- const height = Math.max(originalHeight, props.minSize);
51
- const width = Math.max(originalWidth, props.minSize);
52
- ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
53
- ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
54
- sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
55
- sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
56
- };
57
- vue.provide(scrollbar$1.scrollbarContextKey, vue.reactive({
58
- scrollbarElement: scrollbar$,
59
- wrapElement: wrap$
60
- }));
61
- vue.onMounted(() => {
62
- if (!props.native)
63
- vue.nextTick(() => update());
64
- });
65
- vue.onUpdated(() => update());
66
- return {
67
- ns,
68
- scrollbar$,
69
- wrap$,
70
- resize$,
71
- barRef,
72
- moveX,
73
- moveY,
74
- ratioX,
75
- ratioY,
76
- sizeWidth,
77
- sizeHeight,
78
- style: style$1,
79
- update
80
- };
13
+ maxHeight: {
14
+ type: [String, Number],
15
+ default: ""
16
+ },
17
+ native: {
18
+ type: Boolean,
19
+ default: false
20
+ },
21
+ wrapStyle: {
22
+ type: props.definePropType([String, Object, Array]),
23
+ default: ""
24
+ },
25
+ wrapClass: {
26
+ type: [String, Array],
27
+ default: ""
28
+ },
29
+ viewClass: {
30
+ type: [String, Array],
31
+ default: ""
32
+ },
33
+ viewStyle: {
34
+ type: [String, Array, Object],
35
+ default: ""
36
+ },
37
+ noresize: Boolean,
38
+ tag: {
39
+ type: String,
40
+ default: "div"
41
+ },
42
+ always: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ minSize: {
47
+ type: Number,
48
+ default: 20
81
49
  }
82
50
  });
83
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
84
- const _component_bar = vue.resolveComponent("bar");
85
- return vue.openBlock(), vue.createElementBlock("div", {
86
- ref: "scrollbar$",
87
- class: vue.normalizeClass(_ctx.ns.b())
88
- }, [
89
- vue.createElementVNode("div", {
90
- ref: "wrap$",
91
- class: vue.normalizeClass([
92
- _ctx.wrapClass,
93
- _ctx.ns.e("wrap"),
94
- { [_ctx.ns.em("wrap", "hidden-default")]: !_ctx.native }
95
- ]),
96
- style: vue.normalizeStyle(_ctx.style)
97
- }, [
98
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
99
- ref: "resize$",
100
- class: vue.normalizeClass([_ctx.ns.e("view"), _ctx.viewClass]),
101
- style: vue.normalizeStyle(_ctx.viewStyle)
102
- }, {
103
- default: vue.withCtx(() => [
104
- vue.renderSlot(_ctx.$slots, "default")
105
- ]),
106
- _: 3
107
- }, 8, ["class", "style"]))
108
- ], 6),
109
- !_ctx.native ? (vue.openBlock(), vue.createBlock(_component_bar, {
110
- key: 0,
111
- ref: "barRef",
112
- height: _ctx.sizeHeight,
113
- width: _ctx.sizeWidth,
114
- always: _ctx.always,
115
- "ratio-x": _ctx.ratioX,
116
- "ratio-y": _ctx.ratioY
117
- }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : vue.createCommentVNode("v-if", true)
118
- ], 2);
119
- }
120
- var Scrollbar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/meng/workspace/element-ps/packages/components/scrollbar/src/scrollbar.vue"]]);
121
51
 
122
- exports["default"] = Scrollbar;
52
+ exports.scrollbarProps = scrollbarProps;
123
53
  //# sourceMappingURL=scrollbar2.js.map