UNPKG

ngx-drag-scroll

Version:

Lightweight drag to scroll library for Angular

132 lines (131 loc) 5.68 kB
import { AfterViewChecked, AfterViewInit, ElementRef, OnChanges, OnDestroy, QueryList, Renderer2 } from '@angular/core'; import { DragScrollItemDirective } from './ngx-drag-scroll-item'; import * as i0 from "@angular/core"; export declare class DragScrollComponent implements OnDestroy, AfterViewInit, OnChanges, AfterViewChecked { private _elementRef; private _renderer; private _document; private _index; private _isDragging; private _onMouseMoveListener; private _onMouseUpListener; private _onMouseDownListener; private _onScrollListener; private _onDragStartListener; /** * Is the user currently pressing the element */ isPressed: boolean; /** * Is the user currently scrolling the element */ isScrolling: boolean; scrollTimer: number | NodeJS.Timer; scrollToTimer: number | NodeJS.Timer; /** * Is the user currently dragging the element */ get isDragging(): boolean; /** * The x coordinates on the element */ downX: number; /** * The y coordinates on the element */ downY: number; displayType: string | null; elWidth: string | null; elHeight: string | null; /** * The parentNode of carousel Element */ parentNode: HTMLElement; /** * The carousel Element */ _contentRef: ElementRef; _children: QueryList<DragScrollItemDirective>; _pointerEvents: string; wrapper: HTMLDivElement | null; scrollbarWidth: string | null; get currIndex(): number; set currIndex(value: number); isAnimating: boolean; prevChildrenLength: number; indexBound: number; rtl: boolean; dsInitialized: import("@angular/core").OutputEmitterRef<void>; indexChanged: import("@angular/core").OutputEmitterRef<number>; reachesLeftBound: import("@angular/core").OutputEmitterRef<boolean>; reachesRightBound: import("@angular/core").OutputEmitterRef<boolean>; snapAnimationFinished: import("@angular/core").OutputEmitterRef<number>; dragStart: import("@angular/core").OutputEmitterRef<void>; dragEnd: import("@angular/core").OutputEmitterRef<void>; /** * Whether the scrollbar is hidden */ scrollbarHidden: import("@angular/core").InputSignal<boolean>; /** * Whether horizontally and vertically draging and scrolling is be disabled */ disabled: import("@angular/core").InputSignal<boolean>; /** * Whether horizontally dragging and scrolling is be disabled */ xDisabled: import("@angular/core").InputSignal<boolean>; /** * Whether vertically dragging and scrolling events is disabled */ yDisabled: import("@angular/core").InputSignal<boolean>; /** * Whether scrolling horizontally with mouse wheel is enabled */ xWheelEnabled: import("@angular/core").InputSignal<boolean>; dragDisabled: import("@angular/core").InputSignal<boolean>; snapDisabled: import("@angular/core").InputSignal<boolean>; snapOffset: import("@angular/core").InputSignal<number>; snapDuration: import("@angular/core").InputSignal<number>; constructor(_elementRef: ElementRef, _renderer: Renderer2, _document: Document); ngOnChanges(): void; ngAfterViewInit(): void; ngAfterViewChecked(): void; ngOnDestroy(): void; onMouseMoveHandler(event: MouseEvent): void; onMouseMove(event: MouseEvent): void; onMouseDownHandler(event: MouseEvent): void; onScrollHandler(): void; onMouseUpHandler(): void; moveLeft(): void; moveRight(): void; moveTo(index: number): void; checkNavStatus(): void; onWheel(event: WheelEvent): void; onWindowResize(): void; private _setIsDragging; private _startGlobalListening; private stopGlobalListening; private disableScroll; private enableScroll; private hideScrollbar; private showScrollbar; private checkScrollbar; private setScrollBar; private getScrollbarWidth; private refreshWrapperDimensions; private scrollTo; private locateCurrentIndex; private currentChildWidth; private toChildrenLocation; private locateDragScrollItem; private markElDimension; private maximumIndex; private isScrollReachesRightEnd; /** * adds a margin right style to the last child element which will resolve the issue * of last item gets cutoff. */ private adjustMarginToLastChild; static ɵfac: i0.ɵɵFactoryDeclaration<DragScrollComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DragScrollComponent, "drag-scroll", never, { "scrollbarHidden": { "alias": "scrollbar-hidden"; "required": false; "isSignal": true; }; "disabled": { "alias": "drag-scroll-disabled"; "required": false; "isSignal": true; }; "xDisabled": { "alias": "drag-scroll-x-disabled"; "required": false; "isSignal": true; }; "yDisabled": { "alias": "drag-scroll-y-disabled"; "required": false; "isSignal": true; }; "xWheelEnabled": { "alias": "scroll-x-wheel-enabled"; "required": false; "isSignal": true; }; "dragDisabled": { "alias": "drag-disabled"; "required": false; "isSignal": true; }; "snapDisabled": { "alias": "snap-disabled"; "required": false; "isSignal": true; }; "snapOffset": { "alias": "snap-offset"; "required": false; "isSignal": true; }; "snapDuration": { "alias": "snap-duration"; "required": false; "isSignal": true; }; }, { "dsInitialized": "dsInitialized"; "indexChanged": "indexChanged"; "reachesLeftBound": "reachesLeftBound"; "reachesRightBound": "reachesRightBound"; "snapAnimationFinished": "snapAnimationFinished"; "dragStart": "dragStart"; "dragEnd": "dragEnd"; }, ["_children"], ["*"], true, never>; }