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.
Files changed (47) hide show
  1. package/dist/cjs/index.js +489 -435
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/icons.d.ts +4 -0
  4. package/dist/cjs/types/locales/hy.d.ts +2 -0
  5. package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
  6. package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
  7. package/dist/cjs/types/types.d.ts +18 -7
  8. package/dist/esm/material-react-table.esm.js +457 -410
  9. package/dist/esm/material-react-table.esm.js.map +1 -1
  10. package/dist/esm/types/icons.d.ts +4 -0
  11. package/dist/esm/types/locales/hy.d.ts +2 -0
  12. package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
  13. package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
  14. package/dist/esm/types/types.d.ts +18 -7
  15. package/dist/index.d.ts +25 -10
  16. package/locales/hy.d.ts +2 -0
  17. package/locales/hy.esm.d.ts +2 -0
  18. package/locales/hy.esm.js +93 -0
  19. package/locales/hy.esm.js.map +1 -0
  20. package/locales/hy.js +97 -0
  21. package/locales/hy.js.map +1 -0
  22. package/package.json +7 -7
  23. package/src/body/MRT_TableBody.tsx +13 -21
  24. package/src/body/MRT_TableBodyCell.tsx +2 -2
  25. package/src/body/MRT_TableBodyRow.tsx +3 -3
  26. package/src/body/MRT_TableDetailPanel.tsx +3 -3
  27. package/src/buttons/MRT_GrabHandleButton.tsx +1 -2
  28. package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -2
  29. package/src/buttons/MRT_ToggleDensePaddingButton.tsx +1 -2
  30. package/src/buttons/MRT_ToggleFiltersButton.tsx +1 -2
  31. package/src/buttons/MRT_ToggleFullScreenButton.tsx +2 -3
  32. package/src/column.utils.ts +15 -9
  33. package/src/footer/MRT_TableFooter.tsx +1 -1
  34. package/src/footer/MRT_TableFooterCell.tsx +1 -1
  35. package/src/footer/MRT_TableFooterRow.tsx +2 -2
  36. package/src/head/MRT_TableHead.tsx +36 -14
  37. package/src/head/MRT_TableHeadCell.tsx +1 -1
  38. package/src/head/MRT_TableHeadRow.tsx +2 -2
  39. package/src/hooks/useMRT_Effects.ts +13 -2
  40. package/src/hooks/useMRT_TableOptions.ts +7 -2
  41. package/src/icons.ts +12 -0
  42. package/src/locales/hy.ts +93 -0
  43. package/src/table/MRT_Table.tsx +4 -2
  44. package/src/toolbar/MRT_TablePagination.tsx +135 -68
  45. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +53 -15
  46. package/src/toolbar/MRT_TopToolbar.tsx +1 -1
  47. 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;
@@ -0,0 +1,2 @@
1
+ import { type MRT_Localization } from '..';
2
+ export declare const MRT_Localization_HY: MRT_Localization;
@@ -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>>({ position, table, }: Props<TData>) => import("react/jsx-runtime").JSX.Element;
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: boolean;
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;