material-react-table 1.0.11 → 1.1.0-beta.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.
Files changed (42) hide show
  1. package/dist/cjs/MaterialReactTable.d.ts +12 -5
  2. package/dist/cjs/_locales/ja.d.ts +2 -0
  3. package/dist/cjs/body/MRT_TableBody.d.ts +2 -1
  4. package/dist/cjs/body/MRT_TableBodyCell.d.ts +2 -1
  5. package/dist/cjs/body/MRT_TableBodyRow.d.ts +2 -1
  6. package/dist/cjs/index.js +352 -323
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/table/MRT_TableRoot.d.ts +5 -4
  9. package/dist/esm/MaterialReactTable.d.ts +12 -5
  10. package/dist/esm/_locales/ja.d.ts +2 -0
  11. package/dist/esm/body/MRT_TableBody.d.ts +2 -1
  12. package/dist/esm/body/MRT_TableBodyCell.d.ts +2 -1
  13. package/dist/esm/body/MRT_TableBodyRow.d.ts +2 -1
  14. package/dist/esm/material-react-table.esm.js +353 -324
  15. package/dist/esm/material-react-table.esm.js.map +1 -1
  16. package/dist/esm/table/MRT_TableRoot.d.ts +5 -4
  17. package/dist/index.d.ts +44 -37
  18. package/locales/ja.d.ts +2 -0
  19. package/locales/ja.esm.d.ts +2 -0
  20. package/locales/ja.esm.js +92 -0
  21. package/locales/ja.esm.js.map +1 -0
  22. package/locales/ja.js +96 -0
  23. package/locales/ja.js.map +1 -0
  24. package/package.json +13 -13
  25. package/src/MaterialReactTable.tsx +15 -7
  26. package/src/_locales/ja.ts +92 -1
  27. package/src/body/MRT_TableBody.tsx +18 -12
  28. package/src/body/MRT_TableBodyCell.tsx +7 -1
  29. package/src/body/MRT_TableBodyRow.tsx +36 -15
  30. package/src/body/MRT_TableDetailPanel.tsx +1 -1
  31. package/src/buttons/MRT_ExpandAllButton.tsx +1 -1
  32. package/src/buttons/MRT_ExpandButton.tsx +1 -1
  33. package/src/buttons/MRT_GrabHandleButton.tsx +1 -1
  34. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +1 -1
  35. package/src/column.utils.ts +1 -1
  36. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +9 -7
  37. package/src/head/MRT_TableHeadCellResizeHandle.tsx +3 -1
  38. package/src/inputs/MRT_SelectCheckbox.tsx +51 -46
  39. package/src/table/MRT_Table.tsx +7 -2
  40. package/src/table/MRT_TablePaper.tsx +1 -1
  41. package/src/table/MRT_TableRoot.tsx +1 -1
  42. package/src/toolbar/MRT_TopToolbar.tsx +1 -1
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_FilterOption, MRT_Row, MRT_TableInstance, MRT_TableState, MaterialReactTableProps, MRT_Localization } from '..';
3
- export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/table-core").TableOptions<TData>>, "state" | "data" | "onStateChange" | "initialState" | "columns" | "defaultColumn" | "enableRowSelection" | "expandRowsFn"> & {
3
+ export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/table-core").TableOptions<TData>>, "initialState" | "state" | "onStateChange" | "data" | "columns" | "defaultColumn" | "enableRowSelection" | "expandRowsFn"> & {
4
4
  columnFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined;
5
5
  columns: MRT_ColumnDef<TData>[];
6
6
  data: TData[];
@@ -13,7 +13,7 @@ export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(pro
13
13
  "mrt-row-select": Partial<MRT_ColumnDef<{}>>;
14
14
  "mrt-row-numbers": Partial<MRT_ColumnDef<{}>>;
15
15
  }> | undefined;
16
- editingMode?: "cell" | "row" | "table" | "modal" | undefined;
16
+ editingMode?: "row" | "cell" | "table" | "modal" | undefined;
17
17
  enableBottomToolbar?: boolean | undefined;
18
18
  enableClickToCopy?: boolean | undefined;
19
19
  enableColumnActions?: boolean | undefined;
@@ -45,6 +45,7 @@ export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(pro
45
45
  icons?: Partial<import("..").MRT_Icons> | undefined;
46
46
  initialState?: Partial<MRT_TableState<TData>> | undefined;
47
47
  localization?: Partial<MRT_Localization> | undefined;
48
+ memoMode?: "row" | "cell" | "table-body" | undefined;
48
49
  muiBottomToolbarProps?: import("@mui/material").ToolbarProps<"div", {}> | (({ table }: {
49
50
  table: MRT_TableInstance<TData>;
50
51
  }) => import("@mui/material").ToolbarProps<"div", {}>) | undefined;
@@ -65,10 +66,10 @@ export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(pro
65
66
  muiSelectAllCheckboxProps?: import("@mui/material").CheckboxProps | (({ table }: {
66
67
  table: MRT_TableInstance<TData>;
67
68
  }) => import("@mui/material").CheckboxProps) | undefined;
68
- muiSelectCheckboxProps?: import("@mui/material").CheckboxProps | (({ table, row, }: {
69
+ muiSelectCheckboxProps?: import("@mui/material").CheckboxProps | import("@mui/material").RadioProps | (({ table, row, }: {
69
70
  table: MRT_TableInstance<TData>;
70
71
  row: MRT_Row<TData>;
71
- }) => import("@mui/material").CheckboxProps) | undefined;
72
+ }) => import("@mui/material").CheckboxProps | import("@mui/material").RadioProps) | undefined;
72
73
  muiTableBodyCellCopyButtonProps?: import("@mui/material").ButtonProps<"button", {}> | (({ cell, column, row, table, }: {
73
74
  cell: MRT_Cell<TData>;
74
75
  column: MRT_Column<TData>;
@@ -1,9 +1,9 @@
1
1
  import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from 'react';
2
- import type { AlertProps, ButtonProps, CheckboxProps, ChipProps, IconButtonProps, LinearProgressProps, PaperProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
2
+ import type { AlertProps, ButtonProps, CheckboxProps, ChipProps, IconButtonProps, LinearProgressProps, PaperProps, RadioProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
3
3
  import type { Cell, Column, ColumnDef, DeepKeys, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
4
4
  import type { Options as VirtualizerOptions, VirtualItem } from 'react-virtual';
5
- import { MRT_Icons } from './icons';
6
5
  import { MRT_FilterFns } from './filterFns';
6
+ import { MRT_Icons } from './icons';
7
7
  import { MRT_SortingFns } from './sortingFns';
8
8
  /**
9
9
  * Most of this file is just TypeScript types
@@ -329,7 +329,7 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
329
329
  onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
330
330
  table: MRT_TableInstance<TData>;
331
331
  }) => ReactNode[];
332
- sortingFn?: MRT_SortingFn;
332
+ sortingFn?: MRT_SortingFn<TData>;
333
333
  };
334
334
  export declare type MRT_DefinedColumnDef<TData extends Record<string, any> = {}> = Omit<MRT_ColumnDef<TData>, 'id' | 'defaultDisplayColumn'> & {
335
335
  defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
@@ -448,6 +448,13 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
448
448
  * @link https://www.material-react-table.com/docs/guides/localization
449
449
  */
450
450
  localization?: Partial<MRT_Localization>;
451
+ /**
452
+ * Memoize cells, rows, or the entire table body to potentially improve render performance.
453
+ *
454
+ * @warning This will break some dynamic rendering features. See the memoization guide for more info:
455
+ * @link https://www.material-react-table.com/docs/guides/memoize-components
456
+ */
457
+ memoMode?: 'cell' | 'row' | 'table-body';
451
458
  muiBottomToolbarProps?: ToolbarProps | (({ table }: {
452
459
  table: MRT_TableInstance<TData>;
453
460
  }) => ToolbarProps);
@@ -468,10 +475,10 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
468
475
  muiSelectAllCheckboxProps?: CheckboxProps | (({ table }: {
469
476
  table: MRT_TableInstance<TData>;
470
477
  }) => CheckboxProps);
471
- muiSelectCheckboxProps?: CheckboxProps | (({ table, row, }: {
478
+ muiSelectCheckboxProps?: (CheckboxProps | RadioProps) | (({ table, row, }: {
472
479
  table: MRT_TableInstance<TData>;
473
480
  row: MRT_Row<TData>;
474
- }) => CheckboxProps);
481
+ }) => CheckboxProps | RadioProps);
475
482
  muiTableBodyCellCopyButtonProps?: ButtonProps | (({ cell, column, row, table, }: {
476
483
  cell: MRT_Cell<TData>;
477
484
  column: MRT_Column<TData>;
@@ -0,0 +1,2 @@
1
+ import { MRT_Localization } from '../MaterialReactTable';
2
+ export declare const MRT_Localization_JA: MRT_Localization;
@@ -1,7 +1,8 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  import type { MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  table: MRT_TableInstance;
5
5
  }
6
6
  export declare const MRT_TableBody: FC<Props>;
7
+ export declare const Memo_MRT_TableBody: React.NamedExoticComponent<Props>;
7
8
  export {};
@@ -1,4 +1,4 @@
1
- import { FC, RefObject } from 'react';
1
+ import React, { FC, RefObject } from 'react';
2
2
  import type { MRT_Cell, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  cell: MRT_Cell;
@@ -8,4 +8,5 @@ interface Props {
8
8
  table: MRT_TableInstance;
9
9
  }
10
10
  export declare const MRT_TableBodyCell: FC<Props>;
11
+ export declare const Memo_MRT_TableBodyCell: React.NamedExoticComponent<Props>;
11
12
  export {};
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  import type { MRT_Row, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  row: MRT_Row;
@@ -7,4 +7,5 @@ interface Props {
7
7
  virtualRow?: any;
8
8
  }
9
9
  export declare const MRT_TableBodyRow: FC<Props>;
10
+ export declare const Memo_MRT_TableBodyRow: React.NamedExoticComponent<Props>;
10
11
  export {};