From 9775c91fb39c28e3798caa102e900b163371b026 Mon Sep 17 00:00:00 2001 From: cipchk Date: Sat, 10 Mar 2018 22:25:13 +0800 Subject: [PATCH] refactor(abc): use preserveWhitespaces: false --- .gitignore | 1 + src/core/abc/avatar-list/avatar-list.component.ts | 3 ++- src/core/abc/charts/bar/bar.component.ts | 3 ++- src/core/abc/charts/card/card.component.ts | 3 ++- .../abc/charts/mini-progress/mini-progress.component.ts | 3 ++- src/core/abc/charts/pie/pie.component.ts | 3 ++- src/core/abc/charts/radar/radar.component.ts | 3 ++- src/core/abc/charts/timeline/timeline.component.ts | 3 ++- src/core/abc/charts/water-wave/water-wave.component.ts | 3 ++- src/core/abc/count-down/count-down.component.ts | 3 ++- src/core/abc/desc-list/desc-list-item.component.ts | 3 ++- src/core/abc/desc-list/desc-list.component.ts | 3 ++- src/core/abc/error-collect/error-collect.component.ts | 8 ++++++-- src/core/abc/exception/exception.component.ts | 3 ++- src/core/abc/footer-toolbar/footer-toolbar.component.ts | 3 ++- src/core/abc/global-footer/global-footer.component.ts | 3 ++- src/core/abc/number-info/number-info.component.ts | 3 ++- src/core/abc/pro-header/pro-header.component.ts | 3 ++- src/core/abc/result/result.component.ts | 3 ++- src/core/abc/reuse-tab/reuse-tab.component.ts | 3 ++- src/core/abc/simple-table/simple-table.component.ts | 3 ++- .../abc/standard-form-row/standard-form-row.component.ts | 3 ++- src/core/abc/tag-select/tag-select.component.ts | 3 ++- src/core/abc/trend/trend.component.ts | 3 ++- 24 files changed, 51 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index f023461d48..9bb504941f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist coverage site/app/routes/gen .idea +debug.log diff --git a/src/core/abc/avatar-list/avatar-list.component.ts b/src/core/abc/avatar-list/avatar-list.component.ts index 6cce307243..d52bc82462 100644 --- a/src/core/abc/avatar-list/avatar-list.component.ts +++ b/src/core/abc/avatar-list/avatar-list.component.ts @@ -13,7 +13,8 @@ import { AvatarListItemComponent } from './avatar-list-item.component'; `, - styleUrls: [ './avatar-list.less' ] + styleUrls: [ './avatar-list.less' ], + preserveWhitespaces: false }) export class AvatarListComponent { diff --git a/src/core/abc/charts/bar/bar.component.ts b/src/core/abc/charts/bar/bar.component.ts index 46f05d1cb3..6b109795ea 100644 --- a/src/core/abc/charts/bar/bar.component.ts +++ b/src/core/abc/charts/bar/bar.component.ts @@ -10,7 +10,8 @@ import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coerci template: `

{{_title}}

`, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + preserveWhitespaces: false }) export class G2BarComponent implements OnDestroy, OnChanges, OnInit { diff --git a/src/core/abc/charts/card/card.component.ts b/src/core/abc/charts/card/card.component.ts index 05782aa609..1340d9ddcc 100644 --- a/src/core/abc/charts/card/card.component.ts +++ b/src/core/abc/charts/card/card.component.ts @@ -31,7 +31,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion'; `, - styleUrls: [ './card.less' ] + styleUrls: [ './card.less' ], + preserveWhitespaces: false }) export class ChartCardComponent { diff --git a/src/core/abc/charts/mini-progress/mini-progress.component.ts b/src/core/abc/charts/mini-progress/mini-progress.component.ts index 9ad046757c..76353f6cab 100644 --- a/src/core/abc/charts/mini-progress/mini-progress.component.ts +++ b/src/core/abc/charts/mini-progress/mini-progress.component.ts @@ -14,7 +14,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
`, - styleUrls: [ './mini-progress.less' ] + styleUrls: [ './mini-progress.less' ], + preserveWhitespaces: false }) export class MiniProgressComponent { diff --git a/src/core/abc/charts/pie/pie.component.ts b/src/core/abc/charts/pie/pie.component.ts index af82947937..7d1fa90d90 100644 --- a/src/core/abc/charts/pie/pie.component.ts +++ b/src/core/abc/charts/pie/pie.component.ts @@ -26,7 +26,8 @@ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coerci `, styleUrls: [ './pie.less' ], encapsulation: ViewEncapsulation.Emulated, - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + preserveWhitespaces: false }) export class G2PieComponent implements OnDestroy, OnChanges, OnInit { diff --git a/src/core/abc/charts/radar/radar.component.ts b/src/core/abc/charts/radar/radar.component.ts index 7059ebb2de..0df86c84a9 100644 --- a/src/core/abc/charts/radar/radar.component.ts +++ b/src/core/abc/charts/radar/radar.component.ts @@ -18,7 +18,8 @@ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coerci `, styleUrls: [ './radar.less' ], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + preserveWhitespaces: false }) export class G2RadarComponent implements OnDestroy, OnChanges, OnInit { diff --git a/src/core/abc/charts/timeline/timeline.component.ts b/src/core/abc/charts/timeline/timeline.component.ts index 48ea94cfad..f0696cf7e6 100644 --- a/src/core/abc/charts/timeline/timeline.component.ts +++ b/src/core/abc/charts/timeline/timeline.component.ts @@ -8,7 +8,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
`, styles: [ `:host {display:block}` ], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + preserveWhitespaces: false }) export class TimelineComponent implements OnDestroy, OnChanges, OnInit { diff --git a/src/core/abc/charts/water-wave/water-wave.component.ts b/src/core/abc/charts/water-wave/water-wave.component.ts index 170921d514..3da68174ae 100644 --- a/src/core/abc/charts/water-wave/water-wave.component.ts +++ b/src/core/abc/charts/water-wave/water-wave.component.ts @@ -16,7 +16,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';

{{percent}}%

`, styleUrls: [ './water-wave.less' ], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + preserveWhitespaces: false }) export class WaterWaveComponent implements OnDestroy, OnChanges, OnInit { diff --git a/src/core/abc/count-down/count-down.component.ts b/src/core/abc/count-down/count-down.component.ts index 983922c107..65d5ba8c01 100644 --- a/src/core/abc/count-down/count-down.component.ts +++ b/src/core/abc/count-down/count-down.component.ts @@ -9,7 +9,8 @@ import * as moment from 'moment'; (finished)="_finished()" (notify)="_notify($event)"> `, - styleUrls: [ './count-down.less' ] + styleUrls: [ './count-down.less' ], + preserveWhitespaces: false }) export class CountDownComponent { diff --git a/src/core/abc/desc-list/desc-list-item.component.ts b/src/core/abc/desc-list/desc-list-item.component.ts index b4c46ad636..4f36a8315e 100644 --- a/src/core/abc/desc-list/desc-list-item.component.ts +++ b/src/core/abc/desc-list/desc-list-item.component.ts @@ -9,7 +9,8 @@ import { Component, Input, ViewChild, TemplateRef } from '@angular/core';
- ` + `, + preserveWhitespaces: false }) export class DescListItemComponent { diff --git a/src/core/abc/desc-list/desc-list.component.ts b/src/core/abc/desc-list/desc-list.component.ts index 9d738b57ca..5897d11ffe 100644 --- a/src/core/abc/desc-list/desc-list.component.ts +++ b/src/core/abc/desc-list/desc-list.component.ts @@ -14,7 +14,8 @@ import { DescListItemComponent } from './desc-list-item.component'; `, - styleUrls: [ './desc-list.less' ] + styleUrls: [ './desc-list.less' ], + preserveWhitespaces: false }) export class DescListComponent implements OnChanges, OnInit { diff --git a/src/core/abc/error-collect/error-collect.component.ts b/src/core/abc/error-collect/error-collect.component.ts index c230fefd15..efca5bd3c8 100644 --- a/src/core/abc/error-collect/error-collect.component.ts +++ b/src/core/abc/error-collect/error-collect.component.ts @@ -9,8 +9,12 @@ import { coerceNumberProperty } from '@angular/cdk/coercion'; */ @Component({ selector: 'error-collect, [error-collect]', - template: ` {{count}}`, - changeDetection: ChangeDetectionStrategy.OnPush + template: ` + + {{count}} + `, + changeDetection: ChangeDetectionStrategy.OnPush, + preserveWhitespaces: false }) export class ErrorCollectComponent implements OnInit, OnDestroy { diff --git a/src/core/abc/exception/exception.component.ts b/src/core/abc/exception/exception.component.ts index 46b56201a6..2c1253ccac 100644 --- a/src/core/abc/exception/exception.component.ts +++ b/src/core/abc/exception/exception.component.ts @@ -19,7 +19,8 @@ import { Component, Input, ContentChild, TemplateRef } from '@angular/core'; `, - styleUrls: [ './exception.less' ] + styleUrls: [ './exception.less' ], + preserveWhitespaces: false }) export class ExceptionComponent { diff --git a/src/core/abc/footer-toolbar/footer-toolbar.component.ts b/src/core/abc/footer-toolbar/footer-toolbar.component.ts index ff761a88ec..b3bc22edcd 100644 --- a/src/core/abc/footer-toolbar/footer-toolbar.component.ts +++ b/src/core/abc/footer-toolbar/footer-toolbar.component.ts @@ -13,7 +13,8 @@ const CLS = 'footer-toolbar'; - ` + `, + preserveWhitespaces: false }) export class FooterToolbarComponent implements OnInit, OnDestroy { diff --git a/src/core/abc/global-footer/global-footer.component.ts b/src/core/abc/global-footer/global-footer.component.ts index a2cbad91b1..46918ce77e 100644 --- a/src/core/abc/global-footer/global-footer.component.ts +++ b/src/core/abc/global-footer/global-footer.component.ts @@ -8,7 +8,8 @@ import { Component, ContentChild, TemplateRef, Input } from '@angular/core'; `, - styleUrls: [ './global-footer.less' ] + styleUrls: [ './global-footer.less' ], + preserveWhitespaces: false }) export class GlobalFooterComponent { diff --git a/src/core/abc/number-info/number-info.component.ts b/src/core/abc/number-info/number-info.component.ts index 72829b24ec..ab4ea5f7c4 100644 --- a/src/core/abc/number-info/number-info.component.ts +++ b/src/core/abc/number-info/number-info.component.ts @@ -14,7 +14,8 @@ import { coerceNumberProperty } from '@angular/cdk/coercion'; `, - styleUrls: [ './number-info.less' ] + styleUrls: [ './number-info.less' ], + preserveWhitespaces: false }) export class NumberInfoComponent implements OnChanges { _title = ''; diff --git a/src/core/abc/pro-header/pro-header.component.ts b/src/core/abc/pro-header/pro-header.component.ts index 902bb9f915..dfbf5b5a10 100644 --- a/src/core/abc/pro-header/pro-header.component.ts +++ b/src/core/abc/pro-header/pro-header.component.ts @@ -32,7 +32,8 @@ import { ProHeaderConfig } from './pro-header.config'; `, - styleUrls: [ './pro-header.less' ] + styleUrls: [ './pro-header.less' ], + preserveWhitespaces: false }) export class ProHeaderComponent implements OnInit, OnChanges { diff --git a/src/core/abc/result/result.component.ts b/src/core/abc/result/result.component.ts index b121af2827..bd9a5c80c6 100644 --- a/src/core/abc/result/result.component.ts +++ b/src/core/abc/result/result.component.ts @@ -11,7 +11,8 @@ import { Component, Input, TemplateRef, ContentChild } from '@angular/core';
`, - styleUrls: [ './result.less' ] + styleUrls: [ './result.less' ], + preserveWhitespaces: false }) export class ResultComponent { diff --git a/src/core/abc/reuse-tab/reuse-tab.component.ts b/src/core/abc/reuse-tab/reuse-tab.component.ts index 65a3e4a537..bce2b82f9c 100644 --- a/src/core/abc/reuse-tab/reuse-tab.component.ts +++ b/src/core/abc/reuse-tab/reuse-tab.component.ts @@ -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; diff --git a/src/core/abc/simple-table/simple-table.component.ts b/src/core/abc/simple-table/simple-table.component.ts index 7f79628797..446ec6d561 100644 --- a/src/core/abc/simple-table/simple-table.component.ts +++ b/src/core/abc/simple-table/simple-table.component.ts @@ -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 { diff --git a/src/core/abc/standard-form-row/standard-form-row.component.ts b/src/core/abc/standard-form-row/standard-form-row.component.ts index b409e1ccb9..1a3dfb9187 100644 --- a/src/core/abc/standard-form-row/standard-form-row.component.ts +++ b/src/core/abc/standard-form-row/standard-form-row.component.ts @@ -7,7 +7,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
{{title}}
`, - styleUrls: [ './standard-form-row.less' ] + styleUrls: [ './standard-form-row.less' ], + preserveWhitespaces: false }) export class StandardFormRowComponent implements OnChanges { diff --git a/src/core/abc/tag-select/tag-select.component.ts b/src/core/abc/tag-select/tag-select.component.ts index 4cd221ceef..ace4f3e84a 100644 --- a/src/core/abc/tag-select/tag-select.component.ts +++ b/src/core/abc/tag-select/tag-select.component.ts @@ -6,7 +6,8 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion'; template: ` {{expand ? '收起' : '展开'}}`, - styleUrls: [ './tag-select.less' ] + styleUrls: [ './tag-select.less' ], + preserveWhitespaces: false }) export class TagSelectComponent { diff --git a/src/core/abc/trend/trend.component.ts b/src/core/abc/trend/trend.component.ts index fd4dbe4424..42d649eea7 100644 --- a/src/core/abc/trend/trend.component.ts +++ b/src/core/abc/trend/trend.component.ts @@ -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 {