import { TypeColumnTable } from '../../enums/columns/typeColumnTable.enum'; import { Target, TypeLinkTable } from '../../enums/typeLinkTable.enum'; /** * column filter fields */ export interface FilterColumnTable { /** * filter visible */ filter: boolean; /** * attribute to send filter */ attribute?: string; /** * additional search filter field */ additionalSearchFilter?: string; /** * placeholder search field */ placeholder?: string; } /** * column sort fields */ export interface Sort { /** * sort visible */ sort: boolean; /** * attribute to send sort */ attribute?: string; } /** * column fixed scroll table */ export interface FixedOption { /** * fixed left column */ left?: boolean; /** * fixed right column */ right?: boolean; } /** * column styles row and columns styles */ export interface Style { /** * object table data cells styles */ td?: { /** * object style property and value styles */ style?: { [key: string]: string; }; /** * add ellipsis text */ ellipsis?: boolean; /** * add breakWord text */ breakWord?: boolean; }; /** * object table head cells styles */ th?: { /** * add ellipsis text */ style?: { [key: string]: string; }; /** * add ellipsis text */ ellipsis?: boolean; /** * add breakWord text */ breakWord?: boolean; }; } /** * */ export interface LinkTable { /** * */ type?: TypeLinkTable; /** * */ url: string | (({ data, column }: { data: any; column: any; }) => string); /** * */ target?: Target; } /** * column fields */ export interface ColumnTable { /** * visible name of column */ header: string; /** * match name of column to api request response */ attribute: string; /** * type of column */ type?: TypeColumnTable; /** * link to other view */ link?: LinkTable; /** * save null text */ safeNull?: string; /** * object sort */ sort?: Sort; /** * object filter */ filter?: FilterColumnTable; /** * object fixed columns */ fixed?: FixedOption; /** * object style of column and row data */ style?: Style; /** * show column */ isShow?: Boolean | (() => boolean); /** * customViewData column data */ customViewData?: ({ data, column }: { data: any; column: any; }) => string; }