@dooherceg/material-react-table 3.2.5 → 3.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/dist/index.d.ts +9 -1
- package/dist/index.esm.js +274 -178
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +274 -178
- package/dist/index.js.map +1 -1
- package/locales/de/index.esm.js +8 -0
- package/locales/de/index.js +8 -0
- package/locales/en/index.esm.js +8 -0
- package/locales/en/index.js +8 -0
- package/locales/fr/index.esm.js +8 -0
- package/locales/fr/index.js +8 -0
- package/locales/hr/index.esm.js +8 -0
- package/locales/hr/index.js +8 -0
- package/locales/nl/index.esm.js +8 -0
- package/locales/nl/index.js +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -433,6 +433,9 @@ interface MRT_Localization {
|
|
|
433
433
|
sortedByColumnDesc: string;
|
|
434
434
|
thenBy: string;
|
|
435
435
|
toggleDensity: string;
|
|
436
|
+
densityCompact: string;
|
|
437
|
+
densityStandard: string;
|
|
438
|
+
densityComfortable: string;
|
|
436
439
|
toggleSelectAll: string;
|
|
437
440
|
toggleSelectRow: string;
|
|
438
441
|
toggleVisibility: string;
|
|
@@ -462,6 +465,11 @@ interface MRT_Localization {
|
|
|
462
465
|
deleteConfirmYes: string;
|
|
463
466
|
deleteConfirmNo: string;
|
|
464
467
|
deleteConfirmDeleting: string;
|
|
468
|
+
errorTitle: string;
|
|
469
|
+
errorMessage: string;
|
|
470
|
+
serverTableErrorTitle: string;
|
|
471
|
+
serverTableErrorMessage: string;
|
|
472
|
+
serverTableErrorRetry: string;
|
|
465
473
|
[key: string]: string;
|
|
466
474
|
}
|
|
467
475
|
interface MRT_Theme {
|
|
@@ -1756,7 +1764,7 @@ type MaterialReactServerTableProps<TData extends MRT_RowData> = Omit<MaterialRea
|
|
|
1756
1764
|
};
|
|
1757
1765
|
declare const MaterialReactServerTable: <TData extends MRT_RowData & {
|
|
1758
1766
|
id: string;
|
|
1759
|
-
}>({ loadConfig, saveState, ...instanceProps }: MaterialReactServerTableProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
1767
|
+
}>({ loadConfig, saveState, localization, ...instanceProps }: MaterialReactServerTableProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
1760
1768
|
|
|
1761
1769
|
type TableInstanceProp<TData extends MRT_RowData> = {
|
|
1762
1770
|
table: MRT_TableInstance<TData>;
|
package/dist/index.esm.js
CHANGED
|
@@ -87,6 +87,7 @@ import { Icon } from '@iconify/react';
|
|
|
87
87
|
import BookmarkAddIcon from '@mui/icons-material/BookmarkAdd';
|
|
88
88
|
import CheckIcon from '@mui/icons-material/Check';
|
|
89
89
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
90
|
+
import ErrorOutlineRoundedIcon from '@mui/icons-material/ErrorOutlineRounded';
|
|
90
91
|
import Paper from '@mui/material/Paper';
|
|
91
92
|
import Collapse from '@mui/material/Collapse';
|
|
92
93
|
import LinearProgress from '@mui/material/LinearProgress';
|
|
@@ -1897,6 +1898,9 @@ const MRT_Localization_EN = {
|
|
|
1897
1898
|
sortedByColumnDesc: 'Sorted by {column} descending',
|
|
1898
1899
|
thenBy: ', then by ',
|
|
1899
1900
|
toggleDensity: 'Density',
|
|
1901
|
+
densityCompact: 'Compact',
|
|
1902
|
+
densityStandard: 'Standard',
|
|
1903
|
+
densityComfortable: 'Comfortable',
|
|
1900
1904
|
toggleFullScreen: 'Toggle full screen',
|
|
1901
1905
|
toggleSelectAll: 'Toggle select all',
|
|
1902
1906
|
toggleSelectRow: 'Toggle select row',
|
|
@@ -1925,6 +1929,11 @@ const MRT_Localization_EN = {
|
|
|
1925
1929
|
deleteConfirmYes: 'Delete',
|
|
1926
1930
|
deleteConfirmNo: 'Cancel',
|
|
1927
1931
|
deleteConfirmDeleting: 'Deleting...',
|
|
1932
|
+
errorTitle: 'Unexpected error',
|
|
1933
|
+
errorMessage: 'An unexpected error occurred. Please try again.',
|
|
1934
|
+
serverTableErrorTitle: 'Unable to load table',
|
|
1935
|
+
serverTableErrorMessage: 'Something went wrong while loading the table configuration. Please try again.',
|
|
1936
|
+
serverTableErrorRetry: 'Try again',
|
|
1928
1937
|
resetState: 'Reset State',
|
|
1929
1938
|
tableOptions: 'Options',
|
|
1930
1939
|
};
|
|
@@ -2411,8 +2420,7 @@ const getMRT_RowSpacerColumnDef = (tableOptions) => {
|
|
|
2411
2420
|
|
|
2412
2421
|
const useMRT_Effects = (table) => {
|
|
2413
2422
|
const { getIsSomeRowsPinned, getPrePaginationRowModel, getState, options: { enablePagination, enableRowPinning, rowCount }, } = table;
|
|
2414
|
-
const {
|
|
2415
|
-
const totalColumnCount = table.options.columns.length;
|
|
2423
|
+
const { density, globalFilter, isLoading, pagination, showSkeletons, sorting, } = getState();
|
|
2416
2424
|
const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
|
|
2417
2425
|
const rerender = useReducer(() => ({}), {})[1];
|
|
2418
2426
|
const initialBodyHeight = useRef(null);
|
|
@@ -2421,12 +2429,6 @@ const useMRT_Effects = (table) => {
|
|
|
2421
2429
|
initialBodyHeight.current = document.body.style.height;
|
|
2422
2430
|
}
|
|
2423
2431
|
}, []);
|
|
2424
|
-
//recalculate column order when columns change or features are toggled on/off
|
|
2425
|
-
useEffect(() => {
|
|
2426
|
-
if (totalColumnCount !== columnOrder.length) {
|
|
2427
|
-
table.setColumnOrder(getDefaultColumnOrderIds(table.options));
|
|
2428
|
-
}
|
|
2429
|
-
}, [totalColumnCount]);
|
|
2430
2432
|
//if page index is out of bounds, set it to the last page
|
|
2431
2433
|
useEffect(() => {
|
|
2432
2434
|
if (!enablePagination || isLoading || showSkeletons)
|
|
@@ -5043,6 +5045,194 @@ const MRT_AdvancedFilters = ({ table, }) => {
|
|
|
5043
5045
|
return jsx(MRT_AdvancedFiltersContent, { table: table });
|
|
5044
5046
|
};
|
|
5045
5047
|
|
|
5048
|
+
const MRT_Localization_HR = {
|
|
5049
|
+
language: 'hr',
|
|
5050
|
+
actions: 'Radnje',
|
|
5051
|
+
and: 'i',
|
|
5052
|
+
booleanFalse: 'Ne',
|
|
5053
|
+
booleanTrue: 'Da',
|
|
5054
|
+
cancel: 'Odustani',
|
|
5055
|
+
close: 'Zatvori',
|
|
5056
|
+
changeFilterMode: 'Promijeni način filtriranja',
|
|
5057
|
+
changeSearchMode: 'Promijeni način pretraživanja',
|
|
5058
|
+
clearFilter: 'Očisti filtriranje',
|
|
5059
|
+
clearSearch: 'Očisti pretragu',
|
|
5060
|
+
clearSelection: 'Očisti odabir',
|
|
5061
|
+
clearSort: 'Očisti sortiranje',
|
|
5062
|
+
deselectAllOnAllPages: 'Poništi odabir na svim stranicama',
|
|
5063
|
+
deselectAllOnCurrentPage: 'Poništi odabir na trenutnoj stranici',
|
|
5064
|
+
clickToCopy: 'Klikni za kopiranje',
|
|
5065
|
+
copy: 'Kopiraj',
|
|
5066
|
+
collapse: 'Sažmi',
|
|
5067
|
+
collapseAll: 'Sažmi sve',
|
|
5068
|
+
columnActions: 'Radnje s stupcima',
|
|
5069
|
+
columns: 'Kolone',
|
|
5070
|
+
copiedToClipboard: 'Kopirano u međuspremnik',
|
|
5071
|
+
dropToGroupBy: 'Ispusti za grupiranje po {column}',
|
|
5072
|
+
edit: 'Uredi',
|
|
5073
|
+
expand: 'Proširi',
|
|
5074
|
+
expandAll: 'Proširi sve',
|
|
5075
|
+
filterArrIncludes: 'Uključuje',
|
|
5076
|
+
filterArrIncludesAll: 'Uključuje sve',
|
|
5077
|
+
filterArrIncludesSome: 'Uključuje',
|
|
5078
|
+
filterBetween: 'Između',
|
|
5079
|
+
filterBetweenInclusive: 'Između uključivo',
|
|
5080
|
+
filterByColumn: 'Filtriraj po {column}',
|
|
5081
|
+
filterFrom: 'Od',
|
|
5082
|
+
filterTo: 'Do',
|
|
5083
|
+
filterContains: 'Sadrži',
|
|
5084
|
+
filterEmpty: 'Prazno',
|
|
5085
|
+
filterEndsWith: 'Završava s',
|
|
5086
|
+
filterEquals: 'Jednako',
|
|
5087
|
+
filterEqualsString: 'Jednako',
|
|
5088
|
+
filterFuzzy: 'Maglovito',
|
|
5089
|
+
filterGreaterThan: 'Veće od',
|
|
5090
|
+
filterGreaterThanOrEqualTo: 'Veće od ili jednako',
|
|
5091
|
+
filterInArray: 'Je jedno od',
|
|
5092
|
+
filterIsAnyOf: 'Je jedno od',
|
|
5093
|
+
filterInNumberRange: 'Između',
|
|
5094
|
+
filterIncludesString: 'Sadrži',
|
|
5095
|
+
filterIncludesStringSensitive: 'Sadrži',
|
|
5096
|
+
filterLessThan: 'Manje od',
|
|
5097
|
+
filterLessThanOrEqualTo: 'Manje od ili jednako',
|
|
5098
|
+
filterMode: 'Način filtriranja: {filterType}',
|
|
5099
|
+
filterNoOptions: 'Nema dostupnih opcija za filtriranje',
|
|
5100
|
+
filterNotEmpty: 'Nije prazno',
|
|
5101
|
+
filterNotEquals: 'Nije jednako',
|
|
5102
|
+
filterNotContains: 'Ne sadrži',
|
|
5103
|
+
filterLogic: 'Logika',
|
|
5104
|
+
filterOperator: 'Operator',
|
|
5105
|
+
filterStartsWith: 'Počinje s',
|
|
5106
|
+
filterWeakEquals: 'Jednako',
|
|
5107
|
+
filterCurrentWeek: 'Trenutni tjedan',
|
|
5108
|
+
filterCurrentMonth: 'Trenutni mjesec',
|
|
5109
|
+
filterLast7Days: 'Zadnjih 7 dana',
|
|
5110
|
+
filterLastWeek: 'Prošli tjedan',
|
|
5111
|
+
filterLastMonth: 'Prošli mjesec',
|
|
5112
|
+
filterFromToday: 'Od danas',
|
|
5113
|
+
filterToToday: 'Do danas',
|
|
5114
|
+
filteringByColumn: 'Filtriranje po {column} - {filterType} {filterValue}',
|
|
5115
|
+
goToFirstPage: 'Idi na prvu stranicu',
|
|
5116
|
+
goToLastPage: 'Idi na zadnju stranicu',
|
|
5117
|
+
goToNextPage: 'Idi na sljedeću stranicu',
|
|
5118
|
+
goToPreviousPage: 'Idi na prethodnu stranicu',
|
|
5119
|
+
grab: 'Uhvati',
|
|
5120
|
+
groupByColumn: 'Grupiraj po {column}',
|
|
5121
|
+
groupedBy: 'Grupirano po ',
|
|
5122
|
+
hideAll: 'Sakrij sve',
|
|
5123
|
+
hideColumn: 'Sakrij stupac {column}',
|
|
5124
|
+
max: 'Maks.',
|
|
5125
|
+
min: 'Min.',
|
|
5126
|
+
move: 'Premjesti',
|
|
5127
|
+
noRecordsToDisplay: 'Nema zapisa za prikaz',
|
|
5128
|
+
noResultsFound: 'Nema pronađenih rezultata',
|
|
5129
|
+
moreThan: 'više od',
|
|
5130
|
+
of: 'od',
|
|
5131
|
+
or: 'ili',
|
|
5132
|
+
pin: 'Prikači',
|
|
5133
|
+
pinToLeft: 'Prikači na lijevo',
|
|
5134
|
+
pinToRight: 'Prikači na desno',
|
|
5135
|
+
resetColumnSize: 'Resetiraj veličinu stupca',
|
|
5136
|
+
resetOrder: 'Resetiraj redoslijed',
|
|
5137
|
+
rowActions: 'Radnje retka',
|
|
5138
|
+
rowNumber: '#',
|
|
5139
|
+
countRows: 'Izbroji redove',
|
|
5140
|
+
countRowsTooltip: 'Izbroji ukupan broj redova za trenutne filtere',
|
|
5141
|
+
rowCount: 'Broj redova',
|
|
5142
|
+
rowNumbers: 'Brojevi redaka',
|
|
5143
|
+
rowsPerPage: 'Redaka po stranici',
|
|
5144
|
+
rowsSelected: '{count} odabranih redova',
|
|
5145
|
+
save: 'Spremi',
|
|
5146
|
+
search: 'Pretraži',
|
|
5147
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} od {rowCount} odabranih redaka',
|
|
5148
|
+
select: 'Odaberi',
|
|
5149
|
+
selectAllOnAllPages: 'Odaberi sve na svim stranicama',
|
|
5150
|
+
selectAllOnCurrentPage: 'Odaberi sve na trenutnoj stranici',
|
|
5151
|
+
showAll: 'Prikaži sve',
|
|
5152
|
+
showAllColumns: 'Prikaži sve stupce',
|
|
5153
|
+
showHideColumns: 'Kolone',
|
|
5154
|
+
showHideFilters: 'Prikaži/sakrij filtere',
|
|
5155
|
+
showHideSearch: 'Prikaži/sakrij pretragu',
|
|
5156
|
+
showAdvancedFilters: 'Prikaži napredne filtere',
|
|
5157
|
+
advancedFilters: 'Napredni filteri',
|
|
5158
|
+
filters: 'Filteri',
|
|
5159
|
+
add: 'Dodaj',
|
|
5160
|
+
newEntry: 'Novi unos',
|
|
5161
|
+
clear: 'Očisti',
|
|
5162
|
+
discardChanges: 'Odbaci izmjene',
|
|
5163
|
+
saveFilters: 'Spremi filtere',
|
|
5164
|
+
savedFilters: 'Spremljeni filteri',
|
|
5165
|
+
noSavedFilters: 'Nema spremljenih filtera',
|
|
5166
|
+
filterName: 'Naziv filtera',
|
|
5167
|
+
apply: 'Primijeni',
|
|
5168
|
+
sortByColumnAsc: 'Sortiraj po {column} uzlazno',
|
|
5169
|
+
sortByColumnDesc: 'Sortiraj po {column} silazno',
|
|
5170
|
+
sortedByColumnAsc: 'Sortirano po {column} uzlazno',
|
|
5171
|
+
sortedByColumnDesc: 'Sortirano po {column} silazno',
|
|
5172
|
+
thenBy: ', zatim po ',
|
|
5173
|
+
toggleDensity: 'Gustoća',
|
|
5174
|
+
densityCompact: 'Kompaktan',
|
|
5175
|
+
densityStandard: 'Standard',
|
|
5176
|
+
densityComfortable: 'Udobno',
|
|
5177
|
+
toggleFullScreen: 'Prebaci u puni zaslon',
|
|
5178
|
+
toggleSelectAll: 'Prebaci odabir svih',
|
|
5179
|
+
toggleSelectRow: 'Prebaci odabir retka',
|
|
5180
|
+
toggleVisibility: 'Prebaci vidljivost',
|
|
5181
|
+
ungroupByColumn: 'Razgrupiraj po {column}',
|
|
5182
|
+
unpin: 'Odkači',
|
|
5183
|
+
unpinAll: 'Odkači sve',
|
|
5184
|
+
dimensionRotationEnabled: 'Rotacija ukljucena',
|
|
5185
|
+
dimensionRotationDisabled: 'Rotacija iskljucena',
|
|
5186
|
+
length: 'Dužina',
|
|
5187
|
+
width: 'Širina',
|
|
5188
|
+
height: 'Visina',
|
|
5189
|
+
depth: 'Dubina',
|
|
5190
|
+
tolerance: 'Tolerancija',
|
|
5191
|
+
exportButton: 'Izvoz',
|
|
5192
|
+
exportSelectRowsTooltip: 'Odaberite redove za izvoz',
|
|
5193
|
+
exportPrintPdf: 'Ispis PDF',
|
|
5194
|
+
exportDownload: 'Preuzmi',
|
|
5195
|
+
exportGrouped: 'Grupirati datoteke',
|
|
5196
|
+
exportInProgress: 'Izvoz u toku...',
|
|
5197
|
+
exportSuccess: 'Izvoz je uspješno završen.',
|
|
5198
|
+
exportError: 'Izvoz nije uspio. Pokušajte ponovo.',
|
|
5199
|
+
exportNoExportsSelected: 'Nije odabran tip izvoza. Molimo odaberite izvoz iz gornje trake.',
|
|
5200
|
+
deleteConfirmationTitle: 'Brisanje reda',
|
|
5201
|
+
deleteConfirmationMessage: 'Da li ste sigurni da želite izbrisati ovaj red?',
|
|
5202
|
+
deleteConfirmYes: 'Izbriši',
|
|
5203
|
+
deleteConfirmNo: 'Odustani',
|
|
5204
|
+
deleteConfirmDeleting: 'Brisanje...',
|
|
5205
|
+
errorTitle: 'Neočekivana greška',
|
|
5206
|
+
errorMessage: 'Došlo je do neočekivane pogreške. Pokušajte ponovno.',
|
|
5207
|
+
serverTableErrorTitle: 'Učitavanje tablice nije uspjelo',
|
|
5208
|
+
serverTableErrorMessage: 'Došlo je do pogreške prilikom učitavanja konfiguracije tablice. Pokušajte ponovno.',
|
|
5209
|
+
serverTableErrorRetry: 'Pokušaj ponovno',
|
|
5210
|
+
resetState: 'Resetuj stanje',
|
|
5211
|
+
tableOptions: 'Opcije',
|
|
5212
|
+
};
|
|
5213
|
+
|
|
5214
|
+
const MaterialReactServerTableError = ({ description, localization = MRT_Localization_HR, title, }) => (jsxs(Paper, { "data-testid": "server-table-error", sx: {
|
|
5215
|
+
alignItems: 'center',
|
|
5216
|
+
display: 'flex',
|
|
5217
|
+
flexDirection: 'column',
|
|
5218
|
+
gap: '1rem',
|
|
5219
|
+
height: '100%',
|
|
5220
|
+
justifyContent: 'center',
|
|
5221
|
+
minHeight: '12rem',
|
|
5222
|
+
px: '2rem',
|
|
5223
|
+
py: '3rem',
|
|
5224
|
+
textAlign: 'center',
|
|
5225
|
+
}, children: [jsx(Box, { sx: (theme) => ({
|
|
5226
|
+
alignItems: 'center',
|
|
5227
|
+
backgroundColor: theme.palette.error.main + '14',
|
|
5228
|
+
borderRadius: '50%',
|
|
5229
|
+
color: theme.palette.error.main,
|
|
5230
|
+
display: 'flex',
|
|
5231
|
+
height: '4rem',
|
|
5232
|
+
justifyContent: 'center',
|
|
5233
|
+
width: '4rem',
|
|
5234
|
+
}), children: jsx(ErrorOutlineRoundedIcon, { sx: { fontSize: '2.25rem' } }) }), jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '0.35rem' }, children: [jsx(Typography, { fontWeight: 600, variant: "h6", children: title !== null && title !== void 0 ? title : localization.errorTitle }), jsx(Typography, { color: "text.secondary", sx: { maxWidth: '28rem' }, variant: "body2", children: description !== null && description !== void 0 ? description : localization.errorMessage })] })] }));
|
|
5235
|
+
|
|
5046
5236
|
function RowActionsCell({ row, table, }) {
|
|
5047
5237
|
const { actions } = table.options;
|
|
5048
5238
|
return (jsx(Box, { children: actions === null || actions === void 0 ? void 0 : actions.map((action) => {
|
|
@@ -5955,25 +6145,67 @@ const MRT_ToggleAdvancedFiltersButton = (_a) => {
|
|
|
5955
6145
|
return (jsx(MRT_AdvancedFiltersProvider, { initialOpen: initialOpen, setterRef: table._showAdvancedFiltersSetterRef, children: jsx(MRT_ToggleAdvancedFiltersButtonInner, Object.assign({ table: table }, rest)) }));
|
|
5956
6146
|
};
|
|
5957
6147
|
|
|
6148
|
+
const getDensityOptions = ({ icons: { DensityLargeIcon, DensityMediumIcon, DensitySmallIcon }, localization, }) => [
|
|
6149
|
+
{
|
|
6150
|
+
Icon: DensitySmallIcon,
|
|
6151
|
+
label: localization.densityCompact,
|
|
6152
|
+
value: 'compact',
|
|
6153
|
+
},
|
|
6154
|
+
{
|
|
6155
|
+
Icon: DensityMediumIcon,
|
|
6156
|
+
label: localization.densityStandard,
|
|
6157
|
+
value: 'comfortable',
|
|
6158
|
+
},
|
|
6159
|
+
{
|
|
6160
|
+
Icon: DensityLargeIcon,
|
|
6161
|
+
label: localization.densityComfortable,
|
|
6162
|
+
value: 'spacious',
|
|
6163
|
+
},
|
|
6164
|
+
];
|
|
6165
|
+
|
|
6166
|
+
const MRT_ToggleDensePaddingMenu = (_a) => {
|
|
6167
|
+
var { anchorEl, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "setAnchorEl", "table"]);
|
|
6168
|
+
const { getState, options: { icons, localization }, setDensity, } = table;
|
|
6169
|
+
const { density } = getState();
|
|
6170
|
+
const handleCloseMenu = () => {
|
|
6171
|
+
setAnchorEl(null);
|
|
6172
|
+
};
|
|
6173
|
+
const handleSelectDensity = (nextDensity) => {
|
|
6174
|
+
setDensity(nextDensity);
|
|
6175
|
+
handleCloseMenu();
|
|
6176
|
+
};
|
|
6177
|
+
const densityOptions = getDensityOptions({ icons, localization });
|
|
6178
|
+
return (jsx(Menu, Object.assign({ id: "mrt-density-menu", anchorEl: anchorEl, open: !!anchorEl, onClose: handleCloseMenu, anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'left' } }, rest, { children: densityOptions.map(({ Icon, label, value }) => (jsxs(MenuItem, { onClick: () => handleSelectDensity(value), selected: density === value, sx: {
|
|
6179
|
+
borderRadius: '4px',
|
|
6180
|
+
'&.Mui-selected': {
|
|
6181
|
+
backgroundColor: 'action.selected',
|
|
6182
|
+
},
|
|
6183
|
+
'&.Mui-selected:hover': {
|
|
6184
|
+
backgroundColor: 'action.hover',
|
|
6185
|
+
},
|
|
6186
|
+
}, children: [jsx(ListItemIcon, { sx: { color: 'text.primary', marginRight: '0px' }, children: jsx(Icon, {}) }), jsx(ListItemText, { primary: label, slotProps: {
|
|
6187
|
+
primary: {
|
|
6188
|
+
fontSize: '0.875rem',
|
|
6189
|
+
fontWeight: 600,
|
|
6190
|
+
},
|
|
6191
|
+
} })] }, value))) })));
|
|
6192
|
+
};
|
|
6193
|
+
|
|
5958
6194
|
const MRT_ToggleDensePaddingButton = (_a) => {
|
|
5959
6195
|
var _b;
|
|
5960
6196
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
5961
|
-
const { getState, options: { icons: { DensityLargeIcon, DensityMediumIcon, DensitySmallIcon }, localization, },
|
|
6197
|
+
const { getState, options: { icons: { DensityLargeIcon, DensityMediumIcon, DensitySmallIcon }, localization, }, } = table;
|
|
5962
6198
|
const { density } = getState();
|
|
5963
|
-
const
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
: density === 'compact'
|
|
5967
|
-
? 'spacious'
|
|
5968
|
-
: 'comfortable';
|
|
5969
|
-
setDensity(nextDensity);
|
|
6199
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
6200
|
+
const handleOpenMenu = (event) => {
|
|
6201
|
+
setAnchorEl(event.currentTarget);
|
|
5970
6202
|
};
|
|
5971
6203
|
const DensityIcon = density === 'compact'
|
|
5972
6204
|
? DensitySmallIcon
|
|
5973
6205
|
: density === 'comfortable'
|
|
5974
6206
|
? DensityMediumIcon
|
|
5975
6207
|
: DensityLargeIcon;
|
|
5976
|
-
return (jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity, children: jsx(Button, Object.assign({ "aria-label": localization.toggleDensity, onClick:
|
|
6208
|
+
return (jsxs(Fragment, { children: [jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity, children: jsx(Button, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleOpenMenu, size: "small", startIcon: jsx(DensityIcon, { fontSize: "small" }), variant: "text" }, rest, { title: undefined, children: localization.toggleDensity })) }), anchorEl && (jsx(MRT_ToggleDensePaddingMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))] }));
|
|
5977
6209
|
};
|
|
5978
6210
|
|
|
5979
6211
|
const MRT_ToggleFiltersButton = (_a) => {
|
|
@@ -7938,164 +8170,6 @@ const useServerTableState = ({ initialState, saveState, saveDebounceMs = 500, })
|
|
|
7938
8170
|
};
|
|
7939
8171
|
};
|
|
7940
8172
|
|
|
7941
|
-
const MRT_Localization_HR = {
|
|
7942
|
-
language: 'hr',
|
|
7943
|
-
actions: 'Radnje',
|
|
7944
|
-
and: 'i',
|
|
7945
|
-
booleanFalse: 'Ne',
|
|
7946
|
-
booleanTrue: 'Da',
|
|
7947
|
-
cancel: 'Odustani',
|
|
7948
|
-
close: 'Zatvori',
|
|
7949
|
-
changeFilterMode: 'Promijeni način filtriranja',
|
|
7950
|
-
changeSearchMode: 'Promijeni način pretraživanja',
|
|
7951
|
-
clearFilter: 'Očisti filtriranje',
|
|
7952
|
-
clearSearch: 'Očisti pretragu',
|
|
7953
|
-
clearSelection: 'Očisti odabir',
|
|
7954
|
-
clearSort: 'Očisti sortiranje',
|
|
7955
|
-
deselectAllOnAllPages: 'Poništi odabir na svim stranicama',
|
|
7956
|
-
deselectAllOnCurrentPage: 'Poništi odabir na trenutnoj stranici',
|
|
7957
|
-
clickToCopy: 'Klikni za kopiranje',
|
|
7958
|
-
copy: 'Kopiraj',
|
|
7959
|
-
collapse: 'Sažmi',
|
|
7960
|
-
collapseAll: 'Sažmi sve',
|
|
7961
|
-
columnActions: 'Radnje s stupcima',
|
|
7962
|
-
columns: 'Kolone',
|
|
7963
|
-
copiedToClipboard: 'Kopirano u međuspremnik',
|
|
7964
|
-
dropToGroupBy: 'Ispusti za grupiranje po {column}',
|
|
7965
|
-
edit: 'Uredi',
|
|
7966
|
-
expand: 'Proširi',
|
|
7967
|
-
expandAll: 'Proširi sve',
|
|
7968
|
-
filterArrIncludes: 'Uključuje',
|
|
7969
|
-
filterArrIncludesAll: 'Uključuje sve',
|
|
7970
|
-
filterArrIncludesSome: 'Uključuje',
|
|
7971
|
-
filterBetween: 'Između',
|
|
7972
|
-
filterBetweenInclusive: 'Između uključivo',
|
|
7973
|
-
filterByColumn: 'Filtriraj po {column}',
|
|
7974
|
-
filterFrom: 'Od',
|
|
7975
|
-
filterTo: 'Do',
|
|
7976
|
-
filterContains: 'Sadrži',
|
|
7977
|
-
filterEmpty: 'Prazno',
|
|
7978
|
-
filterEndsWith: 'Završava s',
|
|
7979
|
-
filterEquals: 'Jednako',
|
|
7980
|
-
filterEqualsString: 'Jednako',
|
|
7981
|
-
filterFuzzy: 'Maglovito',
|
|
7982
|
-
filterGreaterThan: 'Veće od',
|
|
7983
|
-
filterGreaterThanOrEqualTo: 'Veće od ili jednako',
|
|
7984
|
-
filterInArray: 'Je jedno od',
|
|
7985
|
-
filterIsAnyOf: 'Je jedno od',
|
|
7986
|
-
filterInNumberRange: 'Između',
|
|
7987
|
-
filterIncludesString: 'Sadrži',
|
|
7988
|
-
filterIncludesStringSensitive: 'Sadrži',
|
|
7989
|
-
filterLessThan: 'Manje od',
|
|
7990
|
-
filterLessThanOrEqualTo: 'Manje od ili jednako',
|
|
7991
|
-
filterMode: 'Način filtriranja: {filterType}',
|
|
7992
|
-
filterNoOptions: 'Nema dostupnih opcija za filtriranje',
|
|
7993
|
-
filterNotEmpty: 'Nije prazno',
|
|
7994
|
-
filterNotEquals: 'Nije jednako',
|
|
7995
|
-
filterNotContains: 'Ne sadrži',
|
|
7996
|
-
filterLogic: 'Logika',
|
|
7997
|
-
filterOperator: 'Operator',
|
|
7998
|
-
filterStartsWith: 'Počinje s',
|
|
7999
|
-
filterWeakEquals: 'Jednako',
|
|
8000
|
-
filterCurrentWeek: 'Trenutni tjedan',
|
|
8001
|
-
filterCurrentMonth: 'Trenutni mjesec',
|
|
8002
|
-
filterLast7Days: 'Zadnjih 7 dana',
|
|
8003
|
-
filterLastWeek: 'Prošli tjedan',
|
|
8004
|
-
filterLastMonth: 'Prošli mjesec',
|
|
8005
|
-
filterFromToday: 'Od danas',
|
|
8006
|
-
filterToToday: 'Do danas',
|
|
8007
|
-
filteringByColumn: 'Filtriranje po {column} - {filterType} {filterValue}',
|
|
8008
|
-
goToFirstPage: 'Idi na prvu stranicu',
|
|
8009
|
-
goToLastPage: 'Idi na zadnju stranicu',
|
|
8010
|
-
goToNextPage: 'Idi na sljedeću stranicu',
|
|
8011
|
-
goToPreviousPage: 'Idi na prethodnu stranicu',
|
|
8012
|
-
grab: 'Uhvati',
|
|
8013
|
-
groupByColumn: 'Grupiraj po {column}',
|
|
8014
|
-
groupedBy: 'Grupirano po ',
|
|
8015
|
-
hideAll: 'Sakrij sve',
|
|
8016
|
-
hideColumn: 'Sakrij stupac {column}',
|
|
8017
|
-
max: 'Maks.',
|
|
8018
|
-
min: 'Min.',
|
|
8019
|
-
move: 'Premjesti',
|
|
8020
|
-
noRecordsToDisplay: 'Nema zapisa za prikaz',
|
|
8021
|
-
noResultsFound: 'Nema pronađenih rezultata',
|
|
8022
|
-
moreThan: 'više od',
|
|
8023
|
-
of: 'od',
|
|
8024
|
-
or: 'ili',
|
|
8025
|
-
pin: 'Prikači',
|
|
8026
|
-
pinToLeft: 'Prikači na lijevo',
|
|
8027
|
-
pinToRight: 'Prikači na desno',
|
|
8028
|
-
resetColumnSize: 'Resetiraj veličinu stupca',
|
|
8029
|
-
resetOrder: 'Resetiraj redoslijed',
|
|
8030
|
-
rowActions: 'Radnje retka',
|
|
8031
|
-
rowNumber: '#',
|
|
8032
|
-
countRows: 'Izbroji redove',
|
|
8033
|
-
countRowsTooltip: 'Izbroji ukupan broj redova za trenutne filtere',
|
|
8034
|
-
rowCount: 'Broj redova',
|
|
8035
|
-
rowNumbers: 'Brojevi redaka',
|
|
8036
|
-
rowsPerPage: 'Redaka po stranici',
|
|
8037
|
-
rowsSelected: '{count} odabranih redova',
|
|
8038
|
-
save: 'Spremi',
|
|
8039
|
-
search: 'Pretraži',
|
|
8040
|
-
selectedCountOfRowCountRowsSelected: '{selectedCount} od {rowCount} odabranih redaka',
|
|
8041
|
-
select: 'Odaberi',
|
|
8042
|
-
selectAllOnAllPages: 'Odaberi sve na svim stranicama',
|
|
8043
|
-
selectAllOnCurrentPage: 'Odaberi sve na trenutnoj stranici',
|
|
8044
|
-
showAll: 'Prikaži sve',
|
|
8045
|
-
showAllColumns: 'Prikaži sve stupce',
|
|
8046
|
-
showHideColumns: 'Kolone',
|
|
8047
|
-
showHideFilters: 'Prikaži/sakrij filtere',
|
|
8048
|
-
showHideSearch: 'Prikaži/sakrij pretragu',
|
|
8049
|
-
showAdvancedFilters: 'Prikaži napredne filtere',
|
|
8050
|
-
advancedFilters: 'Napredni filteri',
|
|
8051
|
-
filters: 'Filteri',
|
|
8052
|
-
add: 'Dodaj',
|
|
8053
|
-
newEntry: 'Novi unos',
|
|
8054
|
-
clear: 'Očisti',
|
|
8055
|
-
discardChanges: 'Odbaci izmjene',
|
|
8056
|
-
saveFilters: 'Spremi filtere',
|
|
8057
|
-
savedFilters: 'Spremljeni filteri',
|
|
8058
|
-
noSavedFilters: 'Nema spremljenih filtera',
|
|
8059
|
-
filterName: 'Naziv filtera',
|
|
8060
|
-
apply: 'Primijeni',
|
|
8061
|
-
sortByColumnAsc: 'Sortiraj po {column} uzlazno',
|
|
8062
|
-
sortByColumnDesc: 'Sortiraj po {column} silazno',
|
|
8063
|
-
sortedByColumnAsc: 'Sortirano po {column} uzlazno',
|
|
8064
|
-
sortedByColumnDesc: 'Sortirano po {column} silazno',
|
|
8065
|
-
thenBy: ', zatim po ',
|
|
8066
|
-
toggleDensity: 'Gustoća',
|
|
8067
|
-
toggleFullScreen: 'Prebaci u puni zaslon',
|
|
8068
|
-
toggleSelectAll: 'Prebaci odabir svih',
|
|
8069
|
-
toggleSelectRow: 'Prebaci odabir retka',
|
|
8070
|
-
toggleVisibility: 'Prebaci vidljivost',
|
|
8071
|
-
ungroupByColumn: 'Razgrupiraj po {column}',
|
|
8072
|
-
unpin: 'Odkači',
|
|
8073
|
-
unpinAll: 'Odkači sve',
|
|
8074
|
-
dimensionRotationEnabled: 'Rotacija ukljucena',
|
|
8075
|
-
dimensionRotationDisabled: 'Rotacija iskljucena',
|
|
8076
|
-
length: 'Dužina',
|
|
8077
|
-
width: 'Širina',
|
|
8078
|
-
height: 'Visina',
|
|
8079
|
-
depth: 'Dubina',
|
|
8080
|
-
tolerance: 'Tolerancija',
|
|
8081
|
-
exportButton: 'Izvoz',
|
|
8082
|
-
exportSelectRowsTooltip: 'Odaberite redove za izvoz',
|
|
8083
|
-
exportPrintPdf: 'Ispis PDF',
|
|
8084
|
-
exportDownload: 'Preuzmi',
|
|
8085
|
-
exportGrouped: 'Grupirati datoteke',
|
|
8086
|
-
exportInProgress: 'Izvoz u toku...',
|
|
8087
|
-
exportSuccess: 'Izvoz je uspješno završen.',
|
|
8088
|
-
exportError: 'Izvoz nije uspio. Pokušajte ponovo.',
|
|
8089
|
-
exportNoExportsSelected: 'Nije odabran tip izvoza. Molimo odaberite izvoz iz gornje trake.',
|
|
8090
|
-
deleteConfirmationTitle: 'Brisanje reda',
|
|
8091
|
-
deleteConfirmationMessage: 'Da li ste sigurni da želite izbrisati ovaj red?',
|
|
8092
|
-
deleteConfirmYes: 'Izbriši',
|
|
8093
|
-
deleteConfirmNo: 'Odustani',
|
|
8094
|
-
deleteConfirmDeleting: 'Brisanje...',
|
|
8095
|
-
resetState: 'Resetuj stanje',
|
|
8096
|
-
tableOptions: 'Opcije',
|
|
8097
|
-
};
|
|
8098
|
-
|
|
8099
8173
|
function createColumnDef(column) {
|
|
8100
8174
|
if (column.type === 'object' || column.type === 'actions') {
|
|
8101
8175
|
return column;
|
|
@@ -8215,8 +8289,30 @@ const MaterialReactServerTableInstance = (_a) => {
|
|
|
8215
8289
|
return jsx(MaterialReactTable, { table: table });
|
|
8216
8290
|
};
|
|
8217
8291
|
|
|
8292
|
+
const MaterialReactServerTableSkeleton = () => (jsxs(Paper, { "data-testid": "server-table-skeleton", sx: {
|
|
8293
|
+
display: 'flex',
|
|
8294
|
+
flexDirection: 'column',
|
|
8295
|
+
height: '100%',
|
|
8296
|
+
}, children: [jsxs(Box, { sx: (theme) => ({
|
|
8297
|
+
alignItems: 'center',
|
|
8298
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
8299
|
+
display: 'flex',
|
|
8300
|
+
height: '4rem',
|
|
8301
|
+
justifyContent: 'space-between',
|
|
8302
|
+
paddingLeft: '1.3rem',
|
|
8303
|
+
paddingRight: '0.3rem',
|
|
8304
|
+
}), children: [jsxs(Box, { sx: { alignItems: 'center', display: 'flex', gap: '0.5rem' }, children: [jsx(Skeleton, { animation: "wave", height: 30, variant: "rounded", width: 73 }), jsx(Skeleton, { animation: "wave", height: 30, variant: "rounded", width: 80 }), jsx(Skeleton, { animation: "wave", height: 30, variant: "rounded", width: 67 }), jsx(Skeleton, { animation: "wave", height: 30, variant: "rounded", width: 135 })] }), jsx(Box, { sx: { alignItems: 'center', display: 'flex', gap: '0.5rem' }, children: jsx(Skeleton, { animation: "wave", height: 24, variant: "circular", width: 24 }) })] }), jsx(Box, { sx: { display: 'flex', flex: 1, padding: '1.3rem' }, children: jsx(Skeleton, { animation: "wave", variant: "rounded", sx: { flex: 1, height: '100%' } }) }), jsx(Box, { sx: (theme) => ({
|
|
8305
|
+
alignItems: 'center',
|
|
8306
|
+
borderTop: `1px solid ${theme.palette.divider}`,
|
|
8307
|
+
display: 'flex',
|
|
8308
|
+
height: '3.30rem',
|
|
8309
|
+
justifyContent: 'flex-end',
|
|
8310
|
+
px: '1.3rem',
|
|
8311
|
+
}), children: jsxs(Box, { sx: { alignItems: 'center', display: 'flex', gap: '1rem' }, children: [jsx(Skeleton, { animation: "wave", height: 36, variant: "rounded", width: 136 }), jsx(Skeleton, { animation: "wave", height: 31, variant: "text", width: 176 }), jsx(Skeleton, { animation: "wave", height: 22, variant: "text", width: 70 }), jsx(Skeleton, { animation: "wave", height: 24, variant: "circular", width: 24 }), jsx(Skeleton, { animation: "wave", height: 24, variant: "circular", width: 24 })] }) })] }));
|
|
8312
|
+
|
|
8218
8313
|
const MaterialReactServerTable = (_a) => {
|
|
8219
|
-
var { loadConfig, saveState } = _a, instanceProps = __rest(_a, ["loadConfig", "saveState"]);
|
|
8314
|
+
var { loadConfig, saveState, localization } = _a, instanceProps = __rest(_a, ["loadConfig", "saveState", "localization"]);
|
|
8315
|
+
const mergedLocalization = Object.assign(Object.assign({}, MRT_Localization_HR), localization);
|
|
8220
8316
|
const [configLoading, setConfigLoading] = useState(true);
|
|
8221
8317
|
const [config, setConfig] = useState(null);
|
|
8222
8318
|
useEffect(() => {
|
|
@@ -8245,10 +8341,10 @@ const MaterialReactServerTable = (_a) => {
|
|
|
8245
8341
|
};
|
|
8246
8342
|
}, [loadConfig]);
|
|
8247
8343
|
if (configLoading) {
|
|
8248
|
-
return jsx(
|
|
8344
|
+
return jsx(MaterialReactServerTableSkeleton, {});
|
|
8249
8345
|
}
|
|
8250
8346
|
if (!config) {
|
|
8251
|
-
return jsx(
|
|
8347
|
+
return (jsx(MaterialReactServerTableError, { description: mergedLocalization.serverTableErrorMessage }));
|
|
8252
8348
|
}
|
|
8253
8349
|
return (jsx(MaterialReactServerTableInstance, Object.assign({ config: config, saveState: saveState }, instanceProps)));
|
|
8254
8350
|
};
|