From 696a6c40e94a183e8932116807c9c699b0d7b3e8 Mon Sep 17 00:00:00 2001 From: Merott Movahedi Date: Wed, 28 Nov 2018 12:51:04 +0000 Subject: [PATCH] build: fix some TS build issues in templates Fixes _some_ of the issues found when ng-zorro is used in projects with TS strict mode, mostly in HTML templates. Partially addresses #660, but still a long way to go. --- components/message/nz-message-config.ts | 3 +++ components/notification/nz-notification.component.html | 4 ++-- components/pagination/nz-pagination.component.ts | 4 ++-- components/table/nz-td.component.html | 2 +- components/table/nz-th.component.ts | 2 +- components/tabs/nz-tabset.component.html | 2 +- components/upload/interface.ts | 1 + 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/components/message/nz-message-config.ts b/components/message/nz-message-config.ts index 0c2736132e6..d825d7237e3 100644 --- a/components/message/nz-message-config.ts +++ b/components/message/nz-message-config.ts @@ -7,6 +7,9 @@ export interface NzMessageConfig { nzAnimate?: boolean; // For message container only nzMaxStack?: number; + nzTop?: string; + nzBottom?: string; + nzPlacement?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | string; /* tslint:disable-next-line:no-any */ [index: string]: any; } diff --git a/components/notification/nz-notification.component.html b/components/notification/nz-notification.component.html index 84bd9152942..74c56a479d2 100644 --- a/components/notification/nz-notification.component.html +++ b/components/notification/nz-notification.component.html @@ -1,6 +1,6 @@
diff --git a/components/pagination/nz-pagination.component.ts b/components/pagination/nz-pagination.component.ts index bf5b6b710c4..00ba9af49ec 100644 --- a/components/pagination/nz-pagination.component.ts +++ b/components/pagination/nz-pagination.component.ts @@ -35,7 +35,7 @@ export class NzPaginationComponent implements OnInit, OnDestroy { private _total: number; private _pageIndex = 1; firstIndex = 1; - pages = []; + pages: Array<{index: number}> = []; @Input() nzShowTotal: TemplateRef<{ $implicit: number, range: [ number, number ] }>; @Input() nzInTable = false; @Input() nzSize: string; @@ -231,7 +231,7 @@ export class NzPaginationComponent implements OnInit, OnDestroy { /** generate indexes list */ buildIndexes(): void { - const tmpPages = []; + const tmpPages: Array<{index: number}> = []; if (this.lastIndex <= 9) { for (let i = 2; i <= this.lastIndex - 1; i++) { tmpPages.push({ index: i }); diff --git a/components/table/nz-td.component.html b/components/table/nz-td.component.html index d781db0a790..c647bcd1358 100644 --- a/components/table/nz-td.component.html +++ b/components/table/nz-td.component.html @@ -8,7 +8,7 @@ (ngModelChange)="nzCheckedChange.emit($event)"> = []; + @Input() nzSelections: Array<{ text: string, onSelect(): any }> = []; @Input() nzChecked = false; @Input() nzDisabled = false; @Input() nzIndeterminate = false; diff --git a/components/tabs/nz-tabset.component.html b/components/tabs/nz-tabset.component.html index ab9eee0cff6..2579e3cec6b 100644 --- a/components/tabs/nz-tabset.component.html +++ b/components/tabs/nz-tabset.component.html @@ -32,7 +32,7 @@ #tabContent [class.ant-tabs-content-animated]="tabPaneAnimated" [class.ant-tabs-content-no-animated]="!tabPaneAnimated" - [style.margin-left.%]="tabPaneAnimated&&(-nzSelectedIndex*100)"> + [style.margin-left.%]="tabPaneAnimated&&(-(nzSelectedIndex || 0)*100)">