material-react-table 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/column.utils.d.ts +4 -4
- package/dist/esm/material-react-table.esm.js +5 -1
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/column.utils.d.ts +4 -4
- package/package.json +1 -1
- package/src/column.utils.ts +6 -8
- package/src/head/MRT_TableHeadCellSortLabel.tsx +4 -0
@@ -1,10 +1,10 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Row } from '@tanstack/react-table';
|
2
2
|
import { MRT_AggregationFns } from './aggregationFns';
|
3
3
|
import { MRT_FilterFns } from './filterFns';
|
4
4
|
import { MRT_SortingFns } from './sortingFns';
|
5
5
|
import type { TableCellProps } from '@mui/material/TableCell';
|
6
6
|
import type { Theme } from '@mui/material/styles';
|
7
|
-
import type { MaterialReactTableProps, MRT_Column, MRT_ColumnDef, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterOption, MRT_Header, MRT_TableInstance } from '.';
|
7
|
+
import type { MaterialReactTableProps, MRT_Column, MRT_ColumnDef, MRT_ColumnOrderState, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterOption, MRT_GroupingState, MRT_Header, MRT_TableInstance } from '.';
|
8
8
|
export declare const getColumnId: <TData extends Record<string, any> = {}>(columnDef: MRT_ColumnDef<TData>) => string;
|
9
9
|
export declare const getAllLeafColumnDefs: <TData extends Record<string, any> = {}>(columns: MRT_ColumnDef<TData>[]) => MRT_ColumnDef<TData>[];
|
10
10
|
export declare const prepareColumns: <TData extends Record<string, any> = {}>({ aggregationFns, columnDefs, columnFilterFns, defaultDisplayColumn, filterFns, sortingFns, }: {
|
@@ -100,8 +100,8 @@ export declare const prepareColumns: <TData extends Record<string, any> = {}>({
|
|
100
100
|
basic: import("@tanstack/react-table").SortingFn<any>;
|
101
101
|
} & Record<string, import("@tanstack/react-table").SortingFn<any>>;
|
102
102
|
}) => MRT_DefinedColumnDef<TData>[];
|
103
|
-
export declare const reorderColumn: <TData extends Record<string, any> = {}>(draggedColumn: MRT_Column<TData>, targetColumn: MRT_Column<TData>, columnOrder:
|
104
|
-
export declare const showExpandColumn: <TData extends Record<string, any> = {}>(props: MaterialReactTableProps<TData>, grouping?:
|
103
|
+
export declare const reorderColumn: <TData extends Record<string, any> = {}>(draggedColumn: MRT_Column<TData>, targetColumn: MRT_Column<TData>, columnOrder: MRT_ColumnOrderState) => MRT_ColumnOrderState;
|
104
|
+
export declare const showExpandColumn: <TData extends Record<string, any> = {}>(props: MaterialReactTableProps<TData>, grouping?: MRT_GroupingState) => boolean;
|
105
105
|
export declare const getLeadingDisplayColumnIds: <TData extends Record<string, any> = {}>(props: MaterialReactTableProps<TData>) => MRT_DisplayColumnIds[];
|
106
106
|
export declare const getTrailingDisplayColumnIds: <TData extends Record<string, any> = {}>(props: MaterialReactTableProps<TData>) => (string | false | undefined)[];
|
107
107
|
export declare const getDefaultColumnOrderIds: <TData extends Record<string, any> = {}>(props: MaterialReactTableProps<TData>) => string[];
|
@@ -1879,7 +1879,11 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
1879
1879
|
transform: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) !== 'right'
|
1880
1880
|
? 'translateX(-0.5ch)'
|
1881
1881
|
: undefined,
|
1882
|
-
}, IconComponent: ArrowDownwardIcon
|
1882
|
+
}, IconComponent: ArrowDownwardIcon, onClick: (e) => {
|
1883
|
+
var _a;
|
1884
|
+
e.stopPropagation();
|
1885
|
+
(_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(e);
|
1886
|
+
} })));
|
1883
1887
|
};
|
1884
1888
|
|
1885
1889
|
const MRT_TableHeadCell = ({ header, table }) => {
|