UNPKG

amotify

Version:

UI Component for React,NextJS,esbuild

113 lines (112 loc) 3.21 kB
/// <reference types="react" /> import { StyleTags, ReactElement } from '../../@declares'; import { TableTypes } from '.'; import TableParts from './Parts'; declare namespace Data { type Cell = TableParts.TableCell & { type?: 'th' | 'td'; data: string | number; option?: any; orderIndex?: string | number; }; type HeadRow = Cell[]; type BodyRow = Array<Cell> & ArrayObject; type ArrayObject = { rowID?: any; __sys4SearchKey?: string; checked?: boolean; filtered?: boolean; currentPage?: boolean; }; type Input = TableTypes.UniInput & { tableID?: string; head: HeadRow; rows: BodyRow[]; onRowClick?: TableTypes.OnRowClick; checker?: boolean; searchKeyword?: string; filter?: boolean | boolean[]; order?: boolean | boolean[]; defaultOrder?: Order; pageRowLength: number; noRecords?: ReactElement; onOrderChanged?: { (order: Order): void; }; }; type useRefreshOutput = { val_status: Options; set_status: React.Dispatch<React.SetStateAction<Options>>; rows: { total: number; page: number; filtered: number; }; }; type FilterColumnsProps = { index: number; keyword: string; enabled: boolean; }[]; type Order = [number, 'ASC' | 'DESC']; type Options = { tableID: string; componentID: string; colLength: number; checker: boolean; searchKeyword: string; filter: { enabled: boolean; column: boolean[]; current: (string[])[]; }; order: { enabled: boolean; column: boolean[]; current: Data.Order; }; paging: { rowLength: number; pageLength: number; currentPageIndex: number; }; head: Data.HeadRow; rows: Data.BodyRow[]; noRecords: ReactElement; cellStyles?: StyleTags.PropsNFreeCSS; cellClassName?: string; cellStylesCallback?: { (p: TableTypes.StylesCallbackInput): StyleTags.PropsNFreeCSS; }; onRowClick?: TableTypes.OnRowClick; onOrderChanged?: { (args: Data.Order): void; }; }; namespace Methods { type Component = (props: Data.Input) => JSX.Element; type FNs = { __memoryID: string; getRowData(tableID: string): BodyRow[]; }; type Parts = { SearchInput: React.FC<{ tableID: string; onChange(keyword: string): void; }>; Info: React.FC<{ tableID: string; }>; Paging: React.FC<{ tableID: string; }>; RowLength: React.FC<{ tableID: string; lengthSelect: number[]; }>; }; } type Methods = Methods.Component & Methods.FNs & Methods.Parts; } declare const Data: Data.Methods; export { Data, Data as default };