1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('swiper/core'), require('rxjs')) :
|
3 | typeof define === 'function' && define.amd ? define('swiper_angular', ['exports', '@angular/core', '@angular/common', 'swiper/core', 'rxjs'], factory) :
|
4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.swiper_angular = {}, global.ng.core, global.ng.common, global.Swiper, global.rxjs));
|
5 | }(this, (function (exports, core, common, Swiper, rxjs) { 'use strict';
|
6 |
|
7 | function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
8 |
|
9 | var Swiper__default = _interopDefaultLegacy(Swiper);
|
10 |
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | var extendStatics = function (d, b) {
|
27 | extendStatics = Object.setPrototypeOf ||
|
28 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
29 | function (d, b) { for (var p in b)
|
30 | if (Object.prototype.hasOwnProperty.call(b, p))
|
31 | d[p] = b[p]; };
|
32 | return extendStatics(d, b);
|
33 | };
|
34 | function __extends(d, b) {
|
35 | if (typeof b !== "function" && b !== null)
|
36 | throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
37 | extendStatics(d, b);
|
38 | function __() { this.constructor = d; }
|
39 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
40 | }
|
41 | var __assign = function () {
|
42 | __assign = Object.assign || function __assign(t) {
|
43 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
44 | s = arguments[i];
|
45 | for (var p in s)
|
46 | if (Object.prototype.hasOwnProperty.call(s, p))
|
47 | t[p] = s[p];
|
48 | }
|
49 | return t;
|
50 | };
|
51 | return __assign.apply(this, arguments);
|
52 | };
|
53 | function __rest(s, e) {
|
54 | var t = {};
|
55 | for (var p in s)
|
56 | if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
57 | t[p] = s[p];
|
58 | if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
59 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
60 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
61 | t[p[i]] = s[p[i]];
|
62 | }
|
63 | return t;
|
64 | }
|
65 | function __decorate(decorators, target, key, desc) {
|
66 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
67 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
68 | r = Reflect.decorate(decorators, target, key, desc);
|
69 | else
|
70 | for (var i = decorators.length - 1; i >= 0; i--)
|
71 | if (d = decorators[i])
|
72 | r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
73 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
74 | }
|
75 | function __param(paramIndex, decorator) {
|
76 | return function (target, key) { decorator(target, key, paramIndex); };
|
77 | }
|
78 | function __metadata(metadataKey, metadataValue) {
|
79 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
80 | return Reflect.metadata(metadataKey, metadataValue);
|
81 | }
|
82 | function __awaiter(thisArg, _arguments, P, generator) {
|
83 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
84 | return new (P || (P = Promise))(function (resolve, reject) {
|
85 | function fulfilled(value) { try {
|
86 | step(generator.next(value));
|
87 | }
|
88 | catch (e) {
|
89 | reject(e);
|
90 | } }
|
91 | function rejected(value) { try {
|
92 | step(generator["throw"](value));
|
93 | }
|
94 | catch (e) {
|
95 | reject(e);
|
96 | } }
|
97 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
98 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
99 | });
|
100 | }
|
101 | function __generator(thisArg, body) {
|
102 | var _ = { label: 0, sent: function () { if (t[0] & 1)
|
103 | throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
104 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
105 | function verb(n) { return function (v) { return step([n, v]); }; }
|
106 | function step(op) {
|
107 | if (f)
|
108 | throw new TypeError("Generator is already executing.");
|
109 | while (_)
|
110 | try {
|
111 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
112 | return t;
|
113 | if (y = 0, t)
|
114 | op = [op[0] & 2, t.value];
|
115 | switch (op[0]) {
|
116 | case 0:
|
117 | case 1:
|
118 | t = op;
|
119 | break;
|
120 | case 4:
|
121 | _.label++;
|
122 | return { value: op[1], done: false };
|
123 | case 5:
|
124 | _.label++;
|
125 | y = op[1];
|
126 | op = [0];
|
127 | continue;
|
128 | case 7:
|
129 | op = _.ops.pop();
|
130 | _.trys.pop();
|
131 | continue;
|
132 | default:
|
133 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
134 | _ = 0;
|
135 | continue;
|
136 | }
|
137 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
138 | _.label = op[1];
|
139 | break;
|
140 | }
|
141 | if (op[0] === 6 && _.label < t[1]) {
|
142 | _.label = t[1];
|
143 | t = op;
|
144 | break;
|
145 | }
|
146 | if (t && _.label < t[2]) {
|
147 | _.label = t[2];
|
148 | _.ops.push(op);
|
149 | break;
|
150 | }
|
151 | if (t[2])
|
152 | _.ops.pop();
|
153 | _.trys.pop();
|
154 | continue;
|
155 | }
|
156 | op = body.call(thisArg, _);
|
157 | }
|
158 | catch (e) {
|
159 | op = [6, e];
|
160 | y = 0;
|
161 | }
|
162 | finally {
|
163 | f = t = 0;
|
164 | }
|
165 | if (op[0] & 5)
|
166 | throw op[1];
|
167 | return { value: op[0] ? op[1] : void 0, done: true };
|
168 | }
|
169 | }
|
170 | var __createBinding = Object.create ? (function (o, m, k, k2) {
|
171 | if (k2 === undefined)
|
172 | k2 = k;
|
173 | Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
174 | }) : (function (o, m, k, k2) {
|
175 | if (k2 === undefined)
|
176 | k2 = k;
|
177 | o[k2] = m[k];
|
178 | });
|
179 | function __exportStar(m, o) {
|
180 | for (var p in m)
|
181 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
182 | __createBinding(o, m, p);
|
183 | }
|
184 | function __values(o) {
|
185 | var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
186 | if (m)
|
187 | return m.call(o);
|
188 | if (o && typeof o.length === "number")
|
189 | return {
|
190 | next: function () {
|
191 | if (o && i >= o.length)
|
192 | o = void 0;
|
193 | return { value: o && o[i++], done: !o };
|
194 | }
|
195 | };
|
196 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
197 | }
|
198 | function __read(o, n) {
|
199 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
200 | if (!m)
|
201 | return o;
|
202 | var i = m.call(o), r, ar = [], e;
|
203 | try {
|
204 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
205 | ar.push(r.value);
|
206 | }
|
207 | catch (error) {
|
208 | e = { error: error };
|
209 | }
|
210 | finally {
|
211 | try {
|
212 | if (r && !r.done && (m = i["return"]))
|
213 | m.call(i);
|
214 | }
|
215 | finally {
|
216 | if (e)
|
217 | throw e.error;
|
218 | }
|
219 | }
|
220 | return ar;
|
221 | }
|
222 |
|
223 | function __spread() {
|
224 | for (var ar = [], i = 0; i < arguments.length; i++)
|
225 | ar = ar.concat(__read(arguments[i]));
|
226 | return ar;
|
227 | }
|
228 |
|
229 | function __spreadArrays() {
|
230 | for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
231 | s += arguments[i].length;
|
232 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
233 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
234 | r[k] = a[j];
|
235 | return r;
|
236 | }
|
237 | function __spreadArray(to, from) {
|
238 | for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
239 | to[j] = from[i];
|
240 | return to;
|
241 | }
|
242 | function __await(v) {
|
243 | return this instanceof __await ? (this.v = v, this) : new __await(v);
|
244 | }
|
245 | function __asyncGenerator(thisArg, _arguments, generator) {
|
246 | if (!Symbol.asyncIterator)
|
247 | throw new TypeError("Symbol.asyncIterator is not defined.");
|
248 | var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
249 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
250 | function verb(n) { if (g[n])
|
251 | i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
252 | function resume(n, v) { try {
|
253 | step(g[n](v));
|
254 | }
|
255 | catch (e) {
|
256 | settle(q[0][3], e);
|
257 | } }
|
258 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
259 | function fulfill(value) { resume("next", value); }
|
260 | function reject(value) { resume("throw", value); }
|
261 | function settle(f, v) { if (f(v), q.shift(), q.length)
|
262 | resume(q[0][0], q[0][1]); }
|
263 | }
|
264 | function __asyncDelegator(o) {
|
265 | var i, p;
|
266 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
267 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
268 | }
|
269 | function __asyncValues(o) {
|
270 | if (!Symbol.asyncIterator)
|
271 | throw new TypeError("Symbol.asyncIterator is not defined.");
|
272 | var m = o[Symbol.asyncIterator], i;
|
273 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
274 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
275 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
276 | }
|
277 | function __makeTemplateObject(cooked, raw) {
|
278 | if (Object.defineProperty) {
|
279 | Object.defineProperty(cooked, "raw", { value: raw });
|
280 | }
|
281 | else {
|
282 | cooked.raw = raw;
|
283 | }
|
284 | return cooked;
|
285 | }
|
286 | ;
|
287 | var __setModuleDefault = Object.create ? (function (o, v) {
|
288 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
289 | }) : function (o, v) {
|
290 | o["default"] = v;
|
291 | };
|
292 | function __importStar(mod) {
|
293 | if (mod && mod.__esModule)
|
294 | return mod;
|
295 | var result = {};
|
296 | if (mod != null)
|
297 | for (var k in mod)
|
298 | if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
299 | __createBinding(result, mod, k);
|
300 | __setModuleDefault(result, mod);
|
301 | return result;
|
302 | }
|
303 | function __importDefault(mod) {
|
304 | return (mod && mod.__esModule) ? mod : { default: mod };
|
305 | }
|
306 | function __classPrivateFieldGet(receiver, privateMap) {
|
307 | if (!privateMap.has(receiver)) {
|
308 | throw new TypeError("attempted to get private field on non-instance");
|
309 | }
|
310 | return privateMap.get(receiver);
|
311 | }
|
312 | function __classPrivateFieldSet(receiver, privateMap, value) {
|
313 | if (!privateMap.has(receiver)) {
|
314 | throw new TypeError("attempted to set private field on non-instance");
|
315 | }
|
316 | privateMap.set(receiver, value);
|
317 | return value;
|
318 | }
|
319 |
|
320 | function isObject(o) {
|
321 | return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object;
|
322 | }
|
323 | function extend(target, src) {
|
324 | Object.keys(src).forEach(function (key) {
|
325 | if (typeof target[key] === 'undefined') {
|
326 | target[key] = src[key];
|
327 | return;
|
328 | }
|
329 | if (target[key] && !src[key]) {
|
330 | return;
|
331 | }
|
332 | if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
|
333 | extend(target[key], src[key]);
|
334 | }
|
335 | else {
|
336 | target[key] = src[key];
|
337 | }
|
338 | });
|
339 | }
|
340 | function coerceBooleanProperty(value) {
|
341 | return value != null && "" + value !== 'false';
|
342 | }
|
343 | var ignoreNgOnChanges = ['pagination', 'navigation', 'scrollbar', 'virtual'];
|
344 | function setProperty(val, obj) {
|
345 | if (obj === void 0) { obj = {}; }
|
346 | if (isObject(val)) {
|
347 | return val;
|
348 | }
|
349 | var newValue = coerceBooleanProperty(val);
|
350 | if (newValue === true) {
|
351 | return obj;
|
352 | }
|
353 | return newValue;
|
354 | }
|
355 |
|
356 |
|
357 | var paramsList = [
|
358 | 'init',
|
359 | '_direction',
|
360 | 'touchEventsTarget',
|
361 | 'initialSlide',
|
362 | '_speed',
|
363 | 'cssMode',
|
364 | 'updateOnWindowResize',
|
365 | 'nested',
|
366 | '_width',
|
367 | '_height',
|
368 | 'preventInteractionOnTransition',
|
369 | 'userAgent',
|
370 | 'url',
|
371 | '_edgeSwipeDetection',
|
372 | '_edgeSwipeThreshold',
|
373 | '_freeMode',
|
374 | '_freeModeMomentum',
|
375 | '_freeModeMomentumRatio',
|
376 | '_freeModeMomentumBounce',
|
377 | '_freeModeMomentumBounceRatio',
|
378 | '_freeModeMomentumVelocityRatio',
|
379 | '_freeModeSticky',
|
380 | '_freeModeMinimumVelocity',
|
381 | '_autoHeight',
|
382 | 'setWrapperSize',
|
383 | 'virtualTranslate',
|
384 | '_effect',
|
385 | 'breakpoints',
|
386 | '_spaceBetween',
|
387 | '_slidesPerView',
|
388 | '_slidesPerColumn',
|
389 | '_slidesPerColumnFill',
|
390 | '_slidesPerGroup',
|
391 | '_slidesPerGroupSkip',
|
392 | '_centeredSlides',
|
393 | '_centeredSlidesBounds',
|
394 | '_slidesOffsetBefore',
|
395 | '_slidesOffsetAfter',
|
396 | 'normalizeSlideIndex',
|
397 | '_centerInsufficientSlides',
|
398 | '_watchOverflow',
|
399 | 'roundLengths',
|
400 | 'touchRatio',
|
401 | 'touchAngle',
|
402 | 'simulateTouch',
|
403 | '_shortSwipes',
|
404 | '_longSwipes',
|
405 | 'longSwipesRatio',
|
406 | 'longSwipesMs',
|
407 | '_followFinger',
|
408 | 'allowTouchMove',
|
409 | '_threshold',
|
410 | 'touchMoveStopPropagation',
|
411 | 'touchStartPreventDefault',
|
412 | 'touchStartForcePreventDefault',
|
413 | 'touchReleaseOnEdges',
|
414 | 'uniqueNavElements',
|
415 | '_resistance',
|
416 | '_resistanceRatio',
|
417 | '_watchSlidesProgress',
|
418 | '_watchSlidesVisibility',
|
419 | '_grabCursor',
|
420 | 'preventClicks',
|
421 | 'preventClicksPropagation',
|
422 | '_slideToClickedSlide',
|
423 | '_preloadImages',
|
424 | 'updateOnImagesReady',
|
425 | '_loop',
|
426 | '_loopAdditionalSlides',
|
427 | '_loopedSlides',
|
428 | '_loopFillGroupWithBlank',
|
429 | 'loopPreventsSlide',
|
430 | '_allowSlidePrev',
|
431 | '_allowSlideNext',
|
432 | '_swipeHandler',
|
433 | '_noSwiping',
|
434 | 'noSwipingClass',
|
435 | 'noSwipingSelector',
|
436 | 'passiveListeners',
|
437 | 'containerModifierClass',
|
438 | 'slideClass',
|
439 | 'slideBlankClass',
|
440 | 'slideActiveClass',
|
441 | 'slideDuplicateActiveClass',
|
442 | 'slideVisibleClass',
|
443 | 'slideDuplicateClass',
|
444 | 'slideNextClass',
|
445 | 'slideDuplicateNextClass',
|
446 | 'slidePrevClass',
|
447 | 'slideDuplicatePrevClass',
|
448 | 'wrapperClass',
|
449 | 'runCallbacksOnInit',
|
450 |
|
451 | 'a11y',
|
452 | 'autoplay',
|
453 | '_controller',
|
454 | 'coverflowEffect',
|
455 | 'cubeEffect',
|
456 | 'fadeEffect',
|
457 | 'flipEffect',
|
458 | 'hashNavigation',
|
459 | 'history',
|
460 | 'keyboard',
|
461 | 'lazy',
|
462 | 'mousewheel',
|
463 | '_navigation',
|
464 | '_pagination',
|
465 | 'parallax',
|
466 | '_scrollbar',
|
467 | '_thumbs',
|
468 | 'virtual',
|
469 | 'zoom',
|
470 | ];
|
471 |
|
472 |
|
473 | var ɵ0 = function (key) { return key.replace(/_/, ''); };
|
474 | var allowedParams = paramsList.map(ɵ0);
|
475 | function getParams(obj) {
|
476 | if (obj === void 0) { obj = {}; }
|
477 | var params = {
|
478 | on: {},
|
479 | };
|
480 | var passedParams = {};
|
481 | extend(params, Swiper__default['default'].defaults);
|
482 | extend(params, Swiper__default['default'].extendedDefaults);
|
483 | params._emitClasses = true;
|
484 | var rest = {};
|
485 | Object.keys(obj).forEach(function (key) {
|
486 | var _key = key.replace(/^_/, '');
|
487 | if (typeof obj[_key] === 'undefined')
|
488 | return;
|
489 | if (allowedParams.indexOf(_key) >= 0) {
|
490 | if (isObject(obj[_key])) {
|
491 | params[_key] = {};
|
492 | passedParams[_key] = {};
|
493 | extend(params[_key], obj[_key]);
|
494 | extend(passedParams[_key], obj[_key]);
|
495 | }
|
496 | else {
|
497 | params[_key] = obj[_key];
|
498 | passedParams[_key] = obj[_key];
|
499 | }
|
500 | }
|
501 | else {
|
502 | rest[_key] = obj[_key];
|
503 | }
|
504 | });
|
505 | return { params: params, passedParams: passedParams, rest: rest };
|
506 | }
|
507 |
|
508 | var SwiperSlideDirective = (function () {
|
509 | function SwiperSlideDirective(template) {
|
510 | this.template = template;
|
511 | this.class = '';
|
512 | this.slideData = {
|
513 | isActive: false,
|
514 | isPrev: false,
|
515 | isNext: false,
|
516 | isVisible: false,
|
517 | isDuplicate: false,
|
518 | };
|
519 | }
|
520 | Object.defineProperty(SwiperSlideDirective.prototype, "zoom", {
|
521 | get: function () {
|
522 | return this._zoom;
|
523 | },
|
524 | set: function (val) {
|
525 | this._zoom = coerceBooleanProperty(val);
|
526 | },
|
527 | enumerable: false,
|
528 | configurable: true
|
529 | });
|
530 | Object.defineProperty(SwiperSlideDirective.prototype, "classNames", {
|
531 | get: function () {
|
532 | return this._classNames;
|
533 | },
|
534 | set: function (val) {
|
535 | if (this._classNames === val) {
|
536 | return;
|
537 | }
|
538 | this._classNames = val;
|
539 | this.slideData = {
|
540 | isActive: this._hasClass(['swiper-slide-active', 'swiper-slide-duplicate-active']),
|
541 | isVisible: this._hasClass(['swiper-slide-visible']),
|
542 | isDuplicate: this._hasClass(['swiper-slide-duplicate']),
|
543 | isPrev: this._hasClass(['swiper-slide-prev', 'swiper-slide-duplicate-prev']),
|
544 | isNext: this._hasClass(['swiper-slide-next', 'swiper-slide-duplicate-next']),
|
545 | };
|
546 | },
|
547 | enumerable: false,
|
548 | configurable: true
|
549 | });
|
550 | SwiperSlideDirective.prototype._hasClass = function (classNames) {
|
551 | var _this = this;
|
552 | return classNames.some(function (className) { return _this._classNames.indexOf(className) >= 0; });
|
553 | };
|
554 | return SwiperSlideDirective;
|
555 | }());
|
556 | SwiperSlideDirective.decorators = [
|
557 | { type: core.Directive, args: [{
|
558 | selector: 'ng-template[swiperSlide]',
|
559 | },] }
|
560 | ];
|
561 | SwiperSlideDirective.ctorParameters = function () { return [
|
562 | { type: core.TemplateRef }
|
563 | ]; };
|
564 | SwiperSlideDirective.propDecorators = {
|
565 | virtualIndex: [{ type: core.Input }],
|
566 | class: [{ type: core.Input }],
|
567 | zoom: [{ type: core.Input }]
|
568 | };
|
569 |
|
570 | var SwiperComponent = (function () {
|
571 | function SwiperComponent(zone, elementRef, _changeDetectorRef) {
|
572 | var _this = this;
|
573 | this.zone = zone;
|
574 | this.elementRef = elementRef;
|
575 | this._changeDetectorRef = _changeDetectorRef;
|
576 | this.init = true;
|
577 | this.slideClass = 'swiper-slide';
|
578 | this.wrapperClass = 'swiper-wrapper';
|
579 | this.showNavigation = true;
|
580 | this.showPagination = true;
|
581 | this.showScrollbar = true;
|
582 |
|
583 | this.s__beforeBreakpoint = new core.EventEmitter();
|
584 |
|
585 | this.s__containerClasses = new core.EventEmitter();
|
586 |
|
587 | this.s__slideClass = new core.EventEmitter();
|
588 |
|
589 | this.s__swiper = new core.EventEmitter();
|
590 |
|
591 | this.s_activeIndexChange = new core.EventEmitter();
|
592 |
|
593 | this.s_afterInit = new core.EventEmitter();
|
594 |
|
595 | this.s_autoplay = new core.EventEmitter();
|
596 |
|
597 | this.s_autoplayStart = new core.EventEmitter();
|
598 |
|
599 | this.s_autoplayStop = new core.EventEmitter();
|
600 |
|
601 | this.s_beforeDestroy = new core.EventEmitter();
|
602 |
|
603 | this.s_beforeInit = new core.EventEmitter();
|
604 |
|
605 | this.s_beforeLoopFix = new core.EventEmitter();
|
606 |
|
607 | this.s_beforeResize = new core.EventEmitter();
|
608 |
|
609 | this.s_beforeSlideChangeStart = new core.EventEmitter();
|
610 |
|
611 | this.s_beforeTransitionStart = new core.EventEmitter();
|
612 |
|
613 | this.s_breakpoint = new core.EventEmitter();
|
614 |
|
615 | this.s_changeDirection = new core.EventEmitter();
|
616 |
|
617 | this.s_click = new core.EventEmitter();
|
618 |
|
619 | this.s_doubleTap = new core.EventEmitter();
|
620 |
|
621 | this.s_doubleClick = new core.EventEmitter();
|
622 |
|
623 | this.s_destroy = new core.EventEmitter();
|
624 |
|
625 | this.s_fromEdge = new core.EventEmitter();
|
626 |
|
627 | this.s_hashChange = new core.EventEmitter();
|
628 |
|
629 | this.s_hashSet = new core.EventEmitter();
|
630 |
|
631 | this.s_imagesReady = new core.EventEmitter();
|
632 |
|
633 | this.s_init = new core.EventEmitter();
|
634 |
|
635 | this.s_keyPress = new core.EventEmitter();
|
636 |
|
637 | this.s_lazyImageLoad = new core.EventEmitter();
|
638 |
|
639 | this.s_lazyImageReady = new core.EventEmitter();
|
640 |
|
641 | this.s_loopFix = new core.EventEmitter();
|
642 |
|
643 | this.s_momentumBounce = new core.EventEmitter();
|
644 |
|
645 | this.s_navigationHide = new core.EventEmitter();
|
646 |
|
647 | this.s_navigationShow = new core.EventEmitter();
|
648 |
|
649 | this.s_observerUpdate = new core.EventEmitter();
|
650 |
|
651 | this.s_orientationchange = new core.EventEmitter();
|
652 |
|
653 | this.s_paginationHide = new core.EventEmitter();
|
654 |
|
655 | this.s_paginationRender = new core.EventEmitter();
|
656 |
|
657 | this.s_paginationShow = new core.EventEmitter();
|
658 |
|
659 | this.s_paginationUpdate = new core.EventEmitter();
|
660 |
|
661 | this.s_progress = new core.EventEmitter();
|
662 |
|
663 | this.s_reachBeginning = new core.EventEmitter();
|
664 |
|
665 | this.s_reachEnd = new core.EventEmitter();
|
666 |
|
667 | this.s_realIndexChange = new core.EventEmitter();
|
668 |
|
669 | this.s_resize = new core.EventEmitter();
|
670 |
|
671 | this.s_scroll = new core.EventEmitter();
|
672 |
|
673 | this.s_scrollbarDragEnd = new core.EventEmitter();
|
674 |
|
675 | this.s_scrollbarDragMove = new core.EventEmitter();
|
676 |
|
677 | this.s_scrollbarDragStart = new core.EventEmitter();
|
678 |
|
679 | this.s_setTransition = new core.EventEmitter();
|
680 |
|
681 | this.s_setTranslate = new core.EventEmitter();
|
682 |
|
683 | this.s_slideChange = new core.EventEmitter();
|
684 |
|
685 | this.s_slideChangeTransitionEnd = new core.EventEmitter();
|
686 |
|
687 | this.s_slideChangeTransitionStart = new core.EventEmitter();
|
688 |
|
689 | this.s_slideNextTransitionEnd = new core.EventEmitter();
|
690 |
|
691 | this.s_slideNextTransitionStart = new core.EventEmitter();
|
692 |
|
693 | this.s_slidePrevTransitionEnd = new core.EventEmitter();
|
694 |
|
695 | this.s_slidePrevTransitionStart = new core.EventEmitter();
|
696 |
|
697 | this.s_slideResetTransitionStart = new core.EventEmitter();
|
698 |
|
699 | this.s_slideResetTransitionEnd = new core.EventEmitter();
|
700 |
|
701 | this.s_sliderMove = new core.EventEmitter();
|
702 |
|
703 | this.s_sliderFirstMove = new core.EventEmitter();
|
704 |
|
705 | this.s_slidesLengthChange = new core.EventEmitter();
|
706 |
|
707 | this.s_slidesGridLengthChange = new core.EventEmitter();
|
708 |
|
709 | this.s_snapGridLengthChange = new core.EventEmitter();
|
710 |
|
711 | this.s_snapIndexChange = new core.EventEmitter();
|
712 |
|
713 | this.s_tap = new core.EventEmitter();
|
714 |
|
715 | this.s_toEdge = new core.EventEmitter();
|
716 |
|
717 | this.s_touchEnd = new core.EventEmitter();
|
718 |
|
719 | this.s_touchMove = new core.EventEmitter();
|
720 |
|
721 | this.s_touchMoveOpposite = new core.EventEmitter();
|
722 |
|
723 | this.s_touchStart = new core.EventEmitter();
|
724 |
|
725 | this.s_transitionEnd = new core.EventEmitter();
|
726 |
|
727 | this.s_transitionStart = new core.EventEmitter();
|
728 |
|
729 | this.s_update = new core.EventEmitter();
|
730 |
|
731 | this.s_zoomChange = new core.EventEmitter();
|
732 |
|
733 | this.s_swiper = new core.EventEmitter();
|
734 | this.indexChange = new core.EventEmitter();
|
735 | this._activeSlides = new rxjs.Subject();
|
736 | this.containerClasses = 'swiper-container';
|
737 | this.slidesChanges = function (val) {
|
738 | var _a;
|
739 | _this.slides = val.map(function (slide, index) {
|
740 | slide.slideIndex = index;
|
741 | slide.classNames = _this.slideClass;
|
742 | return slide;
|
743 | });
|
744 | if (_this.loop && !_this.loopedSlides) {
|
745 | _this.calcLoopedSlides();
|
746 | }
|
747 | if (!_this.virtual) {
|
748 | _this.prependSlides = rxjs.of(_this.slides.slice(_this.slides.length - _this.loopedSlides));
|
749 | _this.appendSlides = rxjs.of(_this.slides.slice(0, _this.loopedSlides));
|
750 | }
|
751 | _this._changeDetectorRef.detectChanges();
|
752 | (_a = _this.swiperRef) === null || _a === void 0 ? void 0 : _a.update();
|
753 | };
|
754 | this.style = null;
|
755 | }
|
756 | Object.defineProperty(SwiperComponent.prototype, "navigation", {
|
757 | get: function () {
|
758 | return this._navigation;
|
759 | },
|
760 | set: function (val) {
|
761 | var _a, _b, _c, _d;
|
762 | var currentNext = typeof this._navigation !== 'boolean' ? (_a = this._navigation) === null || _a === void 0 ? void 0 : _a.nextEl : null;
|
763 | var currentPrev = typeof this._navigation !== 'boolean' ? (_b = this._navigation) === null || _b === void 0 ? void 0 : _b.prevEl : null;
|
764 | this._navigation = setProperty(val, {
|
765 | nextEl: currentNext || null,
|
766 | prevEl: currentPrev || null,
|
767 | });
|
768 | if (typeof this._navigation !== 'boolean' &&
|
769 | (typeof ((_c = this._navigation) === null || _c === void 0 ? void 0 : _c.nextEl) === 'string' || typeof ((_d = this._navigation) === null || _d === void 0 ? void 0 : _d.prevEl) === 'string')) {
|
770 | this.showNavigation = false;
|
771 | }
|
772 | },
|
773 | enumerable: false,
|
774 | configurable: true
|
775 | });
|
776 | Object.defineProperty(SwiperComponent.prototype, "pagination", {
|
777 | get: function () {
|
778 | return this._pagination;
|
779 | },
|
780 | set: function (val) {
|
781 | var _a, _b;
|
782 | var current = typeof this._pagination !== 'boolean' ? (_a = this._pagination) === null || _a === void 0 ? void 0 : _a.el : null;
|
783 | this._pagination = setProperty(val, {
|
784 | el: current || null,
|
785 | });
|
786 | if (typeof this._pagination !== 'boolean' && typeof ((_b = this._pagination) === null || _b === void 0 ? void 0 : _b.el) === 'string') {
|
787 | this.showPagination = false;
|
788 | }
|
789 | },
|
790 | enumerable: false,
|
791 | configurable: true
|
792 | });
|
793 | Object.defineProperty(SwiperComponent.prototype, "scrollbar", {
|
794 | get: function () {
|
795 | return this._scrollbar;
|
796 | },
|
797 | set: function (val) {
|
798 | var _a, _b;
|
799 | var current = typeof this._scrollbar !== 'boolean' ? (_a = this._scrollbar) === null || _a === void 0 ? void 0 : _a.el : null;
|
800 | this._scrollbar = setProperty(val, {
|
801 | el: current || null,
|
802 | });
|
803 | if (typeof this._scrollbar !== 'boolean' && typeof ((_b = this._scrollbar) === null || _b === void 0 ? void 0 : _b.el) === 'string') {
|
804 | this.showScrollbar = false;
|
805 | }
|
806 | },
|
807 | enumerable: false,
|
808 | configurable: true
|
809 | });
|
810 | Object.defineProperty(SwiperComponent.prototype, "virtual", {
|
811 | get: function () {
|
812 | return this._virtual;
|
813 | },
|
814 | set: function (val) {
|
815 | this._virtual = setProperty(val);
|
816 | },
|
817 | enumerable: false,
|
818 | configurable: true
|
819 | });
|
820 | Object.defineProperty(SwiperComponent.prototype, "index", {
|
821 | set: function (index) {
|
822 | this.setIndex(index);
|
823 | },
|
824 | enumerable: false,
|
825 | configurable: true
|
826 | });
|
827 | Object.defineProperty(SwiperComponent.prototype, "config", {
|
828 | set: function (val) {
|
829 | this.updateSwiper(val);
|
830 | var params = getParams(val).params;
|
831 | Object.assign(this, params);
|
832 | },
|
833 | enumerable: false,
|
834 | configurable: true
|
835 | });
|
836 | Object.defineProperty(SwiperComponent.prototype, "prevElRef", {
|
837 | set: function (el) {
|
838 | this._setElement(el, this.navigation, 'navigation', 'prevEl');
|
839 | },
|
840 | enumerable: false,
|
841 | configurable: true
|
842 | });
|
843 | Object.defineProperty(SwiperComponent.prototype, "nextElRef", {
|
844 | set: function (el) {
|
845 | this._setElement(el, this.navigation, 'navigation', 'nextEl');
|
846 | },
|
847 | enumerable: false,
|
848 | configurable: true
|
849 | });
|
850 | Object.defineProperty(SwiperComponent.prototype, "scrollbarElRef", {
|
851 | set: function (el) {
|
852 | this._setElement(el, this.scrollbar, 'scrollbar');
|
853 | },
|
854 | enumerable: false,
|
855 | configurable: true
|
856 | });
|
857 | Object.defineProperty(SwiperComponent.prototype, "paginationElRef", {
|
858 | set: function (el) {
|
859 | this._setElement(el, this.pagination, 'pagination');
|
860 | },
|
861 | enumerable: false,
|
862 | configurable: true
|
863 | });
|
864 | Object.defineProperty(SwiperComponent.prototype, "activeSlides", {
|
865 | get: function () {
|
866 | if (this.virtual) {
|
867 | return this._activeSlides;
|
868 | }
|
869 | return rxjs.of(this.slides);
|
870 | },
|
871 | enumerable: false,
|
872 | configurable: true
|
873 | });
|
874 | Object.defineProperty(SwiperComponent.prototype, "zoomContainerClass", {
|
875 | get: function () {
|
876 | return typeof this.zoom !== 'boolean' ? this.zoom.containerClass : 'swiper-zoom-container';
|
877 | },
|
878 | enumerable: false,
|
879 | configurable: true
|
880 | });
|
881 | SwiperComponent.prototype._setElement = function (el, ref, update, key) {
|
882 | if (key === void 0) { key = 'el'; }
|
883 | if (!el || !ref) {
|
884 | return;
|
885 | }
|
886 | if (ref && el.nativeElement) {
|
887 | if (ref[key] === el.nativeElement) {
|
888 | return;
|
889 | }
|
890 | ref[key] = el.nativeElement;
|
891 | }
|
892 | var updateObj = {};
|
893 | updateObj[update] = true;
|
894 | this.updateInitSwiper(updateObj);
|
895 | };
|
896 | SwiperComponent.prototype.ngOnInit = function () {
|
897 | var params = getParams(this).params;
|
898 | Object.assign(this, params);
|
899 | };
|
900 | SwiperComponent.prototype.ngAfterViewInit = function () {
|
901 | this.childrenSlidesInit();
|
902 | if (this.init) {
|
903 | this.initSwiper();
|
904 | this._changeDetectorRef.detectChanges();
|
905 | }
|
906 | };
|
907 | SwiperComponent.prototype.childrenSlidesInit = function () {
|
908 | this.slidesChanges(this.slidesEl);
|
909 | this.slidesEl.changes.subscribe(this.slidesChanges);
|
910 | };
|
911 | Object.defineProperty(SwiperComponent.prototype, "isSwiperActive", {
|
912 | get: function () {
|
913 | return this.swiperRef && !this.swiperRef.destroyed;
|
914 | },
|
915 | enumerable: false,
|
916 | configurable: true
|
917 | });
|
918 | SwiperComponent.prototype.initSwiper = function () {
|
919 | var _this = this;
|
920 | var _e = getParams(this), swiperParams = _e.params, passedParams = _e.passedParams;
|
921 | Object.assign(this, swiperParams);
|
922 | swiperParams.onAny = function (event) {
|
923 | var args = [];
|
924 | for (var _i = 1; _i < arguments.length; _i++) {
|
925 | args[_i - 1] = arguments[_i];
|
926 | }
|
927 | var emitter = _this["s_" + event];
|
928 | if (emitter) {
|
929 | emitter.emit.apply(emitter, __spread(args));
|
930 | }
|
931 | };
|
932 | Object.assign(swiperParams.on, {
|
933 | slideChange: function () {
|
934 | _this.indexChange.emit(_this.swiperRef.realIndex);
|
935 | },
|
936 | _containerClasses: function (swiper, classes) {
|
937 | this.containerClasses = classes;
|
938 | },
|
939 | _swiper: function (swiper) {
|
940 | _this.swiperRef = swiper;
|
941 | _this.s_swiper.emit(_this.swiperRef);
|
942 | swiper.loopCreate = function () { };
|
943 | swiper.loopDestroy = function () { };
|
944 | if (swiperParams.loop) {
|
945 | swiper.loopedSlides = _this.loopedSlides;
|
946 | }
|
947 | if (swiper.virtual && swiper.params.virtual.enabled) {
|
948 | swiper.virtual.slides = _this.slides;
|
949 | var extendWith = {
|
950 | cache: false,
|
951 | renderExternal: function (data) {
|
952 | _this.updateVirtualSlides(data);
|
953 | },
|
954 | renderExternalUpdate: false,
|
955 | };
|
956 | extend(swiper.params.virtual, extendWith);
|
957 | extend(swiper.originalParams.virtual, extendWith);
|
958 | }
|
959 | _this._changeDetectorRef.detectChanges();
|
960 | },
|
961 | _slideClasses: function (_, updated) {
|
962 | updated.forEach(function (_e, index) {
|
963 | var slideEl = _e.slideEl, classNames = _e.classNames;
|
964 | var slideIndex = parseInt(slideEl.getAttribute('data-swiper-slide-index')) || index;
|
965 | if (_this.virtual) {
|
966 | var virtualSlide = _this.slides.find(function (item) {
|
967 | return item.virtualIndex && item.virtualIndex === slideIndex;
|
968 | });
|
969 | if (virtualSlide) {
|
970 | virtualSlide.classNames = classNames;
|
971 | return;
|
972 | }
|
973 | }
|
974 | if (_this.slides[slideIndex]) {
|
975 | _this.slides[slideIndex].classNames = classNames;
|
976 | }
|
977 | });
|
978 | _this._changeDetectorRef.detectChanges();
|
979 | },
|
980 | });
|
981 | new Swiper__default['default'](this.elementRef.nativeElement, swiperParams);
|
982 | };
|
983 | SwiperComponent.prototype.updateVirtualSlides = function (virtualData) {
|
984 | var _e;
|
985 |
|
986 | if (!this.swiperRef ||
|
987 | (this.currentVirtualData &&
|
988 | this.currentVirtualData.from === virtualData.from &&
|
989 | this.currentVirtualData.to === virtualData.to &&
|
990 | this.currentVirtualData.offset === virtualData.offset)) {
|
991 | return;
|
992 | }
|
993 | this.style = this.swiperRef.isHorizontal()
|
994 | ? (_e = {},
|
995 | _e[this.swiperRef.rtlTranslate ? 'right' : 'left'] = virtualData.offset + "px",
|
996 | _e) : {
|
997 | top: virtualData.offset + "px",
|
998 | };
|
999 | this.currentVirtualData = virtualData;
|
1000 | this._activeSlides.next(virtualData.slides);
|
1001 | this._changeDetectorRef.detectChanges();
|
1002 | this.swiperRef.updateSlides();
|
1003 | this.swiperRef.updateProgress();
|
1004 | this.swiperRef.updateSlidesClasses();
|
1005 | if (this.swiperRef.lazy && this.swiperRef.params.lazy['enabled']) {
|
1006 | this.swiperRef.lazy.load();
|
1007 | }
|
1008 | this.swiperRef.virtual.update(true);
|
1009 | return;
|
1010 | };
|
1011 | SwiperComponent.prototype.ngOnChanges = function (changedParams) {
|
1012 | this.updateSwiper(changedParams);
|
1013 | this._changeDetectorRef.detectChanges();
|
1014 | };
|
1015 | SwiperComponent.prototype.updateInitSwiper = function (changedParams) {
|
1016 | if (!(changedParams && this.swiperRef && !this.swiperRef.destroyed)) {
|
1017 | return;
|
1018 | }
|
1019 | var _e = this.swiperRef, currentParams = _e.params, pagination = _e.pagination, navigation = _e.navigation, scrollbar = _e.scrollbar, virtual = _e.virtual, thumbs = _e.thumbs;
|
1020 | if (changedParams.pagination) {
|
1021 | if (this.pagination &&
|
1022 | typeof this.pagination !== 'boolean' &&
|
1023 | this.pagination.el &&
|
1024 | pagination &&
|
1025 | !pagination.el) {
|
1026 | this.updateParameter('pagination', this.pagination);
|
1027 | pagination.init();
|
1028 | pagination.render();
|
1029 | pagination.update();
|
1030 | }
|
1031 | else {
|
1032 | pagination.destroy();
|
1033 | pagination.el = null;
|
1034 | }
|
1035 | }
|
1036 | if (changedParams.scrollbar) {
|
1037 | if (this.scrollbar &&
|
1038 | typeof this.scrollbar !== 'boolean' &&
|
1039 | this.scrollbar.el &&
|
1040 | scrollbar &&
|
1041 | !scrollbar.el) {
|
1042 | this.updateParameter('scrollbar', this.scrollbar);
|
1043 | scrollbar.init();
|
1044 | scrollbar.updateSize();
|
1045 | scrollbar.setTranslate();
|
1046 | }
|
1047 | else {
|
1048 | scrollbar.destroy();
|
1049 | scrollbar.el = null;
|
1050 | }
|
1051 | }
|
1052 | if (changedParams.navigation) {
|
1053 | if (this.navigation &&
|
1054 | typeof this.navigation !== 'boolean' &&
|
1055 | this.navigation.prevEl &&
|
1056 | this.navigation.nextEl &&
|
1057 | navigation &&
|
1058 | !navigation.prevEl &&
|
1059 | !navigation.nextEl) {
|
1060 | this.updateParameter('navigation', this.navigation);
|
1061 | navigation.init();
|
1062 | navigation.update();
|
1063 | }
|
1064 | else if (navigation.prevEl && navigation.nextEl) {
|
1065 | navigation.destroy();
|
1066 | navigation.nextEl = null;
|
1067 | navigation.prevEl = null;
|
1068 | }
|
1069 | }
|
1070 | if (changedParams.thumbs && this.thumbs && this.thumbs.swiper) {
|
1071 | this.updateParameter('thumbs', this.thumbs);
|
1072 | var initialized = thumbs.init();
|
1073 | if (initialized)
|
1074 | thumbs.update(true);
|
1075 | }
|
1076 | if (changedParams.controller && this.controller && this.controller.control) {
|
1077 | this.swiperRef.controller.control = this.controller.control;
|
1078 | }
|
1079 | this.swiperRef.update();
|
1080 | };
|
1081 | SwiperComponent.prototype.updateSwiper = function (changedParams) {
|
1082 | var _a, _b;
|
1083 | if (changedParams.config) {
|
1084 | return;
|
1085 | }
|
1086 | if (!(changedParams && this.swiperRef && !this.swiperRef.destroyed)) {
|
1087 | return;
|
1088 | }
|
1089 | for (var key in changedParams) {
|
1090 | if (ignoreNgOnChanges.indexOf(key) >= 0) {
|
1091 | continue;
|
1092 | }
|
1093 | var newValue = (_b = (_a = changedParams[key]) === null || _a === void 0 ? void 0 : _a.currentValue) !== null && _b !== void 0 ? _b : changedParams[key];
|
1094 | this.updateParameter(key, newValue);
|
1095 | }
|
1096 | if (changedParams.allowSlideNext) {
|
1097 | this.swiperRef.allowSlideNext = this.allowSlideNext;
|
1098 | }
|
1099 | if (changedParams.allowSlidePrev) {
|
1100 | this.swiperRef.allowSlidePrev = this.allowSlidePrev;
|
1101 | }
|
1102 | if (changedParams.direction) {
|
1103 | this.swiperRef.changeDirection(this.direction, false);
|
1104 | }
|
1105 | if (changedParams.breakpoints) {
|
1106 | if (this.loop && !this.loopedSlides) {
|
1107 | this.calcLoopedSlides();
|
1108 | }
|
1109 | this.swiperRef.currentBreakpoint = null;
|
1110 | this.swiperRef.setBreakpoint();
|
1111 | }
|
1112 | this.swiperRef.update();
|
1113 | };
|
1114 | SwiperComponent.prototype.calcLoopedSlides = function () {
|
1115 | if (!this.loop) {
|
1116 | return;
|
1117 | }
|
1118 | var slidesPerViewParams = this.slidesPerView;
|
1119 | if (this.breakpoints) {
|
1120 | var breakpoint = Swiper__default['default'].prototype.getBreakpoint(this.breakpoints);
|
1121 | var breakpointOnlyParams = breakpoint in this.breakpoints ? this.breakpoints[breakpoint] : undefined;
|
1122 | if (breakpointOnlyParams && breakpointOnlyParams.slidesPerView) {
|
1123 | slidesPerViewParams = breakpointOnlyParams.slidesPerView;
|
1124 | }
|
1125 | }
|
1126 | if (slidesPerViewParams === 'auto') {
|
1127 | this.loopedSlides = this.slides.length;
|
1128 | return this.slides.length;
|
1129 | }
|
1130 | var loopedSlides = this.loopedSlides || slidesPerViewParams;
|
1131 | loopedSlides += this.loopAdditionalSlides;
|
1132 | if (loopedSlides > this.slides.length) {
|
1133 | loopedSlides = this.slides.length;
|
1134 | }
|
1135 | this.loopedSlides = loopedSlides;
|
1136 | return loopedSlides;
|
1137 | };
|
1138 | SwiperComponent.prototype.updateParameter = function (key, value) {
|
1139 | if (!(this.swiperRef && !this.swiperRef.destroyed)) {
|
1140 | return;
|
1141 | }
|
1142 | var _key = key.replace(/^_/, '');
|
1143 | if (Object.keys(this.swiperRef.modules).indexOf(_key) >= 0) {
|
1144 | extend(value, this.swiperRef.modules[_key].params[_key]);
|
1145 | }
|
1146 | if (isObject(this.swiperRef.params[_key]) && isObject(value)) {
|
1147 | extend(this.swiperRef.params[_key], value);
|
1148 | }
|
1149 | else {
|
1150 | this.swiperRef.params[_key] = value;
|
1151 | }
|
1152 | };
|
1153 | SwiperComponent.prototype.setIndex = function (index, speed, silent) {
|
1154 | var _this = this;
|
1155 | if (!this.isSwiperActive) {
|
1156 | this.initialSlide = index;
|
1157 | return;
|
1158 | }
|
1159 | if (index === this.swiperRef.activeIndex) {
|
1160 | return;
|
1161 | }
|
1162 | this.zone.runOutsideAngular(function () {
|
1163 | if (_this.loop) {
|
1164 | _this.swiperRef.slideToLoop(index, speed, !silent);
|
1165 | }
|
1166 | else {
|
1167 | _this.swiperRef.slideTo(index, speed, !silent);
|
1168 | }
|
1169 | });
|
1170 | };
|
1171 | SwiperComponent.prototype.ngOnDestroy = function () {
|
1172 | var _a;
|
1173 | (_a = this.swiperRef) === null || _a === void 0 ? void 0 : _a.destroy();
|
1174 | };
|
1175 | return SwiperComponent;
|
1176 | }());
|
1177 | SwiperComponent.decorators = [
|
1178 | { type: core.Component, args: [{
|
1179 | selector: 'swiper, [swiper]',
|
1180 | template: "<ng-content select=\"[slot=container-start]\"></ng-content>\n<ng-container *ngIf=\"navigation && showNavigation\">\n <div class=\"swiper-button-prev\" #prevElRef></div>\n <div class=\"swiper-button-next\" #nextElRef></div>\n</ng-container>\n<div *ngIf=\"scrollbar && showScrollbar\" class=\"swiper-scrollbar\" #scrollbarElRef></div>\n<div *ngIf=\"pagination && showPagination\" class=\"swiper-pagination\" #paginationElRef></div>\n<div [ngClass]=\"wrapperClass\">\n <ng-content select=\"[slot=wrapper-start]\"></ng-content>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: prependSlides,\n key: 'prepend'\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: activeSlides,\n key: ''\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: appendSlides,\n key: 'append'\n }\n \"\n ></ng-template>\n <ng-content select=\"[slot=wrapper-end]\"></ng-content>\n</div>\n<ng-content select=\"[slot=container-end]\"></ng-content>\n\n<ng-template #slidesTemplate let-loopSlides=\"loopSlides\" let-slideKey=\"key\">\n <div\n *ngFor=\"let slide of loopSlides | async\"\n [ngClass]=\"\n (slide.class ? slide.class + ' ' : '') +\n slideClass +\n (slideKey !== '' ? ' ' + slideDuplicateClass : '')\n \"\n [attr.data-swiper-slide-index]=\"slide.virtualIndex ? slide.virtualIndex : slide.slideIndex\"\n [style]=\"style\"\n [ngSwitch]=\"slide.zoom\"\n >\n <div *ngSwitchCase=\"true\" [ngClass]=\"zoomContainerClass\">\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </div>\n <ng-container *ngSwitchDefault>\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </ng-container>\n </div>\n</ng-template>\n",
|
1181 | changeDetection: core.ChangeDetectionStrategy.OnPush,
|
1182 | encapsulation: core.ViewEncapsulation.None,
|
1183 | styles: ["\n swiper {\n display: block;\n }\n "]
|
1184 | },] }
|
1185 | ];
|
1186 | SwiperComponent.ctorParameters = function () { return [
|
1187 | { type: core.NgZone },
|
1188 | { type: core.ElementRef },
|
1189 | { type: core.ChangeDetectorRef }
|
1190 | ]; };
|
1191 | SwiperComponent.propDecorators = {
|
1192 | init: [{ type: core.Input }],
|
1193 | direction: [{ type: core.Input }],
|
1194 | touchEventsTarget: [{ type: core.Input }],
|
1195 | initialSlide: [{ type: core.Input }],
|
1196 | speed: [{ type: core.Input }],
|
1197 | cssMode: [{ type: core.Input }],
|
1198 | updateOnWindowResize: [{ type: core.Input }],
|
1199 | nested: [{ type: core.Input }],
|
1200 | width: [{ type: core.Input }],
|
1201 | height: [{ type: core.Input }],
|
1202 | preventInteractionOnTransition: [{ type: core.Input }],
|
1203 | userAgent: [{ type: core.Input }],
|
1204 | url: [{ type: core.Input }],
|
1205 | edgeSwipeDetection: [{ type: core.Input }],
|
1206 | edgeSwipeThreshold: [{ type: core.Input }],
|
1207 | freeMode: [{ type: core.Input }],
|
1208 | freeModeMomentum: [{ type: core.Input }],
|
1209 | freeModeMomentumRatio: [{ type: core.Input }],
|
1210 | freeModeMomentumBounce: [{ type: core.Input }],
|
1211 | freeModeMomentumBounceRatio: [{ type: core.Input }],
|
1212 | freeModeMomentumVelocityRatio: [{ type: core.Input }],
|
1213 | freeModeSticky: [{ type: core.Input }],
|
1214 | freeModeMinimumVelocity: [{ type: core.Input }],
|
1215 | autoHeight: [{ type: core.Input }],
|
1216 | setWrapperSize: [{ type: core.Input }],
|
1217 | virtualTranslate: [{ type: core.Input }],
|
1218 | effect: [{ type: core.Input }],
|
1219 | breakpoints: [{ type: core.Input }],
|
1220 | spaceBetween: [{ type: core.Input }],
|
1221 | slidesPerView: [{ type: core.Input }],
|
1222 | slidesPerColumn: [{ type: core.Input }],
|
1223 | slidesPerColumnFill: [{ type: core.Input }],
|
1224 | slidesPerGroup: [{ type: core.Input }],
|
1225 | slidesPerGroupSkip: [{ type: core.Input }],
|
1226 | centeredSlides: [{ type: core.Input }],
|
1227 | centeredSlidesBounds: [{ type: core.Input }],
|
1228 | slidesOffsetBefore: [{ type: core.Input }],
|
1229 | slidesOffsetAfter: [{ type: core.Input }],
|
1230 | normalizeSlideIndex: [{ type: core.Input }],
|
1231 | centerInsufficientSlides: [{ type: core.Input }],
|
1232 | watchOverflow: [{ type: core.Input }],
|
1233 | roundLengths: [{ type: core.Input }],
|
1234 | touchRatio: [{ type: core.Input }],
|
1235 | touchAngle: [{ type: core.Input }],
|
1236 | simulateTouch: [{ type: core.Input }],
|
1237 | shortSwipes: [{ type: core.Input }],
|
1238 | longSwipes: [{ type: core.Input }],
|
1239 | longSwipesRatio: [{ type: core.Input }],
|
1240 | longSwipesMs: [{ type: core.Input }],
|
1241 | followFinger: [{ type: core.Input }],
|
1242 | allowTouchMove: [{ type: core.Input }],
|
1243 | threshold: [{ type: core.Input }],
|
1244 | touchMoveStopPropagation: [{ type: core.Input }],
|
1245 | touchStartPreventDefault: [{ type: core.Input }],
|
1246 | touchStartForcePreventDefault: [{ type: core.Input }],
|
1247 | touchReleaseOnEdges: [{ type: core.Input }],
|
1248 | uniqueNavElements: [{ type: core.Input }],
|
1249 | resistance: [{ type: core.Input }],
|
1250 | resistanceRatio: [{ type: core.Input }],
|
1251 | watchSlidesProgress: [{ type: core.Input }],
|
1252 | watchSlidesVisibility: [{ type: core.Input }],
|
1253 | grabCursor: [{ type: core.Input }],
|
1254 | preventClicks: [{ type: core.Input }],
|
1255 | preventClicksPropagation: [{ type: core.Input }],
|
1256 | slideToClickedSlide: [{ type: core.Input }],
|
1257 | preloadImages: [{ type: core.Input }],
|
1258 | updateOnImagesReady: [{ type: core.Input }],
|
1259 | loop: [{ type: core.Input }],
|
1260 | loopAdditionalSlides: [{ type: core.Input }],
|
1261 | loopedSlides: [{ type: core.Input }],
|
1262 | loopFillGroupWithBlank: [{ type: core.Input }],
|
1263 | loopPreventsSlide: [{ type: core.Input }],
|
1264 | allowSlidePrev: [{ type: core.Input }],
|
1265 | allowSlideNext: [{ type: core.Input }],
|
1266 | swipeHandler: [{ type: core.Input }],
|
1267 | noSwiping: [{ type: core.Input }],
|
1268 | noSwipingClass: [{ type: core.Input }],
|
1269 | noSwipingSelector: [{ type: core.Input }],
|
1270 | passiveListeners: [{ type: core.Input }],
|
1271 | containerModifierClass: [{ type: core.Input }],
|
1272 | slideClass: [{ type: core.Input }],
|
1273 | slideBlankClass: [{ type: core.Input }],
|
1274 | slideActiveClass: [{ type: core.Input }],
|
1275 | slideDuplicateActiveClass: [{ type: core.Input }],
|
1276 | slideVisibleClass: [{ type: core.Input }],
|
1277 | slideDuplicateClass: [{ type: core.Input }],
|
1278 | slideNextClass: [{ type: core.Input }],
|
1279 | slideDuplicateNextClass: [{ type: core.Input }],
|
1280 | slidePrevClass: [{ type: core.Input }],
|
1281 | slideDuplicatePrevClass: [{ type: core.Input }],
|
1282 | wrapperClass: [{ type: core.Input }],
|
1283 | runCallbacksOnInit: [{ type: core.Input }],
|
1284 | a11y: [{ type: core.Input }],
|
1285 | autoplay: [{ type: core.Input }],
|
1286 | controller: [{ type: core.Input }],
|
1287 | coverflowEffect: [{ type: core.Input }],
|
1288 | cubeEffect: [{ type: core.Input }],
|
1289 | fadeEffect: [{ type: core.Input }],
|
1290 | flipEffect: [{ type: core.Input }],
|
1291 | hashNavigation: [{ type: core.Input }],
|
1292 | history: [{ type: core.Input }],
|
1293 | keyboard: [{ type: core.Input }],
|
1294 | lazy: [{ type: core.Input }],
|
1295 | mousewheel: [{ type: core.Input }],
|
1296 | parallax: [{ type: core.Input }],
|
1297 | thumbs: [{ type: core.Input }],
|
1298 | zoom: [{ type: core.Input }],
|
1299 | navigation: [{ type: core.Input }],
|
1300 | pagination: [{ type: core.Input }],
|
1301 | scrollbar: [{ type: core.Input }],
|
1302 | virtual: [{ type: core.Input }],
|
1303 | index: [{ type: core.Input }],
|
1304 | config: [{ type: core.Input }],
|
1305 | s__beforeBreakpoint: [{ type: core.Output, args: ['_beforeBreakpoint',] }],
|
1306 | s__containerClasses: [{ type: core.Output, args: ['_containerClasses',] }],
|
1307 | s__slideClass: [{ type: core.Output, args: ['_slideClass',] }],
|
1308 | s__swiper: [{ type: core.Output, args: ['_swiper',] }],
|
1309 | s_activeIndexChange: [{ type: core.Output, args: ['activeIndexChange',] }],
|
1310 | s_afterInit: [{ type: core.Output, args: ['afterInit',] }],
|
1311 | s_autoplay: [{ type: core.Output, args: ['autoplay',] }],
|
1312 | s_autoplayStart: [{ type: core.Output, args: ['autoplayStart',] }],
|
1313 | s_autoplayStop: [{ type: core.Output, args: ['autoplayStop',] }],
|
1314 | s_beforeDestroy: [{ type: core.Output, args: ['beforeDestroy',] }],
|
1315 | s_beforeInit: [{ type: core.Output, args: ['beforeInit',] }],
|
1316 | s_beforeLoopFix: [{ type: core.Output, args: ['beforeLoopFix',] }],
|
1317 | s_beforeResize: [{ type: core.Output, args: ['beforeResize',] }],
|
1318 | s_beforeSlideChangeStart: [{ type: core.Output, args: ['beforeSlideChangeStart',] }],
|
1319 | s_beforeTransitionStart: [{ type: core.Output, args: ['beforeTransitionStart',] }],
|
1320 | s_breakpoint: [{ type: core.Output, args: ['breakpoint',] }],
|
1321 | s_changeDirection: [{ type: core.Output, args: ['changeDirection',] }],
|
1322 | s_click: [{ type: core.Output, args: ['click',] }],
|
1323 | s_doubleTap: [{ type: core.Output, args: ['doubleTap',] }],
|
1324 | s_doubleClick: [{ type: core.Output, args: ['doubleClick',] }],
|
1325 | s_destroy: [{ type: core.Output, args: ['destroy',] }],
|
1326 | s_fromEdge: [{ type: core.Output, args: ['fromEdge',] }],
|
1327 | s_hashChange: [{ type: core.Output, args: ['hashChange',] }],
|
1328 | s_hashSet: [{ type: core.Output, args: ['hashSet',] }],
|
1329 | s_imagesReady: [{ type: core.Output, args: ['imagesReady',] }],
|
1330 | s_init: [{ type: core.Output, args: ['init',] }],
|
1331 | s_keyPress: [{ type: core.Output, args: ['keyPress',] }],
|
1332 | s_lazyImageLoad: [{ type: core.Output, args: ['lazyImageLoad',] }],
|
1333 | s_lazyImageReady: [{ type: core.Output, args: ['lazyImageReady',] }],
|
1334 | s_loopFix: [{ type: core.Output, args: ['loopFix',] }],
|
1335 | s_momentumBounce: [{ type: core.Output, args: ['momentumBounce',] }],
|
1336 | s_navigationHide: [{ type: core.Output, args: ['navigationHide',] }],
|
1337 | s_navigationShow: [{ type: core.Output, args: ['navigationShow',] }],
|
1338 | s_observerUpdate: [{ type: core.Output, args: ['observerUpdate',] }],
|
1339 | s_orientationchange: [{ type: core.Output, args: ['orientationchange',] }],
|
1340 | s_paginationHide: [{ type: core.Output, args: ['paginationHide',] }],
|
1341 | s_paginationRender: [{ type: core.Output, args: ['paginationRender',] }],
|
1342 | s_paginationShow: [{ type: core.Output, args: ['paginationShow',] }],
|
1343 | s_paginationUpdate: [{ type: core.Output, args: ['paginationUpdate',] }],
|
1344 | s_progress: [{ type: core.Output, args: ['progress',] }],
|
1345 | s_reachBeginning: [{ type: core.Output, args: ['reachBeginning',] }],
|
1346 | s_reachEnd: [{ type: core.Output, args: ['reachEnd',] }],
|
1347 | s_realIndexChange: [{ type: core.Output, args: ['realIndexChange',] }],
|
1348 | s_resize: [{ type: core.Output, args: ['resize',] }],
|
1349 | s_scroll: [{ type: core.Output, args: ['scroll',] }],
|
1350 | s_scrollbarDragEnd: [{ type: core.Output, args: ['scrollbarDragEnd',] }],
|
1351 | s_scrollbarDragMove: [{ type: core.Output, args: ['scrollbarDragMove',] }],
|
1352 | s_scrollbarDragStart: [{ type: core.Output, args: ['scrollbarDragStart',] }],
|
1353 | s_setTransition: [{ type: core.Output, args: ['setTransition',] }],
|
1354 | s_setTranslate: [{ type: core.Output, args: ['setTranslate',] }],
|
1355 | s_slideChange: [{ type: core.Output, args: ['slideChange',] }],
|
1356 | s_slideChangeTransitionEnd: [{ type: core.Output, args: ['slideChangeTransitionEnd',] }],
|
1357 | s_slideChangeTransitionStart: [{ type: core.Output, args: ['slideChangeTransitionStart',] }],
|
1358 | s_slideNextTransitionEnd: [{ type: core.Output, args: ['slideNextTransitionEnd',] }],
|
1359 | s_slideNextTransitionStart: [{ type: core.Output, args: ['slideNextTransitionStart',] }],
|
1360 | s_slidePrevTransitionEnd: [{ type: core.Output, args: ['slidePrevTransitionEnd',] }],
|
1361 | s_slidePrevTransitionStart: [{ type: core.Output, args: ['slidePrevTransitionStart',] }],
|
1362 | s_slideResetTransitionStart: [{ type: core.Output, args: ['slideResetTransitionStart',] }],
|
1363 | s_slideResetTransitionEnd: [{ type: core.Output, args: ['slideResetTransitionEnd',] }],
|
1364 | s_sliderMove: [{ type: core.Output, args: ['sliderMove',] }],
|
1365 | s_sliderFirstMove: [{ type: core.Output, args: ['sliderFirstMove',] }],
|
1366 | s_slidesLengthChange: [{ type: core.Output, args: ['slidesLengthChange',] }],
|
1367 | s_slidesGridLengthChange: [{ type: core.Output, args: ['slidesGridLengthChange',] }],
|
1368 | s_snapGridLengthChange: [{ type: core.Output, args: ['snapGridLengthChange',] }],
|
1369 | s_snapIndexChange: [{ type: core.Output, args: ['snapIndexChange',] }],
|
1370 | s_tap: [{ type: core.Output, args: ['tap',] }],
|
1371 | s_toEdge: [{ type: core.Output, args: ['toEdge',] }],
|
1372 | s_touchEnd: [{ type: core.Output, args: ['touchEnd',] }],
|
1373 | s_touchMove: [{ type: core.Output, args: ['touchMove',] }],
|
1374 | s_touchMoveOpposite: [{ type: core.Output, args: ['touchMoveOpposite',] }],
|
1375 | s_touchStart: [{ type: core.Output, args: ['touchStart',] }],
|
1376 | s_transitionEnd: [{ type: core.Output, args: ['transitionEnd',] }],
|
1377 | s_transitionStart: [{ type: core.Output, args: ['transitionStart',] }],
|
1378 | s_update: [{ type: core.Output, args: ['update',] }],
|
1379 | s_zoomChange: [{ type: core.Output, args: ['zoomChange',] }],
|
1380 | s_swiper: [{ type: core.Output, args: ['swiper',] }],
|
1381 | indexChange: [{ type: core.Output }],
|
1382 | prevElRef: [{ type: core.ViewChild, args: ['prevElRef', { static: false },] }],
|
1383 | nextElRef: [{ type: core.ViewChild, args: ['nextElRef', { static: false },] }],
|
1384 | scrollbarElRef: [{ type: core.ViewChild, args: ['scrollbarElRef', { static: false },] }],
|
1385 | paginationElRef: [{ type: core.ViewChild, args: ['paginationElRef', { static: false },] }],
|
1386 | slidesEl: [{ type: core.ContentChildren, args: [SwiperSlideDirective, { descendants: true, emitDistinctChangesOnly: true },] }],
|
1387 | containerClasses: [{ type: core.HostBinding, args: ['class',] }]
|
1388 | };
|
1389 |
|
1390 | var SwiperModule = (function () {
|
1391 | function SwiperModule() {
|
1392 | }
|
1393 | return SwiperModule;
|
1394 | }());
|
1395 | SwiperModule.decorators = [
|
1396 | { type: core.NgModule, args: [{
|
1397 | declarations: [SwiperComponent, SwiperSlideDirective],
|
1398 | exports: [SwiperComponent, SwiperSlideDirective],
|
1399 | imports: [common.CommonModule],
|
1400 | },] }
|
1401 | ];
|
1402 |
|
1403 | |
1404 |
|
1405 |
|
1406 |
|
1407 | |
1408 |
|
1409 |
|
1410 |
|
1411 | exports.SwiperComponent = SwiperComponent;
|
1412 | exports.SwiperModule = SwiperModule;
|
1413 | exports.SwiperSlideDirective = SwiperSlideDirective;
|
1414 |
|
1415 | Object.defineProperty(exports, '__esModule', { value: true });
|
1416 |
|
1417 | })));
|
1418 |
|