From 79b02ca9538cdf392db25bc818a550987c7a454f Mon Sep 17 00:00:00 2001 From: vthinkxie Date: Thu, 27 Jun 2019 17:07:19 +0800 Subject: [PATCH] fix(module:table): compatible with @angular/material/table --- components/table/nz-td.component.ts | 2 +- components/table/nz-th.component.ts | 2 +- components/table/nz-tr.directive.ts | 2 +- components/tooltip/nz-tooltip.directive.ts | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/table/nz-td.component.ts b/components/table/nz-td.component.ts index 62089175d27..6f3ba88d7e2 100644 --- a/components/table/nz-td.component.ts +++ b/components/table/nz-td.component.ts @@ -22,7 +22,7 @@ import { isNotNil, InputBoolean, NzUpdateHostClassService } from 'ng-zorro-antd/ @Component({ // tslint:disable-next-line:component-selector - selector: 'td:not(.nz-disable-td)', + selector: 'td:not(.nz-disable-td):not([mat-cell])', changeDetection: ChangeDetectionStrategy.OnPush, providers: [NzUpdateHostClassService], preserveWhitespaces: false, diff --git a/components/table/nz-th.component.ts b/components/table/nz-th.component.ts index d08b4bdd200..a7ae57e700a 100644 --- a/components/table/nz-th.component.ts +++ b/components/table/nz-th.component.ts @@ -39,7 +39,7 @@ export interface NzThItemInterface { @Component({ // tslint:disable-next-line:component-selector - selector: 'th:not(.nz-disable-th)', + selector: 'th:not(.nz-disable-th):not([mat-sort-header]):not([mat-header-cell])', preserveWhitespaces: false, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/components/table/nz-tr.directive.ts b/components/table/nz-tr.directive.ts index 2a0cbcbb652..08d805b553c 100644 --- a/components/table/nz-tr.directive.ts +++ b/components/table/nz-tr.directive.ts @@ -12,7 +12,7 @@ import { NzTableComponent } from './nz-table.component'; @Directive({ // tslint:disable-next-line:directive-selector - selector: 'tr', + selector: 'tr:not([mat-row]):not([mat-header-row])', host: { '[class.ant-table-row]': 'nzTableComponent' } diff --git a/components/tooltip/nz-tooltip.directive.ts b/components/tooltip/nz-tooltip.directive.ts index 5daebf6653a..fabeeddc43d 100644 --- a/components/tooltip/nz-tooltip.directive.ts +++ b/components/tooltip/nz-tooltip.directive.ts @@ -169,6 +169,7 @@ export class NzTooltipDirective implements AfterViewInit, OnChanges, OnInit, OnD protected updateCompValue(key: string, value: any): void { if (this.isDynamicTooltip && isNotNil(value)) { this.tooltip[key] = value; + this.tooltip.setClassMap(); Promise.resolve().then(() => { this.tooltip.updatePosition(); });