chowa
Version:
UI component library based on React
73 lines (72 loc) • 2.53 kB
TypeScript
/**
* @license chowa v1.1.3
*
* Copyright (c) Chowa Techonlogies Co.,Ltd.(http://www.chowa.cn).
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import { Data, Record, ColumnsWidthMap, FilterInfo, SorterInfo, ExpanedVisibleMap, UpdateParams } from './table';
import { TableColumnProps, DataIndex } from './table-column';
export interface TableBaseProps {
striped: boolean;
expanded: boolean;
selectable: boolean;
columns: TableColumnProps[];
columnsWidthMap: ColumnsWidthMap;
showHeader: boolean;
fixedHeader: boolean;
scrollHeight: number;
dataIndexs: DataIndex[];
data: Data;
globalAlign: 'left' | 'right' | 'center';
resizeable: boolean;
headerRowAttr: (rowIndex: number) => React.Attributes;
filterInfo: FilterInfo;
sorterInfo: SorterInfo;
onSelect: (record: Record) => void;
onDeSelect: (record: Record) => void;
onSelectAll: () => void;
onDeSelectAll: () => void;
selectedIndexs: DataIndex[];
expanedVisibleMap: ExpanedVisibleMap;
accordion: boolean;
expandedRowRender: (record: Record) => React.ReactNode;
expandedOpenNode: React.ReactNode;
expandedCloseNode: React.ReactNode;
onExpandedVisibleChange: (visible: boolean, record: Record) => void;
rowAttr: (index: React.ReactText, record: Record) => React.Attributes;
highlightRow: boolean;
highlightRowIndex: React.ReactText;
noDataDescription: React.ReactNode;
noDataImg: string;
noDataImgStyle: React.CSSProperties;
footer: React.ReactNode;
updateTable: (params: UpdateParams) => void;
scrollTop: number;
draggable: boolean;
rowDragSorter: (dragIndex: number, dropIndex: number) => void;
columnDragSorter: (dragIndex: number, dropIndex: number, parentIndexs: number[]) => void;
}
export interface TableBaseState {
clientWidth: number;
contentWidth: number;
}
declare class TableBase extends React.PureComponent<TableBaseProps, TableBaseState> {
private resizeObserver;
private tableEle;
private headerEle;
private bodyEle;
private contentEle;
private footerEle;
constructor(props: TableBaseProps);
componentDidMount(): void;
componentWillUnmount(): void;
componentDidUpdate(preProps: TableBaseProps): void;
private updateTableSize;
private onClientScroll;
private onContentScroll;
render(): JSX.Element;
}
export default TableBase;