payzli-ui-aryan
Version:
A custom react components library
67 lines (66 loc) • 2.36 kB
TypeScript
import { ISelectInput } from "./types";
export interface ITableHeader {
key: string;
title: string;
type: "currency" | "number" | "string" | "action" | "link" | "button" | "time" | "date" | "jsx" | "profile" | "boolean" | "url" | "sticky_button_popup";
th_class?: string;
td_class?: string;
handleClick?: any;
custom_title?: string;
renderer?: (item: any, UiLanguage?: string, elementIndex?: number, categoryIndex?: number) => any;
enable_dynamic_sort?: boolean;
handleClickShowMore?: any;
popup_width?: string;
popup_positon?: "left" | "right";
first_name?: string;
last_name?: string;
image_hash?: string;
pic_class?: string;
user_id?: string;
mime_type?: string;
total_count?: number;
decimalPlaces?: number;
suffix?: string;
elipsis?: 1 | 2 | 3;
editable?: boolean;
hidden?: boolean;
data_type?: "monetary" | "string" | "number" | "date" | "time" | "datetime";
popup_button?: any;
text_class?: string;
currencyDisplay?: "symbol" | "code" | "name";
grouping?: boolean;
minimumIntegerDigits?: number;
output_date_format?: string;
input_date_format?: string;
}
export interface ITableProps {
headers: ITableHeader[];
data: any[];
page_number: number;
page_size: number;
total_count: number;
sort_value?: ISelectInput;
table_class?: string;
isEdit?: boolean;
head_class?: string;
tr_class?: string;
onRowClick?: (item: any) => void;
column_header_class?: string;
UiLanguage: string;
openDrawer?: any;
disablePagination?: boolean;
handleEditChange?: (key: string, value: any, index: number) => void;
transformCurrency?: (amount: number, currency: string, options: any) => string;
handleDynamicSort?: (th: ITableHeader, value: typeSortValue, data?: any[]) => void;
handlePagination?: (pageNumber: number, itemsPerPage: number) => void;
handleClickShowMore?: (title: string, text: string) => void;
transformPhrase?: (phrase: string, UiLanguage: string, options: any) => string;
loaderComponent?: React.ReactNode;
showLoader?: boolean;
renderCustomPlaceholder?: () => React.ReactNode;
}
export type typeSortValue = "ascending" | "descending";
export declare enum enumSortByValues {
ascending = "ascending",
descending = "descending"
}