wcz-test 4.2.4 → 4.2.5
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 +2 -95
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Autocomplete, Box, Button, CardHeader, Checkbox, Chip, Dialog, DialogActions, DialogContent, DialogTitle, Divider, Fab, FormControl, FormControlLabel, FormHelperText, FormLabel, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItemButton, ListItemIcon, ListItemText, Menu, Paper, Radio, RadioGroup, Slider, Stack, Switch, Tab, TextField, Tooltip, Typography, useEventCallback, useTheme } from "@mui/material";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
|
-
import React, { Fragment, createContext,
|
|
4
|
+
import React, { Fragment, createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import CloudUpload from "@mui/icons-material/CloudUpload";
|
|
6
6
|
import { useDropzone } from "react-dropzone";
|
|
7
7
|
import { initReactI18next, useTranslation, useTranslation as useTranslation$1 } from "react-i18next";
|
|
@@ -2035,33 +2035,6 @@ process.env.NODE_ENV !== "production" && (LocalizationProvider.propTypes = {
|
|
|
2035
2035
|
localeText: import_prop_types.default.object
|
|
2036
2036
|
});
|
|
2037
2037
|
|
|
2038
|
-
//#endregion
|
|
2039
|
-
//#region node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
|
|
2040
|
-
/**
|
|
2041
|
-
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
2042
|
-
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
2043
|
-
*
|
|
2044
|
-
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
2045
|
-
* and confirm it doesn't apply to your use-case.
|
|
2046
|
-
*/
|
|
2047
|
-
const useEnhancedEffect = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
2048
|
-
var useEnhancedEffect_default = useEnhancedEffect;
|
|
2049
|
-
|
|
2050
|
-
//#endregion
|
|
2051
|
-
//#region node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
2052
|
-
/**
|
|
2053
|
-
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
2054
|
-
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
2055
|
-
*/
|
|
2056
|
-
function useEventCallback$1(fn) {
|
|
2057
|
-
const ref = React$1.useRef(fn);
|
|
2058
|
-
useEnhancedEffect_default(() => {
|
|
2059
|
-
ref.current = fn;
|
|
2060
|
-
});
|
|
2061
|
-
return React$1.useRef((...args) => (0, ref.current)(...args)).current;
|
|
2062
|
-
}
|
|
2063
|
-
var useEventCallback_default = useEventCallback$1;
|
|
2064
|
-
|
|
2065
2038
|
//#endregion
|
|
2066
2039
|
//#region node_modules/@mui/x-internals/esm/warning/warning.js
|
|
2067
2040
|
const warnedOnceCache = /* @__PURE__ */ new Set();
|
|
@@ -2547,72 +2520,6 @@ var AdapterDayjs = class {
|
|
|
2547
2520
|
};
|
|
2548
2521
|
};
|
|
2549
2522
|
|
|
2550
|
-
//#endregion
|
|
2551
|
-
//#region src/providers/DialogsProvider.tsx
|
|
2552
|
-
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
2553
|
-
const [stack, setStack] = useState([]);
|
|
2554
|
-
const keyPrefix = useId();
|
|
2555
|
-
const nextId = useRef(0);
|
|
2556
|
-
const dialogMetadata = useRef(/* @__PURE__ */ new WeakMap());
|
|
2557
|
-
const requestDialog = useEventCallback_default(function open(Component$6, payload, options = {}) {
|
|
2558
|
-
const { onClose = async () => {} } = options;
|
|
2559
|
-
let resolve;
|
|
2560
|
-
const promise = new Promise((resolveImpl) => {
|
|
2561
|
-
resolve = resolveImpl;
|
|
2562
|
-
});
|
|
2563
|
-
const key = `${keyPrefix}-${nextId.current}`;
|
|
2564
|
-
nextId.current += 1;
|
|
2565
|
-
const newEntry = {
|
|
2566
|
-
key,
|
|
2567
|
-
open: true,
|
|
2568
|
-
promise,
|
|
2569
|
-
Component: Component$6,
|
|
2570
|
-
payload,
|
|
2571
|
-
onClose,
|
|
2572
|
-
resolve
|
|
2573
|
-
};
|
|
2574
|
-
dialogMetadata.current.set(promise, newEntry);
|
|
2575
|
-
setStack((previousStack) => [...previousStack, newEntry]);
|
|
2576
|
-
return promise;
|
|
2577
|
-
});
|
|
2578
|
-
const removeDialogFromStack = useCallback((dialog) => {
|
|
2579
|
-
setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
|
|
2580
|
-
dialogMetadata.current.delete(dialog);
|
|
2581
|
-
}, []);
|
|
2582
|
-
const closeDialogUi = useEventCallback_default(function closeDialogUi$1(dialog) {
|
|
2583
|
-
setStack((previousStack) => previousStack.map((entry) => entry.promise === dialog ? {
|
|
2584
|
-
...entry,
|
|
2585
|
-
open: false
|
|
2586
|
-
} : entry));
|
|
2587
|
-
setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
|
|
2588
|
-
});
|
|
2589
|
-
const closeDialog = useEventCallback_default(async function closeDialog$1(dialog, result) {
|
|
2590
|
-
const entryToClose = dialogMetadata.current.get(dialog);
|
|
2591
|
-
if (!entryToClose) throw new Error("Dialog not found in stack");
|
|
2592
|
-
try {
|
|
2593
|
-
await entryToClose.onClose(result);
|
|
2594
|
-
} finally {
|
|
2595
|
-
entryToClose.resolve(result);
|
|
2596
|
-
closeDialogUi(dialog);
|
|
2597
|
-
}
|
|
2598
|
-
return dialog;
|
|
2599
|
-
});
|
|
2600
|
-
const contextValue = useMemo(() => ({
|
|
2601
|
-
open: requestDialog,
|
|
2602
|
-
close: closeDialog
|
|
2603
|
-
}), [requestDialog, closeDialog]);
|
|
2604
|
-
return /* @__PURE__ */ jsxs(DialogsContext.Provider, {
|
|
2605
|
-
value: contextValue,
|
|
2606
|
-
children: [children, stack.map(({ key, open, Component: Component$6, payload, promise }) => /* @__PURE__ */ jsx(Component$6, {
|
|
2607
|
-
payload,
|
|
2608
|
-
open,
|
|
2609
|
-
onClose: async (result) => {
|
|
2610
|
-
await closeDialog(promise, result);
|
|
2611
|
-
}
|
|
2612
|
-
}, key))]
|
|
2613
|
-
});
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
2523
|
//#endregion
|
|
2617
2524
|
//#region src/utils/i18n.ts
|
|
2618
2525
|
const i18nCookieName = "i18nextLng";
|
|
@@ -2670,7 +2577,7 @@ const LayoutProvider = (props) => {
|
|
|
2670
2577
|
children: /* @__PURE__ */ jsx(Layout, {
|
|
2671
2578
|
navigation,
|
|
2672
2579
|
theme: props.theme,
|
|
2673
|
-
children:
|
|
2580
|
+
children: props.children
|
|
2674
2581
|
})
|
|
2675
2582
|
})
|
|
2676
2583
|
});
|