UNPKG

@onesy/ui-react

Version:
85 lines (84 loc) 4.06 kB
import React from 'react'; import { TMethod } from '@onesy/utils'; import OnesySubscription from '@onesy/subscription'; import { ISurface } from '../Surface/Surface'; import { IElement, IValueBreakpoints, IElementReference, IPropsAny } from '../types'; export declare type ICarouselValue = { index?: number; x?: number; y?: number; }; export declare type TCarouselItem = string | null | IElement | { element: IElement; }; export declare type TCarouseOnUpdate = (to: string | number, values: TCarouselItem[]) => any; export declare type ICarousel = Omit<ISurface, 'version' | 'onChange'> & { version?: 'regular' | 'transition' | Partial<Record<IValueBreakpoints, 'regular' | 'transition'>>; valueDefault?: ICarouselValue; value?: ICarouselValue; onChange?: (value: ICarouselValue) => any; id?: any; items?: Array<TCarouselItem>; orientation?: 'vertical' | 'horizontal' | Partial<Record<IValueBreakpoints, 'vertical' | 'horizontal'>>; itemSize?: 'auto' | Partial<Record<IValueBreakpoints, 'auto' | false>>; gap?: number | Partial<Record<IValueBreakpoints, number>>; move?: boolean | Partial<Record<IValueBreakpoints, boolean>>; moveValue?: number | Partial<Record<IValueBreakpoints, number>>; moveItems?: number | Partial<Record<IValueBreakpoints, number>>; moveBeyondEdge?: boolean | Partial<Record<IValueBreakpoints, boolean>>; free?: boolean | Partial<Record<IValueBreakpoints, boolean>>; swipe?: boolean | Partial<Record<IValueBreakpoints, boolean>>; background?: boolean | Partial<Record<IValueBreakpoints, boolean>>; index?: number; autoPlay?: boolean | Partial<Record<IValueBreakpoints, boolean>>; autoHeight?: boolean | Partial<Record<IValueBreakpoints, boolean>>; autoHeightDelay?: number; autoPlayInterval?: number; pauseOnHover?: boolean; round?: boolean | Partial<Record<IValueBreakpoints, boolean>>; arrows?: boolean | Partial<Record<IValueBreakpoints, boolean>>; mouseScroll?: boolean; momentum?: boolean | Partial<Record<IValueBreakpoints, boolean>>; previousSub?: OnesySubscription; nextSub?: OnesySubscription; updateSub?: OnesySubscription; arrowsVisibility?: 'hover' | 'visible' | Partial<Record<IValueBreakpoints, 'hover' | 'visible'>>; arrowHideOnStartEnd?: boolean | Partial<Record<IValueBreakpoints, boolean>>; renderProgress?: (update: TCarouseOnUpdate) => IElement; renderArrowPrevious?: (update: () => any) => IElement; renderArrowNext?: (update: () => any) => IElement; progress?: boolean | Partial<Record<IValueBreakpoints, boolean>>; progressVisibility?: 'hover' | 'visible' | Partial<Record<IValueBreakpoints, 'hover' | 'visible'>>; start?: any; end?: any; noTransition?: boolean | Partial<Record<IValueBreakpoints, boolean>>; onUpdatePosition?: (value: ICarouselValue) => any; onInit?: TMethod; onUpdateItems?: TMethod; onBlur?: (event: React.FocusEvent<any>) => any; onFocus?: (event: React.FocusEvent<any>) => any; onMouseEnte?: (event: React.MouseEvent<any>) => any; onMouseLeave?: (event: React.MouseEvent<any>) => any; TransitionComponent?: IElementReference; ProgressTransitionComponent?: IElementReference; ArrowTransitionComponent?: IElementReference; ArrowPreviousTransitionComponent?: IElementReference; ArrowNextTransitionComponent?: IElementReference; IconButtonPrevious?: IElement; IconButtonNext?: IElement; IconPrevious?: IElementReference; IconNext?: IElementReference; ArrowProps?: IPropsAny; ArrowPreviousProps?: IPropsAny; ArrowNextProps?: IPropsAny; CarouselProps?: IPropsAny; TransitionsProps?: IPropsAny; TransitionComponentProps?: IPropsAny; ArrowTransitionComponentProps?: IPropsAny; ArrowPreviousTransitionComponentProps?: IPropsAny; ArrowNextTransitionComponentProps?: IPropsAny; ProgressTransitionComponentProps?: IPropsAny; ItemWrapperProps?: IPropsAny; }; declare const Carousel: React.FC<ICarousel>; export default Carousel;