Skip to content

Commit

Permalink
Merge branch 'development' into feat-docs-split-samples
Browse files Browse the repository at this point in the history
Conflicts:
	demo/src/ng-api-doc.ts
	package.json
  • Loading branch information
valorkin committed Dec 28, 2016
2 parents 1189bfe + 78f6e49 commit 8d3c2a8
Show file tree
Hide file tree
Showing 19 changed files with 1,235 additions and 182 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div class="row">
<div class="col-md-4">
<carousel [interval]="myInterval" [noWrap]="noWrapSlides">
<slide *ngFor="let slidez of slides; let index=index"
[active]="slidez.active">
<carousel [interval]="myInterval" [noWrap]="noWrapSlides" [(activeSlide)]="activeSlideIndex">
<slide *ngFor="let slidez of slides; let index=index">
<img [src]="slidez.image" style="margin:auto;">

<div class="carousel-caption">
Expand All @@ -18,10 +17,17 @@ <h4>Slide {{index}}</h4>
<button type="button" class="btn btn-info"
(click)="addSlide()">Add Slide
</button>
<!-- issue: removing currently active slide should not lead to white screen? -->
<!--<button type="button" class="btn btn-info"-->
<!--(click)="removeSlide(2)">Remove Slide#3-->
<!--</button>-->

<button type="button" class="btn btn-info"
(click)="selectSlide(2)">Select #3
</button>

<button type="button" class="btn btn-info"
(click)="removeSlide()">Remove Current
</button>
<button type="button" class="btn btn-info"
(click)="removeSlide(2)">Remove #3
</button>
<br>

<div class="checkbox">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class CarouselDemoComponent {
public myInterval:number = 5000;
public noWrapSlides:boolean = false;
public slides:any[] = [];
public activeSlideIndex: number;

public constructor() {
for (let i = 0; i < 4; i++) {
Expand All @@ -24,7 +25,12 @@ export class CarouselDemoComponent {
});
}

public removeSlide(index:number):void {
this.slides.splice(index, 1);
public selectSlide(index: number): void {
this.activeSlideIndex = index;
}

public removeSlide(index?: number):void {
const toRemove = index ? index : this.activeSlideIndex;
this.slides.splice(toRemove, 1);
}
}
162 changes: 143 additions & 19 deletions demo/src/ng-api-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ export const ngdoc = {
"description": "<p>Base element to create carousel</p>\n",
"selector": "carousel",
"inputs": [
{
"name": "activeSlide",
"type": "number",
"description": "<p>Index of currently displayed slide(started for 0) </p>\n"
},
{
"name": "interval",
"type": "number",
Expand All @@ -197,44 +202,163 @@ export const ngdoc = {
"description": "<p>If <code>true</code> — will disable pausing on carousel mouse hover </p>\n"
},
{
"name": "noTransition",
"name": "noWrap",
"type": "boolean",
"description": "<p>If <code>true</code> — will disable carousel transitions </p>\n"
"description": "<p>If <code>true</code> — carousel will not cycle continuously and will have hard stops (prevent looping) </p>\n"
}
],
"outputs": [
{
"name": "activeSlideChange",
"description": "<p>Will be emitted when active slide has been changed. Part of two-way-bindable [(activeSlide)] property </p>\n"
}
],
"properties": [
{
"name": "activeSlide",
"type": "number",
"description": "<p>Index of currently displayed slide(started for 0) </p>\n"
}
],
"methods": [
{
"name": "addSlide",
"description": "<p>Adds new slide. If this slide is first in collection - set it as active and starts auto changing</p>\n",
"args": [
{
"name": "slide",
"type": "SlideComponent"
}
],
"returnType": "void"
},
{
"name": "removeSlide",
"description": "<p>Removes specified slide. If this slide is active - will roll to another slide</p>\n",
"args": [
{
"name": "slide",
"type": "SlideComponent"
}
],
"returnType": "void"
},
{
"name": "nextSlide",
"description": "<p>Rolling to next slide</p>\n",
"args": [
{
"name": "force",
"type": "boolean"
}
],
"returnType": "void"
},
{
"name": "previousSlide",
"description": "<p>Rolling to previous slide</p>\n",
"args": [
{
"name": "force",
"type": "boolean"
}
],
"returnType": "void"
},
{
"name": "selectSlide",
"description": "<p>Rolling to specified slide</p>\n",
"args": [
{
"name": "index",
"type": "number"
}
],
"returnType": "void"
},
{
"name": "play",
"description": "<p>Starts a auto changing of slides</p>\n",
"args": [],
"returnType": "void"
},
{
"name": "pause",
"description": "<p>Stops a auto changing of slides</p>\n",
"args": [],
"returnType": "void"
},
{
"name": "getCurrentSlideIndex",
"description": "<p>Finds and returns index of currently displayed slide\n@returns {number}</p>\n",
"args": [],
"returnType": "number"
},
{
"name": "isLast",
"description": "<p>Defines, whether the specified index is last in collection\n@returns {boolean}</p>\n",
"args": [
{
"name": "index",
"type": "number"
}
],
"returnType": "boolean"
}
]
},
"CarouselConfig": {
"fileName": "src/carousel/carousel.config.ts",
"className": "CarouselConfig",
"description": "",
"methods": [],
"properties": [
{
"name": "interval",
"defaultValue": "5000",
"type": "number",
"description": "<p>Default interval of auto changing of slides </p>\n"
},
{
"name": "noPause",
"defaultValue": "false",
"type": "boolean",
"description": "<p>Is loop of auto changing of slides can be paused </p>\n"
},
{
"name": "noWrap",
"defaultValue": "false",
"type": "boolean",
"description": "<p>If <code>true</code> — carousel will not cycle continuously and will have hard stops (prevent looping) </p>\n"
"description": "<p>Is slides can wrap from the last to the first slide </p>\n"
}
],
"outputs": [],
"properties": [],
"methods": []
]
},
"SlideComponent": {
"fileName": "src/carousel/slide.component.ts",
"className": "SlideComponent",
"description": "<p>Wrap your content with <code>slide</code> component </p>\n",
"description": "",
"selector": "slide",
"inputs": [
{
"name": "active",
"type": "boolean",
"description": "<p>Is current slide active </p>\n"
},
}
],
"outputs": [],
"properties": [
{
"name": "direction",
"type": "Direction",
"description": ""
"name": "addClass",
"defaultValue": "true",
"type": "boolean",
"description": "<p>Wraps element by appropriate CSS classes </p>\n"
},
{
"name": "index",
"type": "number",
"description": "<p>Index of slide in carousel&#39;s slides </p>\n"
"name": "carousel",
"type": "CarouselComponent",
"description": "<p>Link to Parent(container-collection) component </p>\n"
}
],
"outputs": [],
"properties": [],
"methods": []
},
"CollapseDirective": {
Expand All @@ -252,11 +376,11 @@ export const ngdoc = {
"outputs": [
{
"name": "collapsed",
"description": "<p>This event fired as soon as content is collapsed </p>\n"
"description": "<p>This event fires as soon as content collapses </p>\n"
},
{
"name": "expanded",
"description": "<p>This event fired as soon as content becomes visible </p>\n"
"description": "<p>This event fires as soon as content becomes visible </p>\n"
}
],
"properties": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-bootstrap-base",
"version": "1.1.16-9",
"version": "1.1.16-10",
"description": "Native Angular Bootstrap Components",
"private": true,
"scripts": {
Expand Down
Loading

0 comments on commit 8d3c2a8

Please sign in to comment.