dynamic-mat-table
Version:
dynamic-mat-table is an Angular component for presenting large and complex data with a lightning fast performance (at least 10x faster) and excellent level of control over the presentation.
62 lines (61 loc) • 2.31 kB
TypeScript
import { IPipe } from "./pipe.model";
import { FooterCell } from "./table-footer.model";
import { TableRow } from "./table-row.model";
export declare type AtRenderFunc<R extends TableRow> = (row: R) => string;
export declare type AtClassFunc = (row: any, col: any) => string;
export declare type AtSortFunc<R extends TableRow> = (data: R[], col: any) => string;
export declare type AtFilterFunc<R extends TableRow> = (data: R[], col: any) => string;
export declare type ToPrint = (row: any) => any;
export declare type ToExport = (row: any, type: any) => any;
export declare type FieldType = "text" | "number" | "date" | "category";
export declare type FieldDisplay = "visible" | "hidden" | "prevent-hidden";
export declare type FieldSticky = "start" | "end" | "none";
export declare type FieldFilter = "client-side" | "server-side" | "none";
export declare type FieldSort = "client-side" | "server-side" | "none";
export interface TableField<R extends TableRow> extends AbstractField {
classNames?: string;
rowClass?: string | AtClassFunc;
customSortFunction?: AtSortFunc<R>;
customFilterFunction?: AtSortFunc<R>;
toPrint?: ToPrint;
toExport?: ToExport;
}
export interface AbstractField {
index?: number;
name: string;
type?: FieldType;
minWidth?: number;
width?: number;
widthPercentage?: number;
widthUnit?: "px" | "%";
style?: any;
header?: string;
isKey?: boolean;
inlineEdit?: boolean;
display?: FieldDisplay;
sticky?: FieldSticky;
filter?: FieldFilter;
sort?: FieldSort;
cellClass?: string;
cellStyle?: any;
icon?: string;
iconColor?: string;
dynamicCellComponent?: any;
draggable?: boolean;
clickable?: boolean;
clickType?: "cell" | "label" | "custom";
printable?: boolean;
exportable?: boolean;
enableContextMenu?: boolean;
rowSelectable?: boolean;
footer?: FooterCell[];
cellEllipsisRow?: number;
cellTooltipEnable?: boolean;
headerEllipsisRow?: number;
headerTooltipEnable?: boolean;
option?: any;
categoryData?: any[];
pipes?: IPipe[];
toString?: (column: TableField<any>, row: TableRow) => string;
customSort?: (column: TableField<any>, row: any) => string;
}