material-react-table 2.0.0-alpha.2 → 2.0.0-alpha.4
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 +208 -144
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/icons.d.ts +4 -0
- package/dist/cjs/types/locales/np.d.ts +2 -0
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
- package/dist/cjs/types/types.d.ts +29 -3
- package/dist/esm/material-react-table.esm.js +200 -144
- 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/np.d.ts +2 -0
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
- package/dist/esm/types/types.d.ts +29 -3
- package/dist/index.d.ts +35 -5
- package/locales/np.d.ts +2 -0
- package/locales/np.esm.d.ts +2 -0
- package/locales/np.esm.js +94 -0
- package/locales/np.esm.js.map +1 -0
- package/locales/np.js +98 -0
- package/locales/np.js.map +1 -0
- package/package.json +26 -26
- package/src/column.utils.ts +1 -5
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +1 -1
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +6 -6
- package/src/hooks/useMRT_Effects.ts +13 -2
- package/src/icons.ts +12 -0
- package/src/inputs/MRT_FilterTextField.tsx +302 -223
- package/src/locales/np.ts +94 -0
- package/src/menus/MRT_ColumnActionMenu.tsx +34 -31
- package/src/menus/MRT_FilterOptionMenu.tsx +1 -1
- package/src/toolbar/MRT_TablePagination.tsx +124 -67
- package/src/types.ts +44 -5
@@ -2,6 +2,8 @@ export interface MRT_Icons {
|
|
2
2
|
ArrowDownwardIcon: any;
|
3
3
|
ArrowRightIcon: any;
|
4
4
|
CancelIcon: any;
|
5
|
+
ChevronLefIcon: 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 {};
|
@@ -2,12 +2,14 @@ import { type Dispatch, type MutableRefObject, type ReactNode, type RefObject, t
|
|
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
4
|
import { type AlertProps } from '@mui/material/Alert';
|
5
|
+
import { type AutocompleteProps } from '@mui/material/Autocomplete';
|
5
6
|
import { type ButtonProps } from '@mui/material/Button';
|
6
7
|
import { type CheckboxProps } from '@mui/material/Checkbox';
|
7
8
|
import { type ChipProps } from '@mui/material/Chip';
|
8
9
|
import { type DialogProps } from '@mui/material/Dialog';
|
9
10
|
import { type IconButtonProps } from '@mui/material/IconButton';
|
10
11
|
import { type LinearProgressProps } from '@mui/material/LinearProgress';
|
12
|
+
import { type PaginationProps } from '@mui/material/Pagination';
|
11
13
|
import { type PaperProps } from '@mui/material/Paper';
|
12
14
|
import { type RadioProps } from '@mui/material/Radio';
|
13
15
|
import { type SkeletonProps } from '@mui/material/Skeleton';
|
@@ -18,10 +20,10 @@ import { type TableCellProps } from '@mui/material/TableCell';
|
|
18
20
|
import { type TableContainerProps } from '@mui/material/TableContainer';
|
19
21
|
import { type TableFooterProps } from '@mui/material/TableFooter';
|
20
22
|
import { type TableHeadProps } from '@mui/material/TableHead';
|
21
|
-
import { type TablePaginationProps } from '@mui/material/TablePagination';
|
22
23
|
import { type TableRowProps } from '@mui/material/TableRow';
|
23
24
|
import { type TextFieldProps } from '@mui/material/TextField';
|
24
25
|
import { type ToolbarProps } from '@mui/material/Toolbar';
|
26
|
+
import { type DatePickerProps } from '@mui/x-date-pickers';
|
25
27
|
import { type MRT_AggregationFns } from './aggregationFns';
|
26
28
|
import { type MRT_FilterFns } from './filterFns';
|
27
29
|
import { type MRT_Icons } from './icons';
|
@@ -313,7 +315,7 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
|
|
313
315
|
text: string;
|
314
316
|
value: any;
|
315
317
|
} | string)[];
|
316
|
-
filterVariant?: 'checkbox' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text';
|
318
|
+
filterVariant?: 'autocomplete' | 'checkbox' | 'date' | 'date-range' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text';
|
317
319
|
/**
|
318
320
|
* footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
|
319
321
|
*/
|
@@ -352,10 +354,19 @@ export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TD
|
|
352
354
|
row: MRT_Row<TData>;
|
353
355
|
table: MRT_TableInstance<TData>;
|
354
356
|
}) => TextFieldProps) | TextFieldProps;
|
357
|
+
muiFilterAutocompleteProps?: ((props: {
|
358
|
+
column: MRT_Column<TData>;
|
359
|
+
table: MRT_TableInstance<TData>;
|
360
|
+
}) => AutocompleteProps<any, any, any, any>) | AutocompleteProps<any, any, any, any>;
|
355
361
|
muiFilterCheckboxProps?: ((props: {
|
356
362
|
column: MRT_Column<TData>;
|
357
363
|
table: MRT_TableInstance<TData>;
|
358
364
|
}) => CheckboxProps) | CheckboxProps;
|
365
|
+
muiFilterDatePickerProps?: ((props: {
|
366
|
+
column: MRT_Column<TData>;
|
367
|
+
rangeFilterIndex?: number;
|
368
|
+
table: MRT_TableInstance<TData>;
|
369
|
+
}) => DatePickerProps<any>) | DatePickerProps<any>;
|
359
370
|
muiFilterSliderProps?: ((props: {
|
360
371
|
column: MRT_Column<TData>;
|
361
372
|
table: MRT_TableInstance<TData>;
|
@@ -576,10 +587,19 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
576
587
|
row: MRT_Row<TData>;
|
577
588
|
table: MRT_TableInstance<TData>;
|
578
589
|
}) => IconButtonProps) | IconButtonProps;
|
590
|
+
muiFilterAutocompleteProps?: ((props: {
|
591
|
+
column: MRT_Column<TData>;
|
592
|
+
table: MRT_TableInstance<TData>;
|
593
|
+
}) => AutocompleteProps<any, any, any, any>) | AutocompleteProps<any, any, any, any>;
|
579
594
|
muiFilterCheckboxProps?: ((props: {
|
580
595
|
column: MRT_Column<TData>;
|
581
596
|
table: MRT_TableInstance<TData>;
|
582
597
|
}) => CheckboxProps) | CheckboxProps;
|
598
|
+
muiFilterDatePickerProps?: ((props: {
|
599
|
+
column: MRT_Column<TData>;
|
600
|
+
rangeFilterIndex?: number;
|
601
|
+
table: MRT_TableInstance<TData>;
|
602
|
+
}) => DatePickerProps<any>) | DatePickerProps<any>;
|
583
603
|
muiFilterSliderProps?: ((props: {
|
584
604
|
column: MRT_Column<TData>;
|
585
605
|
table: MRT_TableInstance<TData>;
|
@@ -655,7 +675,13 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<T
|
|
655
675
|
}) => TableRowProps) | TableRowProps;
|
656
676
|
muiTablePaginationProps?: ((props: {
|
657
677
|
table: MRT_TableInstance<TData>;
|
658
|
-
}) => Partial<
|
678
|
+
}) => Partial<PaginationProps & {
|
679
|
+
rowsPerPageOptions?: number[];
|
680
|
+
showRowsPerPage?: boolean;
|
681
|
+
}>) | Partial<PaginationProps & {
|
682
|
+
rowsPerPageOptions?: number[];
|
683
|
+
showRowsPerPage?: boolean;
|
684
|
+
}>;
|
659
685
|
muiTablePaperProps?: ((props: {
|
660
686
|
table: MRT_TableInstance<TData>;
|
661
687
|
}) => PaperProps) | PaperProps;
|