material-react-table 2.0.0-alpha.6 → 2.0.0-beta.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 +1 -1
- package/dist/cjs/index.js +184 -109
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/body/MRT_TableBodyCell.d.ts +1 -1
- package/dist/cjs/types/body/MRT_TableBodyRow.d.ts +1 -1
- package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +2 -1
- package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/cjs/types/icons.d.ts +1 -0
- package/dist/cjs/types/types.d.ts +6 -1
- package/dist/esm/material-react-table.esm.js +181 -107
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/body/MRT_TableBodyCell.d.ts +1 -1
- package/dist/esm/types/body/MRT_TableBodyRow.d.ts +1 -1
- package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +2 -1
- package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/esm/types/icons.d.ts +1 -0
- package/dist/esm/types/types.d.ts +6 -1
- package/dist/index.d.ts +12 -5
- package/locales/ar.esm.js +1 -0
- package/locales/ar.esm.js.map +1 -1
- package/locales/ar.js +1 -0
- package/locales/ar.js.map +1 -1
- package/locales/bg.esm.js +1 -0
- package/locales/bg.esm.js.map +1 -1
- package/locales/bg.js +1 -0
- package/locales/bg.js.map +1 -1
- package/locales/cs.esm.js +1 -0
- package/locales/cs.esm.js.map +1 -1
- package/locales/cs.js +1 -0
- package/locales/cs.js.map +1 -1
- package/locales/da.esm.js +1 -0
- package/locales/da.esm.js.map +1 -1
- package/locales/da.js +1 -0
- package/locales/da.js.map +1 -1
- package/locales/de.esm.js +1 -0
- package/locales/de.esm.js.map +1 -1
- package/locales/de.js +1 -0
- package/locales/de.js.map +1 -1
- package/locales/es.esm.js +1 -0
- package/locales/es.esm.js.map +1 -1
- package/locales/es.js +1 -0
- package/locales/es.js.map +1 -1
- package/locales/et.esm.js +1 -0
- package/locales/et.esm.js.map +1 -1
- package/locales/et.js +1 -0
- package/locales/et.js.map +1 -1
- package/locales/fa.esm.js +1 -0
- package/locales/fa.esm.js.map +1 -1
- package/locales/fa.js +1 -0
- package/locales/fa.js.map +1 -1
- package/locales/fi.esm.js +1 -0
- package/locales/fi.esm.js.map +1 -1
- package/locales/fi.js +1 -0
- package/locales/fi.js.map +1 -1
- package/locales/fr.esm.js +1 -0
- package/locales/fr.esm.js.map +1 -1
- package/locales/fr.js +1 -0
- package/locales/fr.js.map +1 -1
- package/locales/hu.esm.js +1 -0
- package/locales/hu.esm.js.map +1 -1
- package/locales/hu.js +1 -0
- package/locales/hu.js.map +1 -1
- package/locales/hy.esm.js +1 -0
- package/locales/hy.esm.js.map +1 -1
- package/locales/hy.js +1 -0
- package/locales/hy.js.map +1 -1
- package/locales/id.esm.js +1 -0
- package/locales/id.esm.js.map +1 -1
- package/locales/id.js +1 -0
- package/locales/id.js.map +1 -1
- package/locales/it.esm.js +1 -0
- package/locales/it.esm.js.map +1 -1
- package/locales/it.js +1 -0
- package/locales/it.js.map +1 -1
- package/locales/ja.esm.js +1 -0
- package/locales/ja.esm.js.map +1 -1
- package/locales/ja.js +1 -0
- package/locales/ja.js.map +1 -1
- package/locales/ko.esm.js +1 -0
- package/locales/ko.esm.js.map +1 -1
- package/locales/ko.js +1 -0
- package/locales/ko.js.map +1 -1
- package/locales/nl.esm.js +1 -0
- package/locales/nl.esm.js.map +1 -1
- package/locales/nl.js +1 -0
- package/locales/nl.js.map +1 -1
- package/locales/no.esm.js +1 -0
- package/locales/no.esm.js.map +1 -1
- package/locales/no.js +1 -0
- package/locales/no.js.map +1 -1
- package/locales/np.esm.js +1 -1
- package/locales/np.esm.js.map +1 -1
- package/locales/np.js +1 -1
- package/locales/np.js.map +1 -1
- package/locales/pl.esm.js +1 -0
- package/locales/pl.esm.js.map +1 -1
- package/locales/pl.js +1 -0
- package/locales/pl.js.map +1 -1
- package/locales/pt-BR.esm.js +1 -0
- package/locales/pt-BR.esm.js.map +1 -1
- package/locales/pt-BR.js +1 -0
- package/locales/pt-BR.js.map +1 -1
- package/locales/pt.esm.js +1 -0
- package/locales/pt.esm.js.map +1 -1
- package/locales/pt.js +1 -0
- package/locales/pt.js.map +1 -1
- package/locales/ro.esm.js +1 -0
- package/locales/ro.esm.js.map +1 -1
- package/locales/ro.js +1 -0
- package/locales/ro.js.map +1 -1
- package/locales/ru.esm.js +1 -0
- package/locales/ru.esm.js.map +1 -1
- package/locales/ru.js +1 -0
- package/locales/ru.js.map +1 -1
- package/locales/sk.esm.js +1 -0
- package/locales/sk.esm.js.map +1 -1
- package/locales/sk.js +1 -0
- package/locales/sk.js.map +1 -1
- package/locales/sr-Cyrl-RS.esm.js +1 -0
- package/locales/sr-Cyrl-RS.esm.js.map +1 -1
- package/locales/sr-Cyrl-RS.js +1 -0
- package/locales/sr-Cyrl-RS.js.map +1 -1
- package/locales/sr-Latn-RS.esm.js +1 -0
- package/locales/sr-Latn-RS.esm.js.map +1 -1
- package/locales/sr-Latn-RS.js +1 -0
- package/locales/sr-Latn-RS.js.map +1 -1
- package/locales/sv.esm.js +3 -2
- package/locales/sv.esm.js.map +1 -1
- package/locales/sv.js +3 -2
- package/locales/sv.js.map +1 -1
- package/locales/tr.esm.js +1 -0
- package/locales/tr.esm.js.map +1 -1
- package/locales/tr.js +1 -0
- package/locales/tr.js.map +1 -1
- package/locales/uk.esm.js +1 -0
- package/locales/uk.esm.js.map +1 -1
- package/locales/uk.js +1 -0
- package/locales/uk.js.map +1 -1
- package/locales/vi.esm.js +1 -0
- package/locales/vi.esm.js.map +1 -1
- package/locales/vi.js +1 -0
- package/locales/vi.js.map +1 -1
- package/locales/zh-Hans.esm.js +1 -0
- package/locales/zh-Hans.esm.js.map +1 -1
- package/locales/zh-Hans.js +1 -0
- package/locales/zh-Hans.js.map +1 -1
- package/locales/zh-Hant.esm.js +1 -0
- package/locales/zh-Hant.esm.js.map +1 -1
- package/locales/zh-Hant.js +1 -0
- package/locales/zh-Hant.js.map +1 -1
- package/package.json +11 -11
- package/src/body/MRT_TableBody.tsx +5 -0
- package/src/body/MRT_TableBodyCell.tsx +22 -7
- package/src/body/MRT_TableBodyRow.tsx +8 -6
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +1 -0
- package/src/body/MRT_TableDetailPanel.tsx +1 -2
- package/src/body/index.ts +1 -1
- package/src/buttons/MRT_ExpandButton.tsx +1 -0
- package/src/buttons/MRT_GrabHandleButton.tsx +3 -1
- package/src/column.utils.ts +20 -19
- package/src/footer/MRT_TableFooterCell.tsx +5 -1
- package/src/footer/MRT_TableFooterRow.tsx +2 -2
- package/src/head/MRT_TableHead.tsx +5 -1
- package/src/head/MRT_TableHeadCell.tsx +32 -19
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +2 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +4 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +8 -3
- package/src/head/MRT_TableHeadCellSortLabel.tsx +18 -12
- package/src/head/MRT_TableHeadRow.tsx +2 -2
- package/src/hooks/useMRT_DisplayColumns.tsx +20 -0
- package/src/icons.ts +3 -0
- package/src/inputs/MRT_EditCellTextField.tsx +10 -2
- package/src/locales/ar.ts +1 -1
- package/src/locales/bg.ts +1 -0
- package/src/locales/cs.ts +1 -0
- package/src/locales/da.ts +1 -0
- package/src/locales/de.ts +1 -0
- package/src/locales/es.ts +1 -0
- package/src/locales/et.ts +1 -0
- package/src/locales/fa.ts +1 -0
- package/src/locales/fi.ts +1 -0
- package/src/locales/fr.ts +1 -0
- package/src/locales/hu.ts +1 -0
- package/src/locales/hy.ts +1 -0
- package/src/locales/id.ts +1 -0
- package/src/locales/it.ts +1 -0
- package/src/locales/ja.ts +1 -0
- package/src/locales/ko.ts +1 -0
- package/src/locales/nl.ts +1 -0
- package/src/locales/no.ts +1 -0
- package/src/locales/np.ts +3 -2
- package/src/locales/pl.ts +1 -0
- package/src/locales/pt-BR.ts +1 -0
- package/src/locales/pt.ts +1 -0
- package/src/locales/ro.ts +1 -0
- package/src/locales/ru.ts +1 -0
- package/src/locales/sk.ts +1 -0
- package/src/locales/sr-Cyrl-RS.ts +1 -0
- package/src/locales/sr-Latn-RS.ts +1 -0
- package/src/locales/sv.ts +3 -2
- package/src/locales/tr.ts +1 -0
- package/src/locales/uk.ts +1 -0
- package/src/locales/vi.ts +1 -0
- package/src/locales/zh-Hans.ts +1 -0
- package/src/locales/zh-Hant.ts +1 -0
- package/src/table/MRT_Table.tsx +5 -1
- package/src/table/MRT_TableContainer.tsx +50 -1
- package/src/table/MRT_TablePaper.tsx +1 -1
- package/src/toolbar/MRT_LinearProgressBar.tsx +2 -2
- package/src/toolbar/MRT_TablePagination.tsx +5 -2
- package/src/types.ts +6 -1
@@ -14,6 +14,15 @@ import {
|
|
14
14
|
type MRT_Row,
|
15
15
|
} from '../types';
|
16
16
|
|
17
|
+
const blankColProps = {
|
18
|
+
sx: {
|
19
|
+
flex: '1 0 auto',
|
20
|
+
minWidth: 0,
|
21
|
+
p: 0,
|
22
|
+
width: 0,
|
23
|
+
},
|
24
|
+
};
|
25
|
+
|
17
26
|
interface Params<TData extends Record<string, any>> {
|
18
27
|
columnOrder: MRT_ColumnOrderState;
|
19
28
|
creatingRow: MRT_Row<TData> | null;
|
@@ -123,6 +132,17 @@ export const useMRT_DisplayColumns = <TData extends Record<string, any>>({
|
|
123
132
|
...tableOptions.displayColumnDefOptions?.['mrt-row-numbers'],
|
124
133
|
id: 'mrt-row-numbers',
|
125
134
|
},
|
135
|
+
|
136
|
+
(tableOptions.state?.columnOrder ?? columnOrder).includes(
|
137
|
+
'mrt-row-spacer',
|
138
|
+
) && {
|
139
|
+
columnDefType: 'display',
|
140
|
+
header: '',
|
141
|
+
id: 'spacer',
|
142
|
+
muiTableBodyCellProps: blankColProps,
|
143
|
+
muiTableFooterCellProps: blankColProps,
|
144
|
+
muiTableHeadCellProps: blankColProps,
|
145
|
+
},
|
126
146
|
] as MRT_ColumnDef<TData>[]
|
127
147
|
).filter(Boolean),
|
128
148
|
[
|
package/src/icons.ts
CHANGED
@@ -28,6 +28,7 @@ import SaveIcon from '@mui/icons-material/Save';
|
|
28
28
|
import SearchIcon from '@mui/icons-material/Search';
|
29
29
|
import SearchOffIcon from '@mui/icons-material/SearchOff';
|
30
30
|
import SortIcon from '@mui/icons-material/Sort';
|
31
|
+
import SyncAltIcon from '@mui/icons-material/SyncAlt';
|
31
32
|
import ViewColumnIcon from '@mui/icons-material/ViewColumn';
|
32
33
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
33
34
|
|
@@ -62,6 +63,7 @@ export interface MRT_Icons {
|
|
62
63
|
SearchIcon: any;
|
63
64
|
SearchOffIcon: any;
|
64
65
|
SortIcon: any;
|
66
|
+
SyncAltIcon?: any;
|
65
67
|
ViewColumnIcon: any;
|
66
68
|
VisibilityOffIcon: any;
|
67
69
|
}
|
@@ -97,6 +99,7 @@ export const MRT_Default_Icons: MRT_Icons = {
|
|
97
99
|
SearchIcon,
|
98
100
|
SearchOffIcon,
|
99
101
|
SortIcon,
|
102
|
+
SyncAltIcon,
|
100
103
|
ViewColumnIcon,
|
101
104
|
VisibilityOffIcon,
|
102
105
|
};
|
@@ -100,10 +100,10 @@ export const MRT_EditCellTextField = <TData extends Record<string, any>>({
|
|
100
100
|
}
|
101
101
|
}}
|
102
102
|
label={
|
103
|
-
['custom', 'modal'].includes(
|
103
|
+
!['custom', 'modal'].includes(
|
104
104
|
(isCreating ? createDisplayMode : editDisplayMode) as string,
|
105
105
|
)
|
106
|
-
?
|
106
|
+
? columnDef.header
|
107
107
|
: undefined
|
108
108
|
}
|
109
109
|
margin="none"
|
@@ -119,6 +119,14 @@ export const MRT_EditCellTextField = <TData extends Record<string, any>>({
|
|
119
119
|
value={value}
|
120
120
|
variant="standard"
|
121
121
|
{...textFieldProps}
|
122
|
+
InputProps={{
|
123
|
+
disableUnderline: editDisplayMode === 'table',
|
124
|
+
...textFieldProps.InputProps,
|
125
|
+
}}
|
126
|
+
inputProps={{
|
127
|
+
autoComplete: 'new-password', // disable autocomplete and autofill
|
128
|
+
...textFieldProps.inputProps,
|
129
|
+
}}
|
122
130
|
onBlur={handleBlur}
|
123
131
|
onChange={handleChange}
|
124
132
|
onClick={(e) => {
|
package/src/locales/ar.ts
CHANGED
@@ -14,7 +14,6 @@ export const MRT_Localization_AR: MRT_Localization = {
|
|
14
14
|
collapseAll: 'إخفاء الكل',
|
15
15
|
columnActions: 'إجراءات العمود',
|
16
16
|
copiedToClipboard: 'نسخ إلى الحافظة',
|
17
|
-
|
18
17
|
dropToGroupBy: 'أفلت للمجموعة حسب {column}',
|
19
18
|
edit: 'تعديل',
|
20
19
|
expand: 'إظهار',
|
@@ -60,6 +59,7 @@ export const MRT_Localization_AR: MRT_Localization = {
|
|
60
59
|
noResultsFound: 'لم يتم العثور على نتائج',
|
61
60
|
of: 'ل',
|
62
61
|
or: 'أو',
|
62
|
+
pin: 'تثبيت',
|
63
63
|
pinToLeft: 'تثبيت جهة اليسار',
|
64
64
|
pinToRight: 'تثبيت على اليمين',
|
65
65
|
resetColumnSize: 'Reset column size',
|
package/src/locales/bg.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_BG: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Няма намерени резултати',
|
60
60
|
of: 'от',
|
61
61
|
or: 'или',
|
62
|
+
pin: 'Закачи',
|
62
63
|
pinToLeft: 'Закачи отляво',
|
63
64
|
pinToRight: 'Закачи отдясно',
|
64
65
|
resetColumnSize: 'Нулиране на размера на колоната',
|
package/src/locales/cs.ts
CHANGED
@@ -60,6 +60,7 @@ export const MRT_Localization_CS: MRT_Localization = {
|
|
60
60
|
noResultsFound: 'Nenalezeny žádné výsledky',
|
61
61
|
of: 'z',
|
62
62
|
or: 'nebo',
|
63
|
+
pin: 'Připnout',
|
63
64
|
pinToLeft: 'Připnout doleva',
|
64
65
|
pinToRight: 'Připnout doprava',
|
65
66
|
resetColumnSize: 'Resetovat šířku sloupců',
|
package/src/locales/da.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_DA: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Ingen resultater fundet',
|
60
60
|
of: 'af',
|
61
61
|
or: 'eller',
|
62
|
+
pin: 'Fastgør',
|
62
63
|
pinToLeft: 'Fastgør til venstre',
|
63
64
|
pinToRight: 'Fastgør til højre',
|
64
65
|
resetColumnSize: 'Nulstil kolonnebredde',
|
package/src/locales/de.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_DE: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Keine Ergebnisse gefunden',
|
60
60
|
of: 'von',
|
61
61
|
or: 'oder',
|
62
|
+
pin: 'Anheften',
|
62
63
|
pinToLeft: 'Links anheften',
|
63
64
|
pinToRight: 'Rechts anheften',
|
64
65
|
resetColumnSize: 'Spaltengröße zurücksetzen',
|
package/src/locales/es.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_ES: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'No se encontraron resultados',
|
60
60
|
of: 'de',
|
61
61
|
or: 'o',
|
62
|
+
pin: 'Anclar',
|
62
63
|
pinToLeft: 'Anclar a la izquierda',
|
63
64
|
pinToRight: 'Anclar a la derecha',
|
64
65
|
resetColumnSize: 'Resetear tamaño de columna',
|
package/src/locales/et.ts
CHANGED
package/src/locales/fa.ts
CHANGED
package/src/locales/fi.ts
CHANGED
package/src/locales/fr.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_FR: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Aucun résultat trouvé',
|
60
60
|
of: 'de',
|
61
61
|
or: 'ou',
|
62
|
+
pin: 'Attacher',
|
62
63
|
pinToLeft: 'Épingler à gauche',
|
63
64
|
pinToRight: 'Épingler à droite',
|
64
65
|
resetColumnSize: 'Réinitialiser la taille de la colonne',
|
package/src/locales/hu.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_HU: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Nincs találat',
|
60
60
|
of: 'összesen',
|
61
61
|
or: 'vagy',
|
62
|
+
pin: 'Rögzítés',
|
62
63
|
pinToLeft: 'Rögzítés balra',
|
63
64
|
pinToRight: 'Rögzítés jobbra',
|
64
65
|
resetColumnSize: 'Oszlop méretének alaphelyzetbe állítása',
|
package/src/locales/hy.ts
CHANGED
package/src/locales/id.ts
CHANGED
@@ -60,6 +60,7 @@ export const MRT_Localization_ID: MRT_Localization = {
|
|
60
60
|
noResultsFound: 'Tidak ada hasil yang ditemukan',
|
61
61
|
of: 'dari',
|
62
62
|
or: 'atau',
|
63
|
+
pin: 'Sematkan',
|
63
64
|
pinToLeft: 'Sematkan ke kiri',
|
64
65
|
pinToRight: 'Sematkan ke kanan',
|
65
66
|
resetColumnSize: 'Reset ukuran kolom',
|
package/src/locales/it.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_IT: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Nessun risultato trovato',
|
60
60
|
of: 'di',
|
61
61
|
or: 'o',
|
62
|
+
pin: 'Blocca',
|
62
63
|
pinToLeft: 'Blocca a sinistra',
|
63
64
|
pinToRight: 'Blocca a destra',
|
64
65
|
resetColumnSize: 'Resetta dimensione colonna',
|
package/src/locales/ja.ts
CHANGED
package/src/locales/ko.ts
CHANGED
package/src/locales/nl.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_NL: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Geen resultaten gevonden',
|
60
60
|
of: 'van',
|
61
61
|
or: 'of',
|
62
|
+
pin: 'Vastzetten',
|
62
63
|
pinToLeft: 'Links vastzetten',
|
63
64
|
pinToRight: 'Rechts vastzetten',
|
64
65
|
resetColumnSize: 'Kolombreedte resetten',
|
package/src/locales/no.ts
CHANGED
package/src/locales/np.ts
CHANGED
@@ -42,7 +42,8 @@ export const MRT_Localization_NP: MRT_Localization = {
|
|
42
42
|
filterNotEquals: 'असमान',
|
43
43
|
filterStartsWith: 'सुरुमा समावेश गरिएको',
|
44
44
|
filterWeakEquals: 'असमान',
|
45
|
-
filteringByColumn:
|
45
|
+
filteringByColumn:
|
46
|
+
'{column} द्वारा फिल्टर गर्दै - {filterType} {filterValue}',
|
46
47
|
goToFirstPage: 'पहिलो पृष्ठमा जानुहोस्',
|
47
48
|
goToLastPage: 'अन्तिम पृष्ठमा जानुहोस्',
|
48
49
|
goToNextPage: 'अर्को पृष्ठमा जानुहोस्',
|
@@ -90,5 +91,5 @@ export const MRT_Localization_NP: MRT_Localization = {
|
|
90
91
|
toggleVisibility: 'दृश्यता परिवर्तन गर्नुहोस्',
|
91
92
|
ungroupByColumn: '{column} का आधारमा समूह हटाउनुहोस्',
|
92
93
|
unpin: 'अनपिन गर्नुहोस्',
|
93
|
-
unpinAll: 'सबै अनपिन गर्नुहोस्'
|
94
|
+
unpinAll: 'सबै अनपिन गर्नुहोस्',
|
94
95
|
};
|
package/src/locales/pl.ts
CHANGED
package/src/locales/pt-BR.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_PT_BR: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Nenhum resultado encontrado',
|
60
60
|
of: 'de',
|
61
61
|
or: 'ou',
|
62
|
+
pin: 'Fixar',
|
62
63
|
pinToLeft: 'Fixar à esquerda',
|
63
64
|
pinToRight: 'Fixar à direita',
|
64
65
|
resetColumnSize: 'Restaurar tamanho da coluna',
|
package/src/locales/pt.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_PT: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Nenhum resultado encontrado',
|
60
60
|
of: 'de',
|
61
61
|
or: 'ou',
|
62
|
+
pin: 'Fixar',
|
62
63
|
pinToLeft: 'Fixar à esquerda',
|
63
64
|
pinToRight: 'Fixar à direita',
|
64
65
|
resetColumnSize: 'Restaurar tamanho da coluna',
|
package/src/locales/ro.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_RO: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Niciun rezultat găsit',
|
60
60
|
of: 'din',
|
61
61
|
or: 'sau',
|
62
|
+
pin: 'Fixează',
|
62
63
|
pinToLeft: 'Fixează la stanga',
|
63
64
|
pinToRight: 'Fixează la dreapta',
|
64
65
|
resetColumnSize: 'Resetează dimensiune coloană',
|
package/src/locales/ru.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_RU: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Результатов не найдено',
|
60
60
|
of: 'из',
|
61
61
|
or: 'или',
|
62
|
+
pin: 'Прикрепить',
|
62
63
|
pinToLeft: 'Прикрепить слева',
|
63
64
|
pinToRight: 'Прикрепить справа',
|
64
65
|
resetColumnSize: 'Сбросить размер колонок',
|
package/src/locales/sk.ts
CHANGED
@@ -60,6 +60,7 @@ export const MRT_Localization_SK: MRT_Localization = {
|
|
60
60
|
noResultsFound: 'Nenájdené žiadne výsledky',
|
61
61
|
of: 'z',
|
62
62
|
or: 'alebo',
|
63
|
+
pin: 'Pripnúť',
|
63
64
|
pinToLeft: 'Pripnúť doľava',
|
64
65
|
pinToRight: 'Pripnúť doprava',
|
65
66
|
resetColumnSize: 'Resetovať šírku stĺpcov',
|
package/src/locales/sv.ts
CHANGED
@@ -44,11 +44,11 @@ export const MRT_Localization_SV: MRT_Localization = {
|
|
44
44
|
filterWeakEquals: 'Lika med',
|
45
45
|
filteringByColumn: 'Filtrering efter {column} - {filterType} {filterValue}',
|
46
46
|
goToFirstPage: 'Gå till första sidan',
|
47
|
-
goToLastPage: 'Gå till sista sidan
|
47
|
+
goToLastPage: 'Gå till sista sidan',
|
48
48
|
goToNextPage: 'Gå till nästa sida',
|
49
49
|
goToPreviousPage: 'Gå till föregående sida',
|
50
50
|
grab: 'Greppa',
|
51
|
-
groupByColumn: '
|
51
|
+
groupByColumn: 'Gruppera efter {column}',
|
52
52
|
groupedBy: 'Gruppera efter ',
|
53
53
|
hideAll: 'Göm alla',
|
54
54
|
hideColumn: 'Göm {column} kolumn',
|
@@ -59,6 +59,7 @@ export const MRT_Localization_SV: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Inga resultat funna',
|
60
60
|
of: 'av',
|
61
61
|
or: 'eller',
|
62
|
+
pin: 'Fäst',
|
62
63
|
pinToLeft: 'Fäst till vänster',
|
63
64
|
pinToRight: 'Fäst till höger',
|
64
65
|
resetColumnSize: 'Återställ kolumnstorlek',
|
package/src/locales/tr.ts
CHANGED
package/src/locales/uk.ts
CHANGED
package/src/locales/vi.ts
CHANGED
@@ -59,6 +59,7 @@ export const MRT_Localization_VI: MRT_Localization = {
|
|
59
59
|
noResultsFound: 'Không có kết quả nào được tìm thấy',
|
60
60
|
of: 'trên',
|
61
61
|
or: 'hoặc',
|
62
|
+
pin: 'Ghim',
|
62
63
|
pinToLeft: 'Ghim sang trái',
|
63
64
|
pinToRight: 'Ghim sang phải',
|
64
65
|
resetColumnSize: 'Đặt lại kích thước cột',
|
package/src/locales/zh-Hans.ts
CHANGED
package/src/locales/zh-Hant.ts
CHANGED
package/src/table/MRT_Table.tsx
CHANGED
@@ -6,7 +6,11 @@ import {
|
|
6
6
|
} from '@tanstack/react-virtual';
|
7
7
|
import Table from '@mui/material/Table';
|
8
8
|
import { MRT_TableBody, Memo_MRT_TableBody } from '../body/MRT_TableBody';
|
9
|
-
import {
|
9
|
+
import {
|
10
|
+
extraIndexRangeExtractor,
|
11
|
+
parseCSSVarId,
|
12
|
+
parseFromValuesOrFunc,
|
13
|
+
} from '../column.utils';
|
10
14
|
import { MRT_TableFooter } from '../footer/MRT_TableFooter';
|
11
15
|
import { MRT_TableHead } from '../head/MRT_TableHead';
|
12
16
|
import { type MRT_TableInstance } from '../types';
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import { useEffect, useLayoutEffect, useState } from 'react';
|
2
|
+
import Box from '@mui/material/Box';
|
3
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
2
4
|
import TableContainer from '@mui/material/TableContainer';
|
5
|
+
import { alpha, lighten } from '@mui/material/styles';
|
3
6
|
import { MRT_Table } from './MRT_Table';
|
4
7
|
import { parseFromValuesOrFunc } from '../column.utils';
|
5
8
|
import { MRT_EditRowModal } from '../modals';
|
@@ -21,11 +24,22 @@ export const MRT_TableContainer = <TData extends Record<string, any>>({
|
|
21
24
|
createDisplayMode,
|
22
25
|
editDisplayMode,
|
23
26
|
enableStickyHeader,
|
27
|
+
localization,
|
28
|
+
muiCircularProgressProps,
|
24
29
|
muiTableContainerProps,
|
25
30
|
},
|
26
31
|
refs: { bottomToolbarRef, tableContainerRef, topToolbarRef },
|
27
32
|
} = table;
|
28
|
-
const {
|
33
|
+
const {
|
34
|
+
creatingRow,
|
35
|
+
editingRow,
|
36
|
+
isFullScreen,
|
37
|
+
isLoading,
|
38
|
+
showLoadingOverlay,
|
39
|
+
} = getState();
|
40
|
+
|
41
|
+
const loading =
|
42
|
+
(isLoading || showLoadingOverlay) && showLoadingOverlay !== false;
|
29
43
|
|
30
44
|
const [totalToolbarHeight, setTotalToolbarHeight] = useState(0);
|
31
45
|
|
@@ -33,6 +47,11 @@ export const MRT_TableContainer = <TData extends Record<string, any>>({
|
|
33
47
|
table,
|
34
48
|
});
|
35
49
|
|
50
|
+
const circularProgressProps = parseFromValuesOrFunc(
|
51
|
+
muiCircularProgressProps,
|
52
|
+
{ table },
|
53
|
+
);
|
54
|
+
|
36
55
|
useIsomorphicLayoutEffect(() => {
|
37
56
|
const topToolbarHeight =
|
38
57
|
typeof document !== 'undefined'
|
@@ -52,6 +71,8 @@ export const MRT_TableContainer = <TData extends Record<string, any>>({
|
|
52
71
|
|
53
72
|
return (
|
54
73
|
<TableContainer
|
74
|
+
aria-busy={loading}
|
75
|
+
aria-describedby="mrt-progress"
|
55
76
|
{...tableContainerProps}
|
56
77
|
ref={(node: HTMLDivElement) => {
|
57
78
|
if (node) {
|
@@ -74,9 +95,37 @@ export const MRT_TableContainer = <TData extends Record<string, any>>({
|
|
74
95
|
: undefined,
|
75
96
|
maxWidth: '100%',
|
76
97
|
overflow: 'auto',
|
98
|
+
position: 'relative',
|
77
99
|
...(parseFromValuesOrFunc(tableContainerProps?.sx, theme) as any),
|
78
100
|
})}
|
79
101
|
>
|
102
|
+
{loading ? (
|
103
|
+
<Box
|
104
|
+
sx={(theme) => ({
|
105
|
+
alignItems: 'center',
|
106
|
+
backgroundColor: alpha(
|
107
|
+
lighten(theme.palette.background.paper, 0.05),
|
108
|
+
0.5,
|
109
|
+
),
|
110
|
+
bottom: 0,
|
111
|
+
display: 'flex',
|
112
|
+
justifyContent: 'center',
|
113
|
+
left: 0,
|
114
|
+
maxHeight: '100vh',
|
115
|
+
position: 'absolute',
|
116
|
+
right: 0,
|
117
|
+
top: 0,
|
118
|
+
width: '100%',
|
119
|
+
zIndex: 2,
|
120
|
+
})}
|
121
|
+
>
|
122
|
+
<CircularProgress
|
123
|
+
aria-label={localization.noRecordsToDisplay}
|
124
|
+
id="mrt-progress"
|
125
|
+
{...circularProgressProps}
|
126
|
+
/>
|
127
|
+
</Box>
|
128
|
+
) : null}
|
80
129
|
<MRT_Table table={table} />
|
81
130
|
{(createModalOpen || editModalOpen) && (
|
82
131
|
<MRT_EditRowModal open table={table} />
|
@@ -16,7 +16,7 @@ export const MRT_LinearProgressBar = <TData extends Record<string, any>>({
|
|
16
16
|
getState,
|
17
17
|
options: { muiLinearProgressProps },
|
18
18
|
} = table;
|
19
|
-
const {
|
19
|
+
const { showProgressBars } = getState();
|
20
20
|
|
21
21
|
const linearProgressProps = parseFromValuesOrFunc(muiLinearProgressProps, {
|
22
22
|
isTopToolbar,
|
@@ -25,7 +25,7 @@ export const MRT_LinearProgressBar = <TData extends Record<string, any>>({
|
|
25
25
|
|
26
26
|
return (
|
27
27
|
<Collapse
|
28
|
-
in={
|
28
|
+
in={showProgressBars}
|
29
29
|
mountOnEnter
|
30
30
|
sx={{
|
31
31
|
bottom: isTopToolbar ? 0 : undefined,
|
@@ -62,8 +62,9 @@ export const MRT_TablePagination = <TData extends Record<string, any> = {}>({
|
|
62
62
|
sx={{
|
63
63
|
alignItems: 'center',
|
64
64
|
display: 'flex',
|
65
|
+
flexWrap: 'wrap',
|
65
66
|
gap: '8px',
|
66
|
-
justifyContent: 'space-between',
|
67
|
+
justifyContent: { md: 'space-between', sm: 'center' },
|
67
68
|
justifySelf: 'flex-end',
|
68
69
|
mt:
|
69
70
|
position === 'top' &&
|
@@ -83,11 +84,12 @@ export const MRT_TablePagination = <TData extends Record<string, any> = {}>({
|
|
83
84
|
{localization.rowsPerPage}
|
84
85
|
</InputLabel>
|
85
86
|
<Select
|
87
|
+
disableUnderline
|
86
88
|
id="mrt-rows-per-page"
|
87
89
|
inputProps={{ 'aria-label': localization.rowsPerPage }}
|
88
90
|
label={localization.rowsPerPage}
|
89
91
|
onChange={(event) => setPageSize(+event.target.value)}
|
90
|
-
sx={{
|
92
|
+
sx={{ mb: 0 }}
|
91
93
|
value={pageSize}
|
92
94
|
variant="standard"
|
93
95
|
>
|
@@ -122,6 +124,7 @@ export const MRT_TablePagination = <TData extends Record<string, any> = {}>({
|
|
122
124
|
) : paginationDisplayMode === 'default' ? (
|
123
125
|
<>
|
124
126
|
<Typography
|
127
|
+
align="center"
|
125
128
|
sx={{ mb: 0, minWidth: '10ch', mx: '4px' }}
|
126
129
|
variant="body2"
|
127
130
|
>{`${
|
package/src/types.ts
CHANGED
@@ -43,6 +43,7 @@ import { type AutocompleteProps } from '@mui/material/Autocomplete';
|
|
43
43
|
import { type ButtonProps } from '@mui/material/Button';
|
44
44
|
import { type CheckboxProps } from '@mui/material/Checkbox';
|
45
45
|
import { type ChipProps } from '@mui/material/Chip';
|
46
|
+
import { type CircularProgressProps } from '@mui/material/CircularProgress';
|
46
47
|
import { type DialogProps } from '@mui/material/Dialog';
|
47
48
|
import { type IconButtonProps } from '@mui/material/IconButton';
|
48
49
|
import { type LinearProgressProps } from '@mui/material/LinearProgress';
|
@@ -158,7 +159,7 @@ export interface MRT_Localization {
|
|
158
159
|
noResultsFound: string;
|
159
160
|
of: string;
|
160
161
|
or: string;
|
161
|
-
pin
|
162
|
+
pin: string;
|
162
163
|
pinToLeft: string;
|
163
164
|
pinToRight: string;
|
164
165
|
resetColumnSize: string;
|
@@ -292,6 +293,7 @@ export type MRT_TableState<TData extends Record<string, any>> = TableState & {
|
|
292
293
|
showAlertBanner: boolean;
|
293
294
|
showColumnFilters: boolean;
|
294
295
|
showGlobalFilter: boolean;
|
296
|
+
showLoadingOverlay: boolean;
|
295
297
|
showProgressBars: boolean;
|
296
298
|
showSkeletons: boolean;
|
297
299
|
showToolbarDropZone: boolean;
|
@@ -741,6 +743,9 @@ export type MRT_TableOptions<TData extends Record<string, any>> = Omit<
|
|
741
743
|
muiBottomToolbarProps?:
|
742
744
|
| ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps)
|
743
745
|
| ToolbarProps;
|
746
|
+
muiCircularProgressProps?:
|
747
|
+
| ((props: { table: MRT_TableInstance<TData> }) => CircularProgressProps)
|
748
|
+
| CircularProgressProps;
|
744
749
|
muiColumnActionsButtonProps?:
|
745
750
|
| ((props: {
|
746
751
|
column: MRT_Column<TData>;
|