swiper_angular.js 59 KB

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