UNPKG

@ngx-gallery/gallerize

Version:

Angular gallery directive that hooks the lightbox with the images automatically.

39 lines (38 loc) 1.74 kB
import { OnInit, OnDestroy, NgZone, ElementRef, Renderer2 } from '@angular/core'; import { Gallery, GalleryComponent } from '@ngx-gallery/core'; import { Lightbox } from '@ngx-gallery/lightbox'; export declare class GallerizeDirective implements OnInit, OnDestroy { private _zone; private _el; private _gallery; private _lightbox; private _renderer; private _document; private _galleryCmp; /** Default gallery id */ private _galleryId; /** Gallerize mode */ private readonly _mode; /** If host element is a HTMLElement, will use the following variables: */ /** Stream that emits to fire the detection stream the image elements has changed */ private _observer$; /** Stream that emits when image is discover */ private _detector$; /** If host element is a GalleryComponent, will use the following variables: */ /** Gallery events (if used on a gallery component) */ private _itemClick$; private _itemChange$; /** If set, it will become the gallery id */ gallerize: string; /** The selector used to query images elements */ selector: string; constructor(_zone: NgZone, _el: ElementRef, _gallery: Gallery, _lightbox: Lightbox, _renderer: Renderer2, platform: Object, _document: any, _galleryCmp: GalleryComponent); ngOnInit(): void; ngOnDestroy(): void; /** Gallery mode: means `gallerize` directive is used on `<gallery>` component * Adds a click event to each gallery item so it opens in lightbox */ private galleryMode; /** Detector mode: means `gallerize` directive is used on a normal HTMLElement * Detects images and adds a click event to each image so it opens in the lightbox */ private detectorMode; }