UNPKG

@angular/material

Version:
61 lines 7.38 kB
/** * @license * Copyright Google LLC All Rights Reserved. * * 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 */ import { CdkTextColumn } from '@angular/cdk/table'; import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; import * as i0 from "@angular/core"; import * as i1 from "./cell"; /** * Column that simply shows text content for the header and row cells. Assumes that the table * is using the native table implementation (`<table>`). * * By default, the name of this column will be the header text and data property accessor. * The header text can be overridden with the `headerText` input. Cell values can be overridden with * the `dataAccessor` input. Change the text justification to the start or end using the `justify` * input. * * @deprecated Use `MatTextColumn` from `@angular/material/table` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. * @breaking-change 17.0.0 */ export class MatLegacyTextColumn extends CdkTextColumn { } MatLegacyTextColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: MatLegacyTextColumn, deps: null, target: i0.ɵɵFactoryTarget.Component }); MatLegacyTextColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0-rc.0", type: MatLegacyTextColumn, selector: "mat-text-column", usesInheritance: true, ngImport: i0, template: ` <ng-container matColumnDef> <th mat-header-cell *matHeaderCellDef [style.text-align]="justify"> {{headerText}} </th> <td mat-cell *matCellDef="let data" [style.text-align]="justify"> {{dataAccessor(data, name)}} </td> </ng-container> `, isInline: true, dependencies: [{ kind: "directive", type: i1.MatLegacyHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1.MatLegacyColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i1.MatLegacyCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1.MatLegacyHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1.MatLegacyCell, selector: "mat-cell, td[mat-cell]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0-rc.0", ngImport: i0, type: MatLegacyTextColumn, decorators: [{ type: Component, args: [{ selector: 'mat-text-column', template: ` <ng-container matColumnDef> <th mat-header-cell *matHeaderCellDef [style.text-align]="justify"> {{headerText}} </th> <td mat-cell *matCellDef="let data" [style.text-align]="justify"> {{dataAccessor(data, name)}} </td> </ng-container> `, encapsulation: ViewEncapsulation.None, // Change detection is intentionally not set to OnPush. This component's template will be provided // to the table to be inserted into its view. This is problematic when change detection runs since // the bindings in this template will be evaluated _after_ the table's view is evaluated, which // mean's the template in the table's view will not have the updated value (and in fact will cause // an ExpressionChangedAfterItHasBeenCheckedError). // tslint:disable-next-line:validate-decorators changeDetection: ChangeDetectionStrategy.Default, }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dC1jb2x1bW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvbGVnYWN5LXRhYmxlL3RleHQtY29sdW1uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxhQUFhLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQztBQUNqRCxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFDLE1BQU0sZUFBZSxDQUFDOzs7QUFFcEY7Ozs7Ozs7Ozs7O0dBV0c7QUFzQkgsTUFBTSxPQUFPLG1CQUF1QixTQUFRLGFBQWdCOztxSEFBL0MsbUJBQW1CO3lHQUFuQixtQkFBbUIsOEVBbkJwQjs7Ozs7Ozs7O0dBU1Q7Z0dBVVUsbUJBQW1CO2tCQXJCL0IsU0FBUzttQkFBQztvQkFDVCxRQUFRLEVBQUUsaUJBQWlCO29CQUMzQixRQUFRLEVBQUU7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