Skip to content

Commit

Permalink
Merge branch 'angular-2.0.0-alpha.37' of https://github.com/rkintzi/n…
Browse files Browse the repository at this point in the history
…g2-bootstrap into rkintzi-angular-2.0.0-alpha.37
  • Loading branch information
valorkin committed Sep 16, 2015
2 parents a7d9754 + 331cdf3 commit 7517a9a
Show file tree
Hide file tree
Showing 40 changed files with 107 additions and 153 deletions.
10 changes: 4 additions & 6 deletions components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View,
Directive, LifecycleEvent,
Directive, OnInit, OnDestroy,
NgClass, ViewContainerRef, TemplateRef
} from 'angular2/angular2';

Expand Down Expand Up @@ -52,9 +52,8 @@ export class Accordion {
@Directive({
selector: 'accordion-transclude, [accordion-transclude]',
properties: ['accordionTransclude'],
lifecycle: [LifecycleEvent.onInit]
})
export class AccordionTransclude {
export class AccordionTransclude implements OnInit{
private accordionTransclude:TemplateRef;

constructor(private viewRef:ViewContainerRef) {
Expand All @@ -76,12 +75,11 @@ import {Collapse} from '../collapse/collapse';
host: {
'[class.panel-open]': 'isOpen'
},
lifecycle: [LifecycleEvent.onInit, LifecycleEvent.onDestroy]
})
@View({
template: `
<div class="panel" [ng-class]="panelClass">
<div class="panel-heading" (^click)="toggleOpen($event)">
<div class="panel-heading" (click)="toggleOpen($event)">
<h4 class="panel-title">
<a href tabindex="0" class="accordion-toggle">
<span [ng-class]="{'text-muted': isDisabled}"
Expand All @@ -98,7 +96,7 @@ import {Collapse} from '../collapse/collapse';
`,
directives: [Collapse, AccordionTransclude, NgClass]
})
export class AccordionGroup {
export class AccordionGroup implements OnInit, OnDestroy {
private templateUrl:string;
private panelClass:string;
private _isOpen:boolean;
Expand Down
3 changes: 1 addition & 2 deletions components/accordion/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import {accordion} from 'ng2-bootstrap';
}
})

// class AccordionGroup
// class AccordionGroup implements OnInit, OnDestroy
@Component({
selector: 'accordion-group, [accordion-group]',
properties: ['templateUrl', 'heading', 'isOpen', 'isDisabled', 'panelClass'],
host: {
'[class.panel-open]': 'isOpen'
},
lifecycle: [LifecycleEvent.onInit, LifecycleEvent.onDestroy]
})

// class AccordionHeading
Expand Down
9 changes: 4 additions & 5 deletions components/alert/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View,
LifecycleEvent, EventEmitter,
OnInit, EventEmitter,
ElementRef, ViewContainerRef,
NgIf, NgClass
} from 'angular2/angular2';
Expand All @@ -12,21 +12,20 @@ import {
selector: 'alert',
properties: ['type', 'dismissible', 'dismissOnTimeout'],
events: ['close'],
lifecycle: [LifecycleEvent.onInit]
})
@View({
template: `
<div class="alert" role="alert" [ng-class]="classes" *ng-if="!closed">
<button *ng-if="closeable" type="button" class="close" (^click)="onClose($event)">
<button *ng-if="closeable" type="button" class="close" (click)="onClose($event)">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<ng-content></ng-content>
</div>
`,
directives: [NgIf, NgClass]
directives: [NgIf, NgClass],
})
export class Alert {
export class Alert implements OnInit {
type:string;
close:EventEmitter = new EventEmitter();
templateUrl:string;
Expand Down
3 changes: 1 addition & 2 deletions components/alert/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import {Alert} from 'ng2-bootstrap';

### Annotations
```typescript
// class Alert
// class Alert implements OnInit
@Component({
selector: 'alert',
properties: ['type', 'dismissible', 'dismissOnTimeout'],
events: ['close'],
lifecycle: [LifecycleEvent.onInit]
})
```

Expand Down
5 changes: 2 additions & 3 deletions components/buttons/button-checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Directive,
DefaultValueAccessor,
Self, NgModel, Renderer, ElementRef,
LifecycleEvent
OnInit
} from 'angular2/angular2';


Expand All @@ -14,9 +14,8 @@ import {
'(click)': 'onClick()',
'[class.active]': 'state'
},
lifecycle: [LifecycleEvent.onInit]
})
export class ButtonCheckbox extends DefaultValueAccessor {
export class ButtonCheckbox extends DefaultValueAccessor implements OnInit {
private btnCheckboxTrue:any;
private btnCheckboxFalse:any;
private value:any;
Expand Down
5 changes: 2 additions & 3 deletions components/buttons/button-radio.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="../../tsd.d.ts" />
import {
Directive,
DefaultValueAccessor, LifecycleEvent,
DefaultValueAccessor, OnInit,
Self, NgModel, Renderer, ElementRef
} from 'angular2/angular2';

Expand All @@ -13,9 +13,8 @@ import {
'(click)': 'onClick()',
'[class.active]': 'isActive'
},
lifecycle: [LifecycleEvent.onInit]
})
export class ButtonRadio extends DefaultValueAccessor {
export class ButtonRadio extends DefaultValueAccessor implements OnInit {
private btnRadio:string;
private uncheckable:boolean;
cd:NgModel;
Expand Down
6 changes: 2 additions & 4 deletions components/buttons/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@ import {ButtonRadio, ButtonCheckbox} from 'ng2-bootstrap';
```
### Annotations
```typescript
// class ButtonRadio
// class ButtonRadio implements OnInit
@Directive({
selector: '[btn-radio][ng-model]',
properties: ['btnRadio', 'uncheckable'],
host: {
'(click)': 'onClick()',
'[class.active]': 'isActive'
},
lifecycle: [LifecycleEvent.onInit]
})

// class ButtonCheckbox
// class ButtonCheckbox implements OnInit
@Directive({
selector: '[btn-checkbox][ng-model]',
properties: ['btnCheckboxTrue', 'btnCheckboxFalse'],
host: {
'(click)': 'onClick()',
'[class.active]': 'state'
},
lifecycle: [LifecycleEvent.onInit]
})
```

Expand Down
16 changes: 7 additions & 9 deletions components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View,
Directive, LifecycleEvent,
Directive, OnInit, OnDestroy,
EventEmitter, ElementRef,
CORE_DIRECTIVES, NgClass
} from 'angular2/angular2';
Expand All @@ -14,20 +14,20 @@ export enum Direction {UNKNOWN, NEXT, PREV}

const NAVIGATION = {
[Ng2BootstrapTheme.BS4]: `
<a class="left carousel-control" (^click)="prev()" [hidden]="!slides.length">
<a class="left carousel-control" (click)="prev()" [hidden]="!slides.length">
<span class="icon-prev" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" (^click)="next()" [hidden]="!slides.length">
<a class="right carousel-control" (click)="next()" [hidden]="!slides.length">
<span class="icon-next" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
`,
[Ng2BootstrapTheme.BS3]: `
<a class="left carousel-control" (^click)="prev()" [hidden]="!slides.length">
<a class="left carousel-control" (click)="prev()" [hidden]="!slides.length">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" (^click)="next()" [hidden]="!slides.length">
<a class="right carousel-control" (click)="next()" [hidden]="!slides.length">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
`
Expand All @@ -36,7 +36,6 @@ const NAVIGATION = {
@Component({
selector: 'carousel, [carousel]',
properties: ['interval', 'noTransition', 'noPause', 'noWrap'],
lifecycle: [LifecycleEvent.onDestroy]
})
// todo:
// (ng-swipe-right)="prev()" (ng-swipe-left)="next()"
Expand All @@ -52,7 +51,7 @@ const NAVIGATION = {
`,
directives: [CORE_DIRECTIVES, NgClass]
})
export class Carousel {
export class Carousel implements OnDestroy {
private noPause:boolean;
private noWrap:boolean;
private slides:Array<Slide> = [];
Expand Down Expand Up @@ -212,7 +211,6 @@ export class Carousel {
'[class.item]': 'true',
'[class.carousel-item]': 'true'
},
lifecycle: [LifecycleEvent.onInit, LifecycleEvent.onDestroy]
})
@View({
template: `
Expand All @@ -222,7 +220,7 @@ export class Carousel {
`,
directives: [NgClass]
})
export class Slide {
export class Slide implements OnInit, OnDestroy {
public active:boolean;
public direction:Direction;
public index:number;
Expand Down
6 changes: 2 additions & 4 deletions components/carousel/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import {carousel} from 'ng2-bootstrap';

### Annotations
```typescript
// class Carousel
// class Carousel implements OnDestroy
@Component({
selector: 'carousel, [carousel]',
properties: ['interval', 'noTransition', 'noPause', 'noWrap'],
lifecycle: [LifecycleEvent.onDestroy]
})

// class Slide
// class Slide implements OnInit, OnDestroy
@Component({
selector: 'slide, [slide]',
properties: ['direction', 'active', 'index'],
Expand All @@ -21,7 +20,6 @@ import {carousel} from 'ng2-bootstrap';
'[class.item]': 'true',
'[class.carousel-item]': 'true'
},
lifecycle: [LifecycleEvent.onInit, LifecycleEvent.onDestroy]
})

export const carousel:Array<any> = [Carousel, Slide];
Expand Down
2 changes: 1 addition & 1 deletion components/collapse/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View,
Directive, LifecycleEvent,
Directive,
EventEmitter, ElementRef
} from 'angular2/angular2';

Expand Down
5 changes: 2 additions & 3 deletions components/datepicker/datepicker-inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View, Host,
LifecycleEvent, EventEmitter,
OnInit, EventEmitter,
DefaultValueAccessor,
ElementRef, ViewContainerRef,
NgIf, NgClass, FORM_DIRECTIVES, CORE_DIRECTIVES,
Expand Down Expand Up @@ -69,7 +69,6 @@ const KEYS = {
'dateDisabled',
'templateUrl'
],
lifecycle: [LifecycleEvent.onInit]
})
@View({
template: `
Expand All @@ -79,7 +78,7 @@ const KEYS = {
`,
directives: [FORM_DIRECTIVES, CORE_DIRECTIVES, NgClass, NgModel]
})
export class DatePickerInner {
export class DatePickerInner implements OnInit {
public datepickerMode:string;
public startingDay:number;
public yearRange:number;
Expand Down
11 changes: 5 additions & 6 deletions components/datepicker/datepicker-popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View, Host, Directive,
LifecycleEvent, EventEmitter, NgControl,
OnInit, EventEmitter, NgControl,
DefaultValueAccessor, ComponentRef, ViewEncapsulation, ControlValueAccessor,
ElementRef, ViewContainerRef, DynamicComponentLoader,
NgIf, NgClass, FORM_DIRECTIVES, CORE_DIRECTIVES,
Expand Down Expand Up @@ -57,10 +57,10 @@ const datePickerPopupConfig:Object = {
</li>
<li *ng-if="showButtonBar" style="padding:10px 9px 2px">
<span class="btn-group pull-left">
<button type="button" class="btn btn-sm btn-info" (^click)="select('today')" ng-disabled="isDisabled('today')">{{ getText('current') }}</button>
<button type="button" class="btn btn-sm btn-danger" (^click)="select(null)">{{ getText('clear') }}</button>
<button type="button" class="btn btn-sm btn-info" (click)="select('today')" ng-disabled="isDisabled('today')">{{ getText('current') }}</button>
<button type="button" class="btn btn-sm btn-danger" (click)="select(null)">{{ getText('clear') }}</button>
</span>
<button type="button" class="btn btn-sm btn-success pull-right" (^click)="close()">{{ getText('close') }}</button>
<button type="button" class="btn btn-sm btn-success pull-right" (click)="close()">{{ getText('close') }}</button>
</li>
</ul>`,
directives: [NgClass, NgStyle, DatePicker, FORM_DIRECTIVES, CORE_DIRECTIVES],
Expand Down Expand Up @@ -120,9 +120,8 @@ class PopupContainer {
// prop -> datepickerPopup - format
properties: ['datepickerPopup', 'isOpen'],
host: {'(cupdate)': 'onUpdate1($event)'},
lifecycle: [LifecycleEvent.onInit]
})
export class DatePickerPopup {
export class DatePickerPopup implements OnInit {
private _activeDate:Date;
private placement:string = 'bottom';
private _isOpen:boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
Component, View, Host,
LifecycleEvent, EventEmitter,
EventEmitter,
DefaultValueAccessor,
ElementRef, ViewContainerRef,
NgIf, NgClass, FORM_DIRECTIVES, CORE_DIRECTIVES,
Expand Down
Loading

0 comments on commit 7517a9a

Please sign in to comment.