@siemens/ngx-datatable
Version:
ngx-datatable is an Angular table grid component for presenting large and complex data.
234 lines (233 loc) • 10.3 kB
TypeScript
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
import { ScrollerComponent } from './scroller.component';
import { SelectionType } from '../../types/selection.type';
import { RowHeightCache } from '../../utils/row-height-cache';
import { DragEventData } from '../../types/drag-events.type';
import * as i0 from "@angular/core";
export declare class DataTableBodyComponent implements OnInit, OnDestroy {
cd: ChangeDetectorRef;
rowDefTemplate?: TemplateRef<any>;
scrollbarV: boolean;
scrollbarH: boolean;
loadingIndicator: boolean;
private _ghostLoadingIndicator;
set ghostLoadingIndicator(val: boolean);
get ghostLoadingIndicator(): boolean;
externalPaging: boolean;
rowHeight: number | 'auto' | ((row?: any) => number);
offsetX: number;
emptyMessage: string;
selectionType: SelectionType;
selected: any[];
rowIdentity: any;
rowDetail: any;
groupHeader: any;
selectCheck: any;
displayCheck: any;
trackByProp: string;
rowClass: any;
groupedRows: any;
groupExpansionDefault: boolean;
innerWidth: number;
groupRowsBy: string;
virtualization: boolean;
summaryRow: boolean;
summaryPosition: string;
summaryHeight: number;
rowDraggable: boolean;
rowDragEvents: EventEmitter<DragEventData>;
disableRowCheck: (row: any) => boolean;
set pageSize(val: number);
get pageSize(): number;
set rows(val: any[]);
get rows(): any[];
set columns(val: any[]);
get columns(): any[];
set offset(val: number);
get offset(): number;
set rowCount(val: number);
get rowCount(): number;
get bodyWidth(): string;
set bodyHeight(val: any);
get bodyHeight(): any;
verticalScrollVisible: boolean;
scroll: EventEmitter<any>;
page: EventEmitter<any>;
activate: EventEmitter<any>;
select: EventEmitter<any>;
detailToggle: EventEmitter<any>;
rowContextmenu: EventEmitter<{
event: MouseEvent;
row: any;
}>;
treeAction: EventEmitter<any>;
scroller: ScrollerComponent;
/**
* Returns if selection is enabled.
*/
get selectEnabled(): boolean;
/**
* Property that would calculate the height of scroll bar
* based on the row heights cache for virtual scroll and virtualization. Other scenarios
* calculate scroll height automatically (as height will be undefined).
*/
get scrollHeight(): number | undefined;
rowHeightsCache: RowHeightCache;
temp: any[];
offsetY: number;
indexes: any;
columnGroupWidths: any;
columnGroupWidthsWithoutGroup: any;
rowTrackingFn: any;
listener: any;
rowIndexes: any;
rowExpansions: any[];
_rows: any[];
_bodyHeight: any;
_columns: any[];
_rowCount: number;
_offset: number;
_pageSize: number;
_offsetEvent: number;
private _draggedRow;
private _draggedRowElement;
/**
* Creates an instance of DataTableBodyComponent.
*/
constructor(cd: ChangeDetectorRef);
/**
* Called after the constructor, initializing input properties
*/
ngOnInit(): void;
private toggleStateChange;
/**
* Called once, before the instance is destroyed.
*/
ngOnDestroy(): void;
/**
* Updates the Y offset given a new offset.
*/
updateOffsetY(offset?: number): void;
/**
* Body was scrolled, this is mainly useful for
* when a user is server-side pagination via virtual scroll.
*/
onBodyScroll(event: any): void;
/**
* Updates the page given a direction.
*/
updatePage(direction: string): void;
/**
* Updates the rows in the view port
*/
updateRows(): void;
/**
* Get the row height
*/
getRowHeight(row: any): number;
/**
* @param group the group with all rows
*/
getGroupHeight(group: any): number;
/**
* Calculate row height based on the expanded state of the row.
*/
getRowAndDetailHeight(row: any): number;
/**
* Get the height of the detail row.
*/
getDetailRowHeight: (row?: any, index?: any) => number;
getGroupHeaderRowHeight: (row?: any, index?: any) => number;
/**
* Calculates the styles for the row so that the rows can be moved in 2D space
* during virtual scroll inside the DOM. In the below case the Y position is
* manipulated. As an example, if the height of row 0 is 30 px and row 1 is
* 100 px then following styles are generated:
*
* transform: translate3d(0px, 0px, 0px); -> row0
* transform: translate3d(0px, 30px, 0px); -> row1
* transform: translate3d(0px, 130px, 0px); -> row2
*
* Row heights have to be calculated based on the row heights cache as we wont
* be able to determine which row is of what height before hand. In the above
* case the positionY of the translate3d for row2 would be the sum of all the
* heights of the rows before it (i.e. row0 and row1).
*
* @param rows the row that needs to be placed in the 2D space.
* @param index for ghost cells in order to get correct position of ghost row
* @returns the CSS3 style to be applied
*
* @memberOf DataTableBodyComponent
*/
getRowsStyles(rows: any, index?: number): any;
/**
* Calculate bottom summary row offset for scrollbar mode.
* For more information about cache and offset calculation
* see description for `getRowsStyles` method
*
* @returns the CSS3 style to be applied
*
* @memberOf DataTableBodyComponent
*/
getBottomSummaryRowStyles(): any;
/**
* Hides the loading indicator
*/
hideIndicator(): void;
/**
* Updates the index of the rows in the viewport
*/
updateIndexes(): void;
/**
* Refreshes the full Row Height cache. Should be used
* when the entire row array state has changed.
*/
refreshRowHeightCache(): void;
/**
* Gets the index for the view port
*/
getAdjustedViewPortIndex(): number;
/**
* Toggle the Expansion of the row i.e. if the row is expanded then it will
* collapse and vice versa. Note that the expanded status is stored as
* a part of the row object itself as we have to preserve the expanded row
* status in case of sorting and filtering of the row set.
*/
toggleRowExpansion(row: any): void;
/**
* Expand/Collapse all the rows no matter what their state is.
*/
toggleAllRows(expanded: boolean): void;
/**
* Recalculates the table
*/
recalcLayout(): void;
/**
* Tracks the column
*/
columnTrackingFn(index: number, column: any): any;
/**
* Gets the row pinning group styles
*/
stylesByGroup(group: string): {
width: string;
};
/**
* Returns if the row was expanded and set default row expansion when row expansion is empty
*/
getRowExpanded(row: any): boolean;
getRowExpandedIdx(row: any, expanded: any[]): number;
/**
* Gets the row index given a row
*/
getRowIndex(row: any): number;
onTreeAction(row: any): void;
dragOver(event: DragEvent, dropRow: any): void;
drag(event: DragEvent, dragRow: any, rowComponent: any): void;
drop(event: DragEvent, dropRow: any, rowComponent: any): void;
dragEnter(event: DragEvent, dropRow: any, rowComponent: any): void;
dragLeave(event: DragEvent, dropRow: any, rowComponent: any): void;
dragEnd(event: DragEvent, dragRow: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DataTableBodyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DataTableBodyComponent, "datatable-body", never, { "rowDefTemplate": { "alias": "rowDefTemplate"; "required": false; }; "scrollbarV": { "alias": "scrollbarV"; "required": false; }; "scrollbarH": { "alias": "scrollbarH"; "required": false; }; "loadingIndicator": { "alias": "loadingIndicator"; "required": false; }; "ghostLoadingIndicator": { "alias": "ghostLoadingIndicator"; "required": false; }; "externalPaging": { "alias": "externalPaging"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; "offsetX": { "alias": "offsetX"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "selectionType": { "alias": "selectionType"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "rowIdentity": { "alias": "rowIdentity"; "required": false; }; "rowDetail": { "alias": "rowDetail"; "required": false; }; "groupHeader": { "alias": "groupHeader"; "required": false; }; "selectCheck": { "alias": "selectCheck"; "required": false; }; "displayCheck": { "alias": "displayCheck"; "required": false; }; "trackByProp": { "alias": "trackByProp"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "groupedRows": { "alias": "groupedRows"; "required": false; }; "groupExpansionDefault": { "alias": "groupExpansionDefault"; "required": false; }; "innerWidth": { "alias": "innerWidth"; "required": false; }; "groupRowsBy": { "alias": "groupRowsBy"; "required": false; }; "virtualization": { "alias": "virtualization"; "required": false; }; "summaryRow": { "alias": "summaryRow"; "required": false; }; "summaryPosition": { "alias": "summaryPosition"; "required": false; }; "summaryHeight": { "alias": "summaryHeight"; "required": false; }; "rowDraggable": { "alias": "rowDraggable"; "required": false; }; "rowDragEvents": { "alias": "rowDragEvents"; "required": false; }; "disableRowCheck": { "alias": "disableRowCheck"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "rowCount": { "alias": "rowCount"; "required": false; }; "bodyHeight": { "alias": "bodyHeight"; "required": false; }; "verticalScrollVisible": { "alias": "verticalScrollVisible"; "required": false; }; }, { "scroll": "scroll"; "page": "page"; "activate": "activate"; "select": "select"; "detailToggle": "detailToggle"; "rowContextmenu": "rowContextmenu"; "treeAction": "treeAction"; }, never, ["[loading-indicator]", "[empty-content]"], false, never>;
}