UNPKG

1.26 kBTypeScriptView Raw
1import * as React from 'react';
2import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
3import { SvgIconProps } from '../SvgIcon';
4import { OverrideProps } from '../OverridableComponent';
5
6export type TableSortLabelTypeMap<
7 P = {},
8 D extends React.ElementType = 'span'
9> = ExtendButtonBaseTypeMap<{
10 props: P & {
11 active?: boolean;
12 direction?: 'asc' | 'desc';
13 hideSortIcon?: boolean;
14 IconComponent?: React.ComponentType<{ className: string }>;
15 };
16 defaultComponent: D;
17 classKey: TableSortLabelClassKey;
18}>;
19
20/**
21 * A button based label for placing inside `TableCell` for column sorting.
22 * Demos:
23 *
24 * - [Tables](https://material-ui.com/components/tables/)
25 *
26 * API:
27 *
28 * - [TableSortLabel API](https://material-ui.com/api/table-sort-label/)
29 * - inherits [ButtonBase API](https://material-ui.com/api/button-base/)
30 */
31declare const TableSortLabel: ExtendButtonBase<TableSortLabelTypeMap>;
32
33export type TableSortLabelClassKey =
34 | 'root'
35 | 'active'
36 | 'icon'
37 | 'iconDirectionDesc'
38 | 'iconDirectionAsc';
39
40export type TableSortLabelProps<
41 D extends React.ElementType = TableSortLabelTypeMap['defaultComponent'],
42 P = {}
43> = OverrideProps<TableSortLabelTypeMap<P, D>, D>;
44
45export default TableSortLabel;