UNPKG

15.2 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('lightgallery')) :
3 typeof define === 'function' && define.amd ? define('lightgallery/angular/12', ['exports', '@angular/core', 'lightgallery'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.lightgallery = global.lightgallery || {}, global.lightgallery.angular = global.lightgallery.angular || {}, global.lightgallery.angular["12"] = {}), global.ng.core, global.lightGallery));
5})(this, (function (exports, i0, lightGallery) { 'use strict';
6
7 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9 function _interopNamespace(e) {
10 if (e && e.__esModule) return e;
11 var n = Object.create(null);
12 if (e) {
13 Object.keys(e).forEach(function (k) {
14 if (k !== 'default') {
15 var d = Object.getOwnPropertyDescriptor(e, k);
16 Object.defineProperty(n, k, d.get ? d : {
17 enumerable: true,
18 get: function () { return e[k]; }
19 });
20 }
21 });
22 }
23 n["default"] = e;
24 return Object.freeze(n);
25 }
26
27 var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28 var lightGallery__default = /*#__PURE__*/_interopDefaultLegacy(lightGallery);
29
30 var LightgalleryService = /** @class */ (function () {
31 function LightgalleryService() {
32 }
33 return LightgalleryService;
34 }());
35 LightgalleryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
36 LightgalleryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryService, providedIn: 'root' });
37 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryService, decorators: [{
38 type: i0.Injectable,
39 args: [{
40 providedIn: 'root',
41 }]
42 }], ctorParameters: function () { return []; } });
43
44 var LgMethods = {
45 onAfterAppendSlide: 'lgAfterAppendSlide',
46 onInit: 'lgInit',
47 onHasVideo: 'lgHasVideo',
48 onContainerResize: 'lgContainerResize',
49 onUpdateSlides: 'lgUpdateSlides',
50 onAfterAppendSubHtml: 'lgAfterAppendSubHtml',
51 onBeforeOpen: 'lgBeforeOpen',
52 onAfterOpen: 'lgAfterOpen',
53 onSlideItemLoad: 'lgSlideItemLoad',
54 onBeforeSlide: 'lgBeforeSlide',
55 onAfterSlide: 'lgAfterSlide',
56 onPosterClick: 'lgPosterClick',
57 onDragStart: 'lgDragStart',
58 onDragMove: 'lgDragMove',
59 onDragEnd: 'lgDragEnd',
60 onBeforeNextSlide: 'lgBeforeNextSlide',
61 onBeforePrevSlide: 'lgBeforePrevSlide',
62 onBeforeClose: 'lgBeforeClose',
63 onAfterClose: 'lgAfterClose',
64 onRotateLeft: 'lgRotateLeft',
65 onRotateRight: 'lgRotateRight',
66 onFlipHorizontal: 'lgFlipHorizontal',
67 onFlipVertical: 'lgFlipVertical',
68 };
69 var LightgalleryComponent = /** @class */ (function () {
70 function LightgalleryComponent(_elementRef) {
71 this._elementRef = _elementRef;
72 this.lgInitialized = false;
73 this._elementRef = _elementRef;
74 }
75 LightgalleryComponent.prototype.ngAfterViewChecked = function () {
76 if (!this.lgInitialized) {
77 this.registerEvents();
78 this.LG = lightGallery__default["default"](this._elementRef.nativeElement, this.settings);
79 this.lgInitialized = true;
80 }
81 };
82 LightgalleryComponent.prototype.ngOnDestroy = function () {
83 this.LG.destroy();
84 this.lgInitialized = false;
85 };
86 LightgalleryComponent.prototype.registerEvents = function () {
87 var _this = this;
88 if (this.onAfterAppendSlide) {
89 this._elementRef.nativeElement.addEventListener(LgMethods.onAfterAppendSlide, (function (event) {
90 _this.onAfterAppendSlide &&
91 _this.onAfterAppendSlide(event.detail);
92 }));
93 }
94 if (this.onInit) {
95 this._elementRef.nativeElement.addEventListener(LgMethods.onInit, (function (event) {
96 _this.onInit && _this.onInit(event.detail);
97 }));
98 }
99 if (this.onHasVideo) {
100 this._elementRef.nativeElement.addEventListener(LgMethods.onHasVideo, (function (event) {
101 _this.onHasVideo && _this.onHasVideo(event.detail);
102 }));
103 }
104 if (this.onContainerResize) {
105 this._elementRef.nativeElement.addEventListener(LgMethods.onContainerResize, (function (event) {
106 _this.onContainerResize &&
107 _this.onContainerResize(event.detail);
108 }));
109 }
110 if (this.onAfterAppendSubHtml) {
111 this._elementRef.nativeElement.addEventListener(LgMethods.onAfterAppendSubHtml, (function (event) {
112 _this.onAfterAppendSubHtml &&
113 _this.onAfterAppendSubHtml(event.detail);
114 }));
115 }
116 if (this.onBeforeOpen) {
117 this._elementRef.nativeElement.addEventListener(LgMethods.onBeforeOpen, (function (event) {
118 _this.onBeforeOpen && _this.onBeforeOpen(event.detail);
119 }));
120 }
121 if (this.onAfterOpen) {
122 this._elementRef.nativeElement.addEventListener(LgMethods.onAfterOpen, (function (event) {
123 _this.onAfterOpen && _this.onAfterOpen(event.detail);
124 }));
125 }
126 if (this.onSlideItemLoad) {
127 this._elementRef.nativeElement.addEventListener(LgMethods.onSlideItemLoad, (function (event) {
128 _this.onSlideItemLoad && _this.onSlideItemLoad(event.detail);
129 }));
130 }
131 if (this.onBeforeSlide) {
132 this._elementRef.nativeElement.addEventListener(LgMethods.onBeforeSlide, (function (event) {
133 _this.onBeforeSlide && _this.onBeforeSlide(event.detail);
134 }));
135 }
136 if (this.onAfterSlide) {
137 this._elementRef.nativeElement.addEventListener(LgMethods.onAfterSlide, (function (event) {
138 _this.onAfterSlide && _this.onAfterSlide(event.detail);
139 }));
140 }
141 if (this.onPosterClick) {
142 this._elementRef.nativeElement.addEventListener(LgMethods.onPosterClick, (function (event) {
143 _this.onPosterClick && _this.onPosterClick(event.detail);
144 }));
145 }
146 if (this.onDragStart) {
147 this._elementRef.nativeElement.addEventListener(LgMethods.onDragStart, (function (event) {
148 _this.onDragStart && _this.onDragStart(event.detail);
149 }));
150 }
151 if (this.onDragMove) {
152 this._elementRef.nativeElement.addEventListener(LgMethods.onDragMove, (function (event) {
153 _this.onDragMove && _this.onDragMove(event.detail);
154 }));
155 }
156 if (this.onDragEnd) {
157 this._elementRef.nativeElement.addEventListener(LgMethods.onDragEnd, (function (event) {
158 _this.onDragEnd && _this.onDragEnd(event.detail);
159 }));
160 }
161 if (this.onBeforeNextSlide) {
162 this._elementRef.nativeElement.addEventListener(LgMethods.onBeforeNextSlide, (function (event) {
163 _this.onBeforeNextSlide &&
164 _this.onBeforeNextSlide(event.detail);
165 }));
166 }
167 if (this.onBeforePrevSlide) {
168 this._elementRef.nativeElement.addEventListener(LgMethods.onBeforePrevSlide, (function (event) {
169 _this.onBeforePrevSlide &&
170 _this.onBeforePrevSlide(event.detail);
171 }));
172 }
173 if (this.onBeforeClose) {
174 this._elementRef.nativeElement.addEventListener(LgMethods.onBeforeClose, (function (event) {
175 _this.onBeforeClose && _this.onBeforeClose(event.detail);
176 }));
177 }
178 if (this.onAfterClose) {
179 this._elementRef.nativeElement.addEventListener(LgMethods.onAfterClose, (function (event) {
180 _this.onAfterClose && _this.onAfterClose(event.detail);
181 }));
182 }
183 if (this.onRotateLeft) {
184 this._elementRef.nativeElement.addEventListener(LgMethods.onRotateLeft, (function (event) {
185 _this.onRotateLeft && _this.onRotateLeft(event.detail);
186 }));
187 }
188 if (this.onRotateRight) {
189 this._elementRef.nativeElement.addEventListener(LgMethods.onRotateRight, (function (event) {
190 _this.onRotateRight && _this.onRotateRight(event.detail);
191 }));
192 }
193 if (this.onFlipHorizontal) {
194 this._elementRef.nativeElement.addEventListener(LgMethods.onFlipHorizontal, (function (event) {
195 _this.onFlipHorizontal &&
196 _this.onFlipHorizontal(event.detail);
197 }));
198 }
199 if (this.onFlipVertical) {
200 this._elementRef.nativeElement.addEventListener(LgMethods.onFlipVertical, (function (event) {
201 _this.onFlipVertical && _this.onFlipVertical(event.detail);
202 }));
203 }
204 };
205 return LightgalleryComponent;
206 }());
207 LightgalleryComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryComponent, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
208 LightgalleryComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LightgalleryComponent, selector: "lightgallery", inputs: { settings: "settings", onAfterAppendSlide: "onAfterAppendSlide", onInit: "onInit", onHasVideo: "onHasVideo", onContainerResize: "onContainerResize", onAfterAppendSubHtml: "onAfterAppendSubHtml", onBeforeOpen: "onBeforeOpen", onAfterOpen: "onAfterOpen", onSlideItemLoad: "onSlideItemLoad", onBeforeSlide: "onBeforeSlide", onAfterSlide: "onAfterSlide", onPosterClick: "onPosterClick", onDragStart: "onDragStart", onDragMove: "onDragMove", onDragEnd: "onDragEnd", onBeforeNextSlide: "onBeforeNextSlide", onBeforePrevSlide: "onBeforePrevSlide", onBeforeClose: "onBeforeClose", onAfterClose: "onAfterClose", onRotateLeft: "onRotateLeft", onRotateRight: "onRotateRight", onFlipHorizontal: "onFlipHorizontal", onFlipVertical: "onFlipVertical" }, ngImport: i0__namespace, template: '<ng-content></ng-content>', isInline: true });
209 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryComponent, decorators: [{
210 type: i0.Component,
211 args: [{
212 selector: 'lightgallery',
213 template: '<ng-content></ng-content>',
214 styles: [],
215 }]
216 }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { settings: [{
217 type: i0.Input
218 }], onAfterAppendSlide: [{
219 type: i0.Input
220 }], onInit: [{
221 type: i0.Input
222 }], onHasVideo: [{
223 type: i0.Input
224 }], onContainerResize: [{
225 type: i0.Input
226 }], onAfterAppendSubHtml: [{
227 type: i0.Input
228 }], onBeforeOpen: [{
229 type: i0.Input
230 }], onAfterOpen: [{
231 type: i0.Input
232 }], onSlideItemLoad: [{
233 type: i0.Input
234 }], onBeforeSlide: [{
235 type: i0.Input
236 }], onAfterSlide: [{
237 type: i0.Input
238 }], onPosterClick: [{
239 type: i0.Input
240 }], onDragStart: [{
241 type: i0.Input
242 }], onDragMove: [{
243 type: i0.Input
244 }], onDragEnd: [{
245 type: i0.Input
246 }], onBeforeNextSlide: [{
247 type: i0.Input
248 }], onBeforePrevSlide: [{
249 type: i0.Input
250 }], onBeforeClose: [{
251 type: i0.Input
252 }], onAfterClose: [{
253 type: i0.Input
254 }], onRotateLeft: [{
255 type: i0.Input
256 }], onRotateRight: [{
257 type: i0.Input
258 }], onFlipHorizontal: [{
259 type: i0.Input
260 }], onFlipVertical: [{
261 type: i0.Input
262 }] } });
263
264 var LightgalleryModule = /** @class */ (function () {
265 function LightgalleryModule() {
266 }
267 return LightgalleryModule;
268 }());
269 LightgalleryModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
270 LightgalleryModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryModule, declarations: [LightgalleryComponent], exports: [LightgalleryComponent] });
271 LightgalleryModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryModule, imports: [[]] });
272 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: LightgalleryModule, decorators: [{
273 type: i0.NgModule,
274 args: [{
275 declarations: [LightgalleryComponent],
276 imports: [],
277 exports: [LightgalleryComponent],
278 }]
279 }] });
280
281 /*
282 * Public API Surface of lightgallery-angular
283 */
284
285 /**
286 * Generated bundle index. Do not edit.
287 */
288
289 exports.LightgalleryComponent = LightgalleryComponent;
290 exports.LightgalleryModule = LightgalleryModule;
291 exports.LightgalleryService = LightgalleryService;
292
293 Object.defineProperty(exports, '__esModule', { value: true });
294
295}));
296//# sourceMappingURL=lightgallery-angular-12.umd.js.map