wcz-test 4.10.0 → 5.0.1
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 +36 -7
- package/dist/index.js +318 -281
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
47
47
|
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
48
48
|
var x = b ? Symbol.for("react.responder") : 60118;
|
|
49
49
|
var y = b ? Symbol.for("react.scope") : 60119;
|
|
50
|
-
function
|
|
50
|
+
function z19(a) {
|
|
51
51
|
if ("object" === typeof a && null !== a) {
|
|
52
52
|
var u = a.$$typeof;
|
|
53
53
|
switch (u) {
|
|
@@ -78,7 +78,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
function A(a) {
|
|
81
|
-
return
|
|
81
|
+
return z19(a) === m;
|
|
82
82
|
}
|
|
83
83
|
exports.AsyncMode = l;
|
|
84
84
|
exports.ConcurrentMode = m;
|
|
@@ -94,46 +94,46 @@ var require_react_is_production_min = __commonJS({
|
|
|
94
94
|
exports.StrictMode = f;
|
|
95
95
|
exports.Suspense = p;
|
|
96
96
|
exports.isAsyncMode = function(a) {
|
|
97
|
-
return A(a) ||
|
|
97
|
+
return A(a) || z19(a) === l;
|
|
98
98
|
};
|
|
99
99
|
exports.isConcurrentMode = A;
|
|
100
100
|
exports.isContextConsumer = function(a) {
|
|
101
|
-
return
|
|
101
|
+
return z19(a) === k;
|
|
102
102
|
};
|
|
103
103
|
exports.isContextProvider = function(a) {
|
|
104
|
-
return
|
|
104
|
+
return z19(a) === h;
|
|
105
105
|
};
|
|
106
106
|
exports.isElement = function(a) {
|
|
107
107
|
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
108
108
|
};
|
|
109
109
|
exports.isForwardRef = function(a) {
|
|
110
|
-
return
|
|
110
|
+
return z19(a) === n;
|
|
111
111
|
};
|
|
112
112
|
exports.isFragment = function(a) {
|
|
113
|
-
return
|
|
113
|
+
return z19(a) === e;
|
|
114
114
|
};
|
|
115
115
|
exports.isLazy = function(a) {
|
|
116
|
-
return
|
|
116
|
+
return z19(a) === t2;
|
|
117
117
|
};
|
|
118
118
|
exports.isMemo = function(a) {
|
|
119
|
-
return
|
|
119
|
+
return z19(a) === r;
|
|
120
120
|
};
|
|
121
121
|
exports.isPortal = function(a) {
|
|
122
|
-
return
|
|
122
|
+
return z19(a) === d;
|
|
123
123
|
};
|
|
124
124
|
exports.isProfiler = function(a) {
|
|
125
|
-
return
|
|
125
|
+
return z19(a) === g;
|
|
126
126
|
};
|
|
127
127
|
exports.isStrictMode = function(a) {
|
|
128
|
-
return
|
|
128
|
+
return z19(a) === f;
|
|
129
129
|
};
|
|
130
130
|
exports.isSuspense = function(a) {
|
|
131
|
-
return
|
|
131
|
+
return z19(a) === p;
|
|
132
132
|
};
|
|
133
133
|
exports.isValidElementType = function(a) {
|
|
134
134
|
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t2 || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
135
135
|
};
|
|
136
|
-
exports.typeOf =
|
|
136
|
+
exports.typeOf = z19;
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
|
|
@@ -1786,9 +1786,6 @@ var RouterError = ({ error }) => {
|
|
|
1786
1786
|
] }) });
|
|
1787
1787
|
};
|
|
1788
1788
|
|
|
1789
|
-
// src/providers/LayoutProvider.tsx
|
|
1790
|
-
import { ThemeProvider } from "@mui/material";
|
|
1791
|
-
|
|
1792
1789
|
// node_modules/@babel/runtime/helpers/esm/extends.js
|
|
1793
1790
|
function _extends() {
|
|
1794
1791
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -2553,14 +2550,14 @@ var AdapterDayjs = class {
|
|
|
2553
2550
|
};
|
|
2554
2551
|
|
|
2555
2552
|
// src/providers/LayoutProvider.tsx
|
|
2556
|
-
import { useEffect as
|
|
2553
|
+
import { useEffect as useEffect7, useEffectEvent as useEffectEvent2 } from "react";
|
|
2557
2554
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
2558
|
-
import * as
|
|
2555
|
+
import * as z3 from "zod";
|
|
2559
2556
|
|
|
2560
2557
|
// src/components/core/Layout.tsx
|
|
2561
2558
|
import Menu3 from "@mui/icons-material/Menu";
|
|
2562
2559
|
import MenuOpen from "@mui/icons-material/MenuOpen";
|
|
2563
|
-
import { AppBar, Box as Box9, CssBaseline, IconButton as IconButton5,
|
|
2560
|
+
import { AppBar, Box as Box9, CssBaseline, IconButton as IconButton5, LinearProgress, Toolbar } from "@mui/material";
|
|
2564
2561
|
import { styled as styled2 } from "@mui/material/styles";
|
|
2565
2562
|
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
|
2566
2563
|
import { Fragment as Fragment7 } from "react";
|
|
@@ -2920,15 +2917,22 @@ import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
|
2920
2917
|
import Brightness4 from "@mui/icons-material/Brightness4";
|
|
2921
2918
|
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
2922
2919
|
import DarkMode from "@mui/icons-material/DarkMode";
|
|
2920
|
+
import Done from "@mui/icons-material/Done";
|
|
2923
2921
|
import LightMode from "@mui/icons-material/LightMode";
|
|
2924
2922
|
import Login from "@mui/icons-material/Login";
|
|
2925
2923
|
import Logout from "@mui/icons-material/Logout";
|
|
2926
2924
|
import SettingsBrightness from "@mui/icons-material/SettingsBrightness";
|
|
2927
2925
|
import Translate from "@mui/icons-material/Translate";
|
|
2928
|
-
import { Avatar as Avatar2, Box as Box8, IconButton as IconButton4, List as List4, ListItem as ListItem2, ListItemButton as ListItemButton5, ListItemIcon as ListItemIcon4, ListItemText as ListItemText4, ListSubheader as ListSubheader2, Menu as Menu2, Typography as Typography7
|
|
2926
|
+
import { Avatar as Avatar2, Box as Box8, IconButton as IconButton4, List as List4, ListItem as ListItem2, ListItemButton as ListItemButton5, ListItemIcon as ListItemIcon4, ListItemText as ListItemText4, ListSubheader as ListSubheader2, Menu as Menu2, Typography as Typography7 } from "@mui/material";
|
|
2929
2927
|
import { Fragment as Fragment6, useState as useState8 } from "react";
|
|
2930
2928
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
2931
|
-
|
|
2929
|
+
|
|
2930
|
+
// src/contexts/ThemeContext.ts
|
|
2931
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
2932
|
+
var ThemeContext = createContext4({});
|
|
2933
|
+
var useTheme3 = () => useContext4(ThemeContext);
|
|
2934
|
+
|
|
2935
|
+
// src/components/core/ToolbarAccount.tsx
|
|
2932
2936
|
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2933
2937
|
var capitalize = (value) => value && value.charAt(0).toUpperCase() + value.slice(1);
|
|
2934
2938
|
var ToolbarAccount = () => {
|
|
@@ -2936,7 +2940,7 @@ var ToolbarAccount = () => {
|
|
|
2936
2940
|
const [tab, setTab] = useState8("settings");
|
|
2937
2941
|
const open = Boolean(anchorElement);
|
|
2938
2942
|
const { t: t2, i18n } = useTranslation5();
|
|
2939
|
-
const { mode, setMode } =
|
|
2943
|
+
const { mode, setMode } = useTheme3();
|
|
2940
2944
|
const supportedLanguages = (Array.isArray(i18n.options.supportedLngs) ? i18n.options.supportedLngs : []).filter((lng) => lng !== "cimode");
|
|
2941
2945
|
const languageDisplayNames = new Intl.DisplayNames([i18n.language], { type: "language" });
|
|
2942
2946
|
const colorModes = [
|
|
@@ -3047,7 +3051,6 @@ var Layout = (props) => {
|
|
|
3047
3051
|
const isFetching = !!useIsFetching();
|
|
3048
3052
|
const isMutating = !!useIsMutating();
|
|
3049
3053
|
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
3050
|
-
/* @__PURE__ */ jsx25(InitColorSchemeScript, {}),
|
|
3051
3054
|
/* @__PURE__ */ jsx25(CssBaseline, {}),
|
|
3052
3055
|
/* @__PURE__ */ jsxs14(Box9, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
3053
3056
|
/* @__PURE__ */ jsx25(
|
|
@@ -3084,8 +3087,78 @@ var Layout = (props) => {
|
|
|
3084
3087
|
] });
|
|
3085
3088
|
};
|
|
3086
3089
|
|
|
3087
|
-
// src/
|
|
3088
|
-
import {
|
|
3090
|
+
// src/providers/DialogsProvider.tsx
|
|
3091
|
+
import { useCallback, useId, useMemo as useMemo4, useRef as useRef3, useState as useState9 } from "react";
|
|
3092
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3093
|
+
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
3094
|
+
const [stack, setStack] = useState9([]);
|
|
3095
|
+
const keyPrefix = useId();
|
|
3096
|
+
const nextId = useRef3(0);
|
|
3097
|
+
const dialogMetadata = useRef3(/* @__PURE__ */ new WeakMap());
|
|
3098
|
+
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
3099
|
+
const { onClose = async () => {
|
|
3100
|
+
} } = options;
|
|
3101
|
+
let resolve;
|
|
3102
|
+
const promise = new Promise((resolveImpl) => {
|
|
3103
|
+
resolve = resolveImpl;
|
|
3104
|
+
});
|
|
3105
|
+
const key = `${keyPrefix}-${nextId.current}`;
|
|
3106
|
+
nextId.current += 1;
|
|
3107
|
+
const newEntry = {
|
|
3108
|
+
key,
|
|
3109
|
+
open: true,
|
|
3110
|
+
promise,
|
|
3111
|
+
Component: Component7,
|
|
3112
|
+
payload,
|
|
3113
|
+
onClose,
|
|
3114
|
+
resolve
|
|
3115
|
+
};
|
|
3116
|
+
dialogMetadata.current.set(promise, newEntry);
|
|
3117
|
+
setStack((previousStack) => [...previousStack, newEntry]);
|
|
3118
|
+
return promise;
|
|
3119
|
+
});
|
|
3120
|
+
const removeDialogFromStack = useCallback((dialog) => {
|
|
3121
|
+
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
3122
|
+
dialogMetadata.current.delete(dialog);
|
|
3123
|
+
}, []);
|
|
3124
|
+
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
3125
|
+
setStack(
|
|
3126
|
+
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
3127
|
+
);
|
|
3128
|
+
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
3129
|
+
});
|
|
3130
|
+
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
3131
|
+
const entryToClose = dialogMetadata.current.get(dialog);
|
|
3132
|
+
if (!entryToClose) {
|
|
3133
|
+
throw new Error("Dialog not found in stack");
|
|
3134
|
+
}
|
|
3135
|
+
try {
|
|
3136
|
+
await entryToClose.onClose(result);
|
|
3137
|
+
} finally {
|
|
3138
|
+
entryToClose.resolve(result);
|
|
3139
|
+
closeDialogUi(dialog);
|
|
3140
|
+
}
|
|
3141
|
+
return dialog;
|
|
3142
|
+
});
|
|
3143
|
+
const contextValue = useMemo4(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
3144
|
+
return /* @__PURE__ */ jsxs15(DialogsContext.Provider, { value: contextValue, children: [
|
|
3145
|
+
children,
|
|
3146
|
+
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ jsx26(
|
|
3147
|
+
Component7,
|
|
3148
|
+
{
|
|
3149
|
+
payload,
|
|
3150
|
+
open,
|
|
3151
|
+
onClose: async (result) => {
|
|
3152
|
+
await closeDialog(promise, result);
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
key
|
|
3156
|
+
))
|
|
3157
|
+
] });
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
// src/providers/ThemeProvider.tsx
|
|
3161
|
+
import { ThemeProvider as MuiThemeProvider, createTheme, darken, lighten, useMediaQuery as useMediaQuery2 } from "@mui/material";
|
|
3089
3162
|
import { grey as grey2 } from "@mui/material/colors";
|
|
3090
3163
|
import { csCZ as csCZ3, enUS as enUS3 } from "@mui/material/locale";
|
|
3091
3164
|
|
|
@@ -3790,35 +3863,39 @@ var csCZPickers = {
|
|
|
3790
3863
|
};
|
|
3791
3864
|
var csCZ2 = getPickersLocalization(csCZPickers);
|
|
3792
3865
|
|
|
3793
|
-
// src/
|
|
3866
|
+
// src/providers/ThemeProvider.tsx
|
|
3867
|
+
import { useRouterState as useRouterState3 } from "@tanstack/react-router";
|
|
3868
|
+
import { createServerFn } from "@tanstack/react-start";
|
|
3869
|
+
import { getCookie } from "@tanstack/react-start/server";
|
|
3870
|
+
import { useEffect as useEffect6, useState as useState10 } from "react";
|
|
3794
3871
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
3872
|
+
import { z as z2 } from "zod";
|
|
3873
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3795
3874
|
var WISTRON_PRIMARY_COLOR = "#00506E";
|
|
3796
3875
|
var WISTRON_SECONDARY_COLOR = "#64DC00";
|
|
3876
|
+
var THEME_COOKIE_NAME = "theme";
|
|
3877
|
+
var TEN_YEARS_IN_SECONDS = 60 * 60 * 24 * 365 * 10;
|
|
3797
3878
|
var LOCALE_MAP = {
|
|
3798
3879
|
cs: [csCZ, csCZ2, csCZ3],
|
|
3799
3880
|
en: [enUS2, enUS, enUS3]
|
|
3800
3881
|
};
|
|
3801
|
-
var
|
|
3882
|
+
var ThemeSchema = z2.enum(["light", "dark"]).or(z2.literal("system"));
|
|
3883
|
+
function ThemeProvider({ children, theme }) {
|
|
3802
3884
|
const { i18n } = useTranslation6();
|
|
3803
|
-
|
|
3885
|
+
const rootRouterState = useRouterState3({ select: (s) => s.matches[0] });
|
|
3886
|
+
const prefersDarkMode = useMediaQuery2("(prefers-color-scheme: dark)");
|
|
3887
|
+
const [mode, setMode] = useState10(rootRouterState.context.themeMode);
|
|
3888
|
+
const resolvedMode = mode === "system" ? prefersDarkMode ? "dark" : "light" : mode;
|
|
3889
|
+
useEffect6(() => {
|
|
3890
|
+
document.cookie = `${THEME_COOKIE_NAME}=${mode}; path=/; max-age=${TEN_YEARS_IN_SECONDS}`;
|
|
3891
|
+
}, [mode]);
|
|
3892
|
+
const createdTheme = createTheme(
|
|
3804
3893
|
{
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
palette: {
|
|
3811
|
-
primary: { main: WISTRON_PRIMARY_COLOR },
|
|
3812
|
-
secondary: { main: WISTRON_SECONDARY_COLOR }
|
|
3813
|
-
}
|
|
3814
|
-
},
|
|
3815
|
-
dark: {
|
|
3816
|
-
palette: {
|
|
3817
|
-
primary: { main: lighten(WISTRON_PRIMARY_COLOR, 0.5) },
|
|
3818
|
-
secondary: { main: darken(WISTRON_SECONDARY_COLOR, 0.5) }
|
|
3819
|
-
}
|
|
3820
|
-
},
|
|
3821
|
-
...theme?.colorSchemes
|
|
3894
|
+
palette: {
|
|
3895
|
+
mode: resolvedMode,
|
|
3896
|
+
primary: { main: resolvedMode === "dark" ? lighten(WISTRON_PRIMARY_COLOR, 0.5) : WISTRON_PRIMARY_COLOR },
|
|
3897
|
+
secondary: { main: resolvedMode === "dark" ? darken(WISTRON_SECONDARY_COLOR, 0.5) : WISTRON_SECONDARY_COLOR },
|
|
3898
|
+
...theme?.palette
|
|
3822
3899
|
},
|
|
3823
3900
|
components: {
|
|
3824
3901
|
MuiCssBaseline: {
|
|
@@ -3852,94 +3929,29 @@ var useGetTheme = (theme) => {
|
|
|
3852
3929
|
},
|
|
3853
3930
|
...LOCALE_MAP[i18n.language]
|
|
3854
3931
|
);
|
|
3855
|
-
};
|
|
3856
|
-
|
|
3857
|
-
// src/providers/DialogsProvider.tsx
|
|
3858
|
-
import { useCallback, useId, useMemo as useMemo4, useRef as useRef3, useState as useState9 } from "react";
|
|
3859
|
-
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3860
|
-
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
3861
|
-
const [stack, setStack] = useState9([]);
|
|
3862
|
-
const keyPrefix = useId();
|
|
3863
|
-
const nextId = useRef3(0);
|
|
3864
|
-
const dialogMetadata = useRef3(/* @__PURE__ */ new WeakMap());
|
|
3865
|
-
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
3866
|
-
const { onClose = async () => {
|
|
3867
|
-
} } = options;
|
|
3868
|
-
let resolve;
|
|
3869
|
-
const promise = new Promise((resolveImpl) => {
|
|
3870
|
-
resolve = resolveImpl;
|
|
3871
|
-
});
|
|
3872
|
-
const key = `${keyPrefix}-${nextId.current}`;
|
|
3873
|
-
nextId.current += 1;
|
|
3874
|
-
const newEntry = {
|
|
3875
|
-
key,
|
|
3876
|
-
open: true,
|
|
3877
|
-
promise,
|
|
3878
|
-
Component: Component7,
|
|
3879
|
-
payload,
|
|
3880
|
-
onClose,
|
|
3881
|
-
resolve
|
|
3882
|
-
};
|
|
3883
|
-
dialogMetadata.current.set(promise, newEntry);
|
|
3884
|
-
setStack((previousStack) => [...previousStack, newEntry]);
|
|
3885
|
-
return promise;
|
|
3886
|
-
});
|
|
3887
|
-
const removeDialogFromStack = useCallback((dialog) => {
|
|
3888
|
-
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
3889
|
-
dialogMetadata.current.delete(dialog);
|
|
3890
|
-
}, []);
|
|
3891
|
-
const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
|
|
3892
|
-
setStack(
|
|
3893
|
-
(previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
|
|
3894
|
-
);
|
|
3895
|
-
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
3896
|
-
});
|
|
3897
|
-
const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
|
|
3898
|
-
const entryToClose = dialogMetadata.current.get(dialog);
|
|
3899
|
-
if (!entryToClose) {
|
|
3900
|
-
throw new Error("Dialog not found in stack");
|
|
3901
|
-
}
|
|
3902
|
-
try {
|
|
3903
|
-
await entryToClose.onClose(result);
|
|
3904
|
-
} finally {
|
|
3905
|
-
entryToClose.resolve(result);
|
|
3906
|
-
closeDialogUi(dialog);
|
|
3907
|
-
}
|
|
3908
|
-
return dialog;
|
|
3909
|
-
});
|
|
3910
|
-
const contextValue = useMemo4(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
|
|
3911
|
-
return /* @__PURE__ */ jsxs15(DialogsContext.Provider, { value: contextValue, children: [
|
|
3912
|
-
children,
|
|
3913
|
-
stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ jsx26(
|
|
3914
|
-
Component7,
|
|
3915
|
-
{
|
|
3916
|
-
payload,
|
|
3917
|
-
open,
|
|
3918
|
-
onClose: async (result) => {
|
|
3919
|
-
await closeDialog(promise, result);
|
|
3920
|
-
}
|
|
3921
|
-
},
|
|
3922
|
-
key
|
|
3923
|
-
))
|
|
3924
|
-
] });
|
|
3932
|
+
return /* @__PURE__ */ jsx27(ThemeContext.Provider, { value: { mode, setMode }, children: /* @__PURE__ */ jsx27(MuiThemeProvider, { theme: createdTheme, children }) });
|
|
3925
3933
|
}
|
|
3934
|
+
var getThemeMode = createServerFn().handler(() => {
|
|
3935
|
+
const themeCookie = getCookie(THEME_COOKIE_NAME);
|
|
3936
|
+
const parsed = ThemeSchema.safeParse(themeCookie);
|
|
3937
|
+
return parsed.success ? parsed.data : "system";
|
|
3938
|
+
});
|
|
3926
3939
|
|
|
3927
3940
|
// src/providers/LayoutProvider.tsx
|
|
3928
|
-
import { jsx as
|
|
3941
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3929
3942
|
var LayoutProvider = ({ navigation, theme, children }) => {
|
|
3930
3943
|
const { i18n } = useTranslation7();
|
|
3931
|
-
const createdTheme = useGetTheme(theme);
|
|
3932
3944
|
const languageChangedHandler = useEffectEvent2(() => {
|
|
3933
|
-
|
|
3945
|
+
z3.config(z3.core.locales[i18n.language]());
|
|
3934
3946
|
});
|
|
3935
|
-
|
|
3947
|
+
useEffect7(() => {
|
|
3936
3948
|
languageChangedHandler();
|
|
3937
3949
|
i18n.on("languageChanged", languageChangedHandler);
|
|
3938
3950
|
return () => {
|
|
3939
3951
|
i18n.off("languageChanged", languageChangedHandler);
|
|
3940
3952
|
};
|
|
3941
3953
|
}, []);
|
|
3942
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ jsx28(ThemeProvider, { theme, children: /* @__PURE__ */ jsx28(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.resolvedLanguage, children: /* @__PURE__ */ jsx28(DialogsProvider, { children: /* @__PURE__ */ jsx28(Layout, { navigation, children }) }) }) });
|
|
3943
3955
|
};
|
|
3944
3956
|
|
|
3945
3957
|
// src/index.ts
|
|
@@ -3950,11 +3962,11 @@ import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
|
|
|
3950
3962
|
|
|
3951
3963
|
// src/components/form/FormAutocomplete.tsx
|
|
3952
3964
|
import { Autocomplete, TextField } from "@mui/material";
|
|
3953
|
-
import { jsx as
|
|
3965
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3954
3966
|
var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
3955
3967
|
const field = useFieldContext();
|
|
3956
3968
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3957
|
-
return /* @__PURE__ */
|
|
3969
|
+
return /* @__PURE__ */ jsx29(
|
|
3958
3970
|
Autocomplete,
|
|
3959
3971
|
{
|
|
3960
3972
|
value: field.state.value,
|
|
@@ -3963,7 +3975,7 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3963
3975
|
onBlur: field.handleBlur,
|
|
3964
3976
|
"aria-label": field.name,
|
|
3965
3977
|
...autocompleteProps,
|
|
3966
|
-
renderInput: (parameters) => /* @__PURE__ */
|
|
3978
|
+
renderInput: (parameters) => /* @__PURE__ */ jsx29(
|
|
3967
3979
|
TextField,
|
|
3968
3980
|
{
|
|
3969
3981
|
...parameters,
|
|
@@ -3979,15 +3991,15 @@ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
|
3979
3991
|
|
|
3980
3992
|
// src/components/form/FormCheckbox.tsx
|
|
3981
3993
|
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
3982
|
-
import { jsx as
|
|
3994
|
+
import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3983
3995
|
var FormCheckbox = (props) => {
|
|
3984
3996
|
const field = useFieldContext();
|
|
3985
3997
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
3986
3998
|
return /* @__PURE__ */ jsxs16(FormControl, { component: "fieldset", children: [
|
|
3987
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ jsx30(
|
|
3988
4000
|
FormControlLabel,
|
|
3989
4001
|
{
|
|
3990
|
-
control: /* @__PURE__ */
|
|
4002
|
+
control: /* @__PURE__ */ jsx30(
|
|
3991
4003
|
Checkbox,
|
|
3992
4004
|
{
|
|
3993
4005
|
name: field.name,
|
|
@@ -4001,18 +4013,18 @@ var FormCheckbox = (props) => {
|
|
|
4001
4013
|
label: props.label ?? ""
|
|
4002
4014
|
}
|
|
4003
4015
|
),
|
|
4004
|
-
isTouched && hasError && /* @__PURE__ */
|
|
4016
|
+
isTouched && hasError && /* @__PURE__ */ jsx30(FormHelperText, { error: hasError, children: helperText })
|
|
4005
4017
|
] });
|
|
4006
4018
|
};
|
|
4007
4019
|
|
|
4008
4020
|
// src/components/form/FormDatePicker.tsx
|
|
4009
4021
|
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
4010
4022
|
import dayjs2 from "dayjs";
|
|
4011
|
-
import { jsx as
|
|
4023
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4012
4024
|
var FormDatePicker = (props) => {
|
|
4013
4025
|
const field = useFieldContext();
|
|
4014
4026
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4015
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsx31(
|
|
4016
4028
|
DatePicker,
|
|
4017
4029
|
{
|
|
4018
4030
|
name: field.name,
|
|
@@ -4036,11 +4048,11 @@ var FormDatePicker = (props) => {
|
|
|
4036
4048
|
// src/components/form/FormDateTimePicker.tsx
|
|
4037
4049
|
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
4038
4050
|
import dayjs3 from "dayjs";
|
|
4039
|
-
import { jsx as
|
|
4051
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
4040
4052
|
var FormDateTimePicker = (props) => {
|
|
4041
4053
|
const field = useFieldContext();
|
|
4042
4054
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4043
|
-
return /* @__PURE__ */
|
|
4055
|
+
return /* @__PURE__ */ jsx32(
|
|
4044
4056
|
DateTimePicker,
|
|
4045
4057
|
{
|
|
4046
4058
|
name: field.name,
|
|
@@ -4064,11 +4076,11 @@ var FormDateTimePicker = (props) => {
|
|
|
4064
4076
|
// src/components/form/FormNumberField.tsx
|
|
4065
4077
|
import { TextField as TextField2 } from "@mui/material";
|
|
4066
4078
|
import { NumericFormat } from "react-number-format";
|
|
4067
|
-
import { jsx as
|
|
4079
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4068
4080
|
var FormNumberField = ({ options, ...props }) => {
|
|
4069
4081
|
const field = useFieldContext();
|
|
4070
4082
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4071
|
-
return /* @__PURE__ */
|
|
4083
|
+
return /* @__PURE__ */ jsx33(
|
|
4072
4084
|
NumericFormat,
|
|
4073
4085
|
{
|
|
4074
4086
|
customInput: TextField2,
|
|
@@ -4087,13 +4099,13 @@ var FormNumberField = ({ options, ...props }) => {
|
|
|
4087
4099
|
|
|
4088
4100
|
// src/components/form/FormRadioGroup.tsx
|
|
4089
4101
|
import { FormControl as FormControl2, FormControlLabel as FormControlLabel2, FormHelperText as FormHelperText2, FormLabel, Radio, RadioGroup } from "@mui/material";
|
|
4090
|
-
import { jsx as
|
|
4102
|
+
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4091
4103
|
var FormRadioGroup = ({ label, options, ...props }) => {
|
|
4092
4104
|
const field = useFieldContext();
|
|
4093
4105
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4094
4106
|
return /* @__PURE__ */ jsxs17(FormControl2, { component: "fieldset", children: [
|
|
4095
|
-
label && /* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4107
|
+
label && /* @__PURE__ */ jsx34(FormLabel, { component: "legend", children: label }),
|
|
4108
|
+
/* @__PURE__ */ jsx34(
|
|
4097
4109
|
RadioGroup,
|
|
4098
4110
|
{
|
|
4099
4111
|
name: field.name,
|
|
@@ -4102,30 +4114,30 @@ var FormRadioGroup = ({ label, options, ...props }) => {
|
|
|
4102
4114
|
onBlur: field.handleBlur,
|
|
4103
4115
|
"aria-label": field.name,
|
|
4104
4116
|
...props,
|
|
4105
|
-
children: options.map((option) => /* @__PURE__ */
|
|
4117
|
+
children: options.map((option) => /* @__PURE__ */ jsx34(
|
|
4106
4118
|
FormControlLabel2,
|
|
4107
4119
|
{
|
|
4108
4120
|
value: option.value,
|
|
4109
|
-
control: /* @__PURE__ */
|
|
4121
|
+
control: /* @__PURE__ */ jsx34(Radio, {}),
|
|
4110
4122
|
label: option.label
|
|
4111
4123
|
},
|
|
4112
4124
|
option.value
|
|
4113
4125
|
))
|
|
4114
4126
|
}
|
|
4115
4127
|
),
|
|
4116
|
-
isTouched && hasError && /* @__PURE__ */
|
|
4128
|
+
isTouched && hasError && /* @__PURE__ */ jsx34(FormHelperText2, { error: hasError, children: helperText })
|
|
4117
4129
|
] });
|
|
4118
4130
|
};
|
|
4119
4131
|
|
|
4120
4132
|
// src/components/form/FormSlider.tsx
|
|
4121
4133
|
import { FormControl as FormControl3, FormHelperText as FormHelperText3, FormLabel as FormLabel2, Slider } from "@mui/material";
|
|
4122
|
-
import { jsx as
|
|
4134
|
+
import { jsx as jsx35, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4123
4135
|
var FormSlider = ({ label, ...props }) => {
|
|
4124
4136
|
const field = useFieldContext();
|
|
4125
4137
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4126
4138
|
return /* @__PURE__ */ jsxs18(FormControl3, { component: "fieldset", children: [
|
|
4127
|
-
label && /* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */
|
|
4139
|
+
label && /* @__PURE__ */ jsx35(FormLabel2, { children: label }),
|
|
4140
|
+
/* @__PURE__ */ jsx35(
|
|
4129
4141
|
Slider,
|
|
4130
4142
|
{
|
|
4131
4143
|
name: field.name,
|
|
@@ -4136,13 +4148,13 @@ var FormSlider = ({ label, ...props }) => {
|
|
|
4136
4148
|
...props
|
|
4137
4149
|
}
|
|
4138
4150
|
),
|
|
4139
|
-
isTouched && hasError && /* @__PURE__ */
|
|
4151
|
+
isTouched && hasError && /* @__PURE__ */ jsx35(FormHelperText3, { error: hasError, children: helperText })
|
|
4140
4152
|
] });
|
|
4141
4153
|
};
|
|
4142
4154
|
|
|
4143
4155
|
// src/components/form/FormSubmitButton.tsx
|
|
4144
4156
|
import { Button as Button3 } from "@mui/material";
|
|
4145
|
-
import { jsx as
|
|
4157
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4146
4158
|
var FormSubmitButton = (props) => {
|
|
4147
4159
|
const form = useFormContext();
|
|
4148
4160
|
const handleClick = (event) => {
|
|
@@ -4150,7 +4162,7 @@ var FormSubmitButton = (props) => {
|
|
|
4150
4162
|
event.stopPropagation();
|
|
4151
4163
|
form.handleSubmit();
|
|
4152
4164
|
};
|
|
4153
|
-
return /* @__PURE__ */
|
|
4165
|
+
return /* @__PURE__ */ jsx36(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx36(
|
|
4154
4166
|
Button3,
|
|
4155
4167
|
{
|
|
4156
4168
|
loading: isSubmitting,
|
|
@@ -4165,15 +4177,15 @@ var FormSubmitButton = (props) => {
|
|
|
4165
4177
|
|
|
4166
4178
|
// src/components/form/FormSwitch.tsx
|
|
4167
4179
|
import { FormControl as FormControl4, FormControlLabel as FormControlLabel3, FormHelperText as FormHelperText4, Switch } from "@mui/material";
|
|
4168
|
-
import { jsx as
|
|
4180
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4169
4181
|
var FormSwitch = (props) => {
|
|
4170
4182
|
const field = useFieldContext();
|
|
4171
4183
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4172
4184
|
return /* @__PURE__ */ jsxs19(FormControl4, { component: "fieldset", children: [
|
|
4173
|
-
/* @__PURE__ */
|
|
4185
|
+
/* @__PURE__ */ jsx37(
|
|
4174
4186
|
FormControlLabel3,
|
|
4175
4187
|
{
|
|
4176
|
-
control: /* @__PURE__ */
|
|
4188
|
+
control: /* @__PURE__ */ jsx37(
|
|
4177
4189
|
Switch,
|
|
4178
4190
|
{
|
|
4179
4191
|
name: field.name,
|
|
@@ -4187,17 +4199,17 @@ var FormSwitch = (props) => {
|
|
|
4187
4199
|
label: props.label ?? ""
|
|
4188
4200
|
}
|
|
4189
4201
|
),
|
|
4190
|
-
isTouched && hasError && /* @__PURE__ */
|
|
4202
|
+
isTouched && hasError && /* @__PURE__ */ jsx37(FormHelperText4, { error: hasError, children: helperText })
|
|
4191
4203
|
] });
|
|
4192
4204
|
};
|
|
4193
4205
|
|
|
4194
4206
|
// src/components/form/FormTextField.tsx
|
|
4195
4207
|
import { TextField as TextField3 } from "@mui/material";
|
|
4196
|
-
import { jsx as
|
|
4208
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
4197
4209
|
var FormTextField = (props) => {
|
|
4198
4210
|
const field = useFieldContext();
|
|
4199
4211
|
const { isTouched, hasError, helperText } = getFieldStatus(field);
|
|
4200
|
-
return /* @__PURE__ */
|
|
4212
|
+
return /* @__PURE__ */ jsx38(
|
|
4201
4213
|
TextField3,
|
|
4202
4214
|
{
|
|
4203
4215
|
name: field.name,
|
|
@@ -4442,156 +4454,156 @@ var useGetPeopleSoftCompanyGeneralManager = (companyCode, options) => {
|
|
|
4442
4454
|
|
|
4443
4455
|
// src/models/file/FileMeta.ts
|
|
4444
4456
|
import { uuidv7 as uuidv72 } from "uuidv7";
|
|
4445
|
-
import * as
|
|
4446
|
-
var FileMetaSchema =
|
|
4447
|
-
id:
|
|
4448
|
-
subId:
|
|
4449
|
-
appName:
|
|
4450
|
-
fileName:
|
|
4451
|
-
fileExtension:
|
|
4452
|
-
fileSize:
|
|
4453
|
-
mediaSubType:
|
|
4454
|
-
mediaType:
|
|
4455
|
-
mimeType:
|
|
4456
|
-
createdBy:
|
|
4457
|
-
createdDate:
|
|
4457
|
+
import * as z4 from "zod";
|
|
4458
|
+
var FileMetaSchema = z4.object({
|
|
4459
|
+
id: z4.uuid().default(uuidv72),
|
|
4460
|
+
subId: z4.uuid().default(uuidv72),
|
|
4461
|
+
appName: z4.string().min(1).max(255),
|
|
4462
|
+
fileName: z4.string().min(1).max(255),
|
|
4463
|
+
fileExtension: z4.string().min(1).max(255),
|
|
4464
|
+
fileSize: z4.number().min(0),
|
|
4465
|
+
mediaSubType: z4.string().min(1).max(255),
|
|
4466
|
+
mediaType: z4.string().min(1).max(255),
|
|
4467
|
+
mimeType: z4.string().min(1).max(255),
|
|
4468
|
+
createdBy: z4.string().min(1).max(255),
|
|
4469
|
+
createdDate: z4.date()
|
|
4458
4470
|
});
|
|
4459
4471
|
|
|
4460
4472
|
// src/models/email/Email.ts
|
|
4461
|
-
import
|
|
4473
|
+
import z6 from "zod";
|
|
4462
4474
|
|
|
4463
4475
|
// src/models/email/EmailAttachment.ts
|
|
4464
|
-
import
|
|
4465
|
-
var EmailAttachmentSchema =
|
|
4466
|
-
appName:
|
|
4467
|
-
subId:
|
|
4476
|
+
import z5 from "zod";
|
|
4477
|
+
var EmailAttachmentSchema = z5.object({
|
|
4478
|
+
appName: z5.string().min(1).max(100),
|
|
4479
|
+
subId: z5.uuid()
|
|
4468
4480
|
});
|
|
4469
4481
|
|
|
4470
4482
|
// src/models/email/Email.ts
|
|
4471
|
-
var EmailSchema =
|
|
4472
|
-
subject:
|
|
4473
|
-
body:
|
|
4474
|
-
to:
|
|
4475
|
-
bcc:
|
|
4476
|
-
cc:
|
|
4477
|
-
attachments:
|
|
4483
|
+
var EmailSchema = z6.object({
|
|
4484
|
+
subject: z6.string().min(1).max(60),
|
|
4485
|
+
body: z6.string().min(1),
|
|
4486
|
+
to: z6.array(z6.email()).min(1),
|
|
4487
|
+
bcc: z6.array(z6.email()).optional(),
|
|
4488
|
+
cc: z6.array(z6.email()).optional(),
|
|
4489
|
+
attachments: z6.array(EmailAttachmentSchema).optional()
|
|
4478
4490
|
});
|
|
4479
4491
|
|
|
4480
4492
|
// src/models/peoplesoft/Employee.ts
|
|
4481
|
-
import
|
|
4493
|
+
import z9 from "zod";
|
|
4482
4494
|
|
|
4483
4495
|
// src/models/peoplesoft/EmployeeCategoryGroup.ts
|
|
4484
|
-
import
|
|
4485
|
-
var EmployeeCategoryGroup =
|
|
4496
|
+
import z7 from "zod";
|
|
4497
|
+
var EmployeeCategoryGroup = z7.enum([
|
|
4486
4498
|
"IDL",
|
|
4487
4499
|
"FD",
|
|
4488
4500
|
"FI"
|
|
4489
4501
|
]);
|
|
4490
4502
|
|
|
4491
4503
|
// src/models/peoplesoft/EmployeeStatus.ts
|
|
4492
|
-
import
|
|
4493
|
-
var EmployeeStatus =
|
|
4504
|
+
import z8 from "zod";
|
|
4505
|
+
var EmployeeStatus = z8.enum([
|
|
4494
4506
|
"Active",
|
|
4495
4507
|
"Terminated",
|
|
4496
4508
|
"Leave of Absence"
|
|
4497
4509
|
]);
|
|
4498
4510
|
|
|
4499
4511
|
// src/models/peoplesoft/Employee.ts
|
|
4500
|
-
var EmployeeSchema =
|
|
4501
|
-
badgeId:
|
|
4502
|
-
category:
|
|
4512
|
+
var EmployeeSchema = z9.object({
|
|
4513
|
+
badgeId: z9.string(),
|
|
4514
|
+
category: z9.string(),
|
|
4503
4515
|
categoryGroup: EmployeeCategoryGroup,
|
|
4504
|
-
companyCode:
|
|
4505
|
-
contactPhone:
|
|
4506
|
-
departmentId:
|
|
4507
|
-
departmentDescription:
|
|
4508
|
-
emailString:
|
|
4509
|
-
employeeId:
|
|
4510
|
-
extensionNumber:
|
|
4511
|
-
firstName:
|
|
4512
|
-
gender:
|
|
4513
|
-
hiredDate:
|
|
4514
|
-
lastName:
|
|
4515
|
-
managerId:
|
|
4516
|
-
middleName:
|
|
4517
|
-
name:
|
|
4518
|
-
nameTitleCase:
|
|
4519
|
-
nfcSn:
|
|
4520
|
-
plantId:
|
|
4521
|
-
position:
|
|
4522
|
-
previousEmployeeIds:
|
|
4523
|
-
reHiredDate:
|
|
4524
|
-
recordNumber:
|
|
4516
|
+
companyCode: z9.string(),
|
|
4517
|
+
contactPhone: z9.string(),
|
|
4518
|
+
departmentId: z9.string(),
|
|
4519
|
+
departmentDescription: z9.string(),
|
|
4520
|
+
emailString: z9.string(),
|
|
4521
|
+
employeeId: z9.string(),
|
|
4522
|
+
extensionNumber: z9.string(),
|
|
4523
|
+
firstName: z9.string(),
|
|
4524
|
+
gender: z9.string(),
|
|
4525
|
+
hiredDate: z9.date(),
|
|
4526
|
+
lastName: z9.string(),
|
|
4527
|
+
managerId: z9.string(),
|
|
4528
|
+
middleName: z9.string(),
|
|
4529
|
+
name: z9.string(),
|
|
4530
|
+
nameTitleCase: z9.string(),
|
|
4531
|
+
nfcSn: z9.string(),
|
|
4532
|
+
plantId: z9.string(),
|
|
4533
|
+
position: z9.string(),
|
|
4534
|
+
previousEmployeeIds: z9.string().nullable(),
|
|
4535
|
+
reHiredDate: z9.date().nullable(),
|
|
4536
|
+
recordNumber: z9.number(),
|
|
4525
4537
|
status: EmployeeStatus,
|
|
4526
|
-
supervisorId:
|
|
4527
|
-
terminationDate:
|
|
4528
|
-
terminationFutureDate:
|
|
4529
|
-
type:
|
|
4530
|
-
upperDepartmentId:
|
|
4531
|
-
jobCode:
|
|
4532
|
-
jobDescription:
|
|
4533
|
-
terminationReason:
|
|
4534
|
-
supervisorRecordNumber:
|
|
4538
|
+
supervisorId: z9.string(),
|
|
4539
|
+
terminationDate: z9.date().nullable(),
|
|
4540
|
+
terminationFutureDate: z9.date().nullable(),
|
|
4541
|
+
type: z9.string(),
|
|
4542
|
+
upperDepartmentId: z9.string(),
|
|
4543
|
+
jobCode: z9.string(),
|
|
4544
|
+
jobDescription: z9.string(),
|
|
4545
|
+
terminationReason: z9.string().nullable(),
|
|
4546
|
+
supervisorRecordNumber: z9.number()
|
|
4535
4547
|
});
|
|
4536
4548
|
|
|
4537
4549
|
// src/models/peoplesoft/Department.ts
|
|
4538
|
-
import
|
|
4539
|
-
var DepartmentSchema =
|
|
4540
|
-
departmentId:
|
|
4541
|
-
description:
|
|
4542
|
-
managerId:
|
|
4543
|
-
managerRecordNumber:
|
|
4544
|
-
treeLevel:
|
|
4545
|
-
upperDepartmentId:
|
|
4546
|
-
companyCode:
|
|
4547
|
-
location:
|
|
4548
|
-
salLocation:
|
|
4549
|
-
plantId:
|
|
4550
|
+
import z10 from "zod";
|
|
4551
|
+
var DepartmentSchema = z10.object({
|
|
4552
|
+
departmentId: z10.string(),
|
|
4553
|
+
description: z10.string(),
|
|
4554
|
+
managerId: z10.string(),
|
|
4555
|
+
managerRecordNumber: z10.string(),
|
|
4556
|
+
treeLevel: z10.number(),
|
|
4557
|
+
upperDepartmentId: z10.string(),
|
|
4558
|
+
companyCode: z10.string(),
|
|
4559
|
+
location: z10.string(),
|
|
4560
|
+
salLocation: z10.string(),
|
|
4561
|
+
plantId: z10.string(),
|
|
4550
4562
|
manager: EmployeeSchema
|
|
4551
4563
|
});
|
|
4552
4564
|
|
|
4553
4565
|
// src/models/approval/Approval.ts
|
|
4554
4566
|
import { uuidv7 as uuidv75 } from "uuidv7";
|
|
4555
|
-
import
|
|
4567
|
+
import z18 from "zod";
|
|
4556
4568
|
|
|
4557
4569
|
// src/models/approval/ApprovalFlow.ts
|
|
4558
4570
|
import { uuidv7 as uuidv73 } from "uuidv7";
|
|
4559
|
-
import { z as
|
|
4571
|
+
import { z as z12 } from "zod";
|
|
4560
4572
|
|
|
4561
4573
|
// src/models/approval/StepApprovalOrder.ts
|
|
4562
|
-
import
|
|
4563
|
-
var StepApprovalOrder =
|
|
4574
|
+
import z11 from "zod";
|
|
4575
|
+
var StepApprovalOrder = z11.enum([
|
|
4564
4576
|
"Serial",
|
|
4565
4577
|
"Parallel",
|
|
4566
4578
|
"OneOfThem"
|
|
4567
4579
|
]);
|
|
4568
4580
|
|
|
4569
4581
|
// src/models/approval/ApprovalFlow.ts
|
|
4570
|
-
var ApprovalFlowSchema =
|
|
4571
|
-
id:
|
|
4572
|
-
approvalStage:
|
|
4573
|
-
batchSequence:
|
|
4574
|
-
approvalSequence:
|
|
4582
|
+
var ApprovalFlowSchema = z12.object({
|
|
4583
|
+
id: z12.uuid().default(uuidv73),
|
|
4584
|
+
approvalStage: z12.number(),
|
|
4585
|
+
batchSequence: z12.number().optional(),
|
|
4586
|
+
approvalSequence: z12.number(),
|
|
4575
4587
|
stepApprovalOrder: StepApprovalOrder,
|
|
4576
|
-
steps:
|
|
4577
|
-
isActive:
|
|
4588
|
+
steps: z12.array(z12.custom()),
|
|
4589
|
+
isActive: z12.boolean().default(false)
|
|
4578
4590
|
});
|
|
4579
4591
|
|
|
4580
4592
|
// src/models/approval/ApprovalFlowStep.ts
|
|
4581
4593
|
import { uuidv7 as uuidv74 } from "uuidv7";
|
|
4582
|
-
import { z as
|
|
4594
|
+
import { z as z15 } from "zod";
|
|
4583
4595
|
|
|
4584
4596
|
// src/models/approval/ApprovalEmployee.ts
|
|
4585
|
-
import { z as
|
|
4586
|
-
var ApprovalEmployeeSchema =
|
|
4587
|
-
employeeId:
|
|
4588
|
-
name:
|
|
4589
|
-
email:
|
|
4597
|
+
import { z as z13 } from "zod";
|
|
4598
|
+
var ApprovalEmployeeSchema = z13.object({
|
|
4599
|
+
employeeId: z13.string().min(1).max(20),
|
|
4600
|
+
name: z13.string().min(1).max(50),
|
|
4601
|
+
email: z13.email().min(1).max(100)
|
|
4590
4602
|
});
|
|
4591
4603
|
|
|
4592
4604
|
// src/models/approval/ApprovalStepResult.ts
|
|
4593
|
-
import
|
|
4594
|
-
var ApprovalStepResult =
|
|
4605
|
+
import z14 from "zod";
|
|
4606
|
+
var ApprovalStepResult = z14.enum([
|
|
4595
4607
|
"NotAvailable",
|
|
4596
4608
|
"FutureApproval",
|
|
4597
4609
|
"WaitingForApproval",
|
|
@@ -4603,27 +4615,27 @@ var ApprovalStepResult = z13.enum([
|
|
|
4603
4615
|
]);
|
|
4604
4616
|
|
|
4605
4617
|
// src/models/approval/ApprovalFlowStep.ts
|
|
4606
|
-
var ApprovalFlowStepSchema =
|
|
4607
|
-
id:
|
|
4608
|
-
order:
|
|
4609
|
-
approverRole:
|
|
4618
|
+
var ApprovalFlowStepSchema = z15.object({
|
|
4619
|
+
id: z15.uuid().default(uuidv74),
|
|
4620
|
+
order: z15.number(),
|
|
4621
|
+
approverRole: z15.string().min(1).max(100).default("Approver"),
|
|
4610
4622
|
approver: ApprovalEmployeeSchema,
|
|
4611
4623
|
actualApprover: ApprovalEmployeeSchema.optional(),
|
|
4612
4624
|
result: ApprovalStepResult.default("NotAvailable"),
|
|
4613
|
-
resultDate:
|
|
4614
|
-
resultComment:
|
|
4625
|
+
resultDate: z15.date().optional(),
|
|
4626
|
+
resultComment: z15.string().max(2e3).optional()
|
|
4615
4627
|
});
|
|
4616
4628
|
|
|
4617
4629
|
// src/models/approval/ApprovalRequestType.ts
|
|
4618
|
-
import
|
|
4619
|
-
var ApprovalRequestType =
|
|
4630
|
+
import z16 from "zod";
|
|
4631
|
+
var ApprovalRequestType = z16.enum([
|
|
4620
4632
|
"Single",
|
|
4621
4633
|
"Batch"
|
|
4622
4634
|
]);
|
|
4623
4635
|
|
|
4624
4636
|
// src/models/approval/ApprovalStatus.ts
|
|
4625
|
-
import
|
|
4626
|
-
var ApprovalStatus =
|
|
4637
|
+
import z17 from "zod";
|
|
4638
|
+
var ApprovalStatus = z17.enum([
|
|
4627
4639
|
"WaitingForApproval",
|
|
4628
4640
|
"Approved",
|
|
4629
4641
|
"PartiallyApproved",
|
|
@@ -4633,21 +4645,21 @@ var ApprovalStatus = z16.enum([
|
|
|
4633
4645
|
]);
|
|
4634
4646
|
|
|
4635
4647
|
// src/models/approval/Approval.ts
|
|
4636
|
-
var ApprovalSchema =
|
|
4637
|
-
id:
|
|
4638
|
-
number:
|
|
4639
|
-
applicationName:
|
|
4648
|
+
var ApprovalSchema = z18.object({
|
|
4649
|
+
id: z18.uuid().default(uuidv75),
|
|
4650
|
+
number: z18.string().max(30).optional(),
|
|
4651
|
+
applicationName: z18.string().min(1).max(50),
|
|
4640
4652
|
type: ApprovalRequestType.default("Single"),
|
|
4641
4653
|
status: ApprovalStatus,
|
|
4642
|
-
emailBody:
|
|
4643
|
-
created:
|
|
4644
|
-
createdBy:
|
|
4645
|
-
updated:
|
|
4646
|
-
updatedBy:
|
|
4647
|
-
approvalFlows:
|
|
4648
|
-
currentApprovers:
|
|
4654
|
+
emailBody: z18.string().min(1),
|
|
4655
|
+
created: z18.date(),
|
|
4656
|
+
createdBy: z18.custom(),
|
|
4657
|
+
updated: z18.date(),
|
|
4658
|
+
updatedBy: z18.custom(),
|
|
4659
|
+
approvalFlows: z18.array(z18.custom()).min(1),
|
|
4660
|
+
currentApprovers: z18.array(z18.custom())
|
|
4649
4661
|
});
|
|
4650
|
-
var
|
|
4662
|
+
var CreateApprovalSchema = ApprovalSchema.pick({
|
|
4651
4663
|
id: true,
|
|
4652
4664
|
number: true,
|
|
4653
4665
|
applicationName: true,
|
|
@@ -4655,14 +4667,14 @@ var ApprovalCreateSchema = ApprovalSchema.pick({
|
|
|
4655
4667
|
emailBody: true,
|
|
4656
4668
|
approvalFlows: true
|
|
4657
4669
|
}).extend({
|
|
4658
|
-
approvalFlows:
|
|
4670
|
+
approvalFlows: z18.array(
|
|
4659
4671
|
ApprovalFlowSchema.pick({
|
|
4660
4672
|
approvalStage: true,
|
|
4661
4673
|
batchSequence: true,
|
|
4662
4674
|
stepApprovalOrder: true,
|
|
4663
4675
|
steps: true
|
|
4664
4676
|
}).extend({
|
|
4665
|
-
steps:
|
|
4677
|
+
steps: z18.array(
|
|
4666
4678
|
ApprovalFlowStepSchema.pick({
|
|
4667
4679
|
approverRole: true,
|
|
4668
4680
|
approver: true
|
|
@@ -4671,27 +4683,51 @@ var ApprovalCreateSchema = ApprovalSchema.pick({
|
|
|
4671
4683
|
})
|
|
4672
4684
|
).min(1)
|
|
4673
4685
|
});
|
|
4674
|
-
var
|
|
4686
|
+
var ApproveApprovalSchema = z18.object({
|
|
4687
|
+
id: z18.uuid(),
|
|
4675
4688
|
result: ApprovalStepResult,
|
|
4676
|
-
resultComment:
|
|
4677
|
-
emailBody:
|
|
4689
|
+
resultComment: z18.string().max(2e3).optional(),
|
|
4690
|
+
emailBody: z18.string().min(1)
|
|
4691
|
+
});
|
|
4692
|
+
var ResubmitApprovalSchema = ApprovalSchema.pick({
|
|
4693
|
+
id: true,
|
|
4694
|
+
approvalFlows: true
|
|
4695
|
+
}).extend({
|
|
4696
|
+
approvalFlows: z18.array(
|
|
4697
|
+
ApprovalFlowSchema.pick({
|
|
4698
|
+
approvalStage: true,
|
|
4699
|
+
batchSequence: true,
|
|
4700
|
+
stepApprovalOrder: true,
|
|
4701
|
+
steps: true
|
|
4702
|
+
}).extend({
|
|
4703
|
+
steps: z18.array(
|
|
4704
|
+
ApprovalFlowStepSchema.pick({
|
|
4705
|
+
approverRole: true,
|
|
4706
|
+
approver: true
|
|
4707
|
+
})
|
|
4708
|
+
)
|
|
4709
|
+
})
|
|
4710
|
+
).min(1)
|
|
4678
4711
|
});
|
|
4679
|
-
var CancelApprovalSchema =
|
|
4680
|
-
|
|
4681
|
-
|
|
4712
|
+
var CancelApprovalSchema = z18.object({
|
|
4713
|
+
id: z18.uuid(),
|
|
4714
|
+
comment: z18.string().min(1).max(2e3),
|
|
4715
|
+
emailBody: z18.string().min(1)
|
|
4682
4716
|
});
|
|
4683
|
-
var WithdrawApprovalSchema =
|
|
4684
|
-
|
|
4685
|
-
|
|
4717
|
+
var WithdrawApprovalSchema = z18.object({
|
|
4718
|
+
id: z18.uuid(),
|
|
4719
|
+
comment: z18.string().min(1).max(2e3),
|
|
4720
|
+
emailBody: z18.string().min(1)
|
|
4686
4721
|
});
|
|
4687
4722
|
export {
|
|
4688
|
-
ApprovalCreateSchema,
|
|
4689
4723
|
ApprovalEmployeeSchema,
|
|
4690
4724
|
ApprovalFlowSchema,
|
|
4691
4725
|
ApprovalFlowStepSchema,
|
|
4692
4726
|
ApprovalSchema,
|
|
4727
|
+
ApproveApprovalSchema,
|
|
4693
4728
|
CancelApprovalSchema,
|
|
4694
4729
|
ChipInputCell,
|
|
4730
|
+
CreateApprovalSchema,
|
|
4695
4731
|
DepartmentSchema,
|
|
4696
4732
|
Dropzone,
|
|
4697
4733
|
EditableColumnHeader,
|
|
@@ -4703,6 +4739,7 @@ export {
|
|
|
4703
4739
|
Fullscreen,
|
|
4704
4740
|
LayoutProvider,
|
|
4705
4741
|
Platform,
|
|
4742
|
+
ResubmitApprovalSchema,
|
|
4706
4743
|
RouterButton,
|
|
4707
4744
|
RouterError,
|
|
4708
4745
|
RouterGridActionsCellItem,
|
|
@@ -4711,9 +4748,9 @@ export {
|
|
|
4711
4748
|
RouterListItemButton,
|
|
4712
4749
|
RouterNotFound,
|
|
4713
4750
|
RouterTab,
|
|
4714
|
-
SingleApprovalSchema,
|
|
4715
4751
|
TypographyWithIcon,
|
|
4716
4752
|
WithdrawApprovalSchema,
|
|
4753
|
+
getThemeMode,
|
|
4717
4754
|
rootRouteHead,
|
|
4718
4755
|
t,
|
|
4719
4756
|
useDeleteFile,
|