2017-06-29 10:23:56 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
2017-10-06 14:31:05 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2017-06-29 10:23:56 -07:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
|
*/
|
|
|
|
|
|
2018-04-25 09:57:57 -07:00
|
|
|
import {
|
|
|
|
|
Attribute,
|
|
|
|
|
ChangeDetectionStrategy,
|
|
|
|
|
ChangeDetectorRef,
|
|
|
|
|
Component,
|
|
|
|
|
ElementRef,
|
|
|
|
|
IterableDiffers,
|
|
|
|
|
ViewEncapsulation
|
|
|
|
|
} from '@angular/core';
|
2017-07-25 16:15:24 -07:00
|
|
|
import {CDK_TABLE_TEMPLATE, CdkTable} from '@angular/cdk/table';
|
2017-06-29 14:21:20 -07:00
|
|
|
|
2017-06-29 10:23:56 -07:00
|
|
|
/**
|
|
|
|
|
* Wrapper for the CdkTable with Material design styles.
|
|
|
|
|
*/
|
|
|
|
|
@Component({
|
|
|
|
|
moduleId: module.id,
|
2018-03-30 07:29:19 -07:00
|
|
|
selector: 'mat-table, table[mat-table]',
|
2017-10-04 23:52:52 +02:00
|
|
|
exportAs: 'matTable',
|
2017-06-29 10:23:56 -07:00
|
|
|
template: CDK_TABLE_TEMPLATE,
|
|
|
|
|
styleUrls: ['table.css'],
|
|
|
|
|
host: {
|
|
|
|
|
'class': 'mat-table',
|
|
|
|
|
},
|
|
|
|
|
encapsulation: ViewEncapsulation.None,
|
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
|
|
|
})
|
2018-04-25 09:57:57 -07:00
|
|
|
export class MatTable<T> extends CdkTable<T> {
|
|
|
|
|
// TODO(andrewseguin): Remove this explicitly set constructor when the compiler knows how to
|
|
|
|
|
// properly build the es6 version of the class. Currently sets ctorParameters to empty due to a
|
|
|
|
|
// fixed bug.
|
|
|
|
|
// https://github.com/angular/tsickle/pull/760 - tsickle PR that fixed this
|
|
|
|
|
// https://github.com/angular/angular/pull/23531 - updates compiler-cli to fixed version
|
|
|
|
|
constructor(protected _differs: IterableDiffers,
|
|
|
|
|
protected _changeDetectorRef: ChangeDetectorRef,
|
|
|
|
|
protected _elementRef: ElementRef,
|
|
|
|
|
@Attribute('role') role: string) {
|
|
|
|
|
super(_differs, _changeDetectorRef, _elementRef, role);
|
|
|
|
|
}
|
|
|
|
|
}
|