UNPKG

@hxui/angular

Version:

This README includes the steps that are necessary to import the HxUi-angular into a project or to contribute with development.

94 lines (93 loc) 3.46 kB
import { EventEmitter, OnInit, DoCheck } from '@angular/core'; import { TabularColumn } from './tabular'; import { ITabularConfig } from './tabular-config.interface'; import { ActionConfigRouteType, IActionsConfig } from './actions-config.interface'; import { TabularSortByService, SortByDirection } from './tabular-sort-by.service'; import { TabularConfig } from './tabular.config'; import { TabularSize } from './tabular-size.enum'; import { ITabularColumnBadgeType, ITabularColumnIconType, TabularColumnTypes } from './tabular-column.interface'; import { ITabularRow } from './tabular-row.interface'; import { Context } from '../enums'; export declare class TabularComponent implements OnInit, DoCheck { private conf; private sortByService; /** * Collection of column models */ columns: TabularColumn[]; /** * Collection of data rows */ rows: ITabularRow[]; /** * Tabular configuration * IPaginationInstance, ISearchConfig */ config: ITabularConfig; /** The function to call when a action item is clicked **/ callback: Function; /** * Search term is used in the simple search pipe * Array of objects: *ngFor="#row of rows | simpleSearch : 'the search term'" */ searchTerm: string; /** * Event fired when refresh is called. * Host should refresh data of input. */ refresh: EventEmitter<boolean>; /** * Event fired when a row is clicked. */ rowClick: EventEmitter<any>; oldRows: ITabularRow[]; pagedItems: any[]; TabularColumnTypes: typeof TabularColumnTypes; TabularSize: typeof TabularSize; ActionConfigRouteType: typeof ActionConfigRouteType; selectAll: boolean; Context: typeof Context; SortByDirection: typeof SortByDirection; protected _callback: Function; protected _config: ITabularConfig; protected _searchTerm: string; constructor(conf: TabularConfig, sortByService: TabularSortByService); ngOnInit(): void; ngDoCheck(): void; /** * Calls the parsed callback with optional arguments */ executeCallback(event: Event, cb: any[]): void; toggleSelectAll: ($event: any) => void; toggleIndividualSelect: ($event: any) => void; setPage($event?: { page: number; itemsPerPage: number; }): void; /** * Get the action tooltip if it exists */ getActionTooltip(action: IActionsConfig): string; getActionDisabledState(action: IActionsConfig): boolean; /** * Handles the column header click event for sorting. * Sort order is Descending, Ascending followed by None. */ onSortClickHandler(key: string, type: TabularColumnTypes): boolean; isColumnSorted(key: string, direction: SortByDirection): boolean; /** * Handles the row click event. */ onRowClickHandler($event: any, data: any): void; private orderByData(); readonly totalItemCount: number; /** * Helper to determine if tabular instance is in small mode */ isSmall(): boolean; hasValidBadgeTypeParams(colData: ITabularColumnBadgeType): boolean; hasValidIconTypeParams(colData: ITabularColumnIconType): boolean; getTooltipContext(colData: ITabularColumnIconType): Context; hasChildren(action: IActionsConfig): boolean; trackByFn(index: any, action: any): any; }