wcz-test 2.7.0 → 2.9.0
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 +20 -18
- package/dist/index.js +255 -130
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1038,9 +1038,32 @@ var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...p
|
|
|
1038
1038
|
] });
|
|
1039
1039
|
};
|
|
1040
1040
|
|
|
1041
|
+
// src/index.ts
|
|
1042
|
+
import { PageHeader } from "@toolpad/core/PageContainer";
|
|
1043
|
+
|
|
1044
|
+
// src/components/core/PageContainer.tsx
|
|
1045
|
+
import { Container } from "@mui/material";
|
|
1046
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1047
|
+
var PageContainer = (props) => {
|
|
1048
|
+
return /* @__PURE__ */ jsx2(
|
|
1049
|
+
Container,
|
|
1050
|
+
{
|
|
1051
|
+
sx: {
|
|
1052
|
+
display: "flex",
|
|
1053
|
+
flexDirection: "column",
|
|
1054
|
+
height: "100vh",
|
|
1055
|
+
my: 1,
|
|
1056
|
+
...props.sx
|
|
1057
|
+
},
|
|
1058
|
+
...props,
|
|
1059
|
+
children: props.children
|
|
1060
|
+
}
|
|
1061
|
+
);
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1041
1064
|
// src/components/data-grid/ChipInputCell.tsx
|
|
1042
1065
|
import { Chip, Stack as Stack2 } from "@mui/material";
|
|
1043
|
-
import { jsx as
|
|
1066
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
1044
1067
|
var isArray = (value) => Array.isArray(value);
|
|
1045
1068
|
var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
1046
1069
|
if (!params.value) return null;
|
|
@@ -1049,81 +1072,100 @@ var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
|
1049
1072
|
return value;
|
|
1050
1073
|
};
|
|
1051
1074
|
if (isArray(params.value))
|
|
1052
|
-
return /* @__PURE__ */
|
|
1053
|
-
(value, index) => /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ jsx3(Stack2, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
|
|
1076
|
+
(value, index) => /* @__PURE__ */ jsx3(Chip, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
|
|
1054
1077
|
) });
|
|
1055
|
-
return /* @__PURE__ */
|
|
1078
|
+
return /* @__PURE__ */ jsx3(Chip, { label: getLabelValue(params.value), ...slotProps });
|
|
1056
1079
|
};
|
|
1057
1080
|
|
|
1058
1081
|
// src/components/data-grid/EditableColumnHeader.tsx
|
|
1059
1082
|
import { Edit } from "@mui/icons-material";
|
|
1060
|
-
import { jsx as
|
|
1083
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1061
1084
|
var EditableColumnHeader = ({ colDef }) => {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1085
|
+
return /* @__PURE__ */ jsx4(TypographyWithIcon, { endIcon: /* @__PURE__ */ jsx4(Edit, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
|
|
1063
1086
|
};
|
|
1064
1087
|
|
|
1065
1088
|
// src/components/router/RouterButton.tsx
|
|
1066
1089
|
import { Button } from "@mui/material";
|
|
1067
1090
|
import { createLink } from "@tanstack/react-router";
|
|
1068
1091
|
import React from "react";
|
|
1069
|
-
import { jsx as
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1092
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1093
|
+
var Component = React.forwardRef((props, ref) => /* @__PURE__ */ jsx5(Button, { ref, component: "a", ...props }));
|
|
1094
|
+
var CreatedComponent = createLink(Component);
|
|
1072
1095
|
var RouterButton = (props) => {
|
|
1073
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ jsx5(CreatedComponent, { preload: "intent", ...props });
|
|
1074
1097
|
};
|
|
1075
1098
|
|
|
1076
|
-
// src/components/router/
|
|
1077
|
-
import {
|
|
1099
|
+
// src/components/router/RouterGridActionsCellItem.tsx
|
|
1100
|
+
import { GridActionsCellItem } from "@mui/x-data-grid-premium";
|
|
1078
1101
|
import { createLink as createLink2 } from "@tanstack/react-router";
|
|
1079
1102
|
import React2 from "react";
|
|
1080
|
-
import { jsx as
|
|
1081
|
-
var
|
|
1082
|
-
(props, ref) => /* @__PURE__ */
|
|
1103
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1104
|
+
var Component2 = React2.forwardRef(
|
|
1105
|
+
(props, ref) => /* @__PURE__ */ jsx6(GridActionsCellItem, { ref, component: "a", ...props })
|
|
1083
1106
|
);
|
|
1084
|
-
var
|
|
1107
|
+
var CreatedComponent2 = createLink2(Component2);
|
|
1108
|
+
var RouterGridActionsCellItem = (props) => {
|
|
1109
|
+
return /* @__PURE__ */ jsx6(CreatedComponent2, { preload: "intent", ...props });
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
// src/components/router/RouterIconButton.tsx
|
|
1113
|
+
import { IconButton } from "@mui/material";
|
|
1114
|
+
import { createLink as createLink3 } from "@tanstack/react-router";
|
|
1115
|
+
import React3 from "react";
|
|
1116
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1117
|
+
var Component3 = React3.forwardRef((props, ref) => /* @__PURE__ */ jsx7(IconButton, { ref, component: "a", ...props }));
|
|
1118
|
+
var CreatedComponent3 = createLink3(Component3);
|
|
1119
|
+
var RouterIconButton = (props) => {
|
|
1120
|
+
return /* @__PURE__ */ jsx7(CreatedComponent3, { preload: "intent", ...props });
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
// src/components/router/RouterLink.tsx
|
|
1124
|
+
import { Link } from "@mui/material";
|
|
1125
|
+
import { createLink as createLink4 } from "@tanstack/react-router";
|
|
1126
|
+
import React4 from "react";
|
|
1127
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1128
|
+
var Component4 = React4.forwardRef((props, ref) => /* @__PURE__ */ jsx8(Link, { ref, ...props }));
|
|
1129
|
+
var CreatedComponent4 = createLink4(Component4);
|
|
1085
1130
|
var RouterLink = (props) => {
|
|
1086
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ jsx8(CreatedComponent4, { preload: "intent", ...props });
|
|
1087
1132
|
};
|
|
1088
1133
|
|
|
1089
1134
|
// src/components/router/RouterTab.tsx
|
|
1090
1135
|
import { Tab } from "@mui/material";
|
|
1091
|
-
import { createLink as
|
|
1092
|
-
import
|
|
1093
|
-
import { jsx as
|
|
1094
|
-
var
|
|
1095
|
-
var
|
|
1136
|
+
import { createLink as createLink5 } from "@tanstack/react-router";
|
|
1137
|
+
import React5 from "react";
|
|
1138
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1139
|
+
var Component5 = React5.forwardRef((props, ref) => /* @__PURE__ */ jsx9(Tab, { ref, component: "a", ...props }));
|
|
1140
|
+
var CreatedComponent5 = createLink5(Component5);
|
|
1096
1141
|
var RouterTab = (props) => {
|
|
1097
|
-
return /* @__PURE__ */
|
|
1142
|
+
return /* @__PURE__ */ jsx9(CreatedComponent5, { preload: "intent", ...props });
|
|
1098
1143
|
};
|
|
1099
1144
|
|
|
1100
1145
|
// src/components/router/RouterNotFound.tsx
|
|
1101
1146
|
import { Box, Divider, Typography as Typography2 } from "@mui/material";
|
|
1102
1147
|
import { useTranslation } from "react-i18next";
|
|
1103
|
-
import { jsx as
|
|
1148
|
+
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1104
1149
|
function RouterNotFound() {
|
|
1105
1150
|
const { t } = useTranslation();
|
|
1106
|
-
return /* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1109
|
-
/* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ jsx10(Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ jsxs2(Box, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
1152
|
+
/* @__PURE__ */ jsx10(Typography2, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
|
|
1153
|
+
/* @__PURE__ */ jsx10(Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1154
|
+
/* @__PURE__ */ jsx10(Typography2, { variant: "h5", component: "span", children: t("Layout.ThisPageCouldNotBeFound") })
|
|
1110
1155
|
] }) });
|
|
1111
1156
|
}
|
|
1112
1157
|
|
|
1113
1158
|
// src/components/router/RouterError.tsx
|
|
1114
1159
|
import { Box as Box2, Divider as Divider2, Typography as Typography3 } from "@mui/material";
|
|
1115
|
-
import { jsx as
|
|
1160
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1116
1161
|
var RouterError = ({ error }) => {
|
|
1117
|
-
return /* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ jsx11(Box2, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ jsxs3(Box2, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
1163
|
+
/* @__PURE__ */ jsx11(Typography3, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "500" }),
|
|
1164
|
+
/* @__PURE__ */ jsx11(Divider2, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1165
|
+
/* @__PURE__ */ jsx11(Typography3, { variant: "h5", component: "span", children: error.message })
|
|
1121
1166
|
] }) });
|
|
1122
1167
|
};
|
|
1123
1168
|
|
|
1124
|
-
// src/index.ts
|
|
1125
|
-
import { PageContainer, PageHeader } from "@toolpad/core/PageContainer";
|
|
1126
|
-
|
|
1127
1169
|
// src/providers/LayoutProvider.tsx
|
|
1128
1170
|
import { LinearProgress, useMediaQuery } from "@mui/material";
|
|
1129
1171
|
|
|
@@ -1151,11 +1193,11 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
1151
1193
|
|
|
1152
1194
|
// node_modules/@mui/x-date-pickers/esm/LocalizationProvider/LocalizationProvider.js
|
|
1153
1195
|
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
1154
|
-
import * as
|
|
1196
|
+
import * as React6 from "react";
|
|
1155
1197
|
import { useThemeProps } from "@mui/material/styles";
|
|
1156
1198
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1157
1199
|
var _excluded = ["localeText"];
|
|
1158
|
-
var MuiPickersAdapterContext = /* @__PURE__ */
|
|
1200
|
+
var MuiPickersAdapterContext = /* @__PURE__ */ React6.createContext(null);
|
|
1159
1201
|
if (process.env.NODE_ENV !== "production") MuiPickersAdapterContext.displayName = "MuiPickersAdapterContext";
|
|
1160
1202
|
var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
1161
1203
|
const {
|
|
@@ -1164,7 +1206,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1164
1206
|
const {
|
|
1165
1207
|
utils: parentUtils,
|
|
1166
1208
|
localeText: parentLocaleText
|
|
1167
|
-
} =
|
|
1209
|
+
} = React6.useContext(MuiPickersAdapterContext) ?? {
|
|
1168
1210
|
utils: void 0,
|
|
1169
1211
|
localeText: void 0
|
|
1170
1212
|
};
|
|
@@ -1182,8 +1224,8 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1182
1224
|
adapterLocale,
|
|
1183
1225
|
localeText: themeLocaleText
|
|
1184
1226
|
} = props;
|
|
1185
|
-
const localeText =
|
|
1186
|
-
const utils =
|
|
1227
|
+
const localeText = React6.useMemo(() => _extends({}, themeLocaleText, parentLocaleText, inLocaleText), [themeLocaleText, parentLocaleText, inLocaleText]);
|
|
1228
|
+
const utils = React6.useMemo(() => {
|
|
1187
1229
|
if (!DateAdapter) {
|
|
1188
1230
|
if (parentUtils) {
|
|
1189
1231
|
return parentUtils;
|
|
@@ -1201,7 +1243,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1201
1243
|
}
|
|
1202
1244
|
return adapter;
|
|
1203
1245
|
}, [DateAdapter, adapterLocale, dateFormats, dateLibInstance, parentUtils]);
|
|
1204
|
-
const defaultDates =
|
|
1246
|
+
const defaultDates = React6.useMemo(() => {
|
|
1205
1247
|
if (!utils) {
|
|
1206
1248
|
return null;
|
|
1207
1249
|
}
|
|
@@ -1210,7 +1252,7 @@ var LocalizationProvider = function LocalizationProvider2(inProps) {
|
|
|
1210
1252
|
maxDate: utils.date("2099-12-31T00:00:00.000")
|
|
1211
1253
|
};
|
|
1212
1254
|
}, [utils]);
|
|
1213
|
-
const contextValue =
|
|
1255
|
+
const contextValue = React6.useMemo(() => {
|
|
1214
1256
|
return {
|
|
1215
1257
|
utils,
|
|
1216
1258
|
defaultDates,
|
|
@@ -1803,26 +1845,26 @@ var LayoutContext = createContext2({});
|
|
|
1803
1845
|
var useLayout = () => useContext2(LayoutContext);
|
|
1804
1846
|
|
|
1805
1847
|
// src/components/core/AppTitle.tsx
|
|
1806
|
-
import { jsx as
|
|
1848
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1807
1849
|
var AppTitle = () => {
|
|
1808
1850
|
const { appTitle } = useLayout();
|
|
1809
1851
|
return /* @__PURE__ */ jsxs4(Stack3, { direction: "row", alignItems: "center", spacing: 2, children: [
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ jsx12("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
1853
|
+
/* @__PURE__ */ jsx12(Typography4, { variant: "h6", children: appTitle })
|
|
1812
1854
|
] });
|
|
1813
1855
|
};
|
|
1814
1856
|
|
|
1815
1857
|
// src/components/core/DevelopmentBanner.tsx
|
|
1816
1858
|
import { Close } from "@mui/icons-material";
|
|
1817
|
-
import { Fade, Grid, IconButton, Paper, Typography as Typography5 } from "@mui/material";
|
|
1859
|
+
import { Fade, Grid, IconButton as IconButton2, Paper, Typography as Typography5 } from "@mui/material";
|
|
1818
1860
|
import { useState } from "react";
|
|
1819
1861
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1820
|
-
import { jsx as
|
|
1862
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1821
1863
|
var DevelopmentBanner = ({ hasNavigationRoutes }) => {
|
|
1822
1864
|
const { t } = useTranslation2();
|
|
1823
1865
|
const [bannerOpen, setBannerOpen] = useState(true);
|
|
1824
1866
|
const closeBanner = () => setBannerOpen(false);
|
|
1825
|
-
return /* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ jsx13(Fade, { appear: false, in: bannerOpen, children: /* @__PURE__ */ jsx13(Paper, { square: true, elevation: 3, tabIndex: -1, sx: {
|
|
1826
1868
|
position: "fixed",
|
|
1827
1869
|
bottom: 0,
|
|
1828
1870
|
left: { xs: 0, sm: hasNavigationRoutes ? 83.3 : 0 },
|
|
@@ -1833,19 +1875,19 @@ var DevelopmentBanner = ({ hasNavigationRoutes }) => {
|
|
|
1833
1875
|
borderTopWidth: 1
|
|
1834
1876
|
}, children: /* @__PURE__ */ jsxs5(Grid, { container: true, justifyContent: "space-between", alignItems: "center", children: [
|
|
1835
1877
|
/* @__PURE__ */ jsxs5(Grid, { size: 10, children: [
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1878
|
+
/* @__PURE__ */ jsx13(Typography5, { fontWeight: "bold", children: t("Layout.DevelopmentDialogTitle") }),
|
|
1879
|
+
/* @__PURE__ */ jsx13(Typography5, { variant: "body2", children: t("Layout.DevelopmentDialogContent") })
|
|
1838
1880
|
] }),
|
|
1839
|
-
/* @__PURE__ */
|
|
1881
|
+
/* @__PURE__ */ jsx13(Grid, { size: 2, sx: { p: 1, textAlign: "right" }, children: /* @__PURE__ */ jsx13(IconButton2, { size: "small", onClick: closeBanner, children: /* @__PURE__ */ jsx13(Close, {}) }) })
|
|
1840
1882
|
] }) }) });
|
|
1841
1883
|
};
|
|
1842
1884
|
|
|
1843
1885
|
// src/components/core/ToolbarAccount.tsx
|
|
1844
1886
|
import { AccountCircle, ArrowBack, Brightness4, ChevronRight, DarkMode, LightMode, Login, Logout, SettingsBrightness, Translate } from "@mui/icons-material";
|
|
1845
|
-
import { Avatar, Box as Box3, IconButton as
|
|
1887
|
+
import { Avatar, Box as Box3, IconButton as IconButton3, List, ListItem, ListItemButton, ListItemIcon, ListItemText, ListSubheader, Menu, Typography as Typography6, useColorScheme } from "@mui/material";
|
|
1846
1888
|
import { Fragment, useState as useState2 } from "react";
|
|
1847
1889
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1848
|
-
import { jsx as
|
|
1890
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1849
1891
|
var user = {
|
|
1850
1892
|
name: "Dalibor Homola",
|
|
1851
1893
|
employeeId: "C2503017",
|
|
@@ -1889,63 +1931,63 @@ var ToolbarAccount = () => {
|
|
|
1889
1931
|
setAnchorEl(null);
|
|
1890
1932
|
setTimeout(() => setTab("settings"), 300);
|
|
1891
1933
|
};
|
|
1892
|
-
const
|
|
1893
|
-
const
|
|
1934
|
+
const login2 = () => user.login();
|
|
1935
|
+
const logout2 = () => user.logout();
|
|
1894
1936
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
1895
|
-
const settings = /* @__PURE__ */ jsxs6(List, { component: "nav", subheader: /* @__PURE__ */
|
|
1937
|
+
const settings = /* @__PURE__ */ jsxs6(List, { component: "nav", subheader: /* @__PURE__ */ jsx14(ListSubheader, { sx: { backgroundColor: "transparent" }, children: t("Layout.Settings") }), children: [
|
|
1896
1938
|
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(Brightness4, {}) }),
|
|
1940
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.Appearance"), secondary: getModeText() }),
|
|
1941
|
+
/* @__PURE__ */ jsx14(ChevronRight, {})
|
|
1900
1942
|
] }),
|
|
1901
1943
|
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(Translate, {}) }),
|
|
1945
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.Language"), secondary: i18n2.resolvedLanguage === "en" ? "English" : "\u010Ce\u0161tina" }),
|
|
1946
|
+
/* @__PURE__ */ jsx14(ChevronRight, {})
|
|
1905
1947
|
] })
|
|
1906
1948
|
] });
|
|
1907
1949
|
const theme = /* @__PURE__ */ jsxs6(List, { subheader: /* @__PURE__ */ jsxs6(ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
1908
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ jsx14(IconButton3, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx14(ArrowBack, { fontSize: "small" }) }),
|
|
1909
1951
|
" ",
|
|
1910
1952
|
t("Layout.Appearance")
|
|
1911
1953
|
] }), children: [
|
|
1912
1954
|
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: changeMode("light"), disabled: mode === "light", children: [
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(LightMode, {}) }),
|
|
1956
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.Light") })
|
|
1915
1957
|
] }),
|
|
1916
1958
|
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: changeMode("dark"), disabled: mode === "dark", children: [
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1959
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(DarkMode, {}) }),
|
|
1960
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.Dark") })
|
|
1919
1961
|
] }),
|
|
1920
1962
|
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: changeMode("system"), disabled: mode === "system", children: [
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1963
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(SettingsBrightness, {}) }),
|
|
1964
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.System") })
|
|
1923
1965
|
] })
|
|
1924
1966
|
] });
|
|
1925
1967
|
const language = /* @__PURE__ */ jsxs6(List, { subheader: /* @__PURE__ */ jsxs6(ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx14(IconButton3, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx14(ArrowBack, { fontSize: "small" }) }),
|
|
1927
1969
|
" ",
|
|
1928
1970
|
t("Layout.Language")
|
|
1929
1971
|
] }), children: [
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ jsx14(ListItemButton, { onClick: changeLanguage("en"), disabled: i18n2.resolvedLanguage === "en", children: /* @__PURE__ */ jsx14(ListItemText, { primary: "English" }) }),
|
|
1973
|
+
/* @__PURE__ */ jsx14(ListItemButton, { onClick: changeLanguage("cs"), disabled: i18n2.resolvedLanguage === "cs", children: /* @__PURE__ */ jsx14(ListItemText, { primary: "\u010Ce\u0161tina" }) })
|
|
1932
1974
|
] });
|
|
1933
1975
|
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1976
|
+
/* @__PURE__ */ jsx14(IconButton3, { size: "small", onClick: openMenu, children: user.name ? /* @__PURE__ */ jsx14(Avatar, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ jsx14(Typography6, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) : /* @__PURE__ */ jsx14(AccountCircle, {}) }),
|
|
1977
|
+
/* @__PURE__ */ jsx14(Menu, { anchorEl, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs6(Box3, { sx: { width: 240 }, children: [
|
|
1978
|
+
/* @__PURE__ */ jsx14(List, { children: user.name ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1979
|
+
/* @__PURE__ */ jsx14(ListItem, { children: /* @__PURE__ */ jsx14(ListItemText, { primary: user.name, secondary: /* @__PURE__ */ jsxs6("span", { children: [
|
|
1980
|
+
/* @__PURE__ */ jsx14("span", { children: user.employeeId }),
|
|
1981
|
+
/* @__PURE__ */ jsx14("br", {}),
|
|
1982
|
+
/* @__PURE__ */ jsx14("span", { children: user.department })
|
|
1941
1983
|
] }) }) }),
|
|
1942
|
-
/* @__PURE__ */ jsxs6(ListItemButton, { onClick:
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: logout2, children: [
|
|
1985
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(Logout, { color: "error" }) }),
|
|
1986
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.Logout") })
|
|
1945
1987
|
] })
|
|
1946
|
-
] }) : /* @__PURE__ */ jsxs6(ListItemButton, { onClick:
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
1988
|
+
] }) : /* @__PURE__ */ jsxs6(ListItemButton, { onClick: login2, children: [
|
|
1989
|
+
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(Login, { color: "success" }) }),
|
|
1990
|
+
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.LogIn") })
|
|
1949
1991
|
] }) }),
|
|
1950
1992
|
tab === "settings" && settings,
|
|
1951
1993
|
tab === "theme" && theme,
|
|
@@ -1965,6 +2007,80 @@ import { useTranslation as useTranslation4 } from "react-i18next";
|
|
|
1965
2007
|
// src/utils/ClientUtils.ts
|
|
1966
2008
|
import { useQueryClient } from "@tanstack/react-query";
|
|
1967
2009
|
import axios from "axios";
|
|
2010
|
+
|
|
2011
|
+
// src/services/UserService.ts
|
|
2012
|
+
import Keycloak from "keycloak-js";
|
|
2013
|
+
var keycloakConfig = {
|
|
2014
|
+
url: "https://keycloak.example.com/auth",
|
|
2015
|
+
realm: "example-realm",
|
|
2016
|
+
clientId: "example-client"
|
|
2017
|
+
};
|
|
2018
|
+
var _kc = new Keycloak({
|
|
2019
|
+
url: keycloakConfig.url,
|
|
2020
|
+
realm: keycloakConfig.realm,
|
|
2021
|
+
clientId: keycloakConfig.clientId
|
|
2022
|
+
});
|
|
2023
|
+
var initKeycloak = async () => {
|
|
2024
|
+
if (typeof window === "undefined") return;
|
|
2025
|
+
const authenticated = await _kc.init({ onLoad: "check-sso" });
|
|
2026
|
+
if (authenticated) {
|
|
2027
|
+
return await loadUserInfo();
|
|
2028
|
+
} else {
|
|
2029
|
+
await _kc.login({ idpHint: keycloakConfig.idpHint });
|
|
2030
|
+
return await loadUserInfo();
|
|
2031
|
+
}
|
|
2032
|
+
};
|
|
2033
|
+
var login = _kc.login;
|
|
2034
|
+
var logout = _kc.logout;
|
|
2035
|
+
var getToken = () => {
|
|
2036
|
+
if (_kc.token) {
|
|
2037
|
+
return _kc.token;
|
|
2038
|
+
} else {
|
|
2039
|
+
return getConfidentialToken();
|
|
2040
|
+
}
|
|
2041
|
+
};
|
|
2042
|
+
var getConfidentialToken = async () => {
|
|
2043
|
+
const { confidentialClientId, confidentialClientSecret, url, realm } = keycloakConfig;
|
|
2044
|
+
if (!confidentialClientId || !confidentialClientSecret)
|
|
2045
|
+
throw new Error("Confidential client id or secret is missing");
|
|
2046
|
+
const credentials = btoa(`${confidentialClientId}:${confidentialClientSecret}`);
|
|
2047
|
+
const urlencoded = new URLSearchParams({ grant_type: "client_credentials" });
|
|
2048
|
+
const response = await fetch(`${url}/realms/${realm}/protocol/openid-connect/token`, {
|
|
2049
|
+
method: "POST",
|
|
2050
|
+
headers: {
|
|
2051
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
2052
|
+
"Authorization": `Basic ${credentials}`
|
|
2053
|
+
},
|
|
2054
|
+
body: urlencoded
|
|
2055
|
+
});
|
|
2056
|
+
if (!response.ok)
|
|
2057
|
+
throw new Error("Failed to obtain confidential token");
|
|
2058
|
+
const data = await response.json();
|
|
2059
|
+
return data.access_token;
|
|
2060
|
+
};
|
|
2061
|
+
var updateToken = () => _kc.updateToken(30).catch(login);
|
|
2062
|
+
var hasRole = (roles) => roles.some((role) => _kc.hasRealmRole(role) || _kc.hasResourceRole(role));
|
|
2063
|
+
var loadUserInfo = async () => {
|
|
2064
|
+
const user2 = await _kc.loadUserInfo();
|
|
2065
|
+
return {
|
|
2066
|
+
name: user2.name,
|
|
2067
|
+
employeeId: user2.employeeId?.toUpperCase() ?? "",
|
|
2068
|
+
department: user2.department ?? "",
|
|
2069
|
+
email: user2.email,
|
|
2070
|
+
company: user2.company,
|
|
2071
|
+
category: user2.category
|
|
2072
|
+
};
|
|
2073
|
+
};
|
|
2074
|
+
var UserService = {
|
|
2075
|
+
initKeycloak,
|
|
2076
|
+
login,
|
|
2077
|
+
logout,
|
|
2078
|
+
getToken,
|
|
2079
|
+
updateToken,
|
|
2080
|
+
hasRole
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
// src/utils/ClientUtils.ts
|
|
1968
2084
|
var Platform = class {
|
|
1969
2085
|
static isAndroid = /android/i.test(navigator.userAgent);
|
|
1970
2086
|
static isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
@@ -1997,6 +2113,9 @@ var rootRouteHead = ({ title, themeColor }) => () => ({
|
|
|
1997
2113
|
});
|
|
1998
2114
|
var wczApiClient = axios.create();
|
|
1999
2115
|
wczApiClient.interceptors.request.use(async (config) => {
|
|
2116
|
+
await UserService.updateToken();
|
|
2117
|
+
const token = await UserService.getToken();
|
|
2118
|
+
config.headers.Authorization = `Bearer ${token}`;
|
|
2000
2119
|
return config;
|
|
2001
2120
|
});
|
|
2002
2121
|
var WISTRON_PRIMARY_COLOR = "#00506E";
|
|
@@ -2060,10 +2179,7 @@ var useGetTheme = (theme) => {
|
|
|
2060
2179
|
MuiTableContainer: {
|
|
2061
2180
|
styleOverrides: {
|
|
2062
2181
|
root: ({ theme: theme2 }) => ({
|
|
2063
|
-
|
|
2064
|
-
[theme2.breakpoints.up("sm")]: {
|
|
2065
|
-
height: "calc(100vh - 64px)"
|
|
2066
|
-
},
|
|
2182
|
+
flexGrow: 1,
|
|
2067
2183
|
"& .MuiDataGrid-cell--editing": {
|
|
2068
2184
|
"& .MuiInputBase-root": {
|
|
2069
2185
|
height: "100%"
|
|
@@ -2090,6 +2206,11 @@ var useGetTheme = (theme) => {
|
|
|
2090
2206
|
fullWidth: true
|
|
2091
2207
|
}
|
|
2092
2208
|
},
|
|
2209
|
+
MuiContainer: {
|
|
2210
|
+
defaultProps: {
|
|
2211
|
+
maxWidth: false
|
|
2212
|
+
}
|
|
2213
|
+
},
|
|
2093
2214
|
...theme?.components
|
|
2094
2215
|
}
|
|
2095
2216
|
},
|
|
@@ -2103,10 +2224,10 @@ var useGetTheme = (theme) => {
|
|
|
2103
2224
|
import { useLocation, useNavigate, useSearch, Link as TanstackRouterLink } from "@tanstack/react-router";
|
|
2104
2225
|
import { AppProvider } from "@toolpad/core/AppProvider";
|
|
2105
2226
|
import { useCallback, useMemo as useMemo2, forwardRef } from "react";
|
|
2106
|
-
import { jsx as
|
|
2227
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2107
2228
|
var Link2 = forwardRef((props, ref) => {
|
|
2108
2229
|
const { href, history, ...rest } = props;
|
|
2109
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ jsx15(TanstackRouterLink, { ref, to: href, replace: history === "replace", ...rest });
|
|
2110
2231
|
});
|
|
2111
2232
|
var TanstackRouterAppProvider = (props) => {
|
|
2112
2233
|
const { pathname } = useLocation();
|
|
@@ -2119,11 +2240,11 @@ var TanstackRouterAppProvider = (props) => {
|
|
|
2119
2240
|
[_navigate]
|
|
2120
2241
|
);
|
|
2121
2242
|
const router = useMemo2(() => ({ pathname, searchParams: new URLSearchParams(searchParams), navigate, Link: Link2 }), [pathname, searchParams, navigate]);
|
|
2122
|
-
return /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ jsx15(AppProvider, { router, ...props });
|
|
2123
2244
|
};
|
|
2124
2245
|
|
|
2125
2246
|
// src/providers/LayoutProvider.tsx
|
|
2126
|
-
import { jsx as
|
|
2247
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2127
2248
|
i18n.use(HttpBackend).use(LanguageDetector).use(initReactI18next).init({
|
|
2128
2249
|
fallbackLng: "en",
|
|
2129
2250
|
interpolation: {
|
|
@@ -2145,11 +2266,11 @@ var LayoutProvider = (props) => {
|
|
|
2145
2266
|
const appTitle = rootRouterState.meta?.find((meta) => meta?.title)?.title;
|
|
2146
2267
|
if (!appTitle)
|
|
2147
2268
|
throw new Error("Title is not defined in the RootRoute head.");
|
|
2148
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ jsx16(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n2.resolvedLanguage, children: /* @__PURE__ */ jsx16(TanstackRouterAppProvider, { navigation, theme, localeText: {
|
|
2149
2270
|
confirm: t("Layout.Confirm"),
|
|
2150
2271
|
cancel: t("Layout.Cancel"),
|
|
2151
2272
|
alert: t("Layout.Alert")
|
|
2152
|
-
}, children: /* @__PURE__ */
|
|
2273
|
+
}, children: /* @__PURE__ */ jsx16(NotificationsProvider, { slotProps: { snackbar: { anchorOrigin: { vertical: isLargeScreen ? "top" : "bottom", horizontal: "center" } } }, children: /* @__PURE__ */ jsx16(LayoutContext.Provider, { value: { appTitle }, children: /* @__PURE__ */ jsxs7(
|
|
2153
2274
|
DashboardLayout,
|
|
2154
2275
|
{
|
|
2155
2276
|
defaultSidebarCollapsed: true,
|
|
@@ -2161,8 +2282,8 @@ var LayoutProvider = (props) => {
|
|
|
2161
2282
|
},
|
|
2162
2283
|
children: [
|
|
2163
2284
|
props.children,
|
|
2164
|
-
/* @__PURE__ */
|
|
2165
|
-
(isFetching || isMutating) && /* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ jsx16(DevelopmentBanner, { hasNavigationRoutes: !!navigation.length }),
|
|
2286
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsx16(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
2166
2287
|
]
|
|
2167
2288
|
}
|
|
2168
2289
|
) }) }) }) });
|
|
@@ -2187,11 +2308,11 @@ var getFieldStatus = (field) => {
|
|
|
2187
2308
|
};
|
|
2188
2309
|
|
|
2189
2310
|
// src/components/form/FormAutocomplete.tsx
|
|
2190
|
-
import { jsx as
|
|
2311
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2191
2312
|
var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
2192
2313
|
const field = useFieldContext();
|
|
2193
2314
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2194
|
-
return /* @__PURE__ */
|
|
2315
|
+
return /* @__PURE__ */ jsx17(
|
|
2195
2316
|
Autocomplete,
|
|
2196
2317
|
{
|
|
2197
2318
|
value: field.state.value,
|
|
@@ -2200,7 +2321,7 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
2200
2321
|
onBlur: field.handleBlur,
|
|
2201
2322
|
"aria-label": field.name,
|
|
2202
2323
|
...autocompleteProps,
|
|
2203
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2324
|
+
renderInput: (params) => /* @__PURE__ */ jsx17(
|
|
2204
2325
|
TextField,
|
|
2205
2326
|
{
|
|
2206
2327
|
...params,
|
|
@@ -2216,15 +2337,15 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
2216
2337
|
|
|
2217
2338
|
// src/components/form/FormCheckbox.tsx
|
|
2218
2339
|
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
2219
|
-
import { jsx as
|
|
2340
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2220
2341
|
var FormCheckbox = (props) => {
|
|
2221
2342
|
const field = useFieldContext();
|
|
2222
2343
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2223
2344
|
return /* @__PURE__ */ jsxs8(FormControl, { component: "fieldset", children: [
|
|
2224
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ jsx18(
|
|
2225
2346
|
FormControlLabel,
|
|
2226
2347
|
{
|
|
2227
|
-
control: /* @__PURE__ */
|
|
2348
|
+
control: /* @__PURE__ */ jsx18(
|
|
2228
2349
|
Checkbox,
|
|
2229
2350
|
{
|
|
2230
2351
|
name: field.name,
|
|
@@ -2238,18 +2359,18 @@ var FormCheckbox = (props) => {
|
|
|
2238
2359
|
label: props.label ?? ""
|
|
2239
2360
|
}
|
|
2240
2361
|
),
|
|
2241
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2362
|
+
isTouched && hasError && /* @__PURE__ */ jsx18(FormHelperText, { error: hasError, children: helperText })
|
|
2242
2363
|
] });
|
|
2243
2364
|
};
|
|
2244
2365
|
|
|
2245
2366
|
// src/components/form/FormDatePicker.tsx
|
|
2246
2367
|
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
2247
2368
|
import dayjs from "dayjs";
|
|
2248
|
-
import { jsx as
|
|
2369
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2249
2370
|
var FormDatePicker = (props) => {
|
|
2250
2371
|
const field = useFieldContext();
|
|
2251
2372
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2252
|
-
return /* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ jsx19(
|
|
2253
2374
|
DatePicker,
|
|
2254
2375
|
{
|
|
2255
2376
|
name: field.name,
|
|
@@ -2273,11 +2394,11 @@ var FormDatePicker = (props) => {
|
|
|
2273
2394
|
// src/components/form/FormDateTimePicker.tsx
|
|
2274
2395
|
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
2275
2396
|
import dayjs2 from "dayjs";
|
|
2276
|
-
import { jsx as
|
|
2397
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2277
2398
|
var FormDateTimePicker = (props) => {
|
|
2278
2399
|
const field = useFieldContext();
|
|
2279
2400
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2280
|
-
return /* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ jsx20(
|
|
2281
2402
|
DateTimePicker,
|
|
2282
2403
|
{
|
|
2283
2404
|
name: field.name,
|
|
@@ -2301,11 +2422,11 @@ var FormDateTimePicker = (props) => {
|
|
|
2301
2422
|
// src/components/form/FormNumberField.tsx
|
|
2302
2423
|
import { TextField as TextField2 } from "@mui/material";
|
|
2303
2424
|
import { NumericFormat } from "react-number-format";
|
|
2304
|
-
import { jsx as
|
|
2425
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2305
2426
|
var FormNumberField = ({ options, ...props }) => {
|
|
2306
2427
|
const field = useFieldContext();
|
|
2307
2428
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2308
|
-
return /* @__PURE__ */
|
|
2429
|
+
return /* @__PURE__ */ jsx21(
|
|
2309
2430
|
NumericFormat,
|
|
2310
2431
|
{
|
|
2311
2432
|
customInput: TextField2,
|
|
@@ -2324,13 +2445,13 @@ var FormNumberField = ({ options, ...props }) => {
|
|
|
2324
2445
|
|
|
2325
2446
|
// src/components/form/FormRadioGroup.tsx
|
|
2326
2447
|
import { FormControl as FormControl2, FormControlLabel as FormControlLabel2, FormHelperText as FormHelperText2, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
2327
|
-
import { jsx as
|
|
2448
|
+
import { jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2328
2449
|
var FormRadioGroup = ({ label, options, ...props }) => {
|
|
2329
2450
|
const field = useFieldContext();
|
|
2330
2451
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2331
2452
|
return /* @__PURE__ */ jsxs9(FormControl2, { component: "fieldset", children: [
|
|
2332
|
-
label && /* @__PURE__ */
|
|
2333
|
-
/* @__PURE__ */
|
|
2453
|
+
label && /* @__PURE__ */ jsx22(FormLabel, { component: "legend", children: label }),
|
|
2454
|
+
/* @__PURE__ */ jsx22(
|
|
2334
2455
|
RadioGroup,
|
|
2335
2456
|
{
|
|
2336
2457
|
name: field.name,
|
|
@@ -2339,30 +2460,30 @@ var FormRadioGroup = ({ label, options, ...props }) => {
|
|
|
2339
2460
|
onBlur: field.handleBlur,
|
|
2340
2461
|
"aria-label": field.name,
|
|
2341
2462
|
...props,
|
|
2342
|
-
children: options.map((option) => /* @__PURE__ */
|
|
2463
|
+
children: options.map((option) => /* @__PURE__ */ jsx22(
|
|
2343
2464
|
FormControlLabel2,
|
|
2344
2465
|
{
|
|
2345
2466
|
value: option.value,
|
|
2346
|
-
control: /* @__PURE__ */
|
|
2467
|
+
control: /* @__PURE__ */ jsx22(Radio, {}),
|
|
2347
2468
|
label: option.label
|
|
2348
2469
|
},
|
|
2349
2470
|
option.value
|
|
2350
2471
|
))
|
|
2351
2472
|
}
|
|
2352
2473
|
),
|
|
2353
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2474
|
+
isTouched && hasError && /* @__PURE__ */ jsx22(FormHelperText2, { error: hasError, children: helperText })
|
|
2354
2475
|
] });
|
|
2355
2476
|
};
|
|
2356
2477
|
|
|
2357
2478
|
// src/components/form/FormSlider.tsx
|
|
2358
2479
|
import { FormControl as FormControl3, FormHelperText as FormHelperText3, FormLabel as FormLabel2, Slider } from "@mui/material";
|
|
2359
|
-
import { jsx as
|
|
2480
|
+
import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2360
2481
|
var FormSlider = ({ label, ...props }) => {
|
|
2361
2482
|
const field = useFieldContext();
|
|
2362
2483
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2363
2484
|
return /* @__PURE__ */ jsxs10(FormControl3, { component: "fieldset", children: [
|
|
2364
|
-
label && /* @__PURE__ */
|
|
2365
|
-
/* @__PURE__ */
|
|
2485
|
+
label && /* @__PURE__ */ jsx23(FormLabel2, { children: label }),
|
|
2486
|
+
/* @__PURE__ */ jsx23(
|
|
2366
2487
|
Slider,
|
|
2367
2488
|
{
|
|
2368
2489
|
name: field.name,
|
|
@@ -2373,13 +2494,13 @@ var FormSlider = ({ label, ...props }) => {
|
|
|
2373
2494
|
...props
|
|
2374
2495
|
}
|
|
2375
2496
|
),
|
|
2376
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2497
|
+
isTouched && hasError && /* @__PURE__ */ jsx23(FormHelperText3, { error: hasError, children: helperText })
|
|
2377
2498
|
] });
|
|
2378
2499
|
};
|
|
2379
2500
|
|
|
2380
2501
|
// src/components/form/FormSubmitButton.tsx
|
|
2381
2502
|
import { Button as Button2 } from "@mui/material";
|
|
2382
|
-
import { jsx as
|
|
2503
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2383
2504
|
var FormSubmitButton = (props) => {
|
|
2384
2505
|
const form = useFormContext();
|
|
2385
2506
|
const handleClick = (e) => {
|
|
@@ -2387,7 +2508,7 @@ var FormSubmitButton = (props) => {
|
|
|
2387
2508
|
e.stopPropagation();
|
|
2388
2509
|
form.handleSubmit();
|
|
2389
2510
|
};
|
|
2390
|
-
return /* @__PURE__ */
|
|
2511
|
+
return /* @__PURE__ */ jsx24(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx24(
|
|
2391
2512
|
Button2,
|
|
2392
2513
|
{
|
|
2393
2514
|
loading: isSubmitting,
|
|
@@ -2402,15 +2523,15 @@ var FormSubmitButton = (props) => {
|
|
|
2402
2523
|
|
|
2403
2524
|
// src/components/form/FormSwitch.tsx
|
|
2404
2525
|
import { FormControl as FormControl4, FormControlLabel as FormControlLabel3, FormHelperText as FormHelperText4, Switch } from "@mui/material";
|
|
2405
|
-
import { jsx as
|
|
2526
|
+
import { jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2406
2527
|
var FormSwitch = (props) => {
|
|
2407
2528
|
const field = useFieldContext();
|
|
2408
2529
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2409
2530
|
return /* @__PURE__ */ jsxs11(FormControl4, { component: "fieldset", children: [
|
|
2410
|
-
/* @__PURE__ */
|
|
2531
|
+
/* @__PURE__ */ jsx25(
|
|
2411
2532
|
FormControlLabel3,
|
|
2412
2533
|
{
|
|
2413
|
-
control: /* @__PURE__ */
|
|
2534
|
+
control: /* @__PURE__ */ jsx25(
|
|
2414
2535
|
Switch,
|
|
2415
2536
|
{
|
|
2416
2537
|
name: field.name,
|
|
@@ -2424,17 +2545,17 @@ var FormSwitch = (props) => {
|
|
|
2424
2545
|
label: props.label ?? ""
|
|
2425
2546
|
}
|
|
2426
2547
|
),
|
|
2427
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2548
|
+
isTouched && hasError && /* @__PURE__ */ jsx25(FormHelperText4, { error: hasError, children: helperText })
|
|
2428
2549
|
] });
|
|
2429
2550
|
};
|
|
2430
2551
|
|
|
2431
2552
|
// src/components/form/FormTextField.tsx
|
|
2432
2553
|
import { TextField as TextField3 } from "@mui/material";
|
|
2433
|
-
import { jsx as
|
|
2554
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2434
2555
|
var FormTextField = (props) => {
|
|
2435
2556
|
const field = useFieldContext();
|
|
2436
2557
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2437
|
-
return /* @__PURE__ */
|
|
2558
|
+
return /* @__PURE__ */ jsx26(
|
|
2438
2559
|
TextField3,
|
|
2439
2560
|
{
|
|
2440
2561
|
name: field.name,
|
|
@@ -2555,7 +2676,9 @@ var useOpenFile = (options) => {
|
|
|
2555
2676
|
method: "GET",
|
|
2556
2677
|
responseType: "blob"
|
|
2557
2678
|
}),
|
|
2558
|
-
onSuccess: (data) =>
|
|
2679
|
+
onSuccess: (data) => {
|
|
2680
|
+
window.open(URL.createObjectURL(data));
|
|
2681
|
+
}
|
|
2559
2682
|
});
|
|
2560
2683
|
};
|
|
2561
2684
|
var useUpdateFileMeta = (options) => {
|
|
@@ -2642,6 +2765,8 @@ export {
|
|
|
2642
2765
|
Platform,
|
|
2643
2766
|
RouterButton,
|
|
2644
2767
|
RouterError,
|
|
2768
|
+
RouterGridActionsCellItem,
|
|
2769
|
+
RouterIconButton,
|
|
2645
2770
|
RouterLink,
|
|
2646
2771
|
RouterNotFound,
|
|
2647
2772
|
RouterTab,
|