ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 68.6 kB
Source Map (JSON)
{"version":3,"file":"ng-zorro-antd-carousel.mjs","sources":["../../components/carousel/carousel-content.directive.ts","../../components/carousel/strategies/base-strategy.ts","../../components/carousel/strategies/opacity-strategy.ts","../../components/carousel/strategies/transform-strategy.ts","../../components/carousel/typings.ts","../../components/carousel/carousel.component.ts","../../components/carousel/carousel.module.ts","../../components/carousel/strategies/experimental/transform-no-loop-strategy.ts","../../components/carousel/strategies/experimental/flip-strategy.ts","../../components/carousel/public-api.ts","../../components/carousel/ng-zorro-antd-carousel.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, ElementRef, Renderer2 } from '@angular/core';\n\n@Directive({\n selector: '[nz-carousel-content]',\n exportAs: 'nzCarouselContent',\n host: {\n class: 'slick-slide'\n }\n})\nexport class NzCarouselContentDirective {\n readonly el: HTMLElement;\n\n set isActive(value: boolean) {\n this._active = value;\n if (this.isActive) {\n this.renderer.addClass(this.el, 'slick-active');\n } else {\n this.renderer.removeClass(this.el, 'slick-active');\n }\n }\n\n get isActive(): boolean {\n return this._active;\n }\n\n private _active = false;\n\n constructor(\n elementRef: ElementRef,\n private renderer: Renderer2\n ) {\n this.el = elementRef.nativeElement;\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Platform } from '@angular/cdk/platform';\nimport { ChangeDetectorRef, QueryList, Renderer2 } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzCarouselContentDirective } from '../carousel-content.directive';\nimport { FromToInterface, NzCarouselComponentAsSource, PointerVector } from '../typings';\n\nexport abstract class NzCarouselBaseStrategy<T = NzSafeAny> {\n // Properties that strategies may want to use.\n protected carouselComponent: NzCarouselComponentAsSource | null;\n protected contents!: NzCarouselContentDirective[];\n protected slickListEl!: HTMLElement;\n protected slickTrackEl!: HTMLElement;\n protected length!: number;\n protected unitWidth!: number;\n protected unitHeight!: number;\n\n protected get maxIndex(): number {\n return this.length - 1;\n }\n\n protected get firstEl(): HTMLElement {\n return this.contents[0].el;\n }\n\n protected get lastEl(): HTMLElement {\n return this.contents[this.maxIndex].el;\n }\n\n constructor(\n carouselComponent: NzCarouselComponentAsSource,\n protected cdr: ChangeDetectorRef,\n protected renderer: Renderer2,\n protected platform: Platform,\n protected options?: T\n ) {\n this.carouselComponent = carouselComponent;\n }\n\n /**\n * Initialize dragging sequences.\n *\n * @param contents\n */\n withCarouselContents(contents: QueryList<NzCarouselContentDirective> | null): void {\n const carousel = this.carouselComponent!;\n this.slickListEl = carousel.slickListEl;\n this.slickTrackEl = carousel.slickTrackEl;\n this.contents = contents?.toArray() || [];\n this.length = this.contents.length;\n\n if (this.platform.isBrowser) {\n const rect = carousel.el.getBoundingClientRect();\n this.unitWidth = rect.width;\n this.unitHeight = rect.height;\n } else {\n // Since we cannot call getBoundingClientRect in server, we just hide all items except for the first one.\n contents?.forEach((content, index) => {\n if (index === 0) {\n this.renderer.setStyle(content.el, 'width', '100%');\n } else {\n this.renderer.setStyle(content.el, 'display', 'none');\n }\n });\n }\n }\n\n /**\n * Trigger transition.\n */\n abstract switch(_f: number, _t: number): Observable<void>;\n\n /**\n * When user drag the carousel component.\n *\n * @optional\n */\n dragging(_vector: PointerVector): void {}\n\n /**\n * Destroy a scroll strategy.\n */\n dispose(): void {}\n\n protected getFromToInBoundary(f: number, t: number): FromToInterface {\n const length = this.maxIndex + 1;\n return { from: (f + length) % length, to: (t + length) % length };\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { QueryList } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { NzCarouselContentDirective } from '../carousel-content.directive';\nimport { NzCarouselBaseStrategy } from './base-strategy';\n\nexport class NzCarouselOpacityStrategy extends NzCarouselBaseStrategy {\n override withCarouselContents(contents: QueryList<NzCarouselContentDirective> | null): void {\n super.withCarouselContents(contents);\n\n if (this.contents) {\n this.slickTrackEl.style.width = `${this.length * this.unitWidth}px`;\n\n this.contents.forEach((content: NzCarouselContentDirective, i: number) => {\n this.renderer.setStyle(content.el, 'opacity', this.carouselComponent!.activeIndex === i ? '1' : '0');\n this.renderer.setStyle(content.el, 'position', 'relative');\n this.renderer.setStyle(content.el, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(content.el, 'left', `${-this.unitWidth * i}px`);\n this.renderer.setStyle(content.el, 'transition', ['opacity 500ms ease 0s', 'visibility 500ms ease 0s']);\n });\n }\n }\n\n switch(_f: number, _t: number): Observable<void> {\n const { to: t } = this.getFromToInBoundary(_f, _t);\n const complete$ = new Subject<void>();\n\n this.contents.forEach((content: NzCarouselContentDirective, i: number) => {\n this.renderer.setStyle(content.el, 'opacity', t === i ? '1' : '0');\n });\n\n setTimeout(() => {\n complete$.next();\n complete$.complete();\n }, this.carouselComponent!.nzTransitionSpeed);\n\n return complete$;\n }\n\n override dispose(): void {\n this.contents.forEach((content: NzCarouselContentDirective) => {\n this.renderer.setStyle(content.el, 'transition', null);\n this.renderer.setStyle(content.el, 'opacity', null);\n this.renderer.setStyle(content.el, 'width', null);\n this.renderer.setStyle(content.el, 'left', null);\n });\n\n super.dispose();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Platform } from '@angular/cdk/platform';\nimport { ChangeDetectorRef, QueryList, Renderer2 } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { NzCarouselContentDirective } from '../carousel-content.directive';\nimport { NzCarouselComponentAsSource, PointerVector } from '../typings';\nimport { NzCarouselBaseStrategy } from './base-strategy';\n\ninterface NzCarouselTransformStrategyOptions {\n direction: 'left' | 'right';\n}\n\nexport class NzCarouselTransformStrategy extends NzCarouselBaseStrategy<NzCarouselTransformStrategyOptions> {\n private isDragging = false;\n private isTransitioning = false;\n\n private get vertical(): boolean {\n return this.carouselComponent!.vertical;\n }\n\n constructor(\n carouselComponent: NzCarouselComponentAsSource,\n cdr: ChangeDetectorRef,\n renderer: Renderer2,\n platform: Platform,\n options?: NzCarouselTransformStrategyOptions\n ) {\n super(carouselComponent, cdr, renderer, platform, options);\n }\n\n override dispose(): void {\n super.dispose();\n this.renderer.setStyle(this.slickTrackEl, 'transform', null);\n }\n\n override withCarouselContents(contents: QueryList<NzCarouselContentDirective> | null): void {\n super.withCarouselContents(contents);\n\n const carousel = this.carouselComponent!;\n const activeIndex = carousel.activeIndex;\n\n // We only do when we are in browser.\n if (this.platform.isBrowser && this.contents.length) {\n this.renderer.setStyle(this.slickListEl, 'height', `${this.unitHeight}px`);\n\n if (this.vertical) {\n this.renderer.setStyle(this.slickTrackEl, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(this.slickTrackEl, 'height', `${this.length * this.unitHeight}px`);\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(0, ${-activeIndex * this.unitHeight}px, 0)`\n );\n } else {\n this.renderer.setStyle(this.slickTrackEl, 'height', `${this.unitHeight}px`);\n this.renderer.setStyle(this.slickTrackEl, 'width', `${this.length * this.unitWidth}px`);\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(${-activeIndex * this.unitWidth}px, 0, 0)`);\n }\n\n this.contents.forEach((content: NzCarouselContentDirective) => {\n this.renderer.setStyle(content.el, 'position', 'relative');\n this.renderer.setStyle(content.el, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(content.el, 'height', `${this.unitHeight}px`);\n });\n }\n }\n\n switch(_f: number, _t: number): Observable<void> {\n const { to: t } = this.getFromToInBoundary(_f, _t);\n const complete$ = new Subject<void>();\n\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transition',\n `transform ${this.carouselComponent!.nzTransitionSpeed}ms ease`\n );\n\n if (this.vertical) {\n this.verticalTransform(_f, _t);\n } else {\n this.horizontalTransform(_f, _t);\n }\n\n this.isTransitioning = true;\n this.isDragging = false;\n\n // TODO: use transitionEnd event instead of setTimeout\n setTimeout(() => {\n this.renderer.setStyle(this.slickTrackEl, 'transition', null);\n this.contents.forEach((content: NzCarouselContentDirective) => {\n this.renderer.setStyle(content.el, this.vertical ? 'top' : 'left', null);\n });\n\n if (this.vertical) {\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(0, ${-t * this.unitHeight}px, 0)`);\n } else {\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(${-t * this.unitWidth}px, 0, 0)`);\n }\n\n this.isTransitioning = false;\n\n complete$.next();\n complete$.complete();\n }, this.carouselComponent!.nzTransitionSpeed);\n\n return complete$.asObservable();\n }\n\n override dragging(_vector: PointerVector): void {\n if (this.isTransitioning) {\n return;\n }\n\n const activeIndex = this.carouselComponent!.activeIndex;\n\n if (this.carouselComponent!.vertical) {\n if (!this.isDragging && this.length > 2) {\n if (activeIndex === this.maxIndex) {\n this.prepareVerticalContext(true);\n } else if (activeIndex === 0) {\n this.prepareVerticalContext(false);\n }\n }\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(0, ${-activeIndex * this.unitHeight + _vector.x}px, 0)`\n );\n } else {\n if (!this.isDragging && this.length > 2) {\n if (activeIndex === this.maxIndex) {\n this.prepareHorizontalContext(true);\n } else if (activeIndex === 0) {\n this.prepareHorizontalContext(false);\n }\n }\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(${-activeIndex * this.unitWidth + _vector.x}px, 0, 0)`\n );\n }\n\n this.isDragging = true;\n }\n\n private verticalTransform(_f: number, _t: number): void {\n const { from: f, to: t } = this.getFromToInBoundary(_f, _t);\n const needToAdjust = this.length > 2 && _t !== t;\n\n if (needToAdjust) {\n this.prepareVerticalContext(t < f);\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(0, ${-_t * this.unitHeight}px, 0)`);\n } else {\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(0, ${-t * this.unitHeight}px, 0`);\n }\n }\n\n private horizontalTransform(_f: number, _t: number): void {\n const { from: f, to: t } = this.getFromToInBoundary(_f, _t);\n const needToAdjust = this.length > 2 && _t !== t;\n\n if (needToAdjust) {\n this.prepareHorizontalContext(t < f);\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(${-_t * this.unitWidth}px, 0, 0)`);\n } else {\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(${-t * this.unitWidth}px, 0, 0`);\n }\n }\n\n private prepareVerticalContext(lastToFirst: boolean): void {\n if (lastToFirst) {\n this.renderer.setStyle(this.firstEl, 'top', `${this.length * this.unitHeight}px`);\n this.renderer.setStyle(this.lastEl, 'top', null);\n } else {\n this.renderer.setStyle(this.firstEl, 'top', null);\n this.renderer.setStyle(this.lastEl, 'top', `${-this.unitHeight * this.length}px`);\n }\n }\n\n private prepareHorizontalContext(lastToFirst: boolean): void {\n if (lastToFirst) {\n this.renderer.setStyle(this.firstEl, 'left', `${this.length * this.unitWidth}px`);\n this.renderer.setStyle(this.lastEl, 'left', null);\n } else {\n this.renderer.setStyle(this.firstEl, 'left', null);\n this.renderer.setStyle(this.lastEl, 'left', `${-this.unitWidth * this.length}px`);\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction } from '@angular/cdk/bidi';\nimport { InjectionToken, NgZone, QueryList } from '@angular/core';\n\nimport { NzCarouselContentDirective } from './carousel-content.directive';\nimport { NzCarouselBaseStrategy } from './strategies/base-strategy';\n\nexport type NzCarouselEffects = 'fade' | 'scrollx' | string;\nexport type NzCarouselDotPosition = 'top' | 'bottom' | 'left' | 'right' | string;\n\nexport interface NzCarouselComponentAsSource {\n carouselContents: QueryList<NzCarouselContentDirective>;\n el: HTMLElement;\n nzTransitionSpeed: number;\n vertical: boolean;\n slickListEl: HTMLElement;\n slickTrackEl: HTMLElement;\n activeIndex: number;\n dir: Direction;\n ngZone: NgZone;\n}\n\nexport interface NzCarouselStrategyRegistryItem {\n name: string;\n strategy: NzCarouselBaseStrategy;\n}\n\nexport const NZ_CAROUSEL_CUSTOM_STRATEGIES = new InjectionToken<NzCarouselStrategyRegistryItem[]>(\n 'nz-carousel-custom-strategies'\n);\n\nexport interface PointerVector {\n x: number;\n y: number;\n}\n\nexport interface FromToInterface {\n from: number;\n to: number;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport { LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes';\nimport { Platform } from '@angular/cdk/platform';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n Renderer2,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n numberAttribute\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\nimport { NzResizeObserver } from 'ng-zorro-antd/cdk/resize-observer';\nimport { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';\nimport { NzDragService, NzResizeService } from 'ng-zorro-antd/core/services';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { fromEventOutsideAngular } from 'ng-zorro-antd/core/util';\n\nimport { NzCarouselContentDirective } from './carousel-content.directive';\nimport { NzCarouselBaseStrategy } from './strategies/base-strategy';\nimport { NzCarouselOpacityStrategy } from './strategies/opacity-strategy';\nimport { NzCarouselTransformStrategy } from './strategies/transform-strategy';\nimport {\n FromToInterface,\n NZ_CAROUSEL_CUSTOM_STRATEGIES,\n NzCarouselDotPosition,\n NzCarouselEffects,\n PointerVector\n} from './typings';\n\nconst NZ_CONFIG_MODULE_NAME: NzConfigKey = 'carousel';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'nz-carousel',\n exportAs: 'nzCarousel',\n preserveWhitespaces: false,\n template: `\n <div\n class=\"slick-initialized slick-slider\"\n [class.slick-vertical]=\"nzDotPosition === 'left' || nzDotPosition === 'right'\"\n [dir]=\"'ltr'\"\n >\n <div\n #slickList\n class=\"slick-list\"\n tabindex=\"-1\"\n (mousedown)=\"pointerDown($event)\"\n (touchstart)=\"pointerDown($event)\"\n >\n <!-- Render carousel items. -->\n <div class=\"slick-track\" #slickTrack>\n <ng-content></ng-content>\n </div>\n </div>\n <!-- Render dots. -->\n @if (nzDots) {\n <ul\n class=\"slick-dots\"\n [class.slick-dots-top]=\"nzDotPosition === 'top'\"\n [class.slick-dots-bottom]=\"nzDotPosition === 'bottom'\"\n [class.slick-dots-left]=\"nzDotPosition === 'left'\"\n [class.slick-dots-right]=\"nzDotPosition === 'right'\"\n >\n @for (content of carouselContents; track content) {\n <li [class.slick-active]=\"$index === activeIndex\" (click)=\"goTo($index)\">\n <ng-template\n [ngTemplateOutlet]=\"nzDotRender || renderDotTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: $index }\"\n ></ng-template>\n </li>\n }\n </ul>\n }\n </div>\n\n <ng-template #renderDotTemplate let-index>\n <button>{{ index + 1 }}</button>\n </ng-template>\n `,\n host: {\n class: 'ant-carousel',\n '[class.ant-carousel-vertical]': 'vertical',\n '[class.ant-carousel-rtl]': `dir === 'rtl'`\n },\n imports: [NgTemplateOutlet]\n})\nexport class NzCarouselComponent implements AfterContentInit, AfterViewInit, OnDestroy, OnChanges, OnInit {\n readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;\n\n @ContentChildren(NzCarouselContentDirective) carouselContents!: QueryList<NzCarouselContentDirective>;\n\n @ViewChild('slickList', { static: true }) slickList!: ElementRef<HTMLElement>;\n @ViewChild('slickTrack', { static: true }) slickTrack!: ElementRef<HTMLElement>;\n\n @Input() nzDotRender?: TemplateRef<{ $implicit: number }>;\n @Input() @WithConfig() nzEffect: NzCarouselEffects = 'scrollx';\n @Input({ transform: booleanAttribute }) @WithConfig() nzEnableSwipe: boolean = true;\n @Input({ transform: booleanAttribute }) @WithConfig() nzDots: boolean = true;\n @Input({ transform: booleanAttribute }) @WithConfig() nzAutoPlay: boolean = false;\n @Input({ transform: numberAttribute }) @WithConfig() nzAutoPlaySpeed: number = 3000;\n @Input({ transform: numberAttribute }) nzTransitionSpeed = 500;\n @Input() @WithConfig() nzLoop: boolean = true;\n\n /**\n * this property is passed directly to an NzCarouselBaseStrategy\n */\n @Input() nzStrategyOptions: NzSafeAny = undefined;\n\n @Input()\n // @ts-ignore\n @WithConfig()\n set nzDotPosition(value: NzCarouselDotPosition) {\n this._dotPosition = value;\n this.vertical = value === 'left' || value === 'right';\n }\n\n get nzDotPosition(): NzCarouselDotPosition {\n return this._dotPosition;\n }\n\n private _dotPosition: NzCarouselDotPosition = 'bottom';\n\n @Output() readonly nzBeforeChange = new EventEmitter<FromToInterface>();\n @Output() readonly nzAfterChange = new EventEmitter<number>();\n\n activeIndex = 0;\n el: HTMLElement;\n slickListEl!: HTMLElement;\n slickTrackEl!: HTMLElement;\n strategy?: NzCarouselBaseStrategy;\n vertical = false;\n transitionInProgress?: ReturnType<typeof setTimeout>;\n dir: Direction = 'ltr';\n\n private destroy$ = new Subject<void>();\n private gestureRect: ClientRect | null = null;\n private pointerDelta: PointerVector | null = null;\n private isTransiting = false;\n private isDragging = false;\n private directionality = inject(Directionality);\n private customStrategies = inject(NZ_CAROUSEL_CUSTOM_STRATEGIES, { optional: true });\n\n constructor(\n elementRef: ElementRef,\n public readonly nzConfigService: NzConfigService,\n public readonly ngZone: NgZone,\n private readonly renderer: Renderer2,\n private readonly cdr: ChangeDetectorRef,\n private readonly platform: Platform,\n private readonly resizeService: NzResizeService,\n private readonly nzDragService: NzDragService,\n private nzResizeObserver: NzResizeObserver\n ) {\n this.nzDotPosition = 'bottom';\n this.el = elementRef.nativeElement;\n }\n ngOnInit(): void {\n this.slickListEl = this.slickList!.nativeElement;\n this.slickTrackEl = this.slickTrack!.nativeElement;\n\n this.dir = this.directionality.value;\n\n this.directionality.change.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n this.markContentActive(this.activeIndex);\n this.cdr.detectChanges();\n });\n\n fromEventOutsideAngular<KeyboardEvent>(this.slickListEl, 'keydown')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => {\n const { keyCode } = event;\n\n if (keyCode !== LEFT_ARROW && keyCode !== RIGHT_ARROW) {\n return;\n }\n\n event.preventDefault();\n\n this.ngZone.run(() => {\n if (keyCode === LEFT_ARROW) {\n this.pre();\n } else {\n this.next();\n }\n this.cdr.markForCheck();\n });\n });\n\n this.nzResizeObserver\n .observe(this.el)\n .pipe(debounceTime(100), distinctUntilChanged(), takeUntil(this.destroy$))\n .subscribe(() => {\n this.layout();\n });\n }\n\n ngAfterContentInit(): void {\n this.markContentActive(0);\n }\n\n ngAfterViewInit(): void {\n this.carouselContents.changes.subscribe(() => {\n this.markContentActive(0);\n this.layout();\n });\n\n this.resizeService\n .subscribe()\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.layout();\n });\n\n this.switchStrategy();\n this.markContentActive(0);\n this.layout();\n\n // If embedded in an entry component, it may do initial render at an inappropriate time.\n // ngZone.onStable won't do this trick\n // TODO: need to change this.\n Promise.resolve().then(() => {\n this.layout();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { nzEffect, nzDotPosition } = changes;\n\n if (nzEffect && !nzEffect.isFirstChange()) {\n this.switchStrategy();\n this.markContentActive(0);\n this.layout();\n }\n\n if (nzDotPosition && !nzDotPosition.isFirstChange()) {\n this.switchStrategy();\n this.markContentActive(0);\n this.layout();\n }\n\n if (!this.nzAutoPlay || !this.nzAutoPlaySpeed) {\n this.clearScheduledTransition();\n } else {\n this.scheduleNextTransition();\n }\n }\n\n ngOnDestroy(): void {\n this.clearScheduledTransition();\n if (this.strategy) {\n this.strategy.dispose();\n }\n\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n next(): void {\n this.goTo(this.activeIndex + 1);\n }\n\n pre(): void {\n this.goTo(this.activeIndex - 1);\n }\n\n goTo(index: number): void {\n if (\n this.carouselContents &&\n this.carouselContents.length &&\n !this.isTransiting &&\n (this.nzLoop || (index >= 0 && index < this.carouselContents.length))\n ) {\n const length = this.carouselContents.length;\n const from = this.activeIndex;\n const to = (index + length) % length;\n this.isTransiting = true;\n this.nzBeforeChange.emit({ from, to });\n this.strategy!.switch(this.activeIndex, index).subscribe(() => {\n this.scheduleNextTransition();\n this.nzAfterChange.emit(to);\n this.isTransiting = false;\n });\n this.markContentActive(to);\n this.cdr.markForCheck();\n }\n }\n\n private switchStrategy(): void {\n if (this.strategy) {\n this.strategy.dispose();\n }\n\n // Load custom strategies first.\n const customStrategy = this.customStrategies ? this.customStrategies.find(s => s.name === this.nzEffect) : null;\n if (customStrategy) {\n this.strategy = new (customStrategy.strategy as NzSafeAny)(this, this.cdr, this.renderer, this.platform);\n return;\n }\n\n this.strategy =\n this.nzEffect === 'scrollx'\n ? new NzCarouselTransformStrategy(this, this.cdr, this.renderer, this.platform)\n : new NzCarouselOpacityStrategy(this, this.cdr, this.renderer, this.platform);\n }\n\n private scheduleNextTransition(): void {\n this.clearScheduledTransition();\n if (this.nzAutoPlay && this.nzAutoPlaySpeed > 0 && this.platform.isBrowser) {\n this.transitionInProgress = setTimeout(() => {\n this.goTo(this.activeIndex + 1);\n }, this.nzAutoPlaySpeed);\n }\n }\n\n private clearScheduledTransition(): void {\n if (this.transitionInProgress) {\n clearTimeout(this.transitionInProgress);\n this.transitionInProgress = undefined;\n }\n }\n\n private markContentActive(index: number): void {\n this.activeIndex = index;\n\n if (this.carouselContents) {\n this.carouselContents.forEach((slide, i) => {\n slide.isActive = index === i;\n });\n }\n\n this.cdr.markForCheck();\n }\n\n /**\n * Drag carousel.\n */\n pointerDown = (event: TouchEvent | MouseEvent): void => {\n if (!this.isDragging && !this.isTransiting && this.nzEnableSwipe) {\n this.clearScheduledTransition();\n this.gestureRect = this.slickListEl.getBoundingClientRect();\n\n this.nzDragService.requestDraggingSequence(event).subscribe(\n delta => {\n this.pointerDelta = delta;\n this.isDragging = true;\n this.strategy?.dragging(this.pointerDelta);\n },\n () => {},\n () => {\n if (this.nzEnableSwipe && this.isDragging) {\n const xDelta = this.pointerDelta ? this.pointerDelta.x : 0;\n\n // Switch to another slide if delta is bigger than third of the width.\n if (\n Math.abs(xDelta) > this.gestureRect!.width / 3 &&\n (this.nzLoop ||\n (xDelta <= 0 && this.activeIndex + 1 < this.carouselContents.length) ||\n (xDelta > 0 && this.activeIndex > 0))\n ) {\n this.goTo(xDelta > 0 ? this.activeIndex - 1 : this.activeIndex + 1);\n } else {\n this.goTo(this.activeIndex);\n }\n\n this.gestureRect = null;\n this.pointerDelta = null;\n }\n\n this.isDragging = false;\n }\n );\n }\n };\n\n layout(): void {\n if (this.strategy) {\n this.strategy.withCarouselContents(this.carouselContents);\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NzCarouselContentDirective } from './carousel-content.directive';\nimport { NzCarouselComponent } from './carousel.component';\n\n@NgModule({\n imports: [NzCarouselComponent, NzCarouselContentDirective],\n exports: [NzCarouselComponent, NzCarouselContentDirective]\n})\nexport class NzCarouselModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Platform } from '@angular/cdk/platform';\nimport { ChangeDetectorRef, QueryList, Renderer2 } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nimport { NzCarouselContentDirective } from '../../carousel-content.directive';\nimport { NzCarouselComponentAsSource, PointerVector } from '../../typings';\nimport { NzCarouselBaseStrategy } from '../base-strategy';\n\ninterface NzCarouselTransformOnLoopStrategyOptions {\n direction: 'left' | 'right';\n}\n\n/**\n * this strategy is very much like NzCarouselTransformStrategy, but it doesn't loop between the first and the last one\n */\nexport class NzCarouselTransformNoLoopStrategy extends NzCarouselBaseStrategy<NzCarouselTransformOnLoopStrategyOptions> {\n private isTransitioning = false;\n\n private get vertical(): boolean {\n return this.carouselComponent!.vertical;\n }\n\n constructor(\n carouselComponent: NzCarouselComponentAsSource,\n cdr: ChangeDetectorRef,\n renderer: Renderer2,\n platform: Platform,\n options?: NzCarouselTransformOnLoopStrategyOptions\n ) {\n super(carouselComponent, cdr, renderer, platform, options);\n }\n\n override dispose(): void {\n this.renderer.setStyle(this.slickTrackEl, 'transform', null);\n\n super.dispose();\n }\n\n override withCarouselContents(contents: QueryList<NzCarouselContentDirective> | null): void {\n super.withCarouselContents(contents);\n\n const carousel = this.carouselComponent!;\n const activeIndex = carousel.activeIndex;\n\n if (this.platform.isBrowser && this.contents.length) {\n this.renderer.setStyle(this.slickListEl, 'height', `${this.unitHeight}px`);\n\n if (this.platform.isBrowser && this.contents.length) {\n this.renderer.setStyle(this.slickListEl, 'height', `${this.unitHeight}px`);\n\n if (this.vertical) {\n this.renderer.setStyle(this.slickTrackEl, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(this.slickTrackEl, 'height', `${this.length * this.unitHeight}px`);\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(0, ${-activeIndex * this.unitHeight}px, 0)`\n );\n } else {\n this.renderer.setStyle(this.slickTrackEl, 'height', `${this.unitHeight}px`);\n this.renderer.setStyle(this.slickTrackEl, 'width', `${this.length * this.unitWidth}px`);\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(${-activeIndex * this.unitWidth}px, 0, 0)`\n );\n }\n\n this.contents.forEach((content: NzCarouselContentDirective) => {\n this.renderer.setStyle(content.el, 'position', 'relative');\n this.renderer.setStyle(content.el, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(content.el, 'height', `${this.unitHeight}px`);\n });\n }\n }\n }\n\n switch(_f: number, _t: number): Observable<void> {\n const to = (_t + this.length) % this.length;\n const transitionSpeed = this.carouselComponent!.nzTransitionSpeed;\n const complete$ = new Subject<void>();\n\n this.renderer.setStyle(this.slickTrackEl, 'transition', `transform ${transitionSpeed}ms ease`);\n\n if (this.vertical) {\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(0, ${-to * this.unitHeight}px, 0)`);\n } else {\n this.renderer.setStyle(this.slickTrackEl, 'transform', `translate3d(${-to * this.unitWidth}px, 0, 0)`);\n }\n\n this.isTransitioning = true;\n\n setTimeout(() => {\n // this strategy don't need to do a following adjust\n this.isTransitioning = false;\n\n complete$.next();\n complete$.complete();\n }, transitionSpeed);\n\n return complete$.asObservable();\n }\n\n override dragging(vector: PointerVector): void {\n if (this.isTransitioning) {\n return;\n }\n\n const activeIndex = this.carouselComponent!.activeIndex;\n\n if (this.vertical) {\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(0, ${-activeIndex * this.unitHeight + vector.x}px, 0)`\n );\n } else {\n this.renderer.setStyle(\n this.slickTrackEl,\n 'transform',\n `translate3d(${-activeIndex * this.unitWidth + vector.x}px, 0, 0)`\n );\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { QueryList } from '@angular/core';\nimport { Observable, Subject, timer } from 'rxjs';\n\nimport { NzCarouselContentDirective } from '../../carousel-content.directive';\nimport { NzCarouselBaseStrategy } from '../base-strategy';\n\nexport class NzCarouselFlipStrategy extends NzCarouselBaseStrategy {\n override withCarouselContents(contents: QueryList<NzCarouselContentDirective> | null): void {\n super.withCarouselContents(contents);\n\n if (this.contents) {\n this.renderer.setStyle(this.slickListEl, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(this.slickTrackEl, 'width', `${this.length * this.unitWidth}px`);\n\n this.contents.forEach((content: NzCarouselContentDirective, i: number) => {\n const cur = this.carouselComponent!.activeIndex === i;\n\n this.renderer.setStyle(content.el, 'transform', cur ? 'rotateY(0deg)' : 'rotateY(180deg)');\n this.renderer.setStyle(content.el, 'position', 'relative');\n this.renderer.setStyle(content.el, 'width', `${this.unitWidth}px`);\n this.renderer.setStyle(content.el, 'left', `${-this.unitWidth * i}px`);\n this.renderer.setStyle(content.el, 'transform-style', 'preserve-3d');\n this.renderer.setStyle(content.el, 'backface-visibility', 'hidden');\n });\n\n const { carouselComponent } = this;\n carouselComponent!.ngZone.runOutsideAngular(() => {\n timer(carouselComponent!.nzTransitionSpeed).subscribe(() => {\n this.contents.forEach(c => this.renderer.setStyle(c.el, 'transition', ['transform 500ms ease 0s']));\n });\n });\n }\n }\n\n switch(rawF: number, rawT: number): Observable<void> {\n const { from, to } = this.getFromToInBoundary(rawF, rawT);\n const complete$ = new Subject<void>();\n const speed = this.carouselComponent!.nzTransitionSpeed;\n\n timer(speed).subscribe(() => {\n complete$.next();\n complete$.complete();\n });\n\n if (rawF === rawT) {\n return complete$;\n }\n\n this.contents.forEach((content: NzCarouselContentDirective, i: number) => {\n if (i === from) {\n this.renderer.setStyle(content.el, 'transform', 'rotateY(180deg)');\n } else if (i === to) {\n this.renderer.setStyle(content.el, 'transform', 'rotateY(0deg)');\n }\n });\n\n return complete$.asObservable();\n }\n\n override dispose(): void {\n this.contents.forEach((content: NzCarouselContentDirective) => {\n this.renderer.setStyle(content.el, 'transition', null);\n this.renderer.setStyle(content.el, 'transform', null);\n this.renderer.setStyle(content.el, 'width', null);\n this.renderer.setStyle(content.el, 'left', null);\n this.renderer.setStyle(content.el, 'transform-style', null);\n this.renderer.setStyle(content.el, 'backface-visibility', null);\n });\n\n super.dispose();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './carousel.module';\nexport * from './carousel.component';\nexport * from './carousel-content.directive';\nexport * from './typings';\n\nexport * from './strategies/base-strategy';\nexport { NzCarouselOpacityStrategy } from './strategies/opacity-strategy';\nexport { NzCarouselTransformStrategy } from './strategies/transform-strategy';\nexport { NzCarouselTransformNoLoopStrategy } from './strategies/experimental/transform-no-loop-strategy';\nexport { NzCarouselFlipStrategy } from './strategies/experimental/flip-strategy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;AAGG;MAWU,0BAA0B,CAAA;AAoB3B,IAAA,QAAA;AAnBD,IAAA,EAAE;IAEX,IAAI,QAAQ,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,cAAc,CAAC;;aAC1C;YACL,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,cAAc,CAAC;;;AAItD,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,OAAO;;IAGb,OAAO,GAAG,KAAK;IAEvB,WACE,CAAA,UAAsB,EACd,QAAmB,EAAA;QAAnB,IAAQ,CAAA,QAAA,GAAR,QAAQ;AAEhB,QAAA,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa;;uGAtBzB,0BA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