@etsoo/materialui
Version:
TypeScript Material-UI Implementation
99 lines (98 loc) • 2.93 kB
TypeScript
import React from "react";
import { GridColumn, GridJsonData, GridMethodRef, GridTemplateType } from "@etsoo/react";
import { DataGridExProps } from "./DataGridEx";
import { ScrollerListExProps } from "./ScrollerListEx";
import { SxProps, Theme } from "@mui/material/styles";
/**
* ResponsibleContainer props
*/
export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProps<T>, "height" | "loadData" | "mRef" | "onInitLoad" | "onUpdateRows" | "rowHeight"> & {
/**
* Height will be deducted
* @param height Current calcuated height
* @param rect Current rect data
*/
adjustHeight?: number | ((height: number, rect: DOMRect) => number);
/**
*
* @param height Current height
* @param isGrid Is displaying DataGrid
* @returns Adjusted height
*/
adjustFabHeight?: (height: number, isGrid: boolean) => number;
/**
* Columns
*/
columns: GridColumn<T>[];
/**
* Container box SX (dataGrid determines the case)
*/
containerBoxSx?: (paddings: number | Record<string, string | number>, hasFields: boolean, dataGrid?: boolean) => SxProps<Theme>;
/**
* Search fields
*/
fields?: React.ReactElement[] | ((data: GridTemplateType<F>) => React.ReactElement[]);
/**
* Search field template
*/
readonly fieldTemplate: F;
/**
* Grid height
*/
height?: number;
/**
* Item renderer
*/
itemRenderer?: ScrollerListExProps<T>["itemRenderer"];
/**
* Load data callback
*/
loadData: (data: GridJsonData & GridTemplateType<F>, lastItem?: T) => PromiseLike<T[] | null | undefined>;
/**
* Methods
*/
mRef?: React.RefObject<GridMethodRef<T> | undefined>;
/**
* Element ready callback
*/
elementReady?: (element: HTMLElement, isDataGrid: boolean) => void;
/**
* Paddings
*/
paddings?: number | Record<string, string | number>;
/**
* Pull to refresh data
*/
pullToRefresh?: boolean;
/**
* Quick action for double click or click under mobile
*/
quickAction?: (data: T) => void;
/**
* Row height
* @param isGrid Is displaying as DataGrid
*/
rowHeight?: number | [number, number] | (<B extends boolean>(isGrid: B) => B extends true ? DataGridExProps<T>["rowHeight"] : ScrollerListExProps<T>["rowHeight"]);
/**
* Size ready to read miliseconds span
*/
sizeReadyMiliseconds?: number;
/**
* SearchBar height
*/
searchBarHeight?: number;
/**
* SearchBar bottom padding
*/
searchBarBottom?: number;
/**
* SearchBar top
*/
searchBarTop?: number | true;
};
/**
* Responsible container
* @param props Props
* @returns Layout
*/
export declare function ResponsibleContainer<T extends object, F>(props: ResponsibleContainerProps<T, F>): import("react/jsx-runtime").JSX.Element;