element-ps 2.0.20 → 2.0.21

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 (340) hide show
  1. package/dist/index.full.js +2 -41
  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 +2 -41
  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/alert/index.mjs +2 -2
  13. package/es/components/alert/src/alert.mjs +33 -83
  14. package/es/components/alert/src/alert.mjs.map +1 -1
  15. package/es/components/alert/src/alert2.mjs +83 -33
  16. package/es/components/alert/src/alert2.mjs.map +1 -1
  17. package/es/components/autocomplete/index.d.ts +5 -5
  18. package/es/components/autocomplete/index.mjs +2 -2
  19. package/es/components/autocomplete/src/autocomplete.mjs +94 -58
  20. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  21. package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
  22. package/es/components/autocomplete/src/autocomplete2.mjs +58 -94
  23. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  24. package/es/components/avatar/index.mjs +2 -2
  25. package/es/components/avatar/src/avatar.mjs +29 -61
  26. package/es/components/avatar/src/avatar.mjs.map +1 -1
  27. package/es/components/avatar/src/avatar2.mjs +61 -29
  28. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  29. package/es/components/calendar/index.mjs +2 -2
  30. package/es/components/calendar/src/calendar.mjs +9 -188
  31. package/es/components/calendar/src/calendar.mjs.map +1 -1
  32. package/es/components/calendar/src/calendar2.mjs +188 -9
  33. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  34. package/es/components/calendar/src/date-table.mjs +27 -146
  35. package/es/components/calendar/src/date-table.mjs.map +1 -1
  36. package/es/components/calendar/src/date-table2.mjs +146 -27
  37. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  38. package/es/components/carousel/index.mjs +4 -4
  39. package/es/components/carousel/src/carousel-item.mjs +7 -148
  40. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  41. package/es/components/carousel/src/carousel-item2.mjs +148 -7
  42. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  43. package/es/components/carousel/src/carousel.mjs +43 -201
  44. package/es/components/carousel/src/carousel.mjs.map +1 -1
  45. package/es/components/carousel/src/carousel2.mjs +201 -43
  46. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  47. package/es/components/cascader-panel/src/config.mjs +1 -1
  48. package/es/components/cascader-panel/src/index.mjs +1 -1
  49. package/es/components/cascader-panel/src/menu.mjs +1 -1
  50. package/es/components/cascader-panel/src/node.mjs +200 -120
  51. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  52. package/es/components/cascader-panel/src/node2.mjs +120 -200
  53. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  54. package/es/components/cascader-panel/src/store.mjs +1 -1
  55. package/es/components/collection/src/collection.mjs +1 -34
  56. package/es/components/collection/src/collection.mjs.map +1 -1
  57. package/es/components/divider/index.mjs +2 -2
  58. package/es/components/divider/src/divider.mjs +34 -17
  59. package/es/components/divider/src/divider.mjs.map +1 -1
  60. package/es/components/divider/src/divider2.mjs +17 -34
  61. package/es/components/divider/src/divider2.mjs.map +1 -1
  62. package/es/components/dropdown/index.d.ts +3 -3
  63. package/es/components/dropdown/src/dropdown-item-impl.mjs +3 -12
  64. package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
  65. package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +0 -3
  66. package/es/components/dropdown/src/dropdown.d.ts +1 -1
  67. package/es/components/dropdown/src/dropdown.vue.d.ts +3 -3
  68. package/es/components/form/index.mjs +4 -4
  69. package/es/components/form/src/form-item.mjs +177 -46
  70. package/es/components/form/src/form-item.mjs.map +1 -1
  71. package/es/components/form/src/form-item2.mjs +46 -177
  72. package/es/components/form/src/form-item2.mjs.map +1 -1
  73. package/es/components/form/src/form.mjs +40 -45
  74. package/es/components/form/src/form.mjs.map +1 -1
  75. package/es/components/form/src/form2.mjs +45 -40
  76. package/es/components/form/src/form2.mjs.map +1 -1
  77. package/es/components/image/index.mjs +2 -2
  78. package/es/components/image/src/image.mjs +170 -46
  79. package/es/components/image/src/image.mjs.map +1 -1
  80. package/es/components/image/src/image2.mjs +46 -170
  81. package/es/components/image/src/image2.mjs.map +1 -1
  82. package/es/components/image-viewer/index.mjs +2 -2
  83. package/es/components/image-viewer/src/image-viewer.mjs +31 -210
  84. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  85. package/es/components/image-viewer/src/image-viewer2.mjs +210 -31
  86. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  87. package/es/components/index.mjs +23 -23
  88. package/es/components/input-number/index.mjs +2 -2
  89. package/es/components/input-number/src/input-number.mjs +46 -171
  90. package/es/components/input-number/src/input-number.mjs.map +1 -1
  91. package/es/components/input-number/src/input-number2.mjs +171 -46
  92. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  93. package/es/components/menu/index.d.ts +3 -3
  94. package/es/components/menu/src/menu.d.ts +4 -4
  95. package/es/components/popover/index.d.ts +6 -6
  96. package/es/components/popover/src/index.vue.d.ts +3 -3
  97. package/es/components/popover/src/popover.d.ts +1 -1
  98. package/es/components/popper/index.mjs +2 -2
  99. package/es/components/popper/src/arrow.mjs +7 -31
  100. package/es/components/popper/src/arrow.mjs.map +1 -1
  101. package/es/components/popper/src/arrow2.mjs +31 -7
  102. package/es/components/popper/src/arrow2.mjs.map +1 -1
  103. package/es/components/radio/index.mjs +2 -2
  104. package/es/components/radio/src/radio-button.mjs +1 -1
  105. package/es/components/radio/src/radio-button2.mjs +1 -1
  106. package/es/components/radio/src/radio.mjs +62 -74
  107. package/es/components/radio/src/radio.mjs.map +1 -1
  108. package/es/components/radio/src/radio2.mjs +74 -62
  109. package/es/components/radio/src/radio2.mjs.map +1 -1
  110. package/es/components/rate/index.mjs +2 -2
  111. package/es/components/rate/src/rate.mjs +84 -169
  112. package/es/components/rate/src/rate.mjs.map +1 -1
  113. package/es/components/rate/src/rate2.mjs +169 -84
  114. package/es/components/rate/src/rate2.mjs.map +1 -1
  115. package/es/components/result/index.mjs +2 -2
  116. package/es/components/result/src/result.mjs +28 -73
  117. package/es/components/result/src/result.mjs.map +1 -1
  118. package/es/components/result/src/result2.mjs +73 -28
  119. package/es/components/result/src/result2.mjs.map +1 -1
  120. package/es/components/select/index.d.ts +5 -5
  121. package/es/components/select/src/select.vue.d.ts +5 -5
  122. package/es/components/select/src/useSelect.d.ts +5 -5
  123. package/es/components/select-v2/index.d.ts +10 -10
  124. package/es/components/select-v2/src/option-item.vue.d.ts +1 -1
  125. package/es/components/select-v2/src/select.vue.d.ts +5 -5
  126. package/es/components/select-v2/src/useSelect.d.ts +5 -5
  127. package/es/components/skeleton/index.mjs +4 -4
  128. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  129. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  130. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  131. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  132. package/es/components/skeleton/src/skeleton.mjs +22 -49
  133. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  134. package/es/components/skeleton/src/skeleton2.mjs +49 -22
  135. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  136. package/es/components/table/index.d.ts +1 -1
  137. package/es/components/table/src/filter-panel.vue.d.ts +5 -5
  138. package/es/components/table/src/table.vue.d.ts +1 -1
  139. package/es/components/tabs/index.mjs +3 -3
  140. package/es/components/tabs/src/tab-bar.mjs +76 -7
  141. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  142. package/es/components/tabs/src/tab-bar2.mjs +7 -76
  143. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  144. package/es/components/tabs/src/tab-nav.mjs +1 -1
  145. package/es/components/tabs/src/tab-pane.mjs +14 -60
  146. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  147. package/es/components/tabs/src/tab-pane2.mjs +60 -14
  148. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  149. package/es/components/time-picker/src/common/picker.vue.d.ts +5 -5
  150. package/es/components/tooltip/index.d.ts +3 -3
  151. package/es/components/tooltip/src/tooltip.d.ts +1 -1
  152. package/es/components/tooltip/src/tooltip.mjs +1 -1
  153. package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
  154. package/es/components/tooltip/src/trigger.vue.d.ts +3 -3
  155. package/es/components/tooltip-v2/index.mjs +2 -2
  156. package/es/components/tooltip-v2/src/arrow.mjs +22 -38
  157. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  158. package/es/components/tooltip-v2/src/arrow2.mjs +38 -22
  159. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  160. package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
  161. package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
  162. package/es/components/tooltip-v2/src/trigger.mjs +89 -11
  163. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  164. package/es/components/tooltip-v2/src/trigger2.mjs +11 -89
  165. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  166. package/es/components/upload/index.mjs +1 -1
  167. package/es/components/upload/src/upload-content.mjs +1 -1
  168. package/es/components/upload/src/upload-dragger.mjs +32 -11
  169. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  170. package/es/components/upload/src/upload-dragger2.mjs +11 -32
  171. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  172. package/es/index.mjs +23 -23
  173. package/lib/components/affix/index.js +2 -2
  174. package/lib/components/affix/src/affix.js +19 -82
  175. package/lib/components/affix/src/affix.js.map +1 -1
  176. package/lib/components/affix/src/affix2.js +82 -19
  177. package/lib/components/affix/src/affix2.js.map +1 -1
  178. package/lib/components/alert/index.js +2 -2
  179. package/lib/components/alert/src/alert.js +33 -82
  180. package/lib/components/alert/src/alert.js.map +1 -1
  181. package/lib/components/alert/src/alert2.js +82 -33
  182. package/lib/components/alert/src/alert2.js.map +1 -1
  183. package/lib/components/autocomplete/index.d.ts +5 -5
  184. package/lib/components/autocomplete/index.js +2 -2
  185. package/lib/components/autocomplete/src/autocomplete.js +94 -58
  186. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  187. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
  188. package/lib/components/autocomplete/src/autocomplete2.js +58 -94
  189. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  190. package/lib/components/avatar/index.js +2 -2
  191. package/lib/components/avatar/src/avatar.js +29 -61
  192. package/lib/components/avatar/src/avatar.js.map +1 -1
  193. package/lib/components/avatar/src/avatar2.js +61 -29
  194. package/lib/components/avatar/src/avatar2.js.map +1 -1
  195. package/lib/components/calendar/index.js +2 -2
  196. package/lib/components/calendar/src/calendar.js +9 -192
  197. package/lib/components/calendar/src/calendar.js.map +1 -1
  198. package/lib/components/calendar/src/calendar2.js +192 -9
  199. package/lib/components/calendar/src/calendar2.js.map +1 -1
  200. package/lib/components/calendar/src/date-table.js +30 -151
  201. package/lib/components/calendar/src/date-table.js.map +1 -1
  202. package/lib/components/calendar/src/date-table2.js +151 -30
  203. package/lib/components/calendar/src/date-table2.js.map +1 -1
  204. package/lib/components/carousel/index.js +4 -4
  205. package/lib/components/carousel/src/carousel-item.js +7 -148
  206. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  207. package/lib/components/carousel/src/carousel-item2.js +148 -7
  208. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  209. package/lib/components/carousel/src/carousel.js +43 -201
  210. package/lib/components/carousel/src/carousel.js.map +1 -1
  211. package/lib/components/carousel/src/carousel2.js +201 -43
  212. package/lib/components/carousel/src/carousel2.js.map +1 -1
  213. package/lib/components/cascader-panel/src/config.js +1 -1
  214. package/lib/components/cascader-panel/src/index.js +1 -1
  215. package/lib/components/cascader-panel/src/menu.js +1 -1
  216. package/lib/components/cascader-panel/src/node.js +200 -121
  217. package/lib/components/cascader-panel/src/node.js.map +1 -1
  218. package/lib/components/cascader-panel/src/node2.js +121 -200
  219. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  220. package/lib/components/cascader-panel/src/store.js +1 -1
  221. package/lib/components/collection/src/collection.js +0 -33
  222. package/lib/components/collection/src/collection.js.map +1 -1
  223. package/lib/components/divider/index.js +2 -2
  224. package/lib/components/divider/src/divider.js +34 -17
  225. package/lib/components/divider/src/divider.js.map +1 -1
  226. package/lib/components/divider/src/divider2.js +17 -34
  227. package/lib/components/divider/src/divider2.js.map +1 -1
  228. package/lib/components/dropdown/index.d.ts +3 -3
  229. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -10
  230. package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
  231. package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +0 -3
  232. package/lib/components/dropdown/src/dropdown.d.ts +1 -1
  233. package/lib/components/dropdown/src/dropdown.vue.d.ts +3 -3
  234. package/lib/components/form/index.js +4 -4
  235. package/lib/components/form/src/form-item.js +177 -47
  236. package/lib/components/form/src/form-item.js.map +1 -1
  237. package/lib/components/form/src/form-item2.js +47 -177
  238. package/lib/components/form/src/form-item2.js.map +1 -1
  239. package/lib/components/form/src/form.js +40 -45
  240. package/lib/components/form/src/form.js.map +1 -1
  241. package/lib/components/form/src/form2.js +45 -40
  242. package/lib/components/form/src/form2.js.map +1 -1
  243. package/lib/components/image/index.js +2 -2
  244. package/lib/components/image/src/image.js +170 -46
  245. package/lib/components/image/src/image.js.map +1 -1
  246. package/lib/components/image/src/image2.js +46 -170
  247. package/lib/components/image/src/image2.js.map +1 -1
  248. package/lib/components/image-viewer/index.js +2 -2
  249. package/lib/components/image-viewer/src/image-viewer.js +31 -210
  250. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  251. package/lib/components/image-viewer/src/image-viewer2.js +210 -31
  252. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  253. package/lib/components/index.js +23 -23
  254. package/lib/components/input-number/index.js +2 -2
  255. package/lib/components/input-number/src/input-number.js +46 -171
  256. package/lib/components/input-number/src/input-number.js.map +1 -1
  257. package/lib/components/input-number/src/input-number2.js +171 -46
  258. package/lib/components/input-number/src/input-number2.js.map +1 -1
  259. package/lib/components/menu/index.d.ts +3 -3
  260. package/lib/components/menu/src/menu.d.ts +4 -4
  261. package/lib/components/popover/index.d.ts +6 -6
  262. package/lib/components/popover/src/index.vue.d.ts +3 -3
  263. package/lib/components/popover/src/popover.d.ts +1 -1
  264. package/lib/components/popper/index.js +2 -2
  265. package/lib/components/popper/src/arrow.js +7 -31
  266. package/lib/components/popper/src/arrow.js.map +1 -1
  267. package/lib/components/popper/src/arrow2.js +31 -7
  268. package/lib/components/popper/src/arrow2.js.map +1 -1
  269. package/lib/components/radio/index.js +2 -2
  270. package/lib/components/radio/src/radio-button.js +1 -1
  271. package/lib/components/radio/src/radio-button2.js +1 -1
  272. package/lib/components/radio/src/radio.js +64 -73
  273. package/lib/components/radio/src/radio.js.map +1 -1
  274. package/lib/components/radio/src/radio2.js +73 -64
  275. package/lib/components/radio/src/radio2.js.map +1 -1
  276. package/lib/components/rate/index.js +2 -2
  277. package/lib/components/rate/src/rate.js +84 -169
  278. package/lib/components/rate/src/rate.js.map +1 -1
  279. package/lib/components/rate/src/rate2.js +169 -84
  280. package/lib/components/rate/src/rate2.js.map +1 -1
  281. package/lib/components/result/index.js +2 -2
  282. package/lib/components/result/src/result.js +30 -73
  283. package/lib/components/result/src/result.js.map +1 -1
  284. package/lib/components/result/src/result2.js +73 -30
  285. package/lib/components/result/src/result2.js.map +1 -1
  286. package/lib/components/select/index.d.ts +5 -5
  287. package/lib/components/select/src/select.vue.d.ts +5 -5
  288. package/lib/components/select/src/useSelect.d.ts +5 -5
  289. package/lib/components/select-v2/index.d.ts +10 -10
  290. package/lib/components/select-v2/src/option-item.vue.d.ts +1 -1
  291. package/lib/components/select-v2/src/select.vue.d.ts +5 -5
  292. package/lib/components/select-v2/src/useSelect.d.ts +5 -5
  293. package/lib/components/skeleton/index.js +4 -4
  294. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  295. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  296. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  297. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  298. package/lib/components/skeleton/src/skeleton.js +22 -49
  299. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  300. package/lib/components/skeleton/src/skeleton2.js +49 -22
  301. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  302. package/lib/components/table/index.d.ts +1 -1
  303. package/lib/components/table/src/filter-panel.vue.d.ts +5 -5
  304. package/lib/components/table/src/table.vue.d.ts +1 -1
  305. package/lib/components/tabs/index.js +3 -3
  306. package/lib/components/tabs/src/tab-bar.js +76 -7
  307. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  308. package/lib/components/tabs/src/tab-bar2.js +7 -76
  309. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  310. package/lib/components/tabs/src/tab-nav.js +1 -1
  311. package/lib/components/tabs/src/tab-pane.js +14 -60
  312. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  313. package/lib/components/tabs/src/tab-pane2.js +60 -14
  314. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  315. package/lib/components/time-picker/src/common/picker.vue.d.ts +5 -5
  316. package/lib/components/tooltip/index.d.ts +3 -3
  317. package/lib/components/tooltip/src/tooltip.d.ts +1 -1
  318. package/lib/components/tooltip/src/tooltip.js +1 -1
  319. package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
  320. package/lib/components/tooltip/src/trigger.vue.d.ts +3 -3
  321. package/lib/components/tooltip-v2/index.js +2 -2
  322. package/lib/components/tooltip-v2/src/arrow.js +23 -38
  323. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  324. package/lib/components/tooltip-v2/src/arrow2.js +38 -23
  325. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  326. package/lib/components/tooltip-v2/src/tooltip.js +2 -2
  327. package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
  328. package/lib/components/tooltip-v2/src/trigger.js +89 -11
  329. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  330. package/lib/components/tooltip-v2/src/trigger2.js +11 -89
  331. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  332. package/lib/components/upload/index.js +1 -1
  333. package/lib/components/upload/src/upload-content.js +1 -1
  334. package/lib/components/upload/src/upload-dragger.js +32 -12
  335. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  336. package/lib/components/upload/src/upload-dragger2.js +12 -32
  337. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  338. package/lib/index.js +23 -23
  339. package/package.json +1 -1
  340. package/web-types.json +1 -1
@@ -1,208 +1,50 @@
1
- import { defineComponent, ref, computed, unref, shallowRef, onMounted, nextTick, onBeforeUnmount, provide, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, withCtx, renderSlot, Fragment, renderList, toDisplayString, createCommentVNode } from 'vue';
2
- import { useResizeObserver } from '@vueuse/core';
3
1
  import '../../../utils/index.mjs';
4
- import { PsIcon } from '../../icon/index.mjs';
5
- import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
6
- import '../../../hooks/index.mjs';
7
- import '../../../tokens/index.mjs';
8
- import { carouselProps } from './carousel2.mjs';
9
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
- import { isString } from '@vue/shared';
12
- import { debugWarn } from '../../../utils/error.mjs';
13
- import { carouselContextKey } from '../../../tokens/carousel.mjs';
2
+ import { buildProps } from '../../../utils/vue/props.mjs';
14
3
 
15
- const _hoisted_1 = { key: 0 };
16
- const __default__ = {
17
- name: "PsCarousel"
18
- };
19
- const _sfc_main = /* @__PURE__ */ defineComponent({
20
- ...__default__,
21
- props: carouselProps,
22
- setup(__props, { expose }) {
23
- const props = __props;
24
- const ns = useNamespace("carousel");
25
- const COMPONENT_NAME = "PsCarousel";
26
- const THROTTLE_TIME = 300;
27
- const activeIndex = ref(-1);
28
- const timer = ref(null);
29
- const hover = ref(false);
30
- const root = ref();
31
- const items = ref([]);
32
- const arrowDisplay = computed(() => props.arrow !== "never" && !unref(isVertical));
33
- const hasLabel = computed(() => {
34
- return items.value.some((item) => item.props.label.toString().length > 0);
35
- });
36
- const carouselClasses = computed(() => {
37
- const classes = [ns.b(), ns.m(props.direction)];
38
- if (unref(isCardType)) {
39
- classes.push(ns.m("card"));
40
- }
41
- return classes;
42
- });
43
- const indicatorsClasses = computed(() => {
44
- const classes = [ns.e("indicators"), ns.em("indicators", props.direction)];
45
- if (hasLabel.value) {
46
- classes.push(ns.em("indicators", "labels"));
47
- }
48
- if (props.indicatorPosition === "outside" || unref(isCardType)) {
49
- classes.push(ns.em("indicators", "outside"));
50
- }
51
- return classes;
52
- });
53
- const isCardType = computed(() => props.type === "card");
54
- const isVertical = computed(() => props.direction === "vertical");
55
- function pauseTimer() {
56
- if (timer.value) {
57
- clearInterval(timer.value);
58
- timer.value = null;
59
- }
4
+ const carouselProps = buildProps({
5
+ initialIndex: {
6
+ type: Number,
7
+ default: 0
8
+ },
9
+ height: { type: String, default: "" },
10
+ trigger: {
11
+ type: String,
12
+ default: "hover"
13
+ },
14
+ autoplay: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ interval: {
19
+ type: Number,
20
+ default: 3e3
21
+ },
22
+ indicatorPosition: { type: String, default: "" },
23
+ indicator: {
24
+ type: Boolean,
25
+ default: true
26
+ },
27
+ arrow: {
28
+ type: String,
29
+ default: "hover"
30
+ },
31
+ type: { type: String, default: "" },
32
+ loop: {
33
+ type: Boolean,
34
+ default: true
35
+ },
36
+ direction: {
37
+ type: String,
38
+ default: "horizontal",
39
+ validator(val) {
40
+ return ["horizontal", "vertical"].includes(val);
60
41
  }
61
- function startTimer() {
62
- if (props.interval <= 0 || !props.autoplay || timer.value)
63
- return;
64
- timer.value = setInterval(() => playSlides(), props.interval);
65
- }
66
- const playSlides = () => {
67
- if (activeIndex.value < items.value.length - 1) {
68
- activeIndex.value = activeIndex.value + 1;
69
- } else if (props.loop) {
70
- activeIndex.value = 0;
71
- }
72
- };
73
- function setActiveItem(index) {
74
- if (isString(index)) {
75
- const filteredItems = items.value.filter((item) => item.props.name === index);
76
- if (filteredItems.length > 0) {
77
- index = items.value.indexOf(filteredItems[0]);
78
- }
79
- }
80
- index = Number(index);
81
- if (Number.isNaN(index) || index !== Math.floor(index)) {
82
- debugWarn(COMPONENT_NAME, "index must be integer.");
83
- return;
84
- }
85
- const itemCount = items.value.length;
86
- const oldIndex = activeIndex.value;
87
- if (index < 0) {
88
- activeIndex.value = props.loop ? itemCount - 1 : 0;
89
- } else if (index >= itemCount) {
90
- activeIndex.value = props.loop ? 0 : itemCount - 1;
91
- } else {
92
- activeIndex.value = index;
93
- }
94
- if (oldIndex === activeIndex.value) {
95
- resetItemPosition(oldIndex);
96
- }
97
- }
98
- function resetItemPosition(oldIndex) {
99
- items.value.forEach((item, index) => {
100
- item.translateItem(index, activeIndex.value, oldIndex);
101
- });
102
- }
103
- function addItem(item) {
104
- items.value.push(item);
105
- }
106
- function removeItem(uid) {
107
- const index = items.value.findIndex((item) => item.uid === uid);
108
- if (index !== -1) {
109
- items.value.splice(index, 1);
110
- if (activeIndex.value === index)
111
- next();
112
- }
113
- }
114
- function next() {
115
- setActiveItem(activeIndex.value + 1);
116
- }
117
- const resizeObserver = shallowRef();
118
- onMounted(async () => {
119
- await nextTick();
120
- resizeObserver.value = useResizeObserver(root.value, () => {
121
- resetItemPosition();
122
- });
123
- if (props.initialIndex < items.value.length && props.initialIndex >= 0) {
124
- activeIndex.value = props.initialIndex;
125
- }
126
- startTimer();
127
- });
128
- onBeforeUnmount(() => {
129
- pauseTimer();
130
- if (root.value && resizeObserver.value)
131
- resizeObserver.value.stop();
132
- });
133
- provide(carouselContextKey, {
134
- root,
135
- isCardType,
136
- isVertical,
137
- items,
138
- loop: props.loop,
139
- addItem,
140
- removeItem,
141
- setActiveItem
142
- });
143
- expose({
144
- setActiveItem
145
- });
146
- return (_ctx, _cache) => {
147
- return openBlock(), createElementBlock("div", {
148
- ref_key: "root",
149
- ref: root,
150
- class: normalizeClass(unref(carouselClasses))
151
- }, [
152
- createElementVNode("div", {
153
- class: normalizeClass(unref(ns).e("container")),
154
- style: normalizeStyle({ height: _ctx.height })
155
- }, [
156
- createElementVNode("button", {
157
- type: "button",
158
- class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "left")])
159
- }, [
160
- createVNode(unref(PsIcon), null, {
161
- default: withCtx(() => [
162
- createVNode(unref(ArrowLeft))
163
- ]),
164
- _: 1
165
- })
166
- ], 2),
167
- createElementVNode("button", {
168
- type: "button",
169
- class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "right")])
170
- }, [
171
- createVNode(unref(PsIcon), null, {
172
- default: withCtx(() => [
173
- createVNode(unref(ArrowRight))
174
- ]),
175
- _: 1
176
- })
177
- ], 2),
178
- renderSlot(_ctx.$slots, "default")
179
- ], 6),
180
- _ctx.indicatorPosition !== "none" ? (openBlock(), createElementBlock("ul", {
181
- key: 0,
182
- class: normalizeClass(unref(indicatorsClasses))
183
- }, [
184
- (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
185
- return openBlock(), createElementBlock("li", {
186
- key: index,
187
- class: normalizeClass([
188
- unref(ns).e("indicator"),
189
- unref(ns).em("indicator", _ctx.direction),
190
- unref(ns).is("active", index === activeIndex.value)
191
- ])
192
- }, [
193
- createElementVNode("button", {
194
- class: normalizeClass(unref(ns).e("button"))
195
- }, [
196
- unref(hasLabel) ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(item.props.label), 1)) : createCommentVNode("v-if", true)
197
- ], 2)
198
- ], 2);
199
- }), 128))
200
- ], 2)) : createCommentVNode("v-if", true)
201
- ], 2);
202
- };
42
+ },
43
+ pauseOnHover: {
44
+ type: Boolean,
45
+ default: true
203
46
  }
204
47
  });
205
- var Carousel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/carousel/src/carousel.vue"]]);
206
48
 
207
- export { Carousel as default };
49
+ export { carouselProps };
208
50
  //# sourceMappingURL=carousel.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.mjs","sources":["../../../../../../packages/components/carousel/src/carousel.vue"],"sourcesContent":["<template>\n <div\n ref=\"root\"\n :class=\"carouselClasses\"\n >\n <div :class=\"ns.e('container')\" :style=\"{ height: height }\">\n <button\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'left')]\"\n >\n <PsIcon>\n <ArrowLeft />\n </PsIcon>\n </button>\n <button\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'right')]\"\n >\n <PsIcon>\n <ArrowRight />\n </PsIcon>\n </button>\n <slot />\n </div>\n <ul v-if=\"indicatorPosition !== 'none'\" :class=\"indicatorsClasses\">\n <li\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"[\n ns.e('indicator'),\n ns.em('indicator', direction),\n ns.is('active', index === activeIndex),\n ]\"\n >\n <button :class=\"ns.e('button')\">\n <span v-if=\"hasLabel\">{{ item.props.label }}</span>\n </button>\n </li>\n </ul>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n unref,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { debugWarn, isString } from '@element-ps/utils'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-ps/hooks'\nimport { carouselContextKey } from '@element-ps/tokens'\nimport { carouselProps } from './carousel'\nimport type { CarouselItemContext } from '@element-ps/tokens'\n\ndefineOptions({\n name: 'PsCarousel',\n})\n\nconst props = defineProps(carouselProps)\nconst ns = useNamespace('carousel')\nconst COMPONENT_NAME = 'PsCarousel'\nconst THROTTLE_TIME = 300\n\n// refs\nconst activeIndex = ref(-1)\nconst timer = ref<ReturnType<typeof setInterval> | null>(null)\nconst hover = ref(false)\nconst root = ref<HTMLDivElement>()\nconst items = ref<Array<CarouselItemContext>>([])\n\n// computed\nconst arrowDisplay = computed(\n () => props.arrow !== 'never' && !unref(isVertical)\n)\n\nconst hasLabel = computed(() => {\n return items.value.some((item) => item.props.label.toString().length > 0)\n})\n\nconst carouselClasses = computed(() => {\n const classes = [ns.b(), ns.m(props.direction)]\n if (unref(isCardType)) {\n classes.push(ns.m('card'))\n }\n return classes\n})\n\nconst indicatorsClasses = computed(() => {\n const classes = [ns.e('indicators'), ns.em('indicators', props.direction)]\n if (hasLabel.value) {\n classes.push(ns.em('indicators', 'labels'))\n }\n if (props.indicatorPosition === 'outside' || unref(isCardType)) {\n classes.push(ns.em('indicators', 'outside'))\n }\n return classes\n})\n\nconst isCardType = computed(() => props.type === 'card')\nconst isVertical = computed(() => props.direction === 'vertical')\n\nfunction pauseTimer() {\n if (timer.value) {\n clearInterval(timer.value)\n timer.value = null\n }\n}\n\nfunction startTimer() {\n if (props.interval <= 0 || !props.autoplay || timer.value) return\n timer.value = setInterval(() => playSlides(), props.interval)\n}\n\nconst playSlides = () => {\n if (activeIndex.value < items.value.length - 1) {\n activeIndex.value = activeIndex.value + 1\n } else if (props.loop) {\n activeIndex.value = 0\n }\n}\n\nfunction setActiveItem(index: number | string) {\n if (isString(index)) {\n const filteredItems = items.value.filter(\n (item) => item.props.name === index\n )\n if (filteredItems.length > 0) {\n index = items.value.indexOf(filteredItems[0])\n }\n }\n index = Number(index)\n if (Number.isNaN(index) || index !== Math.floor(index)) {\n debugWarn(COMPONENT_NAME, 'index must be integer.')\n return\n }\n const itemCount = items.value.length\n const oldIndex = activeIndex.value\n if (index < 0) {\n activeIndex.value = props.loop ? itemCount - 1 : 0\n } else if (index >= itemCount) {\n activeIndex.value = props.loop ? 0 : itemCount - 1\n } else {\n activeIndex.value = index\n }\n if (oldIndex === activeIndex.value) {\n resetItemPosition(oldIndex)\n }\n}\n\nfunction resetItemPosition(oldIndex?: number) {\n items.value.forEach((item, index) => {\n item.translateItem(index, activeIndex.value, oldIndex)\n })\n}\n\nfunction addItem(item: CarouselItemContext) {\n items.value.push(item)\n}\n\nfunction removeItem(uid?: number) {\n const index = items.value.findIndex((item) => item.uid === uid)\n if (index !== -1) {\n items.value.splice(index, 1)\n if (activeIndex.value === index) next()\n }\n}\n\nfunction next() {\n setActiveItem(activeIndex.value + 1)\n}\n\nconst resizeObserver = shallowRef<ReturnType<typeof useResizeObserver>>()\n// lifecycle\nonMounted(async () => {\n await nextTick()\n\n resizeObserver.value = useResizeObserver(root.value, () => {\n resetItemPosition()\n })\n if (props.initialIndex < items.value.length && props.initialIndex >= 0) {\n activeIndex.value = props.initialIndex\n }\n startTimer()\n})\n\nonBeforeUnmount(() => {\n pauseTimer()\n if (root.value && resizeObserver.value) resizeObserver.value.stop()\n})\n\n// provide\nprovide(carouselContextKey, {\n root,\n isCardType,\n isVertical,\n items,\n loop: props.loop,\n addItem,\n removeItem,\n setActiveItem,\n})\n\ndefineExpose({\n /** @description manually switch slide */\n setActiveItem,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmEA,IAAA,MAAA,EAAA,GAAA,aAAA,UAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,YAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,GAAA,CAAA;AAGA,IAAA,MAAA,WAAA,GAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,IAAA,IAAA,CAAA,CAA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AA,CAAA,kBAAA,EAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,KAAA;AAAA,MACA,MAAA,KAAA,CAAA,IAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,aAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"carousel.mjs","sources":["../../../../../../packages/components/carousel/src/carousel.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Carousel from './carousel.vue'\n\nexport const carouselProps = buildProps({\n initialIndex: {\n type: Number,\n default: 0,\n },\n height: { type: String, default: '' },\n trigger: {\n type: String,\n default: 'hover',\n },\n autoplay: {\n type: Boolean,\n default: true,\n },\n interval: {\n type: Number,\n default: 3000,\n },\n indicatorPosition: { type: String, default: '' },\n indicator: {\n type: Boolean,\n default: true,\n },\n arrow: {\n type: String,\n default: 'hover',\n },\n type: { type: String, default: '' },\n loop: {\n type: Boolean,\n default: true,\n },\n direction: {\n type: String,\n default: 'horizontal',\n validator(val: string) {\n return ['horizontal', 'vertical'].includes(val)\n },\n },\n pauseOnHover: {\n type: Boolean,\n default: true,\n },\n} as const)\n\nexport type CarouselProps = ExtractPropTypes<typeof carouselProps>\n\nexport type CarouselInstance = InstanceType<typeof Carousel>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACvC,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AAClD,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,SAAS,CAAC,GAAG,EAAE;AACnB,MAAM,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACtD,KAAK;AACL,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC;;;;"}
@@ -1,50 +1,208 @@
1
+ import { defineComponent, ref, computed, unref, shallowRef, onMounted, nextTick, onBeforeUnmount, provide, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, withCtx, renderSlot, Fragment, renderList, toDisplayString, createCommentVNode } from 'vue';
2
+ import { useResizeObserver } from '@vueuse/core';
1
3
  import '../../../utils/index.mjs';
2
- import { buildProps } from '../../../utils/vue/props.mjs';
4
+ import { PsIcon } from '../../icon/index.mjs';
5
+ import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
6
+ import '../../../hooks/index.mjs';
7
+ import '../../../tokens/index.mjs';
8
+ import { carouselProps } from './carousel.mjs';
9
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { isString } from '@vue/shared';
12
+ import { debugWarn } from '../../../utils/error.mjs';
13
+ import { carouselContextKey } from '../../../tokens/carousel.mjs';
3
14
 
4
- const carouselProps = buildProps({
5
- initialIndex: {
6
- type: Number,
7
- default: 0
8
- },
9
- height: { type: String, default: "" },
10
- trigger: {
11
- type: String,
12
- default: "hover"
13
- },
14
- autoplay: {
15
- type: Boolean,
16
- default: true
17
- },
18
- interval: {
19
- type: Number,
20
- default: 3e3
21
- },
22
- indicatorPosition: { type: String, default: "" },
23
- indicator: {
24
- type: Boolean,
25
- default: true
26
- },
27
- arrow: {
28
- type: String,
29
- default: "hover"
30
- },
31
- type: { type: String, default: "" },
32
- loop: {
33
- type: Boolean,
34
- default: true
35
- },
36
- direction: {
37
- type: String,
38
- default: "horizontal",
39
- validator(val) {
40
- return ["horizontal", "vertical"].includes(val);
15
+ const _hoisted_1 = { key: 0 };
16
+ const __default__ = {
17
+ name: "PsCarousel"
18
+ };
19
+ const _sfc_main = /* @__PURE__ */ defineComponent({
20
+ ...__default__,
21
+ props: carouselProps,
22
+ setup(__props, { expose }) {
23
+ const props = __props;
24
+ const ns = useNamespace("carousel");
25
+ const COMPONENT_NAME = "PsCarousel";
26
+ const THROTTLE_TIME = 300;
27
+ const activeIndex = ref(-1);
28
+ const timer = ref(null);
29
+ const hover = ref(false);
30
+ const root = ref();
31
+ const items = ref([]);
32
+ const arrowDisplay = computed(() => props.arrow !== "never" && !unref(isVertical));
33
+ const hasLabel = computed(() => {
34
+ return items.value.some((item) => item.props.label.toString().length > 0);
35
+ });
36
+ const carouselClasses = computed(() => {
37
+ const classes = [ns.b(), ns.m(props.direction)];
38
+ if (unref(isCardType)) {
39
+ classes.push(ns.m("card"));
40
+ }
41
+ return classes;
42
+ });
43
+ const indicatorsClasses = computed(() => {
44
+ const classes = [ns.e("indicators"), ns.em("indicators", props.direction)];
45
+ if (hasLabel.value) {
46
+ classes.push(ns.em("indicators", "labels"));
47
+ }
48
+ if (props.indicatorPosition === "outside" || unref(isCardType)) {
49
+ classes.push(ns.em("indicators", "outside"));
50
+ }
51
+ return classes;
52
+ });
53
+ const isCardType = computed(() => props.type === "card");
54
+ const isVertical = computed(() => props.direction === "vertical");
55
+ function pauseTimer() {
56
+ if (timer.value) {
57
+ clearInterval(timer.value);
58
+ timer.value = null;
59
+ }
41
60
  }
42
- },
43
- pauseOnHover: {
44
- type: Boolean,
45
- default: true
61
+ function startTimer() {
62
+ if (props.interval <= 0 || !props.autoplay || timer.value)
63
+ return;
64
+ timer.value = setInterval(() => playSlides(), props.interval);
65
+ }
66
+ const playSlides = () => {
67
+ if (activeIndex.value < items.value.length - 1) {
68
+ activeIndex.value = activeIndex.value + 1;
69
+ } else if (props.loop) {
70
+ activeIndex.value = 0;
71
+ }
72
+ };
73
+ function setActiveItem(index) {
74
+ if (isString(index)) {
75
+ const filteredItems = items.value.filter((item) => item.props.name === index);
76
+ if (filteredItems.length > 0) {
77
+ index = items.value.indexOf(filteredItems[0]);
78
+ }
79
+ }
80
+ index = Number(index);
81
+ if (Number.isNaN(index) || index !== Math.floor(index)) {
82
+ debugWarn(COMPONENT_NAME, "index must be integer.");
83
+ return;
84
+ }
85
+ const itemCount = items.value.length;
86
+ const oldIndex = activeIndex.value;
87
+ if (index < 0) {
88
+ activeIndex.value = props.loop ? itemCount - 1 : 0;
89
+ } else if (index >= itemCount) {
90
+ activeIndex.value = props.loop ? 0 : itemCount - 1;
91
+ } else {
92
+ activeIndex.value = index;
93
+ }
94
+ if (oldIndex === activeIndex.value) {
95
+ resetItemPosition(oldIndex);
96
+ }
97
+ }
98
+ function resetItemPosition(oldIndex) {
99
+ items.value.forEach((item, index) => {
100
+ item.translateItem(index, activeIndex.value, oldIndex);
101
+ });
102
+ }
103
+ function addItem(item) {
104
+ items.value.push(item);
105
+ }
106
+ function removeItem(uid) {
107
+ const index = items.value.findIndex((item) => item.uid === uid);
108
+ if (index !== -1) {
109
+ items.value.splice(index, 1);
110
+ if (activeIndex.value === index)
111
+ next();
112
+ }
113
+ }
114
+ function next() {
115
+ setActiveItem(activeIndex.value + 1);
116
+ }
117
+ const resizeObserver = shallowRef();
118
+ onMounted(async () => {
119
+ await nextTick();
120
+ resizeObserver.value = useResizeObserver(root.value, () => {
121
+ resetItemPosition();
122
+ });
123
+ if (props.initialIndex < items.value.length && props.initialIndex >= 0) {
124
+ activeIndex.value = props.initialIndex;
125
+ }
126
+ startTimer();
127
+ });
128
+ onBeforeUnmount(() => {
129
+ pauseTimer();
130
+ if (root.value && resizeObserver.value)
131
+ resizeObserver.value.stop();
132
+ });
133
+ provide(carouselContextKey, {
134
+ root,
135
+ isCardType,
136
+ isVertical,
137
+ items,
138
+ loop: props.loop,
139
+ addItem,
140
+ removeItem,
141
+ setActiveItem
142
+ });
143
+ expose({
144
+ setActiveItem
145
+ });
146
+ return (_ctx, _cache) => {
147
+ return openBlock(), createElementBlock("div", {
148
+ ref_key: "root",
149
+ ref: root,
150
+ class: normalizeClass(unref(carouselClasses))
151
+ }, [
152
+ createElementVNode("div", {
153
+ class: normalizeClass(unref(ns).e("container")),
154
+ style: normalizeStyle({ height: _ctx.height })
155
+ }, [
156
+ createElementVNode("button", {
157
+ type: "button",
158
+ class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "left")])
159
+ }, [
160
+ createVNode(unref(PsIcon), null, {
161
+ default: withCtx(() => [
162
+ createVNode(unref(ArrowLeft))
163
+ ]),
164
+ _: 1
165
+ })
166
+ ], 2),
167
+ createElementVNode("button", {
168
+ type: "button",
169
+ class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "right")])
170
+ }, [
171
+ createVNode(unref(PsIcon), null, {
172
+ default: withCtx(() => [
173
+ createVNode(unref(ArrowRight))
174
+ ]),
175
+ _: 1
176
+ })
177
+ ], 2),
178
+ renderSlot(_ctx.$slots, "default")
179
+ ], 6),
180
+ _ctx.indicatorPosition !== "none" ? (openBlock(), createElementBlock("ul", {
181
+ key: 0,
182
+ class: normalizeClass(unref(indicatorsClasses))
183
+ }, [
184
+ (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
185
+ return openBlock(), createElementBlock("li", {
186
+ key: index,
187
+ class: normalizeClass([
188
+ unref(ns).e("indicator"),
189
+ unref(ns).em("indicator", _ctx.direction),
190
+ unref(ns).is("active", index === activeIndex.value)
191
+ ])
192
+ }, [
193
+ createElementVNode("button", {
194
+ class: normalizeClass(unref(ns).e("button"))
195
+ }, [
196
+ unref(hasLabel) ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(item.props.label), 1)) : createCommentVNode("v-if", true)
197
+ ], 2)
198
+ ], 2);
199
+ }), 128))
200
+ ], 2)) : createCommentVNode("v-if", true)
201
+ ], 2);
202
+ };
46
203
  }
47
204
  });
205
+ var Carousel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/carousel/src/carousel.vue"]]);
48
206
 
49
- export { carouselProps };
207
+ export { Carousel as default };
50
208
  //# sourceMappingURL=carousel2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel2.mjs","sources":["../../../../../../packages/components/carousel/src/carousel.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Carousel from './carousel.vue'\n\nexport const carouselProps = buildProps({\n initialIndex: {\n type: Number,\n default: 0,\n },\n height: { type: String, default: '' },\n trigger: {\n type: String,\n default: 'hover',\n },\n autoplay: {\n type: Boolean,\n default: true,\n },\n interval: {\n type: Number,\n default: 3000,\n },\n indicatorPosition: { type: String, default: '' },\n indicator: {\n type: Boolean,\n default: true,\n },\n arrow: {\n type: String,\n default: 'hover',\n },\n type: { type: String, default: '' },\n loop: {\n type: Boolean,\n default: true,\n },\n direction: {\n type: String,\n default: 'horizontal',\n validator(val: string) {\n return ['horizontal', 'vertical'].includes(val)\n },\n },\n pauseOnHover: {\n type: Boolean,\n default: true,\n },\n} as const)\n\nexport type CarouselProps = ExtractPropTypes<typeof carouselProps>\n\nexport type CarouselInstance = InstanceType<typeof Carousel>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACvC,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AAClD,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,SAAS,CAAC,GAAG,EAAE;AACnB,MAAM,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACtD,KAAK;AACL,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"carousel2.mjs","sources":["../../../../../../packages/components/carousel/src/carousel.vue"],"sourcesContent":["<template>\n <div\n ref=\"root\"\n :class=\"carouselClasses\"\n >\n <div :class=\"ns.e('container')\" :style=\"{ height: height }\">\n <button\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'left')]\"\n >\n <PsIcon>\n <ArrowLeft />\n </PsIcon>\n </button>\n <button\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'right')]\"\n >\n <PsIcon>\n <ArrowRight />\n </PsIcon>\n </button>\n <slot />\n </div>\n <ul v-if=\"indicatorPosition !== 'none'\" :class=\"indicatorsClasses\">\n <li\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"[\n ns.e('indicator'),\n ns.em('indicator', direction),\n ns.is('active', index === activeIndex),\n ]\"\n >\n <button :class=\"ns.e('button')\">\n <span v-if=\"hasLabel\">{{ item.props.label }}</span>\n </button>\n </li>\n </ul>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n unref,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { debugWarn, isString } from '@element-ps/utils'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-ps/hooks'\nimport { carouselContextKey } from '@element-ps/tokens'\nimport { carouselProps } from './carousel'\nimport type { CarouselItemContext } from '@element-ps/tokens'\n\ndefineOptions({\n name: 'PsCarousel',\n})\n\nconst props = defineProps(carouselProps)\nconst ns = useNamespace('carousel')\nconst COMPONENT_NAME = 'PsCarousel'\nconst THROTTLE_TIME = 300\n\n// refs\nconst activeIndex = ref(-1)\nconst timer = ref<ReturnType<typeof setInterval> | null>(null)\nconst hover = ref(false)\nconst root = ref<HTMLDivElement>()\nconst items = ref<Array<CarouselItemContext>>([])\n\n// computed\nconst arrowDisplay = computed(\n () => props.arrow !== 'never' && !unref(isVertical)\n)\n\nconst hasLabel = computed(() => {\n return items.value.some((item) => item.props.label.toString().length > 0)\n})\n\nconst carouselClasses = computed(() => {\n const classes = [ns.b(), ns.m(props.direction)]\n if (unref(isCardType)) {\n classes.push(ns.m('card'))\n }\n return classes\n})\n\nconst indicatorsClasses = computed(() => {\n const classes = [ns.e('indicators'), ns.em('indicators', props.direction)]\n if (hasLabel.value) {\n classes.push(ns.em('indicators', 'labels'))\n }\n if (props.indicatorPosition === 'outside' || unref(isCardType)) {\n classes.push(ns.em('indicators', 'outside'))\n }\n return classes\n})\n\nconst isCardType = computed(() => props.type === 'card')\nconst isVertical = computed(() => props.direction === 'vertical')\n\nfunction pauseTimer() {\n if (timer.value) {\n clearInterval(timer.value)\n timer.value = null\n }\n}\n\nfunction startTimer() {\n if (props.interval <= 0 || !props.autoplay || timer.value) return\n timer.value = setInterval(() => playSlides(), props.interval)\n}\n\nconst playSlides = () => {\n if (activeIndex.value < items.value.length - 1) {\n activeIndex.value = activeIndex.value + 1\n } else if (props.loop) {\n activeIndex.value = 0\n }\n}\n\nfunction setActiveItem(index: number | string) {\n if (isString(index)) {\n const filteredItems = items.value.filter(\n (item) => item.props.name === index\n )\n if (filteredItems.length > 0) {\n index = items.value.indexOf(filteredItems[0])\n }\n }\n index = Number(index)\n if (Number.isNaN(index) || index !== Math.floor(index)) {\n debugWarn(COMPONENT_NAME, 'index must be integer.')\n return\n }\n const itemCount = items.value.length\n const oldIndex = activeIndex.value\n if (index < 0) {\n activeIndex.value = props.loop ? itemCount - 1 : 0\n } else if (index >= itemCount) {\n activeIndex.value = props.loop ? 0 : itemCount - 1\n } else {\n activeIndex.value = index\n }\n if (oldIndex === activeIndex.value) {\n resetItemPosition(oldIndex)\n }\n}\n\nfunction resetItemPosition(oldIndex?: number) {\n items.value.forEach((item, index) => {\n item.translateItem(index, activeIndex.value, oldIndex)\n })\n}\n\nfunction addItem(item: CarouselItemContext) {\n items.value.push(item)\n}\n\nfunction removeItem(uid?: number) {\n const index = items.value.findIndex((item) => item.uid === uid)\n if (index !== -1) {\n items.value.splice(index, 1)\n if (activeIndex.value === index) next()\n }\n}\n\nfunction next() {\n setActiveItem(activeIndex.value + 1)\n}\n\nconst resizeObserver = shallowRef<ReturnType<typeof useResizeObserver>>()\n// lifecycle\nonMounted(async () => {\n await nextTick()\n\n resizeObserver.value = useResizeObserver(root.value, () => {\n resetItemPosition()\n })\n if (props.initialIndex < items.value.length && props.initialIndex >= 0) {\n activeIndex.value = props.initialIndex\n }\n startTimer()\n})\n\nonBeforeUnmount(() => {\n pauseTimer()\n if (root.value && resizeObserver.value) resizeObserver.value.stop()\n})\n\n// provide\nprovide(carouselContextKey, {\n root,\n isCardType,\n isVertical,\n items,\n loop: props.loop,\n addItem,\n removeItem,\n setActiveItem,\n})\n\ndefineExpose({\n /** @description manually switch slide */\n setActiveItem,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmEA,IAAA,MAAA,EAAA,GAAA,aAAA,UAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,YAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,GAAA,CAAA;AAGA,IAAA,MAAA,WAAA,GAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA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A,CAAA,CAAA;AAGA,IAAA,OAAA,CAAA,kBAAA,EAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,KAAA;AAAA,MACA,MAAA,KAAA,CAAA,IAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,aAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { computed } from 'vue';
2
2
  import { NOOP } from '@vue/shared';
3
- import { ExpandTrigger } from './node.mjs';
3
+ import { ExpandTrigger } from './node2.mjs';
4
4
 
5
5
  const CommonProps = {
6
6
  modelValue: [Number, String, Array],
@@ -6,7 +6,7 @@ import '../../../constants/index.mjs';
6
6
  import '../../../hooks/index.mjs';
7
7
  import PsCascaderMenu from './menu.mjs';
8
8
  import Store from './store.mjs';
9
- import Node, { ExpandTrigger } from './node.mjs';
9
+ import Node, { ExpandTrigger } from './node2.mjs';
10
10
  import { CommonProps, useCascaderConfig } from './config.mjs';
11
11
  import { sortByOriginalOrder, checkNode, getMenuIndex } from './utils.mjs';
12
12
  import { CASCADER_PANEL_INJECTION_KEY } from './types.mjs';
@@ -4,7 +4,7 @@ import '../../../hooks/index.mjs';
4
4
  import '../../../utils/index.mjs';
5
5
  import { Loading } from '@element-plus/icons-vue';
6
6
  import { PsIcon } from '../../icon/index.mjs';
7
- import PsCascaderNode from './node2.mjs';
7
+ import PsCascaderNode from './node.mjs';
8
8
  import { CASCADER_PANEL_INJECTION_KEY } from './types.mjs';
9
9
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
10
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';