compat(table): add mat-compatible rows (#6603)

This commit is contained in:
Andrew Seguin
2017-08-23 13:28:36 -07:00
committed by Kara
parent c4a5d7a038
commit 32f42d6fb5
2 changed files with 23 additions and 5 deletions
+5 -3
View File
@@ -10,7 +10,7 @@ import {NgModule} from '@angular/core';
import {MdTable} from './table';
import {CdkTableModule} from '@angular/cdk/table';
import {MdCell, MdHeaderCell, MdCellDef, MdHeaderCellDef, MdColumnDef} from './cell';
import {MdHeaderRow, MdRow, MdHeaderRowDef, MdRowDef} from './row';
import {MdHeaderRow, MdRow, MdHeaderRowDef, MdRowDef, MatHeaderRowDef, MatRowDef} from './row';
import {CommonModule} from '@angular/common';
import {MdCommonModule} from '../core';
@@ -22,9 +22,11 @@ export * from './row';
imports: [CdkTableModule, CommonModule, MdCommonModule],
exports: [MdTable, MdCellDef, MdHeaderCellDef, MdColumnDef,
MdHeaderRowDef, MdRowDef,
MdHeaderCell, MdCell, MdHeaderRow, MdRow],
MdHeaderCell, MdCell, MdHeaderRow, MdRow,
MatHeaderRowDef, MatRowDef],
declarations: [MdTable, MdCellDef, MdHeaderCellDef, MdColumnDef,
MdHeaderRowDef, MdRowDef,
MdHeaderCell, MdCell, MdHeaderRow, MdRow],
MdHeaderCell, MdCell, MdHeaderRow, MdRow,
MatHeaderRowDef, MatRowDef],
})
export class MdTableModule {}
+18 -2
View File
@@ -26,23 +26,39 @@ export const _MdRow = CdkRow;
* Captures the header row's template and other header properties such as the columns to display.
*/
@Directive({
selector: '[mdHeaderRowDef], [matHeaderRowDef]',
selector: '[mdHeaderRowDef]',
providers: [{provide: CdkHeaderRowDef, useExisting: MdHeaderRowDef}],
inputs: ['columns: mdHeaderRowDef'],
})
export class MdHeaderRowDef extends _MdHeaderRowDef { }
/** Mat-compatible version of MdHeaderRowDef */
@Directive({
selector: '[matHeaderRowDef]',
providers: [{provide: CdkHeaderRowDef, useExisting: MatHeaderRowDef}],
inputs: ['columns: matHeaderRowDef'],
})
export class MatHeaderRowDef extends _MdHeaderRowDef { }
/**
* Data row definition for the md-table.
* Captures the header row's template and other row properties such as the columns to display.
*/
@Directive({
selector: '[mdRowDef], [matRowDef]',
selector: '[mdRowDef]',
providers: [{provide: CdkRowDef, useExisting: MdRowDef}],
inputs: ['columns: mdRowDefColumns'],
})
export class MdRowDef extends _MdCdkRowDef { }
/** Mat-compatible version of MdRowDef */
@Directive({
selector: '[matRowDef]',
providers: [{provide: CdkRowDef, useExisting: MatRowDef}],
inputs: ['columns: matRowDefColumns'],
})
export class MatRowDef extends _MdCdkRowDef { }
/** Header template container that contains the cell outlet. Adds the right class and role. */
@Component({
selector: 'md-header-row, mat-header-row',