Skip to content

Commit

Permalink
fix(build): change properties privacy to use in factories
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Telnov authored and valorkin committed Oct 3, 2016
1 parent de26168 commit 19c0c61
Show file tree
Hide file tree
Showing 25 changed files with 138 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ ng2-bootstrap.js.map
factories

/**/*.metadata.json
/**/*.ngfactory.ts
2 changes: 1 addition & 1 deletion components/accordion/accordion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class AccordionComponent {

/* tslint:disable:no-unused-variable */
@HostBinding('class.panel-group')
private addClass:boolean = true;
public addClass:boolean = true;
/* tslint:enable:no-unused-variable */

private groups:Array<AccordionPanelComponent> = [];
Expand Down
2 changes: 1 addition & 1 deletion components/accordion/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AccordionComponent {
@Input() public closeOthers:boolean;

@HostBinding('class.panel-group')
private addClass = true;
public addClass = true;
}

// component AccordionGroup
Expand Down
2 changes: 1 addition & 1 deletion components/alert/alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class AlertComponent implements OnInit {

@Output() public close:EventEmitter<AlertComponent> = new EventEmitter<AlertComponent>(false);

private closed:boolean;
public closed:boolean;
private classes:Array<string> = [];

public ngOnInit():any {
Expand Down
4 changes: 2 additions & 2 deletions components/buttons/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export class ButtonRadioDirective implements ControlValueAccessor, OnInit {
// directive ButtonCheckbox
@Directive({ selector: '[btnCheckbox][ngModel]' })
export class ButtonCheckboxDirective implements ControlValueAccessor, OnInit {
@Input() private btnCheckboxTrue:any;
@Input() private btnCheckboxFalse:any;
@Input() public btnCheckboxTrue:any;
@Input() public btnCheckboxFalse:any;

@HostBinding('class.active')
private state:boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class CarouselComponent implements OnDestroy {
this.restartTimer();
}

private slides:Array<SlideComponent> = [];
public slides:Array<SlideComponent> = [];
private currentInterval:any;
private isPlaying:boolean;
private destroyed:boolean = false;
Expand Down
8 changes: 4 additions & 4 deletions components/carousel/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { CarouselModule } from 'ng2-bootstrap/components/carousel';
selector: 'carousel'
})
export class CarouselComponent implements OnDestroy {
@Input() private noWrap:boolean;
@Input() private noPause:boolean;
@Input() private noTransition:boolean;
@Input() public noWrap:boolean;
@Input() public noPause:boolean;
@Input() public noTransition:boolean;

@Input() public get interval():number {}
}
Expand All @@ -32,7 +32,7 @@ export class SlideComponent implements OnInit, OnDestroy {

@HostBinding('class.item')
@HostBinding('class.carousel-item')
private addClass:boolean = true;
public addClass:boolean = true;
}
```

Expand Down
14 changes: 7 additions & 7 deletions components/collapse/collapse.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ export class CollapseDirective implements OnInit {
// @HostBinding('style.height')
// private height:string;
@HostBinding('style.display')
private display:string;
public display:string;
// shown
@HostBinding('class.in')
@HostBinding('attr.aria-expanded')
private isExpanded:boolean = true;
public isExpanded:boolean = true;
// hidden
@HostBinding('attr.aria-hidden')
private isCollapsed:boolean = false;
public isCollapsed:boolean = false;
// stale state
@HostBinding('class.collapse')
private isCollapse:boolean = true;
public isCollapse:boolean = true;
// animation state
@HostBinding('class.collapsing')
private isCollapsing:boolean = false;
public isCollapsing:boolean = false;

// @Input() private transitionDuration:number = 500; // Duration in ms

@Input()
private set collapse(value:boolean) {
public set collapse(value:boolean) {
this.isExpanded = value;
this.toggle();
}

private get collapse():boolean {
public get collapse():boolean {
return this.isExpanded;
}

Expand Down
4 changes: 2 additions & 2 deletions components/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export class NgTranscludeDirective {
private _ngTransclude:TemplateRef<any>;

@Input()
private set ngTransclude(templateRef:TemplateRef<any>) {
public set ngTransclude(templateRef:TemplateRef<any>) {
this._ngTransclude = templateRef;
if (templateRef) {
this.viewRef.createEmbeddedView(templateRef);
}
}

private get ngTransclude():TemplateRef<any> {
public get ngTransclude():TemplateRef<any> {
return this._ngTransclude;
}

Expand Down
14 changes: 7 additions & 7 deletions components/datepicker/datepicker-inner.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';

import { DateFormatter } from './date-formatter';

Expand Down Expand Up @@ -69,6 +69,8 @@ export class DatePickerInnerComponent implements OnInit, OnChanges {

@Output() public selectionDone:EventEmitter<Date> = new EventEmitter<Date>(undefined);

@Output() public update:EventEmitter<Date> = new EventEmitter<Date>(false);

public stepDay:any = {};
public stepMonth:any = {};
public stepYear:any = {};
Expand All @@ -87,9 +89,6 @@ export class DatePickerInnerComponent implements OnInit, OnChanges {
private refreshViewHandlerYear:Function;
private compareHandlerYear:Function;

@Output()
private update:EventEmitter<Date> = new EventEmitter<Date>(false);

@Input()
public get activeDate():Date {
return this._activeDate;
Expand Down Expand Up @@ -125,15 +124,16 @@ export class DatePickerInnerComponent implements OnInit, OnChanges {

if (this.initDate) {
this.activeDate = this.initDate;
this.selectedDate = new Date(this.activeDate.valueOf());
this.selectedDate = new Date(this.activeDate.valueOf() as number);
this.update.emit(this.activeDate);
} else if (this.activeDate === undefined) {
this.activeDate = new Date();
}
}

// this.refreshView should be called here to reflect the changes on the fly
public ngOnChanges():void {
// tslint:disable-next-line:no-unused-variable
public ngOnChanges(changes:SimpleChanges):void {
this.refreshView();
}

Expand Down Expand Up @@ -255,7 +255,7 @@ export class DatePickerInnerComponent implements OnInit, OnChanges {
this.datepickerMode = this.modes[this.modes.indexOf(this.datepickerMode) - 1];
}

this.selectedDate = new Date(this.activeDate.valueOf());
this.selectedDate = new Date(this.activeDate.valueOf() as number);
this.update.emit(this.activeDate);
this.refreshView();
}
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/monthpicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
<tr *ngFor="let rowz of rows">
<td *ngFor="let dtz of rowz" class="text-center" role="gridcell" id="{{dtz.uid}}" [ngClass]="dtz.customClass">
<button type="button" style="min-width:100%;" class="btn btn-default"
[ngClass]="{'btn-info': dtz.selected, 'btn-link': isBS4 && !dtz.selected && !datePicker.isActive(dtz), 'btn-info': isBS4 && !dtz.selected && datePicker.isActive(dtz), disabled: dtz.disabled, active: !isBS4 && datePicker.isActive(dtz)}"
[ngClass]="{'btn-link': isBS4 && !dtz.selected && !datePicker.isActive(dtz), 'btn-info': dtz.selected || (isBS4 && !dtz.selected && datePicker.isActive(dtz)), disabled: dtz.disabled, active: !isBS4 && datePicker.isActive(dtz)}"
[disabled]="dtz.disabled"
(click)="datePicker.select(dtz.date)" tabindex="-1">
<span [ngClass]="{'text-success': isBS4 && dtz.current, 'text-info': !isBS4 && dtz.current}">{{dtz.label}}</span>
Expand Down
2 changes: 1 addition & 1 deletion components/datepicker/yearpicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
<tr *ngFor="let rowz of rows">
<td *ngFor="let dtz of rowz" class="text-center" role="gridcell">
<button type="button" style="min-width:100%;" class="btn btn-default"
[ngClass]="{'btn-info': dtz.selected, 'btn-link': isBS4 && !dtz.selected && !datePicker.isActive(dtz), 'btn-info': isBS4 && !dtz.selected && datePicker.isActive(dtz), disabled: dtz.disabled, active: !isBS4 && datePicker.isActive(dtz)}"
[ngClass]="{'btn-link': isBS4 && !dtz.selected && !datePicker.isActive(dtz), 'btn-info': dtz.selected || (isBS4 && !dtz.selected && datePicker.isActive(dtz)), disabled: dtz.disabled, active: !isBS4 && datePicker.isActive(dtz)}"
[disabled]="dtz.disabled"
(click)="datePicker.select(dtz.date)" tabindex="-1">
<span [ngClass]="{'text-success': isBS4 && dtz.current, 'text-info': !isBS4 && dtz.current}">{{dtz.label}}</span>
Expand Down
7 changes: 3 additions & 4 deletions components/pagination/pagination.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,14 @@ export class PaginationComponent implements ControlValueAccessor, OnInit, Pagina
public renderer:Renderer;
public elementRef:ElementRef;

private classMap:string;
public classMap:string;
public pages:Array<any>;

private _itemsPerPage:number;
private _totalItems:number;
private _totalPages:number;
private inited:boolean = false;
// ??
private _page:number;
private pages:Array<any>;

public constructor(@Self() cd:NgModel, renderer:Renderer, elementRef:ElementRef) {
this.cd = cd;
Expand Down Expand Up @@ -224,7 +223,7 @@ export class PaginationComponent implements ControlValueAccessor, OnInit, Pagina
this.onTouched = fn;
}

private selectPage(page:number, event?:MouseEvent):void {
public selectPage(page:number, event?:MouseEvent):void {
if (event) {
event.preventDefault();
}
Expand Down
8 changes: 4 additions & 4 deletions components/pagination/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export class PaginationComponent implements ControlValueAccessor, OnInit, IPagin
@Input() public lastText:string;
@Input() public rotate:boolean;

@Input() private disabled:boolean;
@Input() public disabled:boolean;
@Input() public get itemsPerPage():number {}
@Input() private get totalItems():number {}
@Input() public get totalItems():number {}

@Output() private numPages:EventEmitter<number> = new EventEmitter(false);
@Output() private pageChanged:EventEmitter<IPageChangedEvent> = new EventEmitter(false);
@Output() public numPages:EventEmitter<number> = new EventEmitter(false);
@Output() public pageChanged:EventEmitter<IPageChangedEvent> = new EventEmitter(false);

@Component({
selector: 'pager[ngModel]',
Expand Down
1 change: 1 addition & 0 deletions components/progressbar/bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ProgressDirective } from './progress.directive';
})
export class BarComponent implements OnInit, OnDestroy {
@Input() public type:string;
public max:number;

@Input()
public get value():number {
Expand Down
8 changes: 4 additions & 4 deletions components/progressbar/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export class BarComponent implements OnInit, OnDestroy {
selector: 'progressbar, [progressbar]'
})
export class ProgressbarComponent {
@Input() private animate:boolean;
@Input() private max:number;
@Input() private type:string;
@Input() private value:number;
@Input() public animate:boolean;
@Input() public max:number;
@Input() public type:string;
@Input() public value:number;
}```
### Properties
Expand Down
8 changes: 4 additions & 4 deletions components/rating/rating.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export class RatingComponent implements ControlValueAccessor, OnInit {
public onTouched:any = Function.prototype;

public cd:NgModel;
private range:Array<any>;
private value:number;
public range:Array<any>;
public value:number;
private preValue:number;

@HostListener('keydown', ['$event'])
protected onKeydown(event:KeyboardEvent):void {
public onKeydown(event:KeyboardEvent):void {
if ([37, 38, 39, 40].indexOf(event.which) === -1) {
return;
}
Expand Down Expand Up @@ -87,7 +87,7 @@ export class RatingComponent implements ControlValueAccessor, OnInit {
}
}

protected reset():void {
public reset():void {
this.value = this.preValue;
this.onLeave.emit(this.value);
}
Expand Down
16 changes: 8 additions & 8 deletions components/rating/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { RatingModule } from 'ng2-bootstrap/components/rating';
selector: 'rating[ngModel]'
})
export class RatingComponent implements ControlValueAccessor, OnInit {
@Input() private max:number;
@Input() private stateOn:string;
@Input() private stateOff:string;
@Input() private readonly:boolean;
@Input() private titles:Array<string>;
@Input() private ratingStates:{stateOn:string, stateOff:string}[];
@Input() public max:number;
@Input() public stateOn:string;
@Input() public stateOff:string;
@Input() public readonly:boolean;
@Input() public titles:Array<string>;
@Input() public ratingStates:{stateOn:string, stateOff:string}[];

@Output() private onHover:EventEmitter<number> = new EventEmitter(false);
@Output() private onLeave:EventEmitter<number> = new EventEmitter(false);
@Output() public onHover:EventEmitter<number> = new EventEmitter(false);
@Output() public onLeave:EventEmitter<number> = new EventEmitter(false);
}
```

Expand Down
4 changes: 2 additions & 2 deletions components/tabs/tabset.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class TabsetComponent implements OnInit, OnDestroy {
return this._type;
};

@HostBinding('class.tab-container') protected clazz:boolean = true;
@HostBinding('class.tab-container') public clazz:boolean = true;

public set vertical(value:boolean) {
this._vertical = value;
Expand All @@ -58,12 +58,12 @@ export class TabsetComponent implements OnInit, OnDestroy {
}

public tabs:Array<TabDirective> = [];
public classMap:any = {};

private isDestroyed:boolean;
private _vertical:boolean;
private _justified:boolean;
private _type:string;
private classMap:any = {};

public ngOnInit():void {
this.type = this.type !== 'undefined' ? this.type : 'tabs';
Expand Down
20 changes: 10 additions & 10 deletions components/timepicker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import { TimepickerModule } from 'ng2-bootstrap/components/timepicker';
})
export class TimepickerComponent implements ControlValueAccessor, OnInit {
// config
@Input() private hourStep:number;
@Input() private minuteStep:number;
@Input() private readonlyInput:boolean;
@Input() private mousewheel:boolean;
@Input() private arrowkeys:boolean;
@Input() private showSpinners:boolean;
@Input() private min:Date;
@Input() private max:Date;
@Input() private meridians:Array<string> = ['AM', 'PM']; // ??
@Input() public hourStep:number;
@Input() public minuteStep:number;
@Input() public readonlyInput:boolean;
@Input() public mousewheel:boolean;
@Input() public arrowkeys:boolean;
@Input() public showSpinners:boolean;
@Input() public min:Date;
@Input() public max:Date;
@Input() public meridians:Array<string> = ['AM', 'PM']; // ??

@Input() private get showMeridian() {}
@Input() public get showMeridian() {}
}
```

Expand Down
Loading

0 comments on commit 19c0c61

Please sign in to comment.