material-react-table 1.0.0-beta.8 → 1.0.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.
- package/README.md +2 -2
- package/dist/cjs/MaterialReactTable.d.ts +112 -7
- package/dist/cjs/_locales/en.d.ts +2 -0
- package/dist/cjs/_locales/pt-BR.d.ts +2 -0
- package/dist/cjs/column.utils.d.ts +6 -0
- package/dist/cjs/head/MRT_TableHeadCellSortLabel.d.ts +2 -0
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +200 -71
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/inputs/MRT_FilterCheckbox.d.ts +8 -0
- package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +3 -3
- package/dist/cjs/table/MRT_TableRoot.d.ts +254 -2
- package/dist/cjs/toolbar/MRT_TablePagination.d.ts +3 -4
- package/dist/cjs/toolbar/MRT_ToolbarInternalButtons.d.ts +3 -4
- package/dist/cjs/toolbar/MRT_TopToolbar.d.ts +1 -0
- package/dist/esm/MaterialReactTable.d.ts +112 -7
- package/dist/esm/_locales/en.d.ts +2 -0
- package/dist/esm/_locales/pt-BR.d.ts +2 -0
- package/dist/esm/column.utils.d.ts +6 -0
- package/dist/esm/head/MRT_TableHeadCellSortLabel.d.ts +2 -0
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/inputs/MRT_FilterCheckbox.d.ts +8 -0
- package/dist/esm/material-react-table.esm.js +200 -73
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +3 -3
- package/dist/esm/table/MRT_TableRoot.d.ts +254 -2
- package/dist/esm/toolbar/MRT_TablePagination.d.ts +3 -4
- package/dist/esm/toolbar/MRT_ToolbarInternalButtons.d.ts +3 -4
- package/dist/esm/toolbar/MRT_TopToolbar.d.ts +1 -0
- package/dist/index.d.ts +61 -28
- package/locales/en.d.ts +2 -0
- package/locales/en.esm.d.ts +2 -0
- package/locales/en.esm.js +92 -0
- package/locales/en.esm.js.map +1 -0
- package/locales/en.js +96 -0
- package/locales/en.js.map +1 -0
- package/locales/pt-BR.d.ts +2 -0
- package/locales/pt-BR.esm.d.ts +2 -0
- package/locales/pt-BR.esm.js +92 -0
- package/locales/pt-BR.esm.js.map +1 -0
- package/locales/pt-BR.js +96 -0
- package/locales/pt-BR.js.map +1 -0
- package/package.json +13 -11
- package/src/MaterialReactTable.tsx +205 -67
- package/src/_locales/de.ts +1 -0
- package/src/{localization.ts → _locales/en.ts} +8 -84
- package/src/_locales/es.ts +1 -0
- package/src/_locales/fr.ts +1 -0
- package/src/_locales/hi.ts +1 -0
- package/src/_locales/id.ts +1 -0
- package/src/_locales/ja.ts +1 -0
- package/src/_locales/nl.ts +1 -0
- package/src/_locales/pt-BR.ts +92 -0
- package/src/_locales/pt.ts +1 -0
- package/src/_locales/ru.ts +1 -0
- package/src/_locales/uk.ts +1 -0
- package/src/_locales/vi.ts +1 -0
- package/src/_locales/zh.ts +1 -0
- package/src/body/MRT_EditRowModal.tsx +3 -2
- package/src/body/MRT_TableBodyCell.tsx +1 -1
- package/src/body/MRT_TableBodyRow.tsx +1 -1
- package/src/body/MRT_TableDetailPanel.tsx +1 -1
- package/src/buttons/MRT_ExpandAllButton.tsx +1 -1
- package/src/buttons/MRT_ExpandButton.tsx +1 -1
- package/src/buttons/MRT_GrabHandleButton.tsx +1 -1
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +7 -2
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +1 -1
- package/src/column.utils.ts +28 -3
- package/src/footer/MRT_TableFooter.tsx +1 -1
- package/src/head/MRT_TableHead.tsx +10 -2
- package/src/head/MRT_TableHeadCell.tsx +10 -2
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +1 -1
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +7 -3
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +5 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +1 -1
- package/src/head/MRT_TableHeadCellSortLabel.tsx +11 -3
- package/src/index.tsx +6 -3
- package/src/inputs/MRT_FilterCheckbox.tsx +96 -0
- package/src/inputs/MRT_FilterTextField.tsx +19 -13
- package/src/inputs/MRT_GlobalFilterTextField.tsx +18 -5
- package/src/inputs/MRT_SelectCheckbox.tsx +16 -7
- package/src/menus/MRT_FilterOptionMenu.tsx +19 -2
- package/src/table/MRT_TablePaper.tsx +16 -4
- package/src/table/MRT_TableRoot.tsx +8 -7
- package/src/toolbar/MRT_BottomToolbar.tsx +4 -1
- package/src/toolbar/MRT_TablePagination.tsx +45 -8
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +2 -1
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -4
- package/src/toolbar/MRT_TopToolbar.tsx +2 -1
- package/dist/cjs/localization.d.ts +0 -84
- package/dist/esm/localization.d.ts +0 -84
|
@@ -3,6 +3,7 @@ import React, {
|
|
|
3
3
|
MutableRefObject,
|
|
4
4
|
ReactNode,
|
|
5
5
|
SetStateAction,
|
|
6
|
+
useMemo,
|
|
6
7
|
} from 'react';
|
|
7
8
|
import type {
|
|
8
9
|
AlertProps,
|
|
@@ -44,12 +45,103 @@ import type { Options as VirtualizerOptions, VirtualItem } from 'react-virtual';
|
|
|
44
45
|
import { MRT_AggregationFns } from './aggregationFns';
|
|
45
46
|
import { MRT_Default_Icons, MRT_Icons } from './icons';
|
|
46
47
|
import { MRT_FilterFns } from './filterFns';
|
|
47
|
-
import {
|
|
48
|
+
import { MRT_Localization_EN } from './_locales/en';
|
|
48
49
|
import { MRT_SortingFns } from './sortingFns';
|
|
49
50
|
import { MRT_TableRoot } from './table/MRT_TableRoot';
|
|
51
|
+
import { MRT_DefaultColumn, MRT_DefaultDisplayColumn } from './column.utils';
|
|
50
52
|
|
|
51
53
|
type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
|
52
54
|
|
|
55
|
+
export interface MRT_Localization {
|
|
56
|
+
actions: string;
|
|
57
|
+
and: string;
|
|
58
|
+
cancel: string;
|
|
59
|
+
changeFilterMode: string;
|
|
60
|
+
changeSearchMode: string;
|
|
61
|
+
clearFilter: string;
|
|
62
|
+
clearSearch: string;
|
|
63
|
+
clearSort: string;
|
|
64
|
+
clickToCopy: string;
|
|
65
|
+
columnActions: string;
|
|
66
|
+
copiedToClipboard: string;
|
|
67
|
+
dropToGroupBy: string;
|
|
68
|
+
edit: string;
|
|
69
|
+
expand: string;
|
|
70
|
+
expandAll: string;
|
|
71
|
+
filterArrIncludes: string;
|
|
72
|
+
filterArrIncludesAll: string;
|
|
73
|
+
filterArrIncludesSome: string;
|
|
74
|
+
filterBetween: string;
|
|
75
|
+
filterBetweenInclusive: string;
|
|
76
|
+
filterByColumn: string;
|
|
77
|
+
filterContains: string;
|
|
78
|
+
filterEmpty: string;
|
|
79
|
+
filterEndsWith: string;
|
|
80
|
+
filterEquals: string;
|
|
81
|
+
filterEqualsString: string;
|
|
82
|
+
filterFuzzy: string;
|
|
83
|
+
filterGreaterThan: string;
|
|
84
|
+
filterGreaterThanOrEqualTo: string;
|
|
85
|
+
filterInNumberRange: string;
|
|
86
|
+
filterIncludesString: string;
|
|
87
|
+
filterIncludesStringSensitive: string;
|
|
88
|
+
filterLessThan: string;
|
|
89
|
+
filterLessThanOrEqualTo: string;
|
|
90
|
+
filterMode: string;
|
|
91
|
+
filterNotEmpty: string;
|
|
92
|
+
filterNotEquals: string;
|
|
93
|
+
filterStartsWith: string;
|
|
94
|
+
filterWeakEquals: string;
|
|
95
|
+
filteringByColumn: string;
|
|
96
|
+
goToFirstPage: string;
|
|
97
|
+
goToLastPage: string;
|
|
98
|
+
goToNextPage: string;
|
|
99
|
+
goToPreviousPage: string;
|
|
100
|
+
grab: string;
|
|
101
|
+
groupByColumn: string;
|
|
102
|
+
groupedBy: string;
|
|
103
|
+
hideAll: string;
|
|
104
|
+
hideColumn: string;
|
|
105
|
+
max: string;
|
|
106
|
+
min: string;
|
|
107
|
+
move: string;
|
|
108
|
+
noRecordsToDisplay: string;
|
|
109
|
+
noResultsFound: string;
|
|
110
|
+
of: string;
|
|
111
|
+
or: string;
|
|
112
|
+
pinToLeft: string;
|
|
113
|
+
pinToRight: string;
|
|
114
|
+
resetColumnSize: string;
|
|
115
|
+
resetOrder: string;
|
|
116
|
+
rowActions: string;
|
|
117
|
+
rowNumber: string;
|
|
118
|
+
rowNumbers: string;
|
|
119
|
+
rowsPerPage: string;
|
|
120
|
+
save: string;
|
|
121
|
+
search: string;
|
|
122
|
+
select: string;
|
|
123
|
+
selectedCountOfRowCountRowsSelected: string;
|
|
124
|
+
showAll: string;
|
|
125
|
+
showAllColumns: string;
|
|
126
|
+
showHideColumns: string;
|
|
127
|
+
showHideFilters: string;
|
|
128
|
+
showHideSearch: string;
|
|
129
|
+
sortByColumnAsc: string;
|
|
130
|
+
sortByColumnDesc: string;
|
|
131
|
+
sortedByColumnAsc: string;
|
|
132
|
+
sortedByColumnDesc: string;
|
|
133
|
+
thenBy: string;
|
|
134
|
+
toggleDensity: string;
|
|
135
|
+
toggleFullScreen: string;
|
|
136
|
+
toggleSelectAll: string;
|
|
137
|
+
toggleSelectRow: string;
|
|
138
|
+
toggleVisibility: string;
|
|
139
|
+
ungroupByColumn: string;
|
|
140
|
+
unpin: string;
|
|
141
|
+
unpinAll: string;
|
|
142
|
+
unsorted: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
53
145
|
export interface MRT_RowModel<TData extends Record<string, any> = {}> {
|
|
54
146
|
flatRows: MRT_Row<TData>[];
|
|
55
147
|
rows: MRT_Row<TData>[];
|
|
@@ -191,10 +283,12 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<
|
|
|
191
283
|
Filter?: ({
|
|
192
284
|
column,
|
|
193
285
|
header,
|
|
286
|
+
rangeFilterIndex,
|
|
194
287
|
table,
|
|
195
288
|
}: {
|
|
196
289
|
column: MRT_Column<TData>;
|
|
197
290
|
header: MRT_Header<TData>;
|
|
291
|
+
rangeFilterIndex?: number;
|
|
198
292
|
table: MRT_TableInstance<TData>;
|
|
199
293
|
}) => ReactNode;
|
|
200
294
|
Footer?:
|
|
@@ -265,7 +359,7 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<
|
|
|
265
359
|
enableEditing?: boolean;
|
|
266
360
|
filterFn?: MRT_FilterFn<TData>;
|
|
267
361
|
filterSelectOptions?: (string | { text: string; value: any })[];
|
|
268
|
-
filterVariant?: 'text' | 'select' | 'multi-select' | 'range';
|
|
362
|
+
filterVariant?: 'text' | 'select' | 'multi-select' | 'range' | 'checkbox';
|
|
269
363
|
/**
|
|
270
364
|
* footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
|
|
271
365
|
*/
|
|
@@ -314,10 +408,14 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<
|
|
|
314
408
|
| TableCellProps
|
|
315
409
|
| (({
|
|
316
410
|
cell,
|
|
411
|
+
column,
|
|
412
|
+
row,
|
|
317
413
|
table,
|
|
318
414
|
}: {
|
|
319
|
-
table: MRT_TableInstance<TData>;
|
|
320
415
|
cell: MRT_Cell<TData>;
|
|
416
|
+
column: MRT_Column<TData>;
|
|
417
|
+
row: MRT_Row<TData>;
|
|
418
|
+
table: MRT_TableInstance<TData>;
|
|
321
419
|
}) => TableCellProps);
|
|
322
420
|
muiTableFooterCellProps?:
|
|
323
421
|
| TableCellProps
|
|
@@ -346,6 +444,15 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<
|
|
|
346
444
|
table: MRT_TableInstance<TData>;
|
|
347
445
|
column: MRT_Column<TData>;
|
|
348
446
|
}) => IconButtonProps);
|
|
447
|
+
muiTableHeadCellFilterCheckboxProps?:
|
|
448
|
+
| CheckboxProps
|
|
449
|
+
| (({
|
|
450
|
+
column,
|
|
451
|
+
table,
|
|
452
|
+
}: {
|
|
453
|
+
column: MRT_Column<TData>;
|
|
454
|
+
table: MRT_TableInstance<TData>;
|
|
455
|
+
}) => CheckboxProps);
|
|
349
456
|
muiTableHeadCellFilterTextFieldProps?:
|
|
350
457
|
| TextFieldProps
|
|
351
458
|
| (({
|
|
@@ -699,6 +806,15 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
699
806
|
table: MRT_TableInstance<TData>;
|
|
700
807
|
column: MRT_Column<TData>;
|
|
701
808
|
}) => IconButtonProps);
|
|
809
|
+
muiTableHeadCellFilterCheckboxProps?:
|
|
810
|
+
| CheckboxProps
|
|
811
|
+
| (({
|
|
812
|
+
column,
|
|
813
|
+
table,
|
|
814
|
+
}: {
|
|
815
|
+
column: MRT_Column<TData>;
|
|
816
|
+
table: MRT_TableInstance<TData>;
|
|
817
|
+
}) => CheckboxProps);
|
|
702
818
|
muiTableHeadCellFilterTextFieldProps?:
|
|
703
819
|
| TextFieldProps
|
|
704
820
|
| (({
|
|
@@ -783,6 +899,9 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
783
899
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
784
900
|
positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
|
|
785
901
|
positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
|
|
902
|
+
renderBottomToolbar?:
|
|
903
|
+
| ReactNode
|
|
904
|
+
| (({ table }: { table: MRT_TableInstance<TData> }) => ReactNode);
|
|
786
905
|
renderBottomToolbarCustomActions?: ({
|
|
787
906
|
table,
|
|
788
907
|
}: {
|
|
@@ -847,6 +966,9 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
847
966
|
}: {
|
|
848
967
|
table: MRT_TableInstance<TData>;
|
|
849
968
|
}) => ReactNode;
|
|
969
|
+
renderTopToolbar?:
|
|
970
|
+
| ReactNode
|
|
971
|
+
| (({ table }: { table: MRT_TableInstance<TData> }) => ReactNode);
|
|
850
972
|
renderTopToolbarCustomActions?: ({
|
|
851
973
|
table,
|
|
852
974
|
}: {
|
|
@@ -882,11 +1004,11 @@ export type Virtualizer = {
|
|
|
882
1004
|
measure: () => void;
|
|
883
1005
|
};
|
|
884
1006
|
|
|
885
|
-
|
|
1007
|
+
const MaterialReactTable = <TData extends Record<string, any> = {}>({
|
|
886
1008
|
aggregationFns,
|
|
887
1009
|
autoResetExpanded = false,
|
|
888
1010
|
columnResizeMode = 'onEnd',
|
|
889
|
-
defaultColumn
|
|
1011
|
+
defaultColumn,
|
|
890
1012
|
defaultDisplayColumn,
|
|
891
1013
|
editingMode = 'modal',
|
|
892
1014
|
enableBottomToolbar = true,
|
|
@@ -924,68 +1046,84 @@ export default <TData extends Record<string, any> = {}>({
|
|
|
924
1046
|
positionToolbarAlertBanner = 'top',
|
|
925
1047
|
positionToolbarDropZone = 'top',
|
|
926
1048
|
rowNumberMode = 'original',
|
|
927
|
-
selectAllMode = '
|
|
1049
|
+
selectAllMode = 'page',
|
|
928
1050
|
sortingFns,
|
|
929
1051
|
...rest
|
|
930
|
-
}: MaterialReactTableProps<TData>) =>
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1052
|
+
}: MaterialReactTableProps<TData>) => {
|
|
1053
|
+
const _icons = useMemo(() => ({ ...MRT_Default_Icons, ...icons }), []);
|
|
1054
|
+
const _localization = useMemo(
|
|
1055
|
+
() => ({
|
|
1056
|
+
...MRT_Localization_EN,
|
|
1057
|
+
...localization,
|
|
1058
|
+
}),
|
|
1059
|
+
[],
|
|
1060
|
+
);
|
|
1061
|
+
const _aggregationFns = useMemo(
|
|
1062
|
+
() => ({ ...MRT_AggregationFns, ...aggregationFns }),
|
|
1063
|
+
[],
|
|
1064
|
+
);
|
|
1065
|
+
const _filterFns = useMemo(() => ({ ...MRT_FilterFns, ...filterFns }), []);
|
|
1066
|
+
const _sortingFns = useMemo(() => ({ ...MRT_SortingFns, ...sortingFns }), []);
|
|
1067
|
+
const _defaultColumn = useMemo<Partial<MRT_ColumnDef<TData>>>(
|
|
1068
|
+
() => ({ ...MRT_DefaultColumn, ...defaultColumn }),
|
|
1069
|
+
[],
|
|
1070
|
+
);
|
|
1071
|
+
const _defaultDisplayColumn = useMemo<Partial<MRT_ColumnDef<TData>>>(
|
|
1072
|
+
() => ({
|
|
1073
|
+
...(MRT_DefaultDisplayColumn as Partial<MRT_ColumnDef<TData>>),
|
|
949
1074
|
...defaultDisplayColumn,
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1075
|
+
}),
|
|
1076
|
+
[],
|
|
1077
|
+
);
|
|
1078
|
+
|
|
1079
|
+
return (
|
|
1080
|
+
<MRT_TableRoot
|
|
1081
|
+
aggregationFns={_aggregationFns}
|
|
1082
|
+
autoResetExpanded={autoResetExpanded}
|
|
1083
|
+
columnResizeMode={columnResizeMode}
|
|
1084
|
+
defaultColumn={_defaultColumn}
|
|
1085
|
+
defaultDisplayColumn={_defaultDisplayColumn}
|
|
1086
|
+
editingMode={editingMode}
|
|
1087
|
+
enableBottomToolbar={enableBottomToolbar}
|
|
1088
|
+
enableColumnActions={enableColumnActions}
|
|
1089
|
+
enableColumnFilters={enableColumnFilters}
|
|
1090
|
+
enableColumnOrdering={enableColumnOrdering}
|
|
1091
|
+
enableColumnResizing={enableColumnResizing}
|
|
1092
|
+
enableDensityToggle={enableDensityToggle}
|
|
1093
|
+
enableExpandAll={enableExpandAll}
|
|
1094
|
+
enableFilters={enableFilters}
|
|
1095
|
+
enableFullScreenToggle={enableFullScreenToggle}
|
|
1096
|
+
enableGlobalFilter={enableGlobalFilter}
|
|
1097
|
+
enableGlobalFilterRankedResults={enableGlobalFilterRankedResults}
|
|
1098
|
+
enableGrouping={enableGrouping}
|
|
1099
|
+
enableHiding={enableHiding}
|
|
1100
|
+
enableMultiRowSelection={enableMultiRowSelection}
|
|
1101
|
+
enableMultiSort={enableMultiSort}
|
|
1102
|
+
enablePagination={enablePagination}
|
|
1103
|
+
enablePinning={enablePinning}
|
|
1104
|
+
enableRowSelection={enableRowSelection}
|
|
1105
|
+
enableSelectAll={enableSelectAll}
|
|
1106
|
+
enableSorting={enableSorting}
|
|
1107
|
+
enableStickyHeader={enableStickyHeader}
|
|
1108
|
+
enableTableFooter={enableTableFooter}
|
|
1109
|
+
enableTableHead={enableTableHead}
|
|
1110
|
+
enableToolbarInternalActions={enableToolbarInternalActions}
|
|
1111
|
+
enableTopToolbar={enableTopToolbar}
|
|
1112
|
+
filterFns={_filterFns}
|
|
1113
|
+
icons={_icons}
|
|
1114
|
+
localization={_localization}
|
|
1115
|
+
positionActionsColumn={positionActionsColumn}
|
|
1116
|
+
positionExpandColumn={positionExpandColumn}
|
|
1117
|
+
positionGlobalFilter={positionGlobalFilter}
|
|
1118
|
+
positionPagination={positionPagination}
|
|
1119
|
+
positionToolbarAlertBanner={positionToolbarAlertBanner}
|
|
1120
|
+
positionToolbarDropZone={positionToolbarDropZone}
|
|
1121
|
+
rowNumberMode={rowNumberMode}
|
|
1122
|
+
selectAllMode={selectAllMode}
|
|
1123
|
+
sortingFns={_sortingFns}
|
|
1124
|
+
{...rest}
|
|
1125
|
+
/>
|
|
1126
|
+
);
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
export default MaterialReactTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -1,88 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
actions: string;
|
|
3
|
-
and: string;
|
|
4
|
-
cancel: string;
|
|
5
|
-
changeFilterMode: string;
|
|
6
|
-
changeSearchMode: string;
|
|
7
|
-
clearFilter: string;
|
|
8
|
-
clearSearch: string;
|
|
9
|
-
clearSort: string;
|
|
10
|
-
clickToCopy: string;
|
|
11
|
-
columnActions: string;
|
|
12
|
-
copiedToClipboard: string;
|
|
13
|
-
dropToGroupBy: string;
|
|
14
|
-
edit: string;
|
|
15
|
-
expand: string;
|
|
16
|
-
expandAll: string;
|
|
17
|
-
filterArrIncludes: string;
|
|
18
|
-
filterArrIncludesAll: string;
|
|
19
|
-
filterArrIncludesSome: string;
|
|
20
|
-
filterBetween: string;
|
|
21
|
-
filterBetweenInclusive: string;
|
|
22
|
-
filterByColumn: string;
|
|
23
|
-
filterContains: string;
|
|
24
|
-
filterEmpty: string;
|
|
25
|
-
filterEndsWith: string;
|
|
26
|
-
filterEquals: string;
|
|
27
|
-
filterEqualsString: string;
|
|
28
|
-
filterFuzzy: string;
|
|
29
|
-
filterGreaterThan: string;
|
|
30
|
-
filterGreaterThanOrEqualTo: string;
|
|
31
|
-
filterInNumberRange: string;
|
|
32
|
-
filterIncludesString: string;
|
|
33
|
-
filterIncludesStringSensitive: string;
|
|
34
|
-
filterLessThan: string;
|
|
35
|
-
filterLessThanOrEqualTo: string;
|
|
36
|
-
filterMode: string;
|
|
37
|
-
filterNotEmpty: string;
|
|
38
|
-
filterNotEquals: string;
|
|
39
|
-
filterStartsWith: string;
|
|
40
|
-
filterWeakEquals: string;
|
|
41
|
-
filteringByColumn: string;
|
|
42
|
-
grab: string;
|
|
43
|
-
groupByColumn: string;
|
|
44
|
-
groupedBy: string;
|
|
45
|
-
hideAll: string;
|
|
46
|
-
hideColumn: string;
|
|
47
|
-
max: string;
|
|
48
|
-
min: string;
|
|
49
|
-
move: string;
|
|
50
|
-
noRecordsToDisplay: string;
|
|
51
|
-
noResultsFound: string;
|
|
52
|
-
or: string;
|
|
53
|
-
pinToLeft: string;
|
|
54
|
-
pinToRight: string;
|
|
55
|
-
resetColumnSize: string;
|
|
56
|
-
resetOrder: string;
|
|
57
|
-
rowActions: string;
|
|
58
|
-
rowNumber: string;
|
|
59
|
-
rowNumbers: string;
|
|
60
|
-
save: string;
|
|
61
|
-
search: string;
|
|
62
|
-
select: string;
|
|
63
|
-
selectedCountOfRowCountRowsSelected: string;
|
|
64
|
-
showAll: string;
|
|
65
|
-
showAllColumns: string;
|
|
66
|
-
showHideColumns: string;
|
|
67
|
-
showHideFilters: string;
|
|
68
|
-
showHideSearch: string;
|
|
69
|
-
sortByColumnAsc: string;
|
|
70
|
-
sortByColumnDesc: string;
|
|
71
|
-
sortedByColumnAsc: string;
|
|
72
|
-
sortedByColumnDesc: string;
|
|
73
|
-
thenBy: string;
|
|
74
|
-
toggleDensity: string;
|
|
75
|
-
toggleFullScreen: string;
|
|
76
|
-
toggleSelectAll: string;
|
|
77
|
-
toggleSelectRow: string;
|
|
78
|
-
toggleVisibility: string;
|
|
79
|
-
ungroupByColumn: string;
|
|
80
|
-
unpin: string;
|
|
81
|
-
unpinAll: string;
|
|
82
|
-
unsorted: string;
|
|
83
|
-
}
|
|
1
|
+
import { MRT_Localization } from '../MaterialReactTable';
|
|
84
2
|
|
|
85
|
-
export const
|
|
3
|
+
export const MRT_Localization_EN: MRT_Localization = {
|
|
86
4
|
actions: 'Actions',
|
|
87
5
|
and: 'and',
|
|
88
6
|
cancel: 'Cancel',
|
|
@@ -123,6 +41,10 @@ export const MRT_DefaultLocalization_EN: MRT_Localization = {
|
|
|
123
41
|
filterStartsWith: 'Starts With',
|
|
124
42
|
filterWeakEquals: 'Equals',
|
|
125
43
|
filteringByColumn: 'Filtering by {column} - {filterType} {filterValue}',
|
|
44
|
+
goToFirstPage: 'Go to first page',
|
|
45
|
+
goToLastPage: 'Go to last page',
|
|
46
|
+
goToNextPage: 'Go to next page',
|
|
47
|
+
goToPreviousPage: 'Go to previous page',
|
|
126
48
|
grab: 'Grab',
|
|
127
49
|
groupByColumn: 'Group by {column}',
|
|
128
50
|
groupedBy: 'Grouped by ',
|
|
@@ -133,6 +55,7 @@ export const MRT_DefaultLocalization_EN: MRT_Localization = {
|
|
|
133
55
|
move: 'Move',
|
|
134
56
|
noRecordsToDisplay: 'No records to display',
|
|
135
57
|
noResultsFound: 'No results found',
|
|
58
|
+
of: 'of',
|
|
136
59
|
or: 'or',
|
|
137
60
|
pinToLeft: 'Pin to left',
|
|
138
61
|
pinToRight: 'Pin to right',
|
|
@@ -141,6 +64,7 @@ export const MRT_DefaultLocalization_EN: MRT_Localization = {
|
|
|
141
64
|
rowActions: 'Row Actions',
|
|
142
65
|
rowNumber: '#',
|
|
143
66
|
rowNumbers: 'Row Numbers',
|
|
67
|
+
rowsPerPage: 'Rows per page',
|
|
144
68
|
save: 'Save',
|
|
145
69
|
search: 'Search',
|
|
146
70
|
selectedCountOfRowCountRowsSelected:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { MRT_Localization } from '../MaterialReactTable';
|
|
2
|
+
|
|
3
|
+
export const MRT_Localization_PT_BR: MRT_Localization = {
|
|
4
|
+
actions: 'Ações',
|
|
5
|
+
and: 'e',
|
|
6
|
+
cancel: 'Cancelar',
|
|
7
|
+
changeFilterMode: 'Alterar o modo de filtro',
|
|
8
|
+
changeSearchMode: 'Alterar o modo de pesquisa',
|
|
9
|
+
clearFilter: 'Limpar filtros',
|
|
10
|
+
clearSearch: 'Limpar pesquisa',
|
|
11
|
+
clearSort: 'Limpar classificações',
|
|
12
|
+
clickToCopy: 'Clique para copiar',
|
|
13
|
+
columnActions: 'Ações das colunas',
|
|
14
|
+
copiedToClipboard: 'Copiado para área de transferência',
|
|
15
|
+
dropToGroupBy: 'Solte para agrupar por {column}',
|
|
16
|
+
edit: 'Editar',
|
|
17
|
+
expand: 'Expandir',
|
|
18
|
+
expandAll: 'Expandir tudo',
|
|
19
|
+
filterArrIncludes: 'Inclui',
|
|
20
|
+
filterArrIncludesAll: 'Incluir tudo',
|
|
21
|
+
filterArrIncludesSome: 'Inclui alguns',
|
|
22
|
+
filterBetween: 'Entre',
|
|
23
|
+
filterBetweenInclusive: 'Entre valores incluídos',
|
|
24
|
+
filterByColumn: 'Filtrar por {column}',
|
|
25
|
+
filterContains: 'Contém',
|
|
26
|
+
filterEmpty: 'vazio',
|
|
27
|
+
filterEndsWith: 'Termina com',
|
|
28
|
+
filterEquals: 'Igual',
|
|
29
|
+
filterEqualsString: 'Igual',
|
|
30
|
+
filterFuzzy: 'Impreciso',
|
|
31
|
+
filterGreaterThan: 'Maior que',
|
|
32
|
+
filterGreaterThanOrEqualTo: 'Maior ou igual que',
|
|
33
|
+
filterInNumberRange: 'Entre',
|
|
34
|
+
filterIncludesString: 'Contém',
|
|
35
|
+
filterIncludesStringSensitive: 'Contém',
|
|
36
|
+
filterLessThan: 'Menor que',
|
|
37
|
+
filterLessThanOrEqualTo: 'Menor ou igual que',
|
|
38
|
+
filterMode: 'Modo de filtro: {filterType}',
|
|
39
|
+
filterNotEmpty: 'Não é vazio',
|
|
40
|
+
filterNotEquals: 'Não é igual',
|
|
41
|
+
filterStartsWith: 'Começa com',
|
|
42
|
+
filterWeakEquals: 'Igual',
|
|
43
|
+
filteringByColumn: 'Filtrando por {column} - {filterType} {filterValue}',
|
|
44
|
+
goToFirstPage: 'Ir para a primeira página',
|
|
45
|
+
goToLastPage: 'Ir para a última página',
|
|
46
|
+
goToNextPage: 'Ir para a próxima página',
|
|
47
|
+
goToPreviousPage: 'Ir para a página anterior',
|
|
48
|
+
grab: 'Agarrar',
|
|
49
|
+
groupByColumn: 'Agrupar por {column}',
|
|
50
|
+
groupedBy: 'Agrupado por ',
|
|
51
|
+
hideAll: 'Ocultar tudo',
|
|
52
|
+
hideColumn: 'Ocultar coluna {column}',
|
|
53
|
+
max: 'Max',
|
|
54
|
+
min: 'Min',
|
|
55
|
+
move: 'Mover',
|
|
56
|
+
noRecordsToDisplay: 'Não há registros a serem exibidos',
|
|
57
|
+
noResultsFound: 'Nenhum resultado encontrado',
|
|
58
|
+
of: 'de',
|
|
59
|
+
or: 'ou',
|
|
60
|
+
pinToLeft: 'Fixar à esquerda',
|
|
61
|
+
pinToRight: 'Fixar à direita',
|
|
62
|
+
resetColumnSize: 'Restaurar tamanho da coluna',
|
|
63
|
+
resetOrder: 'Restaurar ordem',
|
|
64
|
+
rowActions: 'Ações da linha',
|
|
65
|
+
rowNumber: '#',
|
|
66
|
+
rowNumbers: 'Número da linha',
|
|
67
|
+
rowsPerPage: 'Linhas por página',
|
|
68
|
+
save: 'Salvar',
|
|
69
|
+
search: 'Pesquisar',
|
|
70
|
+
selectedCountOfRowCountRowsSelected:
|
|
71
|
+
'{selectedCount} de {rowCount} linha(s) selecionada(s)',
|
|
72
|
+
select: 'Selecionar',
|
|
73
|
+
showAll: 'Mostrar tudo',
|
|
74
|
+
showAllColumns: 'Mostrar todas as colunas',
|
|
75
|
+
showHideColumns: 'Mostrar/Ocultar colunas',
|
|
76
|
+
showHideFilters: 'Mostrar/Ocultar filtros',
|
|
77
|
+
showHideSearch: 'Mostrar/Ocultar barra de pesquisa',
|
|
78
|
+
sortByColumnAsc: 'Ordenar por {column} em ascendente',
|
|
79
|
+
sortByColumnDesc: 'Ordenar por {column} em descendente',
|
|
80
|
+
sortedByColumnAsc: 'Ordenado por {column} em ascendente',
|
|
81
|
+
sortedByColumnDesc: 'Ordenado por {column} em descendente',
|
|
82
|
+
thenBy: ', depois por ',
|
|
83
|
+
toggleDensity: 'Alternar densidade',
|
|
84
|
+
toggleFullScreen: 'Alternar tela cheia',
|
|
85
|
+
toggleSelectAll: 'Alternar selecionar tudo',
|
|
86
|
+
toggleSelectRow: 'Alternar seleção da linha',
|
|
87
|
+
toggleVisibility: 'Alternar visibilidade',
|
|
88
|
+
ungroupByColumn: 'Desagrupar por {column}',
|
|
89
|
+
unpin: 'Desfixar',
|
|
90
|
+
unpinAll: 'Desfixar tudo',
|
|
91
|
+
unsorted: 'Desordenar',
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//Not supported yet, but if you want to help, copy en.ts file contents here and translate, then make a PR
|
|
@@ -32,9 +32,10 @@ export const MRT_EditRowModal = <TData extends Record<string, any> = {}>({
|
|
|
32
32
|
<form onSubmit={(e) => e.preventDefault()}>
|
|
33
33
|
<Stack
|
|
34
34
|
sx={{
|
|
35
|
-
width: '100%',
|
|
36
|
-
minWidth: { xs: '300px', sm: '360px', md: '400px' },
|
|
37
35
|
gap: '1.5rem',
|
|
36
|
+
minWidth: { xs: '300px', sm: '360px', md: '400px' },
|
|
37
|
+
pt: '1rem',
|
|
38
|
+
width: '100%',
|
|
38
39
|
}}
|
|
39
40
|
>
|
|
40
41
|
{row
|
|
@@ -68,7 +68,7 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
68
68
|
|
|
69
69
|
const mcTableCellBodyProps =
|
|
70
70
|
columnDef.muiTableBodyCellProps instanceof Function
|
|
71
|
-
? columnDef.muiTableBodyCellProps({ cell, table })
|
|
71
|
+
? columnDef.muiTableBodyCellProps({ cell, column, row, table })
|
|
72
72
|
: columnDef.muiTableBodyCellProps;
|
|
73
73
|
|
|
74
74
|
const tableCellProps = {
|
|
@@ -69,7 +69,7 @@ export const MRT_TableBodyRow: FC<Props> = ({
|
|
|
69
69
|
backgroundColor: lighten(theme.palette.background.default, 0.06),
|
|
70
70
|
opacity:
|
|
71
71
|
draggingRow?.id === row.id || hoveredRow?.id === row.id ? 0.5 : 1,
|
|
72
|
-
transition: 'all 0.
|
|
72
|
+
transition: 'all 0.1s ease-in-out',
|
|
73
73
|
'&:hover td': {
|
|
74
74
|
backgroundColor:
|
|
75
75
|
tableRowProps?.hover !== false && getIsSomeColumnsPinned()
|
|
@@ -36,7 +36,7 @@ export const MRT_TableDetailPanel: FC<Props> = ({ row, table }) => {
|
|
|
36
36
|
borderBottom: !row.getIsExpanded() ? 'none' : undefined,
|
|
37
37
|
pb: row.getIsExpanded() ? '1rem' : 0,
|
|
38
38
|
pt: row.getIsExpanded() ? '1rem' : 0,
|
|
39
|
-
transition: 'all 0.
|
|
39
|
+
transition: 'all 0.1s ease-in-out',
|
|
40
40
|
width: `${table.getTotalSize()}px`,
|
|
41
41
|
...(tableCellProps?.sx instanceof Function
|
|
42
42
|
? tableCellProps.sx(theme)
|