@autotaxatiepartners/ngx-gallery 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/autotaxatiepartners-ngx-gallery.mjs +1896 -0
- package/fesm2022/autotaxatiepartners-ngx-gallery.mjs.map +1 -0
- package/index.d.ts +611 -0
- package/package.json +37 -64
- package/.editorconfig +0 -13
- package/.eslintrc.json +0 -51
- package/.travis.yml +0 -38
- package/angular.json +0 -108
- package/projects/gallery/.eslintrc.json +0 -55
- package/projects/gallery/README.md +0 -24
- package/projects/gallery/karma.conf.js +0 -52
- package/projects/gallery/ng-package.json +0 -7
- package/projects/gallery/package.json +0 -32
- package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.html +0 -4
- package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.scss +0 -21
- package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.spec.ts +0 -25
- package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.ts +0 -28
- package/projects/gallery/src/lib/ngx-gallery-action.ts +0 -23
- package/projects/gallery/src/lib/ngx-gallery-animation.ts +0 -6
- package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.html +0 -27
- package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.scss +0 -45
- package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.spec.ts +0 -25
- package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.ts +0 -28
- package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.html +0 -4
- package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.scss +0 -26
- package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.spec.ts +0 -25
- package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.ts +0 -25
- package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.html +0 -49
- package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.scss +0 -106
- package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.spec.ts +0 -35
- package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.ts +0 -381
- package/projects/gallery/src/lib/ngx-gallery-image-size.ts +0 -4
- package/projects/gallery/src/lib/ngx-gallery-image.ts +0 -31
- package/projects/gallery/src/lib/ngx-gallery-layout.ts +0 -4
- package/projects/gallery/src/lib/ngx-gallery-options.ts +0 -261
- package/projects/gallery/src/lib/ngx-gallery-order.ts +0 -5
- package/projects/gallery/src/lib/ngx-gallery-ordered-image.ts +0 -19
- package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.html +0 -117
- package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.scss +0 -121
- package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.spec.ts +0 -34
- package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.ts +0 -619
- package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.html +0 -45
- package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.scss +0 -87
- package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.spec.ts +0 -31
- package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.ts +0 -298
- package/projects/gallery/src/lib/ngx-gallery.component.html +0 -53
- package/projects/gallery/src/lib/ngx-gallery.component.scss +0 -77
- package/projects/gallery/src/lib/ngx-gallery.component.spec.ts +0 -37
- package/projects/gallery/src/lib/ngx-gallery.component.ts +0 -336
- package/projects/gallery/src/lib/ngx-gallery.module.ts +0 -29
- package/projects/gallery/src/lib/ngx-gallery.service.spec.ts +0 -18
- package/projects/gallery/src/lib/ngx-gallery.service.ts +0 -71
- package/projects/gallery/src/public-api.ts +0 -20
- package/projects/gallery/src/test.ts +0 -17
- package/projects/gallery/tsconfig.lib.json +0 -14
- package/projects/gallery/tsconfig.lib.prod.json +0 -9
- package/projects/gallery/tsconfig.spec.json +0 -16
- package/projects/gallery-app/.browserslistrc +0 -12
- package/projects/gallery-app/.eslintrc.json +0 -40
- package/projects/gallery-app/e2e/protractor.conf.js +0 -32
- package/projects/gallery-app/e2e/src/app.e2e-spec.ts +0 -23
- package/projects/gallery-app/e2e/src/app.po.ts +0 -11
- package/projects/gallery-app/e2e/tsconfig.json +0 -13
- package/projects/gallery-app/karma.conf.js +0 -32
- package/projects/gallery-app/src/app/app-routing.module.ts +0 -11
- package/projects/gallery-app/src/app/app.component.html +0 -4
- package/projects/gallery-app/src/app/app.component.scss +0 -9
- package/projects/gallery-app/src/app/app.component.spec.ts +0 -35
- package/projects/gallery-app/src/app/app.component.ts +0 -82
- package/projects/gallery-app/src/app/app.module.ts +0 -20
- package/projects/gallery-app/src/assets/.gitkeep +0 -0
- package/projects/gallery-app/src/assets/img/gallery/1-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/1-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/1-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/2-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/2-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/2-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/3-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/3-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/3-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/4-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/4-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/4-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/5-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/5-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/5-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/6-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/6-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/6-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/7-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/7-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/7-small.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/8-big.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/8-medium.jpeg +0 -0
- package/projects/gallery-app/src/assets/img/gallery/8-small.jpeg +0 -0
- package/projects/gallery-app/src/environments/environment.prod.ts +0 -3
- package/projects/gallery-app/src/environments/environment.ts +0 -16
- package/projects/gallery-app/src/favicon.ico +0 -0
- package/projects/gallery-app/src/index.html +0 -13
- package/projects/gallery-app/src/main.ts +0 -12
- package/projects/gallery-app/src/polyfills.ts +0 -53
- package/projects/gallery-app/src/styles.scss +0 -1
- package/projects/gallery-app/src/test.ts +0 -16
- package/projects/gallery-app/tsconfig.app.json +0 -17
- package/projects/gallery-app/tsconfig.spec.json +0 -18
- package/tsconfig.json +0 -43
|
@@ -0,0 +1,1896 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, HostListener, ViewChild, HostBinding, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/platform-browser';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
7
|
+
|
|
8
|
+
class NgxGalleryService {
|
|
9
|
+
constructor(renderer) {
|
|
10
|
+
this.renderer = renderer;
|
|
11
|
+
this.swipeHandlers = new Map();
|
|
12
|
+
this.pointerData = new Map();
|
|
13
|
+
}
|
|
14
|
+
manageSwipe(status, element, id, nextHandler, prevHandler) {
|
|
15
|
+
const handlers = this.swipeHandlers.get(id);
|
|
16
|
+
if (status && !handlers) {
|
|
17
|
+
const el = element.nativeElement;
|
|
18
|
+
const pointerDown = this.renderer.listen(el, 'pointerdown', (event) => {
|
|
19
|
+
this.pointerData.set(id, { x: event.clientX });
|
|
20
|
+
});
|
|
21
|
+
const pointerUp = this.renderer.listen(el, 'pointerup', (event) => {
|
|
22
|
+
const start = this.pointerData.get(id);
|
|
23
|
+
const endX = event.clientX;
|
|
24
|
+
if (!start)
|
|
25
|
+
return;
|
|
26
|
+
const deltaX = endX - start.x;
|
|
27
|
+
const threshold = 40;
|
|
28
|
+
if (deltaX > threshold) {
|
|
29
|
+
prevHandler();
|
|
30
|
+
}
|
|
31
|
+
else if (deltaX < -threshold) {
|
|
32
|
+
nextHandler();
|
|
33
|
+
}
|
|
34
|
+
this.pointerData.delete(id);
|
|
35
|
+
});
|
|
36
|
+
const pointerCancel = this.renderer.listen(el, 'pointercancel', () => {
|
|
37
|
+
this.pointerData.delete(id);
|
|
38
|
+
});
|
|
39
|
+
const pointerLeave = this.renderer.listen(el, 'pointerleave', () => {
|
|
40
|
+
this.pointerData.delete(id);
|
|
41
|
+
});
|
|
42
|
+
this.swipeHandlers.set(id, [pointerDown, pointerUp, pointerCancel, pointerLeave]);
|
|
43
|
+
}
|
|
44
|
+
else if (!status && handlers) {
|
|
45
|
+
handlers.forEach(unlisten => unlisten());
|
|
46
|
+
this.swipeHandlers.delete(id);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
validateUrl(url) {
|
|
50
|
+
return url?.replace(/ /g, '%20').replace(/'/g, '%27') ?? url;
|
|
51
|
+
}
|
|
52
|
+
getBackgroundUrl(image) {
|
|
53
|
+
return `url('${this.validateUrl(image)}')`;
|
|
54
|
+
}
|
|
55
|
+
getFileType(fileSource) {
|
|
56
|
+
const ext = fileSource.split('.').pop()?.toLowerCase();
|
|
57
|
+
return ['avi', 'flv', 'wmv', 'mov', 'mp4'].includes(ext ?? '') ? 'video' : 'image';
|
|
58
|
+
}
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryService, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
60
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryService, providedIn: 'root' }); }
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryService, decorators: [{
|
|
63
|
+
type: Injectable,
|
|
64
|
+
args: [{ providedIn: 'root' }]
|
|
65
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }] });
|
|
66
|
+
|
|
67
|
+
class NgxGalleryArrowsComponent {
|
|
68
|
+
constructor() {
|
|
69
|
+
this.prevClick = new EventEmitter();
|
|
70
|
+
this.nextClick = new EventEmitter();
|
|
71
|
+
}
|
|
72
|
+
handlePrevClick() {
|
|
73
|
+
this.prevClick.emit();
|
|
74
|
+
}
|
|
75
|
+
handleNextClick() {
|
|
76
|
+
this.nextClick.emit();
|
|
77
|
+
}
|
|
78
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryArrowsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
79
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: NgxGalleryArrowsComponent, isStandalone: false, selector: "ngx-gallery-arrows", inputs: { prevDisabled: "prevDisabled", nextDisabled: "nextDisabled", arrowPrevIcon: "arrowPrevIcon", arrowNextIcon: "arrowNextIcon", arrowIconSize: "arrowIconSize" }, outputs: { prevClick: "prevClick", nextClick: "nextClick" }, ngImport: i0, template: "<div class=\"ngx-gallery-arrows-wrapper ngx-gallery-arrow-left\">\n <div\n class=\"ngx-gallery-icon ngx-gallery-arrow\"\n aria-hidden=\"true\"\n (click)=\"handlePrevClick()\"\n [class.ngx-gallery-disabled]=\"prevDisabled\"\n >\n <i\n [ngClass]=\"['ngx-gallery-icon-content', arrowPrevIcon]\"\n [style.fontSize.px]=\"arrowIconSize\"\n ></i>\n </div>\n</div>\n\n<div class=\"ngx-gallery-arrows-wrapper ngx-gallery-arrow-right\">\n <div\n class=\"ngx-gallery-icon ngx-gallery-arrow\"\n aria-hidden=\"true\"\n (click)=\"handleNextClick()\"\n [class.ngx-gallery-disabled]=\"nextDisabled\"\n >\n <i\n [ngClass]=\"['ngx-gallery-icon-content', arrowNextIcon]\"\n [style.fontSize.px]=\"arrowIconSize\"\n ></i>\n </div>\n</div>\n", styles: [".ngx-gallery-arrow-wrapper{position:absolute;height:100%;width:1px;display:table;table-layout:fixed}.ngx-gallery-preview-img-wrapper .ngx-gallery-arrow-wrapper{z-index:10001}.ngx-gallery-arrow-left{left:0}.ngx-gallery-arrow-right{right:0}.ngx-gallery-arrow{top:50%;transform:translateY(-50%);cursor:pointer}.ngx-gallery-arrow.ngx-gallery-disabled{opacity:.6;cursor:default}.ngx-gallery-arrow-left .ngx-gallery-arrow{left:10px}.ngx-gallery-arrow-right .ngx-gallery-arrow{right:10px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryArrowsComponent, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{ selector: 'ngx-gallery-arrows', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"ngx-gallery-arrows-wrapper ngx-gallery-arrow-left\">\n <div\n class=\"ngx-gallery-icon ngx-gallery-arrow\"\n aria-hidden=\"true\"\n (click)=\"handlePrevClick()\"\n [class.ngx-gallery-disabled]=\"prevDisabled\"\n >\n <i\n [ngClass]=\"['ngx-gallery-icon-content', arrowPrevIcon]\"\n [style.fontSize.px]=\"arrowIconSize\"\n ></i>\n </div>\n</div>\n\n<div class=\"ngx-gallery-arrows-wrapper ngx-gallery-arrow-right\">\n <div\n class=\"ngx-gallery-icon ngx-gallery-arrow\"\n aria-hidden=\"true\"\n (click)=\"handleNextClick()\"\n [class.ngx-gallery-disabled]=\"nextDisabled\"\n >\n <i\n [ngClass]=\"['ngx-gallery-icon-content', arrowNextIcon]\"\n [style.fontSize.px]=\"arrowIconSize\"\n ></i>\n </div>\n</div>\n", styles: [".ngx-gallery-arrow-wrapper{position:absolute;height:100%;width:1px;display:table;table-layout:fixed}.ngx-gallery-preview-img-wrapper .ngx-gallery-arrow-wrapper{z-index:10001}.ngx-gallery-arrow-left{left:0}.ngx-gallery-arrow-right{right:0}.ngx-gallery-arrow{top:50%;transform:translateY(-50%);cursor:pointer}.ngx-gallery-arrow.ngx-gallery-disabled{opacity:.6;cursor:default}.ngx-gallery-arrow-left .ngx-gallery-arrow{left:10px}.ngx-gallery-arrow-right .ngx-gallery-arrow{right:10px}\n"] }]
|
|
84
|
+
}], ctorParameters: () => [], propDecorators: { prevDisabled: [{
|
|
85
|
+
type: Input
|
|
86
|
+
}], nextDisabled: [{
|
|
87
|
+
type: Input
|
|
88
|
+
}], arrowPrevIcon: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}], arrowNextIcon: [{
|
|
91
|
+
type: Input
|
|
92
|
+
}], arrowIconSize: [{
|
|
93
|
+
type: Input
|
|
94
|
+
}], prevClick: [{
|
|
95
|
+
type: Output
|
|
96
|
+
}], nextClick: [{
|
|
97
|
+
type: Output
|
|
98
|
+
}] } });
|
|
99
|
+
|
|
100
|
+
class NgxGalleryActionComponent {
|
|
101
|
+
constructor() {
|
|
102
|
+
this.disabled = false;
|
|
103
|
+
this.titleText = '';
|
|
104
|
+
this.closeClick = new EventEmitter();
|
|
105
|
+
}
|
|
106
|
+
handleClick(event) {
|
|
107
|
+
if (!this.disabled) {
|
|
108
|
+
this.closeClick.emit(event);
|
|
109
|
+
}
|
|
110
|
+
event.stopPropagation();
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
}
|
|
113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: NgxGalleryActionComponent, isStandalone: false, selector: "ngx-gallery-action", inputs: { icon: "icon", disabled: "disabled", titleText: "titleText" }, outputs: { closeClick: "closeClick" }, ngImport: i0, template: "<div class=\"ngx-gallery-icon\" [class.ngx-gallery-icon-disabled]=\"disabled\" aria-hidden=\"true\" title=\"{{ titleText }}\"\n (click)=\"handleClick($event)\">\n <i class=\"ngx-gallery-icon-content {{ icon }}\"></i>\n</div>", styles: [".ngx-gallery-icon{color:#fff;font-size:25px;position:absolute;z-index:2000;display:inline-block}.ngx-gallery-icon{position:relative;margin-right:10px;margin-top:10px;font-size:25px;cursor:pointer;text-decoration:none}.ngx-gallery-icon .ngx-gallery-icon-content{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryActionComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{ selector: 'ngx-gallery-action', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"ngx-gallery-icon\" [class.ngx-gallery-icon-disabled]=\"disabled\" aria-hidden=\"true\" title=\"{{ titleText }}\"\n (click)=\"handleClick($event)\">\n <i class=\"ngx-gallery-icon-content {{ icon }}\"></i>\n</div>", styles: [".ngx-gallery-icon{color:#fff;font-size:25px;position:absolute;z-index:2000;display:inline-block}.ngx-gallery-icon{position:relative;margin-right:10px;margin-top:10px;font-size:25px;cursor:pointer;text-decoration:none}.ngx-gallery-icon .ngx-gallery-icon-content{display:block}\n"] }]
|
|
119
|
+
}], ctorParameters: () => [], propDecorators: { icon: [{
|
|
120
|
+
type: Input
|
|
121
|
+
}], disabled: [{
|
|
122
|
+
type: Input
|
|
123
|
+
}], titleText: [{
|
|
124
|
+
type: Input
|
|
125
|
+
}], closeClick: [{
|
|
126
|
+
type: Output
|
|
127
|
+
}] } });
|
|
128
|
+
|
|
129
|
+
class NgxGalleryBulletsComponent {
|
|
130
|
+
constructor() {
|
|
131
|
+
this.active = 0;
|
|
132
|
+
this.bulletChange = new EventEmitter();
|
|
133
|
+
}
|
|
134
|
+
getBullets() {
|
|
135
|
+
return Array(this.count);
|
|
136
|
+
}
|
|
137
|
+
handleChange(event, index) {
|
|
138
|
+
this.bulletChange.emit(index);
|
|
139
|
+
}
|
|
140
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryBulletsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGalleryBulletsComponent, isStandalone: false, selector: "ngx-gallery-bullets", inputs: { count: "count", active: "active" }, outputs: { bulletChange: "bulletChange" }, ngImport: i0, template: "@for (bullet of getBullets(); track bullet; let i = $index) {\n<div class=\"ngx-gallery-bullet\" (click)=\"handleChange($event, i)\" [ngClass]=\"{ 'ngx-gallery-active': i === active }\">\n</div>\n}", styles: [":host{position:absolute;z-index:2000;display:inline-flex;left:50%;transform:translate(-50%);bottom:0;padding:10px}.ngx-gallery-bullet{width:10px;height:10px;border-radius:50%;cursor:pointer;background:#fff}.ngx-gallery-bullet:not(:first-child){margin-left:5px}.ngx-gallery-bullet:hover,.ngx-gallery-bullet.ngx-gallery-active{background:#000}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
142
|
+
}
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryBulletsComponent, decorators: [{
|
|
144
|
+
type: Component,
|
|
145
|
+
args: [{ selector: 'ngx-gallery-bullets', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@for (bullet of getBullets(); track bullet; let i = $index) {\n<div class=\"ngx-gallery-bullet\" (click)=\"handleChange($event, i)\" [ngClass]=\"{ 'ngx-gallery-active': i === active }\">\n</div>\n}", styles: [":host{position:absolute;z-index:2000;display:inline-flex;left:50%;transform:translate(-50%);bottom:0;padding:10px}.ngx-gallery-bullet{width:10px;height:10px;border-radius:50%;cursor:pointer;background:#fff}.ngx-gallery-bullet:not(:first-child){margin-left:5px}.ngx-gallery-bullet:hover,.ngx-gallery-bullet.ngx-gallery-active{background:#000}\n"] }]
|
|
146
|
+
}], ctorParameters: () => [], propDecorators: { count: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], active: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], bulletChange: [{
|
|
151
|
+
type: Output
|
|
152
|
+
}] } });
|
|
153
|
+
|
|
154
|
+
class NgxGalleryPreviewComponent {
|
|
155
|
+
constructor(sanitization, elementRef, helperService, renderer, changeDetectorRef) {
|
|
156
|
+
this.sanitization = sanitization;
|
|
157
|
+
this.elementRef = elementRef;
|
|
158
|
+
this.helperService = helperService;
|
|
159
|
+
this.renderer = renderer;
|
|
160
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
161
|
+
this.showSpinner = false;
|
|
162
|
+
this.positionLeft = 0;
|
|
163
|
+
this.positionTop = 0;
|
|
164
|
+
this.zoomValue = 1;
|
|
165
|
+
this.loading = false;
|
|
166
|
+
this.rotateValue = 0;
|
|
167
|
+
this.index = 0;
|
|
168
|
+
this.previewOpen = new EventEmitter();
|
|
169
|
+
this.previewClose = new EventEmitter();
|
|
170
|
+
this.activeChange = new EventEmitter();
|
|
171
|
+
this.isOpen = false;
|
|
172
|
+
this.initialX = 0;
|
|
173
|
+
this.initialY = 0;
|
|
174
|
+
this.initialLeft = 0;
|
|
175
|
+
this.initialTop = 0;
|
|
176
|
+
this.isMove = false;
|
|
177
|
+
// interaction mode: 'none' | 'pan' | 'swipe'
|
|
178
|
+
this.interactionMode = 'none';
|
|
179
|
+
// swipe tracking
|
|
180
|
+
this.swipeStartX = 0;
|
|
181
|
+
this.swipeStartY = 0;
|
|
182
|
+
this.swipeOffsetX = 0;
|
|
183
|
+
this.swipeAnimating = false;
|
|
184
|
+
}
|
|
185
|
+
ngOnInit() {
|
|
186
|
+
if (this.arrows && this.arrowsAutoHide) {
|
|
187
|
+
this.arrows = false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
ngAfterViewInit() {
|
|
191
|
+
// no external swiper hookup anymore
|
|
192
|
+
}
|
|
193
|
+
ngOnDestroy() {
|
|
194
|
+
if (this.keyDownListener) {
|
|
195
|
+
this.keyDownListener();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
onMouseEnter() {
|
|
199
|
+
if (this.arrowsAutoHide && !this.arrows) {
|
|
200
|
+
this.arrows = true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
onMouseLeave() {
|
|
204
|
+
if (this.arrowsAutoHide && this.arrows) {
|
|
205
|
+
this.arrows = false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
onKeyDown(e) {
|
|
209
|
+
if (!this.isOpen) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (this.keyboardNavigation) {
|
|
213
|
+
if (this.isKeyboardPrev(e)) {
|
|
214
|
+
this.showPrev();
|
|
215
|
+
}
|
|
216
|
+
else if (this.isKeyboardNext(e)) {
|
|
217
|
+
this.showNext();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (this.closeOnEsc && this.isKeyboardEsc(e)) {
|
|
221
|
+
this.close();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
open(index) {
|
|
225
|
+
this.previewOpen.emit();
|
|
226
|
+
this.index = index;
|
|
227
|
+
this.isOpen = true;
|
|
228
|
+
this.show(true);
|
|
229
|
+
if (this.forceFullscreen) {
|
|
230
|
+
this.manageFullscreen();
|
|
231
|
+
}
|
|
232
|
+
this.keyDownListener = this.renderer.listen('window', 'keydown', (e) => this.onKeyDown(e));
|
|
233
|
+
}
|
|
234
|
+
close() {
|
|
235
|
+
this.isOpen = false;
|
|
236
|
+
const video = this.previewImage?.nativeElement;
|
|
237
|
+
if (video &&
|
|
238
|
+
video.currentTime > 0 &&
|
|
239
|
+
!video.paused &&
|
|
240
|
+
!video.ended &&
|
|
241
|
+
video.readyState > 2) {
|
|
242
|
+
video.pause();
|
|
243
|
+
}
|
|
244
|
+
this.closeFullscreen();
|
|
245
|
+
this.previewClose.emit();
|
|
246
|
+
this.stopAutoPlay();
|
|
247
|
+
if (this.keyDownListener) {
|
|
248
|
+
this.keyDownListener();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
onWrapperClick(event) {
|
|
252
|
+
if (!this.closeOnClick) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
this.close();
|
|
256
|
+
}
|
|
257
|
+
imageMouseEnter() {
|
|
258
|
+
if (this.autoPlay && this.autoPlayPauseOnHover) {
|
|
259
|
+
this.stopAutoPlay();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
imageMouseLeave() {
|
|
263
|
+
if (this.autoPlay && this.autoPlayPauseOnHover) {
|
|
264
|
+
this.startAutoPlay();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
startAutoPlay() {
|
|
268
|
+
if (this.autoPlay) {
|
|
269
|
+
this.stopAutoPlay();
|
|
270
|
+
this.timer = setTimeout(() => {
|
|
271
|
+
if (!this.showNext()) {
|
|
272
|
+
this.index = -1;
|
|
273
|
+
this.showNext();
|
|
274
|
+
}
|
|
275
|
+
}, this.autoPlayInterval);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
stopAutoPlay() {
|
|
279
|
+
if (this.timer) {
|
|
280
|
+
clearTimeout(this.timer);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
showAtIndex(index) {
|
|
284
|
+
this.index = index;
|
|
285
|
+
this.show();
|
|
286
|
+
}
|
|
287
|
+
showNext() {
|
|
288
|
+
if (this.canShowNext()) {
|
|
289
|
+
this.index++;
|
|
290
|
+
if (this.index === this.images.length) {
|
|
291
|
+
this.index = 0;
|
|
292
|
+
}
|
|
293
|
+
this.show();
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
showPrev() {
|
|
301
|
+
if (this.canShowPrev()) {
|
|
302
|
+
this.index--;
|
|
303
|
+
if (this.index < 0) {
|
|
304
|
+
this.index = this.images.length - 1;
|
|
305
|
+
}
|
|
306
|
+
this.show();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
canShowNext() {
|
|
310
|
+
if (this.loading) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
if (this.images) {
|
|
314
|
+
return this.infinityMove || this.index < this.images.length - 1;
|
|
315
|
+
}
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
canShowPrev() {
|
|
319
|
+
if (this.loading) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
if (this.images) {
|
|
323
|
+
return this.infinityMove || this.index > 0;
|
|
324
|
+
}
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
manageFullscreen() {
|
|
328
|
+
if (this.fullscreen || this.forceFullscreen) {
|
|
329
|
+
const doc = document;
|
|
330
|
+
if (!doc.fullscreenElement && !doc.mozFullScreenElement
|
|
331
|
+
&& !doc.webkitFullscreenElement && !doc.msFullscreenElement) {
|
|
332
|
+
this.openFullscreen();
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
this.closeFullscreen();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
getSafeUrl(image) {
|
|
340
|
+
return this.sanitization.bypassSecurityTrustUrl(image);
|
|
341
|
+
}
|
|
342
|
+
getFileType(fileSource) {
|
|
343
|
+
return this.helperService.getFileType(fileSource);
|
|
344
|
+
}
|
|
345
|
+
zoomIn() {
|
|
346
|
+
if (this.canZoomIn()) {
|
|
347
|
+
this.zoomValue += this.zoomStep;
|
|
348
|
+
if (this.zoomValue > this.zoomMax) {
|
|
349
|
+
this.zoomValue = this.zoomMax;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
zoomOut() {
|
|
354
|
+
if (this.canZoomOut()) {
|
|
355
|
+
this.zoomValue -= this.zoomStep;
|
|
356
|
+
if (this.zoomValue < this.zoomMin) {
|
|
357
|
+
this.zoomValue = this.zoomMin;
|
|
358
|
+
}
|
|
359
|
+
if (this.zoomValue <= 1) {
|
|
360
|
+
this.resetPosition();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
rotateLeft() {
|
|
365
|
+
this.rotateValue -= 90;
|
|
366
|
+
}
|
|
367
|
+
rotateRight() {
|
|
368
|
+
this.rotateValue += 90;
|
|
369
|
+
}
|
|
370
|
+
getTransform() {
|
|
371
|
+
return this.sanitization.bypassSecurityTrustStyle('scale(' + this.zoomValue + ') rotate(' + this.rotateValue + 'deg)');
|
|
372
|
+
}
|
|
373
|
+
canZoomIn() {
|
|
374
|
+
return this.zoomValue < this.zoomMax;
|
|
375
|
+
}
|
|
376
|
+
canZoomOut() {
|
|
377
|
+
return this.zoomValue > this.zoomMin;
|
|
378
|
+
}
|
|
379
|
+
canDragOnZoom() {
|
|
380
|
+
return this.zoom && this.zoomValue > 1;
|
|
381
|
+
}
|
|
382
|
+
// these 3 are the ones your current HTML calls
|
|
383
|
+
mouseDownHandler(e) {
|
|
384
|
+
this.onSwipeStart(e);
|
|
385
|
+
}
|
|
386
|
+
mouseMoveHandler(e) {
|
|
387
|
+
this.onSwipeMove(e);
|
|
388
|
+
}
|
|
389
|
+
mouseUpHandler(e) {
|
|
390
|
+
this.onSwipeEnd(e);
|
|
391
|
+
}
|
|
392
|
+
// generic swipe/pan handlers
|
|
393
|
+
onSwipeStart(e) {
|
|
394
|
+
const x = this.getClientX(e);
|
|
395
|
+
const y = this.getClientY(e);
|
|
396
|
+
if (this.canDragOnZoom()) {
|
|
397
|
+
this.interactionMode = 'pan';
|
|
398
|
+
this.initialX = x;
|
|
399
|
+
this.initialY = y;
|
|
400
|
+
this.initialLeft = this.positionLeft;
|
|
401
|
+
this.initialTop = this.positionTop;
|
|
402
|
+
this.isMove = true;
|
|
403
|
+
}
|
|
404
|
+
else if (this.swipe) {
|
|
405
|
+
this.interactionMode = 'swipe';
|
|
406
|
+
this.swipeStartX = x;
|
|
407
|
+
this.swipeStartY = y;
|
|
408
|
+
this.swipeOffsetX = 0;
|
|
409
|
+
this.swipeAnimating = false;
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
this.interactionMode = 'none';
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
onSwipeMove(e) {
|
|
416
|
+
if (this.interactionMode === 'pan') {
|
|
417
|
+
if (this.isMove) {
|
|
418
|
+
this.positionLeft = this.initialLeft + (this.getClientX(e) - this.initialX);
|
|
419
|
+
this.positionTop = this.initialTop + (this.getClientY(e) - this.initialY);
|
|
420
|
+
}
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
if (this.interactionMode === 'swipe') {
|
|
424
|
+
const currentX = this.getClientX(e);
|
|
425
|
+
const currentY = this.getClientY(e);
|
|
426
|
+
const deltaX = currentX - this.swipeStartX;
|
|
427
|
+
const deltaY = currentY - this.swipeStartY;
|
|
428
|
+
if (Math.abs(deltaY) > Math.abs(deltaX)) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
this.swipeOffsetX = deltaX;
|
|
432
|
+
e.preventDefault();
|
|
433
|
+
this.changeDetectorRef.markForCheck();
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
onSwipeEnd(e) {
|
|
437
|
+
if (this.interactionMode === 'pan') {
|
|
438
|
+
this.isMove = false;
|
|
439
|
+
this.interactionMode = 'none';
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (this.interactionMode === 'swipe') {
|
|
443
|
+
const endX = this.getClientX(e);
|
|
444
|
+
const endY = this.getClientY(e);
|
|
445
|
+
const deltaX = endX - this.swipeStartX;
|
|
446
|
+
const deltaY = endY - this.swipeStartY;
|
|
447
|
+
const horizontalThreshold = 60;
|
|
448
|
+
const verticalThreshold = 80;
|
|
449
|
+
if (Math.abs(deltaX) > horizontalThreshold && Math.abs(deltaY) < verticalThreshold) {
|
|
450
|
+
if (deltaX < 0) {
|
|
451
|
+
if (this.canShowNext()) {
|
|
452
|
+
this.animateSwipeTo(-100);
|
|
453
|
+
this.showNext();
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
this.animateSwipeTo(0);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
if (this.canShowPrev()) {
|
|
461
|
+
this.animateSwipeTo(100);
|
|
462
|
+
this.showPrev();
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
this.animateSwipeTo(0);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
this.animateSwipeTo(0);
|
|
471
|
+
}
|
|
472
|
+
this.interactionMode = 'none';
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
animateSwipeTo(percent) {
|
|
476
|
+
this.swipeAnimating = true;
|
|
477
|
+
if (percent === 0) {
|
|
478
|
+
this.swipeOffsetX = 0;
|
|
479
|
+
this.changeDetectorRef.markForCheck();
|
|
480
|
+
setTimeout(() => {
|
|
481
|
+
this.swipeAnimating = false;
|
|
482
|
+
this.changeDetectorRef.markForCheck();
|
|
483
|
+
}, 200);
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
this.swipeOffsetX = (percent / 100) * this.getPreviewWidth();
|
|
487
|
+
this.changeDetectorRef.markForCheck();
|
|
488
|
+
setTimeout(() => {
|
|
489
|
+
this.swipeOffsetX = 0;
|
|
490
|
+
this.swipeAnimating = false;
|
|
491
|
+
this.changeDetectorRef.markForCheck();
|
|
492
|
+
}, 200);
|
|
493
|
+
}
|
|
494
|
+
getSwipeTransform() {
|
|
495
|
+
if (!this.swipeOffsetX) {
|
|
496
|
+
return 'translateX(0px)';
|
|
497
|
+
}
|
|
498
|
+
return 'translateX(' + this.swipeOffsetX + 'px)';
|
|
499
|
+
}
|
|
500
|
+
getPreviewWidth() {
|
|
501
|
+
const host = this.elementRef.nativeElement;
|
|
502
|
+
const el = host.querySelector('.ngx-gallery-preview-img-wrapper');
|
|
503
|
+
if (el) {
|
|
504
|
+
return el.clientWidth;
|
|
505
|
+
}
|
|
506
|
+
return 300;
|
|
507
|
+
}
|
|
508
|
+
getClientX(e) {
|
|
509
|
+
const touchEvent = e;
|
|
510
|
+
if (touchEvent.touches && touchEvent.touches.length) {
|
|
511
|
+
return touchEvent.touches[0].clientX;
|
|
512
|
+
}
|
|
513
|
+
if (touchEvent.changedTouches && touchEvent.changedTouches.length) {
|
|
514
|
+
return touchEvent.changedTouches[0].clientX;
|
|
515
|
+
}
|
|
516
|
+
const mouseEvent = e;
|
|
517
|
+
return mouseEvent.clientX;
|
|
518
|
+
}
|
|
519
|
+
getClientY(e) {
|
|
520
|
+
const touchEvent = e;
|
|
521
|
+
if (touchEvent.touches && touchEvent.touches.length) {
|
|
522
|
+
return touchEvent.touches[0].clientY;
|
|
523
|
+
}
|
|
524
|
+
if (touchEvent.changedTouches && touchEvent.changedTouches.length) {
|
|
525
|
+
return touchEvent.changedTouches[0].clientY;
|
|
526
|
+
}
|
|
527
|
+
const mouseEvent = e;
|
|
528
|
+
return mouseEvent.clientY;
|
|
529
|
+
}
|
|
530
|
+
resetPosition() {
|
|
531
|
+
if (this.zoom) {
|
|
532
|
+
this.positionLeft = 0;
|
|
533
|
+
this.positionTop = 0;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
isKeyboardNext(e) {
|
|
537
|
+
return e.keyCode === 39;
|
|
538
|
+
}
|
|
539
|
+
isKeyboardPrev(e) {
|
|
540
|
+
return e.keyCode === 37;
|
|
541
|
+
}
|
|
542
|
+
isKeyboardEsc(e) {
|
|
543
|
+
return e.keyCode === 27;
|
|
544
|
+
}
|
|
545
|
+
openFullscreen() {
|
|
546
|
+
const element = document.documentElement;
|
|
547
|
+
if (element.requestFullscreen) {
|
|
548
|
+
element.requestFullscreen();
|
|
549
|
+
}
|
|
550
|
+
else if (element.msRequestFullscreen) {
|
|
551
|
+
element.msRequestFullscreen();
|
|
552
|
+
}
|
|
553
|
+
else if (element.mozRequestFullScreen) {
|
|
554
|
+
element.mozRequestFullScreen();
|
|
555
|
+
}
|
|
556
|
+
else if (element.webkitRequestFullscreen) {
|
|
557
|
+
element.webkitRequestFullscreen();
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
closeFullscreen() {
|
|
561
|
+
if (this.isFullscreen()) {
|
|
562
|
+
const doc = document;
|
|
563
|
+
if (doc.exitFullscreen) {
|
|
564
|
+
doc.exitFullscreen();
|
|
565
|
+
}
|
|
566
|
+
else if (doc.msExitFullscreen) {
|
|
567
|
+
doc.msExitFullscreen();
|
|
568
|
+
}
|
|
569
|
+
else if (doc.mozCancelFullScreen) {
|
|
570
|
+
doc.mozCancelFullScreen();
|
|
571
|
+
}
|
|
572
|
+
else if (doc.webkitExitFullscreen) {
|
|
573
|
+
doc.webkitExitFullscreen();
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
isFullscreen() {
|
|
578
|
+
const doc = document;
|
|
579
|
+
return doc.fullscreenElement || doc.webkitFullscreenElement
|
|
580
|
+
|| doc.mozFullScreenElement || doc.msFullscreenElement;
|
|
581
|
+
}
|
|
582
|
+
show(first = false) {
|
|
583
|
+
this.loading = true;
|
|
584
|
+
this.stopAutoPlay();
|
|
585
|
+
this.activeChange.emit(this.index);
|
|
586
|
+
this.swipeOffsetX = 0;
|
|
587
|
+
this.swipeAnimating = false;
|
|
588
|
+
if (first || !this.animation) {
|
|
589
|
+
this._show();
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
setTimeout(() => this._show(), 600);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
_show() {
|
|
596
|
+
this.zoomValue = 1;
|
|
597
|
+
this.rotateValue = 0;
|
|
598
|
+
this.resetPosition();
|
|
599
|
+
this.src = this.getSafeUrl(this.images[this.index]);
|
|
600
|
+
this.type = this.getFileType(this.images[this.index]);
|
|
601
|
+
this.srcIndex = this.index;
|
|
602
|
+
this.description = this.descriptions?.[this.index];
|
|
603
|
+
this.changeDetectorRef.markForCheck();
|
|
604
|
+
setTimeout(() => {
|
|
605
|
+
if (this.isLoaded(this.previewImage?.nativeElement) || this.type === 'video') {
|
|
606
|
+
this.loading = false;
|
|
607
|
+
this.startAutoPlay();
|
|
608
|
+
this.changeDetectorRef.markForCheck();
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
setTimeout(() => {
|
|
612
|
+
if (this.loading) {
|
|
613
|
+
this.showSpinner = true;
|
|
614
|
+
this.changeDetectorRef.markForCheck();
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
if (this.previewImage && this.previewImage.nativeElement) {
|
|
618
|
+
this.previewImage.nativeElement.onload = () => {
|
|
619
|
+
this.loading = false;
|
|
620
|
+
this.showSpinner = false;
|
|
621
|
+
this.previewImage.nativeElement.onload = null;
|
|
622
|
+
this.startAutoPlay();
|
|
623
|
+
this.changeDetectorRef.markForCheck();
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
isLoaded(img) {
|
|
630
|
+
if (!img || !img.complete) {
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
return !(typeof img.naturalWidth !== 'undefined' && img.naturalWidth === 0);
|
|
634
|
+
}
|
|
635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryPreviewComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i0.ElementRef }, { token: NgxGalleryService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
636
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGalleryPreviewComponent, isStandalone: false, selector: "ngx-gallery-preview", inputs: { images: "images", descriptions: "descriptions", showDescription: "showDescription", arrows: "arrows", arrowsAutoHide: "arrowsAutoHide", swipe: "swipe", fullscreen: "fullscreen", forceFullscreen: "forceFullscreen", closeOnClick: "closeOnClick", closeOnEsc: "closeOnEsc", keyboardNavigation: "keyboardNavigation", arrowPrevIcon: "arrowPrevIcon", arrowNextIcon: "arrowNextIcon", arrowIconSize: "arrowIconSize", closeIcon: "closeIcon", fullscreenIcon: "fullscreenIcon", spinnerIcon: "spinnerIcon", autoPlay: "autoPlay", autoPlayInterval: "autoPlayInterval", autoPlayPauseOnHover: "autoPlayPauseOnHover", infinityMove: "infinityMove", zoom: "zoom", zoomStep: "zoomStep", zoomMax: "zoomMax", zoomMin: "zoomMin", zoomInIcon: "zoomInIcon", zoomOutIcon: "zoomOutIcon", animation: "animation", actions: "actions", rotate: "rotate", rotateLeftIcon: "rotateLeftIcon", rotateRightIcon: "rotateRightIcon", download: "download", downloadIcon: "downloadIcon", bullets: "bullets" }, outputs: { previewOpen: "previewOpen", previewClose: "previewClose", activeChange: "activeChange" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, viewQueries: [{ propertyName: "previewImage", first: true, predicate: ["previewImage"], descendants: true }], ngImport: i0, template: "@if (arrows) {\n <ngx-gallery-arrows\n (prevClick)=\"showPrev()\"\n (nextClick)=\"showNext()\"\n [prevDisabled]=\"!canShowPrev()\"\n [nextDisabled]=\"!canShowNext()\"\n [arrowPrevIcon]=\"arrowPrevIcon\"\n [arrowNextIcon]=\"arrowNextIcon\"\n [arrowIconSize]=\"arrowIconSize\">\n </ngx-gallery-arrows>\n}\n\n<div class=\"ngx-gallery-preview-top\">\n <div class=\"ngx-gallery-preview-icons\">\n @for (action of actions; track action) {\n <ngx-gallery-action\n [icon]=\"action.icon\"\n [disabled]=\"action.disabled\"\n [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, index)\"></ngx-gallery-action>\n }\n @if (download && src) {\n <a [href]=\"src\" class=\"ngx-gallery-icon\" aria-hidden=\"true\" download>\n <i class=\"ngx-gallery-icon-content {{ downloadIcon }}\"></i>\n </a>\n }\n @if (zoom) {\n <ngx-gallery-action [icon]=\"zoomOutIcon\" [disabled]=\"!canZoomOut()\" (closeClick)=\"zoomOut()\"></ngx-gallery-action>\n }\n @if (zoom) {\n <ngx-gallery-action [icon]=\"zoomInIcon\" [disabled]=\"!canZoomIn()\" (closeClick)=\"zoomIn()\"></ngx-gallery-action>\n }\n @if (rotate) {\n <ngx-gallery-action [icon]=\"rotateLeftIcon\" (closeClick)=\"rotateLeft()\"></ngx-gallery-action>\n }\n @if (rotate) {\n <ngx-gallery-action [icon]=\"rotateRightIcon\" (closeClick)=\"rotateRight()\"></ngx-gallery-action>\n }\n @if (fullscreen) {\n <ngx-gallery-action [icon]=\"'ngx-gallery-fullscreen ' + fullscreenIcon\"\n (closeClick)=\"manageFullscreen()\"></ngx-gallery-action>\n }\n <ngx-gallery-action [icon]=\"'ngx-gallery-close ' + closeIcon\" (closeClick)=\"close()\"></ngx-gallery-action>\n </div>\n</div>\n\n<div class=\"ngx-spinner-wrapper ngx-gallery-center\" [class.ngx-gallery-active]=\"showSpinner\">\n <i class=\"ngx-gallery-icon ngx-gallery-spinner {{spinnerIcon}}\" aria-hidden=\"true\"></i>\n</div>\n\n<div\n class=\"ngx-gallery-preview-wrapper\"\n (click)=\"onWrapperClick($event)\"\n>\n <div class=\"ngx-gallery-preview-img-wrapper\">\n @if (src && type === 'image') {\n <img\n #previewImage\n class=\"ngx-gallery-preview-img ngx-gallery-center\"\n [src]=\"src\"\n (click)=\"$event.stopPropagation()\"\n (mouseenter)=\"imageMouseEnter()\"\n (mouseleave)=\"imageMouseLeave()\"\n (mousedown)=\"mouseDownHandler($event)\"\n (mousemove)=\"mouseMoveHandler($event)\"\n (mouseup)=\"mouseUpHandler($event)\"\n (touchstart)=\"mouseDownHandler($event)\"\n (touchmove)=\"mouseMoveHandler($event)\"\n (touchend)=\"mouseUpHandler($event)\"\n [class.ngx-gallery-active]=\"!loading\"\n [class.animation]=\"animation\"\n [class.ngx-gallery-grab]=\"canDragOnZoom()\"\n [style.transform]=\"getTransform()\"\n [style.left]=\"positionLeft + 'px'\"\n [style.top]=\"positionTop + 'px'\"\n />\n }\n\n @if (src && type === 'video') {\n <video\n #previewImage\n controls\n style=\"width: 100%; height: 100%;\"\n class=\"ngx-gallery-preview-img ngx-gallery-center\"\n (click)=\"$event.stopPropagation()\"\n (mouseenter)=\"imageMouseEnter()\"\n (mouseleave)=\"imageMouseLeave()\"\n (mousedown)=\"mouseDownHandler($event)\"\n (mousemove)=\"mouseMoveHandler($event)\"\n (mouseup)=\"mouseUpHandler($event)\"\n (touchstart)=\"mouseDownHandler($event)\"\n (touchmove)=\"mouseMoveHandler($event)\"\n (touchend)=\"mouseUpHandler($event)\"\n [class.ngx-gallery-active]=\"!loading\"\n [class.animation]=\"animation\"\n [class.ngx-gallery-grab]=\"canDragOnZoom()\"\n [style.transform]=\"getTransform()\"\n [style.left]=\"positionLeft + 'px'\"\n [style.top]=\"positionTop + 'px'\">\n <source [src]=\"src\">\n Your browser does not support the video tag.\n </video>\n }\n\n @if (bullets) {\n <ngx-gallery-bullets\n [count]=\"images.length\"\n [active]=\"index\"\n (bulletChange)=\"showAtIndex($event)\">\n </ngx-gallery-bullets>\n }\n </div>\n\n @if (showDescription && description) {\n <div class=\"ngx-gallery-preview-text\" [innerHTML]=\"description\" (click)=\"$event.stopPropagation()\"></div>\n }\n</div>\n", styles: [":host.ngx-gallery-active{width:100%;height:100%;position:fixed;left:0;top:0;background:#000000b3;z-index:10000;display:inline-block;font-size:50px!important}:host{display:none;font-size:50px!important}:host .ngx-gallery-arrow{font-size:50px!important}ngx-gallery-bullets{height:5%;align-items:center;padding:0}.ngx-gallery-preview-img{opacity:0;max-width:90%;max-height:90%;-webkit-user-select:none;user-select:none;transition:transform .5s}.ngx-gallery-preview-img.animation{transition:opacity .5s linear,transform .5s}.ngx-gallery-preview-img.ngx-gallery-active{opacity:1}.ngx-gallery-preview-img.ngx-gallery-grab{cursor:grab}.ngx-gallery-icon.ngx-gallery-spinner{font-size:50px;left:0;display:inline-block}:host .ngx-gallery-preview-top{position:absolute;width:100%;-webkit-user-select:none;user-select:none;font-size:25px}.ngx-gallery-preview-icons{float:right}.ngx-gallery-preview-icons .ngx-gallery-icon{position:relative;margin-right:10px;margin-top:10px;font-size:25px;cursor:pointer;text-decoration:none}.ngx-gallery-preview-icons .ngx-gallery-icon.ngx-gallery-icon-disabled{cursor:default;opacity:.4}.ngx-spinner-wrapper{width:50px;height:50px;display:none}.ngx-spinner-wrapper.ngx-gallery-active{display:inline-block}.ngx-gallery-center{position:absolute;inset:0;margin:auto}.ngx-gallery-preview-text{width:100%;background:#000000b3;padding:10px;text-align:center;color:#fff;font-size:16px;flex:0 1 auto;z-index:10}.ngx-gallery-preview-wrapper{width:100%;height:100%;display:flex;flex-flow:column}.ngx-gallery-preview-img-wrapper{flex:1 1 auto;position:relative}\n"], dependencies: [{ kind: "component", type: NgxGalleryArrowsComponent, selector: "ngx-gallery-arrows", inputs: ["prevDisabled", "nextDisabled", "arrowPrevIcon", "arrowNextIcon", "arrowIconSize"], outputs: ["prevClick", "nextClick"] }, { kind: "component", type: NgxGalleryActionComponent, selector: "ngx-gallery-action", inputs: ["icon", "disabled", "titleText"], outputs: ["closeClick"] }, { kind: "component", type: NgxGalleryBulletsComponent, selector: "ngx-gallery-bullets", inputs: ["count", "active"], outputs: ["bulletChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
637
|
+
}
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryPreviewComponent, decorators: [{
|
|
639
|
+
type: Component,
|
|
640
|
+
args: [{ selector: 'ngx-gallery-preview', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (arrows) {\n <ngx-gallery-arrows\n (prevClick)=\"showPrev()\"\n (nextClick)=\"showNext()\"\n [prevDisabled]=\"!canShowPrev()\"\n [nextDisabled]=\"!canShowNext()\"\n [arrowPrevIcon]=\"arrowPrevIcon\"\n [arrowNextIcon]=\"arrowNextIcon\"\n [arrowIconSize]=\"arrowIconSize\">\n </ngx-gallery-arrows>\n}\n\n<div class=\"ngx-gallery-preview-top\">\n <div class=\"ngx-gallery-preview-icons\">\n @for (action of actions; track action) {\n <ngx-gallery-action\n [icon]=\"action.icon\"\n [disabled]=\"action.disabled\"\n [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, index)\"></ngx-gallery-action>\n }\n @if (download && src) {\n <a [href]=\"src\" class=\"ngx-gallery-icon\" aria-hidden=\"true\" download>\n <i class=\"ngx-gallery-icon-content {{ downloadIcon }}\"></i>\n </a>\n }\n @if (zoom) {\n <ngx-gallery-action [icon]=\"zoomOutIcon\" [disabled]=\"!canZoomOut()\" (closeClick)=\"zoomOut()\"></ngx-gallery-action>\n }\n @if (zoom) {\n <ngx-gallery-action [icon]=\"zoomInIcon\" [disabled]=\"!canZoomIn()\" (closeClick)=\"zoomIn()\"></ngx-gallery-action>\n }\n @if (rotate) {\n <ngx-gallery-action [icon]=\"rotateLeftIcon\" (closeClick)=\"rotateLeft()\"></ngx-gallery-action>\n }\n @if (rotate) {\n <ngx-gallery-action [icon]=\"rotateRightIcon\" (closeClick)=\"rotateRight()\"></ngx-gallery-action>\n }\n @if (fullscreen) {\n <ngx-gallery-action [icon]=\"'ngx-gallery-fullscreen ' + fullscreenIcon\"\n (closeClick)=\"manageFullscreen()\"></ngx-gallery-action>\n }\n <ngx-gallery-action [icon]=\"'ngx-gallery-close ' + closeIcon\" (closeClick)=\"close()\"></ngx-gallery-action>\n </div>\n</div>\n\n<div class=\"ngx-spinner-wrapper ngx-gallery-center\" [class.ngx-gallery-active]=\"showSpinner\">\n <i class=\"ngx-gallery-icon ngx-gallery-spinner {{spinnerIcon}}\" aria-hidden=\"true\"></i>\n</div>\n\n<div\n class=\"ngx-gallery-preview-wrapper\"\n (click)=\"onWrapperClick($event)\"\n>\n <div class=\"ngx-gallery-preview-img-wrapper\">\n @if (src && type === 'image') {\n <img\n #previewImage\n class=\"ngx-gallery-preview-img ngx-gallery-center\"\n [src]=\"src\"\n (click)=\"$event.stopPropagation()\"\n (mouseenter)=\"imageMouseEnter()\"\n (mouseleave)=\"imageMouseLeave()\"\n (mousedown)=\"mouseDownHandler($event)\"\n (mousemove)=\"mouseMoveHandler($event)\"\n (mouseup)=\"mouseUpHandler($event)\"\n (touchstart)=\"mouseDownHandler($event)\"\n (touchmove)=\"mouseMoveHandler($event)\"\n (touchend)=\"mouseUpHandler($event)\"\n [class.ngx-gallery-active]=\"!loading\"\n [class.animation]=\"animation\"\n [class.ngx-gallery-grab]=\"canDragOnZoom()\"\n [style.transform]=\"getTransform()\"\n [style.left]=\"positionLeft + 'px'\"\n [style.top]=\"positionTop + 'px'\"\n />\n }\n\n @if (src && type === 'video') {\n <video\n #previewImage\n controls\n style=\"width: 100%; height: 100%;\"\n class=\"ngx-gallery-preview-img ngx-gallery-center\"\n (click)=\"$event.stopPropagation()\"\n (mouseenter)=\"imageMouseEnter()\"\n (mouseleave)=\"imageMouseLeave()\"\n (mousedown)=\"mouseDownHandler($event)\"\n (mousemove)=\"mouseMoveHandler($event)\"\n (mouseup)=\"mouseUpHandler($event)\"\n (touchstart)=\"mouseDownHandler($event)\"\n (touchmove)=\"mouseMoveHandler($event)\"\n (touchend)=\"mouseUpHandler($event)\"\n [class.ngx-gallery-active]=\"!loading\"\n [class.animation]=\"animation\"\n [class.ngx-gallery-grab]=\"canDragOnZoom()\"\n [style.transform]=\"getTransform()\"\n [style.left]=\"positionLeft + 'px'\"\n [style.top]=\"positionTop + 'px'\">\n <source [src]=\"src\">\n Your browser does not support the video tag.\n </video>\n }\n\n @if (bullets) {\n <ngx-gallery-bullets\n [count]=\"images.length\"\n [active]=\"index\"\n (bulletChange)=\"showAtIndex($event)\">\n </ngx-gallery-bullets>\n }\n </div>\n\n @if (showDescription && description) {\n <div class=\"ngx-gallery-preview-text\" [innerHTML]=\"description\" (click)=\"$event.stopPropagation()\"></div>\n }\n</div>\n", styles: [":host.ngx-gallery-active{width:100%;height:100%;position:fixed;left:0;top:0;background:#000000b3;z-index:10000;display:inline-block;font-size:50px!important}:host{display:none;font-size:50px!important}:host .ngx-gallery-arrow{font-size:50px!important}ngx-gallery-bullets{height:5%;align-items:center;padding:0}.ngx-gallery-preview-img{opacity:0;max-width:90%;max-height:90%;-webkit-user-select:none;user-select:none;transition:transform .5s}.ngx-gallery-preview-img.animation{transition:opacity .5s linear,transform .5s}.ngx-gallery-preview-img.ngx-gallery-active{opacity:1}.ngx-gallery-preview-img.ngx-gallery-grab{cursor:grab}.ngx-gallery-icon.ngx-gallery-spinner{font-size:50px;left:0;display:inline-block}:host .ngx-gallery-preview-top{position:absolute;width:100%;-webkit-user-select:none;user-select:none;font-size:25px}.ngx-gallery-preview-icons{float:right}.ngx-gallery-preview-icons .ngx-gallery-icon{position:relative;margin-right:10px;margin-top:10px;font-size:25px;cursor:pointer;text-decoration:none}.ngx-gallery-preview-icons .ngx-gallery-icon.ngx-gallery-icon-disabled{cursor:default;opacity:.4}.ngx-spinner-wrapper{width:50px;height:50px;display:none}.ngx-spinner-wrapper.ngx-gallery-active{display:inline-block}.ngx-gallery-center{position:absolute;inset:0;margin:auto}.ngx-gallery-preview-text{width:100%;background:#000000b3;padding:10px;text-align:center;color:#fff;font-size:16px;flex:0 1 auto;z-index:10}.ngx-gallery-preview-wrapper{width:100%;height:100%;display:flex;flex-flow:column}.ngx-gallery-preview-img-wrapper{flex:1 1 auto;position:relative}\n"] }]
|
|
641
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }, { type: i0.ElementRef }, { type: NgxGalleryService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { images: [{
|
|
642
|
+
type: Input
|
|
643
|
+
}], descriptions: [{
|
|
644
|
+
type: Input
|
|
645
|
+
}], showDescription: [{
|
|
646
|
+
type: Input
|
|
647
|
+
}], arrows: [{
|
|
648
|
+
type: Input
|
|
649
|
+
}], arrowsAutoHide: [{
|
|
650
|
+
type: Input
|
|
651
|
+
}], swipe: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], fullscreen: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], forceFullscreen: [{
|
|
656
|
+
type: Input
|
|
657
|
+
}], closeOnClick: [{
|
|
658
|
+
type: Input
|
|
659
|
+
}], closeOnEsc: [{
|
|
660
|
+
type: Input
|
|
661
|
+
}], keyboardNavigation: [{
|
|
662
|
+
type: Input
|
|
663
|
+
}], arrowPrevIcon: [{
|
|
664
|
+
type: Input
|
|
665
|
+
}], arrowNextIcon: [{
|
|
666
|
+
type: Input
|
|
667
|
+
}], arrowIconSize: [{
|
|
668
|
+
type: Input
|
|
669
|
+
}], closeIcon: [{
|
|
670
|
+
type: Input
|
|
671
|
+
}], fullscreenIcon: [{
|
|
672
|
+
type: Input
|
|
673
|
+
}], spinnerIcon: [{
|
|
674
|
+
type: Input
|
|
675
|
+
}], autoPlay: [{
|
|
676
|
+
type: Input
|
|
677
|
+
}], autoPlayInterval: [{
|
|
678
|
+
type: Input
|
|
679
|
+
}], autoPlayPauseOnHover: [{
|
|
680
|
+
type: Input
|
|
681
|
+
}], infinityMove: [{
|
|
682
|
+
type: Input
|
|
683
|
+
}], zoom: [{
|
|
684
|
+
type: Input
|
|
685
|
+
}], zoomStep: [{
|
|
686
|
+
type: Input
|
|
687
|
+
}], zoomMax: [{
|
|
688
|
+
type: Input
|
|
689
|
+
}], zoomMin: [{
|
|
690
|
+
type: Input
|
|
691
|
+
}], zoomInIcon: [{
|
|
692
|
+
type: Input
|
|
693
|
+
}], zoomOutIcon: [{
|
|
694
|
+
type: Input
|
|
695
|
+
}], animation: [{
|
|
696
|
+
type: Input
|
|
697
|
+
}], actions: [{
|
|
698
|
+
type: Input
|
|
699
|
+
}], rotate: [{
|
|
700
|
+
type: Input
|
|
701
|
+
}], rotateLeftIcon: [{
|
|
702
|
+
type: Input
|
|
703
|
+
}], rotateRightIcon: [{
|
|
704
|
+
type: Input
|
|
705
|
+
}], download: [{
|
|
706
|
+
type: Input
|
|
707
|
+
}], downloadIcon: [{
|
|
708
|
+
type: Input
|
|
709
|
+
}], bullets: [{
|
|
710
|
+
type: Input
|
|
711
|
+
}], previewOpen: [{
|
|
712
|
+
type: Output
|
|
713
|
+
}], previewClose: [{
|
|
714
|
+
type: Output
|
|
715
|
+
}], activeChange: [{
|
|
716
|
+
type: Output
|
|
717
|
+
}], previewImage: [{
|
|
718
|
+
type: ViewChild,
|
|
719
|
+
args: ['previewImage']
|
|
720
|
+
}], onMouseEnter: [{
|
|
721
|
+
type: HostListener,
|
|
722
|
+
args: ['mouseenter']
|
|
723
|
+
}], onMouseLeave: [{
|
|
724
|
+
type: HostListener,
|
|
725
|
+
args: ['mouseleave']
|
|
726
|
+
}] } });
|
|
727
|
+
|
|
728
|
+
class NgxGalleryAnimation {
|
|
729
|
+
static { this.Fade = 'fade'; }
|
|
730
|
+
static { this.Slide = 'slide'; }
|
|
731
|
+
static { this.Rotate = 'rotate'; }
|
|
732
|
+
static { this.Zoom = 'zoom'; }
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
class NgxGalleryImageComponent {
|
|
736
|
+
set selectedIndex(index) {
|
|
737
|
+
if (index > this._selectedIndex) {
|
|
738
|
+
let action;
|
|
739
|
+
if (this.animation === NgxGalleryAnimation.Slide) {
|
|
740
|
+
action = 'slideRight';
|
|
741
|
+
}
|
|
742
|
+
else if (this.animation === NgxGalleryAnimation.Fade) {
|
|
743
|
+
action = 'fade';
|
|
744
|
+
}
|
|
745
|
+
else if (this.animation === NgxGalleryAnimation.Rotate) {
|
|
746
|
+
action = 'rotateRight';
|
|
747
|
+
}
|
|
748
|
+
else if (this.animation === NgxGalleryAnimation.Zoom) {
|
|
749
|
+
action = 'zoom';
|
|
750
|
+
}
|
|
751
|
+
this.setAction(action);
|
|
752
|
+
}
|
|
753
|
+
else if (index < this._selectedIndex) {
|
|
754
|
+
let action;
|
|
755
|
+
if (this.animation === NgxGalleryAnimation.Slide) {
|
|
756
|
+
action = 'slideLeft';
|
|
757
|
+
}
|
|
758
|
+
else if (this.animation === NgxGalleryAnimation.Fade) {
|
|
759
|
+
action = 'fade';
|
|
760
|
+
}
|
|
761
|
+
else if (this.animation === NgxGalleryAnimation.Rotate) {
|
|
762
|
+
action = 'rotateLeft';
|
|
763
|
+
}
|
|
764
|
+
else if (this.animation === NgxGalleryAnimation.Zoom) {
|
|
765
|
+
action = 'zoom';
|
|
766
|
+
}
|
|
767
|
+
this.setAction(action);
|
|
768
|
+
}
|
|
769
|
+
this._selectedIndex = index;
|
|
770
|
+
}
|
|
771
|
+
constructor(sanitization, changeDetectorRef, elementRef, helperService) {
|
|
772
|
+
this.sanitization = sanitization;
|
|
773
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
774
|
+
this.elementRef = elementRef;
|
|
775
|
+
this.helperService = helperService;
|
|
776
|
+
this.imageClick = new EventEmitter();
|
|
777
|
+
this.activeChange = new EventEmitter();
|
|
778
|
+
this.animating = new EventEmitter();
|
|
779
|
+
this.canChangeImage = true;
|
|
780
|
+
this.isAnimating = false;
|
|
781
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
782
|
+
this.action = 'none';
|
|
783
|
+
}
|
|
784
|
+
ngOnInit() {
|
|
785
|
+
if (this.arrows && this.arrowsAutoHide) {
|
|
786
|
+
this.arrows = false;
|
|
787
|
+
}
|
|
788
|
+
if (this.autoPlay) {
|
|
789
|
+
this.startAutoPlay();
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
ngOnChanges(changes) {
|
|
793
|
+
if (changes['swipe']) {
|
|
794
|
+
this.helperService.manageSwipe(this.swipe, this.elementRef, 'image', () => this.showNext(), () => this.showPrev());
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
onMouseEnter() {
|
|
798
|
+
if (this.arrowsAutoHide && !this.arrows) {
|
|
799
|
+
this.arrows = true;
|
|
800
|
+
}
|
|
801
|
+
if (this.autoPlay && this.autoPlayPauseOnHover) {
|
|
802
|
+
this.stopAutoPlay();
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
onMouseLeave() {
|
|
806
|
+
if (this.arrowsAutoHide && this.arrows) {
|
|
807
|
+
this.arrows = false;
|
|
808
|
+
}
|
|
809
|
+
if (this.autoPlay && this.autoPlayPauseOnHover) {
|
|
810
|
+
this.startAutoPlay();
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
reset(index) {
|
|
814
|
+
this._selectedIndex = index;
|
|
815
|
+
this.action = 'none';
|
|
816
|
+
}
|
|
817
|
+
getImages() {
|
|
818
|
+
if (!this.images) {
|
|
819
|
+
return [];
|
|
820
|
+
}
|
|
821
|
+
if (this.lazyLoading) {
|
|
822
|
+
const indexes = [this._selectedIndex];
|
|
823
|
+
const prevIndex = this._selectedIndex - 1;
|
|
824
|
+
if (prevIndex === -1 && this.infinityMove) {
|
|
825
|
+
indexes.push(this.images.length - 1);
|
|
826
|
+
}
|
|
827
|
+
else if (prevIndex >= 0) {
|
|
828
|
+
indexes.push(prevIndex);
|
|
829
|
+
}
|
|
830
|
+
const nextIndex = this._selectedIndex + 1;
|
|
831
|
+
if (nextIndex === this.images.length && this.infinityMove) {
|
|
832
|
+
indexes.push(0);
|
|
833
|
+
}
|
|
834
|
+
else if (nextIndex < this.images.length) {
|
|
835
|
+
indexes.push(nextIndex);
|
|
836
|
+
}
|
|
837
|
+
return this.images.filter((img, i) => indexes.indexOf(i) !== -1);
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
return this.images;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
startAutoPlay() {
|
|
844
|
+
this.stopAutoPlay();
|
|
845
|
+
this.timer = setInterval(() => {
|
|
846
|
+
if (!this.showNext()) {
|
|
847
|
+
this._selectedIndex = -1;
|
|
848
|
+
this.showNext();
|
|
849
|
+
}
|
|
850
|
+
}, this.autoPlayInterval);
|
|
851
|
+
}
|
|
852
|
+
stopAutoPlay() {
|
|
853
|
+
if (this.timer) {
|
|
854
|
+
clearInterval(this.timer);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
handleClick(event, index) {
|
|
858
|
+
if (this.clickable) {
|
|
859
|
+
this.imageClick.emit(index);
|
|
860
|
+
event.stopPropagation();
|
|
861
|
+
event.preventDefault();
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
show(index) {
|
|
865
|
+
if (this.isAnimating) {
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (index > this._selectedIndex) {
|
|
869
|
+
let action;
|
|
870
|
+
if (this.animation === NgxGalleryAnimation.Slide) {
|
|
871
|
+
action = 'slideRight';
|
|
872
|
+
}
|
|
873
|
+
else if (this.animation === NgxGalleryAnimation.Fade) {
|
|
874
|
+
action = 'fade';
|
|
875
|
+
}
|
|
876
|
+
else if (this.animation === NgxGalleryAnimation.Rotate) {
|
|
877
|
+
action = 'rotateRight';
|
|
878
|
+
}
|
|
879
|
+
else if (this.animation === NgxGalleryAnimation.Zoom) {
|
|
880
|
+
action = 'zoom';
|
|
881
|
+
}
|
|
882
|
+
this.setAction(action);
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
let action;
|
|
886
|
+
if (this.animation === NgxGalleryAnimation.Slide) {
|
|
887
|
+
action = 'slideLeft';
|
|
888
|
+
}
|
|
889
|
+
else if (this.animation === NgxGalleryAnimation.Fade) {
|
|
890
|
+
action = 'fade';
|
|
891
|
+
}
|
|
892
|
+
else if (this.animation === NgxGalleryAnimation.Rotate) {
|
|
893
|
+
action = 'rotateLeft';
|
|
894
|
+
}
|
|
895
|
+
else if (this.animation === NgxGalleryAnimation.Zoom) {
|
|
896
|
+
action = 'zoom';
|
|
897
|
+
}
|
|
898
|
+
this.setAction(action);
|
|
899
|
+
}
|
|
900
|
+
this._selectedIndex = index;
|
|
901
|
+
this.activeChange.emit(this._selectedIndex);
|
|
902
|
+
this.setChangeTimeout();
|
|
903
|
+
}
|
|
904
|
+
setAction(action) {
|
|
905
|
+
this.action = action;
|
|
906
|
+
this.changeDetectorRef.detectChanges();
|
|
907
|
+
}
|
|
908
|
+
showNext() {
|
|
909
|
+
if (this.isAnimating) {
|
|
910
|
+
return false;
|
|
911
|
+
}
|
|
912
|
+
if (this.canShowNext() && this.canChangeImage) {
|
|
913
|
+
let action;
|
|
914
|
+
if (this.animation === NgxGalleryAnimation.Slide) {
|
|
915
|
+
action = 'slideRight';
|
|
916
|
+
}
|
|
917
|
+
else if (this.animation === NgxGalleryAnimation.Fade) {
|
|
918
|
+
action = 'fade';
|
|
919
|
+
}
|
|
920
|
+
else if (this.animation === NgxGalleryAnimation.Rotate) {
|
|
921
|
+
action = 'rotateRight';
|
|
922
|
+
}
|
|
923
|
+
else if (this.animation === NgxGalleryAnimation.Zoom) {
|
|
924
|
+
action = 'zoom';
|
|
925
|
+
}
|
|
926
|
+
this.setAction(action);
|
|
927
|
+
this._selectedIndex++;
|
|
928
|
+
if (this._selectedIndex === this.images.length) {
|
|
929
|
+
this._selectedIndex = 0;
|
|
930
|
+
}
|
|
931
|
+
this.activeChange.emit(this._selectedIndex);
|
|
932
|
+
this.setChangeTimeout();
|
|
933
|
+
return true;
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
return false;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
showPrev() {
|
|
940
|
+
if (this.isAnimating) {
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
if (this.canShowPrev() && this.canChangeImage) {
|
|
944
|
+
let action;
|
|
945
|
+
if (this.animation === NgxGalleryAnimation.Slide) {
|
|
946
|
+
action = 'slideLeft';
|
|
947
|
+
}
|
|
948
|
+
else if (this.animation === NgxGalleryAnimation.Fade) {
|
|
949
|
+
action = 'fade';
|
|
950
|
+
}
|
|
951
|
+
else if (this.animation === NgxGalleryAnimation.Rotate) {
|
|
952
|
+
action = 'rotateLeft';
|
|
953
|
+
}
|
|
954
|
+
else if (this.animation === NgxGalleryAnimation.Zoom) {
|
|
955
|
+
action = 'zoom';
|
|
956
|
+
}
|
|
957
|
+
this.setAction(action);
|
|
958
|
+
this._selectedIndex--;
|
|
959
|
+
if (this._selectedIndex < 0) {
|
|
960
|
+
this._selectedIndex = this.images.length - 1;
|
|
961
|
+
}
|
|
962
|
+
this.activeChange.emit(this._selectedIndex);
|
|
963
|
+
this.setChangeTimeout();
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
setChangeTimeout() {
|
|
967
|
+
this.canChangeImage = false;
|
|
968
|
+
let timeout = 1000;
|
|
969
|
+
if (this.animation === NgxGalleryAnimation.Slide
|
|
970
|
+
|| this.animation === NgxGalleryAnimation.Fade) {
|
|
971
|
+
timeout = 500;
|
|
972
|
+
}
|
|
973
|
+
setTimeout(() => {
|
|
974
|
+
this.canChangeImage = true;
|
|
975
|
+
}, timeout);
|
|
976
|
+
}
|
|
977
|
+
canShowNext() {
|
|
978
|
+
if (this.images) {
|
|
979
|
+
return this.infinityMove || this._selectedIndex < this.images.length - 1;
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
return false;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
canShowPrev() {
|
|
986
|
+
if (this.images) {
|
|
987
|
+
return this.infinityMove || this._selectedIndex > 0;
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
getSafeUrl(image) {
|
|
994
|
+
return this.sanitization.bypassSecurityTrustStyle(this.helperService.getBackgroundUrl(image.toString()));
|
|
995
|
+
}
|
|
996
|
+
getFileType(fileSource) {
|
|
997
|
+
return this.helperService.getFileType(fileSource);
|
|
998
|
+
}
|
|
999
|
+
onStart(event) {
|
|
1000
|
+
this.isAnimating = true;
|
|
1001
|
+
this.animating.emit(true);
|
|
1002
|
+
}
|
|
1003
|
+
onDone(event) {
|
|
1004
|
+
this.isAnimating = false;
|
|
1005
|
+
this.animating.emit(false);
|
|
1006
|
+
}
|
|
1007
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryImageComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: NgxGalleryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1008
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGalleryImageComponent, isStandalone: false, selector: "ngx-gallery-image", inputs: { images: "images", clickable: "clickable", selectedIndex: "selectedIndex", arrows: "arrows", arrowsAutoHide: "arrowsAutoHide", swipe: "swipe", animation: "animation", size: "size", arrowPrevIcon: "arrowPrevIcon", arrowNextIcon: "arrowNextIcon", arrowIconSize: "arrowIconSize", autoPlay: "autoPlay", autoPlayInterval: "autoPlayInterval", autoPlayPauseOnHover: "autoPlayPauseOnHover", infinityMove: "infinityMove", lazyLoading: "lazyLoading", actions: "actions", descriptions: "descriptions", showDescription: "showDescription", bullets: "bullets" }, outputs: { imageClick: "imageClick", activeChange: "activeChange", animating: "animating" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ngx-gallery-image-wrapper ngx-gallery-animation-{{animation}} ngx-gallery-image-size-{{size}}\">\n @for (image of getImages(); track image; let i = $index) {\n @if (image.type === 'image' && image.index === _selectedIndex) {\n <div class=\"ngx-gallery-image\" [ngClass]=\"{'ngx-gallery-clickable': clickable }\"\n [style.background-image]=\"getSafeUrl(image.src)\" (click)=\"handleClick($event, image.index)\" [@animation]=\"action\"\n (@animation.start)=\"onStart($event)\" (@animation.done)=\"onDone($event)\">\n <div class=\"ngx-gallery-icons-wrapper\">\n @for (action of actions; track action) {\n <ngx-gallery-action [icon]=\"action.icon\" [disabled]=\"action.disabled\" [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, image.index)\"></ngx-gallery-action>\n }\n </div>\n @if (showDescription && descriptions[image.index]) {\n <div class=\"ngx-gallery-image-text\" [innerHTML]=\"descriptions[image.index]\" (click)=\"$event.stopPropagation()\">\n </div>\n }\n </div>\n }\n @if (image.type === 'video' && image.index === _selectedIndex) {\n <div class=\"ngx-gallery-image\" [ngClass]=\"{'ngx-gallery-clickable': clickable }\"\n [style.background-image]=\"getSafeUrl(image.src)\" (click)=\"handleClick($event, image.index)\" [@animation]=\"action\"\n (@animation.start)=\"onStart($event)\" (@animation.done)=\"onDone($event)\">\n <video controls style=\"width:100%; height:100%; background: #000;\">\n <source [src]=\"image.src\">\n Your browser does not support the video tag.\n </video>\n <div class=\"ngx-gallery-icons-wrapper\">\n @for (action of actions; track action) {\n <ngx-gallery-action [icon]=\"action.icon\" [disabled]=\"action.disabled\" [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, image.index)\"></ngx-gallery-action>\n }\n </div>\n @if (showDescription && descriptions[image.index]) {\n <div class=\"ngx-gallery-image-text\" [innerHTML]=\"descriptions[image.index]\" (click)=\"$event.stopPropagation()\">\n </div>\n }\n </div>\n }\n }\n @if (bullets) {\n <ngx-gallery-bullets [count]=\"images.length\" [active]=\"_selectedIndex\"\n (bulletChange)=\"show($event)\"></ngx-gallery-bullets>\n }\n @if (arrows) {\n <ngx-gallery-arrows class=\"ngx-gallery-image-size-{{size}}\" (prevClick)=\"showPrev()\" (nextClick)=\"showNext()\"\n [prevDisabled]=\"!canShowPrev()\" [nextDisabled]=\"!canShowNext()\" [arrowPrevIcon]=\"arrowPrevIcon\" [arrowIconSize]=\"arrowIconSize\"\n [arrowNextIcon]=\"arrowNextIcon\"></ngx-gallery-arrows>\n }\n</div>", styles: [":host{width:100%;display:inline-block;position:relative;font-size:25px}.ngx-gallery-image-wrapper{width:100%;height:100%;position:absolute;left:0;top:0;overflow:hidden}.ngx-gallery-image{background-position:center;background-repeat:no-repeat;height:100%;width:100%;position:absolute;top:0}.ngx-gallery-image-size-cover .ngx-gallery-image{background-size:cover}.ngx-gallery-image-size-contain .ngx-gallery-image{background-size:contain}.ngx-gallery-animation-fade .ngx-gallery-image{left:0;opacity:1;transition:.5s ease-in-out}.ngx-gallery-animation-fade .ngx-gallery-image.ngx-gallery-active{opacity:1}.ngx-gallery-animation-rotate .ngx-gallery-image{transition:1s ease;transform:scale(1) rotate(0);left:0;opacity:1}.ngx-gallery-animation-zoom .ngx-gallery-image{transition:1s ease;transform:scale(1);left:0;opacity:1}.ngx-gallery-image-text{width:100%;background:#000000b3;padding:10px;text-align:center;color:#fff;font-size:16px;position:absolute;bottom:0;z-index:10}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgxGalleryArrowsComponent, selector: "ngx-gallery-arrows", inputs: ["prevDisabled", "nextDisabled", "arrowPrevIcon", "arrowNextIcon", "arrowIconSize"], outputs: ["prevClick", "nextClick"] }, { kind: "component", type: NgxGalleryActionComponent, selector: "ngx-gallery-action", inputs: ["icon", "disabled", "titleText"], outputs: ["closeClick"] }, { kind: "component", type: NgxGalleryBulletsComponent, selector: "ngx-gallery-bullets", inputs: ["count", "active"], outputs: ["bulletChange"] }], animations: [
|
|
1009
|
+
trigger('animation', [
|
|
1010
|
+
// ...
|
|
1011
|
+
state('slideRight', style({})),
|
|
1012
|
+
state('slideLeft', style({})),
|
|
1013
|
+
state('fade', style({})),
|
|
1014
|
+
state('rotateLeft', style({})),
|
|
1015
|
+
state('rotateRight', style({})),
|
|
1016
|
+
state('zoom', style({})),
|
|
1017
|
+
transition('slideRight => void', [
|
|
1018
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(-100%)' }))
|
|
1019
|
+
]),
|
|
1020
|
+
transition('void => slideRight', [
|
|
1021
|
+
style({ transform: 'translateX(100%)' }),
|
|
1022
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(0)' }))
|
|
1023
|
+
]),
|
|
1024
|
+
transition('slideLeft => void', [
|
|
1025
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(100%)' }))
|
|
1026
|
+
]),
|
|
1027
|
+
transition('void => slideLeft', [
|
|
1028
|
+
style({ transform: 'translateX(-100%)' }),
|
|
1029
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(0)' }))
|
|
1030
|
+
]),
|
|
1031
|
+
transition('fade => void', [
|
|
1032
|
+
animate('500ms ease-in-out', style({ opacity: '0' }))
|
|
1033
|
+
]),
|
|
1034
|
+
transition('void => fade', [
|
|
1035
|
+
style({ opacity: '0' }),
|
|
1036
|
+
animate('500ms ease-in-out', style({ opacity: '1' }))
|
|
1037
|
+
]),
|
|
1038
|
+
transition('rotateLeft => void', [
|
|
1039
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(-90deg)', opacity: '0' }))
|
|
1040
|
+
]),
|
|
1041
|
+
transition('void => rotateLeft', [
|
|
1042
|
+
style({ transform: 'scale(1, 1) rotate(-90deg)', opacity: '0' }),
|
|
1043
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(0deg)', opacity: '1' }))
|
|
1044
|
+
]),
|
|
1045
|
+
transition('rotateRight => void', [
|
|
1046
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(90deg)', opacity: '0' }))
|
|
1047
|
+
]),
|
|
1048
|
+
transition('void => rotateRight', [
|
|
1049
|
+
style({ transform: 'scale(1, 1) rotate(90deg)', opacity: '0' }),
|
|
1050
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(0deg)', opacity: '1' }))
|
|
1051
|
+
]),
|
|
1052
|
+
transition('zoom => void', [
|
|
1053
|
+
animate('500ms ease-in-out', style({ transform: 'scale(2.5,2.5)', opacity: '0' }))
|
|
1054
|
+
]),
|
|
1055
|
+
transition('void => zoom', [
|
|
1056
|
+
style({ transform: 'scale(2.5,2.5)', opacity: '0' }),
|
|
1057
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1)', opacity: '1' }))
|
|
1058
|
+
]),
|
|
1059
|
+
]),
|
|
1060
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1061
|
+
}
|
|
1062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryImageComponent, decorators: [{
|
|
1063
|
+
type: Component,
|
|
1064
|
+
args: [{ selector: 'ngx-gallery-image', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
|
|
1065
|
+
trigger('animation', [
|
|
1066
|
+
// ...
|
|
1067
|
+
state('slideRight', style({})),
|
|
1068
|
+
state('slideLeft', style({})),
|
|
1069
|
+
state('fade', style({})),
|
|
1070
|
+
state('rotateLeft', style({})),
|
|
1071
|
+
state('rotateRight', style({})),
|
|
1072
|
+
state('zoom', style({})),
|
|
1073
|
+
transition('slideRight => void', [
|
|
1074
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(-100%)' }))
|
|
1075
|
+
]),
|
|
1076
|
+
transition('void => slideRight', [
|
|
1077
|
+
style({ transform: 'translateX(100%)' }),
|
|
1078
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(0)' }))
|
|
1079
|
+
]),
|
|
1080
|
+
transition('slideLeft => void', [
|
|
1081
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(100%)' }))
|
|
1082
|
+
]),
|
|
1083
|
+
transition('void => slideLeft', [
|
|
1084
|
+
style({ transform: 'translateX(-100%)' }),
|
|
1085
|
+
animate('500ms ease-in-out', style({ transform: 'translateX(0)' }))
|
|
1086
|
+
]),
|
|
1087
|
+
transition('fade => void', [
|
|
1088
|
+
animate('500ms ease-in-out', style({ opacity: '0' }))
|
|
1089
|
+
]),
|
|
1090
|
+
transition('void => fade', [
|
|
1091
|
+
style({ opacity: '0' }),
|
|
1092
|
+
animate('500ms ease-in-out', style({ opacity: '1' }))
|
|
1093
|
+
]),
|
|
1094
|
+
transition('rotateLeft => void', [
|
|
1095
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(-90deg)', opacity: '0' }))
|
|
1096
|
+
]),
|
|
1097
|
+
transition('void => rotateLeft', [
|
|
1098
|
+
style({ transform: 'scale(1, 1) rotate(-90deg)', opacity: '0' }),
|
|
1099
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(0deg)', opacity: '1' }))
|
|
1100
|
+
]),
|
|
1101
|
+
transition('rotateRight => void', [
|
|
1102
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(90deg)', opacity: '0' }))
|
|
1103
|
+
]),
|
|
1104
|
+
transition('void => rotateRight', [
|
|
1105
|
+
style({ transform: 'scale(1, 1) rotate(90deg)', opacity: '0' }),
|
|
1106
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1) rotate(0deg)', opacity: '1' }))
|
|
1107
|
+
]),
|
|
1108
|
+
transition('zoom => void', [
|
|
1109
|
+
animate('500ms ease-in-out', style({ transform: 'scale(2.5,2.5)', opacity: '0' }))
|
|
1110
|
+
]),
|
|
1111
|
+
transition('void => zoom', [
|
|
1112
|
+
style({ transform: 'scale(2.5,2.5)', opacity: '0' }),
|
|
1113
|
+
animate('500ms ease-in-out', style({ transform: 'scale(1, 1)', opacity: '1' }))
|
|
1114
|
+
]),
|
|
1115
|
+
]),
|
|
1116
|
+
], standalone: false, template: "<div class=\"ngx-gallery-image-wrapper ngx-gallery-animation-{{animation}} ngx-gallery-image-size-{{size}}\">\n @for (image of getImages(); track image; let i = $index) {\n @if (image.type === 'image' && image.index === _selectedIndex) {\n <div class=\"ngx-gallery-image\" [ngClass]=\"{'ngx-gallery-clickable': clickable }\"\n [style.background-image]=\"getSafeUrl(image.src)\" (click)=\"handleClick($event, image.index)\" [@animation]=\"action\"\n (@animation.start)=\"onStart($event)\" (@animation.done)=\"onDone($event)\">\n <div class=\"ngx-gallery-icons-wrapper\">\n @for (action of actions; track action) {\n <ngx-gallery-action [icon]=\"action.icon\" [disabled]=\"action.disabled\" [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, image.index)\"></ngx-gallery-action>\n }\n </div>\n @if (showDescription && descriptions[image.index]) {\n <div class=\"ngx-gallery-image-text\" [innerHTML]=\"descriptions[image.index]\" (click)=\"$event.stopPropagation()\">\n </div>\n }\n </div>\n }\n @if (image.type === 'video' && image.index === _selectedIndex) {\n <div class=\"ngx-gallery-image\" [ngClass]=\"{'ngx-gallery-clickable': clickable }\"\n [style.background-image]=\"getSafeUrl(image.src)\" (click)=\"handleClick($event, image.index)\" [@animation]=\"action\"\n (@animation.start)=\"onStart($event)\" (@animation.done)=\"onDone($event)\">\n <video controls style=\"width:100%; height:100%; background: #000;\">\n <source [src]=\"image.src\">\n Your browser does not support the video tag.\n </video>\n <div class=\"ngx-gallery-icons-wrapper\">\n @for (action of actions; track action) {\n <ngx-gallery-action [icon]=\"action.icon\" [disabled]=\"action.disabled\" [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, image.index)\"></ngx-gallery-action>\n }\n </div>\n @if (showDescription && descriptions[image.index]) {\n <div class=\"ngx-gallery-image-text\" [innerHTML]=\"descriptions[image.index]\" (click)=\"$event.stopPropagation()\">\n </div>\n }\n </div>\n }\n }\n @if (bullets) {\n <ngx-gallery-bullets [count]=\"images.length\" [active]=\"_selectedIndex\"\n (bulletChange)=\"show($event)\"></ngx-gallery-bullets>\n }\n @if (arrows) {\n <ngx-gallery-arrows class=\"ngx-gallery-image-size-{{size}}\" (prevClick)=\"showPrev()\" (nextClick)=\"showNext()\"\n [prevDisabled]=\"!canShowPrev()\" [nextDisabled]=\"!canShowNext()\" [arrowPrevIcon]=\"arrowPrevIcon\" [arrowIconSize]=\"arrowIconSize\"\n [arrowNextIcon]=\"arrowNextIcon\"></ngx-gallery-arrows>\n }\n</div>", styles: [":host{width:100%;display:inline-block;position:relative;font-size:25px}.ngx-gallery-image-wrapper{width:100%;height:100%;position:absolute;left:0;top:0;overflow:hidden}.ngx-gallery-image{background-position:center;background-repeat:no-repeat;height:100%;width:100%;position:absolute;top:0}.ngx-gallery-image-size-cover .ngx-gallery-image{background-size:cover}.ngx-gallery-image-size-contain .ngx-gallery-image{background-size:contain}.ngx-gallery-animation-fade .ngx-gallery-image{left:0;opacity:1;transition:.5s ease-in-out}.ngx-gallery-animation-fade .ngx-gallery-image.ngx-gallery-active{opacity:1}.ngx-gallery-animation-rotate .ngx-gallery-image{transition:1s ease;transform:scale(1) rotate(0);left:0;opacity:1}.ngx-gallery-animation-zoom .ngx-gallery-image{transition:1s ease;transform:scale(1);left:0;opacity:1}.ngx-gallery-image-text{width:100%;background:#000000b3;padding:10px;text-align:center;color:#fff;font-size:16px;position:absolute;bottom:0;z-index:10}\n"] }]
|
|
1117
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: NgxGalleryService }], propDecorators: { images: [{
|
|
1118
|
+
type: Input
|
|
1119
|
+
}], clickable: [{
|
|
1120
|
+
type: Input
|
|
1121
|
+
}], selectedIndex: [{
|
|
1122
|
+
type: Input
|
|
1123
|
+
}], arrows: [{
|
|
1124
|
+
type: Input
|
|
1125
|
+
}], arrowsAutoHide: [{
|
|
1126
|
+
type: Input
|
|
1127
|
+
}], swipe: [{
|
|
1128
|
+
type: Input
|
|
1129
|
+
}], animation: [{
|
|
1130
|
+
type: Input
|
|
1131
|
+
}], size: [{
|
|
1132
|
+
type: Input
|
|
1133
|
+
}], arrowPrevIcon: [{
|
|
1134
|
+
type: Input
|
|
1135
|
+
}], arrowNextIcon: [{
|
|
1136
|
+
type: Input
|
|
1137
|
+
}], arrowIconSize: [{
|
|
1138
|
+
type: Input
|
|
1139
|
+
}], autoPlay: [{
|
|
1140
|
+
type: Input
|
|
1141
|
+
}], autoPlayInterval: [{
|
|
1142
|
+
type: Input
|
|
1143
|
+
}], autoPlayPauseOnHover: [{
|
|
1144
|
+
type: Input
|
|
1145
|
+
}], infinityMove: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], lazyLoading: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], actions: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}], descriptions: [{
|
|
1152
|
+
type: Input
|
|
1153
|
+
}], showDescription: [{
|
|
1154
|
+
type: Input
|
|
1155
|
+
}], bullets: [{
|
|
1156
|
+
type: Input
|
|
1157
|
+
}], imageClick: [{
|
|
1158
|
+
type: Output
|
|
1159
|
+
}], activeChange: [{
|
|
1160
|
+
type: Output
|
|
1161
|
+
}], animating: [{
|
|
1162
|
+
type: Output
|
|
1163
|
+
}], onMouseEnter: [{
|
|
1164
|
+
type: HostListener,
|
|
1165
|
+
args: ['mouseenter']
|
|
1166
|
+
}], onMouseLeave: [{
|
|
1167
|
+
type: HostListener,
|
|
1168
|
+
args: ['mouseleave']
|
|
1169
|
+
}] } });
|
|
1170
|
+
|
|
1171
|
+
class NgxGalleryOrder {
|
|
1172
|
+
static { this.Column = 1; }
|
|
1173
|
+
static { this.Row = 2; }
|
|
1174
|
+
static { this.Page = 3; }
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
class NgxGalleryThumbnailsComponent {
|
|
1178
|
+
constructor(sanitization, elementRef, helperService) {
|
|
1179
|
+
this.sanitization = sanitization;
|
|
1180
|
+
this.elementRef = elementRef;
|
|
1181
|
+
this.helperService = helperService;
|
|
1182
|
+
this.minStopIndex = 0;
|
|
1183
|
+
this.activeChange = new EventEmitter();
|
|
1184
|
+
this.index = 0;
|
|
1185
|
+
}
|
|
1186
|
+
ngOnChanges(changes) {
|
|
1187
|
+
if (changes['selectedIndex']) {
|
|
1188
|
+
this.validateIndex();
|
|
1189
|
+
}
|
|
1190
|
+
if (changes['swipe']) {
|
|
1191
|
+
this.helperService.manageSwipe(this.swipe, this.elementRef, 'thumbnails', () => this.moveRight(), () => this.moveLeft());
|
|
1192
|
+
}
|
|
1193
|
+
if (this.images) {
|
|
1194
|
+
this.remainingCountValue = this.images.length - (this.rows * this.columns);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
onMouseEnter() {
|
|
1198
|
+
this.mouseenter = true;
|
|
1199
|
+
}
|
|
1200
|
+
onMouseLeave() {
|
|
1201
|
+
this.mouseenter = false;
|
|
1202
|
+
}
|
|
1203
|
+
reset(index) {
|
|
1204
|
+
this.selectedIndex = index;
|
|
1205
|
+
this.setDefaultPosition();
|
|
1206
|
+
this.index = 0;
|
|
1207
|
+
this.validateIndex();
|
|
1208
|
+
}
|
|
1209
|
+
getImages() {
|
|
1210
|
+
if (!this.images) {
|
|
1211
|
+
return [];
|
|
1212
|
+
}
|
|
1213
|
+
if (this.remainingCount) {
|
|
1214
|
+
return this.images.slice(0, this.rows * this.columns);
|
|
1215
|
+
}
|
|
1216
|
+
else if (this.lazyLoading && this.order !== NgxGalleryOrder.Row) {
|
|
1217
|
+
let stopIndex = 0;
|
|
1218
|
+
if (this.order === NgxGalleryOrder.Column) {
|
|
1219
|
+
stopIndex = (this.index + this.columns + this.moveSize) * this.rows;
|
|
1220
|
+
}
|
|
1221
|
+
else if (this.order === NgxGalleryOrder.Page) {
|
|
1222
|
+
stopIndex = this.index + ((this.columns * this.rows) * 2);
|
|
1223
|
+
}
|
|
1224
|
+
if (stopIndex <= this.minStopIndex) {
|
|
1225
|
+
stopIndex = this.minStopIndex;
|
|
1226
|
+
}
|
|
1227
|
+
else {
|
|
1228
|
+
this.minStopIndex = stopIndex;
|
|
1229
|
+
}
|
|
1230
|
+
return this.images.slice(0, stopIndex);
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
return this.images;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
handleClick(event, index) {
|
|
1237
|
+
if (!this.hasLink(index) && !this.isAnimating) {
|
|
1238
|
+
this.selectedIndex = index;
|
|
1239
|
+
this.activeChange.emit(index);
|
|
1240
|
+
}
|
|
1241
|
+
event.stopPropagation();
|
|
1242
|
+
event.preventDefault();
|
|
1243
|
+
}
|
|
1244
|
+
hasLink(index) {
|
|
1245
|
+
return !!(this.links && this.links.length && this.links[index]);
|
|
1246
|
+
}
|
|
1247
|
+
moveRight() {
|
|
1248
|
+
if (this.canMoveRight()) {
|
|
1249
|
+
this.index += this.moveSize;
|
|
1250
|
+
const maxIndex = this.getMaxIndex() - this.columns;
|
|
1251
|
+
if (this.index > maxIndex) {
|
|
1252
|
+
this.index = maxIndex;
|
|
1253
|
+
}
|
|
1254
|
+
this.setThumbnailsPosition();
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
moveLeft() {
|
|
1258
|
+
if (this.canMoveLeft()) {
|
|
1259
|
+
this.index -= this.moveSize;
|
|
1260
|
+
if (this.index < 0) {
|
|
1261
|
+
this.index = 0;
|
|
1262
|
+
}
|
|
1263
|
+
this.setThumbnailsPosition();
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
canMoveRight() {
|
|
1267
|
+
return this.index + this.columns < this.getMaxIndex();
|
|
1268
|
+
}
|
|
1269
|
+
canMoveLeft() {
|
|
1270
|
+
return this.index !== 0;
|
|
1271
|
+
}
|
|
1272
|
+
getThumbnailLeft(index) {
|
|
1273
|
+
let calculatedIndex;
|
|
1274
|
+
if (this.order === NgxGalleryOrder.Column) {
|
|
1275
|
+
calculatedIndex = Math.floor(index / this.rows);
|
|
1276
|
+
}
|
|
1277
|
+
else if (this.order === NgxGalleryOrder.Page) {
|
|
1278
|
+
calculatedIndex = (index % this.columns) + (Math.floor(index / (this.rows * this.columns)) * this.columns);
|
|
1279
|
+
}
|
|
1280
|
+
else if (this.order === NgxGalleryOrder.Row && this.remainingCount) {
|
|
1281
|
+
calculatedIndex = index % this.columns;
|
|
1282
|
+
}
|
|
1283
|
+
else {
|
|
1284
|
+
calculatedIndex = index % Math.ceil(this.images.length / this.rows);
|
|
1285
|
+
}
|
|
1286
|
+
return this.getThumbnailPosition(calculatedIndex, this.columns);
|
|
1287
|
+
}
|
|
1288
|
+
getThumbnailTop(index) {
|
|
1289
|
+
let calculatedIndex;
|
|
1290
|
+
if (this.order === NgxGalleryOrder.Column) {
|
|
1291
|
+
calculatedIndex = index % this.rows;
|
|
1292
|
+
}
|
|
1293
|
+
else if (this.order === NgxGalleryOrder.Page) {
|
|
1294
|
+
calculatedIndex = Math.floor(index / this.columns) - (Math.floor(index / (this.rows * this.columns)) * this.rows);
|
|
1295
|
+
}
|
|
1296
|
+
else if (this.order === NgxGalleryOrder.Row && this.remainingCount) {
|
|
1297
|
+
calculatedIndex = Math.floor(index / this.columns);
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
calculatedIndex = Math.floor(index / Math.ceil(this.images.length / this.rows));
|
|
1301
|
+
}
|
|
1302
|
+
return this.getThumbnailPosition(calculatedIndex, this.rows);
|
|
1303
|
+
}
|
|
1304
|
+
getThumbnailWidth() {
|
|
1305
|
+
return this.getThumbnailDimension(this.columns);
|
|
1306
|
+
}
|
|
1307
|
+
getThumbnailHeight() {
|
|
1308
|
+
return this.getThumbnailDimension(this.rows);
|
|
1309
|
+
}
|
|
1310
|
+
setThumbnailsPosition() {
|
|
1311
|
+
this.thumbnailsLeft = -((100 / this.columns) * this.index) + '%';
|
|
1312
|
+
this.thumbnailsMarginLeft = -((this.margin - (((this.columns - 1)
|
|
1313
|
+
* this.margin) / this.columns)) * this.index) + 'px';
|
|
1314
|
+
}
|
|
1315
|
+
setDefaultPosition() {
|
|
1316
|
+
this.thumbnailsLeft = '0px';
|
|
1317
|
+
this.thumbnailsMarginLeft = '0px';
|
|
1318
|
+
}
|
|
1319
|
+
canShowArrows() {
|
|
1320
|
+
if (this.remainingCount) {
|
|
1321
|
+
return false;
|
|
1322
|
+
}
|
|
1323
|
+
else {
|
|
1324
|
+
return this.arrows && this.images && this.images.length > this.getVisibleCount()
|
|
1325
|
+
&& (!this.arrowsAutoHide || this.mouseenter);
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
validateIndex() {
|
|
1329
|
+
if (this.images) {
|
|
1330
|
+
let newIndex;
|
|
1331
|
+
if (this.order === NgxGalleryOrder.Column) {
|
|
1332
|
+
newIndex = Math.floor(this.selectedIndex / this.rows);
|
|
1333
|
+
}
|
|
1334
|
+
else {
|
|
1335
|
+
newIndex = this.selectedIndex % Math.ceil(this.images.length / this.rows);
|
|
1336
|
+
}
|
|
1337
|
+
if (this.remainingCount) {
|
|
1338
|
+
newIndex = 0;
|
|
1339
|
+
}
|
|
1340
|
+
if (newIndex < this.index || newIndex >= this.index + this.columns) {
|
|
1341
|
+
const maxIndex = this.getMaxIndex() - this.columns;
|
|
1342
|
+
this.index = newIndex > maxIndex ? maxIndex : newIndex;
|
|
1343
|
+
this.setThumbnailsPosition();
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
getSafeUrl(image) {
|
|
1348
|
+
return this.sanitization.bypassSecurityTrustStyle(this.helperService.getBackgroundUrl(image.toString()));
|
|
1349
|
+
}
|
|
1350
|
+
getFileType(fileSource) {
|
|
1351
|
+
return this.helperService.getFileType(fileSource.toString());
|
|
1352
|
+
}
|
|
1353
|
+
getThumbnailPosition(index, count) {
|
|
1354
|
+
return this.getSafeStyle('calc(' + ((100 / count) * index) + '% + '
|
|
1355
|
+
+ ((this.margin - (((count - 1) * this.margin) / count)) * index) + 'px)');
|
|
1356
|
+
}
|
|
1357
|
+
getThumbnailDimension(count) {
|
|
1358
|
+
if (this.margin !== 0) {
|
|
1359
|
+
return this.getSafeStyle('calc(' + (100 / count) + '% - '
|
|
1360
|
+
+ (((count - 1) * this.margin) / count) + 'px)');
|
|
1361
|
+
}
|
|
1362
|
+
else {
|
|
1363
|
+
return this.getSafeStyle('calc(' + (100 / count) + '% + 1px)');
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
getMaxIndex() {
|
|
1367
|
+
if (this.order === NgxGalleryOrder.Page) {
|
|
1368
|
+
let maxIndex = (Math.floor(this.images.length / this.getVisibleCount()) * this.columns);
|
|
1369
|
+
if (this.images.length % this.getVisibleCount() > this.columns) {
|
|
1370
|
+
maxIndex += this.columns;
|
|
1371
|
+
}
|
|
1372
|
+
else {
|
|
1373
|
+
maxIndex += this.images.length % this.getVisibleCount();
|
|
1374
|
+
}
|
|
1375
|
+
return maxIndex;
|
|
1376
|
+
}
|
|
1377
|
+
else {
|
|
1378
|
+
return Math.ceil(this.images.length / this.rows);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
getVisibleCount() {
|
|
1382
|
+
return this.columns * this.rows;
|
|
1383
|
+
}
|
|
1384
|
+
getSafeStyle(value) {
|
|
1385
|
+
return this.sanitization.bypassSecurityTrustStyle(value);
|
|
1386
|
+
}
|
|
1387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryThumbnailsComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i0.ElementRef }, { token: NgxGalleryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1388
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGalleryThumbnailsComponent, isStandalone: false, selector: "ngx-gallery-thumbnails", inputs: { images: "images", isAnimating: "isAnimating", links: "links", labels: "labels", linkTarget: "linkTarget", columns: "columns", rows: "rows", arrows: "arrows", arrowsAutoHide: "arrowsAutoHide", margin: "margin", selectedIndex: "selectedIndex", clickable: "clickable", swipe: "swipe", size: "size", arrowPrevIcon: "arrowPrevIcon", arrowNextIcon: "arrowNextIcon", arrowIconThumbnailSize: "arrowIconThumbnailSize", moveSize: "moveSize", order: "order", remainingCount: "remainingCount", lazyLoading: "lazyLoading", actions: "actions" }, outputs: { activeChange: "activeChange" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ngx-gallery-thumbnails-wrapper ngx-gallery-thumbnail-size-{{size}}\">\n <div class=\"ngx-gallery-thumbnails\" [style.transform]=\"'translateX(' + thumbnailsLeft + ')'\"\n [style.marginLeft]=\"thumbnailsMarginLeft\">\n @for (image of getImages(); track image; let i = $index) {\n <a [href]=\"hasLink(i) ? links[i] : '#'\" [target]=\"linkTarget\" class=\"ngx-gallery-thumbnail\"\n (click)=\"handleClick($event, i)\" [style.width]=\"getThumbnailWidth()\" [style.height]=\"getThumbnailHeight()\"\n [style.left]=\"getThumbnailLeft(i)\" [style.top]=\"getThumbnailTop(i)\"\n [ngClass]=\"{ 'ngx-gallery-active': i === selectedIndex, 'ngx-gallery-clickable': clickable }\"\n [attr.aria-label]=\"labels[i]\">\n @if (getFileType(image) === 'image') {\n <div [style.background-image]=\"getSafeUrl(image)\" class=\"ngx-gallery-thumbnail\"\n [ngClass]=\"{ 'ngx-gallery-active': i === selectedIndex, 'ngx-gallery-clickable': clickable }\"\n style=\"width: 100%; height: 100%; position:absolute;\"></div>\n }\n @if (getFileType(image) === 'video') {\n <div class=\"ngx-gallery-thumbnail-video\">\n <video class=\"ngx-gallery-thumbnail\"\n [ngClass]=\"{ 'ngx-gallery-active': i === selectedIndex, 'ngx-gallery-clickable': clickable }\"\n style=\"width: 100%; height: 100%; position:absolute; left:0; background:#000;\">\n <source [src]=\"image\">\n Your browser does not support the video tag.\n </video>\n </div>\n }\n <div class=\"ngx-gallery-icons-wrapper\">\n @for (action of actions; track action) {\n <ngx-gallery-action [icon]=\"action.icon\" [disabled]=\"action.disabled\" [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, i)\"></ngx-gallery-action>\n }\n </div>\n @if (remainingCount && remainingCountValue && (i === (rows * columns) - 1)) {\n <div class=\"ngx-gallery-remaining-count-overlay\">\n <span class=\"ngx-gallery-remaining-count\">+{{remainingCountValue}}</span>\n </div>\n }\n </a>\n }\n </div>\n</div>\n\n@if (canShowArrows()) {\n<ngx-gallery-arrows (prevClick)=\"moveLeft()\" (nextClick)=\"moveRight()\" [prevDisabled]=\"!canMoveLeft()\"\n [nextDisabled]=\"!canMoveRight()\" [arrowPrevIcon]=\"arrowPrevIcon\" [arrowNextIcon]=\"arrowNextIcon\"\n [arrowIconSize]=\"arrowIconThumbnailSize\"></ngx-gallery-arrows>\n}", styles: ["@charset \"UTF-8\";:host{width:100%;display:inline-block;position:relative;font-size:25px}.ngx-gallery-thumbnails-wrapper{width:100%;height:100%;position:absolute;overflow:hidden}.ngx-gallery-thumbnails{height:100%;width:100%;position:absolute;left:0;transform:translate(0);transition:transform .5s ease-in-out;will-change:transform}.ngx-gallery-thumbnails .ngx-gallery-thumbnail{position:absolute;height:100%;background-position:center;background-repeat:no-repeat;text-decoration:none;border:1px double black}.ngx-gallery-thumbnails .ngx-gallery-thumbnail .ngx-gallery-thumbnail-video:after{content:\"\\f144\";display:block;position:absolute;background:#0000;height:100%;width:100%;left:0;top:calc(50% - 20px);font-size:40px;color:#fff;margin:0;padding:0;font-family:fontawesome;text-shadow:0px 4px 3px rgba(0,0,0,.4),0px 8px 13px rgba(0,0,0,.1),0px 18px 23px rgba(0,0,0,.1)}.ngx-gallery-thumbnails .ngx-gallery-thumbnail .img{background-size:cover;height:100%}.ngx-gallery-thumbnails .ngx-gallery-thumbnail.ngx-gallery-active{border:1px double #cc4548}.ngx-gallery-thumbnail-size-cover .ngx-gallery-thumbnails .ngx-gallery-thumbnail{background-size:cover}.ngx-gallery-thumbnail-size-contain .ngx-gallery-thumbnails .ngx-gallery-thumbnail{background-size:contain}.ngx-gallery-remaining-count-overlay{width:100%;height:100%;position:absolute;left:0;top:0;background-color:#0006}.ngx-gallery-remaining-count{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:30px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgxGalleryArrowsComponent, selector: "ngx-gallery-arrows", inputs: ["prevDisabled", "nextDisabled", "arrowPrevIcon", "arrowNextIcon", "arrowIconSize"], outputs: ["prevClick", "nextClick"] }, { kind: "component", type: NgxGalleryActionComponent, selector: "ngx-gallery-action", inputs: ["icon", "disabled", "titleText"], outputs: ["closeClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1389
|
+
}
|
|
1390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryThumbnailsComponent, decorators: [{
|
|
1391
|
+
type: Component,
|
|
1392
|
+
args: [{ selector: 'ngx-gallery-thumbnails', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"ngx-gallery-thumbnails-wrapper ngx-gallery-thumbnail-size-{{size}}\">\n <div class=\"ngx-gallery-thumbnails\" [style.transform]=\"'translateX(' + thumbnailsLeft + ')'\"\n [style.marginLeft]=\"thumbnailsMarginLeft\">\n @for (image of getImages(); track image; let i = $index) {\n <a [href]=\"hasLink(i) ? links[i] : '#'\" [target]=\"linkTarget\" class=\"ngx-gallery-thumbnail\"\n (click)=\"handleClick($event, i)\" [style.width]=\"getThumbnailWidth()\" [style.height]=\"getThumbnailHeight()\"\n [style.left]=\"getThumbnailLeft(i)\" [style.top]=\"getThumbnailTop(i)\"\n [ngClass]=\"{ 'ngx-gallery-active': i === selectedIndex, 'ngx-gallery-clickable': clickable }\"\n [attr.aria-label]=\"labels[i]\">\n @if (getFileType(image) === 'image') {\n <div [style.background-image]=\"getSafeUrl(image)\" class=\"ngx-gallery-thumbnail\"\n [ngClass]=\"{ 'ngx-gallery-active': i === selectedIndex, 'ngx-gallery-clickable': clickable }\"\n style=\"width: 100%; height: 100%; position:absolute;\"></div>\n }\n @if (getFileType(image) === 'video') {\n <div class=\"ngx-gallery-thumbnail-video\">\n <video class=\"ngx-gallery-thumbnail\"\n [ngClass]=\"{ 'ngx-gallery-active': i === selectedIndex, 'ngx-gallery-clickable': clickable }\"\n style=\"width: 100%; height: 100%; position:absolute; left:0; background:#000;\">\n <source [src]=\"image\">\n Your browser does not support the video tag.\n </video>\n </div>\n }\n <div class=\"ngx-gallery-icons-wrapper\">\n @for (action of actions; track action) {\n <ngx-gallery-action [icon]=\"action.icon\" [disabled]=\"action.disabled\" [titleText]=\"action.titleText\"\n (closeClick)=\"action.onClick($event, i)\"></ngx-gallery-action>\n }\n </div>\n @if (remainingCount && remainingCountValue && (i === (rows * columns) - 1)) {\n <div class=\"ngx-gallery-remaining-count-overlay\">\n <span class=\"ngx-gallery-remaining-count\">+{{remainingCountValue}}</span>\n </div>\n }\n </a>\n }\n </div>\n</div>\n\n@if (canShowArrows()) {\n<ngx-gallery-arrows (prevClick)=\"moveLeft()\" (nextClick)=\"moveRight()\" [prevDisabled]=\"!canMoveLeft()\"\n [nextDisabled]=\"!canMoveRight()\" [arrowPrevIcon]=\"arrowPrevIcon\" [arrowNextIcon]=\"arrowNextIcon\"\n [arrowIconSize]=\"arrowIconThumbnailSize\"></ngx-gallery-arrows>\n}", styles: ["@charset \"UTF-8\";:host{width:100%;display:inline-block;position:relative;font-size:25px}.ngx-gallery-thumbnails-wrapper{width:100%;height:100%;position:absolute;overflow:hidden}.ngx-gallery-thumbnails{height:100%;width:100%;position:absolute;left:0;transform:translate(0);transition:transform .5s ease-in-out;will-change:transform}.ngx-gallery-thumbnails .ngx-gallery-thumbnail{position:absolute;height:100%;background-position:center;background-repeat:no-repeat;text-decoration:none;border:1px double black}.ngx-gallery-thumbnails .ngx-gallery-thumbnail .ngx-gallery-thumbnail-video:after{content:\"\\f144\";display:block;position:absolute;background:#0000;height:100%;width:100%;left:0;top:calc(50% - 20px);font-size:40px;color:#fff;margin:0;padding:0;font-family:fontawesome;text-shadow:0px 4px 3px rgba(0,0,0,.4),0px 8px 13px rgba(0,0,0,.1),0px 18px 23px rgba(0,0,0,.1)}.ngx-gallery-thumbnails .ngx-gallery-thumbnail .img{background-size:cover;height:100%}.ngx-gallery-thumbnails .ngx-gallery-thumbnail.ngx-gallery-active{border:1px double #cc4548}.ngx-gallery-thumbnail-size-cover .ngx-gallery-thumbnails .ngx-gallery-thumbnail{background-size:cover}.ngx-gallery-thumbnail-size-contain .ngx-gallery-thumbnails .ngx-gallery-thumbnail{background-size:contain}.ngx-gallery-remaining-count-overlay{width:100%;height:100%;position:absolute;left:0;top:0;background-color:#0006}.ngx-gallery-remaining-count{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:30px}\n"] }]
|
|
1393
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }, { type: i0.ElementRef }, { type: NgxGalleryService }], propDecorators: { images: [{
|
|
1394
|
+
type: Input
|
|
1395
|
+
}], isAnimating: [{
|
|
1396
|
+
type: Input
|
|
1397
|
+
}], links: [{
|
|
1398
|
+
type: Input
|
|
1399
|
+
}], labels: [{
|
|
1400
|
+
type: Input
|
|
1401
|
+
}], linkTarget: [{
|
|
1402
|
+
type: Input
|
|
1403
|
+
}], columns: [{
|
|
1404
|
+
type: Input
|
|
1405
|
+
}], rows: [{
|
|
1406
|
+
type: Input
|
|
1407
|
+
}], arrows: [{
|
|
1408
|
+
type: Input
|
|
1409
|
+
}], arrowsAutoHide: [{
|
|
1410
|
+
type: Input
|
|
1411
|
+
}], margin: [{
|
|
1412
|
+
type: Input
|
|
1413
|
+
}], selectedIndex: [{
|
|
1414
|
+
type: Input
|
|
1415
|
+
}], clickable: [{
|
|
1416
|
+
type: Input
|
|
1417
|
+
}], swipe: [{
|
|
1418
|
+
type: Input
|
|
1419
|
+
}], size: [{
|
|
1420
|
+
type: Input
|
|
1421
|
+
}], arrowPrevIcon: [{
|
|
1422
|
+
type: Input
|
|
1423
|
+
}], arrowNextIcon: [{
|
|
1424
|
+
type: Input
|
|
1425
|
+
}], arrowIconThumbnailSize: [{
|
|
1426
|
+
type: Input
|
|
1427
|
+
}], moveSize: [{
|
|
1428
|
+
type: Input
|
|
1429
|
+
}], order: [{
|
|
1430
|
+
type: Input
|
|
1431
|
+
}], remainingCount: [{
|
|
1432
|
+
type: Input
|
|
1433
|
+
}], lazyLoading: [{
|
|
1434
|
+
type: Input
|
|
1435
|
+
}], actions: [{
|
|
1436
|
+
type: Input
|
|
1437
|
+
}], activeChange: [{
|
|
1438
|
+
type: Output
|
|
1439
|
+
}], onMouseEnter: [{
|
|
1440
|
+
type: HostListener,
|
|
1441
|
+
args: ['mouseenter']
|
|
1442
|
+
}], onMouseLeave: [{
|
|
1443
|
+
type: HostListener,
|
|
1444
|
+
args: ['mouseleave']
|
|
1445
|
+
}] } });
|
|
1446
|
+
|
|
1447
|
+
class NgxGalleryAction {
|
|
1448
|
+
constructor(action) {
|
|
1449
|
+
this.icon = action.icon;
|
|
1450
|
+
this.disabled = action.disabled ? action.disabled : false;
|
|
1451
|
+
this.titleText = action.titleText ? action.titleText : '';
|
|
1452
|
+
this.onClick = action.onClick;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
class NgxGalleryLayout {
|
|
1457
|
+
static { this.ThumbnailsTop = 'thumbnails-top'; }
|
|
1458
|
+
static { this.ThumbnailsBottom = 'thumbnails-bottom'; }
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
class NgxGalleryImageSize {
|
|
1462
|
+
static { this.Cover = 'cover'; }
|
|
1463
|
+
static { this.Contain = 'contain'; }
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
class NgxGalleryOptions {
|
|
1467
|
+
constructor(obj) {
|
|
1468
|
+
const preventDefaults = obj.breakpoint === undefined ? false : true;
|
|
1469
|
+
function use(source, defaultValue) {
|
|
1470
|
+
return obj && (source !== undefined || preventDefaults) ? source : defaultValue;
|
|
1471
|
+
}
|
|
1472
|
+
this.breakpoint = use(obj.breakpoint, undefined);
|
|
1473
|
+
this.width = use(obj.width, '500px');
|
|
1474
|
+
this.height = use(obj.height, '400px');
|
|
1475
|
+
this.fullWidth = use(obj.fullWidth, false);
|
|
1476
|
+
this.layout = use(obj.layout, NgxGalleryLayout.ThumbnailsBottom);
|
|
1477
|
+
this.startIndex = use(obj.startIndex, 0);
|
|
1478
|
+
this.linkTarget = use(obj.linkTarget, '_blank');
|
|
1479
|
+
this.lazyLoading = use(obj.lazyLoading, true);
|
|
1480
|
+
this.image = use(obj.image, true);
|
|
1481
|
+
this.imagePercent = use(obj.imagePercent, 75);
|
|
1482
|
+
this.imageArrows = use(obj.imageArrows, true);
|
|
1483
|
+
this.imageArrowsAutoHide = use(obj.imageArrowsAutoHide, false);
|
|
1484
|
+
this.imageSwipe = use(obj.imageSwipe, false);
|
|
1485
|
+
this.imageAnimation = use(obj.imageAnimation, NgxGalleryAnimation.Fade);
|
|
1486
|
+
this.imageSize = use(obj.imageSize, NgxGalleryImageSize.Cover);
|
|
1487
|
+
this.imageAutoPlay = use(obj.imageAutoPlay, false);
|
|
1488
|
+
this.imageAutoPlayInterval = use(obj.imageAutoPlayInterval, 2000);
|
|
1489
|
+
this.imageAutoPlayPauseOnHover = use(obj.imageAutoPlayPauseOnHover, false);
|
|
1490
|
+
this.imageInfinityMove = use(obj.imageInfinityMove, false);
|
|
1491
|
+
if (obj && obj.imageActions && obj.imageActions.length) {
|
|
1492
|
+
obj.imageActions = obj.imageActions.map(action => new NgxGalleryAction(action));
|
|
1493
|
+
}
|
|
1494
|
+
this.imageActions = use(obj.imageActions, []);
|
|
1495
|
+
this.imageDescription = use(obj.imageDescription, false);
|
|
1496
|
+
this.imageBullets = use(obj.imageBullets, false);
|
|
1497
|
+
this.thumbnails = use(obj.thumbnails, true);
|
|
1498
|
+
this.thumbnailsColumns = use(obj.thumbnailsColumns, 4);
|
|
1499
|
+
this.thumbnailsRows = use(obj.thumbnailsRows, 1);
|
|
1500
|
+
this.thumbnailsPercent = use(obj.thumbnailsPercent, 25);
|
|
1501
|
+
this.thumbnailsMargin = use(obj.thumbnailsMargin, 10);
|
|
1502
|
+
this.thumbnailsArrows = use(obj.thumbnailsArrows, true);
|
|
1503
|
+
this.thumbnailsArrowsAutoHide = use(obj.thumbnailsArrowsAutoHide, false);
|
|
1504
|
+
this.thumbnailsSwipe = use(obj.thumbnailsSwipe, false);
|
|
1505
|
+
this.thumbnailsMoveSize = use(obj.thumbnailsMoveSize, 1);
|
|
1506
|
+
this.thumbnailsOrder = use(obj.thumbnailsOrder, NgxGalleryOrder.Column);
|
|
1507
|
+
this.thumbnailsRemainingCount = use(obj.thumbnailsRemainingCount, false);
|
|
1508
|
+
this.thumbnailsAsLinks = use(obj.thumbnailsAsLinks, false);
|
|
1509
|
+
this.thumbnailsAutoHide = use(obj.thumbnailsAutoHide, false);
|
|
1510
|
+
this.thumbnailMargin = use(obj.thumbnailMargin, 10);
|
|
1511
|
+
this.thumbnailSize = use(obj.thumbnailSize, NgxGalleryImageSize.Cover);
|
|
1512
|
+
if (obj && obj.thumbnailActions && obj.thumbnailActions.length) {
|
|
1513
|
+
obj.thumbnailActions = obj.thumbnailActions.map(action => new NgxGalleryAction(action));
|
|
1514
|
+
}
|
|
1515
|
+
this.thumbnailActions = use(obj.thumbnailActions, []);
|
|
1516
|
+
this.thumbnailClasses = use(obj.thumbnailClasses, []);
|
|
1517
|
+
this.preview = use(obj.preview, true);
|
|
1518
|
+
this.previewDescription = use(obj.previewDescription, true);
|
|
1519
|
+
this.previewArrows = use(obj.previewArrows, true);
|
|
1520
|
+
this.previewArrowsAutoHide = use(obj.previewArrowsAutoHide, false);
|
|
1521
|
+
this.previewSwipe = use(obj.previewSwipe, false);
|
|
1522
|
+
this.previewFullscreen = use(obj.previewFullscreen, false);
|
|
1523
|
+
this.previewForceFullscreen = use(obj.previewForceFullscreen, false);
|
|
1524
|
+
this.previewCloseOnClick = use(obj.previewCloseOnClick, false);
|
|
1525
|
+
this.previewCloseOnEsc = use(obj.previewCloseOnEsc, false);
|
|
1526
|
+
this.previewKeyboardNavigation = use(obj.previewKeyboardNavigation, false);
|
|
1527
|
+
this.previewAnimation = use(obj.previewAnimation, true);
|
|
1528
|
+
this.previewAutoPlay = use(obj.previewAutoPlay, false);
|
|
1529
|
+
this.previewAutoPlayInterval = use(obj.previewAutoPlayInterval, 2000);
|
|
1530
|
+
this.previewAutoPlayPauseOnHover = use(obj.previewAutoPlayPauseOnHover, false);
|
|
1531
|
+
this.previewInfinityMove = use(obj.previewInfinityMove, false);
|
|
1532
|
+
this.previewZoom = use(obj.previewZoom, false);
|
|
1533
|
+
this.previewZoomStep = use(obj.previewZoomStep, 0.1);
|
|
1534
|
+
this.previewZoomMax = use(obj.previewZoomMax, 2);
|
|
1535
|
+
this.previewZoomMin = use(obj.previewZoomMin, 0.5);
|
|
1536
|
+
this.previewRotate = use(obj.previewRotate, false);
|
|
1537
|
+
this.previewDownload = use(obj.previewDownload, false);
|
|
1538
|
+
this.previewCustom = use(obj.previewCustom, undefined);
|
|
1539
|
+
this.previewBullets = use(obj.previewBullets, false);
|
|
1540
|
+
this.arrowPrevIcon = use(obj.arrowPrevIcon, 'fa fa-arrow-circle-left');
|
|
1541
|
+
this.arrowNextIcon = use(obj.arrowNextIcon, 'fa fa-arrow-circle-right');
|
|
1542
|
+
this.arrowIconSize = use(obj.arrowIconSize, 32);
|
|
1543
|
+
this.arrowIconThumbnailSize = use(obj.arrowIconThumbnailSize, 24);
|
|
1544
|
+
this.closeIcon = use(obj.closeIcon, 'fa fa-times-circle');
|
|
1545
|
+
this.fullscreenIcon = use(obj.fullscreenIcon, 'fa fa-arrows-alt');
|
|
1546
|
+
this.spinnerIcon = use(obj.spinnerIcon, 'fa fa-spinner fa-pulse fa-3x fa-fw');
|
|
1547
|
+
this.zoomInIcon = use(obj.zoomInIcon, 'fa fa-search-plus');
|
|
1548
|
+
this.zoomOutIcon = use(obj.zoomOutIcon, 'fa fa-search-minus');
|
|
1549
|
+
this.rotateLeftIcon = use(obj.rotateLeftIcon, 'fa fa-undo');
|
|
1550
|
+
this.rotateRightIcon = use(obj.rotateRightIcon, 'fa fa-repeat');
|
|
1551
|
+
this.downloadIcon = use(obj.downloadIcon, 'fa fa-arrow-circle-down');
|
|
1552
|
+
if (obj && obj.actions && obj.actions.length) {
|
|
1553
|
+
obj.actions = obj.actions.map(action => new NgxGalleryAction(action));
|
|
1554
|
+
}
|
|
1555
|
+
this.actions = use(obj.actions, []);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
class NgxGalleryOrderedImage {
|
|
1560
|
+
constructor(obj) {
|
|
1561
|
+
this.src = obj.src;
|
|
1562
|
+
this.type = obj.type;
|
|
1563
|
+
this.index = obj.index;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
class NgxGalleryComponent {
|
|
1568
|
+
constructor(myElement, helperService) {
|
|
1569
|
+
this.myElement = myElement;
|
|
1570
|
+
this.helperService = helperService;
|
|
1571
|
+
this.options = [{}];
|
|
1572
|
+
this.imagesReady = new EventEmitter();
|
|
1573
|
+
this.change = new EventEmitter();
|
|
1574
|
+
this.previewOpen = new EventEmitter();
|
|
1575
|
+
this.previewClose = new EventEmitter();
|
|
1576
|
+
this.previewChange = new EventEmitter();
|
|
1577
|
+
this.oldImagesLength = 0;
|
|
1578
|
+
this.selectedIndex = 0;
|
|
1579
|
+
this.breakpoint = undefined;
|
|
1580
|
+
this.prevBreakpoint = undefined;
|
|
1581
|
+
}
|
|
1582
|
+
ngOnInit() {
|
|
1583
|
+
this.options = this.options.map((opt) => new NgxGalleryOptions(opt));
|
|
1584
|
+
this.sortOptions();
|
|
1585
|
+
this.setBreakpoint();
|
|
1586
|
+
this.setOptions();
|
|
1587
|
+
this.checkFullWidth();
|
|
1588
|
+
if (this.currentOptions) {
|
|
1589
|
+
this.selectedIndex = this.currentOptions.startIndex;
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
ngDoCheck() {
|
|
1593
|
+
if (this.images !== undefined && (this.images.length !== this.oldImagesLength)
|
|
1594
|
+
|| (this.images !== this.oldImages)) {
|
|
1595
|
+
this.oldImagesLength = this.images.length;
|
|
1596
|
+
this.oldImages = this.images;
|
|
1597
|
+
this.setOptions();
|
|
1598
|
+
this.setImages();
|
|
1599
|
+
if (this.images && this.images.length) {
|
|
1600
|
+
this.imagesReady.emit();
|
|
1601
|
+
}
|
|
1602
|
+
if (this.image) {
|
|
1603
|
+
this.image.reset(this.currentOptions.startIndex);
|
|
1604
|
+
}
|
|
1605
|
+
if (this.currentOptions.thumbnailsAutoHide && this.currentOptions.thumbnails
|
|
1606
|
+
&& this.images.length <= 1) {
|
|
1607
|
+
this.currentOptions.thumbnails = false;
|
|
1608
|
+
this.currentOptions.imageArrows = false;
|
|
1609
|
+
}
|
|
1610
|
+
this.resetThumbnails();
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
ngAfterViewInit() {
|
|
1614
|
+
this.checkFullWidth();
|
|
1615
|
+
}
|
|
1616
|
+
onResize() {
|
|
1617
|
+
this.setBreakpoint();
|
|
1618
|
+
if (this.prevBreakpoint !== this.breakpoint) {
|
|
1619
|
+
this.setOptions();
|
|
1620
|
+
this.resetThumbnails();
|
|
1621
|
+
}
|
|
1622
|
+
if (this.currentOptions && this.currentOptions.fullWidth) {
|
|
1623
|
+
if (this.fullWidthTimeout) {
|
|
1624
|
+
clearTimeout(this.fullWidthTimeout);
|
|
1625
|
+
}
|
|
1626
|
+
this.fullWidthTimeout = setTimeout(() => {
|
|
1627
|
+
this.checkFullWidth();
|
|
1628
|
+
}, 200);
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
getImageHeight() {
|
|
1632
|
+
return (this.currentOptions && this.currentOptions.thumbnails) ?
|
|
1633
|
+
this.currentOptions.imagePercent + '%' : '100%';
|
|
1634
|
+
}
|
|
1635
|
+
getThumbnailsHeight() {
|
|
1636
|
+
if (this.currentOptions && this.currentOptions.image) {
|
|
1637
|
+
return 'calc(' + this.currentOptions.thumbnailsPercent + '% - '
|
|
1638
|
+
+ this.currentOptions.thumbnailsMargin + 'px)';
|
|
1639
|
+
}
|
|
1640
|
+
else {
|
|
1641
|
+
return '100%';
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
getThumbnailsMarginTop() {
|
|
1645
|
+
if (this.currentOptions && this.currentOptions.layout === NgxGalleryLayout.ThumbnailsBottom) {
|
|
1646
|
+
return this.currentOptions.thumbnailsMargin + 'px';
|
|
1647
|
+
}
|
|
1648
|
+
else {
|
|
1649
|
+
return '0px';
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
getThumbnailsMarginBottom() {
|
|
1653
|
+
if (this.currentOptions && this.currentOptions.layout === NgxGalleryLayout.ThumbnailsTop) {
|
|
1654
|
+
return this.currentOptions.thumbnailsMargin + 'px';
|
|
1655
|
+
}
|
|
1656
|
+
else {
|
|
1657
|
+
return '0px';
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
openPreview(index) {
|
|
1661
|
+
if (this.currentOptions.previewCustom) {
|
|
1662
|
+
this.currentOptions.previewCustom(index);
|
|
1663
|
+
}
|
|
1664
|
+
else {
|
|
1665
|
+
this.previewEnabled = true;
|
|
1666
|
+
this.preview.open(index);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
onPreviewOpen() {
|
|
1670
|
+
this.previewOpen.emit();
|
|
1671
|
+
if (this.image && this.image.autoPlay) {
|
|
1672
|
+
this.image.stopAutoPlay();
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
onPreviewClose() {
|
|
1676
|
+
this.previewEnabled = false;
|
|
1677
|
+
this.previewClose.emit();
|
|
1678
|
+
if (this.image && this.image.autoPlay) {
|
|
1679
|
+
this.image.startAutoPlay();
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
selectFromImage(index) {
|
|
1683
|
+
this.select(index);
|
|
1684
|
+
}
|
|
1685
|
+
selectFromThumbnails(index) {
|
|
1686
|
+
this.select(index);
|
|
1687
|
+
if (this.currentOptions && this.currentOptions.thumbnails && this.currentOptions.preview
|
|
1688
|
+
&& (!this.currentOptions.image || this.currentOptions.thumbnailsRemainingCount)) {
|
|
1689
|
+
this.openPreview(this.selectedIndex);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
show(index) {
|
|
1693
|
+
this.select(index);
|
|
1694
|
+
}
|
|
1695
|
+
showNext() {
|
|
1696
|
+
this.image.showNext();
|
|
1697
|
+
}
|
|
1698
|
+
showPrev() {
|
|
1699
|
+
this.image.showPrev();
|
|
1700
|
+
}
|
|
1701
|
+
canShowNext() {
|
|
1702
|
+
if (this.images && this.currentOptions) {
|
|
1703
|
+
return !!(this.currentOptions.imageInfinityMove || this.selectedIndex < this.images.length - 1);
|
|
1704
|
+
}
|
|
1705
|
+
else {
|
|
1706
|
+
return false;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
canShowPrev() {
|
|
1710
|
+
if (this.images && this.currentOptions) {
|
|
1711
|
+
return !!(this.currentOptions.imageInfinityMove || this.selectedIndex > 0);
|
|
1712
|
+
}
|
|
1713
|
+
else {
|
|
1714
|
+
return false;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
previewSelect(index) {
|
|
1718
|
+
this.previewChange.emit({ index, image: this.images[index] });
|
|
1719
|
+
}
|
|
1720
|
+
moveThumbnailsRight() {
|
|
1721
|
+
this.thumbnails.moveRight();
|
|
1722
|
+
}
|
|
1723
|
+
moveThumbnailsLeft() {
|
|
1724
|
+
this.thumbnails.moveLeft();
|
|
1725
|
+
}
|
|
1726
|
+
canMoveThumbnailsRight() {
|
|
1727
|
+
return this.thumbnails.canMoveRight();
|
|
1728
|
+
}
|
|
1729
|
+
canMoveThumbnailsLeft() {
|
|
1730
|
+
return this.thumbnails.canMoveLeft();
|
|
1731
|
+
}
|
|
1732
|
+
resetThumbnails() {
|
|
1733
|
+
if (this.thumbnails) {
|
|
1734
|
+
this.thumbnails.reset(this.currentOptions.startIndex);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
select(index) {
|
|
1738
|
+
this.selectedIndex = index;
|
|
1739
|
+
this.change.emit({
|
|
1740
|
+
index,
|
|
1741
|
+
image: this.images[index]
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
checkFullWidth() {
|
|
1745
|
+
if (this.currentOptions && this.currentOptions.fullWidth) {
|
|
1746
|
+
this.width = document.body.clientWidth + 'px';
|
|
1747
|
+
this.left = 'translateX(' + (-(document.body.clientWidth -
|
|
1748
|
+
this.myElement.nativeElement.parentNode.innerWidth) / 2) + 'px)';
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
setImages() {
|
|
1752
|
+
this.images.forEach((img) => img.type = this.helperService.getFileType(img.url || img.big || img.medium || img.small || ''));
|
|
1753
|
+
this.smallImages = this.images.map((img) => img.small);
|
|
1754
|
+
this.mediumImages = this.images.map((img, i) => new NgxGalleryOrderedImage({
|
|
1755
|
+
src: img.medium,
|
|
1756
|
+
type: img.type,
|
|
1757
|
+
index: i
|
|
1758
|
+
}));
|
|
1759
|
+
this.bigImages = this.images.map((img) => img.big);
|
|
1760
|
+
this.descriptions = this.images.map((img) => img.description);
|
|
1761
|
+
this.links = this.images.map((img) => img.url);
|
|
1762
|
+
this.labels = this.images.map((img) => img.label);
|
|
1763
|
+
}
|
|
1764
|
+
setBreakpoint() {
|
|
1765
|
+
this.prevBreakpoint = this.breakpoint;
|
|
1766
|
+
let breakpoints;
|
|
1767
|
+
if (typeof window !== 'undefined') {
|
|
1768
|
+
breakpoints = this.options.filter((opt) => opt.breakpoint >= window.innerWidth)
|
|
1769
|
+
.map((opt) => opt.breakpoint);
|
|
1770
|
+
}
|
|
1771
|
+
if (breakpoints && breakpoints.length) {
|
|
1772
|
+
this.breakpoint = breakpoints.pop();
|
|
1773
|
+
}
|
|
1774
|
+
else {
|
|
1775
|
+
this.breakpoint = undefined;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
sortOptions() {
|
|
1779
|
+
this.options = [
|
|
1780
|
+
...this.options.filter((a) => a.breakpoint === undefined),
|
|
1781
|
+
...this.options
|
|
1782
|
+
.filter((a) => a.breakpoint !== undefined)
|
|
1783
|
+
.sort((a, b) => b.breakpoint - a.breakpoint)
|
|
1784
|
+
];
|
|
1785
|
+
}
|
|
1786
|
+
setOptions() {
|
|
1787
|
+
this.currentOptions = new NgxGalleryOptions({});
|
|
1788
|
+
this.options
|
|
1789
|
+
.filter((opt) => opt.breakpoint === undefined || opt.breakpoint >= this.breakpoint)
|
|
1790
|
+
.map((opt) => this.combineOptions(this.currentOptions, opt));
|
|
1791
|
+
this.width = this.currentOptions.width;
|
|
1792
|
+
this.height = this.currentOptions.height;
|
|
1793
|
+
}
|
|
1794
|
+
combineOptions(first, second) {
|
|
1795
|
+
Object.keys(second).map((val) => first[val] = second[val] !== undefined ? second[val] : first[val]);
|
|
1796
|
+
}
|
|
1797
|
+
setAnimating(event) {
|
|
1798
|
+
this.isAnimating = event;
|
|
1799
|
+
}
|
|
1800
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryComponent, deps: [{ token: i0.ElementRef }, { token: NgxGalleryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1801
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGalleryComponent, isStandalone: false, selector: "ngx-gallery", inputs: { options: "options", images: "images" }, outputs: { imagesReady: "imagesReady", change: "change", previewOpen: "previewOpen", previewClose: "previewClose", previewChange: "previewChange" }, host: { listeners: { "window:resize": "onResize()" }, properties: { "style.width": "this.width", "style.height": "this.height", "style.transform": "this.left" } }, providers: [NgxGalleryService], viewQueries: [{ propertyName: "preview", first: true, predicate: NgxGalleryPreviewComponent, descendants: true }, { propertyName: "image", first: true, predicate: NgxGalleryImageComponent, descendants: true }, { propertyName: "thumbnails", first: true, predicate: NgxGalleryThumbnailsComponent, descendants: true }], ngImport: i0, template: "<div class=\"ngx-gallery-layout {{currentOptions?.layout}}\">\n @if (currentOptions?.image) {\n <ngx-gallery-image [style.height]=\"getImageHeight()\" [images]=\"mediumImages\" [clickable]=\"currentOptions?.preview\"\n [selectedIndex]=\"selectedIndex\" [arrows]=\"currentOptions?.imageArrows\"\n [arrowsAutoHide]=\"currentOptions?.imageArrowsAutoHide\" [arrowPrevIcon]=\"currentOptions?.arrowPrevIcon\"\n [arrowNextIcon]=\"currentOptions?.arrowNextIcon\" [arrowIconSize]=\"currentOptions?.arrowIconSize\" [swipe]=\"currentOptions?.imageSwipe\" \n [animation]=\"currentOptions?.imageAnimation\" [size]=\"currentOptions?.imageSize\"\n [autoPlay]=\"currentOptions?.imageAutoPlay\" [autoPlayInterval]=\"currentOptions?.imageAutoPlayInterval\"\n [autoPlayPauseOnHover]=\"currentOptions?.imageAutoPlayPauseOnHover\"\n [infinityMove]=\"currentOptions?.imageInfinityMove\" [lazyLoading]=\"currentOptions?.lazyLoading\"\n [actions]=\"currentOptions?.imageActions\" [descriptions]=\"descriptions\"\n [showDescription]=\"currentOptions?.imageDescription\" [bullets]=\"currentOptions?.imageBullets\"\n (imageClick)=\"openPreview($event)\" (activeChange)=\"selectFromImage($event)\"\n (animating)=\"setAnimating($event)\"></ngx-gallery-image>\n }\n\n @if (currentOptions?.thumbnails) {\n <ngx-gallery-thumbnails [style.marginTop]=\"getThumbnailsMarginTop()\"\n [style.marginBottom]=\"getThumbnailsMarginBottom()\" [style.height]=\"getThumbnailsHeight()\" [images]=\"smallImages\"\n [isAnimating]=\"isAnimating\" [links]=\"currentOptions?.thumbnailsAsLinks ? links : []\" [labels]=\"labels\"\n [linkTarget]=\"currentOptions?.linkTarget\" [selectedIndex]=\"selectedIndex\"\n [columns]=\"currentOptions?.thumbnailsColumns\" [rows]=\"currentOptions?.thumbnailsRows\"\n [margin]=\"currentOptions?.thumbnailMargin\" [arrows]=\"currentOptions?.thumbnailsArrows\"\n [arrowsAutoHide]=\"currentOptions?.thumbnailsArrowsAutoHide\" [arrowPrevIcon]=\"currentOptions?.arrowPrevIcon\"\n [arrowNextIcon]=\"currentOptions?.arrowNextIcon\" [arrowIconThumbnailSize]=\"currentOptions?.arrowIconThumbnailSize\" [clickable]=\"currentOptions?.image || currentOptions?.preview\"\n [swipe]=\"currentOptions?.thumbnailsSwipe\" [size]=\"currentOptions?.thumbnailSize\"\n [moveSize]=\"currentOptions?.thumbnailsMoveSize\" [order]=\"currentOptions?.thumbnailsOrder\"\n [remainingCount]=\"currentOptions?.thumbnailsRemainingCount\" [lazyLoading]=\"currentOptions?.lazyLoading\"\n [actions]=\"currentOptions?.thumbnailActions\" (activeChange)=\"selectFromThumbnails($event)\"\n [ngClass]=\"currentOptions?.thumbnailClasses\"></ngx-gallery-thumbnails>\n }\n\n <ngx-gallery-preview [images]=\"bigImages\" [descriptions]=\"descriptions\"\n [showDescription]=\"currentOptions?.previewDescription\" [arrowPrevIcon]=\"currentOptions?.arrowPrevIcon\"\n [arrowNextIcon]=\"currentOptions?.arrowNextIcon\" [arrowIconSize]=\"currentOptions?.arrowIconSize\" [closeIcon]=\"currentOptions?.closeIcon\"\n [fullscreenIcon]=\"currentOptions?.fullscreenIcon\" [spinnerIcon]=\"currentOptions?.spinnerIcon\"\n [arrows]=\"currentOptions?.previewArrows\" [arrowsAutoHide]=\"currentOptions?.previewArrowsAutoHide\"\n [swipe]=\"currentOptions?.previewSwipe\" [fullscreen]=\"currentOptions?.previewFullscreen\"\n [forceFullscreen]=\"currentOptions?.previewForceFullscreen\" [closeOnClick]=\"currentOptions?.previewCloseOnClick\"\n [closeOnEsc]=\"currentOptions?.previewCloseOnEsc\" [keyboardNavigation]=\"currentOptions?.previewKeyboardNavigation\"\n [animation]=\"currentOptions?.previewAnimation\" [autoPlay]=\"currentOptions?.previewAutoPlay\"\n [autoPlayInterval]=\"currentOptions?.previewAutoPlayInterval\"\n [autoPlayPauseOnHover]=\"currentOptions?.previewAutoPlayPauseOnHover\"\n [infinityMove]=\"currentOptions?.previewInfinityMove\" [zoom]=\"currentOptions?.previewZoom\"\n [zoomStep]=\"currentOptions?.previewZoomStep\" [zoomMax]=\"currentOptions?.previewZoomMax\"\n [zoomMin]=\"currentOptions?.previewZoomMin\" [zoomInIcon]=\"currentOptions?.zoomInIcon\"\n [zoomOutIcon]=\"currentOptions?.zoomOutIcon\" [actions]=\"currentOptions?.actions\"\n [rotate]=\"currentOptions?.previewRotate\" [rotateLeftIcon]=\"currentOptions?.rotateLeftIcon\"\n [rotateRightIcon]=\"currentOptions?.rotateRightIcon\" [download]=\"currentOptions?.previewDownload\"\n [downloadIcon]=\"currentOptions?.downloadIcon\" [bullets]=\"currentOptions?.previewBullets\"\n (previewClose)=\"onPreviewClose()\" (previewOpen)=\"onPreviewOpen()\" (activeChange)=\"previewSelect($event)\"\n [class.ngx-gallery-active]=\"previewEnabled\"></ngx-gallery-preview>\n</div>", styles: [":host{display:inline-block}:host>*{float:left}.ngx-gallery-layout{width:100%;height:100%;flex-direction:column}.ngx-gallery-layout.thumbnails-top ngx-gallery-image{order:2}.ngx-gallery-layout.thumbnails-top ngx-gallery-thumbnails{order:1}.ngx-gallery-layout.thumbnails-bottom ngx-gallery-image{order:1}.ngx-gallery-layout.thumbnails-bottom ngx-gallery-thumbnails{order:2}*{box-sizing:border-box}.ngx-gallery-icon{color:#fff;position:absolute;display:inline-block}.ngx-gallery-icon .ngx-gallery-icon-content{display:block}ngx-gallery-preview{touch-action:pan-y;-webkit-user-select:none;user-select:none;display:block;width:100%;height:100%;font-size:25px}ngx-gallery-preview .ngx-gallery-icon{z-index:2000}.ngx-gallery-clickable{cursor:pointer}.ngx-gallery-icons-wrapper .ngx-gallery-icon{position:relative;margin-right:5px;margin-top:5px;font-size:20px;cursor:pointer}.ngx-gallery-icons-wrapper{float:right}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgxGalleryImageComponent, selector: "ngx-gallery-image", inputs: ["images", "clickable", "selectedIndex", "arrows", "arrowsAutoHide", "swipe", "animation", "size", "arrowPrevIcon", "arrowNextIcon", "arrowIconSize", "autoPlay", "autoPlayInterval", "autoPlayPauseOnHover", "infinityMove", "lazyLoading", "actions", "descriptions", "showDescription", "bullets"], outputs: ["imageClick", "activeChange", "animating"] }, { kind: "component", type: NgxGalleryThumbnailsComponent, selector: "ngx-gallery-thumbnails", inputs: ["images", "isAnimating", "links", "labels", "linkTarget", "columns", "rows", "arrows", "arrowsAutoHide", "margin", "selectedIndex", "clickable", "swipe", "size", "arrowPrevIcon", "arrowNextIcon", "arrowIconThumbnailSize", "moveSize", "order", "remainingCount", "lazyLoading", "actions"], outputs: ["activeChange"] }, { kind: "component", type: NgxGalleryPreviewComponent, selector: "ngx-gallery-preview", inputs: ["images", "descriptions", "showDescription", "arrows", "arrowsAutoHide", "swipe", "fullscreen", "forceFullscreen", "closeOnClick", "closeOnEsc", "keyboardNavigation", "arrowPrevIcon", "arrowNextIcon", "arrowIconSize", "closeIcon", "fullscreenIcon", "spinnerIcon", "autoPlay", "autoPlayInterval", "autoPlayPauseOnHover", "infinityMove", "zoom", "zoomStep", "zoomMax", "zoomMin", "zoomInIcon", "zoomOutIcon", "animation", "actions", "rotate", "rotateLeftIcon", "rotateRightIcon", "download", "downloadIcon", "bullets"], outputs: ["previewOpen", "previewClose", "activeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1802
|
+
}
|
|
1803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryComponent, decorators: [{
|
|
1804
|
+
type: Component,
|
|
1805
|
+
args: [{ selector: 'ngx-gallery', encapsulation: ViewEncapsulation.None, providers: [NgxGalleryService], changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"ngx-gallery-layout {{currentOptions?.layout}}\">\n @if (currentOptions?.image) {\n <ngx-gallery-image [style.height]=\"getImageHeight()\" [images]=\"mediumImages\" [clickable]=\"currentOptions?.preview\"\n [selectedIndex]=\"selectedIndex\" [arrows]=\"currentOptions?.imageArrows\"\n [arrowsAutoHide]=\"currentOptions?.imageArrowsAutoHide\" [arrowPrevIcon]=\"currentOptions?.arrowPrevIcon\"\n [arrowNextIcon]=\"currentOptions?.arrowNextIcon\" [arrowIconSize]=\"currentOptions?.arrowIconSize\" [swipe]=\"currentOptions?.imageSwipe\" \n [animation]=\"currentOptions?.imageAnimation\" [size]=\"currentOptions?.imageSize\"\n [autoPlay]=\"currentOptions?.imageAutoPlay\" [autoPlayInterval]=\"currentOptions?.imageAutoPlayInterval\"\n [autoPlayPauseOnHover]=\"currentOptions?.imageAutoPlayPauseOnHover\"\n [infinityMove]=\"currentOptions?.imageInfinityMove\" [lazyLoading]=\"currentOptions?.lazyLoading\"\n [actions]=\"currentOptions?.imageActions\" [descriptions]=\"descriptions\"\n [showDescription]=\"currentOptions?.imageDescription\" [bullets]=\"currentOptions?.imageBullets\"\n (imageClick)=\"openPreview($event)\" (activeChange)=\"selectFromImage($event)\"\n (animating)=\"setAnimating($event)\"></ngx-gallery-image>\n }\n\n @if (currentOptions?.thumbnails) {\n <ngx-gallery-thumbnails [style.marginTop]=\"getThumbnailsMarginTop()\"\n [style.marginBottom]=\"getThumbnailsMarginBottom()\" [style.height]=\"getThumbnailsHeight()\" [images]=\"smallImages\"\n [isAnimating]=\"isAnimating\" [links]=\"currentOptions?.thumbnailsAsLinks ? links : []\" [labels]=\"labels\"\n [linkTarget]=\"currentOptions?.linkTarget\" [selectedIndex]=\"selectedIndex\"\n [columns]=\"currentOptions?.thumbnailsColumns\" [rows]=\"currentOptions?.thumbnailsRows\"\n [margin]=\"currentOptions?.thumbnailMargin\" [arrows]=\"currentOptions?.thumbnailsArrows\"\n [arrowsAutoHide]=\"currentOptions?.thumbnailsArrowsAutoHide\" [arrowPrevIcon]=\"currentOptions?.arrowPrevIcon\"\n [arrowNextIcon]=\"currentOptions?.arrowNextIcon\" [arrowIconThumbnailSize]=\"currentOptions?.arrowIconThumbnailSize\" [clickable]=\"currentOptions?.image || currentOptions?.preview\"\n [swipe]=\"currentOptions?.thumbnailsSwipe\" [size]=\"currentOptions?.thumbnailSize\"\n [moveSize]=\"currentOptions?.thumbnailsMoveSize\" [order]=\"currentOptions?.thumbnailsOrder\"\n [remainingCount]=\"currentOptions?.thumbnailsRemainingCount\" [lazyLoading]=\"currentOptions?.lazyLoading\"\n [actions]=\"currentOptions?.thumbnailActions\" (activeChange)=\"selectFromThumbnails($event)\"\n [ngClass]=\"currentOptions?.thumbnailClasses\"></ngx-gallery-thumbnails>\n }\n\n <ngx-gallery-preview [images]=\"bigImages\" [descriptions]=\"descriptions\"\n [showDescription]=\"currentOptions?.previewDescription\" [arrowPrevIcon]=\"currentOptions?.arrowPrevIcon\"\n [arrowNextIcon]=\"currentOptions?.arrowNextIcon\" [arrowIconSize]=\"currentOptions?.arrowIconSize\" [closeIcon]=\"currentOptions?.closeIcon\"\n [fullscreenIcon]=\"currentOptions?.fullscreenIcon\" [spinnerIcon]=\"currentOptions?.spinnerIcon\"\n [arrows]=\"currentOptions?.previewArrows\" [arrowsAutoHide]=\"currentOptions?.previewArrowsAutoHide\"\n [swipe]=\"currentOptions?.previewSwipe\" [fullscreen]=\"currentOptions?.previewFullscreen\"\n [forceFullscreen]=\"currentOptions?.previewForceFullscreen\" [closeOnClick]=\"currentOptions?.previewCloseOnClick\"\n [closeOnEsc]=\"currentOptions?.previewCloseOnEsc\" [keyboardNavigation]=\"currentOptions?.previewKeyboardNavigation\"\n [animation]=\"currentOptions?.previewAnimation\" [autoPlay]=\"currentOptions?.previewAutoPlay\"\n [autoPlayInterval]=\"currentOptions?.previewAutoPlayInterval\"\n [autoPlayPauseOnHover]=\"currentOptions?.previewAutoPlayPauseOnHover\"\n [infinityMove]=\"currentOptions?.previewInfinityMove\" [zoom]=\"currentOptions?.previewZoom\"\n [zoomStep]=\"currentOptions?.previewZoomStep\" [zoomMax]=\"currentOptions?.previewZoomMax\"\n [zoomMin]=\"currentOptions?.previewZoomMin\" [zoomInIcon]=\"currentOptions?.zoomInIcon\"\n [zoomOutIcon]=\"currentOptions?.zoomOutIcon\" [actions]=\"currentOptions?.actions\"\n [rotate]=\"currentOptions?.previewRotate\" [rotateLeftIcon]=\"currentOptions?.rotateLeftIcon\"\n [rotateRightIcon]=\"currentOptions?.rotateRightIcon\" [download]=\"currentOptions?.previewDownload\"\n [downloadIcon]=\"currentOptions?.downloadIcon\" [bullets]=\"currentOptions?.previewBullets\"\n (previewClose)=\"onPreviewClose()\" (previewOpen)=\"onPreviewOpen()\" (activeChange)=\"previewSelect($event)\"\n [class.ngx-gallery-active]=\"previewEnabled\"></ngx-gallery-preview>\n</div>", styles: [":host{display:inline-block}:host>*{float:left}.ngx-gallery-layout{width:100%;height:100%;flex-direction:column}.ngx-gallery-layout.thumbnails-top ngx-gallery-image{order:2}.ngx-gallery-layout.thumbnails-top ngx-gallery-thumbnails{order:1}.ngx-gallery-layout.thumbnails-bottom ngx-gallery-image{order:1}.ngx-gallery-layout.thumbnails-bottom ngx-gallery-thumbnails{order:2}*{box-sizing:border-box}.ngx-gallery-icon{color:#fff;position:absolute;display:inline-block}.ngx-gallery-icon .ngx-gallery-icon-content{display:block}ngx-gallery-preview{touch-action:pan-y;-webkit-user-select:none;user-select:none;display:block;width:100%;height:100%;font-size:25px}ngx-gallery-preview .ngx-gallery-icon{z-index:2000}.ngx-gallery-clickable{cursor:pointer}.ngx-gallery-icons-wrapper .ngx-gallery-icon{position:relative;margin-right:5px;margin-top:5px;font-size:20px;cursor:pointer}.ngx-gallery-icons-wrapper{float:right}\n"] }]
|
|
1806
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: NgxGalleryService }], propDecorators: { options: [{
|
|
1807
|
+
type: Input
|
|
1808
|
+
}], images: [{
|
|
1809
|
+
type: Input
|
|
1810
|
+
}], imagesReady: [{
|
|
1811
|
+
type: Output
|
|
1812
|
+
}], change: [{
|
|
1813
|
+
type: Output
|
|
1814
|
+
}], previewOpen: [{
|
|
1815
|
+
type: Output
|
|
1816
|
+
}], previewClose: [{
|
|
1817
|
+
type: Output
|
|
1818
|
+
}], previewChange: [{
|
|
1819
|
+
type: Output
|
|
1820
|
+
}], preview: [{
|
|
1821
|
+
type: ViewChild,
|
|
1822
|
+
args: [NgxGalleryPreviewComponent]
|
|
1823
|
+
}], image: [{
|
|
1824
|
+
type: ViewChild,
|
|
1825
|
+
args: [NgxGalleryImageComponent]
|
|
1826
|
+
}], thumbnails: [{
|
|
1827
|
+
type: ViewChild,
|
|
1828
|
+
args: [NgxGalleryThumbnailsComponent]
|
|
1829
|
+
}], width: [{
|
|
1830
|
+
type: HostBinding,
|
|
1831
|
+
args: ['style.width']
|
|
1832
|
+
}], height: [{
|
|
1833
|
+
type: HostBinding,
|
|
1834
|
+
args: ['style.height']
|
|
1835
|
+
}], left: [{
|
|
1836
|
+
type: HostBinding,
|
|
1837
|
+
args: ['style.transform']
|
|
1838
|
+
}], onResize: [{
|
|
1839
|
+
type: HostListener,
|
|
1840
|
+
args: ['window:resize']
|
|
1841
|
+
}] } });
|
|
1842
|
+
|
|
1843
|
+
class NgxGalleryModule {
|
|
1844
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryModule }); }
|
|
1845
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1846
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryModule, declarations: [NgxGalleryComponent,
|
|
1847
|
+
NgxGalleryImageComponent,
|
|
1848
|
+
NgxGalleryArrowsComponent,
|
|
1849
|
+
NgxGalleryThumbnailsComponent,
|
|
1850
|
+
NgxGalleryPreviewComponent,
|
|
1851
|
+
NgxGalleryActionComponent,
|
|
1852
|
+
NgxGalleryBulletsComponent], imports: [CommonModule], exports: [NgxGalleryComponent] }); }
|
|
1853
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryModule, imports: [CommonModule] }); }
|
|
1854
|
+
}
|
|
1855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGalleryModule, decorators: [{
|
|
1856
|
+
type: Injectable
|
|
1857
|
+
}, {
|
|
1858
|
+
type: NgModule,
|
|
1859
|
+
args: [{
|
|
1860
|
+
declarations: [
|
|
1861
|
+
NgxGalleryComponent,
|
|
1862
|
+
NgxGalleryImageComponent,
|
|
1863
|
+
NgxGalleryArrowsComponent,
|
|
1864
|
+
NgxGalleryThumbnailsComponent,
|
|
1865
|
+
NgxGalleryPreviewComponent,
|
|
1866
|
+
NgxGalleryActionComponent,
|
|
1867
|
+
NgxGalleryBulletsComponent
|
|
1868
|
+
],
|
|
1869
|
+
imports: [CommonModule],
|
|
1870
|
+
exports: [NgxGalleryComponent],
|
|
1871
|
+
providers: []
|
|
1872
|
+
}]
|
|
1873
|
+
}] });
|
|
1874
|
+
|
|
1875
|
+
class NgxGalleryImage {
|
|
1876
|
+
constructor(obj) {
|
|
1877
|
+
this.small = obj.small;
|
|
1878
|
+
this.medium = obj.medium;
|
|
1879
|
+
this.big = obj.big;
|
|
1880
|
+
this.description = obj.description;
|
|
1881
|
+
this.url = obj.url;
|
|
1882
|
+
this.type = obj.type;
|
|
1883
|
+
this.label = obj.label;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
/*
|
|
1888
|
+
* Public API Surface of ngx-gallery
|
|
1889
|
+
*/
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* Generated bundle index. Do not edit.
|
|
1893
|
+
*/
|
|
1894
|
+
|
|
1895
|
+
export { NgxGalleryAction, NgxGalleryAnimation, NgxGalleryArrowsComponent, NgxGalleryBulletsComponent, NgxGalleryComponent, NgxGalleryImage, NgxGalleryImageSize, NgxGalleryLayout, NgxGalleryModule, NgxGalleryOptions, NgxGalleryOrder, NgxGalleryOrderedImage, NgxGalleryPreviewComponent, NgxGalleryService, NgxGalleryThumbnailsComponent };
|
|
1896
|
+
//# sourceMappingURL=autotaxatiepartners-ngx-gallery.mjs.map
|