material-react-table 1.2.4 → 1.2.6
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/README.md +1 -1
- package/dist/cjs/MaterialReactTable.d.ts +3 -2
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +5 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/table/MRT_TableRoot.d.ts +3 -2
- package/dist/esm/MaterialReactTable.d.ts +3 -2
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/material-react-table.esm.js +5 -8
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/table/MRT_TableRoot.d.ts +3 -2
- package/dist/index.d.ts +16 -5
- package/package.json +1 -1
- package/src/MaterialReactTable.tsx +4 -2
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +1 -0
- package/src/index.tsx +2 -0
- package/src/table/MRT_TableRoot.tsx +1 -4
|
@@ -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>>, "state" | "data" | "onStateChange" | "initialState" | "columns" | "defaultColumn" | "globalFilterFn" | "enableRowSelection" | "expandRowsFn"> & {
|
|
4
4
|
columnFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined;
|
|
5
5
|
columns: MRT_ColumnDef<TData>[];
|
|
6
6
|
data: TData[];
|
|
@@ -40,8 +40,9 @@ export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(pro
|
|
|
40
40
|
enableTableHead?: boolean | undefined;
|
|
41
41
|
enableToolbarInternalActions?: boolean | undefined;
|
|
42
42
|
enableTopToolbar?: boolean | undefined;
|
|
43
|
-
globalFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined;
|
|
44
43
|
expandRowsFn?: ((dataRow: TData) => TData[]) | undefined;
|
|
44
|
+
globalFilterFn?: MRT_FilterOption | undefined;
|
|
45
|
+
globalFilterModeOptions?: MRT_FilterOption[] | null | undefined;
|
|
45
46
|
icons?: Partial<import("..").MRT_Icons> | undefined;
|
|
46
47
|
initialState?: Partial<MRT_TableState<TData>> | undefined;
|
|
47
48
|
localization?: Partial<MRT_Localization> | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -509,7 +509,7 @@ declare type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-ro
|
|
|
509
509
|
* See the full props list on the official docs site:
|
|
510
510
|
* @link https://www.material-react-table.com/docs/api/props
|
|
511
511
|
*/
|
|
512
|
-
declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'initialState' | 'onStateChange' | 'state'> & {
|
|
512
|
+
declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'globalFilterFn' | 'initialState' | 'onStateChange' | 'state'> & {
|
|
513
513
|
columnFilterModeOptions?: (MRT_FilterOption | string)[] | null;
|
|
514
514
|
/**
|
|
515
515
|
* The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
|
|
@@ -567,8 +567,9 @@ declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = O
|
|
|
567
567
|
enableTableHead?: boolean;
|
|
568
568
|
enableToolbarInternalActions?: boolean;
|
|
569
569
|
enableTopToolbar?: boolean;
|
|
570
|
-
globalFilterModeOptions?: (MRT_FilterOption | string)[] | null;
|
|
571
570
|
expandRowsFn?: (dataRow: TData) => TData[];
|
|
571
|
+
globalFilterFn?: MRT_FilterOption;
|
|
572
|
+
globalFilterModeOptions?: MRT_FilterOption[] | null;
|
|
572
573
|
icons?: Partial<MRT_Icons>;
|
|
573
574
|
initialState?: Partial<MRT_TableState<TData>>;
|
|
574
575
|
/**
|
|
@@ -799,12 +800,22 @@ declare type Virtualizer = {
|
|
|
799
800
|
};
|
|
800
801
|
declare const MaterialReactTable: <TData extends Record<string, any> = {}>({ aggregationFns, autoResetExpanded, columnResizeMode, defaultColumn, defaultDisplayColumn, editingMode, enableBottomToolbar, enableColumnActions, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGlobalFilterRankedResults, enableGrouping, enableHiding, enableMultiRowSelection, enableMultiSort, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarInternalActions, enableTopToolbar, filterFns, icons, localization, positionActionsColumn, positionExpandColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, rowNumberMode, selectAllMode, sortingFns, ...rest }: MaterialReactTableProps<TData>) => JSX.Element;
|
|
801
802
|
|
|
802
|
-
interface Props$
|
|
803
|
+
interface Props$9<TData extends Record<string, any> = {}> {
|
|
803
804
|
cell: MRT_Cell<TData>;
|
|
804
805
|
children: ReactNode;
|
|
805
806
|
table: MRT_TableInstance<TData>;
|
|
806
807
|
}
|
|
807
|
-
declare const MRT_CopyButton: <TData extends Record<string, any> = {}>({ cell, children, table, }: Props$
|
|
808
|
+
declare const MRT_CopyButton: <TData extends Record<string, any> = {}>({ cell, children, table, }: Props$9<TData>) => JSX.Element;
|
|
809
|
+
|
|
810
|
+
interface Props$8<TData extends Record<string, any> = {}> {
|
|
811
|
+
anchorEl: HTMLElement | null;
|
|
812
|
+
header?: MRT_Header<TData>;
|
|
813
|
+
onSelect?: () => void;
|
|
814
|
+
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
815
|
+
setFilterValue?: (filterValue: any) => void;
|
|
816
|
+
table: MRT_TableInstance<TData>;
|
|
817
|
+
}
|
|
818
|
+
declare const MRT_FilterOptionMenu: <TData extends Record<string, any> = {}>({ anchorEl, header, onSelect, setAnchorEl, setFilterValue, table, }: Props$8<TData>) => JSX.Element;
|
|
808
819
|
|
|
809
820
|
interface Props$7<TData extends Record<string, any> = {}> extends IconButtonProps {
|
|
810
821
|
table: MRT_TableInstance<TData>;
|
|
@@ -847,4 +858,4 @@ interface Props<TData extends Record<string, any> = {}> {
|
|
|
847
858
|
}
|
|
848
859
|
declare const MRT_ToolbarInternalButtons: <TData extends Record<string, any> = {}>({ table, }: Props<TData>) => JSX.Element;
|
|
849
860
|
|
|
850
|
-
export { DensityState, MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_CopyButton, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterFn, MRT_FilterOption, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_Header, MRT_HeaderGroup, MRT_Icons, MRT_InternalFilterOption, MRT_Localization, MRT_Row, MRT_RowModel, MRT_ShowHideColumnsButton, MRT_SortingFn, MRT_SortingOption, MRT_TableInstance, MRT_TablePagination, MRT_TableState, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MRT_ToolbarInternalButtons, MaterialReactTableProps, Virtualizer, MaterialReactTable as default };
|
|
861
|
+
export { DensityState, MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_CopyButton, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterFn, MRT_FilterOption, MRT_FilterOptionMenu, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_Header, MRT_HeaderGroup, MRT_Icons, MRT_InternalFilterOption, MRT_Localization, MRT_Row, MRT_RowModel, MRT_ShowHideColumnsButton, MRT_SortingFn, MRT_SortingOption, MRT_TableInstance, MRT_TablePagination, MRT_TableState, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MRT_ToolbarInternalButtons, MaterialReactTableProps, Virtualizer, MaterialReactTable as default };
|
package/package.json
CHANGED
|
@@ -601,6 +601,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
601
601
|
| 'defaultColumn'
|
|
602
602
|
| 'enableRowSelection'
|
|
603
603
|
| 'expandRowsFn'
|
|
604
|
+
| 'globalFilterFn'
|
|
604
605
|
| 'initialState'
|
|
605
606
|
| 'onStateChange'
|
|
606
607
|
| 'state'
|
|
@@ -662,8 +663,9 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
662
663
|
enableTableHead?: boolean;
|
|
663
664
|
enableToolbarInternalActions?: boolean;
|
|
664
665
|
enableTopToolbar?: boolean;
|
|
665
|
-
globalFilterModeOptions?: (MRT_FilterOption | string)[] | null;
|
|
666
666
|
expandRowsFn?: (dataRow: TData) => TData[];
|
|
667
|
+
globalFilterFn?: MRT_FilterOption;
|
|
668
|
+
globalFilterModeOptions?: MRT_FilterOption[] | null;
|
|
667
669
|
icons?: Partial<MRT_Icons>;
|
|
668
670
|
initialState?: Partial<MRT_TableState<TData>>;
|
|
669
671
|
/**
|
|
@@ -1097,7 +1099,7 @@ const MaterialReactTable = <TData extends Record<string, any> = {}>({
|
|
|
1097
1099
|
...MRT_Localization_EN,
|
|
1098
1100
|
...localization,
|
|
1099
1101
|
}),
|
|
1100
|
-
[],
|
|
1102
|
+
[localization],
|
|
1101
1103
|
);
|
|
1102
1104
|
const _aggregationFns = useMemo(
|
|
1103
1105
|
() => ({ ...MRT_AggregationFns, ...aggregationFns }),
|
package/src/index.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import type { MRT_Icons } from './icons';
|
|
|
6
6
|
export type { MRT_Icons };
|
|
7
7
|
|
|
8
8
|
import { MRT_CopyButton } from './buttons/MRT_CopyButton';
|
|
9
|
+
import { MRT_FilterOptionMenu } from './menus/MRT_FilterOptionMenu';
|
|
9
10
|
import { MRT_FullScreenToggleButton } from './buttons/MRT_FullScreenToggleButton';
|
|
10
11
|
import { MRT_GlobalFilterTextField } from './inputs/MRT_GlobalFilterTextField';
|
|
11
12
|
import { MRT_ShowHideColumnsButton } from './buttons/MRT_ShowHideColumnsButton';
|
|
@@ -17,6 +18,7 @@ import { MRT_ToolbarInternalButtons } from './toolbar/MRT_ToolbarInternalButtons
|
|
|
17
18
|
|
|
18
19
|
export {
|
|
19
20
|
MRT_CopyButton,
|
|
21
|
+
MRT_FilterOptionMenu,
|
|
20
22
|
MRT_FullScreenToggleButton,
|
|
21
23
|
MRT_GlobalFilterTextField,
|
|
22
24
|
MRT_ShowHideColumnsButton,
|
|
@@ -55,10 +55,7 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
|
|
|
55
55
|
const initState = props.initialState ?? {};
|
|
56
56
|
initState.columnOrder =
|
|
57
57
|
initState.columnOrder ?? getDefaultColumnOrderIds(props);
|
|
58
|
-
initState.globalFilterFn =
|
|
59
|
-
props.globalFilterFn instanceof String
|
|
60
|
-
? (props.globalFilterFn as MRT_FilterOption)
|
|
61
|
-
: 'fuzzy';
|
|
58
|
+
initState.globalFilterFn = props.globalFilterFn ?? 'fuzzy';
|
|
62
59
|
return initState;
|
|
63
60
|
}, []);
|
|
64
61
|
|