ngx-carousel-ease
Version:
ngx-carousel-ease is a versatile Angular library providing a feature-rich, simple, and performant carousel component. This library supports infinite and responsive mode, mouse and touch event. Attention has been put to accessibility, performance, and frie
116 lines (115 loc) • 5.04 kB
TypeScript
import { ChangeDetectorRef } from '@angular/core';
import { Carousel } from './carousel';
import { CarouselService } from './carousel.service';
import { CommunSlider } from './communSlider';
export declare class InfiniteSlider extends CommunSlider {
readonly MAX_DOM_SIZE: number;
constructor(carousel: Carousel, responsive: boolean, slideToScroll: number, LIMIT_AUTO_SLIDE: number, strechingLimit: number, autoSlide: boolean, animationTimingFn: string, animationTimingMs: number, MAX_DOM_SIZE: number, enableMouseDrag: boolean, enableTouch: boolean, autoPlay: boolean, autoPlayInterval: number, autoPlayAtStart: boolean, playDirection: string, autoplaySlideToScroll: number, carouselService: CarouselService, cd: ChangeDetectorRef);
initProperties(): void;
/**
* next and prev are defined separatively
*/
defineAutoPlayDirection(): void;
/**
* Add slides to the right at start
* If only one window (number of dots === 1) and not responsive mode, there is possibly space at start for slides to the right (even though this configuration does not make a lot of sense)
* TODO: ajouter des slides si slidesToShow > total slides
*/
addSlidesToRightAtStart(): void;
/**
* Fired at drag start
* Instantiate property of the starting drag point on the X axis. Used to compute the translation.
* Disabling the transition while applying the transformation because of the attached animation.
*/
dragStart(event: MouseEvent | TouchEvent): void;
/**
* Relaunch autoPlay if not disabled or infinite mode (never disabled by limits)
* Restart only if started (playActive).
*/
relaunchAutoPlay(): void;
/**
* Fired at drag end
*/
dragStop(event: MouseEvent | TouchEvent): void;
autoSlider(): void;
/**
* Fired at dragging
* Compute the translation, change the slide number, update the direction.
*/
dragMove(event: MouseEvent | TouchEvent): void;
/**
* Responsible for changing slide number and updating the limits.
* If createSlidesInfiniteModeIfLimitsReached() doesn't take action, slide change according to previous computed limits.
*/
modifyCurrentSlide(): void;
/**
* Handle slide creation in infinite mode if limits reached
* Mouse or touch drag.
*/
createSlidesInfiniteModeIfLimits(): boolean;
/**
* Append or prepend new slides according to the direction
* If new slides prepended, update the translation to the correct place (appending new slides do not change the translation).
* Limit DOM growth or update last window translation if applicable.
*/
appendOrPrependNElements(): void;
/**
* Limit DOM growth
* Reset the view accordingly.
*/
limitDOMGrowth(): void;
/**
* Reset the view in a movement to the left
* New slides added to the left, so the view has to be updated accordingly.
* If the carousel is moved with the mouse | touch event (dragging is true), the offset should be equal to a full carousel width. Otherwise (with the buttons), the computed translation should be taken into account.
* Side comment: the view does not have to be updated for slides added to the right, since relative order does not change.
* getBoundingClientRect triggers reflow of the element.
*/
resetViewLeftDirection(): void;
/**
* Reset the view in a movement to the right
* First set of slides have been deleted, so the translation has to be updated accordingly.
* currentTranslation is a negative number so it will be decreased by a set of slides.
* getBoundingClientRect triggers reflow of the element.
*/
resetViewRightDirection(): void;
addSlidesToTheLeft(): void;
addSlidesToTheRight(): void;
/**
* Increase limit on basis of previous computed limits (movement to the right)
* Schema: || previous | current || next
*/
increaseLimits(): void;
/**
* Previous button navigation
*/
prev(slides?: number): void;
/**
* Next button navigation
*/
next(slides?: number): void;
/**
* Buttons navigation in infinite mode
* Create new slide if limits reached (start or end). Update slide, limits and apply transformation accordingly.
*/
handleBtnInfinite(step: number): void;
/**
* Navigation with bullet points
* Update values accordingly.
*/
goTo(bullet: number): void;
/**
* Bullets navigation
* Create new slides if exceeding end of carousel.
*/
navInfiniteBullets(bullet: number): void;
/**
* Exception: if only one window (numberDots === 1), update the accumulatedSlide to let the transformation occurs, but currentSlide should stay at 0.
*/
changeSlideNumber(step: number): void;
infiniteChangeSlideNumber(step: number): void;
/**
* Compute transformation that will be applied on basis of the provided slide number
*/
computeTransformation(slide: number): void;
}