material-react-table 0.15.1 → 0.16.0

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.
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import { MaterialReactTableProps } from '../MaterialReactTable';
2
3
  export declare const MRT_TableRoot: <D extends Record<string, any> = {}>(props: MaterialReactTableProps<D>) => JSX.Element;
package/dist/utils.d.ts CHANGED
@@ -2,12 +2,12 @@ import { ColumnDef, ColumnOrderState, Table, Updater } from '@tanstack/react-tab
2
2
  import { MaterialReactTableProps, MRT_Column, MRT_ColumnDef, MRT_FilterFn } from '.';
3
3
  export declare const getAllLeafColumnDefs: (columns: MRT_ColumnDef[]) => MRT_ColumnDef[];
4
4
  export declare const createGroup: <D extends Record<string, any> = {}>(table: Table<D>, column: MRT_ColumnDef<D>, currentFilterFns: {
5
- [key: string]: import("@tanstack/react-table").FilterFnOption<import("@tanstack/react-table").TableGenerics>;
5
+ [key: string]: import("@tanstack/table-core").FilterFnOption<import("@tanstack/table-core").TableGenerics>;
6
6
  }) => ColumnDef<D>;
7
7
  export declare const createDataColumn: <D extends Record<string, any> = {}>(table: Table<D>, column: MRT_ColumnDef<D>, currentFilterFns: {
8
- [key: string]: import("@tanstack/react-table").FilterFnOption<import("@tanstack/react-table").TableGenerics>;
8
+ [key: string]: import("@tanstack/table-core").FilterFnOption<import("@tanstack/table-core").TableGenerics>;
9
9
  }) => ColumnDef<D>;
10
- export declare const createDisplayColumn: <D extends Record<string, any> = {}>(table: Table<D>, column: Pick<MRT_ColumnDef<D>, "accessorFn" | "columns" | "filterFn" | "footer" | "sortingFn" | "id" | "accessorKey" | "meta" | "enableHiding" | "enablePinning" | "enableColumnFilter" | "enableGlobalFilter" | "sortDescFirst" | "enableSorting" | "enableMultiSort" | "invertSorting" | "sortUndefined" | "aggregationFn" | "enableGrouping" | "enableResizing" | "size" | "minSize" | "maxSize" | "AggregatedCell" | "Cell" | "Edit" | "Filter" | "Footer" | "Header" | "enableClickToCopy" | "enableColumnActions" | "enableColumnOrdering" | "enableEditing" | "enableColumnFilterChangeMode" | "enabledColumnFilterOptions" | "filterSelectOptions" | "muiTableBodyCellCopyButtonProps" | "muiTableBodyCellEditTextFieldProps" | "muiTableBodyCellProps" | "muiTableFooterCellProps" | "muiTableHeadCellColumnActionsButtonProps" | "muiTableHeadCellFilterTextFieldProps" | "muiTableHeadCellProps" | "onCellEditBlur" | "onCellEditChanged" | "onColumnFilterValueChanged" | "onColumnFilterValueChangedDebounced"> & {
10
+ export declare const createDisplayColumn: <D extends Record<string, any> = {}>(table: Table<D>, column: Pick<MRT_ColumnDef<D>, "accessorFn" | "columns" | "filterFn" | "footer" | "sortingFn" | "id" | "accessorKey" | "meta" | "enableHiding" | "enablePinning" | "enableColumnFilter" | "enableGlobalFilter" | "sortDescFirst" | "enableSorting" | "enableMultiSort" | "invertSorting" | "sortUndefined" | "aggregationFn" | "enableGrouping" | "enableResizing" | "size" | "minSize" | "maxSize" | "AggregatedCell" | "Cell" | "Edit" | "Filter" | "Footer" | "Header" | "enableClickToCopy" | "enableColumnActions" | "enableColumnFilterChangeMode" | "enableColumnOrdering" | "enableEditing" | "enabledColumnFilterOptions" | "filterSelectOptions" | "muiTableBodyCellCopyButtonProps" | "muiTableBodyCellEditTextFieldProps" | "muiTableBodyCellProps" | "muiTableFooterCellProps" | "muiTableHeadCellColumnActionsButtonProps" | "muiTableHeadCellFilterTextFieldProps" | "muiTableHeadCellProps" | "onCellEditBlur" | "onCellEditChanged" | "onColumnFilterValueChanged" | "onColumnFilterValueChangedDebounced"> & {
11
11
  header?: string | undefined;
12
12
  }) => ColumnDef<D>;
13
13
  export declare const reorderColumn: (movingColumn: MRT_Column, receivingColumn: MRT_Column, columnOrder: ColumnOrderState, setColumnOrder: (updater: Updater<ColumnOrderState>) => void) => void;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.15.1",
2
+ "version": "0.16.0",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI implementation of TanStack React Table, inspired by material-table and the MUI X DataGrid, written from the ground up in TypeScript.",
@@ -56,12 +56,12 @@
56
56
  }
57
57
  ],
58
58
  "devDependencies": {
59
- "@babel/core": "^7.18.5",
59
+ "@babel/core": "^7.18.6",
60
60
  "@emotion/react": "^11.9.3",
61
61
  "@emotion/styled": "^11.9.3",
62
62
  "@faker-js/faker": "^7.3.0",
63
63
  "@mui/icons-material": "^5.8.4",
64
- "@mui/material": "^5.8.5",
64
+ "@mui/material": "^5.8.6",
65
65
  "@size-limit/preset-small-lib": "^7.0.8",
66
66
  "@storybook/addon-a11y": "^6.5.9",
67
67
  "@storybook/addon-actions": "^6.5.9",
@@ -77,8 +77,8 @@
77
77
  "eslint-plugin-react-hooks": "^4.6.0",
78
78
  "husky": "^8.0.1",
79
79
  "prettier": "^2.7.1",
80
- "react": "^17.0.2",
81
- "react-dom": "^17.0.2",
80
+ "react": "^18.2.0",
81
+ "react-dom": "^18.2.0",
82
82
  "react-is": "^18.2.0",
83
83
  "rollup-plugin-commonjs": "^10.1.0",
84
84
  "rollup-plugin-node-resolve": "^5.2.0",
@@ -97,8 +97,8 @@
97
97
  "react": ">=16.8"
98
98
  },
99
99
  "dependencies": {
100
- "@tanstack/match-sorter-utils": "^8.0.0-alpha.83",
101
- "@tanstack/react-table": "^8.0.0-beta.9",
100
+ "@tanstack/match-sorter-utils": "8.0.13",
101
+ "@tanstack/react-table": "8.0.13",
102
102
  "react-dnd": "^16.0.1",
103
103
  "react-dnd-html5-backend": "^16.0.1",
104
104
  "react-virtual": "^2.10.4"
@@ -205,9 +205,9 @@ export type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<
205
205
  columns?: MRT_ColumnDef<D>[];
206
206
  enableClickToCopy?: boolean;
207
207
  enableColumnActions?: boolean;
208
+ enableColumnFilterChangeMode?: boolean;
208
209
  enableColumnOrdering?: boolean;
209
210
  enableEditing?: boolean;
210
- enableColumnFilterChangeMode?: boolean;
211
211
  enabledColumnFilterOptions?: (MRT_FILTER_OPTION | string)[] | null;
212
212
  filterFn?: MRT_FilterFn;
213
213
  filterSelectOptions?: (string | { text: string; value: string })[];
@@ -12,7 +12,7 @@ interface Props {
12
12
 
13
13
  export const MRT_TableBody: FC<Props> = ({ instance, tableContainerRef }) => {
14
14
  const {
15
- getPaginationRowModel,
15
+ getRowModel,
16
16
  getPrePaginationRowModel,
17
17
  getState,
18
18
  options: {
@@ -51,13 +51,13 @@ export const MRT_TableBody: FC<Props> = ({ instance, tableContainerRef }) => {
51
51
  }
52
52
 
53
53
  return enablePagination
54
- ? getPaginationRowModel().rows
54
+ ? getRowModel().rows
55
55
  : getPrePaginationRowModel().rows;
56
56
  }, [
57
57
  enableGlobalFilterRankedResults,
58
58
  (enableGlobalFilterRankedResults && globalFilter) || !enablePagination
59
59
  ? getPrePaginationRowModel().rows
60
- : getPaginationRowModel().rows,
60
+ : getRowModel().rows,
61
61
  globalFilter,
62
62
  ]);
63
63