[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { OnDestroy, OnInit } from '@angular/core';
|
---|
| 9 | import { CdkCellDef, CdkColumnDef, CdkHeaderCellDef } from './cell';
|
---|
| 10 | import { CdkTable } from './table';
|
---|
| 11 | import { TextColumnOptions } from './tokens';
|
---|
| 12 | /**
|
---|
| 13 | * Column that simply shows text content for the header and row cells. Assumes that the table
|
---|
| 14 | * is using the native table implementation (`<table>`).
|
---|
| 15 | *
|
---|
| 16 | * By default, the name of this column will be the header text and data property accessor.
|
---|
| 17 | * The header text can be overridden with the `headerText` input. Cell values can be overridden with
|
---|
| 18 | * the `dataAccessor` input. Change the text justification to the start or end using the `justify`
|
---|
| 19 | * input.
|
---|
| 20 | */
|
---|
| 21 | export declare class CdkTextColumn<T> implements OnDestroy, OnInit {
|
---|
| 22 | private _table;
|
---|
| 23 | private _options;
|
---|
| 24 | /** Column name that should be used to reference this column. */
|
---|
| 25 | get name(): string;
|
---|
| 26 | set name(name: string);
|
---|
| 27 | _name: string;
|
---|
| 28 | /**
|
---|
| 29 | * Text label that should be used for the column header. If this property is not
|
---|
| 30 | * set, the header text will default to the column name with its first letter capitalized.
|
---|
| 31 | */
|
---|
| 32 | headerText: string;
|
---|
| 33 | /**
|
---|
| 34 | * Accessor function to retrieve the data rendered for each cell. If this
|
---|
| 35 | * property is not set, the data cells will render the value found in the data's property matching
|
---|
| 36 | * the column's name. For example, if the column is named `id`, then the rendered value will be
|
---|
| 37 | * value defined by the data's `id` property.
|
---|
| 38 | */
|
---|
| 39 | dataAccessor: (data: T, name: string) => string;
|
---|
| 40 | /** Alignment of the cell values. */
|
---|
| 41 | justify: 'start' | 'end';
|
---|
| 42 | /** @docs-private */
|
---|
| 43 | columnDef: CdkColumnDef;
|
---|
| 44 | /**
|
---|
| 45 | * The column cell is provided to the column during `ngOnInit` with a static query.
|
---|
| 46 | * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
|
---|
| 47 | * column definition was provided in the same view as the table, which is not the case with this
|
---|
| 48 | * component.
|
---|
| 49 | * @docs-private
|
---|
| 50 | */
|
---|
| 51 | cell: CdkCellDef;
|
---|
| 52 | /**
|
---|
| 53 | * The column headerCell is provided to the column during `ngOnInit` with a static query.
|
---|
| 54 | * Normally, this will be retrieved by the column using `ContentChild`, but that assumes the
|
---|
| 55 | * column definition was provided in the same view as the table, which is not the case with this
|
---|
| 56 | * component.
|
---|
| 57 | * @docs-private
|
---|
| 58 | */
|
---|
| 59 | headerCell: CdkHeaderCellDef;
|
---|
| 60 | constructor(_table: CdkTable<T>, _options: TextColumnOptions<T>);
|
---|
| 61 | ngOnInit(): void;
|
---|
| 62 | ngOnDestroy(): void;
|
---|
| 63 | /**
|
---|
| 64 | * Creates a default header text. Use the options' header text transformation function if one
|
---|
| 65 | * has been provided. Otherwise simply capitalize the column name.
|
---|
| 66 | */
|
---|
| 67 | _createDefaultHeaderText(): string;
|
---|
| 68 | /** Synchronizes the column definition name with the text column name. */
|
---|
| 69 | private _syncColumnDefName;
|
---|
| 70 | }
|
---|