@dooherceg/material-react-table 3.2.4 → 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 +13 -1
- package/dist/index.esm.js +725 -398
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +725 -398
- package/dist/index.js.map +1 -1
- package/locales/de/index.esm.js +12 -0
- package/locales/de/index.js +12 -0
- package/locales/en/index.esm.js +12 -0
- package/locales/en/index.js +12 -0
- package/locales/fr/index.esm.js +12 -0
- package/locales/fr/index.js +12 -0
- package/locales/hr/index.esm.js +12 -0
- package/locales/hr/index.js +12 -0
- package/locales/nl/index.esm.js +12 -0
- package/locales/nl/index.js +12 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -53,12 +53,19 @@ var SortIcon = require('@mui/icons-material/Sort');
|
|
|
53
53
|
var SyncAltIcon = require('@mui/icons-material/SyncAlt');
|
|
54
54
|
var ViewColumnIcon = require('@mui/icons-material/ViewColumn');
|
|
55
55
|
var VisibilityOffIcon = require('@mui/icons-material/VisibilityOff');
|
|
56
|
+
var FileDownloadIcon = require('@mui/icons-material/FileDownload');
|
|
57
|
+
var PrintIcon = require('@mui/icons-material/Print');
|
|
58
|
+
var Divider = require('@mui/material/Divider');
|
|
59
|
+
var FormControl = require('@mui/material/FormControl');
|
|
60
|
+
var FormControlLabel = require('@mui/material/FormControlLabel');
|
|
61
|
+
var RadioGroup = require('@mui/material/RadioGroup');
|
|
62
|
+
var Typography = require('@mui/material/Typography');
|
|
63
|
+
var printJS = require('print-js');
|
|
64
|
+
var notistack = require('notistack');
|
|
56
65
|
var reactVirtual = require('@tanstack/react-virtual');
|
|
57
66
|
var Drawer = require('@mui/material/Drawer');
|
|
58
|
-
var Typography = require('@mui/material/Typography');
|
|
59
67
|
var TextField = require('@mui/material/TextField');
|
|
60
68
|
var reactHookForm = require('react-hook-form');
|
|
61
|
-
var FormControl = require('@mui/material/FormControl');
|
|
62
69
|
var FormHelperText = require('@mui/material/FormHelperText');
|
|
63
70
|
var InputLabel = require('@mui/material/InputLabel');
|
|
64
71
|
var Select = require('@mui/material/Select');
|
|
@@ -82,6 +89,7 @@ var react$1 = require('@iconify/react');
|
|
|
82
89
|
var BookmarkAddIcon = require('@mui/icons-material/BookmarkAdd');
|
|
83
90
|
var CheckIcon = require('@mui/icons-material/Check');
|
|
84
91
|
var ClickAwayListener = require('@mui/material/ClickAwayListener');
|
|
92
|
+
var ErrorOutlineRoundedIcon = require('@mui/icons-material/ErrorOutlineRounded');
|
|
85
93
|
var Paper = require('@mui/material/Paper');
|
|
86
94
|
var Collapse = require('@mui/material/Collapse');
|
|
87
95
|
var LinearProgress = require('@mui/material/LinearProgress');
|
|
@@ -95,14 +103,8 @@ var MenuList = require('@mui/material/MenuList');
|
|
|
95
103
|
var ListItemText = require('@mui/material/ListItemText');
|
|
96
104
|
var BookmarkIcon = require('@mui/icons-material/Bookmark');
|
|
97
105
|
var DeleteForeverIcon = require('@mui/icons-material/DeleteForever');
|
|
98
|
-
var Divider = require('@mui/material/Divider');
|
|
99
|
-
var FormControlLabel = require('@mui/material/FormControlLabel');
|
|
100
106
|
var Switch = require('@mui/material/Switch');
|
|
101
107
|
var Badge = require('@mui/material/Badge');
|
|
102
|
-
var FileDownloadIcon = require('@mui/icons-material/FileDownload');
|
|
103
|
-
var PrintIcon = require('@mui/icons-material/Print');
|
|
104
|
-
var RadioGroup = require('@mui/material/RadioGroup');
|
|
105
|
-
var printJS = require('print-js');
|
|
106
108
|
var TableContainer = require('@mui/material/TableContainer');
|
|
107
109
|
var Dialog = require('@mui/material/Dialog');
|
|
108
110
|
var DialogActions = require('@mui/material/DialogActions');
|
|
@@ -1898,6 +1900,9 @@ const MRT_Localization_EN = {
|
|
|
1898
1900
|
sortedByColumnDesc: 'Sorted by {column} descending',
|
|
1899
1901
|
thenBy: ', then by ',
|
|
1900
1902
|
toggleDensity: 'Density',
|
|
1903
|
+
densityCompact: 'Compact',
|
|
1904
|
+
densityStandard: 'Standard',
|
|
1905
|
+
densityComfortable: 'Comfortable',
|
|
1901
1906
|
toggleFullScreen: 'Toggle full screen',
|
|
1902
1907
|
toggleSelectAll: 'Toggle select all',
|
|
1903
1908
|
toggleSelectRow: 'Toggle select row',
|
|
@@ -1917,15 +1922,348 @@ const MRT_Localization_EN = {
|
|
|
1917
1922
|
exportPrintPdf: 'Print PDF',
|
|
1918
1923
|
exportDownload: 'Download',
|
|
1919
1924
|
exportGrouped: 'Group files',
|
|
1925
|
+
exportInProgress: 'Export in progress...',
|
|
1926
|
+
exportSuccess: 'Export completed successfully.',
|
|
1927
|
+
exportError: 'Export failed. Please try again.',
|
|
1928
|
+
exportNoExportsSelected: 'No export type selected. Please configure the export first.',
|
|
1920
1929
|
deleteConfirmationTitle: 'Delete Row',
|
|
1921
1930
|
deleteConfirmationMessage: 'Are you sure you want to delete the selected row(s)?',
|
|
1922
1931
|
deleteConfirmYes: 'Delete',
|
|
1923
1932
|
deleteConfirmNo: 'Cancel',
|
|
1924
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',
|
|
1925
1939
|
resetState: 'Reset State',
|
|
1926
1940
|
tableOptions: 'Options',
|
|
1927
1941
|
};
|
|
1928
1942
|
|
|
1943
|
+
const downloadExportFiles = (files) => {
|
|
1944
|
+
files.forEach((file) => {
|
|
1945
|
+
const binaryString = atob(file.content);
|
|
1946
|
+
const len = binaryString.length;
|
|
1947
|
+
const bytes = new Uint8Array(len);
|
|
1948
|
+
for (let i = 0; i < len; i++) {
|
|
1949
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
1950
|
+
}
|
|
1951
|
+
const blob = new Blob([bytes], { type: 'application/octet-stream' });
|
|
1952
|
+
const element = document.createElement('a');
|
|
1953
|
+
element.href = URL.createObjectURL(blob);
|
|
1954
|
+
element.download = file.filename;
|
|
1955
|
+
document.body.appendChild(element);
|
|
1956
|
+
element.click();
|
|
1957
|
+
document.body.removeChild(element);
|
|
1958
|
+
URL.revokeObjectURL(element.href);
|
|
1959
|
+
});
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
const printExportFiles = (files) => {
|
|
1963
|
+
files.forEach((file) => {
|
|
1964
|
+
const binaryString = atob(file.content);
|
|
1965
|
+
const len = binaryString.length;
|
|
1966
|
+
const bytes = new Uint8Array(len);
|
|
1967
|
+
for (let i = 0; i < len; i++) {
|
|
1968
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
1969
|
+
}
|
|
1970
|
+
const blob = new Blob([bytes], { type: 'application/pdf' });
|
|
1971
|
+
const url = URL.createObjectURL(blob);
|
|
1972
|
+
printJS({
|
|
1973
|
+
printable: url,
|
|
1974
|
+
type: 'pdf',
|
|
1975
|
+
onLoadingEnd: () => URL.revokeObjectURL(url),
|
|
1976
|
+
});
|
|
1977
|
+
});
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1980
|
+
const MRT_ExportsToolbar = ({ table, availableExports, exportState, onExportStateChange, loadExport, }) => {
|
|
1981
|
+
const theme = styles.useTheme();
|
|
1982
|
+
const { localization } = table.options;
|
|
1983
|
+
const { selectedExports, selectedFormat, grouped } = exportState;
|
|
1984
|
+
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
1985
|
+
const [loadingExportType, setLoadingExportType] = react.useState(null);
|
|
1986
|
+
const { rowSelection } = table.getState();
|
|
1987
|
+
const selectedRowIds = Object.keys(rowSelection).filter((id) => rowSelection[id]);
|
|
1988
|
+
const isNoRowsSelected = selectedRowIds.length === 0;
|
|
1989
|
+
const availableFormats = react.useMemo(() => {
|
|
1990
|
+
const allFormats = Object.values(availableExports).flatMap((exp) => exp.formats);
|
|
1991
|
+
return Array.from(new Set(allFormats));
|
|
1992
|
+
}, [availableExports]);
|
|
1993
|
+
const hasPdfFormat = availableFormats.includes('pdf');
|
|
1994
|
+
const exportTypesForSelectedFormat = react.useMemo(() => {
|
|
1995
|
+
if (!selectedFormat)
|
|
1996
|
+
return [];
|
|
1997
|
+
return Object.values(availableExports).filter((exp) => exp.formats.includes(selectedFormat));
|
|
1998
|
+
}, [availableExports, selectedFormat]);
|
|
1999
|
+
const isPrintDisabled = selectedFormat !== 'pdf' ||
|
|
2000
|
+
!selectedFormat ||
|
|
2001
|
+
selectedExports.length < 1 ||
|
|
2002
|
+
(!grouped && selectedExports.length > 1);
|
|
2003
|
+
const isDownloadDisabled = !selectedFormat || selectedExports.length < 1;
|
|
2004
|
+
const handleOpenMenu = (event) => {
|
|
2005
|
+
setAnchorEl(event.currentTarget);
|
|
2006
|
+
};
|
|
2007
|
+
const handleCloseMenu = () => {
|
|
2008
|
+
setAnchorEl(null);
|
|
2009
|
+
};
|
|
2010
|
+
const handleSelectFormat = (format) => {
|
|
2011
|
+
const newFormat = selectedFormat === format ? null : format;
|
|
2012
|
+
onExportStateChange((prev) => (Object.assign(Object.assign({}, (prev !== null && prev !== void 0 ? prev : { grouped: false })), { selectedExports: [], selectedFormat: newFormat })));
|
|
2013
|
+
};
|
|
2014
|
+
const handleToggleExportType = (exportName) => {
|
|
2015
|
+
const isAlreadySelected = selectedExports.includes(exportName);
|
|
2016
|
+
const newSelectedExports = isAlreadySelected
|
|
2017
|
+
? selectedExports.filter((name) => name !== exportName)
|
|
2018
|
+
: [...selectedExports, exportName];
|
|
2019
|
+
onExportStateChange((prev) => (Object.assign(Object.assign({}, (prev !== null && prev !== void 0 ? prev : { selectedFormat: null, grouped: false })), { selectedExports: newSelectedExports })));
|
|
2020
|
+
};
|
|
2021
|
+
const handleToggleGrouped = () => {
|
|
2022
|
+
onExportStateChange((prev) => (Object.assign(Object.assign({}, (prev !== null && prev !== void 0 ? prev : { selectedFormat: null, selectedExports: [] })), { grouped: !grouped })));
|
|
2023
|
+
};
|
|
2024
|
+
const handleExportAction = (type) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2025
|
+
setLoadingExportType(type);
|
|
2026
|
+
try {
|
|
2027
|
+
const response = yield loadExport({
|
|
2028
|
+
format: selectedFormat,
|
|
2029
|
+
exports: selectedExports,
|
|
2030
|
+
separated_files: !grouped,
|
|
2031
|
+
download: false,
|
|
2032
|
+
ids: JSON.stringify(selectedRowIds),
|
|
2033
|
+
type,
|
|
2034
|
+
});
|
|
2035
|
+
handleCloseMenu();
|
|
2036
|
+
if (type === 'download') {
|
|
2037
|
+
downloadExportFiles(response);
|
|
2038
|
+
}
|
|
2039
|
+
else {
|
|
2040
|
+
printExportFiles(response);
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
finally {
|
|
2044
|
+
setLoadingExportType(null);
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
const renderFormatSelector = () => (jsxRuntime.jsx(Stack, { justifyContent: "flex-start", minWidth: "200px", sx: {
|
|
2048
|
+
borderRight: selectedFormat
|
|
2049
|
+
? `1px dashed ${theme.palette.divider}`
|
|
2050
|
+
: 'none',
|
|
2051
|
+
}, children: jsxRuntime.jsx(FormControl, { children: jsxRuntime.jsx(RadioGroup, { value: selectedFormat !== null && selectedFormat !== void 0 ? selectedFormat : '', children: availableFormats.map((format) => (jsxRuntime.jsx(FormControlLabel, { sx: { m: 0 }, value: format, control: jsxRuntime.jsx(Radio, { size: "small", onClick: () => handleSelectFormat(format) }), label: jsxRuntime.jsx(Typography, { variant: "subtitle2", sx: { fontWeight: 800 }, children: format }) }, format))) }) }) }));
|
|
2052
|
+
const renderExportTypeSelector = () => {
|
|
2053
|
+
if (!selectedFormat || exportTypesForSelectedFormat.length === 0)
|
|
2054
|
+
return null;
|
|
2055
|
+
return (jsxRuntime.jsx(Stack, { minWidth: "250px", maxHeight: "500px", sx: { overflowY: 'auto' }, children: exportTypesForSelectedFormat.map((exportType) => (jsxRuntime.jsxs(MenuItem, { onClick: () => handleToggleExportType(exportType.name), value: exportType.name, children: [jsxRuntime.jsx(Checkbox, { checked: selectedExports.includes(exportType.name), size: "small" }), jsxRuntime.jsx(Typography, { variant: "body2", children: exportType.label })] }, exportType.name))) }));
|
|
2056
|
+
};
|
|
2057
|
+
const renderActionButtons = () => {
|
|
2058
|
+
const isAnyLoading = loadingExportType !== null;
|
|
2059
|
+
return (jsxRuntime.jsxs(Stack, { direction: "row", gap: 0.5, mt: 1, mr: 2, children: [hasPdfFormat && (jsxRuntime.jsx(Button, { sx: { display: 'flex', gap: 0.5 }, disabled: isPrintDisabled || isAnyLoading, onClick: () => handleExportAction('print'), startIcon: loadingExportType === 'print' ? (jsxRuntime.jsx(CircularProgress, { size: 16, color: "inherit" })) : (jsxRuntime.jsx(PrintIcon, { fontSize: "small" })), children: localization.exportPrintPdf })), jsxRuntime.jsx(Button, { sx: { display: 'flex', gap: 0.5 }, disabled: isDownloadDisabled || isAnyLoading, onClick: () => handleExportAction('download'), startIcon: loadingExportType === 'download' ? (jsxRuntime.jsx(CircularProgress, { size: 16, color: "inherit" })) : (jsxRuntime.jsx(FileDownloadIcon, { fontSize: "small" })), children: localization.exportDownload })] }));
|
|
2060
|
+
};
|
|
2061
|
+
const renderGroupedCheckbox = () => (jsxRuntime.jsx(Stack, { mt: "auto", children: jsxRuntime.jsx(FormControlLabel, { onChange: handleToggleGrouped, sx: { m: 0 }, control: jsxRuntime.jsx(Checkbox, { checked: grouped, size: "small" }), label: jsxRuntime.jsx(Typography, { variant: "body2", children: localization.exportGrouped }) }) }));
|
|
2062
|
+
return (jsxRuntime.jsxs(Stack, { direction: "row", gap: 0.5, alignItems: "center", children: [jsxRuntime.jsx(Tooltip, { title: isNoRowsSelected
|
|
2063
|
+
? localization.exportSelectRowsTooltip
|
|
2064
|
+
: localization.exportButton, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(Button, { "aria-label": localization.exportButton, disabled: isNoRowsSelected, onClick: handleOpenMenu, size: "small", startIcon: jsxRuntime.jsx(FileDownloadIcon, { fontSize: "small" }), variant: "text", children: localization.exportButton }) }) }), jsxRuntime.jsxs(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleCloseMenu, anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'left' }, children: [jsxRuntime.jsxs(Stack, { direction: "row", sx: { px: 1, pt: 1, maxHeight: '320px', overflow: 'auto' }, children: [renderFormatSelector(), selectedFormat &&
|
|
2065
|
+
exportTypesForSelectedFormat.length > 0 &&
|
|
2066
|
+
renderExportTypeSelector()] }), jsxRuntime.jsx(Divider, { sx: { mt: 1 } }), jsxRuntime.jsxs(Stack, { direction: "row", alignItems: "center", sx: { px: 1, pb: 1 }, children: [renderActionButtons(), renderGroupedCheckbox()] })] })] }));
|
|
2067
|
+
};
|
|
2068
|
+
|
|
2069
|
+
const MRT_ExportRowButton = ({ onClick }) => {
|
|
2070
|
+
return (jsxRuntime.jsx(IconButton, { sx: { p: 0 }, disableRipple: true, onClick: onClick, children: jsxRuntime.jsx(FileDownloadIcon, { fontSize: "small" }) }));
|
|
2071
|
+
};
|
|
2072
|
+
|
|
2073
|
+
const MRT_PrintRowButton = ({ onClick }) => {
|
|
2074
|
+
return (jsxRuntime.jsx(IconButton, { sx: { p: 0 }, disableRipple: true, onClick: onClick, children: jsxRuntime.jsx(PrintIcon, { fontSize: "small" }) }));
|
|
2075
|
+
};
|
|
2076
|
+
|
|
2077
|
+
const ExportRowAction = ({ onExport, onPrint }) => {
|
|
2078
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MRT_ExportRowButton, { onClick: onExport }), onPrint && jsxRuntime.jsx(MRT_PrintRowButton, { onClick: onPrint })] }));
|
|
2079
|
+
};
|
|
2080
|
+
|
|
2081
|
+
const hasActiveExports = (table) => {
|
|
2082
|
+
const { activeExports } = table.getState();
|
|
2083
|
+
return !!((activeExports === null || activeExports === void 0 ? void 0 : activeExports.selectedFormat) && activeExports.selectedExports.length > 0);
|
|
2084
|
+
};
|
|
2085
|
+
// Same conditions as MRT_ExportsToolbar: pdf format selected, at least one export type,
|
|
2086
|
+
// and either grouped or exactly one export type selected.
|
|
2087
|
+
const isPrintAvailable = (table) => {
|
|
2088
|
+
var _a;
|
|
2089
|
+
const allFormats = Object.values((_a = table.options.availableExports) !== null && _a !== void 0 ? _a : {}).flatMap((e) => e.formats);
|
|
2090
|
+
if (!allFormats.includes('pdf'))
|
|
2091
|
+
return false;
|
|
2092
|
+
const { activeExports } = table.getState();
|
|
2093
|
+
if (!activeExports)
|
|
2094
|
+
return false;
|
|
2095
|
+
const { selectedFormat, selectedExports, grouped } = activeExports;
|
|
2096
|
+
return (selectedFormat === 'pdf' &&
|
|
2097
|
+
selectedExports.length >= 1 &&
|
|
2098
|
+
(grouped || selectedExports.length === 1));
|
|
2099
|
+
};
|
|
2100
|
+
const createExportAction = (_a = {}) => {
|
|
2101
|
+
var { onExport, renderRow: customRenderRow, renderToolbar: customRenderToolbar } = _a, rest = __rest(_a, ["onExport", "renderRow", "renderToolbar"]);
|
|
2102
|
+
// Pure download logic — no notifications. Throws on failure so callers can handle it.
|
|
2103
|
+
const defaultOnExport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ rowsToExport, table, }) {
|
|
2104
|
+
if (!rowsToExport.length)
|
|
2105
|
+
return;
|
|
2106
|
+
const { loadExport } = table.options;
|
|
2107
|
+
const { activeExports } = table.getState();
|
|
2108
|
+
if (!loadExport || !activeExports)
|
|
2109
|
+
return;
|
|
2110
|
+
const response = yield loadExport({
|
|
2111
|
+
format: activeExports.selectedFormat,
|
|
2112
|
+
exports: activeExports.selectedExports,
|
|
2113
|
+
separated_files: !activeExports.grouped,
|
|
2114
|
+
download: false,
|
|
2115
|
+
ids: JSON.stringify(rowsToExport.map((r) => r.id)),
|
|
2116
|
+
type: 'download',
|
|
2117
|
+
});
|
|
2118
|
+
downloadExportFiles(response);
|
|
2119
|
+
});
|
|
2120
|
+
// Pure print logic — no notifications. Throws on failure so callers can handle it.
|
|
2121
|
+
const defaultOnPrint = (_a) => __awaiter(void 0, [_a], void 0, function* ({ rowsToExport, table, }) {
|
|
2122
|
+
if (!rowsToExport.length)
|
|
2123
|
+
return;
|
|
2124
|
+
const { loadExport } = table.options;
|
|
2125
|
+
const { activeExports } = table.getState();
|
|
2126
|
+
if (!loadExport || !activeExports)
|
|
2127
|
+
return;
|
|
2128
|
+
const response = yield loadExport({
|
|
2129
|
+
format: activeExports.selectedFormat,
|
|
2130
|
+
exports: activeExports.selectedExports,
|
|
2131
|
+
separated_files: !activeExports.grouped,
|
|
2132
|
+
download: false,
|
|
2133
|
+
ids: JSON.stringify(rowsToExport.map((r) => r.id)),
|
|
2134
|
+
type: 'print',
|
|
2135
|
+
});
|
|
2136
|
+
printExportFiles(response);
|
|
2137
|
+
});
|
|
2138
|
+
// Single execution pipeline for every export flow (row or toolbar).
|
|
2139
|
+
// If a custom handler exists, it receives defaultOnExport and decides when to call it.
|
|
2140
|
+
const executeExport = (context) => {
|
|
2141
|
+
const executeDefaultExport = () => defaultOnExport(context);
|
|
2142
|
+
if (onExport) {
|
|
2143
|
+
return onExport(Object.assign(Object.assign({}, context), { defaultOnExport: executeDefaultExport }));
|
|
2144
|
+
}
|
|
2145
|
+
return executeDefaultExport();
|
|
2146
|
+
};
|
|
2147
|
+
// Row download: checks for active exports, then wraps with loading/success/error notifications.
|
|
2148
|
+
const handleSingleRowExport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ table, row, }) {
|
|
2149
|
+
const { localization } = table.options;
|
|
2150
|
+
if (!hasActiveExports(table)) {
|
|
2151
|
+
notistack.enqueueSnackbar(localization.exportNoExportsSelected, {
|
|
2152
|
+
variant: 'warning',
|
|
2153
|
+
});
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
const loadingKey = notistack.enqueueSnackbar(localization.exportInProgress, {
|
|
2157
|
+
variant: 'info',
|
|
2158
|
+
persist: true,
|
|
2159
|
+
});
|
|
2160
|
+
try {
|
|
2161
|
+
yield executeExport({ table, rowsToExport: [row] });
|
|
2162
|
+
notistack.closeSnackbar(loadingKey);
|
|
2163
|
+
notistack.enqueueSnackbar(localization.exportSuccess, { variant: 'success' });
|
|
2164
|
+
}
|
|
2165
|
+
catch (_b) {
|
|
2166
|
+
notistack.closeSnackbar(loadingKey);
|
|
2167
|
+
notistack.enqueueSnackbar(localization.exportError, { variant: 'error' });
|
|
2168
|
+
}
|
|
2169
|
+
});
|
|
2170
|
+
// Row print: same guard + notification pattern as download, but calls defaultOnPrint.
|
|
2171
|
+
const handleSingleRowPrint = (_a) => __awaiter(void 0, [_a], void 0, function* ({ table, row, }) {
|
|
2172
|
+
const { localization } = table.options;
|
|
2173
|
+
if (!hasActiveExports(table)) {
|
|
2174
|
+
notistack.enqueueSnackbar(localization.exportNoExportsSelected, {
|
|
2175
|
+
variant: 'warning',
|
|
2176
|
+
});
|
|
2177
|
+
return;
|
|
2178
|
+
}
|
|
2179
|
+
const loadingKey = notistack.enqueueSnackbar(localization.exportInProgress, {
|
|
2180
|
+
variant: 'info',
|
|
2181
|
+
persist: true,
|
|
2182
|
+
});
|
|
2183
|
+
try {
|
|
2184
|
+
yield defaultOnPrint({ table, rowsToExport: [row] });
|
|
2185
|
+
notistack.closeSnackbar(loadingKey);
|
|
2186
|
+
notistack.enqueueSnackbar(localization.exportSuccess, { variant: 'success' });
|
|
2187
|
+
}
|
|
2188
|
+
catch (_b) {
|
|
2189
|
+
notistack.closeSnackbar(loadingKey);
|
|
2190
|
+
notistack.enqueueSnackbar(localization.exportError, { variant: 'error' });
|
|
2191
|
+
}
|
|
2192
|
+
});
|
|
2193
|
+
// Resolves selected rows from table state for toolbar-triggered export (custom renderToolbar only).
|
|
2194
|
+
const handleMultipleRowExport = ({ table, }) => {
|
|
2195
|
+
const rowsToExport = table.getSelectedRowModel().rows;
|
|
2196
|
+
return executeExport({ table, rowsToExport });
|
|
2197
|
+
};
|
|
2198
|
+
const createRowExportExecutor = (context) => () => {
|
|
2199
|
+
void handleSingleRowExport(context);
|
|
2200
|
+
};
|
|
2201
|
+
const createRowPrintExecutor = (context) => () => {
|
|
2202
|
+
void handleSingleRowPrint(context);
|
|
2203
|
+
};
|
|
2204
|
+
const createToolbarExportExecutor = (context) => () => {
|
|
2205
|
+
void handleMultipleRowExport(context);
|
|
2206
|
+
};
|
|
2207
|
+
// Renders download + optional print button. Print is shown under the same conditions
|
|
2208
|
+
// as in MRT_ExportsToolbar: pdf format selected, active exports, grouped or single type.
|
|
2209
|
+
const renderRowAction = (context) => {
|
|
2210
|
+
const onRowExport = createRowExportExecutor(context);
|
|
2211
|
+
const onRowPrint = isPrintAvailable(context.table)
|
|
2212
|
+
? createRowPrintExecutor(context)
|
|
2213
|
+
: undefined;
|
|
2214
|
+
if (customRenderRow) {
|
|
2215
|
+
return customRenderRow(Object.assign(Object.assign({}, context), { onExport: onRowExport }));
|
|
2216
|
+
}
|
|
2217
|
+
return jsxRuntime.jsx(ExportRowAction, { onExport: onRowExport, onPrint: onRowPrint });
|
|
2218
|
+
};
|
|
2219
|
+
// Uses custom toolbar renderer when provided; otherwise renders MRT_ExportsToolbar.
|
|
2220
|
+
// loadExport is always wrapped with notifications so that loading/success/error are shown
|
|
2221
|
+
// regardless of whether a custom onExport handler was provided.
|
|
2222
|
+
// When onExport is provided, it intercepts the call and returns [] so MRT_ExportsToolbar
|
|
2223
|
+
// does not attempt a second download from an empty response.
|
|
2224
|
+
const renderToolbarAction = (context) => {
|
|
2225
|
+
const { table } = context;
|
|
2226
|
+
const { availableExports, loadExport, onActiveExportsChange, localization, } = table.options;
|
|
2227
|
+
const { activeExports } = table.getState();
|
|
2228
|
+
if (customRenderToolbar) {
|
|
2229
|
+
return customRenderToolbar(Object.assign(Object.assign({}, context), { onExport: createToolbarExportExecutor(context) }));
|
|
2230
|
+
}
|
|
2231
|
+
if (!availableExports ||
|
|
2232
|
+
!loadExport ||
|
|
2233
|
+
!onActiveExportsChange ||
|
|
2234
|
+
!activeExports) {
|
|
2235
|
+
return null;
|
|
2236
|
+
}
|
|
2237
|
+
const notifiedLoadExport = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2238
|
+
const loadingKey = notistack.enqueueSnackbar(localization.exportInProgress, {
|
|
2239
|
+
variant: 'info',
|
|
2240
|
+
persist: true,
|
|
2241
|
+
});
|
|
2242
|
+
try {
|
|
2243
|
+
let response;
|
|
2244
|
+
if (onExport) {
|
|
2245
|
+
const rowsToExport = table.getSelectedRowModel().rows;
|
|
2246
|
+
yield executeExport({ table, rowsToExport });
|
|
2247
|
+
response = [];
|
|
2248
|
+
}
|
|
2249
|
+
else {
|
|
2250
|
+
response = yield loadExport(params);
|
|
2251
|
+
}
|
|
2252
|
+
notistack.closeSnackbar(loadingKey);
|
|
2253
|
+
notistack.enqueueSnackbar(localization.exportSuccess, { variant: 'success' });
|
|
2254
|
+
return response;
|
|
2255
|
+
}
|
|
2256
|
+
catch (_a) {
|
|
2257
|
+
notistack.closeSnackbar(loadingKey);
|
|
2258
|
+
notistack.enqueueSnackbar(localization.exportError, { variant: 'error' });
|
|
2259
|
+
return [];
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
return (jsxRuntime.jsx(MRT_ExportsToolbar, { table: table, availableExports: availableExports, exportState: activeExports, onExportStateChange: onActiveExportsChange, loadExport: notifiedLoadExport }));
|
|
2263
|
+
};
|
|
2264
|
+
return Object.assign({ name: 'export', renderRow: renderRowAction, renderToolbar: renderToolbarAction }, rest);
|
|
2265
|
+
};
|
|
2266
|
+
|
|
1929
2267
|
const MRT_DefaultColumn = {
|
|
1930
2268
|
filterVariant: 'text',
|
|
1931
2269
|
maxSize: 1000,
|
|
@@ -1948,8 +2286,18 @@ const MRT_DefaultDisplayColumn = {
|
|
|
1948
2286
|
};
|
|
1949
2287
|
const useMRT_TableOptions = (_a) => {
|
|
1950
2288
|
var _b;
|
|
1951
|
-
var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeDirection, columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBatchRowSelection = true, enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = true, enableColumnPinning = true, enableColumnResizing = true, enableColumnVirtualization, enableDensityToggle = true, enableExpandAll = true, maxDepth, enableExpanding, enableRowReordering, enableFacetedValues = false, enableFilterMatchHighlighting = true, enableFilters = false, enableAdvancedFilters = true, enableGlobalFilter = false, enableGlobalFilterRankedResults = true, enableGrouping = true, enableHiding = true, enableKeyboardShortcuts = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = true, enableRowSelection = true, enableRowVirtualization = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = true, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, id = react.useId(), layoutMode, localization, manualFiltering, manualGrouping, manualPagination, manualSorting, mrtTheme, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionCreatingRow = 'top', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberDisplayMode = 'static', rowPinningDisplayMode = 'sticky', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnFilterDisplayMode", "columnResizeDirection", "columnResizeMode", "createDisplayMode", "defaultColumn", "defaultDisplayColumn", "editDisplayMode", "enableBatchRowSelection", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnPinning", "enableColumnResizing", "enableColumnVirtualization", "enableDensityToggle", "enableExpandAll", "maxDepth", "enableExpanding", "enableRowReordering", "enableFacetedValues", "enableFilterMatchHighlighting", "enableFilters", "enableAdvancedFilters", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableKeyboardShortcuts", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enableRowPinning", "enableRowSelection", "enableRowVirtualization", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "id", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "mrtTheme", "paginationDisplayMode", "positionActionsColumn", "positionCreatingRow", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberDisplayMode", "rowPinningDisplayMode", "selectAllMode", "sortingFns"]);
|
|
2289
|
+
var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeDirection, columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBatchRowSelection = true, enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = true, enableColumnPinning = true, enableColumnResizing = true, enableColumnVirtualization, enableDensityToggle = true, enableExpandAll = true, maxDepth, enableExpanding, enableRowReordering, enableFacetedValues = false, enableFilterMatchHighlighting = true, enableFilters = false, enableAdvancedFilters = true, enableGlobalFilter = false, enableGlobalFilterRankedResults = true, enableGrouping = true, enableHiding = true, enableKeyboardShortcuts = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = true, enableRowSelection = true, enableRowVirtualization = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = true, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, id = react.useId(), layoutMode, localization, manualFiltering, manualGrouping, manualPagination, manualSorting, mrtTheme, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionCreatingRow = 'top', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberDisplayMode = 'static', rowPinningDisplayMode = 'sticky', selectAllMode = 'page', sortingFns, actions, availableExports } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnFilterDisplayMode", "columnResizeDirection", "columnResizeMode", "createDisplayMode", "defaultColumn", "defaultDisplayColumn", "editDisplayMode", "enableBatchRowSelection", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnPinning", "enableColumnResizing", "enableColumnVirtualization", "enableDensityToggle", "enableExpandAll", "maxDepth", "enableExpanding", "enableRowReordering", "enableFacetedValues", "enableFilterMatchHighlighting", "enableFilters", "enableAdvancedFilters", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableKeyboardShortcuts", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enableRowPinning", "enableRowSelection", "enableRowVirtualization", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "id", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "mrtTheme", "paginationDisplayMode", "positionActionsColumn", "positionCreatingRow", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberDisplayMode", "rowPinningDisplayMode", "selectAllMode", "sortingFns", "actions", "availableExports"]);
|
|
1952
2290
|
const theme = styles.useTheme();
|
|
2291
|
+
// When availableExports is configured and the user has not supplied their own
|
|
2292
|
+
// 'export' action, inject the default export action automatically.
|
|
2293
|
+
const effectiveActions = react.useMemo(() => {
|
|
2294
|
+
if (!availableExports)
|
|
2295
|
+
return actions;
|
|
2296
|
+
const hasUserExportAction = actions === null || actions === void 0 ? void 0 : actions.some((a) => a.name === 'export');
|
|
2297
|
+
if (hasUserExportAction)
|
|
2298
|
+
return actions;
|
|
2299
|
+
return [createExportAction(), ...(actions !== null && actions !== void 0 ? actions : [])];
|
|
2300
|
+
}, [actions, availableExports]);
|
|
1953
2301
|
icons = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Default_Icons), icons)), [icons]);
|
|
1954
2302
|
localization = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Localization_EN), localization)), [localization]);
|
|
1955
2303
|
mrtTheme = react.useMemo(() => getMRTTheme(mrtTheme, theme), [mrtTheme, theme]);
|
|
@@ -2053,7 +2401,7 @@ const useMRT_TableOptions = (_a) => {
|
|
|
2053
2401
|
rowPinningDisplayMode,
|
|
2054
2402
|
selectAllMode,
|
|
2055
2403
|
sortingFns,
|
|
2056
|
-
enableAdvancedFilters }, rest);
|
|
2404
|
+
enableAdvancedFilters, actions: effectiveActions, availableExports }, rest);
|
|
2057
2405
|
};
|
|
2058
2406
|
|
|
2059
2407
|
const blankColProps = {
|
|
@@ -2074,8 +2422,7 @@ const getMRT_RowSpacerColumnDef = (tableOptions) => {
|
|
|
2074
2422
|
|
|
2075
2423
|
const useMRT_Effects = (table) => {
|
|
2076
2424
|
const { getIsSomeRowsPinned, getPrePaginationRowModel, getState, options: { enablePagination, enableRowPinning, rowCount }, } = table;
|
|
2077
|
-
const {
|
|
2078
|
-
const totalColumnCount = table.options.columns.length;
|
|
2425
|
+
const { density, globalFilter, isLoading, pagination, showSkeletons, sorting, } = getState();
|
|
2079
2426
|
const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
|
|
2080
2427
|
const rerender = react.useReducer(() => ({}), {})[1];
|
|
2081
2428
|
const initialBodyHeight = react.useRef(null);
|
|
@@ -2084,12 +2431,6 @@ const useMRT_Effects = (table) => {
|
|
|
2084
2431
|
initialBodyHeight.current = document.body.style.height;
|
|
2085
2432
|
}
|
|
2086
2433
|
}, []);
|
|
2087
|
-
//recalculate column order when columns change or features are toggled on/off
|
|
2088
|
-
react.useEffect(() => {
|
|
2089
|
-
if (totalColumnCount !== columnOrder.length) {
|
|
2090
|
-
table.setColumnOrder(getDefaultColumnOrderIds(table.options));
|
|
2091
|
-
}
|
|
2092
|
-
}, [totalColumnCount]);
|
|
2093
2434
|
//if page index is out of bounds, set it to the last page
|
|
2094
2435
|
react.useEffect(() => {
|
|
2095
2436
|
if (!enablePagination || isLoading || showSkeletons)
|
|
@@ -4706,61 +5047,267 @@ const MRT_AdvancedFilters = ({ table, }) => {
|
|
|
4706
5047
|
return jsxRuntime.jsx(MRT_AdvancedFiltersContent, { table: table });
|
|
4707
5048
|
};
|
|
4708
5049
|
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
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
|
+
|
|
5238
|
+
function RowActionsCell({ row, table, }) {
|
|
5239
|
+
const { actions } = table.options;
|
|
5240
|
+
return (jsxRuntime.jsx(Box, { children: actions === null || actions === void 0 ? void 0 : actions.map((action) => {
|
|
5241
|
+
var _a;
|
|
5242
|
+
return (jsxRuntime.jsx(react.Fragment, { children: (_a = action.renderRow) === null || _a === void 0 ? void 0 : _a.call(action, { row, table }) }, action.name));
|
|
5243
|
+
}) }));
|
|
5244
|
+
}
|
|
5245
|
+
|
|
5246
|
+
// Detects whether a real SnackbarProvider exists in the tree.
|
|
5247
|
+
// In notistack's default context both enqueueSnackbar and closeSnackbar point to
|
|
5248
|
+
// the same no-op reference. A real provider binds them to different functions.
|
|
5249
|
+
const useHasSnackbarProvider = () => {
|
|
5250
|
+
const { enqueueSnackbar, closeSnackbar } = notistack.useSnackbar();
|
|
5251
|
+
return enqueueSnackbar !== closeSnackbar;
|
|
5252
|
+
};
|
|
5253
|
+
const Inner = ({ children }) => {
|
|
5254
|
+
const hasProvider = useHasSnackbarProvider();
|
|
5255
|
+
if (hasProvider)
|
|
5256
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children });
|
|
5257
|
+
return (jsxRuntime.jsx(notistack.SnackbarProvider, { maxSnack: 5, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, children: children }));
|
|
5258
|
+
};
|
|
5259
|
+
// Wraps children with SnackbarProvider only when no provider exists in the tree.
|
|
5260
|
+
// When the user's app already has a SnackbarProvider, notifications from MRT
|
|
5261
|
+
// will appear there — inheriting its position and styling.
|
|
5262
|
+
const MaybeSnackbarProvider = ({ children, }) => jsxRuntime.jsx(Inner, { children: children });
|
|
5263
|
+
|
|
5264
|
+
const MRT_ActiveFilterItem = ({ table, rule, }) => {
|
|
5265
|
+
var _a;
|
|
5266
|
+
const column = getFilterColumn(table, rule.columnId);
|
|
5267
|
+
if (!column ||
|
|
5268
|
+
column.columnDef.type === 'actions' ||
|
|
5269
|
+
column.columnDef.type === 'object') {
|
|
5270
|
+
return null;
|
|
5271
|
+
}
|
|
5272
|
+
const columnType = column.columnDef.type;
|
|
5273
|
+
const resolver = columnType && columnTypeResolvers[columnType];
|
|
5274
|
+
return (jsxRuntime.jsx(Box, { "data-testid": "active-filter-item", sx: {
|
|
5275
|
+
display: 'flex',
|
|
5276
|
+
gap: 1,
|
|
5277
|
+
}, children: (_a = resolver === null || resolver === void 0 ? void 0 : resolver.activeFilterRenderer) === null || _a === void 0 ? void 0 : _a.call(resolver, table, rule) }));
|
|
5278
|
+
};
|
|
5279
|
+
|
|
5280
|
+
const MRT_ActiveFilters = ({ table, }) => {
|
|
5281
|
+
const { getState } = table;
|
|
5282
|
+
const { filters } = getState();
|
|
5283
|
+
const hasFilters = filters.rules.length > 0;
|
|
5284
|
+
if (!hasFilters)
|
|
5285
|
+
return null;
|
|
5286
|
+
return (jsxRuntime.jsx(Stack, { "data-testid": "active-filters-container", gap: 1, direction: "row", p: 1, sx: {
|
|
5287
|
+
borderBottom: (theme) => `1px solid ${theme.palette.divider}`,
|
|
5288
|
+
}, children: filters.rules.map((rule) => (jsxRuntime.jsx(MRT_ActiveFilterItem, { table: table, rule: rule }, rule.id))) }));
|
|
5289
|
+
};
|
|
5290
|
+
|
|
5291
|
+
const MRT_LinearProgressBar = (_a) => {
|
|
5292
|
+
var { isTopToolbar, table } = _a, rest = __rest(_a, ["isTopToolbar", "table"]);
|
|
5293
|
+
const { getState, options: { muiLinearProgressProps }, } = table;
|
|
5294
|
+
const { isSaving, showProgressBars } = getState();
|
|
5295
|
+
const linearProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiLinearProgressProps, {
|
|
5296
|
+
isTopToolbar,
|
|
5297
|
+
table,
|
|
5298
|
+
})), rest);
|
|
5299
|
+
return (jsxRuntime.jsx(Collapse, { in: showProgressBars !== false && (showProgressBars || isSaving), mountOnEnter: true, sx: {
|
|
5300
|
+
bottom: isTopToolbar ? 0 : undefined,
|
|
5301
|
+
position: 'absolute',
|
|
5302
|
+
top: !isTopToolbar ? 0 : undefined,
|
|
5303
|
+
width: '100%',
|
|
5304
|
+
}, unmountOnExit: true, children: jsxRuntime.jsx(LinearProgress, Object.assign({ "aria-busy": "true", "aria-label": "Loading", sx: { position: 'relative' } }, linearProgressProps)) }));
|
|
5305
|
+
};
|
|
5306
|
+
|
|
5307
|
+
/**
|
|
5308
|
+
* Displays the number of currently selected rows.
|
|
5309
|
+
*
|
|
5310
|
+
* Responsibilities:
|
|
4764
5311
|
* - Compute the selected row count from `rowSelection` state (server-side
|
|
4765
5312
|
* compatible — counts truthy values in the map directly).
|
|
4766
5313
|
* - Render an accessible label using the `rowsSelected` localization string.
|
|
@@ -5600,191 +6147,103 @@ const MRT_ToggleAdvancedFiltersButton = (_a) => {
|
|
|
5600
6147
|
return (jsxRuntime.jsx(MRT_AdvancedFiltersProvider, { initialOpen: initialOpen, setterRef: table._showAdvancedFiltersSetterRef, children: jsxRuntime.jsx(MRT_ToggleAdvancedFiltersButtonInner, Object.assign({ table: table }, rest)) }));
|
|
5601
6148
|
};
|
|
5602
6149
|
|
|
5603
|
-
const
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
};
|
|
5623
|
-
|
|
5624
|
-
const
|
|
5625
|
-
var _b;
|
|
5626
|
-
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
5627
|
-
const { getState, options: { icons: { FilterListIcon, FilterListOffIcon }, localization, }, setShowColumnFilters, } = table;
|
|
5628
|
-
const { showColumnFilters } = getState();
|
|
5629
|
-
const handleToggleShowFilters = () => {
|
|
5630
|
-
setShowColumnFilters(!showColumnFilters);
|
|
5631
|
-
};
|
|
5632
|
-
return (jsxRuntime.jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters, children: jsxRuntime.jsx(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined, children: showColumnFilters ? jsxRuntime.jsx(FilterListOffIcon, {}) : jsxRuntime.jsx(FilterListIcon, {}) })) }));
|
|
5633
|
-
};
|
|
5634
|
-
|
|
5635
|
-
const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
5636
|
-
var _b, _c;
|
|
5637
|
-
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
5638
|
-
const { getState, options: { icons: { SearchIcon, SearchOffIcon }, localization, }, refs: { searchInputRef }, setShowGlobalFilter, } = table;
|
|
5639
|
-
const { globalFilter, showGlobalFilter } = getState();
|
|
5640
|
-
const handleToggleSearch = () => {
|
|
5641
|
-
setShowGlobalFilter(!showGlobalFilter);
|
|
5642
|
-
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
5643
|
-
};
|
|
5644
|
-
return (jsxRuntime.jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton, Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter && showGlobalFilter, onClick: handleToggleSearch }, rest, { title: undefined, children: showGlobalFilter ? jsxRuntime.jsx(SearchOffIcon, {}) : jsxRuntime.jsx(SearchIcon, {}) })) }) }));
|
|
5645
|
-
};
|
|
5646
|
-
|
|
5647
|
-
const downloadExportFiles = (files) => {
|
|
5648
|
-
files.forEach((file) => {
|
|
5649
|
-
const binaryString = atob(file.content);
|
|
5650
|
-
const len = binaryString.length;
|
|
5651
|
-
const bytes = new Uint8Array(len);
|
|
5652
|
-
for (let i = 0; i < len; i++) {
|
|
5653
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
5654
|
-
}
|
|
5655
|
-
const blob = new Blob([bytes], { type: 'application/octet-stream' });
|
|
5656
|
-
const element = document.createElement('a');
|
|
5657
|
-
element.href = URL.createObjectURL(blob);
|
|
5658
|
-
element.download = file.filename;
|
|
5659
|
-
document.body.appendChild(element);
|
|
5660
|
-
element.click();
|
|
5661
|
-
document.body.removeChild(element);
|
|
5662
|
-
URL.revokeObjectURL(element.href);
|
|
5663
|
-
});
|
|
5664
|
-
};
|
|
5665
|
-
|
|
5666
|
-
const printExportFiles = (files) => {
|
|
5667
|
-
files.forEach((file) => {
|
|
5668
|
-
const binaryString = atob(file.content);
|
|
5669
|
-
const len = binaryString.length;
|
|
5670
|
-
const bytes = new Uint8Array(len);
|
|
5671
|
-
for (let i = 0; i < len; i++) {
|
|
5672
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
5673
|
-
}
|
|
5674
|
-
const blob = new Blob([bytes], { type: 'application/pdf' });
|
|
5675
|
-
const url = URL.createObjectURL(blob);
|
|
5676
|
-
printJS({
|
|
5677
|
-
printable: url,
|
|
5678
|
-
type: 'pdf',
|
|
5679
|
-
onLoadingEnd: () => URL.revokeObjectURL(url),
|
|
5680
|
-
});
|
|
5681
|
-
});
|
|
5682
|
-
};
|
|
5683
|
-
|
|
5684
|
-
const MRT_ExportsToolbar = ({ table, availableExports, exportState, onExportStateChange, loadExport, }) => {
|
|
5685
|
-
const theme = styles.useTheme();
|
|
5686
|
-
const { localization } = table.options;
|
|
5687
|
-
const { selectedExports, selectedFormat, grouped } = exportState;
|
|
5688
|
-
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
5689
|
-
const [loadingExportType, setLoadingExportType] = react.useState(null);
|
|
5690
|
-
const { rowSelection } = table.getState();
|
|
5691
|
-
const selectedRowIds = Object.keys(rowSelection).filter((id) => rowSelection[id]);
|
|
5692
|
-
const isNoRowsSelected = selectedRowIds.length === 0;
|
|
5693
|
-
const availableFormats = react.useMemo(() => {
|
|
5694
|
-
const allFormats = Object.values(availableExports).flatMap((exp) => exp.formats);
|
|
5695
|
-
return Array.from(new Set(allFormats));
|
|
5696
|
-
}, [availableExports]);
|
|
5697
|
-
const hasPdfFormat = availableFormats.includes('pdf');
|
|
5698
|
-
const exportTypesForSelectedFormat = react.useMemo(() => {
|
|
5699
|
-
if (!selectedFormat)
|
|
5700
|
-
return [];
|
|
5701
|
-
return Object.values(availableExports).filter((exp) => exp.formats.includes(selectedFormat));
|
|
5702
|
-
}, [availableExports, selectedFormat]);
|
|
5703
|
-
const isPrintDisabled = selectedFormat !== 'pdf' ||
|
|
5704
|
-
!selectedFormat ||
|
|
5705
|
-
selectedExports.length < 1 ||
|
|
5706
|
-
(!grouped && selectedExports.length > 1);
|
|
5707
|
-
const isDownloadDisabled = !selectedFormat || selectedExports.length < 1;
|
|
5708
|
-
const handleOpenMenu = (event) => {
|
|
5709
|
-
setAnchorEl(event.currentTarget);
|
|
5710
|
-
};
|
|
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();
|
|
5711
6172
|
const handleCloseMenu = () => {
|
|
5712
6173
|
setAnchorEl(null);
|
|
5713
6174
|
};
|
|
5714
|
-
const
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
};
|
|
5718
|
-
const handleToggleExportType = (exportName) => {
|
|
5719
|
-
const isAlreadySelected = selectedExports.includes(exportName);
|
|
5720
|
-
const newSelectedExports = isAlreadySelected
|
|
5721
|
-
? selectedExports.filter((name) => name !== exportName)
|
|
5722
|
-
: [...selectedExports, exportName];
|
|
5723
|
-
onExportStateChange((prev) => (Object.assign(Object.assign({}, (prev !== null && prev !== void 0 ? prev : { selectedFormat: null, grouped: false })), { selectedExports: newSelectedExports })));
|
|
6175
|
+
const handleSelectDensity = (nextDensity) => {
|
|
6176
|
+
setDensity(nextDensity);
|
|
6177
|
+
handleCloseMenu();
|
|
5724
6178
|
};
|
|
5725
|
-
const
|
|
5726
|
-
|
|
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
|
+
|
|
6196
|
+
const MRT_ToggleDensePaddingButton = (_a) => {
|
|
6197
|
+
var _b;
|
|
6198
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
6199
|
+
const { getState, options: { icons: { DensityLargeIcon, DensityMediumIcon, DensitySmallIcon }, localization, }, } = table;
|
|
6200
|
+
const { density } = getState();
|
|
6201
|
+
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
6202
|
+
const handleOpenMenu = (event) => {
|
|
6203
|
+
setAnchorEl(event.currentTarget);
|
|
5727
6204
|
};
|
|
5728
|
-
const
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
else {
|
|
5744
|
-
printExportFiles(response);
|
|
5745
|
-
}
|
|
5746
|
-
}
|
|
5747
|
-
finally {
|
|
5748
|
-
setLoadingExportType(null);
|
|
5749
|
-
}
|
|
5750
|
-
});
|
|
5751
|
-
const renderFormatSelector = () => (jsxRuntime.jsx(Stack, { justifyContent: "flex-start", minWidth: "200px", sx: {
|
|
5752
|
-
borderRight: selectedFormat
|
|
5753
|
-
? `1px dashed ${theme.palette.divider}`
|
|
5754
|
-
: 'none',
|
|
5755
|
-
}, children: jsxRuntime.jsx(FormControl, { children: jsxRuntime.jsx(RadioGroup, { value: selectedFormat !== null && selectedFormat !== void 0 ? selectedFormat : '', children: availableFormats.map((format) => (jsxRuntime.jsx(FormControlLabel, { sx: { m: 0 }, value: format, control: jsxRuntime.jsx(Radio, { size: "small", onClick: () => handleSelectFormat(format) }), label: jsxRuntime.jsx(Typography, { variant: "subtitle2", sx: { fontWeight: 800 }, children: format }) }, format))) }) }) }));
|
|
5756
|
-
const renderExportTypeSelector = () => {
|
|
5757
|
-
if (!selectedFormat || exportTypesForSelectedFormat.length === 0)
|
|
5758
|
-
return null;
|
|
5759
|
-
return (jsxRuntime.jsx(Stack, { minWidth: "250px", maxHeight: "500px", sx: { overflowY: 'auto' }, children: exportTypesForSelectedFormat.map((exportType) => (jsxRuntime.jsxs(MenuItem, { onClick: () => handleToggleExportType(exportType.name), value: exportType.name, children: [jsxRuntime.jsx(Checkbox, { checked: selectedExports.includes(exportType.name), size: "small" }), jsxRuntime.jsx(Typography, { variant: "body2", children: exportType.label })] }, exportType.name))) }));
|
|
6205
|
+
const DensityIcon = density === 'compact'
|
|
6206
|
+
? DensitySmallIcon
|
|
6207
|
+
: density === 'comfortable'
|
|
6208
|
+
? DensityMediumIcon
|
|
6209
|
+
: DensityLargeIcon;
|
|
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 }))] }));
|
|
6211
|
+
};
|
|
6212
|
+
|
|
6213
|
+
const MRT_ToggleFiltersButton = (_a) => {
|
|
6214
|
+
var _b;
|
|
6215
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
6216
|
+
const { getState, options: { icons: { FilterListIcon, FilterListOffIcon }, localization, }, setShowColumnFilters, } = table;
|
|
6217
|
+
const { showColumnFilters } = getState();
|
|
6218
|
+
const handleToggleShowFilters = () => {
|
|
6219
|
+
setShowColumnFilters(!showColumnFilters);
|
|
5760
6220
|
};
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
6221
|
+
return (jsxRuntime.jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters, children: jsxRuntime.jsx(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined, children: showColumnFilters ? jsxRuntime.jsx(FilterListOffIcon, {}) : jsxRuntime.jsx(FilterListIcon, {}) })) }));
|
|
6222
|
+
};
|
|
6223
|
+
|
|
6224
|
+
const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
6225
|
+
var _b, _c;
|
|
6226
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
6227
|
+
const { getState, options: { icons: { SearchIcon, SearchOffIcon }, localization, }, refs: { searchInputRef }, setShowGlobalFilter, } = table;
|
|
6228
|
+
const { globalFilter, showGlobalFilter } = getState();
|
|
6229
|
+
const handleToggleSearch = () => {
|
|
6230
|
+
setShowGlobalFilter(!showGlobalFilter);
|
|
6231
|
+
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
5764
6232
|
};
|
|
5765
|
-
|
|
5766
|
-
return (jsxRuntime.jsxs(Stack, { direction: "row", gap: 0.5, alignItems: "center", children: [jsxRuntime.jsx(Tooltip, { title: isNoRowsSelected
|
|
5767
|
-
? localization.exportSelectRowsTooltip
|
|
5768
|
-
: localization.exportButton, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(Button, { "aria-label": localization.exportButton, disabled: isNoRowsSelected, onClick: handleOpenMenu, size: "small", startIcon: jsxRuntime.jsx(FileDownloadIcon, { fontSize: "small" }), variant: "text", children: localization.exportButton }) }) }), jsxRuntime.jsxs(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleCloseMenu, anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'left' }, children: [jsxRuntime.jsxs(Stack, { direction: "row", sx: { px: 1, pt: 1, maxHeight: '320px', overflow: 'auto' }, children: [renderFormatSelector(), selectedFormat &&
|
|
5769
|
-
exportTypesForSelectedFormat.length > 0 &&
|
|
5770
|
-
renderExportTypeSelector()] }), jsxRuntime.jsx(Divider, { sx: { mt: 1 } }), jsxRuntime.jsxs(Stack, { direction: "row", alignItems: "center", sx: { px: 1, pb: 1 }, children: [renderActionButtons(), renderGroupedCheckbox()] })] })] }));
|
|
6233
|
+
return (jsxRuntime.jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton, Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter && showGlobalFilter, onClick: handleToggleSearch }, rest, { title: undefined, children: showGlobalFilter ? jsxRuntime.jsx(SearchOffIcon, {}) : jsxRuntime.jsx(SearchIcon, {}) })) }) }));
|
|
5771
6234
|
};
|
|
5772
6235
|
|
|
5773
6236
|
const MRT_ToolbarInternalButtons = (_a) => {
|
|
5774
6237
|
var _b;
|
|
5775
6238
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
5776
|
-
const { options: {
|
|
5777
|
-
const { activeExports } = table.getState();
|
|
6239
|
+
const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableGlobalFilter, enableHiding, initialState, enableAdvancedFilters, renderToolbarInternalActions, enableNewEntryButton, }, } = table;
|
|
5778
6240
|
return (jsxRuntime.jsx(Box, Object.assign({}, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', display: 'flex', zIndex: 3, gap: 1 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: (_b = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
|
5779
6241
|
table,
|
|
5780
6242
|
})) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters &&
|
|
5781
6243
|
enableGlobalFilter &&
|
|
5782
6244
|
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters &&
|
|
5783
6245
|
enableColumnFilters &&
|
|
5784
|
-
columnFilterDisplayMode !== 'popover' && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableAdvancedFilters && (jsxRuntime.jsx(MRT_ToggleAdvancedFiltersButton, { table: table })), enableAdvancedFilters && jsxRuntime.jsx(MRT_SavedFiltersButton, { table: table }),
|
|
5785
|
-
loadExport &&
|
|
5786
|
-
onActiveExportsChange &&
|
|
5787
|
-
activeExports && (jsxRuntime.jsx(MRT_ExportsToolbar, { table: table, availableExports: availableExports, exportState: activeExports, onExportStateChange: onActiveExportsChange, loadExport: loadExport })), enableNewEntryButton && jsxRuntime.jsx(MRT_NewEntryButton, { table: table })] })) })));
|
|
6246
|
+
columnFilterDisplayMode !== 'popover' && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableAdvancedFilters && (jsxRuntime.jsx(MRT_ToggleAdvancedFiltersButton, { table: table })), enableAdvancedFilters && jsxRuntime.jsx(MRT_SavedFiltersButton, { table: table }), enableNewEntryButton && jsxRuntime.jsx(MRT_NewEntryButton, { table: table })] })) })));
|
|
5788
6247
|
};
|
|
5789
6248
|
|
|
5790
6249
|
function ToolbarActions({ table, }) {
|
|
@@ -7601,7 +8060,7 @@ const MaterialReactTableComponent = (props, ref) => {
|
|
|
7601
8060
|
? props.table
|
|
7602
8061
|
: useMaterialReactTable(props);
|
|
7603
8062
|
react.useImperativeHandle(ref, () => table, [table]);
|
|
7604
|
-
return jsxRuntime.jsx(MRT_TablePaper, { table: table });
|
|
8063
|
+
return (jsxRuntime.jsx(MaybeSnackbarProvider, { children: jsxRuntime.jsx(MRT_TablePaper, { table: table }) }));
|
|
7605
8064
|
};
|
|
7606
8065
|
const MaterialReactTable = react.forwardRef(MaterialReactTableComponent);
|
|
7607
8066
|
|
|
@@ -7713,160 +8172,6 @@ const useServerTableState = ({ initialState, saveState, saveDebounceMs = 500, })
|
|
|
7713
8172
|
};
|
|
7714
8173
|
};
|
|
7715
8174
|
|
|
7716
|
-
const MRT_Localization_HR = {
|
|
7717
|
-
language: 'hr',
|
|
7718
|
-
actions: 'Radnje',
|
|
7719
|
-
and: 'i',
|
|
7720
|
-
booleanFalse: 'Ne',
|
|
7721
|
-
booleanTrue: 'Da',
|
|
7722
|
-
cancel: 'Odustani',
|
|
7723
|
-
close: 'Zatvori',
|
|
7724
|
-
changeFilterMode: 'Promijeni način filtriranja',
|
|
7725
|
-
changeSearchMode: 'Promijeni način pretraživanja',
|
|
7726
|
-
clearFilter: 'Očisti filtriranje',
|
|
7727
|
-
clearSearch: 'Očisti pretragu',
|
|
7728
|
-
clearSelection: 'Očisti odabir',
|
|
7729
|
-
clearSort: 'Očisti sortiranje',
|
|
7730
|
-
deselectAllOnAllPages: 'Poništi odabir na svim stranicama',
|
|
7731
|
-
deselectAllOnCurrentPage: 'Poništi odabir na trenutnoj stranici',
|
|
7732
|
-
clickToCopy: 'Klikni za kopiranje',
|
|
7733
|
-
copy: 'Kopiraj',
|
|
7734
|
-
collapse: 'Sažmi',
|
|
7735
|
-
collapseAll: 'Sažmi sve',
|
|
7736
|
-
columnActions: 'Radnje s stupcima',
|
|
7737
|
-
columns: 'Kolone',
|
|
7738
|
-
copiedToClipboard: 'Kopirano u međuspremnik',
|
|
7739
|
-
dropToGroupBy: 'Ispusti za grupiranje po {column}',
|
|
7740
|
-
edit: 'Uredi',
|
|
7741
|
-
expand: 'Proširi',
|
|
7742
|
-
expandAll: 'Proširi sve',
|
|
7743
|
-
filterArrIncludes: 'Uključuje',
|
|
7744
|
-
filterArrIncludesAll: 'Uključuje sve',
|
|
7745
|
-
filterArrIncludesSome: 'Uključuje',
|
|
7746
|
-
filterBetween: 'Između',
|
|
7747
|
-
filterBetweenInclusive: 'Između uključivo',
|
|
7748
|
-
filterByColumn: 'Filtriraj po {column}',
|
|
7749
|
-
filterFrom: 'Od',
|
|
7750
|
-
filterTo: 'Do',
|
|
7751
|
-
filterContains: 'Sadrži',
|
|
7752
|
-
filterEmpty: 'Prazno',
|
|
7753
|
-
filterEndsWith: 'Završava s',
|
|
7754
|
-
filterEquals: 'Jednako',
|
|
7755
|
-
filterEqualsString: 'Jednako',
|
|
7756
|
-
filterFuzzy: 'Maglovito',
|
|
7757
|
-
filterGreaterThan: 'Veće od',
|
|
7758
|
-
filterGreaterThanOrEqualTo: 'Veće od ili jednako',
|
|
7759
|
-
filterInArray: 'Je jedno od',
|
|
7760
|
-
filterIsAnyOf: 'Je jedno od',
|
|
7761
|
-
filterInNumberRange: 'Između',
|
|
7762
|
-
filterIncludesString: 'Sadrži',
|
|
7763
|
-
filterIncludesStringSensitive: 'Sadrži',
|
|
7764
|
-
filterLessThan: 'Manje od',
|
|
7765
|
-
filterLessThanOrEqualTo: 'Manje od ili jednako',
|
|
7766
|
-
filterMode: 'Način filtriranja: {filterType}',
|
|
7767
|
-
filterNoOptions: 'Nema dostupnih opcija za filtriranje',
|
|
7768
|
-
filterNotEmpty: 'Nije prazno',
|
|
7769
|
-
filterNotEquals: 'Nije jednako',
|
|
7770
|
-
filterNotContains: 'Ne sadrži',
|
|
7771
|
-
filterLogic: 'Logika',
|
|
7772
|
-
filterOperator: 'Operator',
|
|
7773
|
-
filterStartsWith: 'Počinje s',
|
|
7774
|
-
filterWeakEquals: 'Jednako',
|
|
7775
|
-
filterCurrentWeek: 'Trenutni tjedan',
|
|
7776
|
-
filterCurrentMonth: 'Trenutni mjesec',
|
|
7777
|
-
filterLast7Days: 'Zadnjih 7 dana',
|
|
7778
|
-
filterLastWeek: 'Prošli tjedan',
|
|
7779
|
-
filterLastMonth: 'Prošli mjesec',
|
|
7780
|
-
filterFromToday: 'Od danas',
|
|
7781
|
-
filterToToday: 'Do danas',
|
|
7782
|
-
filteringByColumn: 'Filtriranje po {column} - {filterType} {filterValue}',
|
|
7783
|
-
goToFirstPage: 'Idi na prvu stranicu',
|
|
7784
|
-
goToLastPage: 'Idi na zadnju stranicu',
|
|
7785
|
-
goToNextPage: 'Idi na sljedeću stranicu',
|
|
7786
|
-
goToPreviousPage: 'Idi na prethodnu stranicu',
|
|
7787
|
-
grab: 'Uhvati',
|
|
7788
|
-
groupByColumn: 'Grupiraj po {column}',
|
|
7789
|
-
groupedBy: 'Grupirano po ',
|
|
7790
|
-
hideAll: 'Sakrij sve',
|
|
7791
|
-
hideColumn: 'Sakrij stupac {column}',
|
|
7792
|
-
max: 'Maks.',
|
|
7793
|
-
min: 'Min.',
|
|
7794
|
-
move: 'Premjesti',
|
|
7795
|
-
noRecordsToDisplay: 'Nema zapisa za prikaz',
|
|
7796
|
-
noResultsFound: 'Nema pronađenih rezultata',
|
|
7797
|
-
moreThan: 'više od',
|
|
7798
|
-
of: 'od',
|
|
7799
|
-
or: 'ili',
|
|
7800
|
-
pin: 'Prikači',
|
|
7801
|
-
pinToLeft: 'Prikači na lijevo',
|
|
7802
|
-
pinToRight: 'Prikači na desno',
|
|
7803
|
-
resetColumnSize: 'Resetiraj veličinu stupca',
|
|
7804
|
-
resetOrder: 'Resetiraj redoslijed',
|
|
7805
|
-
rowActions: 'Radnje retka',
|
|
7806
|
-
rowNumber: '#',
|
|
7807
|
-
countRows: 'Izbroji redove',
|
|
7808
|
-
countRowsTooltip: 'Izbroji ukupan broj redova za trenutne filtere',
|
|
7809
|
-
rowCount: 'Broj redova',
|
|
7810
|
-
rowNumbers: 'Brojevi redaka',
|
|
7811
|
-
rowsPerPage: 'Redaka po stranici',
|
|
7812
|
-
rowsSelected: '{count} odabranih redova',
|
|
7813
|
-
save: 'Spremi',
|
|
7814
|
-
search: 'Pretraži',
|
|
7815
|
-
selectedCountOfRowCountRowsSelected: '{selectedCount} od {rowCount} odabranih redaka',
|
|
7816
|
-
select: 'Odaberi',
|
|
7817
|
-
selectAllOnAllPages: 'Odaberi sve na svim stranicama',
|
|
7818
|
-
selectAllOnCurrentPage: 'Odaberi sve na trenutnoj stranici',
|
|
7819
|
-
showAll: 'Prikaži sve',
|
|
7820
|
-
showAllColumns: 'Prikaži sve stupce',
|
|
7821
|
-
showHideColumns: 'Kolone',
|
|
7822
|
-
showHideFilters: 'Prikaži/sakrij filtere',
|
|
7823
|
-
showHideSearch: 'Prikaži/sakrij pretragu',
|
|
7824
|
-
showAdvancedFilters: 'Prikaži napredne filtere',
|
|
7825
|
-
advancedFilters: 'Napredni filteri',
|
|
7826
|
-
filters: 'Filteri',
|
|
7827
|
-
add: 'Dodaj',
|
|
7828
|
-
newEntry: 'Novi unos',
|
|
7829
|
-
clear: 'Očisti',
|
|
7830
|
-
discardChanges: 'Odbaci izmjene',
|
|
7831
|
-
saveFilters: 'Spremi filtere',
|
|
7832
|
-
savedFilters: 'Spremljeni filteri',
|
|
7833
|
-
noSavedFilters: 'Nema spremljenih filtera',
|
|
7834
|
-
filterName: 'Naziv filtera',
|
|
7835
|
-
apply: 'Primijeni',
|
|
7836
|
-
sortByColumnAsc: 'Sortiraj po {column} uzlazno',
|
|
7837
|
-
sortByColumnDesc: 'Sortiraj po {column} silazno',
|
|
7838
|
-
sortedByColumnAsc: 'Sortirano po {column} uzlazno',
|
|
7839
|
-
sortedByColumnDesc: 'Sortirano po {column} silazno',
|
|
7840
|
-
thenBy: ', zatim po ',
|
|
7841
|
-
toggleDensity: 'Gustoća',
|
|
7842
|
-
toggleFullScreen: 'Prebaci u puni zaslon',
|
|
7843
|
-
toggleSelectAll: 'Prebaci odabir svih',
|
|
7844
|
-
toggleSelectRow: 'Prebaci odabir retka',
|
|
7845
|
-
toggleVisibility: 'Prebaci vidljivost',
|
|
7846
|
-
ungroupByColumn: 'Razgrupiraj po {column}',
|
|
7847
|
-
unpin: 'Odkači',
|
|
7848
|
-
unpinAll: 'Odkači sve',
|
|
7849
|
-
dimensionRotationEnabled: 'Rotacija ukljucena',
|
|
7850
|
-
dimensionRotationDisabled: 'Rotacija iskljucena',
|
|
7851
|
-
length: 'Dužina',
|
|
7852
|
-
width: 'Širina',
|
|
7853
|
-
height: 'Visina',
|
|
7854
|
-
depth: 'Dubina',
|
|
7855
|
-
tolerance: 'Tolerancija',
|
|
7856
|
-
exportButton: 'Izvoz',
|
|
7857
|
-
exportSelectRowsTooltip: 'Odaberite redove za izvoz',
|
|
7858
|
-
exportPrintPdf: 'Ispis PDF',
|
|
7859
|
-
exportDownload: 'Preuzmi',
|
|
7860
|
-
exportGrouped: 'Grupirati datoteke',
|
|
7861
|
-
deleteConfirmationTitle: 'Brisanje reda',
|
|
7862
|
-
deleteConfirmationMessage: 'Da li ste sigurni da želite izbrisati ovaj red?',
|
|
7863
|
-
deleteConfirmYes: 'Izbriši',
|
|
7864
|
-
deleteConfirmNo: 'Odustani',
|
|
7865
|
-
deleteConfirmDeleting: 'Brisanje...',
|
|
7866
|
-
resetState: 'Resetuj stanje',
|
|
7867
|
-
tableOptions: 'Opcije',
|
|
7868
|
-
};
|
|
7869
|
-
|
|
7870
8175
|
function createColumnDef(column) {
|
|
7871
8176
|
if (column.type === 'object' || column.type === 'actions') {
|
|
7872
8177
|
return column;
|
|
@@ -7986,8 +8291,30 @@ const MaterialReactServerTableInstance = (_a) => {
|
|
|
7986
8291
|
return jsxRuntime.jsx(MaterialReactTable, { table: table });
|
|
7987
8292
|
};
|
|
7988
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
|
+
|
|
7989
8315
|
const MaterialReactServerTable = (_a) => {
|
|
7990
|
-
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);
|
|
7991
8318
|
const [configLoading, setConfigLoading] = react.useState(true);
|
|
7992
8319
|
const [config, setConfig] = react.useState(null);
|
|
7993
8320
|
react.useEffect(() => {
|
|
@@ -8016,10 +8343,10 @@ const MaterialReactServerTable = (_a) => {
|
|
|
8016
8343
|
};
|
|
8017
8344
|
}, [loadConfig]);
|
|
8018
8345
|
if (configLoading) {
|
|
8019
|
-
return jsxRuntime.jsx(
|
|
8346
|
+
return jsxRuntime.jsx(MaterialReactServerTableSkeleton, {});
|
|
8020
8347
|
}
|
|
8021
8348
|
if (!config) {
|
|
8022
|
-
return jsxRuntime.jsx(
|
|
8349
|
+
return (jsxRuntime.jsx(MaterialReactServerTableError, { description: mergedLocalization.serverTableErrorMessage }));
|
|
8023
8350
|
}
|
|
8024
8351
|
return (jsxRuntime.jsx(MaterialReactServerTableInstance, Object.assign({ config: config, saveState: saveState }, instanceProps)));
|
|
8025
8352
|
};
|