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