UNPKG

@douyinfe/semi-ui

Version:

A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.

77 lines (76 loc) 3.07 kB
import React, { ReactNode } from 'react'; import { FlattenData, GroupFlattenData } from '@douyinfe/semi-foundation/lib/es/table/bodyFoundation'; import Store from '@douyinfe/semi-foundation/lib/es/utils/Store'; import { BaseProps } from '../../_base/baseComponent'; import type { ExpandedRowRender, Virtualized, GetVirtualizedListRef, ColumnProps, Size, BodyScrollEvent, Scroll, Fixed, TableComponents, RowExpandable, VirtualizedOnScroll, RowKey } from '../interface'; export interface BodyProps extends BaseProps { tableLayout?: 'fixed' | 'auto'; anyColumnFixed?: boolean; columns?: ColumnProps[]; dataSource?: Record<string, any>[]; disabledRowKeysSet: Set<any>; emptySlot?: ReactNode; expandedRowKeys?: (string | number)[]; expandedRowRender?: ExpandedRowRender<Record<string, any>>; fixed?: Fixed; forwardedRef?: React.MutableRefObject<HTMLDivElement> | ((instance: any) => void); handleBodyScroll?: (e: BodyScrollEvent) => void; handleWheel?: (e: React.WheelEvent<HTMLDivElement>) => void; includeHeader?: boolean; prefixCls?: string; scroll?: Scroll; selectedRowKeysSet: Set<any>; showHeader?: boolean; size?: Size; virtualized?: Virtualized; components?: TableComponents; store: Store; groups?: Map<string, Record<string, any>[]>[]; rowKey?: RowKey<Record<string, any>>; childrenRecordName?: string; rowExpandable?: RowExpandable<Record<string, any>>; renderExpandIcon: (record: Record<string, any>, isNested: boolean) => ReactNode | null; headerRef?: React.MutableRefObject<HTMLDivElement> | ((instance: any) => void); onScroll?: VirtualizedOnScroll; keepDOM?: boolean; } export interface BodyState { virtualizedData?: Array<FlattenData | GroupFlattenData>; cache?: { virtualizedScrollTop?: number; virtualizedScrollLeft?: number; }; cachedExpandBtnShouldInRow?: boolean; cachedExpandRelatedProps?: any[]; } export interface BodyContext { getVirtualizedListRef: GetVirtualizedListRef; flattenedColumns: ColumnProps[]; getCellWidths: (flattenedColumns: ColumnProps[]) => number[]; } declare const _default: React.ForwardRefExoticComponent<Omit<BodyProps, "forwardedRef"> & React.RefAttributes<HTMLDivElement>>; export default _default; export interface RenderExpandedRowProps { style?: React.CSSProperties; components?: TableComponents; renderExpandIcon: (record?: Record<string, any>, isNested?: boolean) => ReactNode | null; expandedRowRender?: ExpandedRowRender<Record<string, any>>; record?: Record<string, any>; columns?: ColumnProps[]; expanded?: boolean; index?: number; rowKey?: RowKey<Record<string, any>>; virtualized?: Virtualized; level?: number; keepDOM?: boolean; displayNone?: boolean; } export interface RenderSectionRowProps { dataSource?: Record<string, any>[]; columns?: ColumnProps[]; rowKey?: RowKey<Record<string, any>>; group?: any; groupKey: string | number; index?: number; expanded?: boolean; }