material-react-table 2.0.0-alpha.3 → 2.0.0-alpha.5
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 +489 -435
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/icons.d.ts +4 -0
- package/dist/cjs/types/locales/hy.d.ts +2 -0
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/cjs/types/types.d.ts +18 -7
- package/dist/esm/material-react-table.esm.js +457 -410
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/icons.d.ts +4 -0
- package/dist/esm/types/locales/hy.d.ts +2 -0
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/esm/types/types.d.ts +18 -7
- package/dist/index.d.ts +25 -10
- package/locales/hy.d.ts +2 -0
- package/locales/hy.esm.d.ts +2 -0
- package/locales/hy.esm.js +93 -0
- package/locales/hy.esm.js.map +1 -0
- package/locales/hy.js +97 -0
- package/locales/hy.js.map +1 -0
- package/package.json +7 -7
- package/src/body/MRT_TableBody.tsx +13 -21
- package/src/body/MRT_TableBodyCell.tsx +2 -2
- package/src/body/MRT_TableBodyRow.tsx +3 -3
- package/src/body/MRT_TableDetailPanel.tsx +3 -3
- package/src/buttons/MRT_GrabHandleButton.tsx +1 -2
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -2
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +1 -2
- package/src/buttons/MRT_ToggleFiltersButton.tsx +1 -2
- package/src/buttons/MRT_ToggleFullScreenButton.tsx +2 -3
- package/src/column.utils.ts +15 -9
- package/src/footer/MRT_TableFooter.tsx +1 -1
- package/src/footer/MRT_TableFooterCell.tsx +1 -1
- package/src/footer/MRT_TableFooterRow.tsx +2 -2
- package/src/head/MRT_TableHead.tsx +36 -14
- package/src/head/MRT_TableHeadCell.tsx +1 -1
- package/src/head/MRT_TableHeadRow.tsx +2 -2
- package/src/hooks/useMRT_Effects.ts +13 -2
- package/src/hooks/useMRT_TableOptions.ts +7 -2
- package/src/icons.ts +12 -0
- package/src/locales/hy.ts +93 -0
- package/src/table/MRT_Table.tsx +4 -2
- package/src/toolbar/MRT_TablePagination.tsx +135 -68
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +53 -15
- package/src/toolbar/MRT_TopToolbar.tsx +1 -1
- package/src/types.ts +22 -9
@@ -2,6 +2,8 @@ export interface MRT_Icons {
|
|
2
2
|
ArrowDownwardIcon: any;
|
3
3
|
ArrowRightIcon: any;
|
4
4
|
CancelIcon: any;
|
5
|
+
ChevronLeftIcon: any;
|
6
|
+
ChevronRightIcon: any;
|
5
7
|
ClearAllIcon: any;
|
6
8
|
CloseIcon: any;
|
7
9
|
DensityLargeIcon: any;
|
@@ -14,9 +16,11 @@ export interface MRT_Icons {
|
|
14
16
|
FilterAltIcon: any;
|
15
17
|
FilterListIcon: any;
|
16
18
|
FilterListOffIcon: any;
|
19
|
+
FirstPageIcon?: any;
|
17
20
|
FullscreenExitIcon: any;
|
18
21
|
FullscreenIcon: any;
|
19
22
|
KeyboardDoubleArrowDownIcon: any;
|
23
|
+
LastPageIcon?: any;
|
20
24
|
MoreHorizIcon: any;
|
21
25
|
MoreVertIcon: any;
|
22
26
|
PushPinIcon: any;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { type MRT_TableInstance } from '../types';
|
2
|
-
interface Props<TData extends Record<string, any
|
2
|
+
interface Props<TData extends Record<string, any> = {}> {
|
3
3
|
position?: 'bottom' | 'top';
|
4
4
|
table: MRT_TableInstance<TData>;
|
5
5
|
}
|
6
|
-
export declare const MRT_TablePagination: <TData extends Record<string, any
|
6
|
+
export declare const MRT_TablePagination: <TData extends Record<string, any> = {}>({ position, table, }: Props<TData>) => import("react/jsx-runtime").JSX.Element;
|
7
7
|
export {};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type MRT_TableInstance } from '../types';
|
2
2
|
interface Props<TData extends Record<string, any>> {
|
3
|
-
stackAlertBanner
|
3
|
+
stackAlertBanner?: boolean;
|
4
4
|
table: MRT_TableInstance<TData>;
|
5
5
|
}
|
6
6
|
export declare const MRT_ToolbarAlertBanner: <TData extends Record<string, any>>({ stackAlertBanner, table, }: Props<TData>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { type Dispatch, type MutableRefObject, type ReactNode, type RefObject, type SetStateAction } from 'react';
|
2
2
|
import { type AggregationFn, type Cell, type Column, type ColumnDef, type ColumnFiltersState, type ColumnOrderState, type ColumnPinningState, type ColumnSizingInfoState, type ColumnSizingState, type DeepKeys, type ExpandedState, type FilterFn, type GroupingState, type Header, type HeaderGroup, type OnChangeFn, type PaginationState, type Row, type RowSelectionState, type SortingFn, type SortingState, type Table, type TableOptions, type TableState, type Updater, type VisibilityState } from '@tanstack/react-table';
|
3
3
|
import { type VirtualItem, type Virtualizer, type VirtualizerOptions } from '@tanstack/react-virtual';
|
4
|
-
import { type AutocompleteProps } from '@mui/material';
|
5
4
|
import { type AlertProps } from '@mui/material/Alert';
|
5
|
+
import { type AutocompleteProps } from '@mui/material/Autocomplete';
|
6
6
|
import { type ButtonProps } from '@mui/material/Button';
|
7
7
|
import { type CheckboxProps } from '@mui/material/Checkbox';
|
8
8
|
import { type ChipProps } from '@mui/material/Chip';
|
9
9
|
import { type DialogProps } from '@mui/material/Dialog';
|
10
10
|
import { type IconButtonProps } from '@mui/material/IconButton';
|
11
11
|
import { type LinearProgressProps } from '@mui/material/LinearProgress';
|
12
|
+
import { type PaginationProps } from '@mui/material/Pagination';
|
12
13
|
import { type PaperProps } from '@mui/material/Paper';
|
13
14
|
import { type RadioProps } from '@mui/material/Radio';
|
14
15
|
import { type SkeletonProps } from '@mui/material/Skeleton';
|
@@ -19,7 +20,6 @@ import { type TableCellProps } from '@mui/material/TableCell';
|
|
19
20
|
import { type TableContainerProps } from '@mui/material/TableContainer';
|
20
21
|
import { type TableFooterProps } from '@mui/material/TableFooter';
|
21
22
|
import { type TableHeadProps } from '@mui/material/TableHead';
|
22
|
-
import { type TablePaginationProps } from '@mui/material/TablePagination';
|
23
23
|
import { type TableRowProps } from '@mui/material/TableRow';
|
24
24
|
import { type TextFieldProps } from '@mui/material/TextField';
|
25
25
|
import { type ToolbarProps } from '@mui/material/Toolbar';
|
@@ -530,7 +530,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
530
530
|
/**
|
531
531
|
* Changes which kind of CSS layout is used to render the table. `semantic` uses default semantic HTML elements, while `grid` adds CSS grid and flexbox styles
|
532
532
|
*/
|
533
|
-
layoutMode?: 'grid' | 'semantic';
|
533
|
+
layoutMode?: 'grid' | 'grid-no-grow' | 'semantic';
|
534
534
|
/**
|
535
535
|
* Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
|
536
536
|
*
|
@@ -613,6 +613,15 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
613
613
|
isTopToolbar: boolean;
|
614
614
|
table: MRT_TableInstance<TData>;
|
615
615
|
}) => LinearProgressProps) | LinearProgressProps;
|
616
|
+
muiPaginationProps?: ((props: {
|
617
|
+
table: MRT_TableInstance<TData>;
|
618
|
+
}) => Partial<PaginationProps & {
|
619
|
+
rowsPerPageOptions?: number[];
|
620
|
+
showRowsPerPage?: boolean;
|
621
|
+
}>) | Partial<PaginationProps & {
|
622
|
+
rowsPerPageOptions?: number[];
|
623
|
+
showRowsPerPage?: boolean;
|
624
|
+
}>;
|
616
625
|
muiRowDragHandleProps?: ((props: {
|
617
626
|
row: MRT_Row<TData>;
|
618
627
|
table: MRT_TableInstance<TData>;
|
@@ -673,9 +682,6 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
673
682
|
headerGroup: MRT_HeaderGroup<TData>;
|
674
683
|
table: MRT_TableInstance<TData>;
|
675
684
|
}) => TableRowProps) | TableRowProps;
|
676
|
-
muiTablePaginationProps?: ((props: {
|
677
|
-
table: MRT_TableInstance<TData>;
|
678
|
-
}) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>) | Partial<Omit<TablePaginationProps, 'rowsPerPage'>>;
|
679
685
|
muiTablePaperProps?: ((props: {
|
680
686
|
table: MRT_TableInstance<TData>;
|
681
687
|
}) => PaperProps) | PaperProps;
|
@@ -737,7 +743,7 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
737
743
|
positionExpandColumn?: 'first' | 'last';
|
738
744
|
positionGlobalFilter?: 'left' | 'none' | 'right';
|
739
745
|
positionPagination?: 'both' | 'bottom' | 'none' | 'top';
|
740
|
-
positionToolbarAlertBanner?: 'bottom' | 'none' | 'top';
|
746
|
+
positionToolbarAlertBanner?: 'bottom' | 'head-overlay' | 'none' | 'top';
|
741
747
|
positionToolbarDropZone?: 'both' | 'bottom' | 'none' | 'top';
|
742
748
|
renderBottomToolbar?: ((props: {
|
743
749
|
table: MRT_TableInstance<TData>;
|
@@ -789,6 +795,11 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
789
795
|
row: MRT_Row<TData>;
|
790
796
|
table: MRT_TableInstance<TData>;
|
791
797
|
}) => ReactNode;
|
798
|
+
renderToolbarAlertBannerContent?: (props: {
|
799
|
+
groupedAlert: ReactNode | null;
|
800
|
+
selectedAlert: ReactNode | null;
|
801
|
+
table: MRT_TableInstance<TData>;
|
802
|
+
}) => ReactNode;
|
792
803
|
renderToolbarInternalActions?: (props: {
|
793
804
|
table: MRT_TableInstance<TData>;
|
794
805
|
}) => ReactNode;
|