react-native-modern-elements
Version:
A modern, customizable UI component library for React Native
59 lines (58 loc) • 2.32 kB
TypeScript
import React from "react";
import { StyleProp, TextStyle, ViewStyle } from "react-native";
type ColumnAlignment = "left" | "center" | "right";
interface Column<T> {
label: string;
key: keyof T | string;
flex?: number;
align?: ColumnAlignment;
headerTextAlign?: ColumnAlignment;
render?: (value: any, row: any, rowIndex: any) => React.ReactNode;
headerStyle?: StyleProp<ViewStyle>;
headerTextColors?: string;
}
interface BorderProps {
borderColor?: string;
borderWidth?: number;
headerborderRight?: boolean;
}
interface SummaryOptions<T> {
content: React.ReactNode;
align: "left" | "right";
style?: StyleProp<ViewStyle>;
summaryWrapper?: StyleProp<ViewStyle>;
}
interface TableProps<T> extends BorderProps {
columns: Column<T>[];
data: T[];
height?: any;
defaultAlign?: ColumnAlignment;
onRowPress?: (item: T, rowIndex: number) => void;
tableStyles?: StyleProp<ViewStyle>;
showsVerticalScrollIndicator?: boolean;
HeaderRowStyle?: StyleProp<ViewStyle>;
headerTexts?: StyleProp<TextStyle>;
cellRowBottomBorder?: boolean;
cellRowStyle?: StyleProp<ViewStyle>;
enableHeaderShadow?: boolean;
headerShadowStyle?: StyleProp<ViewStyle>;
headerborderBottom?: boolean;
summary?: SummaryOptions<T>;
cellRowRightBorder?: boolean;
showHeader?: boolean;
contentContainerStyle?: StyleProp<ViewStyle>;
totalResult?: any;
refreshing?: any;
loadingMore?: any;
handleRefresh?: any;
loadMore?: any;
initialLoader?: any;
hasMore?: any;
pagination?: boolean;
Refreshing?: boolean;
divider?: boolean;
dividerWight?: number | string;
}
export declare function TableInner<T extends object>({ columns, data, height, onRowPress, defaultAlign, tableStyles, borderColor, borderWidth, headerborderRight, showsVerticalScrollIndicator, HeaderRowStyle, headerTexts, cellRowBottomBorder, cellRowRightBorder, cellRowStyle, enableHeaderShadow, headerShadowStyle, summary, headerborderBottom, showHeader, contentContainerStyle, handleRefresh, hasMore, initialLoader, loadMore, loadingMore, refreshing, totalResult, pagination, Refreshing, divider, dividerWight, }: TableProps<T>): React.JSX.Element;
export declare const Table: React.MemoExoticComponent<typeof TableInner>;
export {};