@hreimer/angular-image-viewer
Version:
A configurable Angular image viewer component, compatible with Angular 11.x+
343 lines (335 loc) • 28.8 kB
JavaScript
import * as i0 from '@angular/core';
import { Directive, Input, EventEmitter, Component, Optional, Inject, Output, HostListener, NgModule } from '@angular/core';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import * as i1 from '@angular/platform-browser';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
class CustomImageEvent {
constructor(name, imageIndex) {
this.name = name;
this.imageIndex = imageIndex;
}
}
// import * as screenfull from 'screenfull';
class FullScreenDirective {
constructor(el) {
this.el = el;
}
ngOnChanges(changes) {
// console.log('fullscreenState isFirstChange:', changes["fullscreenState"].isFirstChange());
// console.log('fullscreenState', this.fullscreenState);
// if (screenfull.isEnabled) {
// screenfull.toggle(this.el.nativeElement);
// }
// if (this.fullscreenState && screenfull.isEnabled) {
// screenfull.request(this.el.nativeElement);
// } else if (screenfull.isEnabled) {
// screenfull.exit();
// }
// tslint:disable-next-line: no-string-literal
if (!changes['fullscreenState'].isFirstChange()) {
if (this.fullscreenState) {
const element = this.el.nativeElement;
// tslint:disable-next-line: max-line-length
const requestMethod = element.requestFullscreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
if (requestMethod) { // Native full screen.
requestMethod.call(element);
}
else {
console.log('FullScreen Request Method Not Supported on this browser.');
}
}
else {
const element = document;
// tslint:disable-next-line: max-line-length
const requestMethod = element.cancelFullscreen || element.webkitExitFullscreen || element.webkitCancelFullScreen || element.mozCancelFullScreen || element.msExitFullScreen;
if (requestMethod) { // Native Cancel full screen.
requestMethod.call(element);
}
else {
console.log('FullScreen Cancel Request Method Not Supported on this browser.');
}
}
}
}
ngOnInit() {
}
}
FullScreenDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FullScreenDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
FullScreenDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: FullScreenDirective, selector: "[appScreenfull]", inputs: { fullscreenState: ["appScreenfull", "fullscreenState"] }, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FullScreenDirective, decorators: [{
type: Directive,
args: [{
selector: '[appScreenfull]'
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { fullscreenState: [{
type: Input,
args: ['appScreenfull']
}] } });
const DEFAULT_CONFIG = {
btnContainerClass: 'btn-container',
btnClass: 'default',
btnSubClass: 'material-icons',
zoomFactor: 0.1,
containerBackgroundColor: '#ccc',
wheelZoom: false,
allowFullscreen: true,
allowKeyboardNavigation: true,
btnShow: {
zoomIn: true,
zoomOut: true,
rotateClockwise: true,
rotateCounterClockwise: true,
next: true,
prev: true,
reset: true
},
btnIcons: {
zoomIn: {
classes: 'fa fa-plus',
text: 'zoom_in'
},
zoomOut: {
classes: 'fa fa-minus',
text: 'zoom_out'
},
rotateClockwise: {
classes: 'fa fa-repeat',
text: 'rotate_right'
},
rotateCounterClockwise: {
classes: 'fa fa-undo',
text: 'rotate_left'
},
next: {
classes: 'fa fa-arrow-right',
text: 'arrow_right'
},
prev: {
classes: 'fa fa-arrow-left',
text: 'arrow_left'
},
fullscreen: {
classes: 'fa fa-arrows-alt',
text: 'fullscreen'
},
reset: {
classes: 'fa fa-undo',
text: 'restore'
},
}
};
class AngularImageViewerComponent {
constructor(moduleConfig, sanitizer) {
this.moduleConfig = moduleConfig;
this.sanitizer = sanitizer;
this.index = 0;
this.indexChange = new EventEmitter();
this.configChange = new EventEmitter();
this.customImageEvent = new EventEmitter();
this.styleHeight = '100%';
this.style = { transform: '', msTransform: '', oTransform: '', webkitTransform: '' };
this.fullscreen = false;
this.loading = true;
this.scale = 1;
this.rotation = 0;
this.translateX = 0;
this.translateY = 0;
this.hovered = false;
}
ngOnChanges(changes) {
if (changes.screenHeightOccupied) {
this.styleHeight = 'calc(100% - ' + this.screenHeightOccupied + 'px)';
// console.log('Style Height:', this.styleHeight);
}
}
ngOnInit() {
const merged = this.mergeConfig(DEFAULT_CONFIG, this.moduleConfig);
this.config = this.mergeConfig(merged, this.config);
this.triggerConfigBinding();
}
nextImage(event) {
if (this.canNavigate(event) && this.index < this.src.length - 1) {
this.loading = true;
this.index++;
this.triggerIndexBinding();
this.reset();
}
}
prevImage(event) {
if (this.canNavigate(event) && this.index > 0) {
this.loading = true;
this.index--;
this.triggerIndexBinding();
this.reset();
}
}
zoomIn() {
this.scale *= (1 + this.config.zoomFactor);
this.updateStyle();
}
zoomOut() {
if (this.scale > this.config.zoomFactor) {
this.scale /= (1 + this.config.zoomFactor);
}
this.updateStyle();
}
scrollZoom(evt) {
if (this.config.wheelZoom) {
evt.deltaY > 0 ? this.zoomOut() : this.zoomIn();
return false;
}
}
rotateClockwise() {
this.rotation += 90;
this.updateStyle();
}
rotateCounterClockwise() {
this.rotation -= 90;
this.updateStyle();
}
onLoad(url) {
// console.log('Loading Image Done:', url);
this.loading = false;
}
onLoadStart(url) {
// console.log('Loading Image:', url);
this.loading = true;
}
imageNotFound(url) {
// console.log('Image not found Url:', url);
}
onDragOver(evt) {
this.translateX += (evt.clientX - this.prevX);
this.translateY += (evt.clientY - this.prevY);
this.prevX = evt.clientX;
this.prevY = evt.clientY;
this.updateStyle();
}
onDragStart(evt) {
if (evt.dataTransfer && evt.dataTransfer.setDragImage) {
evt.dataTransfer.setDragImage(evt.target.nextElementSibling, 0, 0);
}
this.prevX = evt.clientX;
this.prevY = evt.clientY;
}
toggleFullscreen() {
this.fullscreen = !this.fullscreen;
if (!this.fullscreen) {
this.reset();
}
}
triggerIndexBinding() {
this.indexChange.emit(this.index);
}
triggerConfigBinding() {
this.configChange.next(this.config);
}
fireCustomEvent(name, imageIndex) {
this.customImageEvent.emit(new CustomImageEvent(name, imageIndex));
}
reset() {
this.scale = 1;
this.rotation = 0;
this.translateX = 0;
this.translateY = 0;
this.updateStyle();
}
onMouseOver() {
this.hovered = true;
}
onMouseLeave() {
this.hovered = false;
}
canNavigate(event) {
return event == null || (this.config.allowKeyboardNavigation && this.hovered);
}
updateStyle() {
this.style.transform = `translate(${this.translateX}px, ${this.translateY}px) rotate(${this.rotation}deg) scale(${this.scale})`;
this.style.msTransform = this.style.transform;
this.style.webkitTransform = this.style.transform;
this.style.oTransform = this.style.transform;
}
mergeConfig(defaultValues, overrideValues) {
let result = { ...defaultValues };
if (overrideValues) {
result = { ...defaultValues, ...overrideValues };
if (overrideValues.btnIcons) {
result.btnIcons = { ...defaultValues.btnIcons, ...overrideValues.btnIcons };
}
}
return result;
}
}
AngularImageViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AngularImageViewerComponent, deps: [{ token: 'config', optional: true }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
AngularImageViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AngularImageViewerComponent, selector: "angular-image-viewer", inputs: { src: "src", screenHeightOccupied: "screenHeightOccupied", index: "index", config: "config" }, outputs: { indexChange: "indexChange", configChange: "configChange", customImageEvent: "customImageEvent" }, host: { listeners: { "window:keyup.ArrowRight": "nextImage($event)", "window:keyup.ArrowLeft": "prevImage($event)", "mouseover": "onMouseOver()", "mouseleave": "onMouseLeave()" } }, usesOnChanges: true, ngImport: i0, template: "<div [appScreenfull]=\"fullscreen\" class=\"img-container\" [style.height]=\"styleHeight\"\n [style.backgroundColor]=\"config.containerBackgroundColor\" (wheel)=\"scrollZoom($event)\"\n (dragover)=\"onDragOver($event)\">\n <img [src]=\"src[index]\" [ngStyle]=\"style\" alt=\"Image not found...\" (dragstart)=\"onDragStart($event)\"\n (load)=\"onLoad(src[index])\" (error)=\"imageNotFound(src[index])\" (loadstart)=\"onLoadStart(src[index])\" />\n <!-- Div below will be used to hide the 'ghost' image when dragging -->\n <div></div>\n <div class=\"spinner-container\" *ngIf=\"loading\">\n <div class=\"spinner\"></div>\n </div>\n\n <!-- Button Container -->\n <div class=\"btn-container\" [class]=\"config.btnContainerClass\">\n <!-- Rotate Counter Clockwise -->\n <ng-container *ngIf=\"config.btnShow.rotateCounterClockwise\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"rotateCounterClockwise()\" *ngIf=\"config.btnIcons.rotateCounterClockwise.classes\" >\n <span [class]=\"config.btnIcons.rotateCounterClockwise.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.rotateCounterClockwise.text\" (click)=\"rotateCounterClockwise()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.rotateCounterClockwise.text}}</span>\n </a>\n </ng-container>\n\n <!-- Rotate Clockwise -->\n <ng-container *ngIf=\"config.btnShow.rotateClockwise\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"rotateClockwise()\" *ngIf=\"config.btnIcons.rotateClockwise.classes\" >\n <span [class]=\"config.btnIcons.rotateClockwise.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.rotateClockwise.text\" (click)=\"rotateClockwise()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.rotateClockwise.text}}</span>\n </a>\n </ng-container>\n\n <!-- Zoom Out -->\n <ng-container *ngIf=\"config.btnShow.zoomOut\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"zoomOut()\" *ngIf=\"config.btnIcons.zoomOut.classes\" >\n <span [class]=\"config.btnIcons.zoomOut.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.zoomOut.text\" (click)=\"zoomOut()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.zoomOut.text}}</span>\n </a>\n </ng-container>\n\n <!-- Zoom In -->\n <ng-container *ngIf=\"config.btnShow.zoomIn\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"zoomIn()\" *ngIf=\"config.btnIcons.zoomIn.classes\" >\n <span [class]=\"config.btnIcons.zoomIn.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.zoomIn.text\" (click)=\"zoomIn()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.zoomIn.text}}</span>\n </a>\n </ng-container>\n\n <!-- Fullscreen -->\n <ng-container *ngIf=\"config.allowFullscreen\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"toggleFullscreen()\" *ngIf=\"config.btnIcons.fullscreen.classes\" >\n <span [class]=\"config.btnIcons.fullscreen.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.fullscreen.text\" (click)=\"toggleFullscreen()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.fullscreen.text}}</span>\n </a>\n </ng-container>\n\n <!-- Reset -->\n <ng-container *ngIf=\"config.btnShow.reset\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"reset()\" *ngIf=\"config.btnIcons.reset.classes\" >\n <span [class]=\"config.btnIcons.reset.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.reset.text\" (click)=\"reset()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.reset.text}}</span>\n </a>\n </ng-container>\n\n <!-- Custom Buttons -->\n <ng-container *ngFor=\"let cBtn of config.customBtns\">\n <button *ngIf=\"cBtn.icon.classes\" type=\"button\" [class]=\"config.btnClass\"\n (click)=\"fireCustomEvent(cBtn.name, index)\">\n <span *ngIf=\"cBtn.icon.classes\" [class]=\"cBtn.icon.classes\"></span>\n </button>\n <ng-container *ngIf=\"cBtn.icon.text\">\n <a [class]=\"config.btnClass\" *ngIf=\"cBtn.icon.text\" (click)=\"fireCustomEvent(cBtn.name, index)\">\n <span [class]=\"config.btnSubClass\">{{cBtn.icon.text}}</span>\n </a>\n </ng-container>\n </ng-container>\n </div>\n\n <!-- Prev / Next Nav Container -->\n <div class=\"nav-button-container\" *ngIf=\"src.length > 1\">\n <button *ngIf=\"config.btnShow.next\" type=\"button\" [class]=\"config.btnClass\" (click)=\"prevImage($event)\" [disabled]=\"index === 0\">\n <span *ngIf=\"config.btnIcons.prev.classes\" [class]=\"config.btnIcons.prev.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.prev.text\" (click)=\"prevImage($event)\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.prev.text}}</span>\n </a>\n <button *ngIf=\"config.btnShow.next\" type=\"button\" [class]=\"config.btnClass\" (click)=\"nextImage($event)\"\n [disabled]=\"index === src.length - 1\">\n <span *ngIf=\"config.btnIcons.next.classes\" [class]=\"config.btnIcons.next.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.next.text\" (click)=\"nextImage($event)\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.next.text}}</span>\n </a>\n </div>\n</div>", styles: [".img-container{width:100%;display:flex;justify-content:center;align-items:center;overflow:hidden}.img-container .btn-container{position:absolute;z-index:98;text-align:right;bottom:0;right:0;width:100%}.img-container img{max-width:100%;max-height:100%}.img-container a,.img-container button{z-index:99;position:relative}.img-container a:not(:disabled),.img-container button:not(:disabled){cursor:pointer}button.default,a.default{height:40px;width:40px;border:1px solid #555;border-radius:50%;background-color:#fff;opacity:.7;transition:opacity .2s}button.default:hover,a.default:hover{opacity:1}button.default:disabled,a.default:disabled{opacity:.25}.nav-button-container>button,.nav-button-container>a{position:relative;right:0;margin:0 10px}.nav-button-container{text-align:center;position:absolute;z-index:98;bottom:50px;left:0;right:0}.spinner-container{position:absolute;inset:0;width:60px;height:60px;margin:auto;padding:10px;background-color:#0006;border-radius:25%}.spinner{border-width:7px;border-style:solid;border-color:#ccc;border-bottom-color:#222;border-radius:50%;height:100%;width:100%;box-sizing:border-box;animation:rotation 2s linear infinite}@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: FullScreenDirective, selector: "[appScreenfull]", inputs: ["appScreenfull"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AngularImageViewerComponent, decorators: [{
type: Component,
args: [{ selector: 'angular-image-viewer', template: "<div [appScreenfull]=\"fullscreen\" class=\"img-container\" [style.height]=\"styleHeight\"\n [style.backgroundColor]=\"config.containerBackgroundColor\" (wheel)=\"scrollZoom($event)\"\n (dragover)=\"onDragOver($event)\">\n <img [src]=\"src[index]\" [ngStyle]=\"style\" alt=\"Image not found...\" (dragstart)=\"onDragStart($event)\"\n (load)=\"onLoad(src[index])\" (error)=\"imageNotFound(src[index])\" (loadstart)=\"onLoadStart(src[index])\" />\n <!-- Div below will be used to hide the 'ghost' image when dragging -->\n <div></div>\n <div class=\"spinner-container\" *ngIf=\"loading\">\n <div class=\"spinner\"></div>\n </div>\n\n <!-- Button Container -->\n <div class=\"btn-container\" [class]=\"config.btnContainerClass\">\n <!-- Rotate Counter Clockwise -->\n <ng-container *ngIf=\"config.btnShow.rotateCounterClockwise\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"rotateCounterClockwise()\" *ngIf=\"config.btnIcons.rotateCounterClockwise.classes\" >\n <span [class]=\"config.btnIcons.rotateCounterClockwise.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.rotateCounterClockwise.text\" (click)=\"rotateCounterClockwise()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.rotateCounterClockwise.text}}</span>\n </a>\n </ng-container>\n\n <!-- Rotate Clockwise -->\n <ng-container *ngIf=\"config.btnShow.rotateClockwise\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"rotateClockwise()\" *ngIf=\"config.btnIcons.rotateClockwise.classes\" >\n <span [class]=\"config.btnIcons.rotateClockwise.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.rotateClockwise.text\" (click)=\"rotateClockwise()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.rotateClockwise.text}}</span>\n </a>\n </ng-container>\n\n <!-- Zoom Out -->\n <ng-container *ngIf=\"config.btnShow.zoomOut\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"zoomOut()\" *ngIf=\"config.btnIcons.zoomOut.classes\" >\n <span [class]=\"config.btnIcons.zoomOut.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.zoomOut.text\" (click)=\"zoomOut()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.zoomOut.text}}</span>\n </a>\n </ng-container>\n\n <!-- Zoom In -->\n <ng-container *ngIf=\"config.btnShow.zoomIn\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"zoomIn()\" *ngIf=\"config.btnIcons.zoomIn.classes\" >\n <span [class]=\"config.btnIcons.zoomIn.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.zoomIn.text\" (click)=\"zoomIn()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.zoomIn.text}}</span>\n </a>\n </ng-container>\n\n <!-- Fullscreen -->\n <ng-container *ngIf=\"config.allowFullscreen\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"toggleFullscreen()\" *ngIf=\"config.btnIcons.fullscreen.classes\" >\n <span [class]=\"config.btnIcons.fullscreen.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.fullscreen.text\" (click)=\"toggleFullscreen()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.fullscreen.text}}</span>\n </a>\n </ng-container>\n\n <!-- Reset -->\n <ng-container *ngIf=\"config.btnShow.reset\">\n <button type=\"button\" [class]=\"config.btnClass\"\n (click)=\"reset()\" *ngIf=\"config.btnIcons.reset.classes\" >\n <span [class]=\"config.btnIcons.reset.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.reset.text\" (click)=\"reset()\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.reset.text}}</span>\n </a>\n </ng-container>\n\n <!-- Custom Buttons -->\n <ng-container *ngFor=\"let cBtn of config.customBtns\">\n <button *ngIf=\"cBtn.icon.classes\" type=\"button\" [class]=\"config.btnClass\"\n (click)=\"fireCustomEvent(cBtn.name, index)\">\n <span *ngIf=\"cBtn.icon.classes\" [class]=\"cBtn.icon.classes\"></span>\n </button>\n <ng-container *ngIf=\"cBtn.icon.text\">\n <a [class]=\"config.btnClass\" *ngIf=\"cBtn.icon.text\" (click)=\"fireCustomEvent(cBtn.name, index)\">\n <span [class]=\"config.btnSubClass\">{{cBtn.icon.text}}</span>\n </a>\n </ng-container>\n </ng-container>\n </div>\n\n <!-- Prev / Next Nav Container -->\n <div class=\"nav-button-container\" *ngIf=\"src.length > 1\">\n <button *ngIf=\"config.btnShow.next\" type=\"button\" [class]=\"config.btnClass\" (click)=\"prevImage($event)\" [disabled]=\"index === 0\">\n <span *ngIf=\"config.btnIcons.prev.classes\" [class]=\"config.btnIcons.prev.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.prev.text\" (click)=\"prevImage($event)\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.prev.text}}</span>\n </a>\n <button *ngIf=\"config.btnShow.next\" type=\"button\" [class]=\"config.btnClass\" (click)=\"nextImage($event)\"\n [disabled]=\"index === src.length - 1\">\n <span *ngIf=\"config.btnIcons.next.classes\" [class]=\"config.btnIcons.next.classes\"></span>\n </button>\n <a [class]=\"config.btnClass\" *ngIf=\"config.btnIcons.next.text\" (click)=\"nextImage($event)\">\n <span [class]=\"config.btnSubClass\">{{config.btnIcons.next.text}}</span>\n </a>\n </div>\n</div>", styles: [".img-container{width:100%;display:flex;justify-content:center;align-items:center;overflow:hidden}.img-container .btn-container{position:absolute;z-index:98;text-align:right;bottom:0;right:0;width:100%}.img-container img{max-width:100%;max-height:100%}.img-container a,.img-container button{z-index:99;position:relative}.img-container a:not(:disabled),.img-container button:not(:disabled){cursor:pointer}button.default,a.default{height:40px;width:40px;border:1px solid #555;border-radius:50%;background-color:#fff;opacity:.7;transition:opacity .2s}button.default:hover,a.default:hover{opacity:1}button.default:disabled,a.default:disabled{opacity:.25}.nav-button-container>button,.nav-button-container>a{position:relative;right:0;margin:0 10px}.nav-button-container{text-align:center;position:absolute;z-index:98;bottom:50px;left:0;right:0}.spinner-container{position:absolute;inset:0;width:60px;height:60px;margin:auto;padding:10px;background-color:#0006;border-radius:25%}.spinner{border-width:7px;border-style:solid;border-color:#ccc;border-bottom-color:#222;border-radius:50%;height:100%;width:100%;box-sizing:border-box;animation:rotation 2s linear infinite}@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}\n"] }]
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
type: Optional
}, {
type: Inject,
args: ['config']
}] }, { type: i1.DomSanitizer }]; }, propDecorators: { src: [{
type: Input
}], screenHeightOccupied: [{
type: Input
}], index: [{
type: Input
}], config: [{
type: Input
}], indexChange: [{
type: Output
}], configChange: [{
type: Output
}], customImageEvent: [{
type: Output
}], nextImage: [{
type: HostListener,
args: ['window:keyup.ArrowRight', ['$event']]
}], prevImage: [{
type: HostListener,
args: ['window:keyup.ArrowLeft', ['$event']]
}], onMouseOver: [{
type: HostListener,
args: ['mouseover']
}], onMouseLeave: [{
type: HostListener,
args: ['mouseleave']
}] } });
// import { ImageViewerConfig } from 'dist/angular-image-viewer/public-api';
class AngularImageViewerModule {
}
AngularImageViewerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AngularImageViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
AngularImageViewerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AngularImageViewerModule, declarations: [AngularImageViewerComponent, FullScreenDirective], imports: [CommonModule,
BrowserModule,
FormsModule,
BrowserAnimationsModule], exports: [AngularImageViewerComponent, FullScreenDirective] });
AngularImageViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AngularImageViewerModule, imports: [CommonModule,
BrowserModule,
FormsModule,
BrowserAnimationsModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AngularImageViewerModule, decorators: [{
type: NgModule,
args: [{
declarations: [AngularImageViewerComponent, FullScreenDirective],
imports: [
CommonModule,
BrowserModule,
FormsModule,
BrowserAnimationsModule,
],
exports: [AngularImageViewerComponent, FullScreenDirective]
}]
}] });
/*
* Public API Surface of angular-image-viewer
*/
/**
* Generated bundle index. Do not edit.
*/
export { AngularImageViewerComponent, AngularImageViewerModule, CustomImageEvent, FullScreenDirective };
//# sourceMappingURL=hreimer-angular-image-viewer.mjs.map