@hxui/angular
Version:
An Angular library based on the [HXUI design system](https://hxui.io).
136 lines (135 loc) • 5.47 kB
TypeScript
import { EventEmitter, OnInit, DoCheck, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { TabularColumn } from './tabular';
import { ITabularConfig } from './tabular-config.interface';
import { ActionConfigRouteType, IActionsConfig } from './actions-config.interface';
import { TabularSortByService, SortByDirection, ISortByProperty } 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';
import { IWithTooltip } from './tabular-tooltip.interface';
import { TabularContentService } from './tabular-content.service';
import { TabularTheme } from './tabular-theme.enum';
import { ScrollDispatcher } from '@angular/cdk/scrolling';
import { BehaviorSubject } from 'rxjs';
import * as i0 from "@angular/core";
export declare class TabularComponent implements OnInit, DoCheck, OnDestroy {
private conf;
private sortByService;
private contentService;
scroll: ScrollDispatcher;
private cdr;
private table;
private scrollable;
/**
* Collection of column models
*/
columns: TabularColumn[];
/**
* Collection of data rows
*/
rows: ITabularRow[];
/**
* Tabular configuration
* IPaginationInstance, ISearchConfig
*/
get config(): ITabularConfig;
set config(c: ITabularConfig);
/** The function to call when a action item is clicked **/
get callback(): Function;
set callback(Fn: Function);
/**
* Search term is used in the simple search pipe
* Array of objects: *ngFor="#row of rows | simpleSearch : 'the search term'"
*/
get searchTerm(): string;
set searchTerm(term: 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>;
/**
* Event fired when a column is sorted
*/
onSort: EventEmitter<ISortByProperty[]>;
/**
* Event fired when selecting a checkbox on a tabular row
*/
onCheck: EventEmitter<ITabularRow>;
/**
* Event fired when selecting a group checkbox on a tabular column
*/
onCheckAll: EventEmitter<boolean>;
oldRows: ITabularRow[];
pagedItems: any[];
TabularColumnTypes: typeof TabularColumnTypes;
TabularSize: typeof TabularSize;
TabularTheme: typeof TabularTheme;
ActionConfigRouteType: typeof ActionConfigRouteType;
selectAll: boolean;
Context: typeof Context;
SortByDirection: typeof SortByDirection;
isStickyLeft$: BehaviorSubject<boolean>;
isStickyRight$: BehaviorSubject<boolean>;
protected _callback: Function;
protected _config: ITabularConfig;
protected _searchTerm: string;
private _isMutatingInternally;
private _initialLoad;
private subscriptions;
selectAllValue: Boolean;
selectAllDisabled: Boolean;
constructor(conf: TabularConfig, sortByService: TabularSortByService, contentService: TabularContentService, scroll: ScrollDispatcher, cdr: ChangeDetectorRef);
ngOnInit(): void;
ngDoCheck(): void;
ngAfterViewChecked(): void;
ngOnDestroy(): void;
/**
* Calls the parsed callback with optional arguments
*/
executeCallback(event: Event, cb: any[]): void;
toggleSelectAll: ($event: any) => void;
toggleIndividualSelect: ($event: ITabularRow) => void;
private checkSelectAllState;
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;
get 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, item: any): any;
getCellValue(cellContent: any | IWithTooltip): any;
getTooltipInfo(cellContent: any | IWithTooltip): any;
private scrolling;
static ɵfac: i0.ɵɵFactoryDeclaration<TabularComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TabularComponent, "hxa-tabular", never, { "columns": "columns"; "rows": "rows"; "config": "config"; "callback": "callback"; "searchTerm": "searchTerm"; }, { "refresh": "refresh"; "rowClick": "rowClick"; "onSort": "onSort"; "onCheck": "onCheck"; "onCheckAll": "onCheckAll"; }, never, never>;
}