forked from NG-ZORRO/ng-zorro-antd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(module:carousel): refactor (NG-ZORRO#3062)
* refactor(module:carousel): refactor * fix: move some listeners to body * fix: fix vertical context preparing dragging from first to last * fix: opacity strategy transition * fix(module:breadcrumb): add input boolean * feat: support SSR * fix: lint * fix: fix active index not reset when content changes close NG-ZORRO#2468, close NG-ZORRO#2218
- Loading branch information
1 parent
f37aa6c
commit ca7c0f0
Showing
14 changed files
with
695 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { QueryList } from '@angular/core'; | ||
import { NzCarouselContentDirective } from './nz-carousel-content.directive'; | ||
|
||
export type NzCarouselEffects = 'fade' | 'scrollx'; | ||
|
||
export interface NzCarouselComponentAsSource { | ||
carouselContents: QueryList<NzCarouselContentDirective>; | ||
el: HTMLElement; | ||
nzTransitionSpeed: number; | ||
nzVertical: boolean; | ||
slickListEl: HTMLElement; | ||
slickTrackEl: HTMLElement; | ||
activeIndex: number; | ||
} | ||
|
||
export interface PointerVector { | ||
x: number; | ||
y: number; | ||
} | ||
|
||
export interface FromToInterface { | ||
from: number; | ||
to: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
<div class="slick-initialized slick-slider" [class.slick-vertical]="nzVertical"> | ||
<div | ||
class="slick-list" | ||
#slickList | ||
class="slick-list" | ||
tabindex="-1" | ||
(keydown)="onKeyDown($event)" | ||
(swipeleft)="swipe('swipeleft')" | ||
(swiperight)="swipe('swiperight')" | ||
(pan)="swipeInProgress($event);"> | ||
(mousedown)="pointerDown($event)" | ||
(touchstart)="pointerDown($event)" | ||
> | ||
<!-- Render carousel items. --> | ||
<div class="slick-track" #slickTrack> | ||
<ng-content></ng-content> | ||
</div> | ||
</div> | ||
<!-- Render dots. --> | ||
<ul class="slick-dots" *ngIf="nzDots"> | ||
<li *ngFor="let content of slideContents; let i = index" [class.slick-active]="content.isActive" (click)="goTo(i)"> | ||
<ng-template [ngTemplateOutlet]="nzDotRender || renderDotTemplate" [ngTemplateOutletContext]="{ $implicit: i }"></ng-template> | ||
<li | ||
*ngFor="let content of carouselContents; let i = index" | ||
[class.slick-active]="content.isActive" | ||
(click)="goTo(i)" | ||
> | ||
<ng-template [ngTemplateOutlet]="nzDotRender || renderDotTemplate" [ngTemplateOutletContext]="{ $implicit: i }"> | ||
</ng-template> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<ng-template #renderDotTemplate let-index> | ||
<button>{{index + 1}}</button> | ||
<button>{{ index + 1 }}</button> | ||
</ng-template> |
Oops, something went wrong.