UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

1 lines 62 kB
{"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})\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(elementRef: ElementRef, private renderer: Renderer2) {\n this.el = elementRef.nativeElement;\n this.renderer.addClass(elementRef.nativeElement, 'slick-slide');\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@wendellhu95: 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 {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n Renderer2,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { fromEvent, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';\nimport { NzDragService, NzResizeService } from 'ng-zorro-antd/core/services';\nimport { BooleanInput, NumberInput, NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { InputBoolean, InputNumber } 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 NzCarouselDotPosition,\n NzCarouselEffects,\n NzCarouselStrategyRegistryItem,\n NZ_CAROUSEL_CUSTOM_STRATEGIES,\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 >\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 <ul\n class=\"slick-dots\"\n *ngIf=\"nzDots\"\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 <li\n *ngFor=\"let content of carouselContents; let i = index\"\n [class.slick-active]=\"i === activeIndex\"\n (click)=\"onLiClick(i)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"nzDotRender || renderDotTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: i }\"\n ></ng-template>\n </li>\n </ul>\n </div>\n\n <ng-template #renderDotTemplate let-index>\n <button>{{ index + 1 }}</button>\n </ng-template>\n `,\n host: {\n '[class.ant-carousel-vertical]': 'vertical',\n '[class.ant-carousel-rtl]': `dir ==='rtl'`\n }\n})\nexport class NzCarouselComponent implements AfterContentInit, AfterViewInit, OnDestroy, OnChanges, OnInit {\n readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;\n static ngAcceptInputType_nzEnableSwipe: BooleanInput;\n static ngAcceptInputType_nzDots: BooleanInput;\n static ngAcceptInputType_nzAutoPlay: BooleanInput;\n static ngAcceptInputType_nzAutoPlaySpeed: NumberInput;\n static ngAcceptInputType_nzTransitionSpeed: NumberInput;\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() @WithConfig() @InputBoolean() nzEnableSwipe: boolean = true;\n @Input() @WithConfig() @InputBoolean() nzDots: boolean = true;\n @Input() @WithConfig() @InputBoolean() nzAutoPlay: boolean = false;\n @Input() @WithConfig() @InputNumber() nzAutoPlaySpeed: number = 3000;\n @Input() @InputNumber() nzTransitionSpeed = 500;\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 if (value === 'left' || value === 'right') {\n this.vertical = true;\n } else {\n this.vertical = false;\n }\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: number | null = null;\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\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 @Optional() private directionality: Directionality,\n @Optional() @Inject(NZ_CAROUSEL_CUSTOM_STRATEGIES) private customStrategies: NzCarouselStrategyRegistryItem[]\n ) {\n this.nzDotPosition = 'bottom';\n\n this.renderer.addClass(elementRef.nativeElement, 'ant-carousel');\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 this.ngZone.runOutsideAngular(() => {\n fromEvent<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 }\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 onLiClick = (index: number): void => {\n if (this.dir === 'rtl') {\n this.goTo(this.carouselContents.length - 1 - index);\n } else {\n this.goTo(index);\n }\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 (this.carouselContents && this.carouselContents.length && !this.isTransiting) {\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(index);\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 = null;\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 if (this.dir === 'rtl') {\n slide.isActive = index === this.carouselContents.length - 1 - i;\n } else {\n slide.isActive = index === i;\n }\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 (Math.abs(xDelta) > this.gestureRect!.width / 3) {\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 { BidiModule } from '@angular/cdk/bidi';\nimport { PlatformModule } from '@angular/cdk/platform';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzCarouselContentDirective } from './carousel-content.directive';\nimport { NzCarouselComponent } from './carousel.component';\n\n@NgModule({\n declarations: [NzCarouselComponent, NzCarouselContentDirective],\n exports: [NzCarouselComponent, NzCarouselContentDirective],\n imports: [BidiModule, CommonModule, PlatformModule]\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;;;;MAWa,0BAA0B;IAkBrC,YAAY,UAAsB,EAAU,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;QAFvD,YAAO,GAAG,KAAK,CAAC;QAGtB,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;KACjE;IAlBD,IAAI,QAAQ,CAAC,KAAc;QACzB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;SACjD;aAAM;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