wcz-test 2.9.0 → 2.11.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 +5 -8
- package/dist/index.js +62 -124
- package/dist/index.js.map +1 -1
- package/package.json +19 -8
package/dist/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare const RouterTab: LinkComponent<typeof Component>;
|
|
|
57
57
|
declare function RouterNotFound(): react_jsx_runtime.JSX.Element;
|
|
58
58
|
|
|
59
59
|
interface RouterErrorProps {
|
|
60
|
-
error: ErrorComponentProps[
|
|
60
|
+
error: ErrorComponentProps["error"];
|
|
61
61
|
}
|
|
62
62
|
declare const RouterError: FC<RouterErrorProps>;
|
|
63
63
|
|
|
@@ -76,8 +76,8 @@ interface NavigationParams {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
interface ProvidersProps {
|
|
79
|
-
getNavigation?: (
|
|
80
|
-
theme?: Pick<CssVarsThemeOptions,
|
|
79
|
+
getNavigation?: (parameters: NavigationParams) => Navigation;
|
|
80
|
+
theme?: Pick<CssVarsThemeOptions, "colorSchemes" | "components">;
|
|
81
81
|
children: React.ReactNode;
|
|
82
82
|
}
|
|
83
83
|
declare const LayoutProvider: FC<ProvidersProps>;
|
|
@@ -179,9 +179,7 @@ interface FormAutocompleteProps extends Omit<AutocompleteProps<any, boolean, boo
|
|
|
179
179
|
textFieldProps?: Omit<TextFieldProps, FormOmittedProps>;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
interface
|
|
183
|
-
}
|
|
184
|
-
interface FormNumberFieldProps extends FormTextFieldProps$1 {
|
|
182
|
+
interface FormNumberFieldProps extends Omit<TextFieldProps, FormOmittedProps> {
|
|
185
183
|
defaultValue?: number | null;
|
|
186
184
|
options?: Omit<NumericFormatProps<InputAttributes>, "customInput" | "onValueChange" | keyof InputAttributes>;
|
|
187
185
|
}
|
|
@@ -190,8 +188,7 @@ interface FormTextFieldProps extends Omit<TextFieldProps, FormOmittedProps> {
|
|
|
190
188
|
type?: "color" | "email" | "password" | "search" | "tel" | "text" | "url";
|
|
191
189
|
}
|
|
192
190
|
|
|
193
|
-
|
|
194
|
-
}
|
|
191
|
+
type FormSubmitButtonProps = Omit<ButtonProps, "loading" | "disabled" | "onClick" | "type">;
|
|
195
192
|
|
|
196
193
|
declare const useFieldContext: <TData>() => _tanstack_form_core.FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
197
194
|
declare const useFormContext: () => _tanstack_react_form.ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any>;
|
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 });
|
|
@@ -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,25 +1926,28 @@ 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
|
-
const
|
|
1935
|
-
const
|
|
1949
|
+
const login = () => user.login();
|
|
1950
|
+
const logout = () => user.logout();
|
|
1936
1951
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
1937
1952
|
const settings = /* @__PURE__ */ jsxs6(List, { component: "nav", subheader: /* @__PURE__ */ jsx14(ListSubheader, { sx: { backgroundColor: "transparent" }, children: t("Layout.Settings") }), children: [
|
|
1938
1953
|
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
@@ -1974,18 +1989,18 @@ 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 }),
|
|
1981
1996
|
/* @__PURE__ */ jsx14("br", {}),
|
|
1982
1997
|
/* @__PURE__ */ jsx14("span", { children: user.department })
|
|
1983
1998
|
] }) }) }),
|
|
1984
|
-
/* @__PURE__ */ jsxs6(ListItemButton, { onClick:
|
|
1999
|
+
/* @__PURE__ */ jsxs6(ListItemButton, { onClick: logout, children: [
|
|
1985
2000
|
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(Logout, { color: "error" }) }),
|
|
1986
2001
|
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.Logout") })
|
|
1987
2002
|
] })
|
|
1988
|
-
] }) : /* @__PURE__ */ jsxs6(ListItemButton, { onClick:
|
|
2003
|
+
] }) : /* @__PURE__ */ jsxs6(ListItemButton, { onClick: login, children: [
|
|
1989
2004
|
/* @__PURE__ */ jsx14(ListItemIcon, { children: /* @__PURE__ */ jsx14(Login, { color: "success" }) }),
|
|
1990
2005
|
/* @__PURE__ */ jsx14(ListItemText, { primary: t("Layout.LogIn") })
|
|
1991
2006
|
] }) }),
|
|
@@ -2007,80 +2022,6 @@ import { useTranslation as useTranslation4 } from "react-i18next";
|
|
|
2007
2022
|
// src/utils/ClientUtils.ts
|
|
2008
2023
|
import { useQueryClient } from "@tanstack/react-query";
|
|
2009
2024
|
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
|
|
2084
2025
|
var Platform = class {
|
|
2085
2026
|
static isAndroid = /android/i.test(navigator.userAgent);
|
|
2086
2027
|
static isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
@@ -2088,9 +2029,9 @@ var Platform = class {
|
|
|
2088
2029
|
static isMacOS = /Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.userAgent);
|
|
2089
2030
|
};
|
|
2090
2031
|
var getContrastTextColor = (color) => {
|
|
2091
|
-
const r = parseInt(color.
|
|
2092
|
-
const g = parseInt(color.
|
|
2093
|
-
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);
|
|
2094
2035
|
const yiq = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
2095
2036
|
return yiq >= 128 ? "black" : "white";
|
|
2096
2037
|
};
|
|
@@ -2113,9 +2054,6 @@ var rootRouteHead = ({ title, themeColor }) => () => ({
|
|
|
2113
2054
|
});
|
|
2114
2055
|
var wczApiClient = axios.create();
|
|
2115
2056
|
wczApiClient.interceptors.request.use(async (config) => {
|
|
2116
|
-
await UserService.updateToken();
|
|
2117
|
-
const token = await UserService.getToken();
|
|
2118
|
-
config.headers.Authorization = `Bearer ${token}`;
|
|
2119
2057
|
return config;
|
|
2120
2058
|
});
|
|
2121
2059
|
var WISTRON_PRIMARY_COLOR = "#00506E";
|
|
@@ -2138,8 +2076,8 @@ var useGetTheme = (theme) => {
|
|
|
2138
2076
|
},
|
|
2139
2077
|
dark: {
|
|
2140
2078
|
palette: {
|
|
2141
|
-
primary: { main: lighten(WISTRON_PRIMARY_COLOR, 0.
|
|
2142
|
-
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) }
|
|
2143
2081
|
}
|
|
2144
2082
|
},
|
|
2145
2083
|
...theme?.colorSchemes
|
|
@@ -2225,13 +2163,13 @@ import { useLocation, useNavigate, useSearch, Link as TanstackRouterLink } from
|
|
|
2225
2163
|
import { AppProvider } from "@toolpad/core/AppProvider";
|
|
2226
2164
|
import { useCallback, useMemo as useMemo2, forwardRef } from "react";
|
|
2227
2165
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2228
|
-
var Link2 = forwardRef((props,
|
|
2166
|
+
var Link2 = forwardRef(function Link3(props, reference) {
|
|
2229
2167
|
const { href, history, ...rest } = props;
|
|
2230
|
-
return /* @__PURE__ */ jsx15(TanstackRouterLink, { ref, to: href, replace: history === "replace", ...rest });
|
|
2168
|
+
return /* @__PURE__ */ jsx15(TanstackRouterLink, { ref: reference, to: href, replace: history === "replace", ...rest });
|
|
2231
2169
|
});
|
|
2232
2170
|
var TanstackRouterAppProvider = (props) => {
|
|
2233
2171
|
const { pathname } = useLocation();
|
|
2234
|
-
const
|
|
2172
|
+
const searchParameters = useSearch({ strict: false });
|
|
2235
2173
|
const _navigate = useNavigate();
|
|
2236
2174
|
const navigate = useCallback(
|
|
2237
2175
|
(url, { history = "auto" } = {}) => {
|
|
@@ -2239,7 +2177,7 @@ var TanstackRouterAppProvider = (props) => {
|
|
|
2239
2177
|
},
|
|
2240
2178
|
[_navigate]
|
|
2241
2179
|
);
|
|
2242
|
-
const router = useMemo2(() => ({ pathname, searchParams: new URLSearchParams(
|
|
2180
|
+
const router = useMemo2(() => ({ pathname, searchParams: new URLSearchParams(searchParameters), navigate, Link: Link2 }), [pathname, searchParameters, navigate]);
|
|
2243
2181
|
return /* @__PURE__ */ jsx15(AppProvider, { router, ...props });
|
|
2244
2182
|
};
|
|
2245
2183
|
|
|
@@ -2274,7 +2212,7 @@ var LayoutProvider = (props) => {
|
|
|
2274
2212
|
DashboardLayout,
|
|
2275
2213
|
{
|
|
2276
2214
|
defaultSidebarCollapsed: true,
|
|
2277
|
-
hideNavigation:
|
|
2215
|
+
hideNavigation: navigation.length === 0,
|
|
2278
2216
|
slots: {
|
|
2279
2217
|
toolbarActions: () => null,
|
|
2280
2218
|
toolbarAccount: ToolbarAccount,
|
|
@@ -2282,7 +2220,7 @@ var LayoutProvider = (props) => {
|
|
|
2282
2220
|
},
|
|
2283
2221
|
children: [
|
|
2284
2222
|
props.children,
|
|
2285
|
-
/* @__PURE__ */ jsx16(DevelopmentBanner, { hasNavigationRoutes:
|
|
2223
|
+
/* @__PURE__ */ jsx16(DevelopmentBanner, { hasNavigationRoutes: navigation.length > 0 }),
|
|
2286
2224
|
(isFetching || isMutating) && /* @__PURE__ */ jsx16(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
2287
2225
|
]
|
|
2288
2226
|
}
|
|
@@ -2321,10 +2259,10 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
2321
2259
|
onBlur: field.handleBlur,
|
|
2322
2260
|
"aria-label": field.name,
|
|
2323
2261
|
...autocompleteProps,
|
|
2324
|
-
renderInput: (
|
|
2262
|
+
renderInput: (parameters) => /* @__PURE__ */ jsx17(
|
|
2325
2263
|
TextField,
|
|
2326
2264
|
{
|
|
2327
|
-
...
|
|
2265
|
+
...parameters,
|
|
2328
2266
|
name: field.name,
|
|
2329
2267
|
error: isTouched && hasError,
|
|
2330
2268
|
helperText: isTouched && helperText,
|
|
@@ -2350,7 +2288,7 @@ var FormCheckbox = (props) => {
|
|
|
2350
2288
|
{
|
|
2351
2289
|
name: field.name,
|
|
2352
2290
|
checked: Boolean(field.state.value),
|
|
2353
|
-
onChange: (
|
|
2291
|
+
onChange: (event) => field.handleChange(event.target.checked),
|
|
2354
2292
|
onBlur: field.handleBlur,
|
|
2355
2293
|
"aria-label": field.name,
|
|
2356
2294
|
...props
|
|
@@ -2456,7 +2394,7 @@ var FormRadioGroup = ({ label, options, ...props }) => {
|
|
|
2456
2394
|
{
|
|
2457
2395
|
name: field.name,
|
|
2458
2396
|
value: field.state.value ?? "",
|
|
2459
|
-
onChange: (
|
|
2397
|
+
onChange: (event) => field.handleChange(event.target.value),
|
|
2460
2398
|
onBlur: field.handleBlur,
|
|
2461
2399
|
"aria-label": field.name,
|
|
2462
2400
|
...props,
|
|
@@ -2503,9 +2441,9 @@ import { Button as Button2 } from "@mui/material";
|
|
|
2503
2441
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2504
2442
|
var FormSubmitButton = (props) => {
|
|
2505
2443
|
const form = useFormContext();
|
|
2506
|
-
const handleClick = (
|
|
2507
|
-
|
|
2508
|
-
|
|
2444
|
+
const handleClick = (event) => {
|
|
2445
|
+
event.preventDefault();
|
|
2446
|
+
event.stopPropagation();
|
|
2509
2447
|
form.handleSubmit();
|
|
2510
2448
|
};
|
|
2511
2449
|
return /* @__PURE__ */ jsx24(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx24(
|
|
@@ -2536,7 +2474,7 @@ var FormSwitch = (props) => {
|
|
|
2536
2474
|
{
|
|
2537
2475
|
name: field.name,
|
|
2538
2476
|
checked: Boolean(field.state.value),
|
|
2539
|
-
onChange: (
|
|
2477
|
+
onChange: (event) => field.handleChange(event.target.checked),
|
|
2540
2478
|
onBlur: field.handleBlur,
|
|
2541
2479
|
"aria-label": field.name,
|
|
2542
2480
|
...props
|
|
@@ -2560,7 +2498,7 @@ var FormTextField = (props) => {
|
|
|
2560
2498
|
{
|
|
2561
2499
|
name: field.name,
|
|
2562
2500
|
value: field.state.value ?? "",
|
|
2563
|
-
onChange: (
|
|
2501
|
+
onChange: (event) => field.handleChange(event.target.value),
|
|
2564
2502
|
onBlur: field.handleBlur,
|
|
2565
2503
|
error: isTouched && hasError,
|
|
2566
2504
|
helperText: isTouched && helperText,
|
|
@@ -2609,7 +2547,7 @@ var useGetFileMetas = (subId, options) => {
|
|
|
2609
2547
|
const { appTitle } = useLayout();
|
|
2610
2548
|
return useQuery({
|
|
2611
2549
|
...options,
|
|
2612
|
-
queryKey: [QUERY_KEY, "meta", subId],
|
|
2550
|
+
queryKey: [QUERY_KEY, "meta", subId, appTitle],
|
|
2613
2551
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
2614
2552
|
url: `${BASE_URL}/v1/meta?appName=${appTitle}&subId=${subId}`,
|
|
2615
2553
|
method: "GET",
|
|
@@ -2623,7 +2561,7 @@ var useGetFileThumbnail = (meta, options) => {
|
|
|
2623
2561
|
const { appTitle } = useLayout();
|
|
2624
2562
|
return useQuery({
|
|
2625
2563
|
...options,
|
|
2626
|
-
queryKey: [QUERY_KEY, "thumbnail", meta?.id],
|
|
2564
|
+
queryKey: [QUERY_KEY, "thumbnail", meta?.id, appTitle],
|
|
2627
2565
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
2628
2566
|
url: `${BASE_URL}/v1/thumbnail?appName=${appTitle}&id=${meta?.id}`,
|
|
2629
2567
|
method: "GET",
|
|
@@ -2641,7 +2579,7 @@ var useGetFile = (meta, options) => {
|
|
|
2641
2579
|
const { appTitle } = useLayout();
|
|
2642
2580
|
return useQuery({
|
|
2643
2581
|
...options,
|
|
2644
|
-
queryKey: [QUERY_KEY, meta?.id],
|
|
2582
|
+
queryKey: [QUERY_KEY, meta?.id, appTitle],
|
|
2645
2583
|
queryFn: ({ signal }) => wczApiClient.request({
|
|
2646
2584
|
url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta?.id}`,
|
|
2647
2585
|
method: "GET",
|
|
@@ -2749,7 +2687,7 @@ var useUploadFile = ({ subId, onSuccess, onError }) => {
|
|
|
2749
2687
|
}
|
|
2750
2688
|
});
|
|
2751
2689
|
const previousUploads = await upload.findPreviousUploads();
|
|
2752
|
-
if (previousUploads.length) {
|
|
2690
|
+
if (previousUploads.length > 0) {
|
|
2753
2691
|
upload.resumeFromPreviousUpload(previousUploads[0]);
|
|
2754
2692
|
}
|
|
2755
2693
|
upload.start();
|