material-react-table 2.12.0 → 2.12.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/dist/index.d.ts +0 -1
- package/dist/index.esm.js +20 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -35
- package/dist/index.js.map +1 -1
- package/locales/hr/index.d.ts +3 -0
- package/locales/hr/index.esm.d.ts +3 -0
- package/locales/hr/index.esm.js +95 -0
- package/locales/hr/index.js +99 -0
- package/locales/hr/package.json +6 -0
- package/package.json +23 -23
- package/src/components/inputs/MRT_FilterTextField.tsx +12 -25
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -4
- package/src/components/toolbar/MRT_TablePagination.tsx +10 -12
- package/src/hooks/useMRT_ColumnVirtualizer.ts +6 -8
- package/src/locales/hr.ts +96 -0
- package/src/types.ts +0 -1
@@ -0,0 +1,95 @@
|
|
1
|
+
const MRT_Localization_HR = {
|
2
|
+
actions: 'Radnje',
|
3
|
+
and: 'i',
|
4
|
+
cancel: 'Odustani',
|
5
|
+
changeFilterMode: 'Promijeni način filtriranja',
|
6
|
+
changeSearchMode: 'Promijeni način pretraživanja',
|
7
|
+
clearFilter: 'Očisti filtriranje',
|
8
|
+
clearSearch: 'Očisti pretragu',
|
9
|
+
clearSelection: 'Očisti odabir',
|
10
|
+
clearSort: 'Očisti sortiranje',
|
11
|
+
clickToCopy: 'Klikni za kopiranje',
|
12
|
+
copy: 'Kopiraj',
|
13
|
+
collapse: 'Sažmi',
|
14
|
+
collapseAll: 'Sažmi sve',
|
15
|
+
columnActions: 'Radnje s stupcima',
|
16
|
+
copiedToClipboard: 'Kopirano u međuspremnik',
|
17
|
+
dropToGroupBy: 'Ispusti za grupiranje po {column}',
|
18
|
+
edit: 'Uredi',
|
19
|
+
expand: 'Proširi',
|
20
|
+
expandAll: 'Proširi sve',
|
21
|
+
filterArrIncludes: 'Uključuje',
|
22
|
+
filterArrIncludesAll: 'Uključuje sve',
|
23
|
+
filterArrIncludesSome: 'Uključuje',
|
24
|
+
filterBetween: 'Između',
|
25
|
+
filterBetweenInclusive: 'Između uključivo',
|
26
|
+
filterByColumn: 'Filtriraj po {column}',
|
27
|
+
filterContains: 'Sadrži',
|
28
|
+
filterEmpty: 'Prazno',
|
29
|
+
filterEndsWith: 'Završava s',
|
30
|
+
filterEquals: 'Jednako',
|
31
|
+
filterEqualsString: 'Jednako',
|
32
|
+
filterFuzzy: 'Maglovito',
|
33
|
+
filterGreaterThan: 'Veće od',
|
34
|
+
filterGreaterThanOrEqualTo: 'Veće od ili jednako',
|
35
|
+
filterInNumberRange: 'Između',
|
36
|
+
filterIncludesString: 'Sadrži',
|
37
|
+
filterIncludesStringSensitive: 'Sadrži',
|
38
|
+
filterLessThan: 'Manje od',
|
39
|
+
filterLessThanOrEqualTo: 'Manje od ili jednako',
|
40
|
+
filterMode: 'Način filtriranja: {filterType}',
|
41
|
+
filterNotEmpty: 'Nije prazno',
|
42
|
+
filterNotEquals: 'Nije jednako',
|
43
|
+
filterStartsWith: 'Počinje s',
|
44
|
+
filterWeakEquals: 'Jednako',
|
45
|
+
filteringByColumn: 'Filtriranje po {column} - {filterType} {filterValue}',
|
46
|
+
goToFirstPage: 'Idi na prvu stranicu',
|
47
|
+
goToLastPage: 'Idi na zadnju stranicu',
|
48
|
+
goToNextPage: 'Idi na sljedeću stranicu',
|
49
|
+
goToPreviousPage: 'Idi na prethodnu stranicu',
|
50
|
+
grab: 'Uhvati',
|
51
|
+
groupByColumn: 'Grupiraj po {column}',
|
52
|
+
groupedBy: 'Grupirano po ',
|
53
|
+
hideAll: 'Sakrij sve',
|
54
|
+
hideColumn: 'Sakrij stupac {column}',
|
55
|
+
max: 'Maks.',
|
56
|
+
min: 'Min.',
|
57
|
+
move: 'Premjesti',
|
58
|
+
noRecordsToDisplay: 'Nema zapisa za prikaz',
|
59
|
+
noResultsFound: 'Nema pronađenih rezultata',
|
60
|
+
of: 'od',
|
61
|
+
or: 'ili',
|
62
|
+
pin: 'Prikači',
|
63
|
+
pinToLeft: 'Prikači na lijevo',
|
64
|
+
pinToRight: 'Prikači na desno',
|
65
|
+
resetColumnSize: 'Resetiraj veličinu stupca',
|
66
|
+
resetOrder: 'Resetiraj redoslijed',
|
67
|
+
rowActions: 'Radnje retka',
|
68
|
+
rowNumber: '#',
|
69
|
+
rowNumbers: 'Brojevi redaka',
|
70
|
+
rowsPerPage: 'Redaka po stranici',
|
71
|
+
save: 'Spremi',
|
72
|
+
search: 'Pretraži',
|
73
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} od {rowCount} odabranih redaka',
|
74
|
+
select: 'Odaberi',
|
75
|
+
showAll: 'Prikaži sve',
|
76
|
+
showAllColumns: 'Prikaži sve stupce',
|
77
|
+
showHideColumns: 'Prikaži/sakrij stupce',
|
78
|
+
showHideFilters: 'Prikaži/sakrij filtere',
|
79
|
+
showHideSearch: 'Prikaži/sakrij pretragu',
|
80
|
+
sortByColumnAsc: 'Sortiraj po {column} uzlazno',
|
81
|
+
sortByColumnDesc: 'Sortiraj po {column} silazno',
|
82
|
+
sortedByColumnAsc: 'Sortirano po {column} uzlazno',
|
83
|
+
sortedByColumnDesc: 'Sortirano po {column} silazno',
|
84
|
+
thenBy: ', zatim po ',
|
85
|
+
toggleDensity: 'Promijeni gustoću',
|
86
|
+
toggleFullScreen: 'Prebaci u puni zaslon',
|
87
|
+
toggleSelectAll: 'Prebaci odabir svih',
|
88
|
+
toggleSelectRow: 'Prebaci odabir retka',
|
89
|
+
toggleVisibility: 'Prebaci vidljivost',
|
90
|
+
ungroupByColumn: 'Razgrupiraj po {column}',
|
91
|
+
unpin: 'Odkači',
|
92
|
+
unpinAll: 'Odkači sve',
|
93
|
+
};
|
94
|
+
|
95
|
+
export { MRT_Localization_HR };
|
@@ -0,0 +1,99 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const MRT_Localization_HR = {
|
6
|
+
actions: 'Radnje',
|
7
|
+
and: 'i',
|
8
|
+
cancel: 'Odustani',
|
9
|
+
changeFilterMode: 'Promijeni način filtriranja',
|
10
|
+
changeSearchMode: 'Promijeni način pretraživanja',
|
11
|
+
clearFilter: 'Očisti filtriranje',
|
12
|
+
clearSearch: 'Očisti pretragu',
|
13
|
+
clearSelection: 'Očisti odabir',
|
14
|
+
clearSort: 'Očisti sortiranje',
|
15
|
+
clickToCopy: 'Klikni za kopiranje',
|
16
|
+
copy: 'Kopiraj',
|
17
|
+
collapse: 'Sažmi',
|
18
|
+
collapseAll: 'Sažmi sve',
|
19
|
+
columnActions: 'Radnje s stupcima',
|
20
|
+
copiedToClipboard: 'Kopirano u međuspremnik',
|
21
|
+
dropToGroupBy: 'Ispusti za grupiranje po {column}',
|
22
|
+
edit: 'Uredi',
|
23
|
+
expand: 'Proširi',
|
24
|
+
expandAll: 'Proširi sve',
|
25
|
+
filterArrIncludes: 'Uključuje',
|
26
|
+
filterArrIncludesAll: 'Uključuje sve',
|
27
|
+
filterArrIncludesSome: 'Uključuje',
|
28
|
+
filterBetween: 'Između',
|
29
|
+
filterBetweenInclusive: 'Između uključivo',
|
30
|
+
filterByColumn: 'Filtriraj po {column}',
|
31
|
+
filterContains: 'Sadrži',
|
32
|
+
filterEmpty: 'Prazno',
|
33
|
+
filterEndsWith: 'Završava s',
|
34
|
+
filterEquals: 'Jednako',
|
35
|
+
filterEqualsString: 'Jednako',
|
36
|
+
filterFuzzy: 'Maglovito',
|
37
|
+
filterGreaterThan: 'Veće od',
|
38
|
+
filterGreaterThanOrEqualTo: 'Veće od ili jednako',
|
39
|
+
filterInNumberRange: 'Između',
|
40
|
+
filterIncludesString: 'Sadrži',
|
41
|
+
filterIncludesStringSensitive: 'Sadrži',
|
42
|
+
filterLessThan: 'Manje od',
|
43
|
+
filterLessThanOrEqualTo: 'Manje od ili jednako',
|
44
|
+
filterMode: 'Način filtriranja: {filterType}',
|
45
|
+
filterNotEmpty: 'Nije prazno',
|
46
|
+
filterNotEquals: 'Nije jednako',
|
47
|
+
filterStartsWith: 'Počinje s',
|
48
|
+
filterWeakEquals: 'Jednako',
|
49
|
+
filteringByColumn: 'Filtriranje po {column} - {filterType} {filterValue}',
|
50
|
+
goToFirstPage: 'Idi na prvu stranicu',
|
51
|
+
goToLastPage: 'Idi na zadnju stranicu',
|
52
|
+
goToNextPage: 'Idi na sljedeću stranicu',
|
53
|
+
goToPreviousPage: 'Idi na prethodnu stranicu',
|
54
|
+
grab: 'Uhvati',
|
55
|
+
groupByColumn: 'Grupiraj po {column}',
|
56
|
+
groupedBy: 'Grupirano po ',
|
57
|
+
hideAll: 'Sakrij sve',
|
58
|
+
hideColumn: 'Sakrij stupac {column}',
|
59
|
+
max: 'Maks.',
|
60
|
+
min: 'Min.',
|
61
|
+
move: 'Premjesti',
|
62
|
+
noRecordsToDisplay: 'Nema zapisa za prikaz',
|
63
|
+
noResultsFound: 'Nema pronađenih rezultata',
|
64
|
+
of: 'od',
|
65
|
+
or: 'ili',
|
66
|
+
pin: 'Prikači',
|
67
|
+
pinToLeft: 'Prikači na lijevo',
|
68
|
+
pinToRight: 'Prikači na desno',
|
69
|
+
resetColumnSize: 'Resetiraj veličinu stupca',
|
70
|
+
resetOrder: 'Resetiraj redoslijed',
|
71
|
+
rowActions: 'Radnje retka',
|
72
|
+
rowNumber: '#',
|
73
|
+
rowNumbers: 'Brojevi redaka',
|
74
|
+
rowsPerPage: 'Redaka po stranici',
|
75
|
+
save: 'Spremi',
|
76
|
+
search: 'Pretraži',
|
77
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} od {rowCount} odabranih redaka',
|
78
|
+
select: 'Odaberi',
|
79
|
+
showAll: 'Prikaži sve',
|
80
|
+
showAllColumns: 'Prikaži sve stupce',
|
81
|
+
showHideColumns: 'Prikaži/sakrij stupce',
|
82
|
+
showHideFilters: 'Prikaži/sakrij filtere',
|
83
|
+
showHideSearch: 'Prikaži/sakrij pretragu',
|
84
|
+
sortByColumnAsc: 'Sortiraj po {column} uzlazno',
|
85
|
+
sortByColumnDesc: 'Sortiraj po {column} silazno',
|
86
|
+
sortedByColumnAsc: 'Sortirano po {column} uzlazno',
|
87
|
+
sortedByColumnDesc: 'Sortirano po {column} silazno',
|
88
|
+
thenBy: ', zatim po ',
|
89
|
+
toggleDensity: 'Promijeni gustoću',
|
90
|
+
toggleFullScreen: 'Prebaci u puni zaslon',
|
91
|
+
toggleSelectAll: 'Prebaci odabir svih',
|
92
|
+
toggleSelectRow: 'Prebaci odabir retka',
|
93
|
+
toggleVisibility: 'Prebaci vidljivost',
|
94
|
+
ungroupByColumn: 'Razgrupiraj po {column}',
|
95
|
+
unpin: 'Odkači',
|
96
|
+
unpinAll: 'Odkači sve',
|
97
|
+
};
|
98
|
+
|
99
|
+
exports.MRT_Localization_HR = MRT_Localization_HR;
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "2.12.
|
2
|
+
"version": "2.12.1",
|
3
3
|
"license": "MIT",
|
4
4
|
"name": "material-react-table",
|
5
5
|
"description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
|
@@ -61,32 +61,32 @@
|
|
61
61
|
"storybook:dev": "storybook dev -p 6006"
|
62
62
|
},
|
63
63
|
"devDependencies": {
|
64
|
-
"@babel/core": "^7.
|
64
|
+
"@babel/core": "^7.24.0",
|
65
65
|
"@babel/preset-react": "^7.23.3",
|
66
|
-
"@emotion/react": "^11.11.
|
66
|
+
"@emotion/react": "^11.11.4",
|
67
67
|
"@emotion/styled": "^11.11.0",
|
68
68
|
"@faker-js/faker": "^8.4.1",
|
69
|
-
"@mui/icons-material": "^5.15.
|
70
|
-
"@mui/material": "^5.15.
|
71
|
-
"@mui/x-date-pickers": "^6.19.
|
69
|
+
"@mui/icons-material": "^5.15.11",
|
70
|
+
"@mui/material": "^5.15.11",
|
71
|
+
"@mui/x-date-pickers": "^6.19.5",
|
72
72
|
"@rollup/plugin-typescript": "^11.1.6",
|
73
73
|
"@size-limit/preset-small-lib": "^11.0.2",
|
74
|
-
"@storybook/addon-a11y": "^7.6.
|
75
|
-
"@storybook/addon-essentials": "^7.6.
|
76
|
-
"@storybook/addon-interactions": "^7.6.
|
77
|
-
"@storybook/addon-links": "^7.6.
|
78
|
-
"@storybook/addon-storysource": "^7.6.
|
79
|
-
"@storybook/blocks": "^7.6.
|
80
|
-
"@storybook/react": "^7.6.
|
81
|
-
"@storybook/react-vite": "^7.6.
|
74
|
+
"@storybook/addon-a11y": "^7.6.17",
|
75
|
+
"@storybook/addon-essentials": "^7.6.17",
|
76
|
+
"@storybook/addon-interactions": "^7.6.17",
|
77
|
+
"@storybook/addon-links": "^7.6.17",
|
78
|
+
"@storybook/addon-storysource": "^7.6.17",
|
79
|
+
"@storybook/blocks": "^7.6.17",
|
80
|
+
"@storybook/react": "^7.6.17",
|
81
|
+
"@storybook/react-vite": "^7.6.17",
|
82
82
|
"@storybook/testing-library": "^0.2.2",
|
83
|
-
"@types/node": "^20.11.
|
84
|
-
"@types/react": "^18.2.
|
83
|
+
"@types/node": "^20.11.22",
|
84
|
+
"@types/react": "^18.2.60",
|
85
85
|
"@types/react-dom": "^18.2.19",
|
86
|
-
"@typescript-eslint/eslint-plugin": "^7.0
|
87
|
-
"@typescript-eslint/parser": "^7.0
|
86
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
87
|
+
"@typescript-eslint/parser": "^7.1.0",
|
88
88
|
"@vitejs/plugin-react": "^4.2.1",
|
89
|
-
"eslint": "^8.
|
89
|
+
"eslint": "^8.57.0",
|
90
90
|
"eslint-plugin-mui-path-imports": "^0.0.15",
|
91
91
|
"eslint-plugin-perfectionist": "^2.5.0",
|
92
92
|
"prop-types": "^15.8.1",
|
@@ -99,11 +99,11 @@
|
|
99
99
|
"rollup-plugin-dts": "^6.1.0",
|
100
100
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
101
101
|
"size-limit": "^11.0.2",
|
102
|
-
"storybook": "^7.6.
|
102
|
+
"storybook": "^7.6.17",
|
103
103
|
"storybook-dark-mode": "^3.0.3",
|
104
104
|
"tslib": "^2.6.2",
|
105
105
|
"typescript": "^5.3.3",
|
106
|
-
"vite": "^5.1.
|
106
|
+
"vite": "^5.1.4"
|
107
107
|
},
|
108
108
|
"peerDependencies": {
|
109
109
|
"@emotion/react": ">=11.11",
|
@@ -116,8 +116,8 @@
|
|
116
116
|
},
|
117
117
|
"dependencies": {
|
118
118
|
"@tanstack/match-sorter-utils": "8.11.8",
|
119
|
-
"@tanstack/react-table": "8.
|
120
|
-
"@tanstack/react-virtual": "3.1.
|
119
|
+
"@tanstack/react-table": "8.13.2",
|
120
|
+
"@tanstack/react-virtual": "3.1.3",
|
121
121
|
"highlight-words": "1.2.2"
|
122
122
|
}
|
123
123
|
}
|
@@ -73,45 +73,32 @@ export const MRT_FilterTextField = <TData extends MRT_RowData>({
|
|
73
73
|
const { columnDef } = column;
|
74
74
|
const { filterVariant } = columnDef;
|
75
75
|
|
76
|
+
const args = { column, rangeFilterIndex, table };
|
77
|
+
|
76
78
|
const textFieldProps: TextFieldProps = {
|
77
|
-
...parseFromValuesOrFunc(muiFilterTextFieldProps,
|
78
|
-
...parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps,
|
79
|
-
column,
|
80
|
-
table,
|
81
|
-
}),
|
79
|
+
...parseFromValuesOrFunc(muiFilterTextFieldProps, args),
|
80
|
+
...parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps, args),
|
82
81
|
...rest,
|
83
82
|
};
|
84
83
|
|
85
84
|
const autocompleteProps = {
|
86
|
-
...parseFromValuesOrFunc(muiFilterAutocompleteProps,
|
87
|
-
...parseFromValuesOrFunc(columnDef.muiFilterAutocompleteProps,
|
88
|
-
column,
|
89
|
-
table,
|
90
|
-
}),
|
85
|
+
...parseFromValuesOrFunc(muiFilterAutocompleteProps, args),
|
86
|
+
...parseFromValuesOrFunc(columnDef.muiFilterAutocompleteProps, args),
|
91
87
|
};
|
92
88
|
|
93
89
|
const datePickerProps: DatePickerProps<any> = {
|
94
|
-
...parseFromValuesOrFunc(muiFilterDatePickerProps,
|
95
|
-
...parseFromValuesOrFunc(columnDef.muiFilterDatePickerProps,
|
96
|
-
column,
|
97
|
-
table,
|
98
|
-
}),
|
90
|
+
...parseFromValuesOrFunc(muiFilterDatePickerProps, args),
|
91
|
+
...parseFromValuesOrFunc(columnDef.muiFilterDatePickerProps, args),
|
99
92
|
};
|
100
93
|
|
101
94
|
const dateTimePickerProps: DateTimePickerProps<any> = {
|
102
|
-
...parseFromValuesOrFunc(muiFilterDateTimePickerProps,
|
103
|
-
...parseFromValuesOrFunc(columnDef.muiFilterDateTimePickerProps,
|
104
|
-
column,
|
105
|
-
table,
|
106
|
-
}),
|
95
|
+
...parseFromValuesOrFunc(muiFilterDateTimePickerProps, args),
|
96
|
+
...parseFromValuesOrFunc(columnDef.muiFilterDateTimePickerProps, args),
|
107
97
|
};
|
108
98
|
|
109
99
|
const timePickerProps: TimePickerProps<any> = {
|
110
|
-
...parseFromValuesOrFunc(muiFilterTimePickerProps,
|
111
|
-
...parseFromValuesOrFunc(columnDef.muiFilterTimePickerProps,
|
112
|
-
column,
|
113
|
-
table,
|
114
|
-
}),
|
100
|
+
...parseFromValuesOrFunc(muiFilterTimePickerProps, args),
|
101
|
+
...parseFromValuesOrFunc(columnDef.muiFilterTimePickerProps, args),
|
115
102
|
};
|
116
103
|
|
117
104
|
const {
|
@@ -56,10 +56,7 @@ export const MRT_ShowHideColumnsMenuItems = <TData extends MRT_RowData>({
|
|
56
56
|
const { columnDef } = column;
|
57
57
|
const { columnDefType } = columnDef;
|
58
58
|
|
59
|
-
const switchChecked =
|
60
|
-
(columnDefType !== 'group' && column.getIsVisible()) ||
|
61
|
-
(columnDefType === 'group' &&
|
62
|
-
column.getLeafColumns().some((col) => col.getIsVisible()));
|
59
|
+
const switchChecked = column.getIsVisible();
|
63
60
|
|
64
61
|
const handleToggleColumnHidden = (column: MRT_Column<TData>) => {
|
65
62
|
if (columnDefType === 'group') {
|
@@ -37,7 +37,6 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
37
37
|
const isMobile = useMediaQuery('(max-width: 720px)');
|
38
38
|
|
39
39
|
const {
|
40
|
-
getPrePaginationRowModel,
|
41
40
|
getState,
|
42
41
|
options: {
|
43
42
|
enableToolbarInternalActions,
|
@@ -45,10 +44,7 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
45
44
|
localization,
|
46
45
|
muiPaginationProps,
|
47
46
|
paginationDisplayMode,
|
48
|
-
rowCount,
|
49
47
|
},
|
50
|
-
setPageIndex,
|
51
|
-
setPageSize,
|
52
48
|
} = table;
|
53
49
|
const {
|
54
50
|
pagination: { pageIndex = 0, pageSize = 10 },
|
@@ -62,8 +58,8 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
62
58
|
...rest,
|
63
59
|
};
|
64
60
|
|
65
|
-
const totalRowCount =
|
66
|
-
const numberOfPages =
|
61
|
+
const totalRowCount = table.getRowCount();
|
62
|
+
const numberOfPages = table.getPageCount();
|
67
63
|
const showFirstLastPageButtons = numberOfPages > 2;
|
68
64
|
const firstRowIndex = pageIndex * pageSize;
|
69
65
|
const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
|
@@ -123,7 +119,9 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
123
119
|
id: 'mrt-rows-per-page',
|
124
120
|
}}
|
125
121
|
label={localization.rowsPerPage}
|
126
|
-
onChange={(event) =>
|
122
|
+
onChange={(event) =>
|
123
|
+
table.setPageSize(+(event.target.value as any))
|
124
|
+
}
|
127
125
|
sx={{ mb: 0 }}
|
128
126
|
value={pageSize}
|
129
127
|
variant="standard"
|
@@ -153,7 +151,7 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
153
151
|
<Pagination
|
154
152
|
count={numberOfPages}
|
155
153
|
disabled={disabled}
|
156
|
-
onChange={(_e, newPageIndex) => setPageIndex(newPageIndex - 1)}
|
154
|
+
onChange={(_e, newPageIndex) => table.setPageIndex(newPageIndex - 1)}
|
157
155
|
page={pageIndex + 1}
|
158
156
|
renderItem={(item) => (
|
159
157
|
<PaginationItem
|
@@ -189,7 +187,7 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
189
187
|
<IconButton
|
190
188
|
aria-label={localization.goToFirstPage}
|
191
189
|
disabled={disableBack}
|
192
|
-
onClick={() =>
|
190
|
+
onClick={() => table.firstPage()}
|
193
191
|
size="small"
|
194
192
|
>
|
195
193
|
<FirstPageIcon {...flipIconStyles(theme)} />
|
@@ -202,7 +200,7 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
202
200
|
<IconButton
|
203
201
|
aria-label={localization.goToPreviousPage}
|
204
202
|
disabled={disableBack}
|
205
|
-
onClick={() =>
|
203
|
+
onClick={() => table.previousPage()}
|
206
204
|
size="small"
|
207
205
|
>
|
208
206
|
<ChevronLeftIcon {...flipIconStyles(theme)} />
|
@@ -214,7 +212,7 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
214
212
|
<IconButton
|
215
213
|
aria-label={localization.goToNextPage}
|
216
214
|
disabled={disableNext}
|
217
|
-
onClick={() =>
|
215
|
+
onClick={() => table.nextPage()}
|
218
216
|
size="small"
|
219
217
|
>
|
220
218
|
<ChevronRightIcon {...flipIconStyles(theme)} />
|
@@ -227,7 +225,7 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
|
|
227
225
|
<IconButton
|
228
226
|
aria-label={localization.goToLastPage}
|
229
227
|
disabled={disableNext}
|
230
|
-
onClick={() =>
|
228
|
+
onClick={() => table.lastPage()}
|
231
229
|
size="small"
|
232
230
|
>
|
233
231
|
<LastPageIcon {...flipIconStyles(theme)} />
|
@@ -16,10 +16,7 @@ export const useMRT_ColumnVirtualizer = <
|
|
16
16
|
table: MRT_TableInstance<TData>,
|
17
17
|
): MRT_ColumnVirtualizer | undefined => {
|
18
18
|
const {
|
19
|
-
getLeftLeafColumns,
|
20
|
-
getRightLeafColumns,
|
21
19
|
getState,
|
22
|
-
getVisibleLeafColumns,
|
23
20
|
options: {
|
24
21
|
columnVirtualizerInstanceRef,
|
25
22
|
columnVirtualizerOptions,
|
@@ -28,7 +25,7 @@ export const useMRT_ColumnVirtualizer = <
|
|
28
25
|
},
|
29
26
|
refs: { tableContainerRef },
|
30
27
|
} = table;
|
31
|
-
const { columnPinning, draggingColumn } = getState();
|
28
|
+
const { columnPinning, columnVisibility, draggingColumn } = getState();
|
32
29
|
|
33
30
|
if (!enableColumnVirtualization) return undefined;
|
34
31
|
|
@@ -39,21 +36,22 @@ export const useMRT_ColumnVirtualizer = <
|
|
39
36
|
},
|
40
37
|
);
|
41
38
|
|
42
|
-
const visibleColumns = getVisibleLeafColumns();
|
39
|
+
const visibleColumns = table.getVisibleLeafColumns();
|
43
40
|
|
44
41
|
const [leftPinnedIndexes, rightPinnedIndexes] = useMemo(
|
45
42
|
() =>
|
46
43
|
enableColumnPinning
|
47
44
|
? [
|
48
|
-
|
49
|
-
|
45
|
+
table.getLeftVisibleLeafColumns().map((c) => c.getPinnedIndex()),
|
46
|
+
table
|
47
|
+
.getRightVisibleLeafColumns()
|
50
48
|
.map(
|
51
49
|
(column) => visibleColumns.length - column.getPinnedIndex() - 1,
|
52
50
|
)
|
53
51
|
.sort((a, b) => a - b),
|
54
52
|
]
|
55
53
|
: [[], []],
|
56
|
-
[columnPinning, enableColumnPinning],
|
54
|
+
[columnPinning, columnVisibility, enableColumnPinning],
|
57
55
|
);
|
58
56
|
|
59
57
|
const numPinnedLeft = leftPinnedIndexes.length;
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import { type MRT_Localization } from '..';
|
2
|
+
|
3
|
+
export const MRT_Localization_HR: MRT_Localization = {
|
4
|
+
actions: 'Radnje',
|
5
|
+
and: 'i',
|
6
|
+
cancel: 'Odustani',
|
7
|
+
changeFilterMode: 'Promijeni način filtriranja',
|
8
|
+
changeSearchMode: 'Promijeni način pretraživanja',
|
9
|
+
clearFilter: 'Očisti filtriranje',
|
10
|
+
clearSearch: 'Očisti pretragu',
|
11
|
+
clearSelection: 'Očisti odabir',
|
12
|
+
clearSort: 'Očisti sortiranje',
|
13
|
+
clickToCopy: 'Klikni za kopiranje',
|
14
|
+
copy: 'Kopiraj',
|
15
|
+
collapse: 'Sažmi',
|
16
|
+
collapseAll: 'Sažmi sve',
|
17
|
+
columnActions: 'Radnje s stupcima',
|
18
|
+
copiedToClipboard: 'Kopirano u međuspremnik',
|
19
|
+
dropToGroupBy: 'Ispusti za grupiranje po {column}',
|
20
|
+
edit: 'Uredi',
|
21
|
+
expand: 'Proširi',
|
22
|
+
expandAll: 'Proširi sve',
|
23
|
+
filterArrIncludes: 'Uključuje',
|
24
|
+
filterArrIncludesAll: 'Uključuje sve',
|
25
|
+
filterArrIncludesSome: 'Uključuje',
|
26
|
+
filterBetween: 'Između',
|
27
|
+
filterBetweenInclusive: 'Između uključivo',
|
28
|
+
filterByColumn: 'Filtriraj po {column}',
|
29
|
+
filterContains: 'Sadrži',
|
30
|
+
filterEmpty: 'Prazno',
|
31
|
+
filterEndsWith: 'Završava s',
|
32
|
+
filterEquals: 'Jednako',
|
33
|
+
filterEqualsString: 'Jednako',
|
34
|
+
filterFuzzy: 'Maglovito',
|
35
|
+
filterGreaterThan: 'Veće od',
|
36
|
+
filterGreaterThanOrEqualTo: 'Veće od ili jednako',
|
37
|
+
filterInNumberRange: 'Između',
|
38
|
+
filterIncludesString: 'Sadrži',
|
39
|
+
filterIncludesStringSensitive: 'Sadrži',
|
40
|
+
filterLessThan: 'Manje od',
|
41
|
+
filterLessThanOrEqualTo: 'Manje od ili jednako',
|
42
|
+
filterMode: 'Način filtriranja: {filterType}',
|
43
|
+
filterNotEmpty: 'Nije prazno',
|
44
|
+
filterNotEquals: 'Nije jednako',
|
45
|
+
filterStartsWith: 'Počinje s',
|
46
|
+
filterWeakEquals: 'Jednako',
|
47
|
+
filteringByColumn: 'Filtriranje po {column} - {filterType} {filterValue}',
|
48
|
+
goToFirstPage: 'Idi na prvu stranicu',
|
49
|
+
goToLastPage: 'Idi na zadnju stranicu',
|
50
|
+
goToNextPage: 'Idi na sljedeću stranicu',
|
51
|
+
goToPreviousPage: 'Idi na prethodnu stranicu',
|
52
|
+
grab: 'Uhvati',
|
53
|
+
groupByColumn: 'Grupiraj po {column}',
|
54
|
+
groupedBy: 'Grupirano po ',
|
55
|
+
hideAll: 'Sakrij sve',
|
56
|
+
hideColumn: 'Sakrij stupac {column}',
|
57
|
+
max: 'Maks.',
|
58
|
+
min: 'Min.',
|
59
|
+
move: 'Premjesti',
|
60
|
+
noRecordsToDisplay: 'Nema zapisa za prikaz',
|
61
|
+
noResultsFound: 'Nema pronađenih rezultata',
|
62
|
+
of: 'od',
|
63
|
+
or: 'ili',
|
64
|
+
pin: 'Prikači',
|
65
|
+
pinToLeft: 'Prikači na lijevo',
|
66
|
+
pinToRight: 'Prikači na desno',
|
67
|
+
resetColumnSize: 'Resetiraj veličinu stupca',
|
68
|
+
resetOrder: 'Resetiraj redoslijed',
|
69
|
+
rowActions: 'Radnje retka',
|
70
|
+
rowNumber: '#',
|
71
|
+
rowNumbers: 'Brojevi redaka',
|
72
|
+
rowsPerPage: 'Redaka po stranici',
|
73
|
+
save: 'Spremi',
|
74
|
+
search: 'Pretraži',
|
75
|
+
selectedCountOfRowCountRowsSelected:
|
76
|
+
'{selectedCount} od {rowCount} odabranih redaka',
|
77
|
+
select: 'Odaberi',
|
78
|
+
showAll: 'Prikaži sve',
|
79
|
+
showAllColumns: 'Prikaži sve stupce',
|
80
|
+
showHideColumns: 'Prikaži/sakrij stupce',
|
81
|
+
showHideFilters: 'Prikaži/sakrij filtere',
|
82
|
+
showHideSearch: 'Prikaži/sakrij pretragu',
|
83
|
+
sortByColumnAsc: 'Sortiraj po {column} uzlazno',
|
84
|
+
sortByColumnDesc: 'Sortiraj po {column} silazno',
|
85
|
+
sortedByColumnAsc: 'Sortirano po {column} uzlazno',
|
86
|
+
sortedByColumnDesc: 'Sortirano po {column} silazno',
|
87
|
+
thenBy: ', zatim po ',
|
88
|
+
toggleDensity: 'Promijeni gustoću',
|
89
|
+
toggleFullScreen: 'Prebaci u puni zaslon',
|
90
|
+
toggleSelectAll: 'Prebaci odabir svih',
|
91
|
+
toggleSelectRow: 'Prebaci odabir retka',
|
92
|
+
toggleVisibility: 'Prebaci vidljivost',
|
93
|
+
ungroupByColumn: 'Razgrupiraj po {column}',
|
94
|
+
unpin: 'Odkači',
|
95
|
+
unpinAll: 'Odkači sve',
|
96
|
+
};
|
package/src/types.ts
CHANGED
@@ -1267,7 +1267,6 @@ export type MRT_TableOptions<TData extends MRT_RowData> = Omit<
|
|
1267
1267
|
renderTopToolbarCustomActions?: (props: {
|
1268
1268
|
table: MRT_TableInstance<TData>;
|
1269
1269
|
}) => ReactNode;
|
1270
|
-
rowCount?: number;
|
1271
1270
|
rowNumberDisplayMode?: 'original' | 'static';
|
1272
1271
|
rowPinningDisplayMode?:
|
1273
1272
|
| 'bottom'
|