import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TrackByFunction } from '@angular/core'; import { MatTable } from '@angular/material/table'; import { Observable } from 'rxjs'; import { TableVirtualScrollDataSource } from '../components/data-source.class'; import { MatMultiSort, Sort, SortHeaderArrowPosition } from '../directives/datatable-sort'; import { FieldFilterDefinition, DataStoreProvider } from '../interfaces/datastore-provider.interface'; import { ColumnAlignmentType, MatColumnDefinition, CellValueString, CellValueImage, CellValueMailTo } from '../interfaces/datatable-column-definition.interface'; import { MatSortDefinition } from '../interfaces/datatable-sort-definition.interface'; import * as i0 from "@angular/core"; export type RowSelectionType = 'none' | 'single' | 'multi'; /** * Datatable component based on Angular Material. * @class MatDatatableComponent * @implements { AfterViewInit } * @template TRowData - type / interface definition for data of a single row */ export declare class MatDatatableComponent implements AfterViewInit, OnChanges, OnDestroy, OnInit { columnDefinitions: MatColumnDefinition[]; displayedColumns: string[]; rowSelectionMode: RowSelectionType; dataStoreProvider: DataStoreProvider; get trackBy(): TrackByFunction; set trackBy(fn: TrackByFunction); protected _trackByFn: TrackByFunction; withFooter: boolean; rowClick: EventEmitter; rowSelectionChange: EventEmitter; sortChange: EventEmitter; firstVisibleIndexChanged: Observable; totalRowsChanged: Observable; filteredRowsChanged: Observable; protected table: MatTable; protected viewport: CdkVirtualScrollViewport; protected sort: MatMultiSort; protected StringCell: CellValueString; protected MailToCell: CellValueMailTo; protected ImageCell: CellValueImage; protected displayedFooterColumns: string[]; protected dataSource: TableVirtualScrollDataSource; protected currentActivatedRow: TRowData | undefined; protected currentSelectedRows: TRowData[]; private tvs; private readonly unsubscribe$; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; /** * Property to be used to mark a single row (e.g. to be used to * mark the "current" row, when returning from a detail view). */ get activatedRow(): TRowData | undefined; set activatedRow(newActiveRow: TRowData | undefined); get selectedRows(): TRowData[]; set selectedRows(newSelection: TRowData[]); get sortDefinitions(): MatSortDefinition[]; set sortDefinitions(matSortDefinitions: MatSortDefinition[]); get filterDefinitions(): FieldFilterDefinition[]; set filterDefinitions(newFilters: FieldFilterDefinition[]); scrollToRow(row: TRowData): void; reloadTable(): void; /** * Gets 'ngStyle' property of table header cell. * This method creates the style to set the column width. * @param columnDefinition - object defining a table cell * @returns object with properties that reflect the css styles of the header cell */ protected headerFormat(columnDefinition: MatColumnDefinition): Record | undefined; /** * Gets 'ngStyle' property of table data cell. * This method creates the style for data cells according to the given definition. * @param columnDefinition - object defining a table cell * @returns object with properties that reflect the css styles of the data cell */ protected columnFormat(columnDefinition: MatColumnDefinition): Record | undefined; /** * Gets 'ngStyle' property of table footer cell. * This method creates the style for footer cells according to the given definition. * @param footerCellAlignment - definition of the footer cell * @returns object with properties that reflect the css styles of the footer cell */ protected footerColumnFormat(footerCellAlignment?: ColumnAlignmentType): Record | undefined; protected sortArrowPosition(columnDefinition: MatColumnDefinition): SortHeaderArrowPosition; protected onRowClicked(row: TRowData): void; protected onRowSelectionChanged(): void; protected onMultiSortChanged(sortStates: Sort[]): void; /** * Are 2 rows equal? Used by template to mark currentActivatedRow. * @param rowA - first row to compare * @param rowB - second row to compare * @returns true: rowA equals rowB */ protected areRowsEqual(rowA: TRowData, rowB: TRowData): boolean; /** * Check, if the given row is part of the selectedRows. * @param row - row to be checked * @returns true = given row is part of the selectedRows */ protected selectedRowsIncludes(row: TRowData): boolean; /** * Extract the list of footer columns to display from the * list of columns to display. The footer can have columns tha * span several columns; therefore we need a different list. * @param newDisplayedColumns - list of the id of the columns to display * @returns list of the id of the footer columns to display */ private footerColumnsFromColumns; /** * Convert an array of type Sort[] to an array of type RequestSortDataList[] * used in class PaginationDataSource. * @param sorts - sorting definition to convert * @returns sorting definition as array of type RequestSortDataList */ private requestSortDefinitionFromSortArray; /** * Convert an array of type Sort[] to an array of type MatSortDefinition[]. * @param sorts - sorting definition to convert * @returns sorting definition as array of type MatSortDefinition */ private matSortDefinitionFromSortArray; /** * Default implementation of trackBy function. * This function is required, as in strict mode 'trackBy' * must not be undefined. * @param this - required by eslint rule "typescript-eslint/unbound-method" * @param index - index of the row * @param item - object with the row data * @returns stringified content of the item */ private defaultTrackBy; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "mat-datatable", never, { "columnDefinitions": { "alias": "columnDefinitions"; "required": false; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; }; "rowSelectionMode": { "alias": "rowSelectionMode"; "required": false; }; "dataStoreProvider": { "alias": "dataStoreProvider"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; "withFooter": { "alias": "withFooter"; "required": false; }; }, { "rowClick": "rowClick"; "rowSelectionChange": "rowSelectionChange"; "sortChange": "sortChange"; }, never, never, true, never>; }