tdesign-react
Version:
TDesign Component for React
55 lines (54 loc) • 3.34 kB
TypeScript
import React from 'react';
import { PrimaryTableCellParams, PrimaryTableCol, RowClassNameParams, TableRowData, TdPrimaryTableProps } from '../type';
import { TableClassName } from './useClassName';
import { ClassName } from '../../common';
export default function useRowSelect(props: TdPrimaryTableProps, tableSelectedClasses: TableClassName['tableSelectedClasses']): {
selectedRowClassNames: ClassName | ((params: RowClassNameParams<TableRowData>) => ClassName);
currentPaginateData: TableRowData[];
setCurrentPaginateData: React.Dispatch<React.SetStateAction<TableRowData[]>>;
setTSelectedRowKeys: import("../../hooks/useControlled").ChangeHandler<(string | number)[], [options: import("../type").SelectOptions<TableRowData>]>;
formatToRowSelectColumn: (col: PrimaryTableCol) => PrimaryTableCol<TableRowData> | {
width: string | number;
className: string;
cell: (p: PrimaryTableCellParams<TableRowData>) => React.JSX.Element;
title: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | ((props: {
col: PrimaryTableCol;
colIndex: number;
}) => React.ReactNode) | (() => React.JSX.Element);
checkProps?: import("../type").CheckProps<TableRowData>;
children?: PrimaryTableCol<TableRowData>[];
colKey?: string;
disabled?: (options: {
row: TableRowData;
rowIndex: number;
}) => boolean;
edit?: import("../type").TableEditableCellConfig<TableRowData>;
filter?: import("../type").TableColumnFilter;
render?: React.ReactNode | ((props: import("../type").PrimaryTableRenderParams<TableRowData>) => React.ReactNode);
sortType?: import("../type").SortType;
sorter?: boolean | import("../type").SorterFun<TableRowData>;
type?: "single" | "multiple";
fixed?: "left" | "right";
resize?: import("../type").TableColumnResizeConfig;
ellipsis?: React.ReactNode | import("../..").TdTooltipProps | ((props: import("../type").BaseTableCellParams<TableRowData>) => React.ReactNode) | {
props: import("../..").TooltipProps;
content: React.ReactNode | ((props: import("../type").BaseTableCellParams<TableRowData>) => React.ReactNode);
};
align?: "left" | "right" | "center";
minWidth?: string | number;
stopPropagation?: boolean;
resizable?: boolean;
attrs?: import("../type").BaseTableColumnAttributes<TableRowData>;
colspan?: number;
ellipsisTitle?: React.ReactNode | import("../..").TdTooltipProps | ((props: import("../type").BaseTableColParams<TableRowData>) => React.ReactNode) | {
props: import("../..").TooltipProps;
content: React.ReactNode | ((props: import("../type").BaseTableColParams<TableRowData>) => React.ReactNode);
};
foot?: string | import("../../common").TNode | import("../../common").TNode<{
col: import("../type").BaseTableCol;
colIndex: number;
}>;
thClassName?: import("../type").TableColumnClassName<TableRowData> | import("../type").TableColumnClassName<TableRowData>[];
};
onInnerSelectRowClick: (context: import("../type").RowEventContext<TableRowData>) => void;
};