-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(carousel): allow to display multiple items per one slide
- Loading branch information
1 parent
ecdc140
commit 178806c
Showing
22 changed files
with
761 additions
and
64 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
demo/src/app/components/+carousel/carousel-section.component.ts
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
14 changes: 14 additions & 0 deletions
14
demo/src/app/components/+carousel/demos/multilist-from-index/multilist-from-index.html
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,14 @@ | ||
<p> | ||
You can set specific index to start from it | ||
</p> | ||
<carousel [itemsPerSlide]="itemsPerSlide" | ||
[singleSlideOffset]="singleSlideOffset" | ||
[startFromIndex]="6" | ||
[interval]="false"> | ||
<slide *ngFor="let slide of slides; let index=index"> | ||
<img [src]="slide.image" alt="image slide" style="display: block; width: 100%;"> | ||
<div class="carousel-caption"> | ||
<h4>Slide {{index}}</h4> | ||
</div> | ||
</slide> | ||
</carousel> |
23 changes: 23 additions & 0 deletions
23
demo/src/app/components/+carousel/demos/multilist-from-index/multilist-from-index.ts
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,23 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-carousel-multilist-from-index', | ||
templateUrl: './multilist-from-index.html' | ||
}) | ||
export class DemoCarouselMultilistFromIndexComponent { | ||
itemsPerSlide = 5; | ||
singleSlideOffset = true; | ||
|
||
slides = [ | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'}, | ||
{image: 'assets/images/nature/3.jpg'}, | ||
{image: 'assets/images/nature/4.jpg'}, | ||
{image: 'assets/images/nature/5.jpg'}, | ||
{image: 'assets/images/nature/6.jpg'}, | ||
{image: 'assets/images/nature/7.jpg'}, | ||
{image: 'assets/images/nature/8.jpg'}, | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'} | ||
]; | ||
} |
14 changes: 14 additions & 0 deletions
14
demo/src/app/components/+carousel/demos/multilist-single-offset/multilist-single-offset.html
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,14 @@ | ||
<p> | ||
There is ability to shift slide not only by amount of all visible slides but also for one item | ||
</p> | ||
<carousel [itemsPerSlide]="itemsPerSlide" | ||
[singleSlideOffset]="singleSlideOffset" | ||
[interval]="false" | ||
[noWrap]="noWrap"> | ||
<slide *ngFor="let slide of slides; let index=index"> | ||
<img [src]="slide.image" alt="image slide" style="display: block; width: 100%;"> | ||
<div class="carousel-caption"> | ||
<h4>Slide {{index}}</h4> | ||
</div> | ||
</slide> | ||
</carousel> |
24 changes: 24 additions & 0 deletions
24
demo/src/app/components/+carousel/demos/multilist-single-offset/multilist-single-offset.ts
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 { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-carousel-multilist-single-offset', | ||
templateUrl: './multilist-single-offset.html' | ||
}) | ||
export class DemoCarouselMultilistSingleOffsetComponent { | ||
itemsPerSlide = 5; | ||
singleSlideOffset = true; | ||
noWrap = true; | ||
|
||
slides = [ | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'}, | ||
{image: 'assets/images/nature/3.jpg'}, | ||
{image: 'assets/images/nature/4.jpg'}, | ||
{image: 'assets/images/nature/5.jpg'}, | ||
{image: 'assets/images/nature/6.jpg'}, | ||
{image: 'assets/images/nature/7.jpg'}, | ||
{image: 'assets/images/nature/8.jpg'}, | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'} | ||
]; | ||
} |
24 changes: 24 additions & 0 deletions
24
demo/src/app/components/+carousel/demos/multilist/multilist.html
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 @@ | ||
<carousel [itemsPerSlide]="itemsPerSlide" | ||
[singleSlideOffset]="singleSlideOffset" | ||
[noWrap]="!noWrap" | ||
[interval]="false" | ||
[startFromIndex]="5" | ||
(slideRangeChange)="onSlideRangeChange($event)"> | ||
<slide *ngFor="let slide of slides; let index=index"> | ||
<img [src]="slide.image" alt="image slide" style="display: block; width: 100%;"> | ||
<div class="carousel-caption"> | ||
<h4>Slide {{index}}</h4> | ||
</div> | ||
</slide> | ||
</carousel> | ||
|
||
<div class="container" [ngStyle]="{'marginTop': '20px'}"> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox" [(ngModel)]="noWrap"> | ||
Infinite | ||
</label> | ||
</div> | ||
</div> | ||
|
||
<pre class="card card-block card-header">{{slidesChangeMessage}}</pre> |
30 changes: 30 additions & 0 deletions
30
demo/src/app/components/+carousel/demos/multilist/multilist.ts
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,30 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-carousel-multilist', | ||
templateUrl: './multilist.html' | ||
}) | ||
export class DemoCarouselMultilistComponent { | ||
itemsPerSlide = 3; | ||
singleSlideOffset = false; | ||
noWrap = false; | ||
|
||
slidesChangeMessage = ''; | ||
|
||
slides = [ | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'}, | ||
{image: 'assets/images/nature/3.jpg'}, | ||
{image: 'assets/images/nature/4.jpg'}, | ||
{image: 'assets/images/nature/5.jpg'}, | ||
{image: 'assets/images/nature/6.jpg'}, | ||
{image: 'assets/images/nature/7.jpg'}, | ||
{image: 'assets/images/nature/8.jpg'}, | ||
{image: 'assets/images/nature/1.jpg'}, | ||
{image: 'assets/images/nature/2.jpg'} | ||
]; | ||
|
||
onSlideRangeChange(indexes: number[]): void { | ||
this.slidesChangeMessage = `Slides have been switched: ${indexes}`; | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
demo/src/app/docs/api-docs/sample-box/sample-box.component.ts
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
5 changes: 2 additions & 3 deletions
5
demo/src/app/docs/demo-section-components/demo-top-section/demo-top-section.component.ts
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
Oops, something went wrong.