material-react-table 0.5.3 → 0.5.4
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/dist/MaterialReactTable.d.ts +5 -0
- package/dist/filtersFNs.d.ts +67 -0
- package/dist/localization.d.ts +10 -1
- package/dist/material-react-table.cjs.development.js +367 -69
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +368 -70
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_FilterMenu.d.ts +10 -0
- package/dist/useMRT.d.ts +13 -9
- package/package.json +6 -2
- package/src/MaterialReactTable.tsx +15 -1
- package/src/buttons/MRT_EditActionButtons.tsx +3 -1
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +4 -3
- package/src/buttons/MRT_ToggleFiltersButton.tsx +3 -1
- package/src/buttons/MRT_ToggleSearchButton.tsx +5 -2
- package/src/filtersFNs.ts +112 -0
- package/src/head/MRT_TableHeadCell.tsx +45 -44
- package/src/index.tsx +0 -2
- package/src/inputs/MRT_FilterTextField.tsx +117 -52
- package/src/inputs/MRT_SearchTextField.tsx +2 -1
- package/src/inputs/MRT_SelectCheckbox.tsx +5 -7
- package/src/localization.ts +20 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +125 -85
- package/src/menus/MRT_FilterMenu.tsx +109 -0
- package/src/useMRT.tsx +67 -13
|
@@ -48,8 +48,12 @@ export declare type MRT_Row<D extends {} = {}> = Row<D> & UseExpandedRowProps<D>
|
|
|
48
48
|
cells: MRT_Cell<D>[];
|
|
49
49
|
};
|
|
50
50
|
export declare type MRT_Cell<D extends {} = {}, _V = any> = Cell<D> & UseGroupByCellProps<D> & UseRowStateCellProps<D> & {};
|
|
51
|
+
export declare type MRT_FilterType = 'contains' | 'empty' | 'endsWith' | 'equals' | 'fuzzy' | 'notEmpty' | 'notEquals' | 'startsWith';
|
|
51
52
|
export declare type MRT_TableState<D extends {} = {}> = TableState<D> & UseColumnOrderState<D> & UseExpandedState<D> & UseFiltersState<D> & UseGlobalFiltersState<D> & UseGroupByState<D> & UsePaginationState<D> & UseResizeColumnsState<D> & UseRowSelectState<D> & UseRowStateState<D> & UseSortByState<D> & {
|
|
52
53
|
currentEditingRow: MRT_Row<D> | null;
|
|
54
|
+
currentFilterTypes: {
|
|
55
|
+
[key: string]: MRT_FilterType;
|
|
56
|
+
};
|
|
53
57
|
densePadding: boolean;
|
|
54
58
|
fullScreen: boolean;
|
|
55
59
|
showFilters: boolean;
|
|
@@ -75,6 +79,7 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
|
|
|
75
79
|
hideToolbarInternalActions?: boolean;
|
|
76
80
|
hideToolbarTop?: boolean;
|
|
77
81
|
icons?: Partial<MRT_Icons>;
|
|
82
|
+
idPrefix?: string;
|
|
78
83
|
isFetching?: boolean;
|
|
79
84
|
isLoading?: boolean;
|
|
80
85
|
localization?: Partial<MRT_Localization>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { MRT_Row } from '.';
|
|
2
|
+
export declare const fuzzyFilterFN: {
|
|
3
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
4
|
+
autoRemove(val: any): boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const containsFilterFN: {
|
|
7
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
8
|
+
autoRemove(val: any): boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const startsWithFilterFN: {
|
|
11
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
12
|
+
autoRemove(val: any): boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const endsWithFilterFN: {
|
|
15
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
16
|
+
autoRemove(val: any): boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const equalsFilterFN: {
|
|
19
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
20
|
+
autoRemove(val: any): boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const notEqualsFilterFN: {
|
|
23
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
24
|
+
autoRemove(val: any): boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const emptyFilterFN: {
|
|
27
|
+
(rows: MRT_Row[], id: string, _filterValue: string | number): MRT_Row<{}>[];
|
|
28
|
+
autoRemove(val: any): boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const notEmptyFilterFN: {
|
|
31
|
+
(rows: MRT_Row[], id: string, _filterValue: string | number): MRT_Row<{}>[];
|
|
32
|
+
autoRemove(val: any): boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare const defaultFilterFNs: {
|
|
35
|
+
contains: {
|
|
36
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
37
|
+
autoRemove(val: any): boolean;
|
|
38
|
+
};
|
|
39
|
+
empty: {
|
|
40
|
+
(rows: MRT_Row[], id: string, _filterValue: string | number): MRT_Row<{}>[];
|
|
41
|
+
autoRemove(val: any): boolean;
|
|
42
|
+
};
|
|
43
|
+
endsWith: {
|
|
44
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
45
|
+
autoRemove(val: any): boolean;
|
|
46
|
+
};
|
|
47
|
+
equals: {
|
|
48
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
49
|
+
autoRemove(val: any): boolean;
|
|
50
|
+
};
|
|
51
|
+
fuzzy: {
|
|
52
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
53
|
+
autoRemove(val: any): boolean;
|
|
54
|
+
};
|
|
55
|
+
notEmpty: {
|
|
56
|
+
(rows: MRT_Row[], id: string, _filterValue: string | number): MRT_Row<{}>[];
|
|
57
|
+
autoRemove(val: any): boolean;
|
|
58
|
+
};
|
|
59
|
+
notEquals: {
|
|
60
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
61
|
+
autoRemove(val: any): boolean;
|
|
62
|
+
};
|
|
63
|
+
startsWith: {
|
|
64
|
+
(rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
|
|
65
|
+
autoRemove(val: any): boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
package/dist/localization.d.ts
CHANGED
|
@@ -11,6 +11,15 @@ export interface MRT_Localization {
|
|
|
11
11
|
columnShowHideMenuShowAll: string;
|
|
12
12
|
expandAllButtonTitle: string;
|
|
13
13
|
expandButtonTitle: string;
|
|
14
|
+
filterMenuItemContains: string;
|
|
15
|
+
filterMenuItemEmpty: string;
|
|
16
|
+
filterMenuItemEndsWith: string;
|
|
17
|
+
filterMenuItemEquals: string;
|
|
18
|
+
filterMenuItemFuzzy: string;
|
|
19
|
+
filterMenuItemNotEmpty: string;
|
|
20
|
+
filterMenuItemNotEquals: string;
|
|
21
|
+
filterMenuItemStartsWith: string;
|
|
22
|
+
filterMenuTitle: string;
|
|
14
23
|
filterTextFieldClearButtonTitle: string;
|
|
15
24
|
filterTextFieldPlaceholder: string;
|
|
16
25
|
rowActionButtonCancel: string;
|
|
@@ -27,8 +36,8 @@ export interface MRT_Localization {
|
|
|
27
36
|
toggleFilterButtonTitle: string;
|
|
28
37
|
toggleFullScreenButtonTitle: string;
|
|
29
38
|
toggleSearchButtonTitle: string;
|
|
30
|
-
toolbarAlertSelectionMessage: string;
|
|
31
39
|
toolbarAlertGroupedByMessage: string;
|
|
32
40
|
toolbarAlertGroupedThenByMessage: string;
|
|
41
|
+
toolbarAlertSelectionMessage: string;
|
|
33
42
|
}
|
|
34
43
|
export declare const MRT_DefaultLocalization_EN: MRT_Localization;
|