@m4l/components 0.1.64 → 0.1.66
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/@types/export.d.ts +8 -0
- package/components/CommonActions/components/ActionCancel/{index.2eb2c1e1.js → index.4d0333c0.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.2864d574.js → index.298e0109.js} +11 -18
- package/components/CommonActions/components/ActionFormIntro/{index.e7f83ddd.js → index.b45922ff.js} +1 -1
- package/components/CommonActions/components/ActionIntro/{index.0d138cb3.js → index.138101aa.js} +2 -2
- package/components/CommonActions/components/Actions/{index.433cd345.js → index.77574633.js} +11 -18
- package/components/DataGrid/{index.42521a55.js → index.ef23d0a9.js} +28 -35
- package/components/DynamicFilter/{index.442bda79.js → index.04ed3d58.js} +34 -46
- package/components/DynamicFilter/index.d.ts +1 -1
- package/components/HelperText/{index.3c07ca2a.js → index.c35dcb93.js} +10 -10
- package/components/Icon/{index.0f9b360e.js → index.fbeeacc8.js} +2 -2
- package/components/Icon/tests/utils.d.ts +1 -1
- package/components/Image/{index.1a9c0327.js → index.77396f79.js} +1 -1
- package/components/LanguagePopover/{index.68de7176.js → index.c0fc94c7.js} +11 -11
- package/components/ModalDialog/{index.3efe049b.js → index.e600b43a.js} +5 -5
- package/components/NavLink/{index.ae9f1cc9.js → index.3f4e2417.js} +11 -11
- package/components/NoItemSelected/{index.7cfd7613.js → index.609c3c20.js} +1 -1
- package/components/ObjectLogs/{index.b50726fb.js → index.7f93ba51.js} +14 -21
- package/components/PaperForm/{index.44bf4469.js → index.fb4fa784.js} +1 -1
- package/components/Period/{index.99feb99e.js → index.0c5bf66f.js} +12 -19
- package/components/Resizeable/{index.b5d42efb.js → index.4545dd6a.js} +3 -3
- package/components/SideBar/{index.011880b6.js → index.7d970041.js} +7 -7
- package/components/areas/components/AreasAdmin/classes/index.d.ts +5 -0
- package/components/areas/components/AreasAdmin/classes/types.d.ts +11 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +1 -1
- package/components/areas/components/AreasViewer/classes/index.d.ts +5 -0
- package/components/areas/components/AreasViewer/classes/types.d.ts +19 -0
- package/components/areas/components/AreasViewer/index.d.ts +7 -0
- package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/contexts}/AreaContext/helper.d.ts +2 -2
- package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/contexts}/AreaContext/index.d.ts +3 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/store.d.ts +11 -0
- package/components/areas/{contexts/AreaContext/store.d.ts → components/AreasViewer/subcomponents/Area/contexts/AreaContext/types.d.ts} +29 -16
- package/components/areas/components/AreasViewer/subcomponents/Area/index.d.ts +12 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/index.d.ts +5 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/index.d.ts +6 -0
- package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/WindowContext/store.d.ts +8 -3
- package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/WindowContext/types.d.ts +1 -1
- package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/index.d.ts +1 -1
- package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/index.d.ts +1 -1
- package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/Component/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/helper.d.ts +3 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/subcomponents/MainActions/index.d.ts +1 -0
- package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/MicroFrontend/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +8 -0
- package/components/areas/components/{WindowModal → AreasViewer/subcomponents/Area/subcomponents/WindowModal}/index.d.ts +1 -1
- package/components/areas/components/{WindowPopUp → AreasViewer/subcomponents/Area/subcomponents/WindowPopUp}/index.d.ts +1 -1
- package/components/areas/components/{Area → AreasViewer/subcomponents/Area}/types.d.ts +6 -11
- package/components/areas/components/index.d.ts +3 -4
- package/components/areas/constants.d.ts +3 -0
- package/components/areas/contexts/AreasContext/index.d.ts +10 -4
- package/components/areas/contexts/AreasContext/store.d.ts +8 -29
- package/components/areas/contexts/AreasContext/types.d.ts +119 -0
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +3 -2
- package/components/areas/dictionary.d.ts +9 -14
- package/components/areas/hooks/useArea/index.d.ts +1 -1
- package/components/areas/hooks/useAreas/index.d.ts +1 -1
- package/components/areas/hooks/useWindow/index.d.ts +1 -1
- package/components/areas/icons.d.ts +8 -0
- package/components/areas/index.d.ts +1 -0
- package/components/areas/index.d7519516.js +2416 -0
- package/components/formatters/BooleanFormatter/{index.cd00c8e1.js → index.0edacc9b.js} +1 -1
- package/components/formatters/{index.deae4701.js → index.879170b2.js} +2 -2
- package/components/hook-form/RHFAutocomplete/{index.083e23c1.js → index.5f27e28c.js} +13 -12
- package/components/hook-form/RHFAutocomplete/test/constants.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/test/utils.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/{index.ba751be9.js → index.35e17cd6.js} +2 -2
- package/components/hook-form/RHFCheckbox/{index.c19393b1.js → index.4f134f09.js} +3 -3
- package/components/hook-form/RHFPeriod/{index.c0a80aeb.js → index.dcaa0c87.js} +2 -2
- package/components/hook-form/RHFTextField/{index.97485ff2.js → index.fc90a570.js} +13 -13
- package/components/hook-form/RHFUpload/{index.798eb11d.js → index.654ad316.js} +1 -1
- package/components/index.d.ts +1 -3
- package/components/modal/{WindowBase.59f50553.js → WindowBase.230a498f.js} +3 -3
- package/components/modal/{WindowConfirm.c1339cf8.js → WindowConfirm.575b4d41.js} +14 -21
- package/components/modal/index.237881ea.js +23 -0
- package/components/mui_extended/Accordion/{index.b7487e37.js → index.0b15f939.js} +2 -2
- package/components/mui_extended/Button/{index.d9e0ae2e.js → index.b7b70e5f.js} +3 -3
- package/components/mui_extended/IconButton/{index.be9c2ce5.js → index.a5072cd3.js} +15 -11
- package/components/mui_extended/IconButton/types.d.ts +1 -1
- package/components/mui_extended/MenuActions/icons.d.ts +3 -0
- package/components/mui_extended/MenuActions/{index.ec654122.js → index.3a275abb.js} +21 -20
- package/components/mui_extended/MenuActions/types.d.ts +5 -6
- package/components/mui_extended/Pager/{index.9e123670.js → index.5a69ab10.js} +5 -5
- package/components/mui_extended/Popover/{index.260aae81.js → index.e271e4f0.js} +1 -0
- package/components/mui_extended/Typography/{index.41b60a6b.js → index.eab3d85c.js} +1 -1
- package/components/mui_extended/index.35f74599.js +19 -0
- package/contexts/ModalContext/{index.ae8041f3.js → index.de0a3457.js} +1 -1
- package/hooks/useModal/{index.5c159ed2.js → index.e103db09.js} +1 -1
- package/index.js +118 -132
- package/package.json +2 -3
- package/{react-draggable.1aa81436.js → react-draggable.4d08d714.js} +1 -1
- package/{react-resizable.e86cb01e.js → react-resizable.23b980cb.js} +5 -4
- package/utils/{index.e199226a.js → index.c2e62d8f.js} +32 -32
- package/{vendor.a15d263e.js → vendor.be57c149.js} +43 -52
- package/components/areas/components/Area/index.d.ts +0 -5
- package/components/areas/components/AreasAdmin/index.51e28f63.js +0 -120
- package/components/areas/components/AreasContainer/index.1e5e6e91.js +0 -37
- package/components/areas/components/AreasContainer/index.d.ts +0 -1
- package/components/areas/components/GridLayout/index.5bf8d5e4.js +0 -103
- package/components/areas/components/GridLayout/index.d.ts +0 -1
- package/components/areas/components/Window/icons.d.ts +0 -3
- package/components/areas/components/Window/index.416a874f.js +0 -855
- package/components/areas/components/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +0 -8
- package/components/areas/components/WindowPopUp/index.f053fca7.js +0 -118
- package/components/areas/components/WindowsPanel/index.d.ts +0 -1
- package/components/areas/components/index.eace295a.js +0 -77
- package/components/areas/contexts/AreaContext/index.7890e58d.js +0 -509
- package/components/areas/contexts/AreaContext/types.d.ts +0 -20
- package/components/areas/contexts/AreasContext/index.0792a8d1.js +0 -197
- package/components/areas/contexts/DynamicMFParmsContext/index.c19cb8cc.js +0 -43
- package/components/areas/contexts/index.2a915acf.js +0 -198
- package/components/areas/hooks/index.f4d78492.js +0 -27
- package/components/areas/hooks/useArea/index.d6263051.js +0 -20
- package/components/areas/hooks/useDynamicMFParameters/index.041a666b.js +0 -14
- package/components/areas/index.8fca0f8f.js +0 -20
- package/components/modal/index.7a84f64d.js +0 -30
- package/components/mui_extended/index.459cbd6c.js +0 -19
- /package/components/areas/components/{Area → AreasViewer/subcomponents/Area}/subcomponents/InnerForHooks/index.d.ts +0 -0
- /package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/WindowContext/helper.d.ts +0 -0
- /package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/WindowContext/index.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/Header/index.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/Header/skeleton.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/index.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -0
- /package/components/areas/components/{Window → AreasViewer/subcomponents/Area/subcomponents/Window}/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -0
|
@@ -1,855 +0,0 @@
|
|
|
1
|
-
import React__default, { useMemo, useState, useRef, useCallback, useEffect } from "react";
|
|
2
|
-
import { I as Icon } from "../../../Icon/index.0f9b360e.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";
|
|
6
|
-
import { styled } from "@mui/material/styles";
|
|
7
|
-
import "react-router-dom";
|
|
8
|
-
import "../../../animate/LoadingScreen/index.1d0c4307.js";
|
|
9
|
-
import "../../../animate/PropagateLoader/index.be5b02c3.js";
|
|
10
|
-
import "../index.eace295a.js";
|
|
11
|
-
import "../AreasAdmin/index.51e28f63.js";
|
|
12
|
-
import { useEnvironment, useModuleSkeleton, useModuleDictionary, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
|
|
13
|
-
import { I as IconButton } from "../../../mui_extended/IconButton/index.be9c2ce5.js";
|
|
14
|
-
import "zustand";
|
|
15
|
-
import "../../contexts/AreasContext/index.0792a8d1.js";
|
|
16
|
-
import { shallow } from "zustand/shallow";
|
|
17
|
-
import "../AreasContainer/index.1e5e6e91.js";
|
|
18
|
-
import "react-grid-layout/css/styles.css";
|
|
19
|
-
import "../../../../react-resizable.e86cb01e.js";
|
|
20
|
-
import { W as WindowToolsMFProvider, a as WindowMFProvider } from "../../contexts/index.2a915acf.js";
|
|
21
|
-
import { D as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/index.c19cb8cc.js";
|
|
22
|
-
import "react-hook-form";
|
|
23
|
-
import "../../../hook-form/RHFAutocomplete/index.083e23c1.js";
|
|
24
|
-
import { I as Image } from "../../../Image/index.1a9c0327.js";
|
|
25
|
-
import "../../../mui_extended/Typography/index.41b60a6b.js";
|
|
26
|
-
import "clsx";
|
|
27
|
-
import "../../../mui_extended/Accordion/index.b7487e37.js";
|
|
28
|
-
import "../../../mui_extended/Avatar/index.fe06afd7.js";
|
|
29
|
-
import "@mui/material/Button";
|
|
30
|
-
import { B as Button } from "../../../mui_extended/Button/index.d9e0ae2e.js";
|
|
31
|
-
import "@mui/lab";
|
|
32
|
-
import "../../../mui_extended/Popover/index.260aae81.js";
|
|
33
|
-
import { M as MenuActions } from "../../../mui_extended/MenuActions/index.ec654122.js";
|
|
34
|
-
import "../../../mui_extended/Pager/index.9e123670.js";
|
|
35
|
-
import "../../../mui_extended/Tab/index.e0653a0a.js";
|
|
36
|
-
import "../../../HelperText/index.3c07ca2a.js";
|
|
37
|
-
import debounce from "lodash/debounce";
|
|
38
|
-
import "../../../hook-form/RHFAutocompleteAsync/index.ba751be9.js";
|
|
39
|
-
import "../../../hook-form/RHFCheckbox/index.c19393b1.js";
|
|
40
|
-
import "@mui/x-date-pickers";
|
|
41
|
-
import "../../../hook-form/RHFDateTime/index.6c129ce4.js";
|
|
42
|
-
import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender } from "@m4l/graphics";
|
|
43
|
-
import "../../../hook-form/RHFTextField/index.97485ff2.js";
|
|
44
|
-
import "../../../hook-form/RHFPeriod/index.c0a80aeb.js";
|
|
45
|
-
import "../../../Period/index.99feb99e.js";
|
|
46
|
-
import "../../../CommonActions/components/Actions/index.433cd345.js";
|
|
47
|
-
import "../../../../contexts/ModalContext/index.ae8041f3.js";
|
|
48
|
-
import { c as cjs } from "../../../../react-draggable.1aa81436.js";
|
|
49
|
-
import "../../../ModalDialog/index.3efe049b.js";
|
|
50
|
-
import { R as ResizeableWindow } from "../../../Resizeable/index.b5d42efb.js";
|
|
51
|
-
import "../../../modal/WindowConfirm.c1339cf8.js";
|
|
52
|
-
import "../../../modal/WindowBase.59f50553.js";
|
|
53
|
-
import "lodash/isString";
|
|
54
|
-
import "react-dropzone";
|
|
55
|
-
import "../../../hook-form/RHFUpload/index.798eb11d.js";
|
|
56
|
-
import "../../../DataGrid/index.42521a55.js";
|
|
57
|
-
import "react-dnd";
|
|
58
|
-
import "react-dnd-html5-backend";
|
|
59
|
-
import "../../../DynamicFilter/index.442bda79.js";
|
|
60
|
-
import "../../../ScrollBar/index.bbe48f4d.js";
|
|
61
|
-
import "yup";
|
|
62
|
-
import "@hookform/resolvers/yup";
|
|
63
|
-
import "../../../../contexts/RHFormContext/index.a7511399.js";
|
|
64
|
-
import "../../../LanguagePopover/index.68de7176.js";
|
|
65
|
-
import "../../../NavLink/index.ae9f1cc9.js";
|
|
66
|
-
import "../../../NoItemSelected/index.7cfd7613.js";
|
|
67
|
-
import "../../../ObjectLogs/index.b50726fb.js";
|
|
68
|
-
import "../../../../react-json-view.57125fcf.js";
|
|
69
|
-
import "../../../PaperForm/index.44bf4469.js";
|
|
70
|
-
import "../../../Page/index.4237c241.js";
|
|
71
|
-
import "../../../PropertyValue/index.dfcfe1ba.js";
|
|
72
|
-
import "../../../../react-splitter-layout.8b1655c8.js";
|
|
73
|
-
import "../../../SplitLayout/index.5a8355d8.js";
|
|
74
|
-
import "../../../SideBar/index.011880b6.js";
|
|
75
|
-
import "../../../../vendor.a15d263e.js";
|
|
76
|
-
import { a as useAreaStore } from "../../hooks/useArea/index.d6263051.js";
|
|
77
|
-
import { a as useWindow, b as useWindowStore } from "../../hooks/index.f4d78492.js";
|
|
78
|
-
import { L as LinearProgress } from "../../../mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
79
|
-
import { v as varBounce } from "../../../animate/variants/bounce.784aaaaa.js";
|
|
80
|
-
const WrapperWindow = styled("div", {
|
|
81
|
-
shouldForwardProp: (props) => props !== "selected"
|
|
82
|
-
})(({ theme, selected }) => ({
|
|
83
|
-
display: "flex",
|
|
84
|
-
flexDirection: "column",
|
|
85
|
-
height: "100%",
|
|
86
|
-
width: "100%",
|
|
87
|
-
overflow: "hidden",
|
|
88
|
-
border: "1px solid gray",
|
|
89
|
-
borderTop: selected ? "1px solid red" : "1px solid gray",
|
|
90
|
-
backgroundColor: theme.palette.background.paper,
|
|
91
|
-
padding: theme.spacing(0),
|
|
92
|
-
"&.m4l_selected": {
|
|
93
|
-
borderTop: "1px solid green"
|
|
94
|
-
}
|
|
95
|
-
}));
|
|
96
|
-
const WrapperContent = styled("div")(() => ({
|
|
97
|
-
flexGrow: 1,
|
|
98
|
-
position: "relative"
|
|
99
|
-
}));
|
|
100
|
-
const Component = (props) => {
|
|
101
|
-
const {
|
|
102
|
-
component
|
|
103
|
-
} = props;
|
|
104
|
-
const store = useWindow();
|
|
105
|
-
const dynamicMFStore = useWindowStore((state) => state.dynamicMFStore);
|
|
106
|
-
const actions = useWindowStore((state) => state.actions, shallow);
|
|
107
|
-
return /* @__PURE__ */ jsx(WindowToolsMFProvider, {
|
|
108
|
-
...actions,
|
|
109
|
-
children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, {
|
|
110
|
-
store: dynamicMFStore,
|
|
111
|
-
children: typeof component === "function" ? component(store) : component
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
React__default.memo(Component);
|
|
116
|
-
const StyledHeader = styled("div")(({
|
|
117
|
-
theme
|
|
118
|
-
}) => ({
|
|
119
|
-
display: "flex",
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
position: "relative",
|
|
122
|
-
justifyContent: "space-between",
|
|
123
|
-
minHeight: theme.spacing(5),
|
|
124
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
125
|
-
overflow: "hidden",
|
|
126
|
-
cursor: "move",
|
|
127
|
-
height: "60px",
|
|
128
|
-
" > span": {
|
|
129
|
-
marginRight: "12px"
|
|
130
|
-
},
|
|
131
|
-
"& > h5": {
|
|
132
|
-
paddingRight: theme.spacing(3),
|
|
133
|
-
borderRight: `1px solid ${theme.palette.divider}`
|
|
134
|
-
},
|
|
135
|
-
" > nav": {
|
|
136
|
-
marginRight: "12px",
|
|
137
|
-
flexGrow: 1
|
|
138
|
-
},
|
|
139
|
-
"& .splitactions.Mui-disabled": {
|
|
140
|
-
color: theme.palette.primary.main
|
|
141
|
-
},
|
|
142
|
-
"& svg ": {
|
|
143
|
-
width: "20px",
|
|
144
|
-
height: "20px"
|
|
145
|
-
}
|
|
146
|
-
}));
|
|
147
|
-
styled("div")(({
|
|
148
|
-
theme
|
|
149
|
-
}) => ({
|
|
150
|
-
display: "flex",
|
|
151
|
-
alignItems: "center",
|
|
152
|
-
position: "relative",
|
|
153
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
154
|
-
height: "60px",
|
|
155
|
-
minHeight: "60px",
|
|
156
|
-
" > span": {
|
|
157
|
-
marginRight: "12px"
|
|
158
|
-
},
|
|
159
|
-
"& > h5": {
|
|
160
|
-
paddingRight: theme.spacing(3),
|
|
161
|
-
borderRight: `1px solid ${theme.palette.divider}`
|
|
162
|
-
},
|
|
163
|
-
" > nav": {
|
|
164
|
-
marginRight: "12px",
|
|
165
|
-
flexGrow: 1
|
|
166
|
-
},
|
|
167
|
-
"& .splitactions.Mui-disabled": {
|
|
168
|
-
color: theme.palette.primary.main
|
|
169
|
-
},
|
|
170
|
-
"& svg ": {
|
|
171
|
-
width: "20px",
|
|
172
|
-
height: "20px"
|
|
173
|
-
}
|
|
174
|
-
}));
|
|
175
|
-
const Wrapper = styled("div")(({
|
|
176
|
-
theme
|
|
177
|
-
}) => ({
|
|
178
|
-
display: "flex",
|
|
179
|
-
justifyContent: "space-between",
|
|
180
|
-
padding: `0 0`,
|
|
181
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
182
|
-
minHeight: "60px"
|
|
183
|
-
}));
|
|
184
|
-
const ModuleTitleContent = styled("div")(({
|
|
185
|
-
theme
|
|
186
|
-
}) => ({
|
|
187
|
-
display: "grid",
|
|
188
|
-
gridTemplateColumns: "auto",
|
|
189
|
-
gridGap: theme.spacing(1.75),
|
|
190
|
-
alignItems: "center",
|
|
191
|
-
width: "auto",
|
|
192
|
-
height: "auto",
|
|
193
|
-
[theme.breakpoints.up("sm")]: {
|
|
194
|
-
gridTemplateColumns: "repeat(3, auto)"
|
|
195
|
-
}
|
|
196
|
-
}));
|
|
197
|
-
const ModuleTitle = styled("div")(({
|
|
198
|
-
theme
|
|
199
|
-
}) => ({
|
|
200
|
-
display: "grid",
|
|
201
|
-
gridTemplateColumns: `${theme.spacing(3)} auto`,
|
|
202
|
-
gridGap: theme.spacing(2),
|
|
203
|
-
alignItems: "center",
|
|
204
|
-
width: "auto",
|
|
205
|
-
height: "auto"
|
|
206
|
-
}));
|
|
207
|
-
const Separator = styled("div")(({
|
|
208
|
-
theme
|
|
209
|
-
}) => ({
|
|
210
|
-
display: "none",
|
|
211
|
-
alignItems: "center",
|
|
212
|
-
width: "1px",
|
|
213
|
-
background: theme.palette.divider,
|
|
214
|
-
height: "100%",
|
|
215
|
-
margin: `0 ${theme.spacing(2)}`,
|
|
216
|
-
[theme.breakpoints.up("sm")]: {
|
|
217
|
-
display: "flex"
|
|
218
|
-
}
|
|
219
|
-
}));
|
|
220
|
-
const Breadcrumbs = styled("div")(({
|
|
221
|
-
theme
|
|
222
|
-
}) => ({
|
|
223
|
-
display: "grid",
|
|
224
|
-
alignItems: "center",
|
|
225
|
-
gridTemplateColumns: `repeat(3, auto)`,
|
|
226
|
-
gridGap: theme.spacing(2)
|
|
227
|
-
}));
|
|
228
|
-
const ModuleActions = styled("div")(({
|
|
229
|
-
theme
|
|
230
|
-
}) => ({
|
|
231
|
-
display: "grid",
|
|
232
|
-
gridTemplateColumns: "auto",
|
|
233
|
-
alignItems: "center",
|
|
234
|
-
width: "auto",
|
|
235
|
-
height: "auto",
|
|
236
|
-
[theme.breakpoints.up("sm")]: {
|
|
237
|
-
gridTemplateColumns: `repeat(3, ${theme.spacing(3)})`,
|
|
238
|
-
gridGap: theme.spacing(2)
|
|
239
|
-
}
|
|
240
|
-
}));
|
|
241
|
-
function SKTModuleHeader() {
|
|
242
|
-
const isDesktop = useResponsiveDesktop();
|
|
243
|
-
return /* @__PURE__ */ jsxs(Wrapper, {
|
|
244
|
-
id: "HeaderSkeleton",
|
|
245
|
-
children: [/* @__PURE__ */ jsxs(ModuleTitleContent, {
|
|
246
|
-
children: [/* @__PURE__ */ jsxs(ModuleTitle, {
|
|
247
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
248
|
-
variant: "circular",
|
|
249
|
-
width: 24,
|
|
250
|
-
height: 24
|
|
251
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
252
|
-
variant: "text",
|
|
253
|
-
width: 120,
|
|
254
|
-
height: 14
|
|
255
|
-
})]
|
|
256
|
-
}), /* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs(Breadcrumbs, {
|
|
257
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
258
|
-
variant: "text",
|
|
259
|
-
width: 68,
|
|
260
|
-
height: 14
|
|
261
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
262
|
-
variant: "circular",
|
|
263
|
-
width: 4,
|
|
264
|
-
height: 4
|
|
265
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
266
|
-
variant: "text",
|
|
267
|
-
width: 68,
|
|
268
|
-
height: 14
|
|
269
|
-
})]
|
|
270
|
-
})]
|
|
271
|
-
}), /* @__PURE__ */ jsx(ModuleActions, {
|
|
272
|
-
children: isDesktop ? /* @__PURE__ */ jsxs(Fragment, {
|
|
273
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
274
|
-
variant: "circular",
|
|
275
|
-
width: 24,
|
|
276
|
-
height: 24
|
|
277
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
278
|
-
variant: "circular",
|
|
279
|
-
width: 24,
|
|
280
|
-
height: 24
|
|
281
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
282
|
-
variant: "circular",
|
|
283
|
-
width: 24,
|
|
284
|
-
height: 24
|
|
285
|
-
})]
|
|
286
|
-
}) : /* @__PURE__ */ jsx(Skeleton, {
|
|
287
|
-
variant: "circular",
|
|
288
|
-
width: 24,
|
|
289
|
-
height: 24
|
|
290
|
-
})
|
|
291
|
-
})]
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
const icons = {
|
|
295
|
-
CLOSE: "close.svg"
|
|
296
|
-
};
|
|
297
|
-
function getMenuActions(isDesktop, moduleActions) {
|
|
298
|
-
let menuActions = [...moduleActions.filter((action) => action.visibility !== "allways")];
|
|
299
|
-
if (isDesktop !== void 0 && isDesktop) {
|
|
300
|
-
menuActions = menuActions.filter((action) => action.visibility === "normal");
|
|
301
|
-
}
|
|
302
|
-
return menuActions;
|
|
303
|
-
}
|
|
304
|
-
function getMainActions(isDesktop, moduleActions) {
|
|
305
|
-
let mainActions = [];
|
|
306
|
-
if (isDesktop !== void 0 && isDesktop) {
|
|
307
|
-
mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "main"));
|
|
308
|
-
}
|
|
309
|
-
mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "allways"));
|
|
310
|
-
return mainActions;
|
|
311
|
-
}
|
|
312
|
-
function Header() {
|
|
313
|
-
const [url_icon, title, moduleActions, onClose, container_id] = useWindowStore((state) => [state.url_icon, state.title, state.moduleActions, state.onClose, state.windowId], shallow);
|
|
314
|
-
const {
|
|
315
|
-
saveModuleCookies
|
|
316
|
-
} = useWindowStore((state) => state.internalActions);
|
|
317
|
-
const maximizedId = useAreaStore((state) => state.singleId);
|
|
318
|
-
const {
|
|
319
|
-
maximizeLayout,
|
|
320
|
-
normalizeLayouts
|
|
321
|
-
} = useAreaStore((state) => state.actions, shallow);
|
|
322
|
-
const {
|
|
323
|
-
host_static_assets,
|
|
324
|
-
environment_assets
|
|
325
|
-
} = useEnvironment();
|
|
326
|
-
const isDesktop = useResponsiveDesktop();
|
|
327
|
-
const isSkeleton = useModuleSkeleton();
|
|
328
|
-
const menuActions = useMemo(() => getMenuActions(isDesktop, moduleActions), [moduleActions, isDesktop]);
|
|
329
|
-
const mainActions = useMemo(() => {
|
|
330
|
-
return getMainActions(isDesktop, moduleActions);
|
|
331
|
-
}, [moduleActions, isDesktop]);
|
|
332
|
-
const onCloseLocal = () => {
|
|
333
|
-
onClose && onClose(container_id);
|
|
334
|
-
};
|
|
335
|
-
const maxNormalize = () => {
|
|
336
|
-
if (maximizedId) {
|
|
337
|
-
normalizeLayouts();
|
|
338
|
-
} else {
|
|
339
|
-
maximizeLayout(container_id);
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
if (isSkeleton) {
|
|
343
|
-
return /* @__PURE__ */ jsx(SKTModuleHeader, {});
|
|
344
|
-
}
|
|
345
|
-
return /* @__PURE__ */ jsxs(StyledHeader, {
|
|
346
|
-
id: "Header",
|
|
347
|
-
className: "m4l_draggable_handle",
|
|
348
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
349
|
-
src: url_icon
|
|
350
|
-
}), /* @__PURE__ */ jsx(Typography, {
|
|
351
|
-
variant: "h5",
|
|
352
|
-
sx: {
|
|
353
|
-
maxWidth: 260,
|
|
354
|
-
overflow: "hidden",
|
|
355
|
-
whiteSpace: "nowrap",
|
|
356
|
-
color: "text.primary",
|
|
357
|
-
marginLeft: "12px",
|
|
358
|
-
marginRight: "24px",
|
|
359
|
-
textOverflow: "ellipsis"
|
|
360
|
-
},
|
|
361
|
-
children: `${container_id.substring(container_id.length - 3)} - ${title}`
|
|
362
|
-
}), mainActions.map((mainAction, index) => {
|
|
363
|
-
if (!mainAction.component) {
|
|
364
|
-
return /* @__PURE__ */ jsx(IconButton, {
|
|
365
|
-
src: mainAction.urlIcon,
|
|
366
|
-
className: mainAction.className,
|
|
367
|
-
onClick: mainAction.onClick,
|
|
368
|
-
"aria-label": mainAction.label,
|
|
369
|
-
disabled: mainAction.disabled
|
|
370
|
-
}, `main_action_${index}`);
|
|
371
|
-
}
|
|
372
|
-
return /* @__PURE__ */ jsx(mainAction.component, {
|
|
373
|
-
description: mainAction.label,
|
|
374
|
-
onClick: mainAction.onClick
|
|
375
|
-
}, `main_action_${index}`);
|
|
376
|
-
}), menuActions.length > 0 && /* @__PURE__ */ jsx(MenuActions, {
|
|
377
|
-
arrowType: "right-top",
|
|
378
|
-
marginTop: "11px",
|
|
379
|
-
anchorOrigin: {
|
|
380
|
-
vertical: "top",
|
|
381
|
-
horizontal: "left"
|
|
382
|
-
},
|
|
383
|
-
transformOrigin: {
|
|
384
|
-
vertical: "top",
|
|
385
|
-
horizontal: "right"
|
|
386
|
-
},
|
|
387
|
-
menuActions
|
|
388
|
-
}), onClose && /* @__PURE__ */ jsx(IconButton, {
|
|
389
|
-
onClick: onCloseLocal,
|
|
390
|
-
"aria-label": "click",
|
|
391
|
-
src: `${host_static_assets}/${environment_assets}/frontend/commons/assets/icons/${icons.CLOSE}`
|
|
392
|
-
}), isDesktop && /* @__PURE__ */ jsx(Button, {
|
|
393
|
-
onClick: maxNormalize,
|
|
394
|
-
"aria-label": "click",
|
|
395
|
-
children: maximizedId ? "Norm" : "Max"
|
|
396
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
397
|
-
onClick: saveModuleCookies,
|
|
398
|
-
"aria-label": "click",
|
|
399
|
-
children: "Grabar Props"
|
|
400
|
-
})]
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
const WrapperLinearProgress = styled$1("div")(() => ({
|
|
404
|
-
width: "70%",
|
|
405
|
-
margin: "auto auto"
|
|
406
|
-
}));
|
|
407
|
-
const WrapperFallBackNotFound = styled$1("div")(({
|
|
408
|
-
theme
|
|
409
|
-
}) => ({
|
|
410
|
-
width: "100%",
|
|
411
|
-
height: "100%",
|
|
412
|
-
display: "flex",
|
|
413
|
-
flexDirection: "column",
|
|
414
|
-
justifyContent: "center",
|
|
415
|
-
alignItems: "center",
|
|
416
|
-
gap: theme.spacing(3)
|
|
417
|
-
}));
|
|
418
|
-
function FallBackNotFound(props) {
|
|
419
|
-
const {
|
|
420
|
-
setNetworkRefresh
|
|
421
|
-
} = props;
|
|
422
|
-
const {
|
|
423
|
-
getLabel
|
|
424
|
-
} = useModuleDictionary();
|
|
425
|
-
const {
|
|
426
|
-
host_static_assets,
|
|
427
|
-
environment_assets
|
|
428
|
-
} = useEnvironment();
|
|
429
|
-
const handlerClick = () => {
|
|
430
|
-
setNetworkRefresh((prop) => !prop);
|
|
431
|
-
};
|
|
432
|
-
return /* @__PURE__ */ jsxs(WrapperFallBackNotFound, {
|
|
433
|
-
children: [/* @__PURE__ */ jsx(m.div, {
|
|
434
|
-
variants: varBounce().in,
|
|
435
|
-
children: /* @__PURE__ */ jsx(Typography, {
|
|
436
|
-
variant: "h3",
|
|
437
|
-
paragraph: true,
|
|
438
|
-
children: getLabel("loading_mf_title")
|
|
439
|
-
})
|
|
440
|
-
}), /* @__PURE__ */ jsx(Typography, {
|
|
441
|
-
sx: {
|
|
442
|
-
color: "text.secondary"
|
|
443
|
-
},
|
|
444
|
-
children: getLabel("loading_mf_description")
|
|
445
|
-
}), /* @__PURE__ */ jsx(m.div, {
|
|
446
|
-
variants: varBounce().in,
|
|
447
|
-
children: /* @__PURE__ */ jsx(Image, {
|
|
448
|
-
src: `${host_static_assets}/${environment_assets}/frontend/domain/host/commons/assets/img/illustration_noauth.png`,
|
|
449
|
-
ratio: "1:1"
|
|
450
|
-
})
|
|
451
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
452
|
-
size: "medium",
|
|
453
|
-
variant: "contained",
|
|
454
|
-
onClick: handlerClick,
|
|
455
|
-
children: getLabel("loading_mf_intro")
|
|
456
|
-
})]
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
const LoadingMF = (props) => {
|
|
460
|
-
const {
|
|
461
|
-
loadingProgress,
|
|
462
|
-
setNetworkRefresh
|
|
463
|
-
} = props;
|
|
464
|
-
if (loadingProgress !== -1) {
|
|
465
|
-
return /* @__PURE__ */ jsx(WrapperLinearProgress, {
|
|
466
|
-
id: "WrapperLinearProgress",
|
|
467
|
-
children: /* @__PURE__ */ jsx(LinearProgress, {
|
|
468
|
-
variant: "determinate",
|
|
469
|
-
value: loadingProgress
|
|
470
|
-
})
|
|
471
|
-
});
|
|
472
|
-
}
|
|
473
|
-
return /* @__PURE__ */ jsx(FallBackNotFound, {
|
|
474
|
-
setNetworkRefresh
|
|
475
|
-
});
|
|
476
|
-
};
|
|
477
|
-
function getDivScritId(prefix, moduleId) {
|
|
478
|
-
const rotational_id = `${Math.round(new Date().getTime() / 1e3)}_rnd_${Math.round(Math.random() * 1e3)}`;
|
|
479
|
-
return {
|
|
480
|
-
divContainerId: `container_${prefix}_${moduleId}_${rotational_id}`,
|
|
481
|
-
scriptId: `script_${moduleId}_${rotational_id}`,
|
|
482
|
-
moduleId
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
function MFLoader(props) {
|
|
486
|
-
const {
|
|
487
|
-
prefix,
|
|
488
|
-
moduleId,
|
|
489
|
-
cache = true,
|
|
490
|
-
debug_port,
|
|
491
|
-
dynamicMFStore,
|
|
492
|
-
windowTools
|
|
493
|
-
} = props;
|
|
494
|
-
const {
|
|
495
|
-
hostThemeOptions,
|
|
496
|
-
fnComponentsOverrides
|
|
497
|
-
} = useHostTheme();
|
|
498
|
-
const {
|
|
499
|
-
networkOperation
|
|
500
|
-
} = useNetwork();
|
|
501
|
-
const environment = useEnvironment();
|
|
502
|
-
const hostTools = useHostTools();
|
|
503
|
-
const formatter = useFormatter();
|
|
504
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
505
|
-
const [networkProgress, setNetworkProgress] = useState(-1);
|
|
506
|
-
const [_networkRefresh, setNetworkRefresh] = useState(false);
|
|
507
|
-
const {
|
|
508
|
-
currentLocale
|
|
509
|
-
} = useLocales();
|
|
510
|
-
const [divScript, setDivScript] = useState(getDivScritId(prefix, moduleId));
|
|
511
|
-
const refTime = useRef(0);
|
|
512
|
-
const isFirstRender = useFirstRender([moduleId]);
|
|
513
|
-
const final_host = environment.isLocalhost ? `https://localhost:${debug_port}` : `https://${window.location.host}/mf/${moduleId}`;
|
|
514
|
-
function cleanUp(dScript) {
|
|
515
|
-
try {
|
|
516
|
-
if (window[`unmount_${prefix}_${dScript.moduleId}`]) {
|
|
517
|
-
window[`unmount_${prefix}_${dScript.moduleId}`](dScript.divContainerId);
|
|
518
|
-
}
|
|
519
|
-
} catch (error) {
|
|
520
|
-
}
|
|
521
|
-
if (!cache) {
|
|
522
|
-
const script = document.getElementById(dScript.scriptId);
|
|
523
|
-
if (script) {
|
|
524
|
-
try {
|
|
525
|
-
document.head.removeChild(script);
|
|
526
|
-
delete window[`render_${prefix}_${dScript.moduleId}`];
|
|
527
|
-
delete window[`unmount_${prefix}_${dScript.moduleId}`];
|
|
528
|
-
} catch (error) {
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
const renderMicroFrontend = useCallback((newDScript) => {
|
|
534
|
-
try {
|
|
535
|
-
setIsLoading(false);
|
|
536
|
-
window[`render_${prefix}_${newDScript.moduleId}`](newDScript.divContainerId, environment, hostTools, currentLocale, {
|
|
537
|
-
hostThemeOptions,
|
|
538
|
-
fnComponentsOverrides
|
|
539
|
-
}, axiosOperation, formatter, dynamicMFStore, windowTools);
|
|
540
|
-
} catch (error) {
|
|
541
|
-
}
|
|
542
|
-
}, [hostThemeOptions, currentLocale, formatter]);
|
|
543
|
-
const debouncedSetDivScript = useCallback(debounce((newName) => {
|
|
544
|
-
const newDivScript = getDivScritId(prefix, newName);
|
|
545
|
-
if (newName !== divScript.moduleId) {
|
|
546
|
-
setDivScript({
|
|
547
|
-
...newDivScript
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
}, 200), [divScript]);
|
|
551
|
-
useEffect(() => {
|
|
552
|
-
if (!isFirstRender) {
|
|
553
|
-
debouncedSetDivScript(moduleId + "");
|
|
554
|
-
if (moduleId !== divScript.moduleId)
|
|
555
|
-
;
|
|
556
|
-
}
|
|
557
|
-
return () => {
|
|
558
|
-
};
|
|
559
|
-
}, [moduleId]);
|
|
560
|
-
useEffect(() => {
|
|
561
|
-
setIsLoading(true);
|
|
562
|
-
let mounted = true;
|
|
563
|
-
const controller = new AbortController();
|
|
564
|
-
const dsScript = {
|
|
565
|
-
...divScript
|
|
566
|
-
};
|
|
567
|
-
const loadIfNotLoaded = async () => {
|
|
568
|
-
if (!window[`render_${prefix}_${moduleId}`]) {
|
|
569
|
-
let urlFile = "";
|
|
570
|
-
setNetworkProgress(0);
|
|
571
|
-
const manifest = await fetch(`${final_host}/manifest.json?rnd=${Math.random()}`).then((res) => res.json()).catch(() => {
|
|
572
|
-
console.debug("Error fetching manifest", `${final_host}/manifest.json`);
|
|
573
|
-
return void 0;
|
|
574
|
-
});
|
|
575
|
-
if (!manifest) {
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
setNetworkProgress(10);
|
|
579
|
-
if (mounted) {
|
|
580
|
-
urlFile = `${final_host}/${manifest["src/index.tsx"]["file"]}?rnd=${Math.random()}`;
|
|
581
|
-
refTime.current = 0;
|
|
582
|
-
await networkOperation({
|
|
583
|
-
method: "GET",
|
|
584
|
-
endPoint: urlFile,
|
|
585
|
-
isRemote: !environment.isLocalhost,
|
|
586
|
-
headers: {
|
|
587
|
-
"Content-Type": "application/json"
|
|
588
|
-
},
|
|
589
|
-
onDownloadProgress: (progressEvent) => {
|
|
590
|
-
let percentCompleted = 0;
|
|
591
|
-
try {
|
|
592
|
-
if (progressEvent.lengthComputable) {
|
|
593
|
-
percentCompleted = 10 + Math.round(progressEvent.loaded * 90 / progressEvent.total);
|
|
594
|
-
} else {
|
|
595
|
-
if (refTime.current === 0) {
|
|
596
|
-
refTime.current = new Date().getTime();
|
|
597
|
-
}
|
|
598
|
-
percentCompleted = 10 + progressEvent.loaded / 15e5 * 90;
|
|
599
|
-
if (percentCompleted > 95)
|
|
600
|
-
percentCompleted = 95;
|
|
601
|
-
}
|
|
602
|
-
} catch (error) {
|
|
603
|
-
}
|
|
604
|
-
if (mounted) {
|
|
605
|
-
setNetworkProgress(percentCompleted);
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
isExternalUrl: true,
|
|
609
|
-
responseType: "text",
|
|
610
|
-
signal: controller.signal
|
|
611
|
-
}).then(() => {
|
|
612
|
-
if (mounted) {
|
|
613
|
-
setNetworkProgress(100);
|
|
614
|
-
}
|
|
615
|
-
}).catch(() => {
|
|
616
|
-
});
|
|
617
|
-
if (mounted) {
|
|
618
|
-
const script = document.createElement("script");
|
|
619
|
-
script.id = divScript.scriptId;
|
|
620
|
-
script.crossOrigin = "";
|
|
621
|
-
script.type = "module";
|
|
622
|
-
script.src = urlFile || "";
|
|
623
|
-
script.onload = () => {
|
|
624
|
-
if (mounted) {
|
|
625
|
-
console.debug("Script loaded", new Date().getTime());
|
|
626
|
-
setNetworkProgress(100);
|
|
627
|
-
renderMicroFrontend(dsScript);
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
document.head.appendChild(script);
|
|
631
|
-
console.debug("Script appened", new Date().getTime());
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
} else {
|
|
635
|
-
if (mounted) {
|
|
636
|
-
renderMicroFrontend(dsScript);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
};
|
|
640
|
-
loadIfNotLoaded();
|
|
641
|
-
return () => {
|
|
642
|
-
mounted = false;
|
|
643
|
-
controller.abort();
|
|
644
|
-
cleanUp(dsScript);
|
|
645
|
-
};
|
|
646
|
-
}, [divScript]);
|
|
647
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
648
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
649
|
-
id: divScript.divContainerId
|
|
650
|
-
}), isLoading ? /* @__PURE__ */ jsx(LoadingMF, {
|
|
651
|
-
loadingProgress: networkProgress,
|
|
652
|
-
setNetworkRefresh
|
|
653
|
-
}) : null]
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
MFLoader.defaultProps = {
|
|
657
|
-
document,
|
|
658
|
-
window
|
|
659
|
-
};
|
|
660
|
-
const MicroFrontend = (props) => {
|
|
661
|
-
const dynamicMFStore = useWindowStore((state) => state.dynamicMFStore, shallow);
|
|
662
|
-
const moduleId = useWindowStore((state) => state.moduleId, shallow);
|
|
663
|
-
const actions = useWindowStore((state) => state.actions, shallow);
|
|
664
|
-
return /* @__PURE__ */ jsx(MFLoader, {
|
|
665
|
-
...props,
|
|
666
|
-
moduleId,
|
|
667
|
-
dynamicMFStore,
|
|
668
|
-
windowTools: {
|
|
669
|
-
...actions
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
};
|
|
673
|
-
React__default.memo(MicroFrontend);
|
|
674
|
-
const InnerForHooks = (props) => {
|
|
675
|
-
const {
|
|
676
|
-
winType
|
|
677
|
-
} = props;
|
|
678
|
-
const status = useWindowStore((state) => state.status);
|
|
679
|
-
if (status !== "loaded") {
|
|
680
|
-
return null;
|
|
681
|
-
}
|
|
682
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
683
|
-
children: [/* @__PURE__ */ jsx(Header, {}), /* @__PURE__ */ jsx(WrapperContent, {
|
|
684
|
-
children: winType === "microfrontend" ? /* @__PURE__ */ jsx(MicroFrontend, {
|
|
685
|
-
...props.mfProps
|
|
686
|
-
}) : /* @__PURE__ */ jsx(Component, {
|
|
687
|
-
component: props.component
|
|
688
|
-
})
|
|
689
|
-
})]
|
|
690
|
-
});
|
|
691
|
-
};
|
|
692
|
-
React__default.memo(InnerForHooks);
|
|
693
|
-
const Window = (props) => {
|
|
694
|
-
const {
|
|
695
|
-
emergeType
|
|
696
|
-
} = props;
|
|
697
|
-
const selected = useAreaStore((state) => emergeType === "layout" ? state.currentLayoutId : state.currentPopUpId) === props.windowId;
|
|
698
|
-
const {
|
|
699
|
-
selectWindowPopUp,
|
|
700
|
-
selectWindowLayout
|
|
701
|
-
} = useAreaStore((state) => state.actions);
|
|
702
|
-
const onTouch = () => {
|
|
703
|
-
if (!selected) {
|
|
704
|
-
if (emergeType === "popup") {
|
|
705
|
-
selectWindowPopUp(props.windowId);
|
|
706
|
-
} else if (emergeType === "layout") {
|
|
707
|
-
selectWindowLayout(props.windowId);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
return /* @__PURE__ */ jsx(WrapperWindow, {
|
|
712
|
-
id: "WrapperWindow",
|
|
713
|
-
selected,
|
|
714
|
-
onMouseDown: onTouch,
|
|
715
|
-
children: /* @__PURE__ */ jsx(WindowMFProvider, {
|
|
716
|
-
...props,
|
|
717
|
-
children: /* @__PURE__ */ jsx(InnerForHooks, {
|
|
718
|
-
...props
|
|
719
|
-
})
|
|
720
|
-
})
|
|
721
|
-
});
|
|
722
|
-
};
|
|
723
|
-
const MemonizedWindow = React__default.memo(Window);
|
|
724
|
-
const Container = styled("div")(({ theme }) => ({
|
|
725
|
-
display: "flex",
|
|
726
|
-
flexDirection: "column",
|
|
727
|
-
height: "100%",
|
|
728
|
-
overflow: "hidden",
|
|
729
|
-
padding: theme.spacing(3)
|
|
730
|
-
}));
|
|
731
|
-
const WrapperWindowModal = styled(Dialog)(() => ({
|
|
732
|
-
height: "100%",
|
|
733
|
-
"&.m4l_selected": {
|
|
734
|
-
borderTop: "1px solid green"
|
|
735
|
-
}
|
|
736
|
-
}));
|
|
737
|
-
const DragabblePaperComponent = (props) => {
|
|
738
|
-
return /* @__PURE__ */ jsx(cjs.exports, {
|
|
739
|
-
handle: ".m4l_draggable_handle",
|
|
740
|
-
cancel: '[class*="MuiDialogContent-root"]',
|
|
741
|
-
children: /* @__PURE__ */ jsx(Paper, {
|
|
742
|
-
sx: {
|
|
743
|
-
maxHeight: "unset",
|
|
744
|
-
maxWidth: "unset"
|
|
745
|
-
},
|
|
746
|
-
...props
|
|
747
|
-
})
|
|
748
|
-
});
|
|
749
|
-
};
|
|
750
|
-
function PaperComponent(props) {
|
|
751
|
-
return /* @__PURE__ */ jsx(Paper, {
|
|
752
|
-
sx: {
|
|
753
|
-
maxHeight: "unset",
|
|
754
|
-
maxWidth: "unset",
|
|
755
|
-
height: "100%"
|
|
756
|
-
},
|
|
757
|
-
...props
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
const WindowModal = (props) => {
|
|
761
|
-
const {
|
|
762
|
-
closeWindowModal
|
|
763
|
-
} = useAreaStore((state) => state.actions);
|
|
764
|
-
const isDesktop = useResponsiveDesktop();
|
|
765
|
-
const onClose = () => {
|
|
766
|
-
closeWindowModal();
|
|
767
|
-
};
|
|
768
|
-
const contentComnponent = /* @__PURE__ */ jsx(Container, {
|
|
769
|
-
id: "Container",
|
|
770
|
-
children: /* @__PURE__ */ jsx(Window, {
|
|
771
|
-
...props,
|
|
772
|
-
onClose
|
|
773
|
-
})
|
|
774
|
-
});
|
|
775
|
-
return /* @__PURE__ */ jsxs(WrapperWindowModal, {
|
|
776
|
-
open: true,
|
|
777
|
-
"aria-labelledby": "child-modal-title",
|
|
778
|
-
"aria-describedby": "child-modal-description",
|
|
779
|
-
PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
|
|
780
|
-
maxWidth: false,
|
|
781
|
-
fullWidth: !isDesktop,
|
|
782
|
-
fullScreen: false,
|
|
783
|
-
disableEnforceFocus: true,
|
|
784
|
-
children: [isDesktop && /* @__PURE__ */ jsx(
|
|
785
|
-
ResizeableWindow,
|
|
786
|
-
{
|
|
787
|
-
children: contentComnponent
|
|
788
|
-
}
|
|
789
|
-
), !isDesktop && contentComnponent]
|
|
790
|
-
});
|
|
791
|
-
};
|
|
792
|
-
const MemonizedWindowModal = React__default.memo(WindowModal);
|
|
793
|
-
const WrapperWindowsPanel = styled("div", {
|
|
794
|
-
shouldForwardProp: (props) => props !== "isDesktop"
|
|
795
|
-
})(({
|
|
796
|
-
isDesktop
|
|
797
|
-
}) => ({
|
|
798
|
-
display: "flex",
|
|
799
|
-
flexDirection: isDesktop ? "column" : "row",
|
|
800
|
-
height: isDesktop ? "40px" : "unset",
|
|
801
|
-
maxWidth: isDesktop ? "40px" : "unset",
|
|
802
|
-
flexGrow: "1",
|
|
803
|
-
position: "relative"
|
|
804
|
-
}));
|
|
805
|
-
const WrapperWindowPanel = styled("div", {
|
|
806
|
-
shouldForwardProp: (props) => props !== "selected"
|
|
807
|
-
})(({
|
|
808
|
-
selected
|
|
809
|
-
}) => ({
|
|
810
|
-
flexDirection: "column",
|
|
811
|
-
flexGrow: "1",
|
|
812
|
-
position: "relative",
|
|
813
|
-
width: "40px",
|
|
814
|
-
height: "40px",
|
|
815
|
-
border: selected ? "1px solid red" : "1px solid black"
|
|
816
|
-
}));
|
|
817
|
-
const WindowsPanel = () => {
|
|
818
|
-
const status = useAreaStore((state) => state.status);
|
|
819
|
-
const mode = useAreaStore((state) => state.viewMode);
|
|
820
|
-
const singleId = useAreaStore((state) => state.singleId);
|
|
821
|
-
const gridLayouts = useAreaStore((state) => state.gridLayouts, shallow);
|
|
822
|
-
const hashWindowsLayouts = useAreaStore((state) => state.hashWindowsLayouts, shallow);
|
|
823
|
-
const {
|
|
824
|
-
maximizeLayout
|
|
825
|
-
} = useAreaStore((state) => state.actions);
|
|
826
|
-
const isDesktop = useAreaStore((state) => state.isDesktop);
|
|
827
|
-
const onTouched = (layoutId) => {
|
|
828
|
-
maximizeLayout(layoutId);
|
|
829
|
-
};
|
|
830
|
-
if (status === "loaded") {
|
|
831
|
-
if (mode !== "single" || gridLayouts.length < 2) {
|
|
832
|
-
return null;
|
|
833
|
-
}
|
|
834
|
-
return /* @__PURE__ */ jsx(WrapperWindowsPanel, {
|
|
835
|
-
isDesktop,
|
|
836
|
-
children: gridLayouts.map((l) => {
|
|
837
|
-
return /* @__PURE__ */ jsx(WrapperWindowPanel, {
|
|
838
|
-
onClick: () => onTouched(l.i),
|
|
839
|
-
selected: singleId === l.i,
|
|
840
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
841
|
-
src: hashWindowsLayouts[l.i].url_icon
|
|
842
|
-
})
|
|
843
|
-
}, l.i);
|
|
844
|
-
})
|
|
845
|
-
});
|
|
846
|
-
} else {
|
|
847
|
-
return null;
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
export {
|
|
851
|
-
MemonizedWindow as M,
|
|
852
|
-
Window as W,
|
|
853
|
-
MemonizedWindowModal as a,
|
|
854
|
-
WindowsPanel as b
|
|
855
|
-
};
|