import { AfterViewInit, ChangeDetectorRef, DoCheck, ElementRef, EventEmitter, KeyValueDiffer, KeyValueDiffers, OnDestroy, OnInit, QueryList } from '@angular/core'; import { ScrollbarHelper } from '../services/index'; import { ColumnMode, SelectionType, SortType, TableColumn } from '../types/index'; import { DataTableBodyComponent } from './body/body.component'; import { DataTableColumnDirective } from './columns/column.directive'; import { DataTableFooterDirective } from './footer/footer.directive'; import { DataTableRowDetailDirective } from './row-detail/row-detail.directive'; export declare class DataTableComponent implements OnInit, AfterViewInit, DoCheck, OnDestroy { private scrollbarHelper; private changeDetector; /** * Row that is set to active. */ activeRow: any; /** * Get the columns. */ /** * Columns to be displayed. */ columns: TableColumn[]; /** * Type of column width distribution formula. * Example: flex, force, standard */ columnMode: ColumnMode; /** * Gets the count. */ /** * The total count of all rows. * Default value: `0` */ count: number; /** * Css class overrides for icons. * * Defaults: * - `sortAscending: 'fa fa-angle-up'`, * - `sortDescending: 'fa fa-angle-down'`, * - `pagerLeftArrow: 'data-table-icon-left'`, * - `pagerRightArrow: 'data-table-icon-right'`, * - `pagerPrevious: 'data-table-icon-prev'`, * - `pagerNext: 'data-table-icon-skip'` * * @docs-private * @deprecated */ cssClasses: any; /** * If the table should use external paging * otherwise its assumed that all data is preloaded. */ externalPaging: boolean; /** * If the table should use external sorting or * the built-in basic sorting. */ externalSorting: boolean; /** * The minimum footer height in pixels. * Pass falsey for no footer */ footerHeight: number; /** * The minimum header height in pixels. * Pass a false value for no header */ headerHeight: number | string; /** * The row that is considered to be last active */ lastActiveRow: EventEmitter; /** * The page size to be shown. * Default value: `undefined` */ limit: number; /** * Show the linear loading bar. * Default value: `false` */ loadingIndicator: boolean; /** * Message overrides for localization * * emptyMessage [default] = 'No data to display' * totalMessage [default] = 'total' * selectedMessage [default] = 'selected' */ messages: any; /** * The current offset ( page - 1 ) shown. * Default value: `0` */ offset: number; /** * Pagination override for localization * The default display is 'Showing x-y of z' where x is the first row, y is the last row, and z is the row count. * When the table does not have a limit the default string is 'z Records' where z is the number of rows. * To override this display provide a string that includes 'Showing ${firstRow}-${lastRow} of ${rowCount}' or '${rowCount} Records'. */ paginationString: string; /** * Select All aria-label override for localization * The default is `Select All` */ selectAllAriaLabel: string; _selectAllAriaLabel: string; /** * If this is set to true clicking the row will check the checkbox. * Also, clicking the checkbox will move the last active to the checkbox that was clicked. */ propogateSelectionState: boolean; /** * Enable/Disable ability to re-order columns * by dragging them. */ reorderable: boolean; /** * Gets the rows. */ /** * Rows that are displayed in the table. * */ rows: any[]; /** * Enable horz scrollbars */ scrollbarH: boolean; /** * Enable vertical scrollbars */ scrollbarV: boolean; /** * A boolean/function you can use to check whether you want * to select a particular row based on a criteria. Example: * * (selection) => { * return selection !== 'Ethel Price'; * } */ selectCheck: (row: any, index?: number, rows?: any[]) => boolean; /** * A function you can use to check whether you want * to disable the checkbox for a particular row based on a criteria. Example: * * (row) => { * return row.name === 'Ethel Price'; * } */ selectionDisabled: (row: any) => boolean; /** * List of row objects that should be * represented as selected in the grid. * Default value: `[]` */ selected: any[]; /** * Type of row selection. Options are: * * - `single` * - `multi` * - `checkbox` * - `multiClick` * - `cell` * * For no selection pass a `falsey`. * Default value: `undefined` */ selectionType: SelectionType; /** * Row specific classes. * Similar implementation to ngClass. * * [rowClass]="'first second'" * [rowClass]="{ 'first': true, 'second': true, 'third': false }" */ rowClass: any; /** * The row height; which is necessary * to calculate the height for the lazy rendering. */ rowHeight: number | string; /** * This will be used when displaying or selecting rows. * when tracking/comparing them, we'll use the value of this fn, * * (`fn(x) === fn(y)` instead of `x === y`) * */ rowIdentity: (x: any) => any; /** * Array of sorted columns by property and type. * Default value: `[]` */ sorts: any[]; /** * The type of sorting */ sortType: SortType; /** * Property to which you can use for custom tracking of rows. * Example: 'name' */ trackByProp: string; /** * A cell or row was focused via keyboard or mouse click. */ activate: EventEmitter; /** * The table was paged either triggered by the pager or the body scroll. */ page: EventEmitter; /** * Columns were re-ordered. */ reorder: EventEmitter; /** * Column was resized. */ resize: EventEmitter; /** * Dimensions of the data table fired on resize */ resizeDimensions: EventEmitter; /** * The context menu was invoked on a row. * */ rowContextmenu: EventEmitter<{ event: MouseEvent; row: any; }>; /** * Body was scrolled typically in a `scrollbarV:true` scenario. */ scroll: EventEmitter; /** * A cell or row was selected. */ select: EventEmitter; /** * Column sort was invoked. */ sort: EventEmitter; /** * CSS class applied to root if cell selection. */ readonly _isCellSelection: boolean; /** * CSS class applied to root is checkbox selection. */ readonly _isCheckboxSelection: boolean; /** * CSS class applied if the header height if fixed height. */ readonly _isFixedHeader: boolean; /** * CSS class applied to the root element if * the row heights are fixed heights. */ readonly _isFixedRow: boolean; /** * CSS class applied to the root element * if the horziontal scrolling is enabled. */ readonly _isHorScroll: boolean; /** * CSS class added to root element if mulit click select */ readonly _isMultiClickSelection: boolean; /** * CSS class added to root element if mulit select */ readonly _isMultiSelection: boolean; /** * CSS class applied to root element is selectable. */ readonly _isSelectable: boolean; /** * CSS class applied to root if single select. */ readonly _isSingleSelection: boolean; /** * CSS class applied to root element if * vertical scrolling is enabled. */ readonly _isVertScroll: boolean; /** * Returns the column templates. */ /** * Column templates gathered from `ContentChildren` * if described in your markup. * */ columnTemplates: QueryList; /** * Row Detail templates gathered from the ContentChild * */ rowDetail: DataTableRowDetailDirective; /** * Footer template gathered from the ContentChild */ footer: DataTableFooterDirective; /** * Reference to the body component for manually * invoking functions on the body. * * @docs-private */ bodyComponent: DataTableBodyComponent; /** * Returns if some or all rows are selected. */ readonly allRowsSelected: boolean; /** * Returns if some rows are selected. */ readonly someRowsSelected: boolean; /** * Returns if all rows that are not disabled are selected */ readonly allEnabledSelected: boolean; /** @docs-private */ _columnTemplates: QueryList; /** @docs-private */ _columns: TableColumn[]; /** @docs-private */ _count: number; /** @docs-private */ _rows: any[]; /** @docs-private */ bodyHeight: number; /** @docs-private */ element: HTMLElement; /** @docs-private */ innerWidth: number; /** @docs-private */ offsetX: number; /** @docs-private */ pageSize: number; /** @docs-private */ rowCount: number; /** @docs-private */ rowDiffer: KeyValueDiffer<{}, {}>; /** Unique Table ID */ uniqueTableId: string; constructor(scrollbarHelper: ScrollbarHelper, element: ElementRef, differs: KeyValueDiffers, changeDetector: ChangeDetectorRef); /** * Lifecycle hook that is called after data-bound * properties of a directive are initialized. */ ngOnInit(): void; /** * Lifecycle hook that is called when Angular dirty checks a directive. */ ngDoCheck(): void; ngOnDestroy(): void; /** * Lifecycle hook that is called after a component's * view has been fully initialized. */ ngAfterViewInit(): void; /** * Recalc's the sizes of the grid. * * Updated automatically on changes to: * * - Columns * - Rows * - Paging related * * Also can be manually invoked or upon window resize. */ recalculate(): void; /** * Clear the active row. */ clearActiveRow(): void; /** * Recalculates the sizes of the page * * @param [val=this.rows] * @return */ _calcPageSize(val?: any[]): number; /** * Calculates the row count. * * @param [val=this.rows] * @return * */ _calcRowCount(val?: any[]): number; /** * Body triggered a page event. * * @param offset * the new offset of the body page. */ _onBodyPage({offset}: { offset: number; }): void; /** * The body triggered a scroll event. * * @param event * the mouse event that triggered the scroll */ _onBodyScroll(event: MouseEvent): void; /** * The footer triggered a page event. * * @param event * */ _onFooterPage(event: any): void; /** * The header triggered a column re-order event. */ _onColumnReorder({column, newValue, prevValue}: { column: any; newValue: any; prevValue: any; }): void; /** * The header triggered a column resize event. */ _onColumnResize({column, newValue}: { column: any; newValue: number; }): void; /** * Toggle all row selection */ _onHeaderSelect(): void; /** * The header triggered a column sort event. * * @param event * */ _onColumnSort(event: any): void; /** * Window resize handler to update sizes. */ _onWindowResize(): void; /** * Recalculates the column widths based on column width * distribution mode and scrollbar offsets. * * @param [columns=this.columns] * @param [forceIdx=-1] * @param [allowBleed=this.scrollH] */ _recalculateColumns(columns?: any[], forceIdx?: number, allowBleed?: boolean): void; /** * Recalculates the dimensions of the table size. * Internally calls the page size and row count calcs too. */ _recalculateDims(): void; /** * Recalculates the pages after a update. */ _recalculatePages(): void; }