UNPKG

@asi-ngtools/lib

Version:

This project is a little components library, simple to use, which will help you to simplify your project.

63 lines (62 loc) 2.48 kB
import { AsiPaginationService } from './../../services/asi-pagination.service'; import { AsiTableSelectionModel } from './asi-table-config'; import { AsiTableData } from './asi-table-data'; import { AsiTableColumn } from './asi-table-column.directive'; import { QueryList, AfterContentInit, ElementRef } from '@angular/core'; export declare class AsiTable<T> implements AfterContentInit { private paginateService; queryColumns: QueryList<AsiTableColumn>; /** Sorte table automatically */ autoSort: boolean; /** Auto paginate the table */ autoPaginate: boolean; /** Nb element by page */ nbElementParPage: number; /** Define a selection model */ selectionModel: AsiTableSelectionModel; /** Use a ngClass expression to add a class on a row*/ rowClass: any; /** Will call onRequestData when init */ fireRefreshOnInit: boolean; /** Focus to the top of the table when page chanched */ changePageOnTop: boolean; /** Method called when table will ask for data */ /** (on init , on sort ( autoSort is false), on page changed (autoPaginate is false) */ onRequestData: Function; /** If this function is define it's used to define a custom sort on table*/ customSort: Function; topElement: ElementRef; columns: AsiTableColumn[]; data: AsiTableData<{}>; searchDone: boolean; loading: boolean; sortedColumn: AsiTableColumn; noPaginateResults: Array<T>; allChecked: boolean; private requestDataSubcription; constructor(paginateService: AsiPaginationService); getColumns(): any[]; getInlineColumns(): any[]; private filtreColumn(column); getHeaderClass(column: AsiTableColumn): any; fireRefresh(): void; updateData(data: AsiTableData<T>): void; onSort(column: AsiTableColumn): void; onPaginationChanged(pagination: number): void; private paginateDatas(); private requestData(); private getAsiTableRequest(); private sortDatas(); private internalSortData(data); /** Recupere la valeur à afficher pour une cellule */ getCellValue(row: T, column: AsiTableColumn): any; private getProperty(object, path); initCheckbox(): void; onAllChecked(column: AsiTableColumn): void; onChecked(row: any, column: AsiTableColumn): void; private matchRow(rowId, rowToMatch); private updateAllChecked(); getRowClass(row: T): any; private isFunction(functionToCheck); ngAfterContentInit(): void; }