import { EventEmitter, ChangeDetectorRef, OnInit, OnDestroy } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { EntityRecord, EntityState, EntityStore, EntityTableTemplate, EntityTableColumn, EntityTableColumnRenderer, EntityTableSelectionState, EntityTableScrollBehavior } from '../shared'; export declare class EntityTableComponent implements OnInit, OnDestroy { private cdRef; /** * Reference to the column renderer types * @internal */ entityTableColumnRenderer: typeof EntityTableColumnRenderer; /** * Reference to the selection's state * @internal */ entityTableSelectionState: typeof EntityTableSelectionState; /** * Observable of the selection,s state * @internal */ readonly selectionState$: BehaviorSubject; /** * Subscription to the store's selection */ private selection$$; /** * Entity store */ store: EntityStore; /** * Table template */ template: EntityTableTemplate; /** * Scroll behavior on selection */ scrollBehavior: EntityTableScrollBehavior; /** * Whether nulls should be first when sorting */ sortNullsFirst: boolean; /** * Event emitted when an entity (row) is clicked */ entityClick: EventEmitter; /** * Event emitted when an entity (row) is selected */ entitySelectChange: EventEmitter<{ added: object[]; }>; /** * Table headers * @internal */ readonly headers: string[]; /** * Data source consumable by the underlying material table * @internal */ readonly dataSource: BehaviorSubject[]>; /** * Whether selection is supported * @internal */ readonly selection: boolean; /** * Whether a selection checkbox should be displayed * @internal */ readonly selectionCheckbox: boolean; /** * Whether selection many entities should eb supported * @internal */ readonly selectMany: boolean; /** * Whether selection many entities should eb supported * @internal */ readonly fixedHeader: boolean; constructor(cdRef: ChangeDetectorRef); /** * Track the selection state to properly display the selection checkboxes * @internal */ ngOnInit(): void; /** * Unbind the store watcher * @internal */ ngOnDestroy(): void; /** * Trackby function * @param record Record * @param index Record index * @internal */ getTrackByFunction(): (index: number, record: EntityRecord) => string; /** * Trigger a refresh of thre table. This can be useful when * the data source doesn't emit a new value but for some reason * the records need an update. * @internal */ refresh(): void; /** * On sort, sort the store * @param event Sort event * @internal */ onSort(event: { active: string; direction: string; }): void; /** * When an entity is clicked, emit an event * @param record Record * @internal */ onRowClick(record: EntityRecord): void; /** * When an entity is selected, select it in the store and emit an event. Even if * "many" is set to true, this method always select a single, exclusive row. Selecting * multiple rows should be achieved by using the checkboxes. * @param record Record * @internal */ onRowSelect(record: EntityRecord): void; /** * Select or unselect all rows at once. On select, emit an event. * @param toggle Select or unselect * @internal */ onToggleRows(toggle: boolean): void; /** * When an entity is toggled, select or unselect it in the store. On select, * emit an event. * @param toggle Select or unselect * @param record Record * @internal */ onToggleRow(toggle: boolean, record: EntityRecord): void; /** * Compute the selection state * @returns Whether all, some or no rows are selected * @internal */ private computeSelectionState; /** * Whether a column is sortable * @param column Column * @returns True if a column is sortable * @internal */ columnIsSortable(column: EntityTableColumn): boolean; /** * Whether a row is should be selected based on the underlying entity state * @param record Record * @returns True if a row should be selected * @internal */ rowIsSelected(record: EntityRecord): boolean; /** * Method to access an entity's values * @param record Record * @param column Column * @returns Any value * @internal */ getValue(record: EntityRecord, column: EntityTableColumn): any; /** * Return the type of renderer of a column * @param column Column * @returns Renderer type * @internal */ getColumnRenderer(column: EntityTableColumn): EntityTableColumnRenderer; /** * Return the table ngClass * @returns ngClass * @internal */ getTableClass(): { [key: string]: boolean; }; /** * Return a header ngClass * @returns ngClass * @internal */ getHeaderClass(): { [key: string]: boolean; }; /** * Return a row ngClass * @param record Record * @returns ngClass * @internal */ getRowClass(record: EntityRecord): { [key: string]: boolean; }; /** * Return a row ngClass * @param record Record * @param column Column * @returns ngClass * @internal */ getCellClass(record: EntityRecord, column: EntityTableColumn): { [key: string]: boolean; }; /** * When a button is clicked * @param func Function * @param record Record * @internal */ onButtonClick(clickFunc: (entity: object, record?: EntityRecord) => void, record: EntityRecord): void; }