material-react-table 1.3.9 → 1.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -10
- package/dist/cjs/MaterialReactTable.d.ts +21 -21
- package/dist/cjs/_locales/cs.d.ts +1 -1
- package/dist/cjs/_locales/de.d.ts +1 -1
- package/dist/cjs/_locales/en.d.ts +1 -1
- package/dist/cjs/_locales/es.d.ts +1 -1
- package/dist/cjs/_locales/fa.d.ts +1 -1
- package/dist/cjs/_locales/fr.d.ts +2 -0
- package/dist/cjs/_locales/it.d.ts +1 -1
- package/dist/cjs/_locales/ja.d.ts +1 -1
- package/dist/cjs/_locales/pl.d.ts +1 -1
- package/dist/cjs/_locales/pt-BR.d.ts +1 -1
- package/dist/cjs/_locales/pt.d.ts +1 -1
- package/dist/cjs/_locales/ru.d.ts +1 -1
- package/dist/cjs/_locales/tr.d.ts +1 -1
- package/dist/cjs/_locales/vi.d.ts +2 -0
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/table/MRT_TableRoot.d.ts +1 -1
- package/dist/esm/MaterialReactTable.d.ts +21 -21
- package/dist/esm/_locales/cs.d.ts +1 -1
- package/dist/esm/_locales/de.d.ts +1 -1
- package/dist/esm/_locales/en.d.ts +1 -1
- package/dist/esm/_locales/es.d.ts +1 -1
- package/dist/esm/_locales/fa.d.ts +1 -1
- package/dist/esm/_locales/fr.d.ts +2 -0
- package/dist/esm/_locales/it.d.ts +1 -1
- package/dist/esm/_locales/ja.d.ts +1 -1
- package/dist/esm/_locales/pl.d.ts +1 -1
- package/dist/esm/_locales/pt-BR.d.ts +1 -1
- package/dist/esm/_locales/pt.d.ts +1 -1
- package/dist/esm/_locales/ru.d.ts +1 -1
- package/dist/esm/_locales/tr.d.ts +1 -1
- package/dist/esm/_locales/vi.d.ts +2 -0
- package/dist/esm/material-react-table.esm.js +3 -3
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/table/MRT_TableRoot.d.ts +1 -1
- package/dist/index.d.ts +21 -21
- package/locales/cs.d.ts +1 -1
- package/locales/cs.esm.d.ts +1 -1
- package/locales/de.d.ts +1 -1
- package/locales/de.esm.d.ts +1 -1
- package/locales/en.d.ts +1 -1
- package/locales/en.esm.d.ts +1 -1
- package/locales/es.d.ts +1 -1
- package/locales/es.esm.d.ts +1 -1
- package/locales/fa.d.ts +1 -1
- package/locales/fa.esm.d.ts +1 -1
- package/locales/fr.d.ts +2 -0
- package/locales/fr.esm.d.ts +2 -0
- package/locales/fr.esm.js +92 -0
- package/locales/fr.esm.js.map +1 -0
- package/locales/fr.js +96 -0
- package/locales/fr.js.map +1 -0
- package/locales/it.d.ts +1 -1
- package/locales/it.esm.d.ts +1 -1
- package/locales/ja.d.ts +1 -1
- package/locales/ja.esm.d.ts +1 -1
- package/locales/pl.d.ts +1 -1
- package/locales/pl.esm.d.ts +1 -1
- package/locales/pt-BR.d.ts +1 -1
- package/locales/pt-BR.esm.d.ts +1 -1
- package/locales/pt.d.ts +1 -1
- package/locales/pt.esm.d.ts +1 -1
- package/locales/ru.d.ts +1 -1
- package/locales/ru.esm.d.ts +1 -1
- package/locales/tr.d.ts +1 -1
- package/locales/tr.esm.d.ts +1 -1
- package/locales/tr.esm.js +86 -86
- package/locales/tr.js +86 -86
- package/locales/vi.d.ts +2 -0
- package/locales/vi.esm.d.ts +2 -0
- package/locales/vi.esm.js +92 -0
- package/locales/vi.esm.js.map +1 -0
- package/locales/vi.js +96 -0
- package/locales/vi.js.map +1 -0
- package/package.json +29 -22
- package/src/_locales/cs.ts +1 -1
- package/src/_locales/de.ts +1 -1
- package/src/_locales/en.ts +1 -1
- package/src/_locales/es.ts +1 -1
- package/src/_locales/fa.ts +1 -1
- package/src/_locales/fr.ts +92 -1
- package/src/_locales/it.ts +1 -1
- package/src/_locales/ja.ts +1 -1
- package/src/_locales/pl.ts +1 -1
- package/src/_locales/pt-BR.ts +1 -1
- package/src/_locales/pt.ts +1 -1
- package/src/_locales/ru.ts +1 -1
- package/src/_locales/tr.ts +87 -87
- package/src/_locales/vi.ts +92 -1
- package/src/body/MRT_TableBody.tsx +1 -1
@@ -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?: "
|
16
|
+
editingMode?: "row" | "cell" | "table" | "modal" | undefined;
|
17
17
|
enableBottomToolbar?: boolean | undefined;
|
18
18
|
enableClickToCopy?: boolean | undefined;
|
19
19
|
enableColumnActions?: boolean | undefined;
|
@@ -27,8 +27,8 @@ import { MRT_SortingFns } from './sortingFns';
|
|
27
27
|
/**
|
28
28
|
* Most of this file is just TypeScript types
|
29
29
|
*/
|
30
|
-
export
|
31
|
-
|
30
|
+
export type DensityState = 'comfortable' | 'compact' | 'spacious';
|
31
|
+
type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
32
32
|
export interface MRT_Localization {
|
33
33
|
actions: string;
|
34
34
|
and: string;
|
@@ -125,7 +125,7 @@ export interface MRT_RowModel<TData extends Record<string, any> = {}> {
|
|
125
125
|
[key: string]: MRT_Row<TData>;
|
126
126
|
};
|
127
127
|
}
|
128
|
-
export
|
128
|
+
export type MRT_TableInstance<TData extends Record<string, any> = {}> = Omit<Table<TData>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getCenterLeafColumns' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
129
129
|
getAllColumns: () => MRT_Column<TData>[];
|
130
130
|
getAllFlatColumns: () => MRT_Column<TData>[];
|
131
131
|
getAllLeafColumns: () => MRT_Column<TData>[];
|
@@ -175,7 +175,7 @@ export declare type MRT_TableInstance<TData extends Record<string, any> = {}> =
|
|
175
175
|
setShowFilters: Dispatch<SetStateAction<boolean>>;
|
176
176
|
setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
|
177
177
|
};
|
178
|
-
export
|
178
|
+
export type MRT_TableState<TData extends Record<string, any> = {}> = TableState & {
|
179
179
|
columnFilterFns: Record<string, MRT_FilterOption>;
|
180
180
|
density: DensityState;
|
181
181
|
draggingColumn: MRT_Column<TData> | null;
|
@@ -197,7 +197,7 @@ export declare type MRT_TableState<TData extends Record<string, any> = {}> = Tab
|
|
197
197
|
showProgressBars: boolean;
|
198
198
|
showSkeletons: boolean;
|
199
199
|
};
|
200
|
-
export
|
200
|
+
export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnDef<TData, unknown>, 'accessorKey' | 'aggregatedCell' | 'aggregationFn' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
|
201
201
|
AggregatedCell?: ({ cell, column, row, table, }: {
|
202
202
|
cell: MRT_Cell<TData>;
|
203
203
|
column: MRT_Column<TData>;
|
@@ -352,47 +352,47 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
352
352
|
}) => ReactNode[];
|
353
353
|
sortingFn?: MRT_SortingFn<TData>;
|
354
354
|
};
|
355
|
-
export
|
355
|
+
export type MRT_DefinedColumnDef<TData extends Record<string, any> = {}> = Omit<MRT_ColumnDef<TData>, 'id' | 'defaultDisplayColumn'> & {
|
356
356
|
defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
|
357
357
|
id: string;
|
358
358
|
_filterFn: MRT_FilterOption;
|
359
359
|
};
|
360
|
-
export
|
360
|
+
export type MRT_Column<TData extends Record<string, any> = {}> = Omit<Column<TData, unknown>, 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'> & {
|
361
361
|
columnDef: MRT_DefinedColumnDef<TData>;
|
362
362
|
columns?: MRT_Column<TData>[];
|
363
363
|
filterFn?: MRT_FilterFn<TData>;
|
364
364
|
footer: string;
|
365
365
|
header: string;
|
366
366
|
};
|
367
|
-
export
|
367
|
+
export type MRT_Header<TData extends Record<string, any> = {}> = Omit<Header<TData, unknown>, 'column'> & {
|
368
368
|
column: MRT_Column<TData>;
|
369
369
|
};
|
370
|
-
export
|
370
|
+
export type MRT_HeaderGroup<TData extends Record<string, any> = {}> = Omit<HeaderGroup<TData>, 'headers'> & {
|
371
371
|
headers: MRT_Header<TData>[];
|
372
372
|
};
|
373
|
-
export
|
373
|
+
export type MRT_Row<TData extends Record<string, any> = {}> = Omit<Row<TData>, 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'> & {
|
374
374
|
getAllCells: () => MRT_Cell<TData>[];
|
375
375
|
getVisibleCells: () => MRT_Cell<TData>[];
|
376
376
|
subRows?: MRT_Row<TData>[];
|
377
377
|
_valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
|
378
378
|
};
|
379
|
-
export
|
379
|
+
export type MRT_Cell<TData extends Record<string, any> = {}> = Omit<Cell<TData, unknown>, 'column' | 'row'> & {
|
380
380
|
column: MRT_Column<TData>;
|
381
381
|
row: MRT_Row<TData>;
|
382
382
|
};
|
383
|
-
export
|
384
|
-
export
|
385
|
-
export
|
386
|
-
export
|
387
|
-
export
|
388
|
-
export
|
389
|
-
export
|
383
|
+
export type MRT_AggregationOption = string & keyof typeof MRT_AggregationFns;
|
384
|
+
export type MRT_AggregationFn<TData extends Record<string, any> = {}> = AggregationFn<TData> | MRT_AggregationOption;
|
385
|
+
export type MRT_SortingOption = LiteralUnion<string & keyof typeof MRT_SortingFns>;
|
386
|
+
export type MRT_SortingFn<TData extends Record<string, any> = {}> = SortingFn<TData> | MRT_SortingOption;
|
387
|
+
export type MRT_FilterOption = LiteralUnion<string & keyof typeof MRT_FilterFns>;
|
388
|
+
export type MRT_FilterFn<TData extends Record<string, any> = {}> = FilterFn<TData> | MRT_FilterOption;
|
389
|
+
export type MRT_InternalFilterOption = {
|
390
390
|
option: string;
|
391
391
|
symbol: string;
|
392
392
|
label: string;
|
393
393
|
divider: boolean;
|
394
394
|
};
|
395
|
-
export
|
395
|
+
export type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-row-expand' | 'mrt-row-numbers' | 'mrt-row-select';
|
396
396
|
/**
|
397
397
|
* `columns` and `data` props are the only required props, but there are over 150 other optional props.
|
398
398
|
*
|
@@ -402,7 +402,7 @@ export declare type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' |
|
|
402
402
|
* See the full props list on the official docs site:
|
403
403
|
* @link https://www.material-react-table.com/docs/api/props
|
404
404
|
*/
|
405
|
-
export
|
405
|
+
export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'getRowId' | 'globalFilterFn' | 'initialState' | 'onStateChange' | 'state'> & {
|
406
406
|
columnFilterModeOptions?: (MRT_FilterOption | string)[] | null;
|
407
407
|
/**
|
408
408
|
* The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
|
@@ -685,7 +685,7 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
|
|
685
685
|
}) => Partial<VirtualizerOptions<HTMLDivElement>>);
|
686
686
|
virtualizerInstanceRef?: MutableRefObject<Virtualizer | null>;
|
687
687
|
};
|
688
|
-
export
|
688
|
+
export type Virtualizer = {
|
689
689
|
virtualItems: VirtualItem[];
|
690
690
|
totalSize: number;
|
691
691
|
scrollToOffset: (index: number, options?: any | undefined) => void;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_CS: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_DE: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_EN: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '..';
|
1
|
+
import type { MRT_Localization } from '..';
|
2
2
|
export declare const MRT_Localization_ES: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_FA: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_IT: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_JA: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_PL: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_PT_BR: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_PT: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from '../MaterialReactTable';
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_RU: MRT_Localization;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { MRT_Localization } from
|
1
|
+
import type { MRT_Localization } from '../MaterialReactTable';
|
2
2
|
export declare const MRT_Localization_TR: MRT_Localization;
|
@@ -2304,7 +2304,7 @@ const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|
|
2304
2304
|
const Memo_MRT_TableBodyRow = memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row);
|
2305
2305
|
|
2306
2306
|
const MRT_TableBody = ({ table }) => {
|
2307
|
-
var _a;
|
2307
|
+
var _a, _b;
|
2308
2308
|
const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization, localization, manualFiltering, manualSorting, memoMode, muiTableBodyProps, virtualizerInstanceRef, virtualizerProps, }, refs: { tableContainerRef, tablePaperRef }, } = table;
|
2309
2309
|
const { columnFilters, globalFilter, pagination, sorting } = getState();
|
2310
2310
|
const tableBodyProps = muiTableBodyProps instanceof Function
|
@@ -2371,12 +2371,12 @@ const MRT_TableBody = ({ table }) => {
|
|
2371
2371
|
// ? virtualizer.getTotalSize() - virtualRows[virtualRows.length - 1].end
|
2372
2372
|
// : 0;
|
2373
2373
|
// }
|
2374
|
-
return (React.createElement(TableBody, Object.assign({}, tableBodyProps), !rows.length ? (React.createElement("tr", null,
|
2374
|
+
return (React.createElement(TableBody, Object.assign({}, tableBodyProps), ((_a = tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.children) !== null && _a !== void 0 ? _a : !rows.length) ? (React.createElement("tr", null,
|
2375
2375
|
React.createElement("td", { colSpan: table.getVisibleLeafColumns().length },
|
2376
2376
|
React.createElement(Typography, { sx: {
|
2377
2377
|
color: 'text.secondary',
|
2378
2378
|
fontStyle: 'italic',
|
2379
|
-
maxWidth: `min(100vw, ${(
|
2379
|
+
maxWidth: `min(100vw, ${(_b = tablePaperRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth}px)`,
|
2380
2380
|
py: '2rem',
|
2381
2381
|
textAlign: 'center',
|
2382
2382
|
width: '100%',
|