@etsoo/materialui
Version:
TypeScript Material-UI Implementation
102 lines (101 loc) • 2.46 kB
TypeScript
import { GridColumn, GridJsonData, GridLoadDataProps, GridLoaderStates, ScrollerGridProps } from "@etsoo/react";
import React from "react";
import { MouseEventWithDataHandler } from "./MUGlobal";
/**
* Footer item renderer props
*/
export type DataGridExFooterItemRendererProps<T extends object> = {
column: GridColumn<T>;
index: number;
states: GridLoaderStates<T>;
cellProps: any;
checkable: boolean;
};
/**
* Extended DataGrid with VariableSizeGrid props
*/
export type DataGridExProps<T extends object, P extends GridJsonData = GridLoadDataProps> = Omit<ScrollerGridProps<T, P>, "itemRenderer" | "columnCount" | "columnWidth" | "width"> & {
/**
* Alternating colors for odd/even rows
*/
alternatingColors?: [string?, string?];
/**
* Cache key
*/
cacheKey?: string;
/**
* Cache minutes
*/
cacheMinutes?: number;
/**
* Checkable to choose multiple items
* @default false
*/
checkable?: boolean;
/**
* Rows count to have the bottom border
*/
borderRowsCount?: number;
/**
* Bottom height
*/
bottomHeight?: number;
/**
* Columns
*/
columns: GridColumn<T>[];
/**
* Footer item renderer
*/
footerItemRenderer?: (rows: T[], props: DataGridExFooterItemRendererProps<T>) => React.ReactNode;
/**
* Header height
* @default 56
*/
headerHeight?: number;
/**
* Hide the footer
* @default false
*/
hideFooter?: boolean;
/**
* Hover color
*/
hoverColor?: string;
/**
* Double click handler
*/
onDoubleClick?: MouseEventWithDataHandler<T>;
/**
* Click handler
*/
onClick?: MouseEventWithDataHandler<T>;
/**
* Selectable to support hover over and out effect and row clickable
* @default true
*/
selectable?: boolean;
/**
* Selected color
*/
selectedColor?: string;
/**
* Width
*/
width?: number;
};
/**
* Extended datagrid columns calculation
* @param columns
* @returns Total width and unset items
*/
export declare function DataGridExCalColumns<T>(columns: GridColumn<T>[]): {
total: number;
unset: number;
};
/**
* Extended DataGrid with VariableSizeGrid
* @param props Props
* @returns Component
*/
export declare function DataGridEx<T extends object>(props: DataGridExProps<T>): import("react/jsx-runtime").JSX.Element;