wcz-test 2.10.0 → 2.12.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.js +89 -97
- package/dist/index.js.map +1 -1
- package/package.json +19 -8
- package/dist/index.d.ts +0 -348
package/dist/index.js
CHANGED
|
@@ -1024,13 +1024,15 @@ var stackSxProps = [
|
|
|
1024
1024
|
];
|
|
1025
1025
|
var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {
|
|
1026
1026
|
const sxCopy = { ...sx };
|
|
1027
|
-
const stackStyles =
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1027
|
+
const stackStyles = {};
|
|
1028
|
+
if (sxCopy) {
|
|
1029
|
+
for (const current of stackSxProps) {
|
|
1030
|
+
if (sxCopy[current]) {
|
|
1031
|
+
stackStyles[current] = sxCopy[current];
|
|
1032
|
+
delete sxCopy[current];
|
|
1033
|
+
}
|
|
1031
1034
|
}
|
|
1032
|
-
|
|
1033
|
-
}, {});
|
|
1035
|
+
}
|
|
1034
1036
|
return /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: stackStyles, mb: gutterBottom ? 0.7 : void 0, children: [
|
|
1035
1037
|
startIcon,
|
|
1036
1038
|
/* @__PURE__ */ jsx(Typography, { ...props, sx: sxCopy, children }),
|
|
@@ -1090,7 +1092,9 @@ import { Button } from "@mui/material";
|
|
|
1090
1092
|
import { createLink } from "@tanstack/react-router";
|
|
1091
1093
|
import React from "react";
|
|
1092
1094
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1093
|
-
var Component = React.forwardRef((props,
|
|
1095
|
+
var Component = React.forwardRef(function ButtonComponent(props, reference) {
|
|
1096
|
+
return /* @__PURE__ */ jsx5(Button, { ref: reference, component: "a", ...props });
|
|
1097
|
+
});
|
|
1094
1098
|
var CreatedComponent = createLink(Component);
|
|
1095
1099
|
var RouterButton = (props) => {
|
|
1096
1100
|
return /* @__PURE__ */ jsx5(CreatedComponent, { preload: "intent", ...props });
|
|
@@ -1102,7 +1106,9 @@ import { createLink as createLink2 } from "@tanstack/react-router";
|
|
|
1102
1106
|
import React2 from "react";
|
|
1103
1107
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1104
1108
|
var Component2 = React2.forwardRef(
|
|
1105
|
-
(props,
|
|
1109
|
+
function GridActionsCellItemComponent(props, reference) {
|
|
1110
|
+
return /* @__PURE__ */ jsx6(GridActionsCellItem, { ref: reference, component: "a", ...props });
|
|
1111
|
+
}
|
|
1106
1112
|
);
|
|
1107
1113
|
var CreatedComponent2 = createLink2(Component2);
|
|
1108
1114
|
var RouterGridActionsCellItem = (props) => {
|
|
@@ -1114,7 +1120,9 @@ import { IconButton } from "@mui/material";
|
|
|
1114
1120
|
import { createLink as createLink3 } from "@tanstack/react-router";
|
|
1115
1121
|
import React3 from "react";
|
|
1116
1122
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1117
|
-
var Component3 = React3.forwardRef((props,
|
|
1123
|
+
var Component3 = React3.forwardRef(function IconButtonComponent(props, reference) {
|
|
1124
|
+
return /* @__PURE__ */ jsx7(IconButton, { ref: reference, component: "a", ...props });
|
|
1125
|
+
});
|
|
1118
1126
|
var CreatedComponent3 = createLink3(Component3);
|
|
1119
1127
|
var RouterIconButton = (props) => {
|
|
1120
1128
|
return /* @__PURE__ */ jsx7(CreatedComponent3, { preload: "intent", ...props });
|
|
@@ -1125,7 +1133,9 @@ import { Link } from "@mui/material";
|
|
|
1125
1133
|
import { createLink as createLink4 } from "@tanstack/react-router";
|
|
1126
1134
|
import React4 from "react";
|
|
1127
1135
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1128
|
-
var Component4 = React4.forwardRef((props,
|
|
1136
|
+
var Component4 = React4.forwardRef(function LinkComponent(props, reference) {
|
|
1137
|
+
return /* @__PURE__ */ jsx8(Link, { ref: reference, ...props });
|
|
1138
|
+
});
|
|
1129
1139
|
var CreatedComponent4 = createLink4(Component4);
|
|
1130
1140
|
var RouterLink = (props) => {
|
|
1131
1141
|
return /* @__PURE__ */ jsx8(CreatedComponent4, { preload: "intent", ...props });
|
|
@@ -1136,7 +1146,9 @@ import { Tab } from "@mui/material";
|
|
|
1136
1146
|
import { createLink as createLink5 } from "@tanstack/react-router";
|
|
1137
1147
|
import React5 from "react";
|
|
1138
1148
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1139
|
-
var Component5 = React5.forwardRef((props,
|
|
1149
|
+
var Component5 = React5.forwardRef(function TabComponent(props, reference) {
|
|
1150
|
+
return /* @__PURE__ */ jsx9(Tab, { ref: reference, component: "a", ...props });
|
|
1151
|
+
});
|
|
1140
1152
|
var CreatedComponent5 = createLink5(Component5);
|
|
1141
1153
|
var RouterTab = (props) => {
|
|
1142
1154
|
return /* @__PURE__ */ jsx9(CreatedComponent5, { preload: "intent", ...props });
|
|
@@ -1160,7 +1172,7 @@ import { Box as Box2, Divider as Divider2, Typography as Typography3 } from "@mu
|
|
|
1160
1172
|
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1161
1173
|
var RouterError = ({ error }) => {
|
|
1162
1174
|
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" }),
|
|
1175
|
+
/* @__PURE__ */ jsx11(Typography3, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
|
|
1164
1176
|
/* @__PURE__ */ jsx11(Divider2, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
1165
1177
|
/* @__PURE__ */ jsx11(Typography3, { variant: "h5", component: "span", children: error.message })
|
|
1166
1178
|
] }) });
|
|
@@ -1900,9 +1912,9 @@ var user = {
|
|
|
1900
1912
|
}
|
|
1901
1913
|
};
|
|
1902
1914
|
var ToolbarAccount = () => {
|
|
1903
|
-
const [
|
|
1915
|
+
const [anchorElement, setAnchorElement] = useState2();
|
|
1904
1916
|
const [tab, setTab] = useState2("settings");
|
|
1905
|
-
const open = Boolean(
|
|
1917
|
+
const open = Boolean(anchorElement);
|
|
1906
1918
|
const { t, i18n: i18n2 } = useTranslation3();
|
|
1907
1919
|
const { mode, setMode } = useColorScheme();
|
|
1908
1920
|
const changeLanguage = (newLanguage) => () => {
|
|
@@ -1914,21 +1926,24 @@ var ToolbarAccount = () => {
|
|
|
1914
1926
|
};
|
|
1915
1927
|
const getModeText = () => {
|
|
1916
1928
|
switch (mode) {
|
|
1917
|
-
case "light":
|
|
1929
|
+
case "light": {
|
|
1918
1930
|
return t("Layout.Light");
|
|
1919
|
-
|
|
1931
|
+
}
|
|
1932
|
+
case "dark": {
|
|
1920
1933
|
return t("Layout.Dark");
|
|
1921
|
-
|
|
1934
|
+
}
|
|
1935
|
+
default: {
|
|
1922
1936
|
return t("Layout.System");
|
|
1937
|
+
}
|
|
1923
1938
|
}
|
|
1924
1939
|
};
|
|
1925
1940
|
const usernameInitials = () => {
|
|
1926
1941
|
const splittedName = user.name.split(" ");
|
|
1927
1942
|
return `${splittedName[0][0]}${splittedName.length > 1 ? splittedName[1][0] : ""}`;
|
|
1928
1943
|
};
|
|
1929
|
-
const openMenu = (
|
|
1944
|
+
const openMenu = (event) => setAnchorElement(event.currentTarget);
|
|
1930
1945
|
const closeMenu = () => {
|
|
1931
|
-
|
|
1946
|
+
setAnchorElement(void 0);
|
|
1932
1947
|
setTimeout(() => setTab("settings"), 300);
|
|
1933
1948
|
};
|
|
1934
1949
|
const login = () => user.login();
|
|
@@ -1974,7 +1989,7 @@ var ToolbarAccount = () => {
|
|
|
1974
1989
|
] });
|
|
1975
1990
|
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1976
1991
|
/* @__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: [
|
|
1992
|
+
/* @__PURE__ */ jsx14(Menu, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs6(Box3, { sx: { width: 240 }, children: [
|
|
1978
1993
|
/* @__PURE__ */ jsx14(List, { children: user.name ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1979
1994
|
/* @__PURE__ */ jsx14(ListItem, { children: /* @__PURE__ */ jsx14(ListItemText, { primary: user.name, secondary: /* @__PURE__ */ jsxs6("span", { children: [
|
|
1980
1995
|
/* @__PURE__ */ jsx14("span", { children: user.employeeId }),
|
|
@@ -2014,9 +2029,9 @@ var Platform = class {
|
|
|
2014
2029
|
static isMacOS = /Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.userAgent);
|
|
2015
2030
|
};
|
|
2016
2031
|
var getContrastTextColor = (color) => {
|
|
2017
|
-
const r = parseInt(color.
|
|
2018
|
-
const g = parseInt(color.
|
|
2019
|
-
const b = parseInt(color.
|
|
2032
|
+
const r = Number.parseInt(color.slice(1, 3), 16);
|
|
2033
|
+
const g = Number.parseInt(color.slice(3, 5), 16);
|
|
2034
|
+
const b = Number.parseInt(color.slice(5, 7), 16);
|
|
2020
2035
|
const yiq = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
2021
2036
|
return yiq >= 128 ? "black" : "white";
|
|
2022
2037
|
};
|
|
@@ -2061,8 +2076,8 @@ var useGetTheme = (theme) => {
|
|
|
2061
2076
|
},
|
|
2062
2077
|
dark: {
|
|
2063
2078
|
palette: {
|
|
2064
|
-
primary: { main: lighten(WISTRON_PRIMARY_COLOR, 0.
|
|
2065
|
-
secondary: { main: darken(WISTRON_SECONDARY_COLOR, 0.
|
|
2079
|
+
primary: { main: lighten(WISTRON_PRIMARY_COLOR, 0.5) },
|
|
2080
|
+
secondary: { main: darken(WISTRON_SECONDARY_COLOR, 0.5) }
|
|
2066
2081
|
}
|
|
2067
2082
|
},
|
|
2068
2083
|
...theme?.colorSchemes
|
|
@@ -2143,31 +2158,8 @@ var useGetTheme = (theme) => {
|
|
|
2143
2158
|
);
|
|
2144
2159
|
};
|
|
2145
2160
|
|
|
2146
|
-
// src/providers/TanstackRouterAppProvider.tsx
|
|
2147
|
-
import { useLocation, useNavigate, useSearch, Link as TanstackRouterLink } from "@tanstack/react-router";
|
|
2148
|
-
import { AppProvider } from "@toolpad/core/AppProvider";
|
|
2149
|
-
import { useCallback, useMemo as useMemo2, forwardRef } from "react";
|
|
2150
|
-
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2151
|
-
var Link2 = forwardRef((props, ref) => {
|
|
2152
|
-
const { href, history, ...rest } = props;
|
|
2153
|
-
return /* @__PURE__ */ jsx15(TanstackRouterLink, { ref, to: href, replace: history === "replace", ...rest });
|
|
2154
|
-
});
|
|
2155
|
-
var TanstackRouterAppProvider = (props) => {
|
|
2156
|
-
const { pathname } = useLocation();
|
|
2157
|
-
const searchParams = useSearch({ strict: false });
|
|
2158
|
-
const _navigate = useNavigate();
|
|
2159
|
-
const navigate = useCallback(
|
|
2160
|
-
(url, { history = "auto" } = {}) => {
|
|
2161
|
-
_navigate({ to: url.toString(), replace: history === "replace" }).catch(console.error);
|
|
2162
|
-
},
|
|
2163
|
-
[_navigate]
|
|
2164
|
-
);
|
|
2165
|
-
const router = useMemo2(() => ({ pathname, searchParams: new URLSearchParams(searchParams), navigate, Link: Link2 }), [pathname, searchParams, navigate]);
|
|
2166
|
-
return /* @__PURE__ */ jsx15(AppProvider, { router, ...props });
|
|
2167
|
-
};
|
|
2168
|
-
|
|
2169
2161
|
// src/providers/LayoutProvider.tsx
|
|
2170
|
-
import { jsx as
|
|
2162
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2171
2163
|
i18n.use(HttpBackend).use(LanguageDetector).use(initReactI18next).init({
|
|
2172
2164
|
fallbackLng: "en",
|
|
2173
2165
|
interpolation: {
|
|
@@ -2189,15 +2181,15 @@ var LayoutProvider = (props) => {
|
|
|
2189
2181
|
const appTitle = rootRouterState.meta?.find((meta) => meta?.title)?.title;
|
|
2190
2182
|
if (!appTitle)
|
|
2191
2183
|
throw new Error("Title is not defined in the RootRoute head.");
|
|
2192
|
-
return /* @__PURE__ */
|
|
2184
|
+
return /* @__PURE__ */ jsx15(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n2.resolvedLanguage, children: /* @__PURE__ */ jsx15(TanStackRouterAppProvider, { navigation, theme, localeText: {
|
|
2193
2185
|
confirm: t("Layout.Confirm"),
|
|
2194
2186
|
cancel: t("Layout.Cancel"),
|
|
2195
2187
|
alert: t("Layout.Alert")
|
|
2196
|
-
}, children: /* @__PURE__ */
|
|
2188
|
+
}, children: /* @__PURE__ */ jsx15(NotificationsProvider, { slotProps: { snackbar: { anchorOrigin: { vertical: isLargeScreen ? "top" : "bottom", horizontal: "center" } } }, children: /* @__PURE__ */ jsx15(LayoutContext.Provider, { value: { appTitle }, children: /* @__PURE__ */ jsxs7(
|
|
2197
2189
|
DashboardLayout,
|
|
2198
2190
|
{
|
|
2199
2191
|
defaultSidebarCollapsed: true,
|
|
2200
|
-
hideNavigation:
|
|
2192
|
+
hideNavigation: navigation.length === 0,
|
|
2201
2193
|
slots: {
|
|
2202
2194
|
toolbarActions: () => null,
|
|
2203
2195
|
toolbarAccount: ToolbarAccount,
|
|
@@ -2205,8 +2197,8 @@ var LayoutProvider = (props) => {
|
|
|
2205
2197
|
},
|
|
2206
2198
|
children: [
|
|
2207
2199
|
props.children,
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
(isFetching || isMutating) && /* @__PURE__ */
|
|
2200
|
+
/* @__PURE__ */ jsx15(DevelopmentBanner, { hasNavigationRoutes: navigation.length > 0 }),
|
|
2201
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsx15(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
2210
2202
|
]
|
|
2211
2203
|
}
|
|
2212
2204
|
) }) }) }) });
|
|
@@ -2231,11 +2223,11 @@ var getFieldStatus = (field) => {
|
|
|
2231
2223
|
};
|
|
2232
2224
|
|
|
2233
2225
|
// src/components/form/FormAutocomplete.tsx
|
|
2234
|
-
import { jsx as
|
|
2226
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2235
2227
|
var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
2236
2228
|
const field = useFieldContext();
|
|
2237
2229
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2238
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ jsx16(
|
|
2239
2231
|
Autocomplete,
|
|
2240
2232
|
{
|
|
2241
2233
|
value: field.state.value,
|
|
@@ -2244,10 +2236,10 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
2244
2236
|
onBlur: field.handleBlur,
|
|
2245
2237
|
"aria-label": field.name,
|
|
2246
2238
|
...autocompleteProps,
|
|
2247
|
-
renderInput: (
|
|
2239
|
+
renderInput: (parameters) => /* @__PURE__ */ jsx16(
|
|
2248
2240
|
TextField,
|
|
2249
2241
|
{
|
|
2250
|
-
...
|
|
2242
|
+
...parameters,
|
|
2251
2243
|
name: field.name,
|
|
2252
2244
|
error: isTouched && hasError,
|
|
2253
2245
|
helperText: isTouched && helperText,
|
|
@@ -2260,20 +2252,20 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
2260
2252
|
|
|
2261
2253
|
// src/components/form/FormCheckbox.tsx
|
|
2262
2254
|
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
2263
|
-
import { jsx as
|
|
2255
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2264
2256
|
var FormCheckbox = (props) => {
|
|
2265
2257
|
const field = useFieldContext();
|
|
2266
2258
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2267
2259
|
return /* @__PURE__ */ jsxs8(FormControl, { component: "fieldset", children: [
|
|
2268
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ jsx17(
|
|
2269
2261
|
FormControlLabel,
|
|
2270
2262
|
{
|
|
2271
|
-
control: /* @__PURE__ */
|
|
2263
|
+
control: /* @__PURE__ */ jsx17(
|
|
2272
2264
|
Checkbox,
|
|
2273
2265
|
{
|
|
2274
2266
|
name: field.name,
|
|
2275
2267
|
checked: Boolean(field.state.value),
|
|
2276
|
-
onChange: (
|
|
2268
|
+
onChange: (event) => field.handleChange(event.target.checked),
|
|
2277
2269
|
onBlur: field.handleBlur,
|
|
2278
2270
|
"aria-label": field.name,
|
|
2279
2271
|
...props
|
|
@@ -2282,18 +2274,18 @@ var FormCheckbox = (props) => {
|
|
|
2282
2274
|
label: props.label ?? ""
|
|
2283
2275
|
}
|
|
2284
2276
|
),
|
|
2285
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2277
|
+
isTouched && hasError && /* @__PURE__ */ jsx17(FormHelperText, { error: hasError, children: helperText })
|
|
2286
2278
|
] });
|
|
2287
2279
|
};
|
|
2288
2280
|
|
|
2289
2281
|
// src/components/form/FormDatePicker.tsx
|
|
2290
2282
|
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
2291
2283
|
import dayjs from "dayjs";
|
|
2292
|
-
import { jsx as
|
|
2284
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2293
2285
|
var FormDatePicker = (props) => {
|
|
2294
2286
|
const field = useFieldContext();
|
|
2295
2287
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2296
|
-
return /* @__PURE__ */
|
|
2288
|
+
return /* @__PURE__ */ jsx18(
|
|
2297
2289
|
DatePicker,
|
|
2298
2290
|
{
|
|
2299
2291
|
name: field.name,
|
|
@@ -2317,11 +2309,11 @@ var FormDatePicker = (props) => {
|
|
|
2317
2309
|
// src/components/form/FormDateTimePicker.tsx
|
|
2318
2310
|
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
2319
2311
|
import dayjs2 from "dayjs";
|
|
2320
|
-
import { jsx as
|
|
2312
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2321
2313
|
var FormDateTimePicker = (props) => {
|
|
2322
2314
|
const field = useFieldContext();
|
|
2323
2315
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2324
|
-
return /* @__PURE__ */
|
|
2316
|
+
return /* @__PURE__ */ jsx19(
|
|
2325
2317
|
DateTimePicker,
|
|
2326
2318
|
{
|
|
2327
2319
|
name: field.name,
|
|
@@ -2345,11 +2337,11 @@ var FormDateTimePicker = (props) => {
|
|
|
2345
2337
|
// src/components/form/FormNumberField.tsx
|
|
2346
2338
|
import { TextField as TextField2 } from "@mui/material";
|
|
2347
2339
|
import { NumericFormat } from "react-number-format";
|
|
2348
|
-
import { jsx as
|
|
2340
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2349
2341
|
var FormNumberField = ({ options, ...props }) => {
|
|
2350
2342
|
const field = useFieldContext();
|
|
2351
2343
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2352
|
-
return /* @__PURE__ */
|
|
2344
|
+
return /* @__PURE__ */ jsx20(
|
|
2353
2345
|
NumericFormat,
|
|
2354
2346
|
{
|
|
2355
2347
|
customInput: TextField2,
|
|
@@ -2368,45 +2360,45 @@ var FormNumberField = ({ options, ...props }) => {
|
|
|
2368
2360
|
|
|
2369
2361
|
// src/components/form/FormRadioGroup.tsx
|
|
2370
2362
|
import { FormControl as FormControl2, FormControlLabel as FormControlLabel2, FormHelperText as FormHelperText2, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
2371
|
-
import { jsx as
|
|
2363
|
+
import { jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2372
2364
|
var FormRadioGroup = ({ label, options, ...props }) => {
|
|
2373
2365
|
const field = useFieldContext();
|
|
2374
2366
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2375
2367
|
return /* @__PURE__ */ jsxs9(FormControl2, { component: "fieldset", children: [
|
|
2376
|
-
label && /* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2368
|
+
label && /* @__PURE__ */ jsx21(FormLabel, { component: "legend", children: label }),
|
|
2369
|
+
/* @__PURE__ */ jsx21(
|
|
2378
2370
|
RadioGroup,
|
|
2379
2371
|
{
|
|
2380
2372
|
name: field.name,
|
|
2381
2373
|
value: field.state.value ?? "",
|
|
2382
|
-
onChange: (
|
|
2374
|
+
onChange: (event) => field.handleChange(event.target.value),
|
|
2383
2375
|
onBlur: field.handleBlur,
|
|
2384
2376
|
"aria-label": field.name,
|
|
2385
2377
|
...props,
|
|
2386
|
-
children: options.map((option) => /* @__PURE__ */
|
|
2378
|
+
children: options.map((option) => /* @__PURE__ */ jsx21(
|
|
2387
2379
|
FormControlLabel2,
|
|
2388
2380
|
{
|
|
2389
2381
|
value: option.value,
|
|
2390
|
-
control: /* @__PURE__ */
|
|
2382
|
+
control: /* @__PURE__ */ jsx21(Radio, {}),
|
|
2391
2383
|
label: option.label
|
|
2392
2384
|
},
|
|
2393
2385
|
option.value
|
|
2394
2386
|
))
|
|
2395
2387
|
}
|
|
2396
2388
|
),
|
|
2397
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2389
|
+
isTouched && hasError && /* @__PURE__ */ jsx21(FormHelperText2, { error: hasError, children: helperText })
|
|
2398
2390
|
] });
|
|
2399
2391
|
};
|
|
2400
2392
|
|
|
2401
2393
|
// src/components/form/FormSlider.tsx
|
|
2402
2394
|
import { FormControl as FormControl3, FormHelperText as FormHelperText3, FormLabel as FormLabel2, Slider } from "@mui/material";
|
|
2403
|
-
import { jsx as
|
|
2395
|
+
import { jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2404
2396
|
var FormSlider = ({ label, ...props }) => {
|
|
2405
2397
|
const field = useFieldContext();
|
|
2406
2398
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2407
2399
|
return /* @__PURE__ */ jsxs10(FormControl3, { component: "fieldset", children: [
|
|
2408
|
-
label && /* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2400
|
+
label && /* @__PURE__ */ jsx22(FormLabel2, { children: label }),
|
|
2401
|
+
/* @__PURE__ */ jsx22(
|
|
2410
2402
|
Slider,
|
|
2411
2403
|
{
|
|
2412
2404
|
name: field.name,
|
|
@@ -2417,21 +2409,21 @@ var FormSlider = ({ label, ...props }) => {
|
|
|
2417
2409
|
...props
|
|
2418
2410
|
}
|
|
2419
2411
|
),
|
|
2420
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2412
|
+
isTouched && hasError && /* @__PURE__ */ jsx22(FormHelperText3, { error: hasError, children: helperText })
|
|
2421
2413
|
] });
|
|
2422
2414
|
};
|
|
2423
2415
|
|
|
2424
2416
|
// src/components/form/FormSubmitButton.tsx
|
|
2425
2417
|
import { Button as Button2 } from "@mui/material";
|
|
2426
|
-
import { jsx as
|
|
2418
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2427
2419
|
var FormSubmitButton = (props) => {
|
|
2428
2420
|
const form = useFormContext();
|
|
2429
|
-
const handleClick = (
|
|
2430
|
-
|
|
2431
|
-
|
|
2421
|
+
const handleClick = (event) => {
|
|
2422
|
+
event.preventDefault();
|
|
2423
|
+
event.stopPropagation();
|
|
2432
2424
|
form.handleSubmit();
|
|
2433
2425
|
};
|
|
2434
|
-
return /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ jsx23(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx23(
|
|
2435
2427
|
Button2,
|
|
2436
2428
|
{
|
|
2437
2429
|
loading: isSubmitting,
|
|
@@ -2446,20 +2438,20 @@ var FormSubmitButton = (props) => {
|
|
|
2446
2438
|
|
|
2447
2439
|
// src/components/form/FormSwitch.tsx
|
|
2448
2440
|
import { FormControl as FormControl4, FormControlLabel as FormControlLabel3, FormHelperText as FormHelperText4, Switch } from "@mui/material";
|
|
2449
|
-
import { jsx as
|
|
2441
|
+
import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2450
2442
|
var FormSwitch = (props) => {
|
|
2451
2443
|
const field = useFieldContext();
|
|
2452
2444
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2453
2445
|
return /* @__PURE__ */ jsxs11(FormControl4, { component: "fieldset", children: [
|
|
2454
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ jsx24(
|
|
2455
2447
|
FormControlLabel3,
|
|
2456
2448
|
{
|
|
2457
|
-
control: /* @__PURE__ */
|
|
2449
|
+
control: /* @__PURE__ */ jsx24(
|
|
2458
2450
|
Switch,
|
|
2459
2451
|
{
|
|
2460
2452
|
name: field.name,
|
|
2461
2453
|
checked: Boolean(field.state.value),
|
|
2462
|
-
onChange: (
|
|
2454
|
+
onChange: (event) => field.handleChange(event.target.checked),
|
|
2463
2455
|
onBlur: field.handleBlur,
|
|
2464
2456
|
"aria-label": field.name,
|
|
2465
2457
|
...props
|
|
@@ -2468,22 +2460,22 @@ var FormSwitch = (props) => {
|
|
|
2468
2460
|
label: props.label ?? ""
|
|
2469
2461
|
}
|
|
2470
2462
|
),
|
|
2471
|
-
isTouched && hasError && /* @__PURE__ */
|
|
2463
|
+
isTouched && hasError && /* @__PURE__ */ jsx24(FormHelperText4, { error: hasError, children: helperText })
|
|
2472
2464
|
] });
|
|
2473
2465
|
};
|
|
2474
2466
|
|
|
2475
2467
|
// src/components/form/FormTextField.tsx
|
|
2476
2468
|
import { TextField as TextField3 } from "@mui/material";
|
|
2477
|
-
import { jsx as
|
|
2469
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2478
2470
|
var FormTextField = (props) => {
|
|
2479
2471
|
const field = useFieldContext();
|
|
2480
2472
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
2481
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ jsx25(
|
|
2482
2474
|
TextField3,
|
|
2483
2475
|
{
|
|
2484
2476
|
name: field.name,
|
|
2485
2477
|
value: field.state.value ?? "",
|
|
2486
|
-
onChange: (
|
|
2478
|
+
onChange: (event) => field.handleChange(event.target.value),
|
|
2487
2479
|
onBlur: field.handleBlur,
|
|
2488
2480
|
error: isTouched && hasError,
|
|
2489
2481
|
helperText: isTouched && helperText,
|
|
@@ -2532,7 +2524,7 @@ var useGetFileMetas = (subId, options) => {
|
|
|
2532
2524
|
const { appTitle } = useLayout();
|
|
2533
2525
|
return useQuery({
|
|
2534
2526
|
...options,
|
|
2535
|
-
queryKey: [QUERY_KEY, "meta", subId],
|
|
2527
|
+
queryKey: [QUERY_KEY, "meta", subId, appTitle],
|
|
2536
2528
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
2537
2529
|
url: `${BASE_URL}/v1/meta?appName=${appTitle}&subId=${subId}`,
|
|
2538
2530
|
method: "GET",
|
|
@@ -2546,7 +2538,7 @@ var useGetFileThumbnail = (meta, options) => {
|
|
|
2546
2538
|
const { appTitle } = useLayout();
|
|
2547
2539
|
return useQuery({
|
|
2548
2540
|
...options,
|
|
2549
|
-
queryKey: [QUERY_KEY, "thumbnail", meta?.id],
|
|
2541
|
+
queryKey: [QUERY_KEY, "thumbnail", meta?.id, appTitle],
|
|
2550
2542
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
2551
2543
|
url: `${BASE_URL}/v1/thumbnail?appName=${appTitle}&id=${meta?.id}`,
|
|
2552
2544
|
method: "GET",
|
|
@@ -2564,7 +2556,7 @@ var useGetFile = (meta, options) => {
|
|
|
2564
2556
|
const { appTitle } = useLayout();
|
|
2565
2557
|
return useQuery({
|
|
2566
2558
|
...options,
|
|
2567
|
-
queryKey: [QUERY_KEY, meta?.id],
|
|
2559
|
+
queryKey: [QUERY_KEY, meta?.id, appTitle],
|
|
2568
2560
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
2569
2561
|
url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta?.id}`,
|
|
2570
2562
|
method: "GET",
|
|
@@ -2672,7 +2664,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
2672
2664
|
}
|
|
2673
2665
|
});
|
|
2674
2666
|
const previousUploads = await upload.findPreviousUploads();
|
|
2675
|
-
if (previousUploads.length) {
|
|
2667
|
+
if (previousUploads.length > 0) {
|
|
2676
2668
|
upload.resumeFromPreviousUpload(previousUploads[0]);
|
|
2677
2669
|
}
|
|
2678
2670
|
upload.start();
|