@element-plus/nightly 0.0.20221022 → 0.0.20221024

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 (324) hide show
  1. package/dist/index.full.js +293 -234
  2. package/dist/index.full.min.js +15 -15
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +14 -14
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +293 -234
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar.js +1 -1
  12. package/dist/locale/ar.min.js +1 -1
  13. package/dist/locale/ar.min.mjs +1 -1
  14. package/dist/locale/ar.mjs +1 -1
  15. package/dist/locale/az.js +1 -1
  16. package/dist/locale/az.min.js +1 -1
  17. package/dist/locale/az.min.mjs +1 -1
  18. package/dist/locale/az.mjs +1 -1
  19. package/dist/locale/bg.js +1 -1
  20. package/dist/locale/bg.min.js +1 -1
  21. package/dist/locale/bg.min.mjs +1 -1
  22. package/dist/locale/bg.mjs +1 -1
  23. package/dist/locale/bn.js +1 -1
  24. package/dist/locale/bn.min.js +1 -1
  25. package/dist/locale/bn.min.mjs +1 -1
  26. package/dist/locale/bn.mjs +1 -1
  27. package/dist/locale/ca.js +1 -1
  28. package/dist/locale/ca.min.js +1 -1
  29. package/dist/locale/ca.min.mjs +1 -1
  30. package/dist/locale/ca.mjs +1 -1
  31. package/dist/locale/cs.js +1 -1
  32. package/dist/locale/cs.min.js +1 -1
  33. package/dist/locale/cs.min.mjs +1 -1
  34. package/dist/locale/cs.mjs +1 -1
  35. package/dist/locale/da.js +1 -1
  36. package/dist/locale/da.min.js +1 -1
  37. package/dist/locale/da.min.mjs +1 -1
  38. package/dist/locale/da.mjs +1 -1
  39. package/dist/locale/de.js +1 -1
  40. package/dist/locale/de.min.js +1 -1
  41. package/dist/locale/de.min.mjs +1 -1
  42. package/dist/locale/de.mjs +1 -1
  43. package/dist/locale/el.js +1 -1
  44. package/dist/locale/el.min.js +1 -1
  45. package/dist/locale/el.min.mjs +1 -1
  46. package/dist/locale/el.mjs +1 -1
  47. package/dist/locale/en.js +1 -1
  48. package/dist/locale/en.min.js +1 -1
  49. package/dist/locale/en.min.mjs +1 -1
  50. package/dist/locale/en.mjs +1 -1
  51. package/dist/locale/eo.js +1 -1
  52. package/dist/locale/eo.min.js +1 -1
  53. package/dist/locale/eo.min.mjs +1 -1
  54. package/dist/locale/eo.mjs +1 -1
  55. package/dist/locale/es.js +1 -1
  56. package/dist/locale/es.min.js +1 -1
  57. package/dist/locale/es.min.mjs +1 -1
  58. package/dist/locale/es.mjs +1 -1
  59. package/dist/locale/et.js +1 -1
  60. package/dist/locale/et.min.js +1 -1
  61. package/dist/locale/et.min.mjs +1 -1
  62. package/dist/locale/et.mjs +1 -1
  63. package/dist/locale/eu.js +1 -1
  64. package/dist/locale/eu.min.js +1 -1
  65. package/dist/locale/eu.min.mjs +1 -1
  66. package/dist/locale/eu.mjs +1 -1
  67. package/dist/locale/fa.js +1 -1
  68. package/dist/locale/fa.min.js +1 -1
  69. package/dist/locale/fa.min.mjs +1 -1
  70. package/dist/locale/fa.mjs +1 -1
  71. package/dist/locale/fi.js +1 -1
  72. package/dist/locale/fi.min.js +1 -1
  73. package/dist/locale/fi.min.mjs +1 -1
  74. package/dist/locale/fi.mjs +1 -1
  75. package/dist/locale/fr.js +1 -1
  76. package/dist/locale/fr.min.js +1 -1
  77. package/dist/locale/fr.min.mjs +1 -1
  78. package/dist/locale/fr.mjs +1 -1
  79. package/dist/locale/he.js +1 -1
  80. package/dist/locale/he.min.js +1 -1
  81. package/dist/locale/he.min.mjs +1 -1
  82. package/dist/locale/he.mjs +1 -1
  83. package/dist/locale/hr.js +1 -1
  84. package/dist/locale/hr.min.js +1 -1
  85. package/dist/locale/hr.min.mjs +1 -1
  86. package/dist/locale/hr.mjs +1 -1
  87. package/dist/locale/hu.js +1 -1
  88. package/dist/locale/hu.min.js +1 -1
  89. package/dist/locale/hu.min.mjs +1 -1
  90. package/dist/locale/hu.mjs +1 -1
  91. package/dist/locale/hy-am.js +1 -1
  92. package/dist/locale/hy-am.min.js +1 -1
  93. package/dist/locale/hy-am.min.mjs +1 -1
  94. package/dist/locale/hy-am.mjs +1 -1
  95. package/dist/locale/id.js +1 -1
  96. package/dist/locale/id.min.js +1 -1
  97. package/dist/locale/id.min.mjs +1 -1
  98. package/dist/locale/id.mjs +1 -1
  99. package/dist/locale/it.js +1 -1
  100. package/dist/locale/it.min.js +1 -1
  101. package/dist/locale/it.min.mjs +1 -1
  102. package/dist/locale/it.mjs +1 -1
  103. package/dist/locale/ja.js +1 -1
  104. package/dist/locale/ja.min.js +1 -1
  105. package/dist/locale/ja.min.mjs +1 -1
  106. package/dist/locale/ja.mjs +1 -1
  107. package/dist/locale/kk.js +1 -1
  108. package/dist/locale/kk.min.js +1 -1
  109. package/dist/locale/kk.min.mjs +1 -1
  110. package/dist/locale/kk.mjs +1 -1
  111. package/dist/locale/km.js +1 -1
  112. package/dist/locale/km.min.js +1 -1
  113. package/dist/locale/km.min.mjs +1 -1
  114. package/dist/locale/km.mjs +1 -1
  115. package/dist/locale/ko.js +1 -1
  116. package/dist/locale/ko.min.js +1 -1
  117. package/dist/locale/ko.min.mjs +1 -1
  118. package/dist/locale/ko.mjs +1 -1
  119. package/dist/locale/ku.js +1 -1
  120. package/dist/locale/ku.min.js +1 -1
  121. package/dist/locale/ku.min.mjs +1 -1
  122. package/dist/locale/ku.mjs +1 -1
  123. package/dist/locale/ky.js +1 -1
  124. package/dist/locale/ky.min.js +1 -1
  125. package/dist/locale/ky.min.mjs +1 -1
  126. package/dist/locale/ky.mjs +1 -1
  127. package/dist/locale/lt.js +1 -1
  128. package/dist/locale/lt.min.js +1 -1
  129. package/dist/locale/lt.min.mjs +1 -1
  130. package/dist/locale/lt.mjs +1 -1
  131. package/dist/locale/lv.js +1 -1
  132. package/dist/locale/lv.min.js +1 -1
  133. package/dist/locale/lv.min.mjs +1 -1
  134. package/dist/locale/lv.mjs +1 -1
  135. package/dist/locale/mg.js +1 -1
  136. package/dist/locale/mg.min.js +1 -1
  137. package/dist/locale/mg.min.mjs +1 -1
  138. package/dist/locale/mg.mjs +1 -1
  139. package/dist/locale/mn.js +1 -1
  140. package/dist/locale/mn.min.js +1 -1
  141. package/dist/locale/mn.min.mjs +1 -1
  142. package/dist/locale/mn.mjs +1 -1
  143. package/dist/locale/nb-no.js +1 -1
  144. package/dist/locale/nb-no.min.js +1 -1
  145. package/dist/locale/nb-no.min.mjs +1 -1
  146. package/dist/locale/nb-no.mjs +1 -1
  147. package/dist/locale/nl.js +1 -1
  148. package/dist/locale/nl.min.js +1 -1
  149. package/dist/locale/nl.min.mjs +1 -1
  150. package/dist/locale/nl.mjs +1 -1
  151. package/dist/locale/pa.js +1 -1
  152. package/dist/locale/pa.min.js +1 -1
  153. package/dist/locale/pa.min.mjs +1 -1
  154. package/dist/locale/pa.mjs +1 -1
  155. package/dist/locale/pl.js +1 -1
  156. package/dist/locale/pl.min.js +1 -1
  157. package/dist/locale/pl.min.mjs +1 -1
  158. package/dist/locale/pl.mjs +1 -1
  159. package/dist/locale/pt-br.js +1 -1
  160. package/dist/locale/pt-br.min.js +1 -1
  161. package/dist/locale/pt-br.min.mjs +1 -1
  162. package/dist/locale/pt-br.mjs +1 -1
  163. package/dist/locale/pt.js +1 -1
  164. package/dist/locale/pt.min.js +1 -1
  165. package/dist/locale/pt.min.mjs +1 -1
  166. package/dist/locale/pt.mjs +1 -1
  167. package/dist/locale/ro.js +1 -1
  168. package/dist/locale/ro.min.js +1 -1
  169. package/dist/locale/ro.min.mjs +1 -1
  170. package/dist/locale/ro.mjs +1 -1
  171. package/dist/locale/ru.js +1 -1
  172. package/dist/locale/ru.min.js +1 -1
  173. package/dist/locale/ru.min.mjs +1 -1
  174. package/dist/locale/ru.mjs +1 -1
  175. package/dist/locale/sk.js +1 -1
  176. package/dist/locale/sk.min.js +1 -1
  177. package/dist/locale/sk.min.mjs +1 -1
  178. package/dist/locale/sk.mjs +1 -1
  179. package/dist/locale/sl.js +1 -1
  180. package/dist/locale/sl.min.js +1 -1
  181. package/dist/locale/sl.min.mjs +1 -1
  182. package/dist/locale/sl.mjs +1 -1
  183. package/dist/locale/sr.js +1 -1
  184. package/dist/locale/sr.min.js +1 -1
  185. package/dist/locale/sr.min.mjs +1 -1
  186. package/dist/locale/sr.mjs +1 -1
  187. package/dist/locale/sv.js +1 -1
  188. package/dist/locale/sv.min.js +1 -1
  189. package/dist/locale/sv.min.mjs +1 -1
  190. package/dist/locale/sv.mjs +1 -1
  191. package/dist/locale/ta.js +1 -1
  192. package/dist/locale/ta.min.js +1 -1
  193. package/dist/locale/ta.min.mjs +1 -1
  194. package/dist/locale/ta.mjs +1 -1
  195. package/dist/locale/th.js +1 -1
  196. package/dist/locale/th.min.js +1 -1
  197. package/dist/locale/th.min.mjs +1 -1
  198. package/dist/locale/th.mjs +1 -1
  199. package/dist/locale/tk.js +1 -1
  200. package/dist/locale/tk.min.js +1 -1
  201. package/dist/locale/tk.min.mjs +1 -1
  202. package/dist/locale/tk.mjs +1 -1
  203. package/dist/locale/tr.js +1 -1
  204. package/dist/locale/tr.min.js +1 -1
  205. package/dist/locale/tr.min.mjs +1 -1
  206. package/dist/locale/tr.mjs +1 -1
  207. package/dist/locale/ug-cn.js +1 -1
  208. package/dist/locale/ug-cn.min.js +1 -1
  209. package/dist/locale/ug-cn.min.mjs +1 -1
  210. package/dist/locale/ug-cn.mjs +1 -1
  211. package/dist/locale/uk.js +1 -1
  212. package/dist/locale/uk.min.js +1 -1
  213. package/dist/locale/uk.min.mjs +1 -1
  214. package/dist/locale/uk.mjs +1 -1
  215. package/dist/locale/uz-uz.js +1 -1
  216. package/dist/locale/uz-uz.min.js +1 -1
  217. package/dist/locale/uz-uz.min.mjs +1 -1
  218. package/dist/locale/uz-uz.mjs +1 -1
  219. package/dist/locale/vi.js +1 -1
  220. package/dist/locale/vi.min.js +1 -1
  221. package/dist/locale/vi.min.mjs +1 -1
  222. package/dist/locale/vi.mjs +1 -1
  223. package/dist/locale/zh-cn.js +1 -1
  224. package/dist/locale/zh-cn.min.js +1 -1
  225. package/dist/locale/zh-cn.min.mjs +1 -1
  226. package/dist/locale/zh-cn.mjs +1 -1
  227. package/dist/locale/zh-tw.js +1 -1
  228. package/dist/locale/zh-tw.min.js +1 -1
  229. package/dist/locale/zh-tw.min.mjs +1 -1
  230. package/dist/locale/zh-tw.mjs +1 -1
  231. package/es/components/carousel/index.d.ts +18 -34
  232. package/es/components/carousel/index.mjs.map +1 -1
  233. package/es/components/carousel/src/carousel.d.ts +0 -2
  234. package/es/components/carousel/src/carousel.mjs.map +1 -1
  235. package/es/components/carousel/src/carousel.vue.d.ts +66 -84
  236. package/es/components/carousel/src/carousel2.mjs +40 -207
  237. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  238. package/es/components/carousel/src/instance.d.ts +2 -0
  239. package/es/components/carousel/src/instance.mjs +2 -0
  240. package/es/components/carousel/src/instance.mjs.map +1 -0
  241. package/es/components/carousel/src/use-carousel.d.ts +21 -0
  242. package/es/components/carousel/src/use-carousel.mjs +210 -0
  243. package/es/components/carousel/src/use-carousel.mjs.map +1 -0
  244. package/es/components/index.mjs +2 -2
  245. package/es/components/table/src/store/watcher.mjs +10 -0
  246. package/es/components/table/src/store/watcher.mjs.map +1 -1
  247. package/es/components/table/src/table-body/styles-helper.mjs +2 -2
  248. package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
  249. package/es/components/table/src/table-header/style.helper.mjs +2 -2
  250. package/es/components/table/src/table-header/style.helper.mjs.map +1 -1
  251. package/es/components/table/src/util.d.ts +4 -4
  252. package/es/components/table/src/util.mjs +27 -16
  253. package/es/components/table/src/util.mjs.map +1 -1
  254. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  255. package/es/components/transfer/src/transfer-panel.mjs +19 -131
  256. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  257. package/es/components/transfer/src/transfer-panel2.mjs +131 -19
  258. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  259. package/es/components/transfer/src/transfer2.mjs +1 -1
  260. package/es/components/upload/index.mjs +3 -3
  261. package/es/components/upload/src/upload-content.mjs +1 -1
  262. package/es/components/upload/src/upload-content2.mjs +2 -2
  263. package/es/components/upload/src/upload-dragger.mjs +11 -70
  264. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  265. package/es/components/upload/src/upload-dragger2.mjs +70 -11
  266. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  267. package/es/components/upload/src/upload-list.mjs +1 -1
  268. package/es/components/upload/src/upload.mjs +105 -120
  269. package/es/components/upload/src/upload.mjs.map +1 -1
  270. package/es/components/upload/src/upload2.mjs +120 -105
  271. package/es/components/upload/src/upload2.mjs.map +1 -1
  272. package/es/components/upload/src/use-handlers.mjs +1 -1
  273. package/es/index.mjs +2 -2
  274. package/es/version.d.ts +1 -1
  275. package/es/version.mjs +1 -1
  276. package/es/version.mjs.map +1 -1
  277. package/lib/components/carousel/index.d.ts +18 -34
  278. package/lib/components/carousel/index.js.map +1 -1
  279. package/lib/components/carousel/src/carousel.d.ts +0 -2
  280. package/lib/components/carousel/src/carousel.js.map +1 -1
  281. package/lib/components/carousel/src/carousel.vue.d.ts +66 -84
  282. package/lib/components/carousel/src/carousel2.js +42 -209
  283. package/lib/components/carousel/src/carousel2.js.map +1 -1
  284. package/lib/components/carousel/src/instance.d.ts +2 -0
  285. package/lib/components/carousel/src/instance.js +3 -0
  286. package/lib/components/carousel/src/instance.js.map +1 -0
  287. package/lib/components/carousel/src/use-carousel.d.ts +21 -0
  288. package/lib/components/carousel/src/use-carousel.js +214 -0
  289. package/lib/components/carousel/src/use-carousel.js.map +1 -0
  290. package/lib/components/index.js +2 -2
  291. package/lib/components/table/src/store/watcher.js +10 -0
  292. package/lib/components/table/src/store/watcher.js.map +1 -1
  293. package/lib/components/table/src/table-body/styles-helper.js +2 -2
  294. package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
  295. package/lib/components/table/src/table-header/style.helper.js +2 -2
  296. package/lib/components/table/src/table-header/style.helper.js.map +1 -1
  297. package/lib/components/table/src/util.d.ts +4 -4
  298. package/lib/components/table/src/util.js +26 -15
  299. package/lib/components/table/src/util.js.map +1 -1
  300. package/lib/components/transfer/src/composables/use-check.js +1 -1
  301. package/lib/components/transfer/src/transfer-panel.js +21 -131
  302. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  303. package/lib/components/transfer/src/transfer-panel2.js +131 -21
  304. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  305. package/lib/components/transfer/src/transfer2.js +1 -1
  306. package/lib/components/upload/index.js +3 -3
  307. package/lib/components/upload/src/upload-content.js +1 -1
  308. package/lib/components/upload/src/upload-content2.js +2 -2
  309. package/lib/components/upload/src/upload-dragger.js +12 -70
  310. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  311. package/lib/components/upload/src/upload-dragger2.js +70 -12
  312. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  313. package/lib/components/upload/src/upload-list.js +1 -1
  314. package/lib/components/upload/src/upload.js +108 -120
  315. package/lib/components/upload/src/upload.js.map +1 -1
  316. package/lib/components/upload/src/upload2.js +120 -108
  317. package/lib/components/upload/src/upload2.js.map +1 -1
  318. package/lib/components/upload/src/use-handlers.js +1 -1
  319. package/lib/index.js +2 -2
  320. package/lib/version.d.ts +1 -1
  321. package/lib/version.js +1 -1
  322. package/lib/version.js.map +1 -1
  323. package/package.json +2 -2
  324. package/web-types.json +1 -1
@@ -1,35 +1,51 @@
1
- import type { CarouselItemContext } from 'element-plus/es/tokens';
2
1
  declare const _default: import("vue").DefineComponent<{
3
- readonly initialIndex: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
4
- readonly height: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
5
- readonly trigger: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "hover" | "click", unknown, "hover", boolean>;
6
- readonly autoplay: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
7
- readonly interval: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3000, boolean>;
8
- readonly indicatorPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "none" | "outside", unknown, "", boolean>;
9
- readonly indicator: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
10
- readonly arrow: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "hover" | "always" | "never", unknown, "hover", boolean>;
11
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "card", unknown, "", boolean>;
12
- readonly loop: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
13
- readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
14
- readonly pauseOnHover: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
2
+ readonly initialIndex: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
3
+ readonly height: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
4
+ readonly trigger: import("../../../utils").EpPropFinalized<StringConstructor, "hover" | "click", unknown, "hover", boolean>;
5
+ readonly autoplay: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
6
+ readonly interval: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3000, boolean>;
7
+ readonly indicatorPosition: import("../../../utils").EpPropFinalized<StringConstructor, "" | "none" | "outside", unknown, "", boolean>;
8
+ readonly indicator: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
9
+ readonly arrow: import("../../../utils").EpPropFinalized<StringConstructor, "hover" | "always" | "never", unknown, "hover", boolean>;
10
+ readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "" | "card", unknown, "", boolean>;
11
+ readonly loop: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
12
+ readonly direction: import("../../../utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
13
+ readonly pauseOnHover: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
15
14
  }, {
15
+ COMPONENT_NAME: string;
16
16
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
17
- readonly initialIndex: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
18
- readonly height: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
19
- readonly trigger: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "hover" | "click", unknown, "hover", boolean>;
20
- readonly autoplay: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
21
- readonly interval: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3000, boolean>;
22
- readonly indicatorPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "none" | "outside", unknown, "", boolean>;
23
- readonly indicator: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
24
- readonly arrow: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "hover" | "always" | "never", unknown, "hover", boolean>;
25
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "card", unknown, "", boolean>;
26
- readonly loop: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
27
- readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
28
- readonly pauseOnHover: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
17
+ readonly initialIndex: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
18
+ readonly height: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
19
+ readonly trigger: import("../../../utils").EpPropFinalized<StringConstructor, "hover" | "click", unknown, "hover", boolean>;
20
+ readonly autoplay: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
21
+ readonly interval: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3000, boolean>;
22
+ readonly indicatorPosition: import("../../../utils").EpPropFinalized<StringConstructor, "" | "none" | "outside", unknown, "", boolean>;
23
+ readonly indicator: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
24
+ readonly arrow: import("../../../utils").EpPropFinalized<StringConstructor, "hover" | "always" | "never", unknown, "hover", boolean>;
25
+ readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "" | "card", unknown, "", boolean>;
26
+ readonly loop: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
27
+ readonly direction: import("../../../utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
28
+ readonly pauseOnHover: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
29
29
  }>> & {
30
30
  onChange?: ((current: number, prev: number) => any) | undefined;
31
31
  }>>;
32
32
  emit: (event: "change", current: number, prev: number) => void;
33
+ activeIndex: import("vue").Ref<number>;
34
+ arrowDisplay: import("vue").ComputedRef<boolean>;
35
+ hasLabel: import("vue").ComputedRef<boolean>;
36
+ hover: import("vue").Ref<boolean>;
37
+ isCardType: import("vue").ComputedRef<boolean>;
38
+ items: import("vue").ShallowRef<import("../../..").CarouselItemContext[]>;
39
+ handleButtonEnter: (arrow: "left" | "right") => void;
40
+ handleButtonLeave: () => void;
41
+ handleIndicatorClick: (index: number) => void;
42
+ handleMouseEnter: () => void;
43
+ handleMouseLeave: () => void;
44
+ setActiveItem: (index: string | number) => void;
45
+ prev: () => void;
46
+ next: () => void;
47
+ throttledArrowClick: import("lodash").DebouncedFunc<(index: number) => void>;
48
+ throttledIndicatorHover: import("lodash").DebouncedFunc<(index: number) => void>;
33
49
  ns: {
34
50
  namespace: import("vue").Ref<string>;
35
51
  b: (blockSuffix?: string) => string;
@@ -48,45 +64,11 @@ declare const _default: import("vue").DefineComponent<{
48
64
  cssVarBlock: (object: Record<string, string>) => Record<string, string>;
49
65
  cssVarBlockName: (name: string) => string;
50
66
  };
51
- COMPONENT_NAME: string;
52
- THROTTLE_TIME: number;
53
- items: import("vue").ShallowRef<CarouselItemContext[]>;
54
- addItem: (child: CarouselItemContext) => void;
55
- removeItem: (uid: number) => void;
56
- activeIndex: import("vue").Ref<number>;
57
- timer: import("vue").Ref<number | null>;
58
- hover: import("vue").Ref<boolean>;
59
- root: import("vue").Ref<HTMLDivElement | undefined>;
60
- arrowDisplay: import("vue").ComputedRef<boolean>;
61
- hasLabel: import("vue").ComputedRef<boolean>;
62
67
  carouselClasses: import("vue").ComputedRef<string[]>;
63
68
  indicatorsClasses: import("vue").ComputedRef<string[]>;
64
- isCardType: import("vue").ComputedRef<boolean>;
65
- isVertical: import("vue").ComputedRef<boolean>;
66
- throttledArrowClick: import("lodash").DebouncedFunc<(index: number) => void>;
67
- throttledIndicatorHover: import("lodash").DebouncedFunc<(index: number) => void>;
68
- pauseTimer: () => void;
69
- startTimer: () => void;
70
- playSlides: () => void;
71
- setActiveItem: (index: number | string) => void;
72
- resetItemPosition: (oldIndex?: number | undefined) => void;
73
- itemInStage: (item: CarouselItemContext, index: number) => false | "left" | "right";
74
- handleMouseEnter: () => void;
75
- handleMouseLeave: () => void;
76
- handleButtonEnter: (arrow: 'left' | 'right') => void;
77
- handleButtonLeave: () => void;
78
- handleIndicatorClick: (index: number) => void;
79
- handleIndicatorHover: (index: number) => void;
80
- prev: () => void;
81
- next: () => void;
82
- resetTimer: () => void;
83
- resizeObserver: import("vue").ShallowRef<{
84
- isSupported: import("vue").Ref<boolean>;
85
- stop: () => void;
86
- } | undefined>;
87
- ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
69
+ ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
88
70
  readonly size: {
89
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
71
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
90
72
  readonly required: false;
91
73
  readonly validator: ((val: unknown) => boolean) | undefined;
92
74
  __epPropKey: true;
@@ -100,7 +82,7 @@ declare const _default: import("vue").DefineComponent<{
100
82
  }, {
101
83
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
102
84
  readonly size: {
103
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
85
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
104
86
  readonly required: false;
105
87
  readonly validator: ((val: unknown) => boolean) | undefined;
106
88
  __epPropKey: true;
@@ -135,7 +117,7 @@ declare const _default: import("vue").DefineComponent<{
135
117
  style: import("vue").ComputedRef<import("vue").CSSProperties>;
136
118
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
137
119
  readonly size: {
138
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
120
+ readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
139
121
  readonly required: false;
140
122
  readonly validator: ((val: unknown) => boolean) | undefined;
141
123
  __epPropKey: true;
@@ -152,32 +134,32 @@ declare const _default: import("vue").DefineComponent<{
152
134
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
153
135
  change: (current: number, prev: number) => boolean;
154
136
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
155
- readonly initialIndex: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
156
- readonly height: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
157
- readonly trigger: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "hover" | "click", unknown, "hover", boolean>;
158
- readonly autoplay: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
159
- readonly interval: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3000, boolean>;
160
- readonly indicatorPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "none" | "outside", unknown, "", boolean>;
161
- readonly indicator: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
162
- readonly arrow: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "hover" | "always" | "never", unknown, "hover", boolean>;
163
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "card", unknown, "", boolean>;
164
- readonly loop: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
165
- readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
166
- readonly pauseOnHover: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
137
+ readonly initialIndex: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
138
+ readonly height: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
139
+ readonly trigger: import("../../../utils").EpPropFinalized<StringConstructor, "hover" | "click", unknown, "hover", boolean>;
140
+ readonly autoplay: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
141
+ readonly interval: import("../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3000, boolean>;
142
+ readonly indicatorPosition: import("../../../utils").EpPropFinalized<StringConstructor, "" | "none" | "outside", unknown, "", boolean>;
143
+ readonly indicator: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
144
+ readonly arrow: import("../../../utils").EpPropFinalized<StringConstructor, "hover" | "always" | "never", unknown, "hover", boolean>;
145
+ readonly type: import("../../../utils").EpPropFinalized<StringConstructor, "" | "card", unknown, "", boolean>;
146
+ readonly loop: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
147
+ readonly direction: import("../../../utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
148
+ readonly pauseOnHover: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
167
149
  }>> & {
168
150
  onChange?: ((current: number, prev: number) => any) | undefined;
169
151
  }, {
170
- readonly type: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "card", unknown>;
171
- readonly trigger: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "hover" | "click", unknown>;
152
+ readonly type: import("../../../utils").EpPropMergeType<StringConstructor, "" | "card", unknown>;
153
+ readonly trigger: import("../../../utils").EpPropMergeType<StringConstructor, "hover" | "click", unknown>;
172
154
  readonly height: string;
173
- readonly direction: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "vertical" | "horizontal", unknown>;
174
- readonly indicator: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
175
- readonly loop: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
155
+ readonly direction: import("../../../utils").EpPropMergeType<StringConstructor, "vertical" | "horizontal", unknown>;
156
+ readonly indicator: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
157
+ readonly loop: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
176
158
  readonly initialIndex: number;
177
- readonly autoplay: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
159
+ readonly autoplay: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
178
160
  readonly interval: number;
179
- readonly indicatorPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "none" | "outside", unknown>;
180
- readonly arrow: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "hover" | "always" | "never", unknown>;
181
- readonly pauseOnHover: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
161
+ readonly indicatorPosition: import("../../../utils").EpPropMergeType<StringConstructor, "" | "none" | "outside", unknown>;
162
+ readonly arrow: import("../../../utils").EpPropMergeType<StringConstructor, "hover" | "always" | "never", unknown>;
163
+ readonly pauseOnHover: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
182
164
  }>;
183
165
  export default _default;
@@ -3,28 +3,19 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var lodashUnified = require('lodash-unified');
7
- var core = require('@vueuse/core');
8
- require('../../../utils/index.js');
9
- var index$2 = require('../../icon/index.js');
6
+ var index$1 = require('../../icon/index.js');
10
7
  var iconsVue = require('@element-plus/icons-vue');
11
8
  require('../../../hooks/index.js');
12
- require('../../../tokens/index.js');
13
9
  var carousel = require('./carousel.js');
10
+ var useCarousel = require('./use-carousel.js');
14
11
  var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
15
12
  var index = require('../../../hooks/use-namespace/index.js');
16
- var index$1 = require('../../../hooks/use-ordered-children/index.js');
17
- var shared = require('@vue/shared');
18
- var error = require('../../../utils/error.js');
19
- var carousel$1 = require('../../../tokens/carousel.js');
20
13
 
21
- const _hoisted_1 = ["onMouseenter", "onMouseleave"];
22
- const _hoisted_2 = ["onMouseenter", "onClick"];
23
- const _hoisted_3 = { key: 0 };
14
+ const _hoisted_1 = ["onMouseenter", "onClick"];
15
+ const _hoisted_2 = { key: 0 };
24
16
  const COMPONENT_NAME = "ElCarousel";
25
- const THROTTLE_TIME = 300;
26
17
  const __default__ = vue.defineComponent({
27
- name: "ElCarousel"
18
+ name: COMPONENT_NAME
28
19
  });
29
20
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
30
21
  ...__default__,
@@ -32,20 +23,25 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
32
23
  emits: carousel.carouselEmits,
33
24
  setup(__props, { expose, emit }) {
34
25
  const props = __props;
35
- const ns = index.useNamespace("carousel");
36
26
  const {
37
- children: items,
38
- addChild: addItem,
39
- removeChild: removeItem
40
- } = index$1.useOrderedChildren(vue.getCurrentInstance(), "ElCarouselItem");
41
- const activeIndex = vue.ref(-1);
42
- const timer = vue.ref(null);
43
- const hover = vue.ref(false);
44
- const root = vue.ref();
45
- const arrowDisplay = vue.computed(() => props.arrow !== "never" && !vue.unref(isVertical));
46
- const hasLabel = vue.computed(() => {
47
- return items.value.some((item) => item.props.label.toString().length > 0);
48
- });
27
+ activeIndex,
28
+ arrowDisplay,
29
+ hasLabel,
30
+ hover,
31
+ isCardType,
32
+ items,
33
+ handleButtonEnter,
34
+ handleButtonLeave,
35
+ handleIndicatorClick,
36
+ handleMouseEnter,
37
+ handleMouseLeave,
38
+ setActiveItem,
39
+ prev,
40
+ next,
41
+ throttledArrowClick,
42
+ throttledIndicatorHover
43
+ } = useCarousel.useCarousel(props, emit, COMPONENT_NAME);
44
+ const ns = index.useNamespace("carousel");
49
45
  const carouselClasses = vue.computed(() => {
50
46
  const classes = [ns.b(), ns.m(props.direction)];
51
47
  if (vue.unref(isCardType)) {
@@ -55,7 +51,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55
51
  });
56
52
  const indicatorsClasses = vue.computed(() => {
57
53
  const classes = [ns.e("indicators"), ns.em("indicators", props.direction)];
58
- if (hasLabel.value) {
54
+ if (vue.unref(hasLabel)) {
59
55
  classes.push(ns.em("indicators", "labels"));
60
56
  }
61
57
  if (props.indicatorPosition === "outside" || vue.unref(isCardType)) {
@@ -63,168 +59,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
63
59
  }
64
60
  return classes;
65
61
  });
66
- const isCardType = vue.computed(() => props.type === "card");
67
- const isVertical = vue.computed(() => props.direction === "vertical");
68
- const throttledArrowClick = lodashUnified.throttle((index) => {
69
- setActiveItem(index);
70
- }, THROTTLE_TIME, { trailing: true });
71
- const throttledIndicatorHover = lodashUnified.throttle((index) => {
72
- handleIndicatorHover(index);
73
- }, THROTTLE_TIME);
74
- function pauseTimer() {
75
- if (timer.value) {
76
- clearInterval(timer.value);
77
- timer.value = null;
78
- }
79
- }
80
- function startTimer() {
81
- if (props.interval <= 0 || !props.autoplay || timer.value)
82
- return;
83
- timer.value = setInterval(() => playSlides(), props.interval);
84
- }
85
- const playSlides = () => {
86
- if (activeIndex.value < items.value.length - 1) {
87
- activeIndex.value = activeIndex.value + 1;
88
- } else if (props.loop) {
89
- activeIndex.value = 0;
90
- }
91
- };
92
- function setActiveItem(index) {
93
- if (shared.isString(index)) {
94
- const filteredItems = items.value.filter((item) => item.props.name === index);
95
- if (filteredItems.length > 0) {
96
- index = items.value.indexOf(filteredItems[0]);
97
- }
98
- }
99
- index = Number(index);
100
- if (Number.isNaN(index) || index !== Math.floor(index)) {
101
- error.debugWarn(COMPONENT_NAME, "index must be integer.");
102
- return;
103
- }
104
- const itemCount = items.value.length;
105
- const oldIndex = activeIndex.value;
106
- if (index < 0) {
107
- activeIndex.value = props.loop ? itemCount - 1 : 0;
108
- } else if (index >= itemCount) {
109
- activeIndex.value = props.loop ? 0 : itemCount - 1;
110
- } else {
111
- activeIndex.value = index;
112
- }
113
- if (oldIndex === activeIndex.value) {
114
- resetItemPosition(oldIndex);
115
- }
116
- resetTimer();
117
- }
118
- function resetItemPosition(oldIndex) {
119
- items.value.forEach((item, index) => {
120
- item.translateItem(index, activeIndex.value, oldIndex);
121
- });
122
- }
123
- function itemInStage(item, index) {
124
- var _a, _b, _c, _d;
125
- const _items = vue.unref(items);
126
- const itemCount = _items.length;
127
- if (itemCount === 0 || !item.states.inStage)
128
- return false;
129
- const nextItemIndex = index + 1;
130
- const prevItemIndex = index - 1;
131
- const lastItemIndex = itemCount - 1;
132
- const isLastItemActive = _items[lastItemIndex].states.active;
133
- const isFirstItemActive = _items[0].states.active;
134
- const isNextItemActive = (_b = (_a = _items[nextItemIndex]) == null ? void 0 : _a.states) == null ? void 0 : _b.active;
135
- const isPrevItemActive = (_d = (_c = _items[prevItemIndex]) == null ? void 0 : _c.states) == null ? void 0 : _d.active;
136
- if (index === lastItemIndex && isFirstItemActive || isNextItemActive) {
137
- return "left";
138
- } else if (index === 0 && isLastItemActive || isPrevItemActive) {
139
- return "right";
140
- }
141
- return false;
142
- }
143
- function handleMouseEnter() {
144
- hover.value = true;
145
- if (props.pauseOnHover) {
146
- pauseTimer();
147
- }
148
- }
149
- function handleMouseLeave() {
150
- hover.value = false;
151
- startTimer();
152
- }
153
- function handleButtonEnter(arrow) {
154
- if (vue.unref(isVertical))
155
- return;
156
- items.value.forEach((item, index) => {
157
- if (arrow === itemInStage(item, index)) {
158
- item.states.hover = true;
159
- }
160
- });
161
- }
162
- function handleButtonLeave() {
163
- if (vue.unref(isVertical))
164
- return;
165
- items.value.forEach((item) => {
166
- item.states.hover = false;
167
- });
168
- }
169
- function handleIndicatorClick(index) {
170
- activeIndex.value = index;
171
- }
172
- function handleIndicatorHover(index) {
173
- if (props.trigger === "hover" && index !== activeIndex.value) {
174
- activeIndex.value = index;
175
- }
176
- }
177
- function prev() {
178
- setActiveItem(activeIndex.value - 1);
179
- }
180
- function next() {
181
- setActiveItem(activeIndex.value + 1);
182
- }
183
- function resetTimer() {
184
- pauseTimer();
185
- startTimer();
186
- }
187
- vue.watch(() => activeIndex.value, (current, prev2) => {
188
- resetItemPosition(prev2);
189
- if (prev2 > -1) {
190
- emit("change", current, prev2);
191
- }
192
- });
193
- vue.watch(() => props.autoplay, (autoplay) => {
194
- autoplay ? startTimer() : pauseTimer();
195
- });
196
- vue.watch(() => props.loop, () => {
197
- setActiveItem(activeIndex.value);
198
- });
199
- vue.watch(() => props.interval, () => {
200
- resetTimer();
201
- });
202
- vue.watch(() => items.value, () => {
203
- if (items.value.length > 0)
204
- setActiveItem(props.initialIndex);
205
- });
206
- const resizeObserver = vue.shallowRef();
207
- vue.onMounted(() => {
208
- resizeObserver.value = core.useResizeObserver(root.value, () => {
209
- resetItemPosition();
210
- });
211
- startTimer();
212
- });
213
- vue.onBeforeUnmount(() => {
214
- pauseTimer();
215
- if (root.value && resizeObserver.value)
216
- resizeObserver.value.stop();
217
- });
218
- vue.provide(carousel$1.carouselContextKey, {
219
- root,
220
- isCardType,
221
- isVertical,
222
- items,
223
- loop: props.loop,
224
- addItem,
225
- removeItem,
226
- setActiveItem
227
- });
228
62
  expose({
229
63
  setActiveItem,
230
64
  prev,
@@ -232,11 +66,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
232
66
  });
233
67
  return (_ctx, _cache) => {
234
68
  return vue.openBlock(), vue.createElementBlock("div", {
235
- ref_key: "root",
236
- ref: root,
69
+ ref: "root",
237
70
  class: vue.normalizeClass(vue.unref(carouselClasses)),
238
- onMouseenter: vue.withModifiers(handleMouseEnter, ["stop"]),
239
- onMouseleave: vue.withModifiers(handleMouseLeave, ["stop"])
71
+ onMouseenter: _cache[6] || (_cache[6] = vue.withModifiers((...args) => vue.unref(handleMouseEnter) && vue.unref(handleMouseEnter)(...args), ["stop"])),
72
+ onMouseleave: _cache[7] || (_cache[7] = vue.withModifiers((...args) => vue.unref(handleMouseLeave) && vue.unref(handleMouseLeave)(...args), ["stop"]))
240
73
  }, [
241
74
  vue.createElementVNode("div", {
242
75
  class: vue.normalizeClass(vue.unref(ns).e("container")),
@@ -251,11 +84,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
251
84
  vue.withDirectives(vue.createElementVNode("button", {
252
85
  type: "button",
253
86
  class: vue.normalizeClass([vue.unref(ns).e("arrow"), vue.unref(ns).em("arrow", "left")]),
254
- onMouseenter: _cache[0] || (_cache[0] = ($event) => handleButtonEnter("left")),
255
- onMouseleave: handleButtonLeave,
256
- onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => vue.unref(throttledArrowClick)(activeIndex.value - 1), ["stop"]))
87
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => vue.unref(handleButtonEnter)("left")),
88
+ onMouseleave: _cache[1] || (_cache[1] = (...args) => vue.unref(handleButtonLeave) && vue.unref(handleButtonLeave)(...args)),
89
+ onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => vue.unref(throttledArrowClick)(vue.unref(activeIndex) - 1), ["stop"]))
257
90
  }, [
258
- vue.createVNode(vue.unref(index$2.ElIcon), null, {
91
+ vue.createVNode(vue.unref(index$1.ElIcon), null, {
259
92
  default: vue.withCtx(() => [
260
93
  vue.createVNode(vue.unref(iconsVue.ArrowLeft))
261
94
  ]),
@@ -264,7 +97,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
264
97
  ], 34), [
265
98
  [
266
99
  vue.vShow,
267
- (_ctx.arrow === "always" || hover.value) && (props.loop || activeIndex.value > 0)
100
+ (_ctx.arrow === "always" || vue.unref(hover)) && (props.loop || vue.unref(activeIndex) > 0)
268
101
  ]
269
102
  ])
270
103
  ]),
@@ -279,11 +112,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
279
112
  vue.withDirectives(vue.createElementVNode("button", {
280
113
  type: "button",
281
114
  class: vue.normalizeClass([vue.unref(ns).e("arrow"), vue.unref(ns).em("arrow", "right")]),
282
- onMouseenter: _cache[2] || (_cache[2] = ($event) => handleButtonEnter("right")),
283
- onMouseleave: handleButtonLeave,
284
- onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => vue.unref(throttledArrowClick)(activeIndex.value + 1), ["stop"]))
115
+ onMouseenter: _cache[3] || (_cache[3] = ($event) => vue.unref(handleButtonEnter)("right")),
116
+ onMouseleave: _cache[4] || (_cache[4] = (...args) => vue.unref(handleButtonLeave) && vue.unref(handleButtonLeave)(...args)),
117
+ onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => vue.unref(throttledArrowClick)(vue.unref(activeIndex) + 1), ["stop"]))
285
118
  }, [
286
- vue.createVNode(vue.unref(index$2.ElIcon), null, {
119
+ vue.createVNode(vue.unref(index$1.ElIcon), null, {
287
120
  default: vue.withCtx(() => [
288
121
  vue.createVNode(vue.unref(iconsVue.ArrowRight))
289
122
  ]),
@@ -292,7 +125,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
292
125
  ], 34), [
293
126
  [
294
127
  vue.vShow,
295
- (_ctx.arrow === "always" || hover.value) && (props.loop || activeIndex.value < vue.unref(items).length - 1)
128
+ (_ctx.arrow === "always" || vue.unref(hover)) && (props.loop || vue.unref(activeIndex) < vue.unref(items).length - 1)
296
129
  ]
297
130
  ])
298
131
  ]),
@@ -310,20 +143,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
310
143
  class: vue.normalizeClass([
311
144
  vue.unref(ns).e("indicator"),
312
145
  vue.unref(ns).em("indicator", _ctx.direction),
313
- vue.unref(ns).is("active", index === activeIndex.value)
146
+ vue.unref(ns).is("active", index === vue.unref(activeIndex))
314
147
  ]),
315
148
  onMouseenter: ($event) => vue.unref(throttledIndicatorHover)(index),
316
- onClick: vue.withModifiers(($event) => handleIndicatorClick(index), ["stop"])
149
+ onClick: vue.withModifiers(($event) => vue.unref(handleIndicatorClick)(index), ["stop"])
317
150
  }, [
318
151
  vue.createElementVNode("button", {
319
152
  class: vue.normalizeClass(vue.unref(ns).e("button"))
320
153
  }, [
321
- vue.unref(hasLabel) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3, vue.toDisplayString(item.props.label), 1)) : vue.createCommentVNode("v-if", true)
154
+ vue.unref(hasLabel) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(item.props.label), 1)) : vue.createCommentVNode("v-if", true)
322
155
  ], 2)
323
- ], 42, _hoisted_2);
156
+ ], 42, _hoisted_1);
324
157
  }), 128))
325
158
  ], 2)) : vue.createCommentVNode("v-if", true)
326
- ], 42, _hoisted_1);
159
+ ], 34);
327
160
  };
328
161
  }
329
162
  });
@@ -1 +1 @@
1
- {"version":3,"file":"carousel2.js","sources":["../../../../../../packages/components/carousel/src/carousel.vue"],"sourcesContent":["<template>\n <div\n ref=\"root\"\n :class=\"carouselClasses\"\n @mouseenter.stop=\"handleMouseEnter\"\n @mouseleave.stop=\"handleMouseLeave\"\n >\n <div :class=\"ns.e('container')\" :style=\"{ height: height }\">\n <transition v-if=\"arrowDisplay\" name=\"carousel-arrow-left\">\n <button\n v-show=\"\n (arrow === 'always' || hover) && (props.loop || activeIndex > 0)\n \"\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'left')]\"\n @mouseenter=\"handleButtonEnter('left')\"\n @mouseleave=\"handleButtonLeave\"\n @click.stop=\"throttledArrowClick(activeIndex - 1)\"\n >\n <ElIcon>\n <ArrowLeft />\n </ElIcon>\n </button>\n </transition>\n <transition v-if=\"arrowDisplay\" name=\"carousel-arrow-right\">\n <button\n v-show=\"\n (arrow === 'always' || hover) &&\n (props.loop || activeIndex < items.length - 1)\n \"\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'right')]\"\n @mouseenter=\"handleButtonEnter('right')\"\n @mouseleave=\"handleButtonLeave\"\n @click.stop=\"throttledArrowClick(activeIndex + 1)\"\n >\n <ElIcon>\n <ArrowRight />\n </ElIcon>\n </button>\n </transition>\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 @mouseenter=\"throttledIndicatorHover(index)\"\n @click.stop=\"handleIndicatorClick(index)\"\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 getCurrentInstance,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n unref,\n watch,\n} from 'vue'\nimport { throttle } from 'lodash-unified'\nimport { useResizeObserver } from '@vueuse/core'\nimport { debugWarn, isString } from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { useNamespace, useOrderedChildren } from '@element-plus/hooks'\nimport { carouselContextKey } from '@element-plus/tokens'\nimport { carouselEmits, carouselProps } from './carousel'\nimport type { CarouselItemContext } from '@element-plus/tokens'\n\ndefineOptions({\n name: 'ElCarousel',\n})\n\nconst props = defineProps(carouselProps)\nconst emit = defineEmits(carouselEmits)\nconst ns = useNamespace('carousel')\nconst COMPONENT_NAME = 'ElCarousel'\nconst THROTTLE_TIME = 300\n\nconst {\n children: items,\n addChild: addItem,\n removeChild: removeItem,\n} = useOrderedChildren<CarouselItemContext>(\n getCurrentInstance()!,\n 'ElCarouselItem'\n)\n\n// refs\nconst activeIndex = ref(-1)\nconst timer = ref<ReturnType<typeof setInterval> | null>(null)\nconst hover = ref(false)\nconst root = ref<HTMLDivElement>()\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\n// methods\nconst throttledArrowClick = throttle(\n (index: number) => {\n setActiveItem(index)\n },\n THROTTLE_TIME,\n { trailing: true }\n)\n\nconst throttledIndicatorHover = throttle((index: number) => {\n handleIndicatorHover(index)\n}, THROTTLE_TIME)\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 resetTimer()\n}\n\nfunction resetItemPosition(oldIndex?: number) {\n items.value.forEach((item, index) => {\n item.translateItem(index, activeIndex.value, oldIndex)\n })\n}\n\nfunction itemInStage(item: CarouselItemContext, index: number) {\n const _items = unref(items)\n const itemCount = _items.length\n if (itemCount === 0 || !item.states.inStage) return false\n const nextItemIndex = index + 1\n const prevItemIndex = index - 1\n const lastItemIndex = itemCount - 1\n const isLastItemActive = _items[lastItemIndex].states.active\n const isFirstItemActive = _items[0].states.active\n const isNextItemActive = _items[nextItemIndex]?.states?.active\n const isPrevItemActive = _items[prevItemIndex]?.states?.active\n\n if ((index === lastItemIndex && isFirstItemActive) || isNextItemActive) {\n return 'left'\n } else if ((index === 0 && isLastItemActive) || isPrevItemActive) {\n return 'right'\n }\n return false\n}\n\nfunction handleMouseEnter() {\n hover.value = true\n if (props.pauseOnHover) {\n pauseTimer()\n }\n}\n\nfunction handleMouseLeave() {\n hover.value = false\n startTimer()\n}\n\nfunction handleButtonEnter(arrow: 'left' | 'right') {\n if (unref(isVertical)) return\n items.value.forEach((item, index) => {\n if (arrow === itemInStage(item, index)) {\n item.states.hover = true\n }\n })\n}\n\nfunction handleButtonLeave() {\n if (unref(isVertical)) return\n items.value.forEach((item) => {\n item.states.hover = false\n })\n}\n\nfunction handleIndicatorClick(index: number) {\n activeIndex.value = index\n}\n\nfunction handleIndicatorHover(index: number) {\n if (props.trigger === 'hover' && index !== activeIndex.value) {\n activeIndex.value = index\n }\n}\n\nfunction prev() {\n setActiveItem(activeIndex.value - 1)\n}\n\nfunction next() {\n setActiveItem(activeIndex.value + 1)\n}\n\nfunction resetTimer() {\n pauseTimer()\n startTimer()\n}\n\n// watch\nwatch(\n () => activeIndex.value,\n (current, prev) => {\n resetItemPosition(prev)\n if (prev > -1) {\n emit('change', current, prev)\n }\n }\n)\nwatch(\n () => props.autoplay,\n (autoplay) => {\n autoplay ? startTimer() : pauseTimer()\n }\n)\nwatch(\n () => props.loop,\n () => {\n setActiveItem(activeIndex.value)\n }\n)\n\nwatch(\n () => props.interval,\n () => {\n resetTimer()\n }\n)\n\nwatch(\n () => items.value,\n () => {\n if (items.value.length > 0) setActiveItem(props.initialIndex)\n }\n)\n\nconst resizeObserver = shallowRef<ReturnType<typeof useResizeObserver>>()\n// lifecycle\nonMounted(() => {\n resizeObserver.value = useResizeObserver(root.value, () => {\n resetItemPosition()\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 /** @description switch to the previous slide */\n prev,\n /** @description switch to the next slide */\n next,\n})\n</script>\n"],"names":["useNamespace","useOrderedChildren","getCurrentInstance","ref","computed","unref","throttle","isString","debugWarn","watch","shallowRef","onMounted","useResizeObserver","onBeforeUnmount","provide","carouselContextKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;uCAqFc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAKA,mBAAa,UAAU,CAAA,CAAA;AAIlC,IAAM,MAAA;AAAA,MACJ,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,OAAA;AAAA,MACV,WAAa,EAAA,UAAA;AAAA,KACX,GAAAC,0BAAA,CACFC,sBAAmB,EAAA,EACnB,gBACF,CAAA,CAAA;AAGA,IAAM,MAAA,WAAA,GAAcC,QAAI,CAAE,CAAA,CAAA,CAAA;AAC1B,IAAM,MAAA,KAAA,GAAQA,QAA2C,IAAI,CAAA,CAAA;AAC7D,IAAM,MAAA,KAAA,GAAQA,QAAI,KAAK,CAAA,CAAA;AACvB,IAAA,MAAM,OAAOA,OAAoB,EAAA,CAAA;AAGjC,IAAM,MAAA,YAAA,GAAeC,aACnB,MAAM,KAAA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MAEf,UAAA,EAAA,CAAA;AAEA,KACE,CAAA,CAAA;AAEE,IAAIA,SAAA,CAAA,MAAM,MAAM,KAAS,EAAA,MAAA;AAAG,MAAA,IAAA,KAAA,CAAA,KAAA,CAAc,MAAM,GAAY,CAAA;AAAA,QAEhE,aAAA,CAAA,KAAA,CAAA,YAAA,CAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAA,cAAgB,GAAAC,cAAA,EAAA,CAAA;AACd,IAAAC,aAAA,CAAA,MAAA;AACE,MAAkB,cAAA,CAAA,KAAA,GAAAC,sBAAA,CAAA,IAAA,CAAA,KAAA,EAAA,MAAA;AAAA,QACnB,iBAAA,EAAA,CAAA;AACD,OAAW,CAAA,CAAA;AAAA,MACZ,UAAA,EAAA,CAAA;AAED,KAAA,CAAA,CAAA;AACE,IAAWC,mBAAA,CAAA,MAAA;AACX,MAAI;AAAoC,MAAA,IAAA,IAAA,CAAA,KAAA,kBAA0B,CAAA,KAAA;AAAA,QACnE,cAAA,CAAA,KAAA,CAAA,IAAA,EAAA,CAAA;AAGD,KAAA,CAAA,CAAA;AAA4B,IAC1BC,WAAA,CAAAC,6BAAA,EAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAY,MACZ,IAAA,EAAA,KAAA,CAAA,IAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACD,aAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAEX,MAAA,CAAA;AAAA,MAEA,aAAA;AAAA,MAEA,IAAA;AAAA,MACD,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"carousel2.js","sources":["../../../../../../packages/components/carousel/src/carousel.vue"],"sourcesContent":["<template>\n <div\n ref=\"root\"\n :class=\"carouselClasses\"\n @mouseenter.stop=\"handleMouseEnter\"\n @mouseleave.stop=\"handleMouseLeave\"\n >\n <div :class=\"ns.e('container')\" :style=\"{ height: height }\">\n <transition v-if=\"arrowDisplay\" name=\"carousel-arrow-left\">\n <button\n v-show=\"\n (arrow === 'always' || hover) && (props.loop || activeIndex > 0)\n \"\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'left')]\"\n @mouseenter=\"handleButtonEnter('left')\"\n @mouseleave=\"handleButtonLeave\"\n @click.stop=\"throttledArrowClick(activeIndex - 1)\"\n >\n <ElIcon>\n <ArrowLeft />\n </ElIcon>\n </button>\n </transition>\n <transition v-if=\"arrowDisplay\" name=\"carousel-arrow-right\">\n <button\n v-show=\"\n (arrow === 'always' || hover) &&\n (props.loop || activeIndex < items.length - 1)\n \"\n type=\"button\"\n :class=\"[ns.e('arrow'), ns.em('arrow', 'right')]\"\n @mouseenter=\"handleButtonEnter('right')\"\n @mouseleave=\"handleButtonLeave\"\n @click.stop=\"throttledArrowClick(activeIndex + 1)\"\n >\n <ElIcon>\n <ArrowRight />\n </ElIcon>\n </button>\n </transition>\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 @mouseenter=\"throttledIndicatorHover(index)\"\n @click.stop=\"handleIndicatorClick(index)\"\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 { computed, unref } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { carouselEmits, carouselProps } from './carousel'\nimport { useCarousel } from './use-carousel'\n\nconst COMPONENT_NAME = 'ElCarousel'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(carouselProps)\nconst emit = defineEmits(carouselEmits)\nconst {\n activeIndex,\n arrowDisplay,\n hasLabel,\n hover,\n isCardType,\n items,\n handleButtonEnter,\n handleButtonLeave,\n handleIndicatorClick,\n handleMouseEnter,\n handleMouseLeave,\n setActiveItem,\n prev,\n next,\n throttledArrowClick,\n throttledIndicatorHover,\n} = useCarousel(props, emit, COMPONENT_NAME)\nconst ns = useNamespace('carousel')\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 (unref(hasLabel)) {\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\ndefineExpose({\n /** @description manually switch slide */\n setActiveItem,\n /** @description switch to the previous slide */\n prev,\n /** @description switch to the next slide */\n next,\n})\n</script>\n"],"names":["useCarousel","useNamespace","computed","unref"],"mappings":";;;;;;;;;;;;;;;;uCAwEc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAIA,IAAM,MAAA;AAAA,MACJ,WAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,KAAA;AAAA,MACA,iBAAA;AAAA,MACA,iBAAA;AAAA,MACA,oBAAA;AAAA,MACA,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,mBAAA;AAAA,MACA,uBAAA;AAAA,KACE,GAAAA,uBAAA,CAAY,KAAO,EAAA,IAAA,EAAM,cAAc,CAAA,CAAA;AAC3C,IAAM,MAAA,EAAA,GAAKC,mBAAa,UAAU,CAAA,CAAA;AAElC,IAAM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+ export declare type CarouselInstance = InstanceType<typeof Carousel>;
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=instance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}