Skip to content

Commit

Permalink
refactor(abc): use preserveWhitespaces: false
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Mar 13, 2018
1 parent 20b4fa0 commit 9775c91
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dist
coverage
site/app/routes/gen
.idea
debug.log
3 changes: 2 additions & 1 deletion src/core/abc/avatar-list/avatar-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { AvatarListItemComponent } from './avatar-list-item.component';
</li>
</ul>
`,
styleUrls: [ './avatar-list.less' ]
styleUrls: [ './avatar-list.less' ],
preserveWhitespaces: false
})
export class AvatarListComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/bar/bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coerci
template: `
<ng-container *ngIf="_title; else _titleTpl"><h4>{{_title}}</h4></ng-container>
<div #container></div>`,
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class G2BarComponent implements OnDestroy, OnChanges, OnInit {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/card/card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
</nz-spin>
</nz-card>
`,
styleUrls: [ './card.less' ]
styleUrls: [ './card.less' ],
preserveWhitespaces: false
})
export class ChartCardComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/mini-progress/mini-progress.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
<div class="progress" [ngStyle]="{'background-color': color, 'width.%': percent, 'height.px':strokeWidth}"></div>
</div>
`,
styleUrls: [ './mini-progress.less' ]
styleUrls: [ './mini-progress.less' ],
preserveWhitespaces: false
})
export class MiniProgressComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/pie/pie.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coerci
</ul>`,
styleUrls: [ './pie.less' ],
encapsulation: ViewEncapsulation.Emulated,
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class G2PieComponent implements OnDestroy, OnChanges, OnInit {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/radar/radar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coerci
</div>
</div>`,
styleUrls: [ './radar.less' ],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class G2RadarComponent implements OnDestroy, OnChanges, OnInit {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/timeline/timeline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
<div #container></div>
<div #slider></div>`,
styles: [ `:host {display:block}` ],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class TimelineComponent implements OnDestroy, OnChanges, OnInit {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/charts/water-wave/water-wave.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
<h4>{{percent}}%</h4>
</div>`,
styleUrls: [ './water-wave.less' ],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class WaterWaveComponent implements OnDestroy, OnChanges, OnInit {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/count-down/count-down.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import * as moment from 'moment';
(finished)="_finished()"
(notify)="_notify($event)"></countdown>
`,
styleUrls: [ './count-down.less' ]
styleUrls: [ './count-down.less' ],
preserveWhitespaces: false
})
export class CountDownComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/desc-list/desc-list-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { Component, Input, ViewChild, TemplateRef } from '@angular/core';
</div>
<div class="detail"><ng-content></ng-content></div>
</ng-template>
`
`,
preserveWhitespaces: false
})
export class DescListItemComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/desc-list/desc-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { DescListItemComponent } from './desc-list-item.component';
</div>
</div>
`,
styleUrls: [ './desc-list.less' ]
styleUrls: [ './desc-list.less' ],
preserveWhitespaces: false
})
export class DescListComponent implements OnChanges, OnInit {

Expand Down
8 changes: 6 additions & 2 deletions src/core/abc/error-collect/error-collect.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
*/
@Component({
selector: 'error-collect, [error-collect]',
template: `<i class="anticon anticon-exclamation-circle"></i> {{count}}`,
changeDetection: ChangeDetectionStrategy.OnPush
template: `
<i class="anticon anticon-exclamation-circle"></i>
<span class="pl-sm">{{count}}</span>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class ErrorCollectComponent implements OnInit, OnDestroy {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/exception/exception.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import { Component, Input, ContentChild, TemplateRef } from '@angular/core';
</div>
</div>
`,
styleUrls: [ './exception.less' ]
styleUrls: [ './exception.less' ],
preserveWhitespaces: false
})
export class ExceptionComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/footer-toolbar/footer-toolbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const CLS = 'footer-toolbar';
<error-collect *ngIf="errorCollect"></error-collect>
<ng-content></ng-content>
</div>
`
`,
preserveWhitespaces: false
})
export class FooterToolbarComponent implements OnInit, OnDestroy {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/global-footer/global-footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { Component, ContentChild, TemplateRef, Input } from '@angular/core';
</div>
<div *ngIf="copyright" class="copyright"><ng-template [ngTemplateOutlet]="copyright"></ng-template></div>
`,
styleUrls: [ './global-footer.less' ]
styleUrls: [ './global-footer.less' ],
preserveWhitespaces: false
})
export class GlobalFooterComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/number-info/number-info.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
</span>
</div>
`,
styleUrls: [ './number-info.less' ]
styleUrls: [ './number-info.less' ],
preserveWhitespaces: false
})
export class NumberInfoComponent implements OnChanges {
_title = '';
Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/pro-header/pro-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import { ProHeaderConfig } from './pro-header.config';
<ng-content></ng-content>
<ng-template [ngTemplateOutlet]="tab"></ng-template>
`,
styleUrls: [ './pro-header.less' ]
styleUrls: [ './pro-header.less' ],
preserveWhitespaces: false
})
export class ProHeaderComponent implements OnInit, OnChanges {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/result/result.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { Component, Input, TemplateRef, ContentChild } from '@angular/core';
</div>
<div class="actions"><ng-content></ng-content></div>
`,
styleUrls: [ './result.less' ]
styleUrls: [ './result.less' ],
preserveWhitespaces: false
})
export class ResultComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/reuse-tab/reuse-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { ReuseTabCached, ReuseTabNotify, ReuseTabMatchMode } from './interface';
selector: 'reuse-tab',
templateUrl: './reuse-tab.component.html',
styleUrls: ['./reuse-tab.less'],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false
})
export class ReuseTabComponent implements OnInit, OnChanges, OnDestroy {
private sub$: Subscription;
Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/simple-table/simple-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { SimpleTableExport } from './simple-table-export';
selector: 'simple-table',
templateUrl: './simple-table.component.html',
styleUrls: [ './simple-table.less' ],
providers: [ SimpleTableExport, CNCurrencyPipe, MomentDatePipe, YNPipe, DecimalPipe ]
providers: [ SimpleTableExport, CNCurrencyPipe, MomentDatePipe, YNPipe, DecimalPipe ],
preserveWhitespaces: false
})
export class SimpleTableComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
<div *ngIf="title" class="label"><span>{{title}}</span></div>
<div class="control"><ng-content></ng-content></div>
`,
styleUrls: [ './standard-form-row.less' ]
styleUrls: [ './standard-form-row.less' ],
preserveWhitespaces: false
})
export class StandardFormRowComponent implements OnChanges {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/tag-select/tag-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
template: `
<ng-content></ng-content>
<a *ngIf="expandable" class="trigger" (click)="trigger()">{{expand ? '收起' : '展开'}}<i class="anticon anticon-{{expand ? 'up' : 'down'}} ml-sm"></i></a>`,
styleUrls: [ './tag-select.less' ]
styleUrls: [ './tag-select.less' ],
preserveWhitespaces: false
})
export class TagSelectComponent {

Expand Down
3 changes: 2 additions & 1 deletion src/core/abc/trend/trend.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
// tslint:disable-next-line:use-host-property-decorator
host: {
'[class.grey]': '!colorful'
}
},
preserveWhitespaces: false
})
export class TrendComponent {

Expand Down

0 comments on commit 9775c91

Please sign in to comment.