@etsoo/materialui
Version:
TypeScript Material-UI Implementation
103 lines (102 loc) • 3.09 kB
TypeScript
import React from "react";
import { ListChildComponentProps } from "react-window";
import { GridColumn, GridJsonData, GridMethodRef, GridTemplateType } from "@etsoo/react";
import { DataGridExProps } from "./DataGridEx";
import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from "./ScrollerListEx";
import { SxProps, Theme } from "@mui/material/styles";
/**
* ResponsibleContainer props
*/
export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProps<T>, "height" | "itemKey" | "loadData" | "mRef" | "onScroll" | "onItemsRendered" | "onInitLoad" | "onUpdateRows"> & {
/**
* 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;
/**
* Inner item renderer
*/
innerItemRenderer: (props: ScrollerListExInnerItemRendererProps<T>) => React.ReactNode;
/**
* Item renderer
*/
itemRenderer?: (props: ListChildComponentProps<T>) => React.ReactElement;
/**
* Item size, a function indicates its a variable size list
*/
itemSize: ScrollerListExItemSize;
/**
* Load data callback
*/
loadData: (data: GridJsonData & GridTemplateType<F>, lastItem?: T) => PromiseLike<T[] | null | undefined>;
/**
* Methods
*/
mRef?: React.MutableRefObject<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;
/**
* 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;