mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* fix(components): [tabs] update tabs order correctly when reordering * fix * perf: reorder only if child components have been moved * chore: tweak the test --------- Co-authored-by: dopamine <coderzyou@gmail.com>
39 lines
1021 B
TypeScript
39 lines
1021 B
TypeScript
import type { InjectionKey, Ref, VNode } from 'vue'
|
|
import type { CarouselItemProps } from './carousel-item'
|
|
|
|
export type CarouselItemStates = {
|
|
hover: boolean
|
|
translate: number
|
|
scale: number
|
|
active: boolean
|
|
ready: boolean
|
|
inStage: boolean
|
|
animating: boolean
|
|
}
|
|
|
|
export type CarouselItemContext = {
|
|
props: CarouselItemProps
|
|
states: CarouselItemStates
|
|
uid: number
|
|
getVnode: () => VNode
|
|
translateItem: (index: number, activeIndex: number, oldIndex?: number) => void
|
|
}
|
|
|
|
export type CarouselContext = {
|
|
root: Ref<HTMLElement | undefined>
|
|
items: Ref<CarouselItemContext[]>
|
|
isCardType: Ref<boolean>
|
|
isVertical: Ref<boolean>
|
|
loop: boolean
|
|
cardScale: number
|
|
addItem: (item: CarouselItemContext) => void
|
|
removeItem: (item: CarouselItemContext) => void
|
|
setActiveItem: (index: number) => void
|
|
setContainerHeight: (height: number) => void
|
|
}
|
|
|
|
export const carouselContextKey: InjectionKey<CarouselContext> =
|
|
Symbol('carouselContextKey')
|
|
|
|
export const CAROUSEL_ITEM_NAME = 'ElCarouselItem'
|