@m4l/components 0.1.49 → 0.1.51
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/components/CommonActions/components/ActionFormCancel/{index.d6875fe6.js → index.27e301c5.js} +10 -10
- package/components/CommonActions/components/Actions/{index.4e56715e.js → index.c06ea173.js} +9 -9
- package/components/DataGrid/{index.4baf5552.js → index.eb1bdc97.js} +11 -40
- package/components/DynamicFilter/{index.b4fc6428.js → index.17731fda.js} +15 -15
- package/components/ErrorLabel/{index.73f9362c.js → index.78553a1e.js} +1 -1
- package/components/LanguagePopover/{index.26b694ef.js → index.5047b444.js} +1 -1
- package/components/ModalDialog/{index.58a21edf.js → index.de10969f.js} +2 -2
- package/components/ObjectLogs/{index.9e362091.js → index.338656c6.js} +12 -12
- package/components/Period/{index.2841388b.js → index.89daad51.js} +10 -10
- package/components/areas/components/Area/types.d.ts +4 -2
- package/components/areas/components/AreasAdmin/{index.5f46d742.js → index.3e586e9b.js} +2 -2
- package/components/areas/components/AreasContainer/{index.c99b3cca.js → index.15e4628d.js} +2 -2
- package/components/areas/components/GridLayout/index.f38f5b74.js +101 -0
- package/components/areas/components/Window/{index.d3ccc192.js → index.d1a59be4.js} +137 -26
- package/components/areas/components/Window/subcomponents/InnerForHooks/index.d.ts +2 -2
- package/components/areas/components/WindowModal/index.d.ts +4 -0
- package/components/areas/components/WindowPopUp/{index.7183a2e5.js → index.90566fca.js} +21 -21
- package/components/areas/components/{index.9f1b8516.js → index.29809e82.js} +17 -17
- package/components/areas/contexts/AreaContext/{index.2f35327c.js → index.c787aee6.js} +34 -47
- package/components/areas/contexts/AreaContext/index.d.ts +18 -4
- package/components/areas/contexts/AreaContext/store.d.ts +6 -2
- package/components/areas/contexts/AreasContext/{index.82659d93.js → index.4f938baa.js} +7 -10
- package/components/areas/contexts/AreasContext/store.d.ts +2 -2
- package/components/areas/contexts/{index.1edc1f88.js → index.4cfa6ea9.js} +10 -3
- package/components/areas/hooks/{index.3326476e.js → index.b15baf14.js} +1 -1
- package/components/areas/hooks/useArea/{index.061d19d5.js → index.575c2abe.js} +8 -8
- package/components/areas/hooks/useArea/index.d.ts +9 -1
- package/components/areas/{index.ae311948.js → index.8c6f9e65.js} +5 -5
- package/components/hook-form/RHFCheckbox/{index.ebfe1e3c.js → index.ca94a050.js} +1 -1
- package/components/hook-form/RHFPeriod/{index.3470638a.js → index.47cf646d.js} +2 -2
- package/components/modal/ModalDialog/types.d.ts +2 -1
- package/components/modal/{WindowBase.52e21822.js → WindowBase.ed279350.js} +1 -1
- package/components/modal/{WindowConfirm.2fc8ed8f.js → WindowConfirm.72de5ce8.js} +9 -9
- package/components/modal/{index.4a20488c.js → index.7197145d.js} +10 -10
- package/components/mui_extended/Pager/{index.80ccec47.js → index.984aac44.js} +0 -10
- package/components/mui_extended/{index.3106c913.js → index.cb9d48d2.js} +1 -1
- package/contexts/ModalContext/{index.a6faf940.js → index.e94f0e72.js} +1 -1
- package/hooks/useModal/{index.54a1887f.js → index.56c03c00.js} +1 -1
- package/index.js +28 -28
- package/package.json +5 -3
- package/components/CommonActions/components/Actions/styles.d.ts +0 -2
- package/components/DataGrid/styles.d.ts +0 -3
- package/components/DataGrid/subcomponents/Actions/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/Density/styles.d.ts +0 -3
- package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/styles.d.ts +0 -4
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +0 -8
- package/components/DataGrid/subcomponents/Table/styles.d.ts +0 -3
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +0 -6
- package/components/DynamicFilter/styles.d.ts +0 -6
- package/components/DynamicFilter/subcomponents/ApplyedFilters/components/ApplyedFilter/styles.d.ts +0 -6
- package/components/DynamicFilter/subcomponents/ApplyedFilters/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/ClearFilters/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/FilterButton/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/InputFilter/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/PopupEditFilter/styles.d.ts +0 -7
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/styles.d.ts +0 -3
- package/components/ErrorLabel/styles.d.ts +0 -2
- package/components/Icon/styles.d.ts +0 -4
- package/components/Image/styles.d.ts +0 -3
- package/components/Image/subcomponents/LazyLoadComponent/styles.d.ts +0 -2
- package/components/Image/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/LanguagePopover/styles.d.ts +0 -5
- package/components/NoItemSelected/styles.d.ts +0 -5
- package/components/ObjectLogs/components/DetailDialog/styles.d.ts +0 -3
- package/components/ObjectLogs/styles.d.ts +0 -4
- package/components/PaperForm/styles.d.ts +0 -7
- package/components/Period/styles.d.ts +0 -7
- package/components/PropertyValue/styles.d.ts +0 -6
- package/components/ResizeableWindow/styles.d.ts +0 -5
- package/components/SplitLayout/styles.d.ts +0 -4
- package/components/animate/LoadingScreen/styles.d.ts +0 -3
- package/components/animate/PropagateLoader/syles.d.ts +0 -2
- package/components/areas/components/Area/styles.d.ts +0 -2
- package/components/areas/components/AreasAdmin/styles.d.ts +0 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +0 -3
- package/components/areas/components/AreasContainer/styles.d.ts +0 -2
- package/components/areas/components/GridLayout/index.7cca9a94.js +0 -102
- package/components/areas/components/GridLayout/styles.d.ts +0 -2
- package/components/areas/components/Window/styles.d.ts +0 -6
- package/components/areas/components/Window/subcomponents/InnerForHooks/styles.d.ts +0 -2
- package/components/areas/components/Window/subcomponents/InnerForHooks/subcomponents/Header/styles.d.ts +0 -9
- package/components/areas/components/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -2
- package/components/areas/components/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +0 -2
- package/components/hook-form/RHFAutocomplete/styles.d.ts +0 -2
- package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +0 -2
- package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/styles.d.ts +0 -3
- package/components/hook-form/RHFCheckbox/styles.d.ts +0 -14
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/hook-form/RHFDateTime/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/hook-form/RHFPeriod/styles.d.ts +0 -2
- package/components/hook-form/RHFTextField/styles.d.ts +0 -3
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +0 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +0 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +0 -12
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/modal/ModalDialog/styles.d.ts +0 -9
- package/components/modal/WindowBase/styles.d.ts +0 -2
- package/components/modal/WindowBase/subcomponents/Header/styles.d.ts +0 -6
- package/components/modal/WindowConfirm/subcomponents/MessageIlustration/styles.d.ts +0 -6
- package/components/mui_extended/Accordion/styles.d.ts +0 -4
- package/components/mui_extended/Button/styles.d.ts +0 -13
- package/components/mui_extended/IconButton/styles.d.ts +0 -2
- package/components/mui_extended/ImageButton/styles.d.ts +0 -2
- package/components/mui_extended/LoadingButton/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/mui_extended/MenuActions/styles.d.ts +0 -30
- package/components/mui_extended/Pager/components/PagerActions/styles.d.ts +0 -2
- package/components/mui_extended/Pager/styles.d.ts +0 -6
- package/components/mui_extended/Popover/styles.d.ts +0 -1
- package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +0 -3
- package/components/mui_extended/Tab/styles.d.ts +0 -2
- package/components/mui_extended/Typography/styles.d.ts +0 -2
- package/contexts/RHFormContext/styles.d.ts +0 -2
|
@@ -1,38 +1,81 @@
|
|
|
1
1
|
import React__default, { useMemo, useState, useRef, useCallback, useEffect } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { I as Icon } from "../../../Icon/index.f6e8d810.js";
|
|
3
|
+
import { m } from "framer-motion";
|
|
4
|
+
import { Skeleton, Typography, styled as styled$1, Dialog, Paper } from "@mui/material";
|
|
5
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
6
|
import { styled } from "@mui/material/styles";
|
|
4
|
-
import
|
|
7
|
+
import "react-router-dom";
|
|
8
|
+
import "../../../animate/LoadingScreen/index.1d0c4307.js";
|
|
9
|
+
import "../../../animate/PropagateLoader/index.be5b02c3.js";
|
|
10
|
+
import "../index.29809e82.js";
|
|
11
|
+
import "../AreasAdmin/index.3e586e9b.js";
|
|
12
|
+
import { useEnvironment, useModuleSkeleton, useModuleDictionary, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
|
|
13
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/index.1318a283.js";
|
|
14
|
+
import "zustand";
|
|
15
|
+
import "../../contexts/AreasContext/index.4f938baa.js";
|
|
5
16
|
import { shallow } from "zustand/shallow";
|
|
17
|
+
import "../AreasContainer/index.15e4628d.js";
|
|
18
|
+
import "react-grid-layout/css/styles.css";
|
|
19
|
+
import "../../../../react-resizable.bb58c8fc.js";
|
|
20
|
+
import { W as WindowToolsMFProvider, a as WindowMFProvider } from "../../contexts/index.4cfa6ea9.js";
|
|
6
21
|
import { D as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
7
|
-
import "../../../../contexts/ModalContext/index.a6faf940.js";
|
|
8
22
|
import "react-hook-form";
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useEnvironment, useModuleSkeleton, useModuleDictionary, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
|
|
14
|
-
import { Skeleton, Typography, styled as styled$1 } from "@mui/material";
|
|
15
|
-
import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender } from "@m4l/graphics";
|
|
16
|
-
import { I as IconButton } from "../../../mui_extended/IconButton/index.1318a283.js";
|
|
17
|
-
import { I as Icon } from "../../../Icon/index.f6e8d810.js";
|
|
23
|
+
import "../../../hook-form/RHFAutocomplete/index.74add0d0.js";
|
|
24
|
+
import { I as Image } from "../../../Image/index.aa24e982.js";
|
|
25
|
+
import debounce from "lodash/debounce";
|
|
26
|
+
import "../../../hook-form/RHFCheckbox/index.ca94a050.js";
|
|
18
27
|
import "../../../mui_extended/Accordion/index.1d513477.js";
|
|
19
28
|
import "../../../mui_extended/Avatar/index.fe06afd7.js";
|
|
20
|
-
import "
|
|
29
|
+
import "@mui/material/Button";
|
|
21
30
|
import { B as Button } from "../../../mui_extended/Button/index.8406ed5b.js";
|
|
22
|
-
import { I as Image } from "../../../Image/index.aa24e982.js";
|
|
23
31
|
import "@mui/lab";
|
|
24
|
-
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.1261168c.js";
|
|
25
32
|
import "../../../mui_extended/Popover/index.58c49cc0.js";
|
|
26
|
-
import "../../../mui_extended/
|
|
33
|
+
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.1261168c.js";
|
|
34
|
+
import "../../../mui_extended/Pager/index.984aac44.js";
|
|
27
35
|
import "../../../mui_extended/Tab/index.e0653a0a.js";
|
|
28
36
|
import "../../../mui_extended/Typography/index.be3a279a.js";
|
|
29
|
-
import
|
|
30
|
-
import "@mui/
|
|
37
|
+
import "../../../ErrorLabel/index.78553a1e.js";
|
|
38
|
+
import "@mui/x-date-pickers";
|
|
39
|
+
import "../../../hook-form/RHFDateTime/index.7f1cbd85.js";
|
|
40
|
+
import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender } from "@m4l/graphics";
|
|
41
|
+
import "../../../hook-form/RHFTextField/index.57f138f7.js";
|
|
42
|
+
import "../../../hook-form/RHFPeriod/index.47cf646d.js";
|
|
43
|
+
import "../../../Period/index.89daad51.js";
|
|
44
|
+
import "../../../CommonActions/components/Actions/index.c06ea173.js";
|
|
45
|
+
import "../../../../contexts/ModalContext/index.e94f0e72.js";
|
|
46
|
+
import { c as cjs } from "../../../../react-draggable.0eef011c.js";
|
|
47
|
+
import "../../../ModalDialog/index.de10969f.js";
|
|
48
|
+
import { R as ResizeableWindow } from "../../../Resizeable/index.8a442a8b.js";
|
|
49
|
+
import "../../../modal/WindowConfirm.72de5ce8.js";
|
|
50
|
+
import "../../../modal/WindowBase.ed279350.js";
|
|
51
|
+
import "lodash/isString";
|
|
52
|
+
import "react-dropzone";
|
|
53
|
+
import "../../../hook-form/RHFUpload/index.7fdff30f.js";
|
|
54
|
+
import "../../../DataGrid/index.eb1bdc97.js";
|
|
55
|
+
import "react-dnd";
|
|
56
|
+
import "react-dnd-html5-backend";
|
|
57
|
+
import "../../../ScrollBar/index.39eeb2de.js";
|
|
58
|
+
import "../../../DynamicFilter/index.17731fda.js";
|
|
59
|
+
import "clsx";
|
|
60
|
+
import "simplebar/dist/simplebar.min.css";
|
|
61
|
+
import "@hookform/resolvers/yup";
|
|
62
|
+
import "../../../../contexts/RHFormContext/index.828b60ad.js";
|
|
63
|
+
import "yup";
|
|
64
|
+
import "../../../../index.js";
|
|
65
|
+
import "@mui/base";
|
|
66
|
+
import "../../../LanguagePopover/index.5047b444.js";
|
|
67
|
+
import "../../../NoItemSelected/index.9636ec8a.js";
|
|
68
|
+
import "../../../ObjectLogs/index.338656c6.js";
|
|
69
|
+
import "../../../../react-json-view.57125fcf.js";
|
|
70
|
+
import "../../../PaperForm/index.0114aa9b.js";
|
|
71
|
+
import "../../../Page/index.4237c241.js";
|
|
72
|
+
import "../../../PropertyValue/index.dfcfe1ba.js";
|
|
73
|
+
import "../../../../react-splitter-layout.8b1655c8.js";
|
|
74
|
+
import "../../../SplitLayout/index.5a8355d8.js";
|
|
75
|
+
import { a as useAreaStore } from "../../hooks/useArea/index.575c2abe.js";
|
|
76
|
+
import { a as useWindow, b as useWindowStore } from "../../hooks/index.b15baf14.js";
|
|
31
77
|
import { L as LinearProgress } from "../../../mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
32
|
-
import { m } from "framer-motion";
|
|
33
78
|
import { v as varBounce } from "../../../animate/variants/bounce.784aaaaa.js";
|
|
34
|
-
import "../../../animate/LoadingScreen/index.1d0c4307.js";
|
|
35
|
-
import "../../../animate/PropagateLoader/index.be5b02c3.js";
|
|
36
79
|
const WrapperWindow = styled("div", {
|
|
37
80
|
shouldForwardProp: (props) => props !== "selected"
|
|
38
81
|
})(({ theme, selected }) => ({
|
|
@@ -614,9 +657,6 @@ const InnerForHooks = (props) => {
|
|
|
614
657
|
const {
|
|
615
658
|
winType
|
|
616
659
|
} = props;
|
|
617
|
-
const areaStatus = useAreaStore((state) => state.status);
|
|
618
|
-
if (areaStatus !== "loaded")
|
|
619
|
-
return null;
|
|
620
660
|
console.log("Render InnerForHooks", props.windowId);
|
|
621
661
|
return /* @__PURE__ */ jsxs(WindowMFProvider, {
|
|
622
662
|
...props,
|
|
@@ -644,7 +684,7 @@ const Window = (props) => {
|
|
|
644
684
|
if (!selected) {
|
|
645
685
|
if (emergeType === "popup") {
|
|
646
686
|
selectWindowPopUp(props.windowId);
|
|
647
|
-
} else {
|
|
687
|
+
} else if (emergeType === "layout") {
|
|
648
688
|
selectWindowLayout(props.windowId);
|
|
649
689
|
}
|
|
650
690
|
}
|
|
@@ -660,7 +700,78 @@ const Window = (props) => {
|
|
|
660
700
|
});
|
|
661
701
|
};
|
|
662
702
|
const MemonizedWindow = React__default.memo(Window);
|
|
703
|
+
const Container = styled("div")(({ theme }) => ({
|
|
704
|
+
display: "flex",
|
|
705
|
+
flexDirection: "column",
|
|
706
|
+
height: "100%",
|
|
707
|
+
overflow: "hidden",
|
|
708
|
+
padding: theme.spacing(3)
|
|
709
|
+
}));
|
|
710
|
+
const WrapperWindowModal = styled(Dialog)(() => ({
|
|
711
|
+
height: "100%",
|
|
712
|
+
"&.m4l_selected": {
|
|
713
|
+
borderTop: "1px solid green"
|
|
714
|
+
}
|
|
715
|
+
}));
|
|
716
|
+
const DragabblePaperComponent = (props) => {
|
|
717
|
+
return /* @__PURE__ */ jsx(cjs.exports, {
|
|
718
|
+
handle: ".m4l_draggable_handle",
|
|
719
|
+
cancel: '[class*="MuiDialogContent-root"]',
|
|
720
|
+
children: /* @__PURE__ */ jsx(Paper, {
|
|
721
|
+
sx: {
|
|
722
|
+
maxHeight: "unset",
|
|
723
|
+
maxWidth: "unset"
|
|
724
|
+
},
|
|
725
|
+
...props
|
|
726
|
+
})
|
|
727
|
+
});
|
|
728
|
+
};
|
|
729
|
+
function PaperComponent(props) {
|
|
730
|
+
return /* @__PURE__ */ jsx(Paper, {
|
|
731
|
+
sx: {
|
|
732
|
+
maxHeight: "unset",
|
|
733
|
+
maxWidth: "unset",
|
|
734
|
+
height: "100%"
|
|
735
|
+
},
|
|
736
|
+
...props
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
const WindowModal = (props) => {
|
|
740
|
+
const {
|
|
741
|
+
closeWindowModal
|
|
742
|
+
} = useAreaStore((state) => state.actions);
|
|
743
|
+
const isDesktop = useResponsiveDesktop();
|
|
744
|
+
const onClose = () => {
|
|
745
|
+
closeWindowModal();
|
|
746
|
+
};
|
|
747
|
+
const contentComnponent = /* @__PURE__ */ jsx(Container, {
|
|
748
|
+
id: "Container",
|
|
749
|
+
children: /* @__PURE__ */ jsx(Window, {
|
|
750
|
+
...props,
|
|
751
|
+
onClose
|
|
752
|
+
})
|
|
753
|
+
});
|
|
754
|
+
console.log("Render WindowModal");
|
|
755
|
+
return /* @__PURE__ */ jsxs(WrapperWindowModal, {
|
|
756
|
+
open: true,
|
|
757
|
+
"aria-labelledby": "child-modal-title",
|
|
758
|
+
"aria-describedby": "child-modal-description",
|
|
759
|
+
PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
|
|
760
|
+
maxWidth: false,
|
|
761
|
+
fullWidth: !isDesktop,
|
|
762
|
+
fullScreen: false,
|
|
763
|
+
disableEnforceFocus: true,
|
|
764
|
+
children: [isDesktop && /* @__PURE__ */ jsx(
|
|
765
|
+
ResizeableWindow,
|
|
766
|
+
{
|
|
767
|
+
children: contentComnponent
|
|
768
|
+
}
|
|
769
|
+
), !isDesktop && contentComnponent]
|
|
770
|
+
});
|
|
771
|
+
};
|
|
772
|
+
React__default.memo(WindowModal);
|
|
663
773
|
export {
|
|
664
774
|
MemonizedWindow as M,
|
|
665
|
-
|
|
775
|
+
WindowModal as W,
|
|
776
|
+
Window as a
|
|
666
777
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WindowProps } from '../../../Area/types';
|
|
3
|
-
export declare const InnerForHooks: (props: WindowProps) => JSX.Element
|
|
4
|
-
export declare const MemonizedInnerForHooks: React.MemoExoticComponent<(props: WindowProps) => JSX.Element
|
|
3
|
+
export declare const InnerForHooks: (props: WindowProps) => JSX.Element;
|
|
4
|
+
export declare const MemonizedInnerForHooks: React.MemoExoticComponent<(props: WindowProps) => JSX.Element>;
|
|
@@ -7,23 +7,23 @@ import "@mui/material/styles";
|
|
|
7
7
|
import "react-router-dom";
|
|
8
8
|
import "../../../animate/LoadingScreen/index.1d0c4307.js";
|
|
9
9
|
import "../../../animate/PropagateLoader/index.be5b02c3.js";
|
|
10
|
-
import "../index.
|
|
11
|
-
import "../AreasAdmin/index.
|
|
10
|
+
import "../index.29809e82.js";
|
|
11
|
+
import "../AreasAdmin/index.3e586e9b.js";
|
|
12
12
|
import "@m4l/core";
|
|
13
13
|
import "../../../mui_extended/IconButton/index.1318a283.js";
|
|
14
14
|
import "zustand";
|
|
15
|
-
import "../../contexts/AreasContext/index.
|
|
15
|
+
import "../../contexts/AreasContext/index.4f938baa.js";
|
|
16
16
|
import "zustand/shallow";
|
|
17
|
-
import "../AreasContainer/index.
|
|
17
|
+
import "../AreasContainer/index.15e4628d.js";
|
|
18
18
|
import "react-grid-layout/css/styles.css";
|
|
19
19
|
import "../../../../react-resizable.bb58c8fc.js";
|
|
20
|
-
import "../../contexts/index.
|
|
20
|
+
import "../../contexts/index.4cfa6ea9.js";
|
|
21
21
|
import "../../contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
22
22
|
import "react-hook-form";
|
|
23
23
|
import "../../../hook-form/RHFAutocomplete/index.74add0d0.js";
|
|
24
24
|
import "../../../Image/index.aa24e982.js";
|
|
25
25
|
import "lodash/debounce";
|
|
26
|
-
import "../../../hook-form/RHFCheckbox/index.
|
|
26
|
+
import "../../../hook-form/RHFCheckbox/index.ca94a050.js";
|
|
27
27
|
import "../../../mui_extended/Accordion/index.1d513477.js";
|
|
28
28
|
import "../../../mui_extended/Avatar/index.fe06afd7.js";
|
|
29
29
|
import "@mui/material/Button";
|
|
@@ -31,31 +31,31 @@ import "../../../mui_extended/Button/index.8406ed5b.js";
|
|
|
31
31
|
import "@mui/lab";
|
|
32
32
|
import "../../../mui_extended/Popover/index.58c49cc0.js";
|
|
33
33
|
import "../../../mui_extended/MenuActions/index.1261168c.js";
|
|
34
|
-
import "../../../mui_extended/Pager/index.
|
|
34
|
+
import "../../../mui_extended/Pager/index.984aac44.js";
|
|
35
35
|
import "../../../mui_extended/Tab/index.e0653a0a.js";
|
|
36
36
|
import "../../../mui_extended/Typography/index.be3a279a.js";
|
|
37
|
-
import "../../../ErrorLabel/index.
|
|
37
|
+
import "../../../ErrorLabel/index.78553a1e.js";
|
|
38
38
|
import "@mui/x-date-pickers";
|
|
39
39
|
import "../../../hook-form/RHFDateTime/index.7f1cbd85.js";
|
|
40
40
|
import "@m4l/graphics";
|
|
41
41
|
import "../../../hook-form/RHFTextField/index.57f138f7.js";
|
|
42
|
-
import "../../../hook-form/RHFPeriod/index.
|
|
43
|
-
import "../../../Period/index.
|
|
44
|
-
import "../../../CommonActions/components/Actions/index.
|
|
45
|
-
import "../../../../contexts/ModalContext/index.
|
|
42
|
+
import "../../../hook-form/RHFPeriod/index.47cf646d.js";
|
|
43
|
+
import "../../../Period/index.89daad51.js";
|
|
44
|
+
import "../../../CommonActions/components/Actions/index.c06ea173.js";
|
|
45
|
+
import "../../../../contexts/ModalContext/index.e94f0e72.js";
|
|
46
46
|
import "../../../../react-draggable.0eef011c.js";
|
|
47
|
-
import "../../../ModalDialog/index.
|
|
47
|
+
import "../../../ModalDialog/index.de10969f.js";
|
|
48
48
|
import { R as ResizeableWindow } from "../../../Resizeable/index.8a442a8b.js";
|
|
49
|
-
import "../../../modal/WindowConfirm.
|
|
50
|
-
import "../../../modal/WindowBase.
|
|
49
|
+
import "../../../modal/WindowConfirm.72de5ce8.js";
|
|
50
|
+
import "../../../modal/WindowBase.ed279350.js";
|
|
51
51
|
import "lodash/isString";
|
|
52
52
|
import "react-dropzone";
|
|
53
53
|
import "../../../hook-form/RHFUpload/index.7fdff30f.js";
|
|
54
|
-
import "../../../DataGrid/index.
|
|
54
|
+
import "../../../DataGrid/index.eb1bdc97.js";
|
|
55
55
|
import "react-dnd";
|
|
56
56
|
import "react-dnd-html5-backend";
|
|
57
57
|
import "../../../ScrollBar/index.39eeb2de.js";
|
|
58
|
-
import "../../../DynamicFilter/index.
|
|
58
|
+
import "../../../DynamicFilter/index.17731fda.js";
|
|
59
59
|
import "clsx";
|
|
60
60
|
import "simplebar/dist/simplebar.min.css";
|
|
61
61
|
import "@hookform/resolvers/yup";
|
|
@@ -63,17 +63,17 @@ import "../../../../contexts/RHFormContext/index.828b60ad.js";
|
|
|
63
63
|
import "yup";
|
|
64
64
|
import { DraggableWindow } from "../../../../index.js";
|
|
65
65
|
import "@mui/base";
|
|
66
|
-
import "../../../LanguagePopover/index.
|
|
66
|
+
import "../../../LanguagePopover/index.5047b444.js";
|
|
67
67
|
import "../../../NoItemSelected/index.9636ec8a.js";
|
|
68
|
-
import "../../../ObjectLogs/index.
|
|
68
|
+
import "../../../ObjectLogs/index.338656c6.js";
|
|
69
69
|
import "../../../../react-json-view.57125fcf.js";
|
|
70
70
|
import "../../../PaperForm/index.0114aa9b.js";
|
|
71
71
|
import "../../../Page/index.4237c241.js";
|
|
72
72
|
import "../../../PropertyValue/index.dfcfe1ba.js";
|
|
73
73
|
import "../../../../react-splitter-layout.8b1655c8.js";
|
|
74
74
|
import "../../../SplitLayout/index.5a8355d8.js";
|
|
75
|
-
import { a as useAreaStore } from "../../hooks/useArea/index.
|
|
76
|
-
import {
|
|
75
|
+
import { a as useAreaStore } from "../../hooks/useArea/index.575c2abe.js";
|
|
76
|
+
import { a as Window } from "../Window/index.d1a59be4.js";
|
|
77
77
|
const WindowPopUp = (props) => {
|
|
78
78
|
const {
|
|
79
79
|
windowProps,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { A as AreaProvider } from "../contexts/AreaContext/index.
|
|
2
|
-
import { G as GridLayout } from "./GridLayout/index.
|
|
3
|
-
import { u as useAreasStore } from "../hooks/useArea/index.061d19d5.js";
|
|
1
|
+
import { A as AreaProvider } from "../contexts/AreaContext/index.c787aee6.js";
|
|
2
|
+
import { G as GridLayout } from "./GridLayout/index.f38f5b74.js";
|
|
4
3
|
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { a as useAreaStore } from "../hooks/useArea/index.575c2abe.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import "./AreasAdmin/index.
|
|
6
|
+
import "./AreasAdmin/index.3e586e9b.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "@m4l/core";
|
|
9
9
|
import "@mui/material";
|
|
10
10
|
import "../../Icon/index.f6e8d810.js";
|
|
11
11
|
import "../../mui_extended/IconButton/index.1318a283.js";
|
|
12
12
|
import "zustand";
|
|
13
|
-
import "../contexts/AreasContext/index.
|
|
13
|
+
import "../contexts/AreasContext/index.4f938baa.js";
|
|
14
14
|
import "zustand/shallow";
|
|
15
|
-
import "./AreasContainer/index.
|
|
15
|
+
import "./AreasContainer/index.15e4628d.js";
|
|
16
16
|
import "react-grid-layout/css/styles.css";
|
|
17
17
|
import "../../../react-resizable.bb58c8fc.js";
|
|
18
18
|
const WrapperArea = styled("div")(() => ({
|
|
@@ -42,27 +42,27 @@ const WrapperArea = styled("div")(() => ({
|
|
|
42
42
|
borderTop: "1px solid green"
|
|
43
43
|
}
|
|
44
44
|
}));
|
|
45
|
+
const InnerForHooks = () => {
|
|
46
|
+
const status = useAreaStore((state) => state.status);
|
|
47
|
+
if (status === "loaded") {
|
|
48
|
+
return /* @__PURE__ */ jsx(GridLayout, {});
|
|
49
|
+
} else {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
children: "Loading.. Intentar si falla."
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
45
55
|
const Area = (props) => {
|
|
46
56
|
const {
|
|
47
57
|
id,
|
|
48
58
|
active
|
|
49
59
|
} = props;
|
|
50
|
-
const {
|
|
51
|
-
setAreaRef
|
|
52
|
-
} = useAreasStore((state) => state.internalActions);
|
|
53
|
-
const setAreaProviderRef = (element) => {
|
|
54
|
-
console.log("setAreaProviderRef", element, id);
|
|
55
|
-
if (element) {
|
|
56
|
-
setAreaRef(id, element);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
60
|
console.log("Render Area");
|
|
60
61
|
return /* @__PURE__ */ jsx(WrapperArea, {
|
|
61
62
|
className: `M4L_Area_wrapper_${id} ${active ? "active" : ""}`,
|
|
62
63
|
children: /* @__PURE__ */ jsx(AreaProvider, {
|
|
63
64
|
...props,
|
|
64
|
-
|
|
65
|
-
children: /* @__PURE__ */ jsx(GridLayout, {})
|
|
65
|
+
children: /* @__PURE__ */ jsx(InnerForHooks, {})
|
|
66
66
|
})
|
|
67
67
|
});
|
|
68
68
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React__default, { createContext,
|
|
1
|
+
import React__default, { createContext, useRef, useEffect } from "react";
|
|
2
2
|
import { shallow } from "zustand/shallow";
|
|
3
|
-
import { W as Window } from "../../components/Window/index.d3ccc192.js";
|
|
4
|
-
import { u as useModal } from "../../../../hooks/useModal/index.54a1887f.js";
|
|
5
3
|
import { useNetwork } from "@m4l/core";
|
|
6
4
|
import { createStore, useStore } from "zustand";
|
|
7
5
|
import { immer } from "zustand/middleware/immer";
|
|
8
6
|
import { devtools } from "zustand/middleware";
|
|
9
7
|
import debounce from "lodash/debounce";
|
|
10
|
-
import { u as useAreasStore } from "../../hooks/useArea/index.
|
|
8
|
+
import { u as useAreasStore } from "../../hooks/useArea/index.575c2abe.js";
|
|
11
9
|
import { jsx } from "react/jsx-runtime";
|
|
12
10
|
const DEBOUCED_SAVE_TIME = 500;
|
|
13
11
|
const COOKIE_BREAKPOINT_LAYOUTS = "layoutPros";
|
|
@@ -59,6 +57,7 @@ const createAreaStore = (initProps) => {
|
|
|
59
57
|
status: "init",
|
|
60
58
|
breakpointsLayouts: {},
|
|
61
59
|
gridLayouts: [],
|
|
60
|
+
windowModal: null,
|
|
62
61
|
windowsPopUps: [],
|
|
63
62
|
hashWindowsPopups: {},
|
|
64
63
|
hashWindowsLayouts: {},
|
|
@@ -71,6 +70,27 @@ const createAreaStore = (initProps) => {
|
|
|
71
70
|
immer((set, get) => ({
|
|
72
71
|
...startProps,
|
|
73
72
|
actions: {
|
|
73
|
+
addWindow: (newWindow) => {
|
|
74
|
+
const windowId = `${get().id}_window_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
75
|
+
console.log("addWindow", newWindow.emergeType);
|
|
76
|
+
if (newWindow.emergeType === "layout") {
|
|
77
|
+
get().actions.addWindowLayout(windowId, newWindow);
|
|
78
|
+
} else if (newWindow.emergeType === "popup") {
|
|
79
|
+
get().actions.addWindowPopUp(windowId, newWindow);
|
|
80
|
+
} else if (newWindow.emergeType === "modal") {
|
|
81
|
+
get().actions.addWindowModal(windowId, newWindow);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
closeWindowModal: () => {
|
|
85
|
+
set((state) => {
|
|
86
|
+
state.windowModal = void 0;
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
addWindowModal: (container_id, newWindowModalProps) => {
|
|
90
|
+
set((state) => {
|
|
91
|
+
state.windowModal = { ...newWindowModalProps, windowId: container_id };
|
|
92
|
+
});
|
|
93
|
+
},
|
|
74
94
|
closeWindowPopUp: (removePopUpId) => {
|
|
75
95
|
set((state) => {
|
|
76
96
|
const removeIndex = state.windowsPopUps.findIndex(
|
|
@@ -85,6 +105,7 @@ const createAreaStore = (initProps) => {
|
|
|
85
105
|
addWindowPopUp: (windowId, newWindowPopupProps) => {
|
|
86
106
|
let popUpId = windowId;
|
|
87
107
|
set((state) => {
|
|
108
|
+
console.log("addWindowPopUp", newWindowPopupProps, state.id);
|
|
88
109
|
if (newWindowPopupProps.replaceMeId) {
|
|
89
110
|
for (const key in state.hashWindowsPopups) {
|
|
90
111
|
const WindoPopUp = state.hashWindowsPopups[key];
|
|
@@ -305,7 +326,7 @@ const createAreaStore = (initProps) => {
|
|
|
305
326
|
);
|
|
306
327
|
};
|
|
307
328
|
const AreaContext = createContext(null);
|
|
308
|
-
const AreaProvider =
|
|
329
|
+
const AreaProvider = (props) => {
|
|
309
330
|
const {
|
|
310
331
|
children,
|
|
311
332
|
id,
|
|
@@ -313,6 +334,9 @@ const AreaProvider = forwardRef((props, ref) => {
|
|
|
313
334
|
loadWindows = true
|
|
314
335
|
} = props;
|
|
315
336
|
const loadAreasFromNetwork = useAreasStore((state) => state.loadAreasFromNetwork);
|
|
337
|
+
const {
|
|
338
|
+
setAreaLink
|
|
339
|
+
} = useAreasStore((state) => state.internalActions);
|
|
316
340
|
const {
|
|
317
341
|
networkOperation
|
|
318
342
|
} = useNetwork();
|
|
@@ -325,26 +349,15 @@ const AreaProvider = forwardRef((props, ref) => {
|
|
|
325
349
|
loadWindows
|
|
326
350
|
});
|
|
327
351
|
}
|
|
328
|
-
const {
|
|
329
|
-
addWindowLayout,
|
|
330
|
-
addWindowPopUp
|
|
331
|
-
} = useStore(areaStoreRef.current, (state) => state.actions, shallow);
|
|
332
352
|
const {
|
|
333
353
|
loadFromApi
|
|
334
354
|
} = useStore(areaStoreRef.current, (state) => state.internalActions, shallow);
|
|
335
355
|
const status = useStore(areaStoreRef.current, (state) => state.status, shallow);
|
|
336
|
-
const {
|
|
337
|
-
openModal,
|
|
338
|
-
closeModal
|
|
339
|
-
} = useModal();
|
|
340
|
-
useImperativeHandle(ref, () => ({
|
|
341
|
-
store: areaStoreRef.current,
|
|
342
|
-
addWindow
|
|
343
|
-
}), []);
|
|
344
356
|
useEffect(() => {
|
|
345
|
-
console.log("useEffect AreaProvider");
|
|
357
|
+
console.log("useEffect AreaProvider setAreaLink");
|
|
358
|
+
setAreaLink(id, areaStoreRef.current);
|
|
346
359
|
return () => {
|
|
347
|
-
console.
|
|
360
|
+
console.debug("useEffect cleanUP AreaProvider", props.id);
|
|
348
361
|
};
|
|
349
362
|
}, []);
|
|
350
363
|
useEffect(() => {
|
|
@@ -353,37 +366,11 @@ const AreaProvider = forwardRef((props, ref) => {
|
|
|
353
366
|
}
|
|
354
367
|
}, [active]);
|
|
355
368
|
console.log("Rendeer AreaProvider status", status, loadAreasFromNetwork);
|
|
356
|
-
const closeWindowModal = useCallback(() => {
|
|
357
|
-
closeModal();
|
|
358
|
-
}, []);
|
|
359
|
-
const openWindowModal = useCallback((container_id, newWindowProps) => {
|
|
360
|
-
openModal({
|
|
361
|
-
window: /* @__PURE__ */ jsx(Window, {
|
|
362
|
-
...newWindowProps,
|
|
363
|
-
windowId: container_id,
|
|
364
|
-
onClose: closeWindowModal
|
|
365
|
-
})
|
|
366
|
-
});
|
|
367
|
-
}, []);
|
|
368
|
-
const addWindow = useCallback((newWindow) => {
|
|
369
|
-
const newId = `${id}_window_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
370
|
-
if (newWindow.emergeType === "layout") {
|
|
371
|
-
addWindowLayout(newId, newWindow);
|
|
372
|
-
} else if (newWindow.emergeType === "popup") {
|
|
373
|
-
addWindowPopUp(newId, newWindow);
|
|
374
|
-
} else {
|
|
375
|
-
openWindowModal(newId, newWindow);
|
|
376
|
-
}
|
|
377
|
-
return newId;
|
|
378
|
-
}, []);
|
|
379
369
|
return /* @__PURE__ */ jsx(AreaContext.Provider, {
|
|
380
|
-
value:
|
|
381
|
-
store: areaStoreRef.current,
|
|
382
|
-
addWindow
|
|
383
|
-
},
|
|
370
|
+
value: areaStoreRef.current,
|
|
384
371
|
children
|
|
385
372
|
});
|
|
386
|
-
}
|
|
373
|
+
};
|
|
387
374
|
AreaProvider.displayName = "AreaProvider";
|
|
388
375
|
React__default.memo(AreaProvider);
|
|
389
376
|
export {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const AreaContext: React.Context<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { AreaProviderProps } from './types';
|
|
3
|
+
declare const AreaContext: React.Context<(Omit<Omit<import("zustand").StoreApi<import("./store").AreaStateWithActions>, "setState"> & {
|
|
4
|
+
setState<A extends string | {
|
|
5
|
+
type: unknown;
|
|
6
|
+
}>(partial: import("./store").AreaStateWithActions | Partial<import("./store").AreaStateWithActions> | ((state: import("./store").AreaStateWithActions) => import("./store").AreaStateWithActions | Partial<import("./store").AreaStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
7
|
+
}, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: import("./store").AreaStateWithActions | Partial<import("./store").AreaStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./store").AreaStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
} | undefined): void;
|
|
11
|
+
}) | null>;
|
|
12
|
+
declare const AreaProvider: {
|
|
13
|
+
(props: AreaProviderProps): JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const MemonizedAreaProvider: React.MemoExoticComponent<{
|
|
17
|
+
(props: AreaProviderProps): JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
}>;
|
|
6
20
|
export { AreaProvider, AreaContext, MemonizedAreaProvider };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NetworkProps } from '@m4l/core';
|
|
1
|
+
import { Maybe, NetworkProps } from '@m4l/core';
|
|
2
2
|
import { Layout, Layouts } from 'react-grid-layout';
|
|
3
3
|
import { DebouncedFunc } from 'lodash';
|
|
4
|
-
import { HashWindowsByLayouts, HashWindowsByPopups, NewLayoutProps, NewPopUpProps } from '../../components/Area/types';
|
|
4
|
+
import { HashWindowsByLayouts, HashWindowsByPopups, ModalProps, NewLayoutProps, NewModalProps, NewPopUpProps, NewWindowProps } from '../../components/Area/types';
|
|
5
5
|
export declare type AreaStatus = 'init' | 'load' | 'loaded' | 'error';
|
|
6
6
|
export interface AreaState {
|
|
7
7
|
zPopUpIndex: number;
|
|
@@ -12,6 +12,7 @@ export interface AreaState {
|
|
|
12
12
|
breakpointsLayouts: Layouts;
|
|
13
13
|
gridLayouts: Layout[];
|
|
14
14
|
windowsPopUps: string[];
|
|
15
|
+
windowModal?: Maybe<ModalProps>;
|
|
15
16
|
hashWindowsPopups: HashWindowsByPopups;
|
|
16
17
|
hashWindowsLayouts: HashWindowsByLayouts;
|
|
17
18
|
networkOperation: (props: NetworkProps) => Promise<any>;
|
|
@@ -20,6 +21,9 @@ export interface AreaState {
|
|
|
20
21
|
}
|
|
21
22
|
export interface AreaStateWithActions extends AreaState {
|
|
22
23
|
actions: {
|
|
24
|
+
addWindow: (newWindow: NewWindowProps) => void;
|
|
25
|
+
closeWindowModal: () => void;
|
|
26
|
+
addWindowModal: (container_id: string, newWindowModalProps: NewModalProps) => void;
|
|
23
27
|
closeWindowPopUp: (removePopUpId: string) => void;
|
|
24
28
|
addWindowPopUp: (container_id: string, newWindowPopupProps: NewPopUpProps) => void;
|
|
25
29
|
closeWindowLayout: (removeLayoutId: string) => void;
|
|
@@ -3,7 +3,7 @@ import { useHostTools, useModuleDictionary, useNetwork, EmitEvents } from "@m4l/
|
|
|
3
3
|
import { createStore, useStore } from "zustand";
|
|
4
4
|
import { devtools } from "zustand/middleware";
|
|
5
5
|
import { immer } from "zustand/middleware/immer";
|
|
6
|
-
import { L as LABEL_NEW_AREA } from "../../index.
|
|
6
|
+
import { L as LABEL_NEW_AREA } from "../../index.8c6f9e65.js";
|
|
7
7
|
import { shallow } from "zustand/shallow";
|
|
8
8
|
import { useFirstRender } from "@m4l/graphics";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -116,11 +116,12 @@ const createAreasStore = (initProps) => {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
setAreaLink: (areaId, store) => {
|
|
120
120
|
set((state) => {
|
|
121
121
|
const areaIndex = state.areas.findIndex((area) => area.id === areaId);
|
|
122
|
-
if (areaIndex > -1
|
|
123
|
-
state.areas[areaIndex].
|
|
122
|
+
if (areaIndex > -1) {
|
|
123
|
+
state.areas[areaIndex].store = store;
|
|
124
|
+
state.areas[areaIndex].linked = true;
|
|
124
125
|
}
|
|
125
126
|
});
|
|
126
127
|
}
|
|
@@ -161,16 +162,12 @@ function AreasProvider(props) {
|
|
|
161
162
|
setHandlerGetLabel
|
|
162
163
|
} = useStore(areasStoreRef.current, (state) => state.internalActions, shallow);
|
|
163
164
|
const addWindow = useCallback((newWindow) => {
|
|
164
|
-
console.log("addWindow raw");
|
|
165
165
|
const currentArea = areasStoreRef.current?.getState().currentArea;
|
|
166
166
|
const areas = areasStoreRef.current?.getState().areas;
|
|
167
167
|
if (currentArea && areas) {
|
|
168
168
|
const areaIndex = areas.findIndex((area) => area.id == currentArea);
|
|
169
|
-
if (areaIndex > -1 && areas[areaIndex].
|
|
170
|
-
|
|
171
|
-
if (areaRef) {
|
|
172
|
-
areaRef.addWindow(newWindow);
|
|
173
|
-
}
|
|
169
|
+
if (areaIndex > -1 && areas[areaIndex].store) {
|
|
170
|
+
areas[areaIndex].store?.getState().actions.addWindow(newWindow);
|
|
174
171
|
}
|
|
175
172
|
}
|
|
176
173
|
}, []);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AreaProviderRef } from '../AreaContext/types';
|
|
2
1
|
import { AreaType } from '../../components/Area/types';
|
|
3
2
|
import { GetLabelType, NetworkProps } from '@m4l/core';
|
|
4
3
|
import { WritableDraft } from 'immer/dist/internal';
|
|
4
|
+
import { AreaStore } from '../AreaContext/store';
|
|
5
5
|
export declare type AreasStatus = 'init' | 'loading' | 'loaded' | 'error';
|
|
6
6
|
export interface AreasState {
|
|
7
7
|
networkOperation: (props: NetworkProps) => Promise<any>;
|
|
@@ -20,7 +20,7 @@ export interface AreasStateWithActions extends AreasState {
|
|
|
20
20
|
internalActions: {
|
|
21
21
|
setHandlerGetLabel: (newHandler: GetLabelType) => void;
|
|
22
22
|
loadFromApi: () => void;
|
|
23
|
-
|
|
23
|
+
setAreaLink: (areaId: string, store: AreaStore) => void;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
declare type DefaultStoreProps = Omit<AreasState, 'currentArea'>;
|