UNPKG

@azerafati/ngx-scroll-drag

Version:

[![Build Status](https://github.com/azerafati/scroll-drag/actions/workflows/test.yml/badge.svg)](https://github.com/azerafati/scroll-drag/actions) [![npm version](https://img.shields.io/npm/v/@azerafati/ngx-scroll-drag.svg?logo=npm&logoColor=fff&label=NPM

50 lines (49 loc) 1.98 kB
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core'; import * as i0 from "@angular/core"; declare enum Direction { Top = "top", Bottom = "bottom", Right = "right", Left = "left" } export type ShadowDir = { [key in Direction]: boolean; }; export declare class ScrollDragDirective implements OnInit, AfterViewInit, OnDestroy { private elemRef; private renderer; scrollDirection: 'Horizontal' | 'Vertical'; scrollShadow: boolean; shadowChange: EventEmitter<{ direction: Direction; isShown: boolean; }>; backgroundColor: string; disableDrag: boolean; shadow: ShadowDir; private dateScrollChange$; private dateScrollChangeSubscription?; private inertia; private scrollDragSnap; private startDragY?; private startDragX?; private isPressed; private readonly element; constructor(elemRef: ElementRef, renderer: Renderer2); set ngxScrollDrag(value: number | string | undefined); ngAfterViewInit(): void; startDrag(ev: MouseEvent): void; drag(ev: MouseEvent): void; leave(ev: MouseEvent): void; stopDrag(ev: MouseEvent): void; onScroll(): void; ngOnInit(): void; scroll(scrollOffset: number): void; ngOnDestroy(): void; private setBoxShadowClass; private switchClass; private setBackgroundShadow; static ɵfac: i0.ɵɵFactoryDeclaration<ScrollDragDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ScrollDragDirective, "[ngxScrollDrag]", never, { "scrollDirection": { "alias": "scrollDirection"; "required": false; }; "scrollShadow": { "alias": "scrollShadow"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "disableDrag": { "alias": "disableDrag"; "required": false; }; "ngxScrollDrag": { "alias": "ngxScrollDrag"; "required": false; }; }, { "shadowChange": "shadowChange"; }, never, never, false, never>; } export {};