@m4l/components 0.1.36 → 0.1.37
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/{commonjs.bcc6b707.js → commonjs.565e6834.js} +0 -1
- package/dist/components/CommonActions/components/ActionCancel/{index.4b36950f.js → index.9230c57b.js} +1 -1
- package/dist/components/CommonActions/components/ActionFormCancel/{index.945e9887.js → index.ab514bd9.js} +9 -7
- package/dist/components/CommonActions/components/ActionIntro/{index.35a0d240.js → index.a0a341c7.js} +1 -1
- package/dist/components/CommonActions/components/Actions/index.d3e1f36e.js +54 -0
- package/dist/components/DataGrid/{index.156cc30c.js → index.67260455.js} +663 -15
- package/dist/components/DynamicFilter/{index.32f84995.js → index.071aa795.js} +92 -18
- package/dist/components/Icon/{index.1dbd3e58.js → index.8d754623.js} +62 -5
- package/dist/components/LanguagePopover/index.cbc4b282.js +144 -0
- package/dist/components/Loadable/{index.8c6006be.js → index.117eaced.js} +1 -1
- package/dist/components/ModalDialog/{index.91777582.js → index.a684827f.js} +5 -5
- package/dist/components/ObjectLogs/{index.9d3fc2ae.js → index.4a859658.js} +12 -10
- package/dist/components/PaperForm/{index.218a6c4b.js → index.c5948756.js} +1 -1
- package/dist/components/Period/{index.74f35862.js → index.abe445bd.js} +9 -7
- package/dist/components/Resizeable/{index.44a0dd46.js → index.c96c0f09.js} +1 -1
- package/dist/components/SplitLayout/{index.81fc4750.js → index.5a8355d8.js} +1 -1
- package/dist/components/animate/PropagateLoader/index.be5b02c3.js +30 -0
- package/dist/components/areas/components/AreasAdmin/index.6794b22f.js +112 -0
- package/dist/components/areas/components/AreasContainer/index.a2f8899b.js +43 -0
- package/dist/components/areas/components/GridLayout/index.b9c1e846.js +92 -0
- package/dist/components/areas/components/Window/index.252fbf4e.js +646 -0
- package/dist/components/areas/components/WindowPopUp/index.214cf099.js +120 -0
- package/dist/components/areas/components/index.7d6cd649.js +67 -0
- package/dist/components/areas/contexts/AreaContext/index.4894cf23.js +286 -0
- package/dist/components/areas/contexts/AreasContext/index.cd8e4bee.js +158 -0
- package/dist/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +17 -0
- package/dist/components/areas/contexts/index.f9196fb2.js +1 -0
- package/dist/components/areas/hooks/useArea/index.9b85ce24.js +19 -0
- package/dist/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +11 -0
- package/dist/components/areas/index.d1bf612c.js +16 -0
- package/dist/components/formatters/BooleanFormatter/{index.efc8ffc2.js → index.3a9b16c8.js} +1 -1
- package/dist/components/formatters/{index.c3f4b687.js → index.0b5f95d0.js} +1 -1
- package/dist/components/hook-form/RHFPeriod/{index.2b8e63a2.js → index.3772295b.js} +1 -1
- package/dist/components/hook-form/RHFTextField/{index.7feaec71.js → index.b17d68f4.js} +1 -1
- package/dist/components/modal/WindowBase.04439b8e.js +120 -0
- package/dist/components/modal/WindowConfirm.0b8a6818.js +115 -0
- package/dist/components/modal/index.8387e90e.js +18 -0
- package/dist/components/mui_extended/Accordion/{index.8e123c57.js → index.a541c71c.js} +2 -2
- package/dist/components/mui_extended/Button/index.86a155a2.js +101 -0
- package/dist/components/mui_extended/IconButton/{index.e3adaa33.js → index.82f16572.js} +5 -62
- package/dist/components/mui_extended/MenuActions/index.ee17bddd.js +112 -0
- package/dist/components/mui_extended/Pager/{index.d245f821.js → index.74d3f5fc.js} +66 -1
- package/dist/components/mui_extended/Popover/index.53c77d23.js +137 -0
- package/dist/components/mui_extended/index.85dfadf1.js +16 -0
- package/dist/contexts/ModalContext/{index.0797eb17.js → index.b90eec94.js} +1 -1
- package/dist/hooks/useModal/{index.32da4dcb.js → index.d14edee3.js} +1 -1
- package/dist/index.js +128 -1691
- package/dist/{components/animate/PropagateLoader/index.eb401503.js → node_modules.416f1da3.js} +59 -28
- package/dist/package.json +2 -1
- package/dist/{react-draggable.3b5b6680.js → react-draggable.84d6b038.js} +1 -1
- package/dist/{react-json-view.03ae95f5.js → react-json-view.57125fcf.js} +1 -1
- package/dist/{react-resizable.6eae0397.js → react-resizable.1d00271d.js} +3 -4
- package/dist/{react-splitter-layout.873aece3.js → react-splitter-layout.8b1655c8.js} +1 -1
- package/dist/style.css +0 -114
- package/dist/utils/{index.9dce2e2f.js → index.899eb67b.js} +28 -460
- package/package.json +3 -1
- package/vite.config.ts +201 -129
- package/dist/components/CommonActions/components/Actions/index.ba86f72f.js +0 -868
- package/dist/components/mui_extended/Button/index.55fc70dc.js +0 -178
- package/dist/components/mui_extended/Popover/index.97cf3a3e.js +0 -275
- package/dist/node_modules.e0b84fac.js +0 -2154
package/dist/index.js
CHANGED
|
@@ -1,80 +1,75 @@
|
|
|
1
|
-
import { I
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { styled } from "@mui/material/styles";
|
|
1
|
+
import { I, a } from "./components/Icon/index.8d754623.js";
|
|
2
|
+
import "framer-motion";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import "@mui/material/styles";
|
|
7
6
|
import "react-router-dom";
|
|
8
7
|
import { L } from "./components/animate/LoadingScreen/index.1d0c4307.js";
|
|
9
|
-
import { P } from "./components/animate/PropagateLoader/index.
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
8
|
+
import { P } from "./components/animate/PropagateLoader/index.be5b02c3.js";
|
|
9
|
+
import { a as a2, D } from "./components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js";
|
|
10
|
+
import { M, a as a3 } from "./contexts/ModalContext/index.b90eec94.js";
|
|
11
|
+
import { useState } from "react";
|
|
12
12
|
import "react-hook-form";
|
|
13
13
|
import "@hookform/resolvers/yup";
|
|
14
14
|
import { R } from "./contexts/RHFormContext/index.d88e6e27.js";
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import { I as I2 } from "./components/
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import "@mui/material/Button";
|
|
21
|
-
import "@mui/lab";
|
|
22
|
-
import { B as Button } from "./components/mui_extended/Button/index.55fc70dc.js";
|
|
23
|
-
import { B, L as L2 } from "./components/mui_extended/Button/index.55fc70dc.js";
|
|
24
|
-
import { L as L3, P as P2 } from "./components/mui_extended/Popover/index.97cf3a3e.js";
|
|
25
|
-
import { M as MenuActions, b as Actions } from "./components/CommonActions/components/Actions/index.ba86f72f.js";
|
|
26
|
-
import { b, M as M2, d, g } from "./components/CommonActions/components/Actions/index.ba86f72f.js";
|
|
27
|
-
import { P as P3, g as g2 } from "./components/mui_extended/Pager/index.d245f821.js";
|
|
28
|
-
import { T } from "./components/mui_extended/Tab/index.e0653a0a.js";
|
|
29
|
-
import { r as reactGridLayout } from "./node_modules.e0b84fac.js";
|
|
30
|
-
import "./react-resizable.6eae0397.js";
|
|
31
|
-
import { c as cjs } from "./react-draggable.3b5b6680.js";
|
|
32
|
-
import { M as M3, d as d2, g as g3 } from "./components/ModalDialog/index.91777582.js";
|
|
33
|
-
import { R as ResizeableWindow } from "./components/Resizeable/index.44a0dd46.js";
|
|
34
|
-
import { R as R2 } from "./components/Resizeable/index.44a0dd46.js";
|
|
35
|
-
import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender } from "@m4l/graphics";
|
|
36
|
-
import { R as R3, g as g4 } from "./components/hook-form/RHFAutocomplete/index.de93fe01.js";
|
|
37
|
-
import { I as Image } from "./components/Image/index.93d5f37f.js";
|
|
38
|
-
import { I as I3 } from "./components/Image/index.93d5f37f.js";
|
|
39
|
-
import debounce from "lodash/debounce";
|
|
40
|
-
import { R as R4 } from "./components/hook-form/RHFCheckbox/index.6dcec9e2.js";
|
|
15
|
+
import "@m4l/core";
|
|
16
|
+
import { R as R2, g } from "./components/hook-form/RHFAutocomplete/index.de93fe01.js";
|
|
17
|
+
import { I as I2 } from "./components/Image/index.93d5f37f.js";
|
|
18
|
+
import "lodash/debounce";
|
|
19
|
+
import { R as R3 } from "./components/hook-form/RHFCheckbox/index.6dcec9e2.js";
|
|
41
20
|
import "@mui/x-date-pickers";
|
|
42
|
-
import { R as
|
|
43
|
-
import
|
|
44
|
-
import { R as
|
|
21
|
+
import { R as R4 } from "./components/hook-form/RHFDateTime/index.7f1cbd85.js";
|
|
22
|
+
import "@m4l/graphics";
|
|
23
|
+
import { R as R5, a as a4 } from "./components/hook-form/RHFTextField/index.b17d68f4.js";
|
|
24
|
+
import { R as R6 } from "./components/hook-form/RHFPeriod/index.3772295b.js";
|
|
45
25
|
import { E } from "./components/ErrorLabel/index.c8615f16.js";
|
|
46
|
-
import { P as
|
|
26
|
+
import { P as P2, g as g2 } from "./components/Period/index.abe445bd.js";
|
|
27
|
+
import { A, d, g as g3 } from "./components/CommonActions/components/Actions/index.d3e1f36e.js";
|
|
28
|
+
import "@mui/material/Button";
|
|
29
|
+
import { c as cjs } from "./react-draggable.84d6b038.js";
|
|
30
|
+
import { M as M2, d as d2, g as g4 } from "./components/ModalDialog/index.a684827f.js";
|
|
31
|
+
import { R as R7 } from "./components/Resizeable/index.c96c0f09.js";
|
|
32
|
+
import { W } from "./components/modal/WindowConfirm.0b8a6818.js";
|
|
33
|
+
import { W as W2 } from "./components/modal/WindowBase.04439b8e.js";
|
|
34
|
+
import "@mui/lab";
|
|
47
35
|
import "lodash/isString";
|
|
48
36
|
import "react-dropzone";
|
|
49
37
|
import { R as R8 } from "./components/hook-form/RHFUpload/index.d5cc7c13.js";
|
|
50
|
-
import {
|
|
38
|
+
import { A as A2 } from "./components/areas/components/index.7d6cd649.js";
|
|
39
|
+
import { A as A3 } from "./components/areas/components/AreasAdmin/index.6794b22f.js";
|
|
40
|
+
import { A as A4, a as a5 } from "./components/areas/contexts/AreasContext/index.cd8e4bee.js";
|
|
41
|
+
import { A as A5 } from "./components/areas/components/AreasContainer/index.a2f8899b.js";
|
|
42
|
+
import "react-grid-layout/css/styles.css";
|
|
43
|
+
import "./react-resizable.1d00271d.js";
|
|
44
|
+
import { A as A6 } from "./components/mui_extended/Accordion/index.a541c71c.js";
|
|
45
|
+
import { A as A7 } from "./components/mui_extended/Avatar/index.fe06afd7.js";
|
|
46
|
+
import { B, L as L2 } from "./components/mui_extended/Button/index.86a155a2.js";
|
|
47
|
+
import { P as P3 } from "./components/mui_extended/Popover/index.53c77d23.js";
|
|
48
|
+
import { M as M3 } from "./components/mui_extended/MenuActions/index.ee17bddd.js";
|
|
49
|
+
import { P as P4, g as g5 } from "./components/mui_extended/Pager/index.74d3f5fc.js";
|
|
50
|
+
import { T } from "./components/mui_extended/Tab/index.e0653a0a.js";
|
|
51
|
+
import { D as D2, N, T as T2, c, b, a as a6, g as g6 } from "./components/DataGrid/index.67260455.js";
|
|
51
52
|
import "react-dnd";
|
|
52
53
|
import "react-dnd-html5-backend";
|
|
53
54
|
import { S } from "./components/ScrollBar/index.39eeb2de.js";
|
|
54
|
-
import { D as
|
|
55
|
+
import { D as D3, d as d3, g as g7 } from "./components/DynamicFilter/index.071aa795.js";
|
|
55
56
|
import "simplebar/dist/simplebar.min.css";
|
|
56
57
|
import "yup";
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import "./
|
|
60
|
-
import
|
|
58
|
+
import { L as L3 } from "./components/LanguagePopover/index.cbc4b282.js";
|
|
59
|
+
import { N as N2, d as d4, g as g8 } from "./components/NoItemSelected/index.46d2f632.js";
|
|
60
|
+
import { O, d as d5, g as g9 } from "./components/ObjectLogs/index.4a859658.js";
|
|
61
|
+
import "./react-json-view.57125fcf.js";
|
|
62
|
+
import { P as P5 } from "./components/PaperForm/index.c5948756.js";
|
|
61
63
|
import { H } from "./components/Page/index.4237c241.js";
|
|
62
64
|
import { P as P6 } from "./components/PropertyValue/index.dfcfe1ba.js";
|
|
63
|
-
import "./react-splitter-layout.
|
|
64
|
-
import { S as S2 } from "./components/SplitLayout/index.
|
|
65
|
+
import "./react-splitter-layout.8b1655c8.js";
|
|
66
|
+
import { S as S2 } from "./components/SplitLayout/index.5a8355d8.js";
|
|
65
67
|
import { v } from "./components/animate/variants/fade.b561c0fc.js";
|
|
66
|
-
import { v as varBounce } from "./components/animate/variants/bounce.784aaaaa.js";
|
|
67
68
|
import { v as v2 } from "./components/animate/variants/bounce.784aaaaa.js";
|
|
68
69
|
import { v as v3 } from "./components/animate/variants/container.11f82b76.js";
|
|
69
|
-
import { v as v4, a as
|
|
70
|
+
import { v as v4, a as a7, b as b2 } from "./components/animate/variants/transition.bd46b9ce.js";
|
|
70
71
|
import { M as M4 } from "./components/animate/MotionContainer/index.8d9f9d80.js";
|
|
71
72
|
import { M as M5 } from "./components/animate/MotionLazyContainer/index.572dd012.js";
|
|
72
|
-
import isEqual from "lodash/isEqual";
|
|
73
|
-
import { L as LinearProgress } from "./components/mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
74
|
-
import { L as L4 } from "./components/mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
75
|
-
import { u as useModal } from "./hooks/useModal/index.32da4dcb.js";
|
|
76
|
-
import { u } from "./hooks/useModal/index.32da4dcb.js";
|
|
77
|
-
import { a as getThemeVariantColor, c as getVariantColor } from "./utils/index.9dce2e2f.js";
|
|
78
73
|
import { R as R9, g as g10 } from "./components/hook-form/RHFAutocompleteAsync/index.ca696cce.js";
|
|
79
74
|
import { R as R10 } from "./components/hook-form/RHFMultiCheckbox/index.2680b3b6.js";
|
|
80
75
|
import { R as R11 } from "./components/hook-form/RHFSelect/index.b6ca8bb2.js";
|
|
@@ -82,1607 +77,49 @@ import { R as R12 } from "./components/hook-form/RHFRadioGroup/index.b3335e13.js
|
|
|
82
77
|
import { B as B2 } from "./components/mui_extended/BoxIcon/index.e638ecc8.js";
|
|
83
78
|
import { B as B3 } from "./components/mui_extended/Breadcrumbs/index.5e37d903.js";
|
|
84
79
|
import { C } from "./components/mui_extended/CircularProgress/index.ad569afd.js";
|
|
80
|
+
import { I as I3 } from "./components/mui_extended/IconButton/index.82f16572.js";
|
|
81
|
+
import { L as L4 } from "./components/mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
85
82
|
import { L as L5 } from "./components/mui_extended/LinkWithRoute/index.16436ab8.js";
|
|
86
83
|
import { T as T3 } from "./components/mui_extended/Typography/index.e5494696.js";
|
|
87
|
-
import { B as B4 } from "./components/formatters/BooleanFormatter/index.
|
|
88
|
-
import { D as
|
|
84
|
+
import { B as B4 } from "./components/formatters/BooleanFormatter/index.3a9b16c8.js";
|
|
85
|
+
import { D as D4 } from "./components/formatters/DateFormatter/index.80522f69.js";
|
|
89
86
|
import { U, g as g11 } from "./components/formatters/UncertaintyFormatter/index.08e1b79f.js";
|
|
90
87
|
import { P as P7, g as g12 } from "./components/formatters/PointsFormatter/index.80a4e414.js";
|
|
91
88
|
import { P as P8, g as g13 } from "./components/formatters/PriceFormatter/index.83cbe7be.js";
|
|
92
|
-
import { d as
|
|
89
|
+
import { d as d6, g as g14 } from "./components/formatters/index.0b5f95d0.js";
|
|
93
90
|
import { c as c2 } from "./components/DataGrid/formatters/columnUncertaintyFormatter/index.cae2057a.js";
|
|
94
91
|
import { c as c3 } from "./components/DataGrid/formatters/columnPointsFormatter/index.5e645334.js";
|
|
95
92
|
import { c as c4 } from "./components/DataGrid/formatters/columnNestedValueFormatter/index.f68ef4e1.js";
|
|
96
93
|
import { c as c5 } from "./components/DataGrid/formatters/columnPriceFormatter/index.e612fda3.js";
|
|
97
|
-
import { A as
|
|
98
|
-
import { A as
|
|
99
|
-
import { A as
|
|
100
|
-
import { A as
|
|
101
|
-
import {
|
|
102
|
-
import { A as A6 } from "./components/CommonActions/components/ActionFormIntro/index.ca4d2674.js";
|
|
103
|
-
import { L as L6 } from "./components/Loadable/index.8c6006be.js";
|
|
94
|
+
import { A as A8 } from "./components/CommonActions/components/ActionCancel/index.9230c57b.js";
|
|
95
|
+
import { A as A9 } from "./components/CommonActions/components/ActionIntro/index.a0a341c7.js";
|
|
96
|
+
import { A as A10 } from "./components/CommonActions/components/ActionFormCancel/index.ab514bd9.js";
|
|
97
|
+
import { A as A11 } from "./components/CommonActions/components/ActionFormIntro/index.ca4d2674.js";
|
|
98
|
+
import { L as L6 } from "./components/Loadable/index.117eaced.js";
|
|
104
99
|
import { S as S3 } from "./components/ScrollToTop/index.e06f98f6.js";
|
|
105
|
-
import { u
|
|
100
|
+
import { u } from "./hooks/useFormAddEdit/index.d4845f1a.js";
|
|
101
|
+
import { u as u2 } from "./hooks/useModal/index.d14edee3.js";
|
|
102
|
+
import { u as u3 } from "./components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js";
|
|
106
103
|
import { L as L7 } from "./assets/Logo/index.228dcb5a.js";
|
|
107
|
-
import "./index.js";
|
|
108
|
-
import "./
|
|
109
|
-
import "clsx";
|
|
110
|
-
import "lodash.isequal";
|
|
104
|
+
import "./utils/index.899eb67b.js";
|
|
105
|
+
import "./node_modules.416f1da3.js";
|
|
111
106
|
import "prop-types";
|
|
112
107
|
import "react-dom";
|
|
108
|
+
import "clsx";
|
|
109
|
+
import "./components/areas/contexts/AreaContext/index.4894cf23.js";
|
|
110
|
+
import "lodash/isEqual";
|
|
111
|
+
import "./components/areas/components/Window/index.252fbf4e.js";
|
|
112
|
+
import "./components/areas/hooks/useArea/index.9b85ce24.js";
|
|
113
|
+
import "./components/areas/components/GridLayout/index.b9c1e846.js";
|
|
114
|
+
import "react-grid-layout";
|
|
115
|
+
import "./components/areas/components/WindowPopUp/index.214cf099.js";
|
|
116
|
+
import "./index.js";
|
|
117
|
+
import "./components/areas/index.d1bf612c.js";
|
|
118
|
+
import "./react-data-grid.d46d625e.js";
|
|
113
119
|
import "simplebar-react";
|
|
114
|
-
import "./commonjs.
|
|
120
|
+
import "./commonjs.565e6834.js";
|
|
115
121
|
import "react-helmet-async";
|
|
116
122
|
import "./components/WrapperComponent/index.5e872594.js";
|
|
117
|
-
const WindowContext = createContext(null);
|
|
118
|
-
function WindowProvider(props) {
|
|
119
|
-
const {
|
|
120
|
-
children,
|
|
121
|
-
initialExternalActions = [],
|
|
122
|
-
...other
|
|
123
|
-
} = props;
|
|
124
|
-
const [moduleActions, setModuleActions] = useState([]);
|
|
125
|
-
const [externalActions, setExternalActions] = useState(initialExternalActions);
|
|
126
|
-
return /* @__PURE__ */ jsx(WindowContext.Provider, {
|
|
127
|
-
value: {
|
|
128
|
-
moduleActions,
|
|
129
|
-
externalActions,
|
|
130
|
-
setModuleActions,
|
|
131
|
-
setExternalActions,
|
|
132
|
-
...other
|
|
133
|
-
},
|
|
134
|
-
children
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
const WrapperWindow = styled("div")(({ theme }) => ({
|
|
138
|
-
display: "flex",
|
|
139
|
-
flexDirection: "column",
|
|
140
|
-
height: "100%",
|
|
141
|
-
width: "100%",
|
|
142
|
-
overflow: "hidden",
|
|
143
|
-
backgroundColor: theme.palette.background.paper,
|
|
144
|
-
padding: theme.spacing(3),
|
|
145
|
-
border: "1px solid gray",
|
|
146
|
-
"&.m4l_selected": {
|
|
147
|
-
borderTop: "1px solid green"
|
|
148
|
-
}
|
|
149
|
-
}));
|
|
150
|
-
const WrapperContent = styled("div")(() => ({
|
|
151
|
-
flexGrow: 1,
|
|
152
|
-
position: "relative"
|
|
153
|
-
}));
|
|
154
|
-
const DynamicMFParmsContext = createContext(null);
|
|
155
|
-
function DynamicMFParmsProvider(props) {
|
|
156
|
-
const {
|
|
157
|
-
children,
|
|
158
|
-
...other
|
|
159
|
-
} = props;
|
|
160
|
-
return /* @__PURE__ */ jsx(DynamicMFParmsContext.Provider, {
|
|
161
|
-
value: other,
|
|
162
|
-
children
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
const useWindow = () => {
|
|
166
|
-
const context = useContext(WindowContext);
|
|
167
|
-
if (!context)
|
|
168
|
-
throw new Error("useWindow context must be use inside WindowContext");
|
|
169
|
-
return context;
|
|
170
|
-
};
|
|
171
|
-
const Component = (props) => {
|
|
172
|
-
const {
|
|
173
|
-
setModuleActions
|
|
174
|
-
} = useWindow();
|
|
175
|
-
return /* @__PURE__ */ jsx(DynamicMFParmsProvider, {
|
|
176
|
-
setModuleActions,
|
|
177
|
-
children: props.children
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
React__default.memo(Component);
|
|
181
|
-
const StyledHeader = styled("div")(({
|
|
182
|
-
theme
|
|
183
|
-
}) => ({
|
|
184
|
-
display: "flex",
|
|
185
|
-
alignItems: "center",
|
|
186
|
-
position: "relative",
|
|
187
|
-
justifyContent: "space-between",
|
|
188
|
-
minHeight: theme.spacing(5),
|
|
189
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
190
|
-
overflow: "hidden",
|
|
191
|
-
cursor: "move",
|
|
192
|
-
height: "60px",
|
|
193
|
-
" > span": {
|
|
194
|
-
marginRight: "12px"
|
|
195
|
-
},
|
|
196
|
-
"& > h5": {
|
|
197
|
-
paddingRight: theme.spacing(3),
|
|
198
|
-
borderRight: `1px solid ${theme.palette.divider}`
|
|
199
|
-
},
|
|
200
|
-
" > nav": {
|
|
201
|
-
marginRight: "12px",
|
|
202
|
-
flexGrow: 1
|
|
203
|
-
},
|
|
204
|
-
"& .splitactions.Mui-disabled": {
|
|
205
|
-
color: theme.palette.primary.main
|
|
206
|
-
},
|
|
207
|
-
"& svg ": {
|
|
208
|
-
width: "20px",
|
|
209
|
-
height: "20px"
|
|
210
|
-
}
|
|
211
|
-
}));
|
|
212
|
-
styled("div")(({
|
|
213
|
-
theme
|
|
214
|
-
}) => ({
|
|
215
|
-
display: "flex",
|
|
216
|
-
alignItems: "center",
|
|
217
|
-
position: "relative",
|
|
218
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
219
|
-
height: "60px",
|
|
220
|
-
minHeight: "60px",
|
|
221
|
-
" > span": {
|
|
222
|
-
marginRight: "12px"
|
|
223
|
-
},
|
|
224
|
-
"& > h5": {
|
|
225
|
-
paddingRight: theme.spacing(3),
|
|
226
|
-
borderRight: `1px solid ${theme.palette.divider}`
|
|
227
|
-
},
|
|
228
|
-
" > nav": {
|
|
229
|
-
marginRight: "12px",
|
|
230
|
-
flexGrow: 1
|
|
231
|
-
},
|
|
232
|
-
"& .splitactions.Mui-disabled": {
|
|
233
|
-
color: theme.palette.primary.main
|
|
234
|
-
},
|
|
235
|
-
"& svg ": {
|
|
236
|
-
width: "20px",
|
|
237
|
-
height: "20px"
|
|
238
|
-
}
|
|
239
|
-
}));
|
|
240
|
-
const Wrapper = styled("div")(({
|
|
241
|
-
theme
|
|
242
|
-
}) => ({
|
|
243
|
-
display: "flex",
|
|
244
|
-
justifyContent: "space-between",
|
|
245
|
-
padding: `0 0`,
|
|
246
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
247
|
-
minHeight: "60px"
|
|
248
|
-
}));
|
|
249
|
-
const ModuleTitleContent = styled("div")(({
|
|
250
|
-
theme
|
|
251
|
-
}) => ({
|
|
252
|
-
display: "grid",
|
|
253
|
-
gridTemplateColumns: "auto",
|
|
254
|
-
gridGap: theme.spacing(1.75),
|
|
255
|
-
alignItems: "center",
|
|
256
|
-
width: "auto",
|
|
257
|
-
height: "auto",
|
|
258
|
-
[theme.breakpoints.up("sm")]: {
|
|
259
|
-
gridTemplateColumns: "repeat(3, auto)"
|
|
260
|
-
}
|
|
261
|
-
}));
|
|
262
|
-
const ModuleTitle = styled("div")(({
|
|
263
|
-
theme
|
|
264
|
-
}) => ({
|
|
265
|
-
display: "grid",
|
|
266
|
-
gridTemplateColumns: `${theme.spacing(3)} auto`,
|
|
267
|
-
gridGap: theme.spacing(2),
|
|
268
|
-
alignItems: "center",
|
|
269
|
-
width: "auto",
|
|
270
|
-
height: "auto"
|
|
271
|
-
}));
|
|
272
|
-
const Separator = styled("div")(({
|
|
273
|
-
theme
|
|
274
|
-
}) => ({
|
|
275
|
-
display: "none",
|
|
276
|
-
alignItems: "center",
|
|
277
|
-
width: "1px",
|
|
278
|
-
background: theme.palette.divider,
|
|
279
|
-
height: "100%",
|
|
280
|
-
margin: `0 ${theme.spacing(2)}`,
|
|
281
|
-
[theme.breakpoints.up("sm")]: {
|
|
282
|
-
display: "flex"
|
|
283
|
-
}
|
|
284
|
-
}));
|
|
285
|
-
const Breadcrumbs = styled("div")(({
|
|
286
|
-
theme
|
|
287
|
-
}) => ({
|
|
288
|
-
display: "grid",
|
|
289
|
-
alignItems: "center",
|
|
290
|
-
gridTemplateColumns: `repeat(3, auto)`,
|
|
291
|
-
gridGap: theme.spacing(2)
|
|
292
|
-
}));
|
|
293
|
-
const ModuleActions = styled("div")(({
|
|
294
|
-
theme
|
|
295
|
-
}) => ({
|
|
296
|
-
display: "grid",
|
|
297
|
-
gridTemplateColumns: "auto",
|
|
298
|
-
alignItems: "center",
|
|
299
|
-
width: "auto",
|
|
300
|
-
height: "auto",
|
|
301
|
-
[theme.breakpoints.up("sm")]: {
|
|
302
|
-
gridTemplateColumns: `repeat(3, ${theme.spacing(3)})`,
|
|
303
|
-
gridGap: theme.spacing(2)
|
|
304
|
-
}
|
|
305
|
-
}));
|
|
306
|
-
function SKTModuleHeader() {
|
|
307
|
-
const isDesktop = useResponsiveDesktop();
|
|
308
|
-
return /* @__PURE__ */ jsxs(Wrapper, {
|
|
309
|
-
id: "HeaderSkeleton",
|
|
310
|
-
children: [/* @__PURE__ */ jsxs(ModuleTitleContent, {
|
|
311
|
-
children: [/* @__PURE__ */ jsxs(ModuleTitle, {
|
|
312
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
313
|
-
variant: "circular",
|
|
314
|
-
width: 24,
|
|
315
|
-
height: 24
|
|
316
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
317
|
-
variant: "text",
|
|
318
|
-
width: 120,
|
|
319
|
-
height: 14
|
|
320
|
-
})]
|
|
321
|
-
}), /* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs(Breadcrumbs, {
|
|
322
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
323
|
-
variant: "text",
|
|
324
|
-
width: 68,
|
|
325
|
-
height: 14
|
|
326
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
327
|
-
variant: "circular",
|
|
328
|
-
width: 4,
|
|
329
|
-
height: 4
|
|
330
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
331
|
-
variant: "text",
|
|
332
|
-
width: 68,
|
|
333
|
-
height: 14
|
|
334
|
-
})]
|
|
335
|
-
})]
|
|
336
|
-
}), /* @__PURE__ */ jsx(ModuleActions, {
|
|
337
|
-
children: isDesktop ? /* @__PURE__ */ jsxs(Fragment, {
|
|
338
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
339
|
-
variant: "circular",
|
|
340
|
-
width: 24,
|
|
341
|
-
height: 24
|
|
342
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
343
|
-
variant: "circular",
|
|
344
|
-
width: 24,
|
|
345
|
-
height: 24
|
|
346
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
347
|
-
variant: "circular",
|
|
348
|
-
width: 24,
|
|
349
|
-
height: 24
|
|
350
|
-
})]
|
|
351
|
-
}) : /* @__PURE__ */ jsx(Skeleton, {
|
|
352
|
-
variant: "circular",
|
|
353
|
-
width: 24,
|
|
354
|
-
height: 24
|
|
355
|
-
})
|
|
356
|
-
})]
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
function getMenuActions(isDesktop, moduleActions) {
|
|
360
|
-
let menuActions = [...moduleActions.filter((action) => action.visibility !== "allways")];
|
|
361
|
-
if (isDesktop !== void 0 && isDesktop) {
|
|
362
|
-
menuActions = menuActions.filter((action) => action.visibility === "normal");
|
|
363
|
-
}
|
|
364
|
-
return menuActions;
|
|
365
|
-
}
|
|
366
|
-
function getMainActions(isDesktop, moduleActions) {
|
|
367
|
-
let mainActions = [];
|
|
368
|
-
if (isDesktop !== void 0 && isDesktop) {
|
|
369
|
-
mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "main"));
|
|
370
|
-
}
|
|
371
|
-
mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "allways"));
|
|
372
|
-
return mainActions;
|
|
373
|
-
}
|
|
374
|
-
function Header$1() {
|
|
375
|
-
const {
|
|
376
|
-
url_icon,
|
|
377
|
-
title,
|
|
378
|
-
moduleActions,
|
|
379
|
-
onClose,
|
|
380
|
-
container_id
|
|
381
|
-
} = useWindow();
|
|
382
|
-
const {
|
|
383
|
-
host_static_assets,
|
|
384
|
-
environment_assets
|
|
385
|
-
} = useEnvironment();
|
|
386
|
-
const isDesktop = useResponsiveDesktop();
|
|
387
|
-
const isSkeleton = useModuleSkeleton();
|
|
388
|
-
const menuActions = useMemo(() => getMenuActions(isDesktop, moduleActions), [moduleActions, isDesktop]);
|
|
389
|
-
const mainActions = useMemo(() => {
|
|
390
|
-
return getMainActions(isDesktop, moduleActions);
|
|
391
|
-
}, [moduleActions, isDesktop]);
|
|
392
|
-
const onCloseLocal = () => {
|
|
393
|
-
onClose && onClose(container_id);
|
|
394
|
-
};
|
|
395
|
-
if (isSkeleton) {
|
|
396
|
-
return /* @__PURE__ */ jsx(SKTModuleHeader, {});
|
|
397
|
-
}
|
|
398
|
-
return /* @__PURE__ */ jsxs(StyledHeader, {
|
|
399
|
-
id: "Header",
|
|
400
|
-
className: "m4l_draggable_handle",
|
|
401
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
402
|
-
src: url_icon,
|
|
403
|
-
bgColor: "primary.main",
|
|
404
|
-
size: "24px"
|
|
405
|
-
}), /* @__PURE__ */ jsx(Typography, {
|
|
406
|
-
variant: "h5",
|
|
407
|
-
sx: {
|
|
408
|
-
maxWidth: 260,
|
|
409
|
-
overflow: "hidden",
|
|
410
|
-
whiteSpace: "nowrap",
|
|
411
|
-
color: "text.primary",
|
|
412
|
-
marginLeft: "12px",
|
|
413
|
-
marginRight: "24px",
|
|
414
|
-
textOverflow: "ellipsis"
|
|
415
|
-
},
|
|
416
|
-
children: title
|
|
417
|
-
}), mainActions.map((mainAction, index) => {
|
|
418
|
-
if (!mainAction.component) {
|
|
419
|
-
return /* @__PURE__ */ jsx(IconButton, {
|
|
420
|
-
src: mainAction.urlIcon,
|
|
421
|
-
className: mainAction.className,
|
|
422
|
-
onClick: mainAction.onClick,
|
|
423
|
-
"aria-label": mainAction.label,
|
|
424
|
-
disabled: mainAction.disabled
|
|
425
|
-
}, `main_action_${index}`);
|
|
426
|
-
}
|
|
427
|
-
return /* @__PURE__ */ jsx(mainAction.component, {
|
|
428
|
-
description: mainAction.label,
|
|
429
|
-
onClick: mainAction.onClick
|
|
430
|
-
}, `main_action_${index}`);
|
|
431
|
-
}), menuActions.length > 0 && /* @__PURE__ */ jsx(MenuActions, {
|
|
432
|
-
arrowType: "right-top",
|
|
433
|
-
marginTop: "11px",
|
|
434
|
-
anchorOrigin: {
|
|
435
|
-
vertical: "top",
|
|
436
|
-
horizontal: "left"
|
|
437
|
-
},
|
|
438
|
-
transformOrigin: {
|
|
439
|
-
vertical: "top",
|
|
440
|
-
horizontal: "right"
|
|
441
|
-
},
|
|
442
|
-
menuActions
|
|
443
|
-
}), onClose && /* @__PURE__ */ jsx(IconButton, {
|
|
444
|
-
onClick: onCloseLocal,
|
|
445
|
-
"aria-label": "click",
|
|
446
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/window/assets/icons/close.svg`
|
|
447
|
-
})]
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
const WrapperLinearProgress = styled$1("div")(() => ({
|
|
451
|
-
width: "70%",
|
|
452
|
-
margin: "auto auto"
|
|
453
|
-
}));
|
|
454
|
-
const WrapperFallBackNotFound = styled$1("div")(({
|
|
455
|
-
theme
|
|
456
|
-
}) => ({
|
|
457
|
-
width: "100%",
|
|
458
|
-
height: "100%",
|
|
459
|
-
display: "flex",
|
|
460
|
-
flexDirection: "column",
|
|
461
|
-
justifyContent: "center",
|
|
462
|
-
alignItems: "center",
|
|
463
|
-
gap: theme.spacing(3)
|
|
464
|
-
}));
|
|
465
|
-
function FallBackNotFound(props) {
|
|
466
|
-
const {
|
|
467
|
-
setNetworkRefresh
|
|
468
|
-
} = props;
|
|
469
|
-
const {
|
|
470
|
-
getLabel
|
|
471
|
-
} = useModuleDictionary();
|
|
472
|
-
const {
|
|
473
|
-
host_static_assets,
|
|
474
|
-
environment_assets
|
|
475
|
-
} = useEnvironment();
|
|
476
|
-
const handlerClick = () => {
|
|
477
|
-
setNetworkRefresh((prop) => !prop);
|
|
478
|
-
};
|
|
479
|
-
return /* @__PURE__ */ jsxs(WrapperFallBackNotFound, {
|
|
480
|
-
children: [/* @__PURE__ */ jsx(m.div, {
|
|
481
|
-
variants: varBounce().in,
|
|
482
|
-
children: /* @__PURE__ */ jsx(Typography, {
|
|
483
|
-
variant: "h3",
|
|
484
|
-
paragraph: true,
|
|
485
|
-
children: getLabel("loading_mf_title")
|
|
486
|
-
})
|
|
487
|
-
}), /* @__PURE__ */ jsx(Typography, {
|
|
488
|
-
sx: {
|
|
489
|
-
color: "text.secondary"
|
|
490
|
-
},
|
|
491
|
-
children: getLabel("loading_mf_description")
|
|
492
|
-
}), /* @__PURE__ */ jsx(m.div, {
|
|
493
|
-
variants: varBounce().in,
|
|
494
|
-
children: /* @__PURE__ */ jsx(Image, {
|
|
495
|
-
src: `${host_static_assets}/${environment_assets}/frontend/domain/host/commons/assets/img/illustration_noauth.png`,
|
|
496
|
-
width: "292px",
|
|
497
|
-
height: "219px"
|
|
498
|
-
})
|
|
499
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
500
|
-
size: "large",
|
|
501
|
-
variant: "contained",
|
|
502
|
-
onClick: handlerClick,
|
|
503
|
-
children: getLabel("loading_mf_intro")
|
|
504
|
-
})]
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
const LoadingMF = (props) => {
|
|
508
|
-
const {
|
|
509
|
-
loadingProgress,
|
|
510
|
-
setNetworkRefresh
|
|
511
|
-
} = props;
|
|
512
|
-
if (loadingProgress !== -1) {
|
|
513
|
-
return /* @__PURE__ */ jsx(WrapperLinearProgress, {
|
|
514
|
-
id: "WrapperLinearProgress",
|
|
515
|
-
children: /* @__PURE__ */ jsx(LinearProgress, {
|
|
516
|
-
variant: "determinate",
|
|
517
|
-
value: loadingProgress
|
|
518
|
-
})
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
return /* @__PURE__ */ jsx(FallBackNotFound, {
|
|
522
|
-
setNetworkRefresh
|
|
523
|
-
});
|
|
524
|
-
};
|
|
525
|
-
function getDivScritId(prefix, moduleId) {
|
|
526
|
-
const rotational_id = `${Math.round(new Date().getTime() / 1e3)}_rnd_${Math.round(Math.random() * 1e3)}`;
|
|
527
|
-
return {
|
|
528
|
-
divContainerId: `container_${prefix}_${moduleId}_${rotational_id}`,
|
|
529
|
-
scriptId: `script_${moduleId}_${rotational_id}`,
|
|
530
|
-
moduleId
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
function MFLoader(props) {
|
|
534
|
-
const {
|
|
535
|
-
prefix,
|
|
536
|
-
module_id,
|
|
537
|
-
cache = true,
|
|
538
|
-
debug_port,
|
|
539
|
-
dynamicParams
|
|
540
|
-
} = props;
|
|
541
|
-
const {
|
|
542
|
-
hostThemeOptions,
|
|
543
|
-
fnComponentsOverrides
|
|
544
|
-
} = useHostTheme();
|
|
545
|
-
const {
|
|
546
|
-
networkOperation
|
|
547
|
-
} = useNetwork();
|
|
548
|
-
const environment = useEnvironment();
|
|
549
|
-
const hostTools = useHostTools();
|
|
550
|
-
const formatter = useFormatter();
|
|
551
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
552
|
-
const [networkProgress, setNetworkProgress] = useState(-1);
|
|
553
|
-
const [_networkRefresh, setNetworkRefresh] = useState(false);
|
|
554
|
-
const {
|
|
555
|
-
currentLocale
|
|
556
|
-
} = useLocales();
|
|
557
|
-
const [divScript, setDivScript] = useState(getDivScritId(prefix, module_id));
|
|
558
|
-
const refTime = useRef(0);
|
|
559
|
-
const isFirstRender = useFirstRender([module_id]);
|
|
560
|
-
const final_host = environment.isLocalhost ? `https://localhost:${debug_port}` : `https://${window.location.host}/mf/${module_id}`;
|
|
561
|
-
function cleanUp(dScript) {
|
|
562
|
-
try {
|
|
563
|
-
if (window[`unmount_${prefix}_${dScript.moduleId}`]) {
|
|
564
|
-
window[`unmount_${prefix}_${dScript.moduleId}`](dScript.divContainerId);
|
|
565
|
-
}
|
|
566
|
-
} catch (error) {
|
|
567
|
-
}
|
|
568
|
-
if (!cache) {
|
|
569
|
-
const script = document.getElementById(dScript.scriptId);
|
|
570
|
-
if (script) {
|
|
571
|
-
try {
|
|
572
|
-
document.head.removeChild(script);
|
|
573
|
-
delete window[`render_${prefix}_${dScript.moduleId}`];
|
|
574
|
-
delete window[`unmount_${prefix}_${dScript.moduleId}`];
|
|
575
|
-
} catch (error) {
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
const renderMicroFrontend = useCallback((newDScript) => {
|
|
581
|
-
try {
|
|
582
|
-
setIsLoading(false);
|
|
583
|
-
window[`render_${prefix}_${newDScript.moduleId}`](newDScript.divContainerId, environment, hostTools, currentLocale, {
|
|
584
|
-
hostThemeOptions,
|
|
585
|
-
fnComponentsOverrides
|
|
586
|
-
}, axiosOperation, formatter, {
|
|
587
|
-
version: 1,
|
|
588
|
-
...dynamicParams ? dynamicParams : {}
|
|
589
|
-
});
|
|
590
|
-
} catch (error) {
|
|
591
|
-
}
|
|
592
|
-
}, [hostThemeOptions, currentLocale, formatter, dynamicParams]);
|
|
593
|
-
const debouncedSetDivScript = useCallback(debounce((newName) => {
|
|
594
|
-
const newDivScript = getDivScritId(prefix, newName);
|
|
595
|
-
if (newName !== divScript.moduleId) {
|
|
596
|
-
setDivScript({
|
|
597
|
-
...newDivScript
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
}, 200), [divScript]);
|
|
601
|
-
useEffect(() => {
|
|
602
|
-
if (!isFirstRender) {
|
|
603
|
-
debouncedSetDivScript(module_id + "");
|
|
604
|
-
if (module_id !== divScript.moduleId)
|
|
605
|
-
;
|
|
606
|
-
}
|
|
607
|
-
return () => {
|
|
608
|
-
};
|
|
609
|
-
}, [module_id]);
|
|
610
|
-
useEffect(() => {
|
|
611
|
-
setIsLoading(true);
|
|
612
|
-
let mounted = true;
|
|
613
|
-
const controller = new AbortController();
|
|
614
|
-
const dsScript = {
|
|
615
|
-
...divScript
|
|
616
|
-
};
|
|
617
|
-
const loadIfNotLoaded = async () => {
|
|
618
|
-
if (!window[`render_${prefix}_${module_id}`]) {
|
|
619
|
-
let urlFile = "";
|
|
620
|
-
setNetworkProgress(0);
|
|
621
|
-
const manifest = await fetch(`${final_host}/manifest.json?rnd=${Math.random()}`).then((res) => res.json()).catch(() => {
|
|
622
|
-
console.debug("Error fetching manifest", `${final_host}/manifest.json`);
|
|
623
|
-
return void 0;
|
|
624
|
-
});
|
|
625
|
-
if (!manifest) {
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
setNetworkProgress(10);
|
|
629
|
-
if (mounted) {
|
|
630
|
-
urlFile = `${final_host}/${manifest["src/index.tsx"]["file"]}?rnd=${Math.random()}`;
|
|
631
|
-
refTime.current = 0;
|
|
632
|
-
await networkOperation({
|
|
633
|
-
method: "GET",
|
|
634
|
-
endPoint: urlFile,
|
|
635
|
-
isRemote: !environment.isLocalhost,
|
|
636
|
-
headers: {
|
|
637
|
-
"Content-Type": "application/json"
|
|
638
|
-
},
|
|
639
|
-
onDownloadProgress: (progressEvent) => {
|
|
640
|
-
let percentCompleted = 0;
|
|
641
|
-
try {
|
|
642
|
-
if (progressEvent.lengthComputable) {
|
|
643
|
-
percentCompleted = 10 + Math.round(progressEvent.loaded * 90 / progressEvent.total);
|
|
644
|
-
} else {
|
|
645
|
-
if (refTime.current === 0) {
|
|
646
|
-
refTime.current = new Date().getTime();
|
|
647
|
-
}
|
|
648
|
-
percentCompleted = 10 + progressEvent.loaded / 15e5 * 90;
|
|
649
|
-
if (percentCompleted > 95)
|
|
650
|
-
percentCompleted = 95;
|
|
651
|
-
}
|
|
652
|
-
} catch (error) {
|
|
653
|
-
}
|
|
654
|
-
if (mounted) {
|
|
655
|
-
setNetworkProgress(percentCompleted);
|
|
656
|
-
}
|
|
657
|
-
},
|
|
658
|
-
isExternalUrl: true,
|
|
659
|
-
responseType: "text",
|
|
660
|
-
signal: controller.signal
|
|
661
|
-
}).then(() => {
|
|
662
|
-
if (mounted) {
|
|
663
|
-
setNetworkProgress(100);
|
|
664
|
-
}
|
|
665
|
-
}).catch(() => {
|
|
666
|
-
});
|
|
667
|
-
if (mounted) {
|
|
668
|
-
const script = document.createElement("script");
|
|
669
|
-
script.id = divScript.scriptId;
|
|
670
|
-
script.crossOrigin = "";
|
|
671
|
-
script.type = "module";
|
|
672
|
-
script.src = urlFile || "";
|
|
673
|
-
script.onload = () => {
|
|
674
|
-
if (mounted) {
|
|
675
|
-
console.debug("Script loaded", new Date().getTime());
|
|
676
|
-
setNetworkProgress(100);
|
|
677
|
-
renderMicroFrontend(dsScript);
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
|
-
document.head.appendChild(script);
|
|
681
|
-
console.debug("Script appened", new Date().getTime());
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
} else {
|
|
685
|
-
if (mounted) {
|
|
686
|
-
renderMicroFrontend(dsScript);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
};
|
|
690
|
-
loadIfNotLoaded();
|
|
691
|
-
return () => {
|
|
692
|
-
mounted = false;
|
|
693
|
-
controller.abort();
|
|
694
|
-
cleanUp(dsScript);
|
|
695
|
-
};
|
|
696
|
-
}, [divScript]);
|
|
697
|
-
console.log("Render micro frontend", divScript.divContainerId, final_host);
|
|
698
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
699
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
700
|
-
id: divScript.divContainerId
|
|
701
|
-
}), isLoading ? /* @__PURE__ */ jsx(LoadingMF, {
|
|
702
|
-
loadingProgress: networkProgress,
|
|
703
|
-
setNetworkRefresh
|
|
704
|
-
}) : null]
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
|
-
MFLoader.defaultProps = {
|
|
708
|
-
document,
|
|
709
|
-
window
|
|
710
|
-
};
|
|
711
|
-
const MicroFrontend = (props) => {
|
|
712
|
-
const {
|
|
713
|
-
setModuleActions
|
|
714
|
-
} = useWindow();
|
|
715
|
-
return /* @__PURE__ */ jsx(MFLoader, {
|
|
716
|
-
...props,
|
|
717
|
-
dynamicParams: {
|
|
718
|
-
...props.dynamicParams,
|
|
719
|
-
setModuleActions
|
|
720
|
-
}
|
|
721
|
-
});
|
|
722
|
-
};
|
|
723
|
-
React__default.memo(MicroFrontend);
|
|
724
|
-
const Window = (props) => {
|
|
725
|
-
return /* @__PURE__ */ jsx(WrapperWindow, {
|
|
726
|
-
children: /* @__PURE__ */ jsxs(WindowProvider, {
|
|
727
|
-
initialExternalActions: [],
|
|
728
|
-
...props,
|
|
729
|
-
children: [/* @__PURE__ */ jsx(Header$1, {}), /* @__PURE__ */ jsx(WrapperContent, {
|
|
730
|
-
children: props.winType === "microfrontend" ? /* @__PURE__ */ jsx(MicroFrontend, {
|
|
731
|
-
...props.mfProps
|
|
732
|
-
}) : /* @__PURE__ */ jsx(Component, {
|
|
733
|
-
children: props.component
|
|
734
|
-
})
|
|
735
|
-
})]
|
|
736
|
-
})
|
|
737
|
-
});
|
|
738
|
-
};
|
|
739
|
-
const MemonizedWindow = React__default.memo(Window);
|
|
740
|
-
const LABEL_NEW_AREA = "label_new_area";
|
|
741
|
-
const AreasContext = createContext(null);
|
|
742
|
-
function AreasProvider(props) {
|
|
743
|
-
const {
|
|
744
|
-
children,
|
|
745
|
-
activeAreasNetwork,
|
|
746
|
-
onLoad
|
|
747
|
-
} = props;
|
|
748
|
-
const [areas, setAreas] = useState([]);
|
|
749
|
-
const {
|
|
750
|
-
events_add_listener,
|
|
751
|
-
events_remove_listener
|
|
752
|
-
} = useHostTools();
|
|
753
|
-
const {
|
|
754
|
-
getLabel
|
|
755
|
-
} = useModuleDictionary();
|
|
756
|
-
const [status, setStatus] = useState("init");
|
|
757
|
-
const {
|
|
758
|
-
networkOperation
|
|
759
|
-
} = useNetwork();
|
|
760
|
-
const [currentArea, setCurrentArea] = useState(areas.length > 0 ? areas[0].id : "");
|
|
761
|
-
const currentAreaRef = useRef(areas.length > 0 ? areas[0].id : "");
|
|
762
|
-
const areaRefs = useRef({});
|
|
763
|
-
const addWindow = useCallback((newWindow) => {
|
|
764
|
-
let current;
|
|
765
|
-
console.log("addWindow raw");
|
|
766
|
-
if (areaRefs.current && areaRefs.current[currentAreaRef.current]) {
|
|
767
|
-
current = areaRefs.current[currentAreaRef.current];
|
|
768
|
-
}
|
|
769
|
-
if (current && current.addWindow) {
|
|
770
|
-
current.addWindow(newWindow);
|
|
771
|
-
}
|
|
772
|
-
}, []);
|
|
773
|
-
const addArea = useCallback(() => {
|
|
774
|
-
const newId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
775
|
-
const newName = `${getLabel(LABEL_NEW_AREA)} ${areas.length + 1}`;
|
|
776
|
-
setAreas((lastAreas) => [...lastAreas, {
|
|
777
|
-
id: newId,
|
|
778
|
-
url_icon: "",
|
|
779
|
-
name: newName,
|
|
780
|
-
loadWindows: false
|
|
781
|
-
}]);
|
|
782
|
-
selectArea(newId);
|
|
783
|
-
if (activeAreasNetwork) {
|
|
784
|
-
networkOperation({
|
|
785
|
-
method: "POST",
|
|
786
|
-
endPoint: `areas`,
|
|
787
|
-
data: {
|
|
788
|
-
id: newId,
|
|
789
|
-
name: newName
|
|
790
|
-
},
|
|
791
|
-
toastSuccess: false,
|
|
792
|
-
toastError: false
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
|
-
return newId;
|
|
796
|
-
}, [getLabel]);
|
|
797
|
-
useEffect(() => {
|
|
798
|
-
events_add_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
|
|
799
|
-
console.log("useEffect AreasProvider Emmiter");
|
|
800
|
-
return () => {
|
|
801
|
-
events_remove_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
|
|
802
|
-
};
|
|
803
|
-
}, []);
|
|
804
|
-
useEffect(() => {
|
|
805
|
-
let mounted = true;
|
|
806
|
-
if (status === "init") {
|
|
807
|
-
if (activeAreasNetwork) {
|
|
808
|
-
setStatus("loading");
|
|
809
|
-
networkOperation({
|
|
810
|
-
method: "GET",
|
|
811
|
-
endPoint: `areas`,
|
|
812
|
-
parms: {},
|
|
813
|
-
toastSuccess: false
|
|
814
|
-
}).then((response) => {
|
|
815
|
-
if (mounted) {
|
|
816
|
-
if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
|
|
817
|
-
setAreas(response.data);
|
|
818
|
-
selectArea(response.data[0].id);
|
|
819
|
-
} else {
|
|
820
|
-
addArea();
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
}).finally(() => {
|
|
824
|
-
setStatus("loaded");
|
|
825
|
-
});
|
|
826
|
-
} else {
|
|
827
|
-
addArea();
|
|
828
|
-
setStatus("loaded");
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
console.log("useEffect AreasProvider");
|
|
832
|
-
return () => {
|
|
833
|
-
console.log("useEffect cluanUp AreasProvider *** no deber\xEDa darse");
|
|
834
|
-
mounted = false;
|
|
835
|
-
};
|
|
836
|
-
}, []);
|
|
837
|
-
useEffect(() => {
|
|
838
|
-
if (status === "loaded") {
|
|
839
|
-
console.log("useEffect Areas loaded");
|
|
840
|
-
onLoad && onLoad();
|
|
841
|
-
}
|
|
842
|
-
}, [status]);
|
|
843
|
-
const selectArea = (newId) => {
|
|
844
|
-
currentAreaRef.current = newId;
|
|
845
|
-
setCurrentArea(newId);
|
|
846
|
-
};
|
|
847
|
-
const deleteArea = (areaId) => {
|
|
848
|
-
let newAreas = [];
|
|
849
|
-
setAreas((lastAreas) => {
|
|
850
|
-
newAreas = [...lastAreas];
|
|
851
|
-
newAreas = lastAreas.filter((area) => area.id !== areaId);
|
|
852
|
-
return newAreas;
|
|
853
|
-
});
|
|
854
|
-
if (currentAreaRef.current === areaId) {
|
|
855
|
-
if (newAreas.length > 0) {
|
|
856
|
-
selectArea(newAreas[0].id);
|
|
857
|
-
} else {
|
|
858
|
-
selectArea("");
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
if (activeAreasNetwork) {
|
|
862
|
-
networkOperation({
|
|
863
|
-
method: "DELETE",
|
|
864
|
-
endPoint: `areas/${areaId}`,
|
|
865
|
-
parms: {},
|
|
866
|
-
toastSuccess: false,
|
|
867
|
-
toastError: false
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
};
|
|
871
|
-
const setAreaRef = (areaId, ref) => {
|
|
872
|
-
console.log("setAreaRef", areaRefs.current[areaId] === ref, areaRefs.current[areaId]?.addWindow === ref?.addWindow, JSON.stringify(areaRefs.current[areaId]) === JSON.stringify(ref), areaRefs.current[areaId], ref);
|
|
873
|
-
if (areaRefs.current[areaId] !== ref) {
|
|
874
|
-
areaRefs.current[areaId] = ref;
|
|
875
|
-
}
|
|
876
|
-
};
|
|
877
|
-
return /* @__PURE__ */ jsx(AreasContext.Provider, {
|
|
878
|
-
value: {
|
|
879
|
-
status,
|
|
880
|
-
activeAreasNetwork,
|
|
881
|
-
areas,
|
|
882
|
-
currentArea,
|
|
883
|
-
addArea,
|
|
884
|
-
deleteArea,
|
|
885
|
-
selectArea,
|
|
886
|
-
setAreaRef
|
|
887
|
-
},
|
|
888
|
-
children
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
function useAreas() {
|
|
892
|
-
const context = useContext(AreasContext);
|
|
893
|
-
if (!context)
|
|
894
|
-
throw new Error("useAreas context must be use inside AreasContext");
|
|
895
|
-
return context;
|
|
896
|
-
}
|
|
897
|
-
const AreaContext = createContext(null);
|
|
898
|
-
const getParmsFromValue = (key, data) => {
|
|
899
|
-
try {
|
|
900
|
-
if (Array.isArray(data)) {
|
|
901
|
-
let ob = data.find((f) => f.id === key);
|
|
902
|
-
if (ob) {
|
|
903
|
-
ob = JSON.parse(ob.value);
|
|
904
|
-
}
|
|
905
|
-
return ob;
|
|
906
|
-
}
|
|
907
|
-
} catch (error) {
|
|
908
|
-
}
|
|
909
|
-
return void 0;
|
|
910
|
-
};
|
|
911
|
-
const AreaProvider = forwardRef((props, ref) => {
|
|
912
|
-
const {
|
|
913
|
-
children,
|
|
914
|
-
id,
|
|
915
|
-
active
|
|
916
|
-
} = props;
|
|
917
|
-
const {
|
|
918
|
-
networkOperation
|
|
919
|
-
} = useNetwork();
|
|
920
|
-
const [status, setStatus] = useState("init");
|
|
921
|
-
const [layouts, setLayouts] = useState([]);
|
|
922
|
-
const [allLayouts, setAllLayouts] = useState({});
|
|
923
|
-
const [hashWindowsLayouts, setHashhWindowsLayouts] = useState({});
|
|
924
|
-
const windowsLayoutsBack = useRef({});
|
|
925
|
-
const [windowsPopUps, setWindowsPopUps] = useState([]);
|
|
926
|
-
const [, setSelectedWindow] = useState("");
|
|
927
|
-
const {
|
|
928
|
-
openModal,
|
|
929
|
-
closeModal
|
|
930
|
-
} = useModal();
|
|
931
|
-
const {
|
|
932
|
-
activeAreasNetwork
|
|
933
|
-
} = useAreas();
|
|
934
|
-
useImperativeHandle(ref, () => ({
|
|
935
|
-
addWindow
|
|
936
|
-
}), []);
|
|
937
|
-
const WindowPopUpZindex = useRef(999);
|
|
938
|
-
const getWindowPopUpZindex = useCallback(() => {
|
|
939
|
-
WindowPopUpZindex.current++;
|
|
940
|
-
return WindowPopUpZindex.current;
|
|
941
|
-
}, []);
|
|
942
|
-
useEffect(() => {
|
|
943
|
-
console.log("useEffect AreaProvider");
|
|
944
|
-
return () => {
|
|
945
|
-
console.log("useEffect cluanUp AreaProvider****");
|
|
946
|
-
};
|
|
947
|
-
}, []);
|
|
948
|
-
useEffect(() => {
|
|
949
|
-
if (active && status === "init") {
|
|
950
|
-
setStatus("load");
|
|
951
|
-
}
|
|
952
|
-
}, [active]);
|
|
953
|
-
console.log("Rendeer AreaProvider status", status, activeAreasNetwork);
|
|
954
|
-
useEffect(() => {
|
|
955
|
-
let mounted = true;
|
|
956
|
-
if (status === "load") {
|
|
957
|
-
if (activeAreasNetwork) {
|
|
958
|
-
console.log("useEffect Load Cargarcokies");
|
|
959
|
-
networkOperation({
|
|
960
|
-
method: "GET",
|
|
961
|
-
endPoint: `cookies`,
|
|
962
|
-
parms: {
|
|
963
|
-
f: [{
|
|
964
|
-
n: "container_id",
|
|
965
|
-
o: "c",
|
|
966
|
-
o1: id
|
|
967
|
-
}]
|
|
968
|
-
},
|
|
969
|
-
toastSuccess: false,
|
|
970
|
-
toastError: false
|
|
971
|
-
}).then((_response) => {
|
|
972
|
-
if (mounted) {
|
|
973
|
-
const layoutParms = getParmsFromValue("layout_parms", _response.data);
|
|
974
|
-
const windows = getParmsFromValue("windows", _response.data);
|
|
975
|
-
if (layoutParms) {
|
|
976
|
-
setAllLayouts(layoutParms);
|
|
977
|
-
}
|
|
978
|
-
if (windows) {
|
|
979
|
-
const newLayouts = [];
|
|
980
|
-
const newHashLayouts = {};
|
|
981
|
-
for (const key in windows) {
|
|
982
|
-
const element = windows[key];
|
|
983
|
-
if (element && element["layoutProps"] && element["mfProps"] && element["emergeType"] === "layout" && element["winType"] === "microfrontend") {
|
|
984
|
-
element["layoutProps"].i = key;
|
|
985
|
-
newLayouts.push(element["layoutProps"]);
|
|
986
|
-
newHashLayouts[key] = {
|
|
987
|
-
...element,
|
|
988
|
-
container_id: key,
|
|
989
|
-
emergeType: "layout",
|
|
990
|
-
onClose: onCloseWindowLayout
|
|
991
|
-
};
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
console.log("GET cookies", layoutParms, newHashLayouts);
|
|
995
|
-
setLayouts(newLayouts);
|
|
996
|
-
setHashhWindowsLayouts(newHashLayouts);
|
|
997
|
-
}
|
|
998
|
-
setStatus("loaded");
|
|
999
|
-
}
|
|
1000
|
-
}).catch((_response) => {
|
|
1001
|
-
setStatus("loaded");
|
|
1002
|
-
});
|
|
1003
|
-
} else {
|
|
1004
|
-
setStatus("loaded");
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return () => {
|
|
1008
|
-
mounted = false;
|
|
1009
|
-
};
|
|
1010
|
-
}, [status]);
|
|
1011
|
-
useEffect(() => {
|
|
1012
|
-
console.log("useEffect SaveWindow", status, hashWindowsLayouts);
|
|
1013
|
-
if (status === "loaded") {
|
|
1014
|
-
let nrKeys = 0;
|
|
1015
|
-
const saveObjetc = {};
|
|
1016
|
-
for (const key in hashWindowsLayouts) {
|
|
1017
|
-
const element = hashWindowsLayouts[key];
|
|
1018
|
-
const newElement = {
|
|
1019
|
-
...element
|
|
1020
|
-
};
|
|
1021
|
-
delete newElement.onClose;
|
|
1022
|
-
if (element.winType === "microfrontend") {
|
|
1023
|
-
saveObjetc[key] = newElement;
|
|
1024
|
-
nrKeys++;
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
console.log("saveWindows", nrKeys, saveObjetc, JSON.stringify(saveObjetc));
|
|
1028
|
-
if (activeAreasNetwork && nrKeys > 0) {
|
|
1029
|
-
networkOperation({
|
|
1030
|
-
method: "PUT",
|
|
1031
|
-
endPoint: `cookies/windows/${id}/nomodule`,
|
|
1032
|
-
data: {
|
|
1033
|
-
value: JSON.stringify(saveObjetc)
|
|
1034
|
-
},
|
|
1035
|
-
toastSuccess: false,
|
|
1036
|
-
toastError: false
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
}, [hashWindowsLayouts]);
|
|
1041
|
-
const debouncedLayoutChange = useCallback(debounce((currentLayouts, newAllLayouts) => {
|
|
1042
|
-
currentLayouts.forEach((layout) => {
|
|
1043
|
-
const {
|
|
1044
|
-
i
|
|
1045
|
-
} = layout;
|
|
1046
|
-
if (i === "none")
|
|
1047
|
-
return;
|
|
1048
|
-
if (isEqual(layout, windowsLayoutsBack.current[i]))
|
|
1049
|
-
return;
|
|
1050
|
-
});
|
|
1051
|
-
setAllLayouts(newAllLayouts);
|
|
1052
|
-
if (activeAreasNetwork) {
|
|
1053
|
-
networkOperation({
|
|
1054
|
-
method: "PUT",
|
|
1055
|
-
endPoint: `cookies/layout_parms/${id}/nomodule`,
|
|
1056
|
-
data: {
|
|
1057
|
-
value: JSON.stringify(newAllLayouts)
|
|
1058
|
-
},
|
|
1059
|
-
toastSuccess: false,
|
|
1060
|
-
toastError: false
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
}, 2e3), [layouts]);
|
|
1064
|
-
const onLayoutChange = useCallback((currentLayouts, newAllLayouts) => {
|
|
1065
|
-
debouncedLayoutChange(currentLayouts, newAllLayouts);
|
|
1066
|
-
}, [debouncedLayoutChange]);
|
|
1067
|
-
const onCloseWindowLayout = useCallback((removeLayoutId) => {
|
|
1068
|
-
setHashhWindowsLayouts((lastHashhWL) => {
|
|
1069
|
-
const newLayouts = {
|
|
1070
|
-
...lastHashhWL
|
|
1071
|
-
};
|
|
1072
|
-
delete newLayouts[removeLayoutId];
|
|
1073
|
-
return newLayouts;
|
|
1074
|
-
});
|
|
1075
|
-
delete windowsLayoutsBack.current[removeLayoutId];
|
|
1076
|
-
}, []);
|
|
1077
|
-
const onCloseWindowPopUp = useCallback((removePopUpId) => {
|
|
1078
|
-
setWindowsPopUps((lastPopUpsMfs) => {
|
|
1079
|
-
const newPopUps = [...lastPopUpsMfs];
|
|
1080
|
-
return newPopUps.filter((p) => p.container_id !== removePopUpId);
|
|
1081
|
-
});
|
|
1082
|
-
}, []);
|
|
1083
|
-
const onCloseWindowModal = useCallback((_removePopUpId) => {
|
|
1084
|
-
closeModal();
|
|
1085
|
-
}, []);
|
|
1086
|
-
const addWindowPopUp = useCallback((container_id, newWindowPopupProps) => {
|
|
1087
|
-
setWindowsPopUps((lastPopUpsMfs) => {
|
|
1088
|
-
return [{
|
|
1089
|
-
...newWindowPopupProps,
|
|
1090
|
-
emergeType: "popup",
|
|
1091
|
-
container_id,
|
|
1092
|
-
onClose: onCloseWindowPopUp
|
|
1093
|
-
}, ...lastPopUpsMfs];
|
|
1094
|
-
});
|
|
1095
|
-
}, []);
|
|
1096
|
-
const addWindowModal = useCallback((container_id, newWindowProps) => {
|
|
1097
|
-
openModal({
|
|
1098
|
-
window: /* @__PURE__ */ jsx(Window, {
|
|
1099
|
-
...newWindowProps,
|
|
1100
|
-
container_id,
|
|
1101
|
-
onClose: onCloseWindowModal
|
|
1102
|
-
})
|
|
1103
|
-
});
|
|
1104
|
-
}, []);
|
|
1105
|
-
const addWindowLayout = useCallback((container_id, newWindow) => {
|
|
1106
|
-
const newLayout = {
|
|
1107
|
-
...newWindow.layoutProps,
|
|
1108
|
-
i: container_id,
|
|
1109
|
-
isDraggable: true,
|
|
1110
|
-
isResizable: true,
|
|
1111
|
-
winType: newWindow.winType
|
|
1112
|
-
};
|
|
1113
|
-
setLayouts((lastLayout) => [...lastLayout, newLayout]);
|
|
1114
|
-
setHashhWindowsLayouts((lastHashWindowsLayouts) => {
|
|
1115
|
-
return {
|
|
1116
|
-
...lastHashWindowsLayouts,
|
|
1117
|
-
[container_id]: {
|
|
1118
|
-
...newWindow,
|
|
1119
|
-
container_id,
|
|
1120
|
-
emergeType: "layout",
|
|
1121
|
-
onClose: onCloseWindowLayout
|
|
1122
|
-
}
|
|
1123
|
-
};
|
|
1124
|
-
});
|
|
1125
|
-
windowsLayoutsBack.current[container_id] = {
|
|
1126
|
-
...newLayout
|
|
1127
|
-
};
|
|
1128
|
-
}, []);
|
|
1129
|
-
const addWindow = useCallback((newWindow) => {
|
|
1130
|
-
const newId = `${id}_window_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
1131
|
-
console.log("addWindow", newWindow.winType, newWindow.emergeType, newId);
|
|
1132
|
-
if (newWindow.emergeType === "layout") {
|
|
1133
|
-
addWindowLayout(newId, newWindow);
|
|
1134
|
-
} else if (newWindow.emergeType === "popup") {
|
|
1135
|
-
addWindowPopUp(newId, newWindow);
|
|
1136
|
-
} else if (newWindow.emergeType === "modal") {
|
|
1137
|
-
addWindowModal(newId, newWindow);
|
|
1138
|
-
}
|
|
1139
|
-
return newId;
|
|
1140
|
-
}, []);
|
|
1141
|
-
const isWindowSelected = useCallback((lookForThisId) => {
|
|
1142
|
-
if (windowsPopUps.findIndex((wp) => wp.container_id === lookForThisId) > -1) {
|
|
1143
|
-
return true;
|
|
1144
|
-
}
|
|
1145
|
-
return false;
|
|
1146
|
-
}, [hashWindowsLayouts, windowsPopUps]);
|
|
1147
|
-
const selectWindow = useCallback((newSeletectedId) => {
|
|
1148
|
-
setSelectedWindow(newSeletectedId);
|
|
1149
|
-
}, []);
|
|
1150
|
-
return /* @__PURE__ */ jsx(AreaContext.Provider, {
|
|
1151
|
-
value: {
|
|
1152
|
-
id,
|
|
1153
|
-
status,
|
|
1154
|
-
isWindowSelected,
|
|
1155
|
-
selectWindow,
|
|
1156
|
-
getWindowPopUpZindex,
|
|
1157
|
-
allLayouts,
|
|
1158
|
-
layouts,
|
|
1159
|
-
hashWindowsLayouts,
|
|
1160
|
-
addWindow,
|
|
1161
|
-
onCloseWindowLayout,
|
|
1162
|
-
onLayoutChange,
|
|
1163
|
-
windowsPopUps,
|
|
1164
|
-
onCloseWindowPopUp
|
|
1165
|
-
},
|
|
1166
|
-
children
|
|
1167
|
-
});
|
|
1168
|
-
});
|
|
1169
|
-
AreaProvider.displayName = "AreaProvider";
|
|
1170
|
-
React__default.memo(AreaProvider);
|
|
1171
|
-
const useArea = () => {
|
|
1172
|
-
const context = useContext(AreaContext);
|
|
1173
|
-
if (!context)
|
|
1174
|
-
throw new Error("useArea context must be use inside AreaContext");
|
|
1175
|
-
return context;
|
|
1176
|
-
};
|
|
1177
|
-
const WrapperPoups = styled("div")(() => ({
|
|
1178
|
-
zIndex: 1,
|
|
1179
|
-
" .react-draggable": {
|
|
1180
|
-
position: "absolute"
|
|
1181
|
-
}
|
|
1182
|
-
}));
|
|
1183
|
-
const WrapperPopUpWindow = styled("div")(() => ({
|
|
1184
|
-
height: "100%",
|
|
1185
|
-
"&.m4l_selected": {
|
|
1186
|
-
borderTop: "1px solid green"
|
|
1187
|
-
}
|
|
1188
|
-
}));
|
|
1189
|
-
const WindowPopUp = (props) => {
|
|
1190
|
-
const {
|
|
1191
|
-
zIndex,
|
|
1192
|
-
windowProps: rect
|
|
1193
|
-
} = props;
|
|
1194
|
-
const {
|
|
1195
|
-
isWindowSelected,
|
|
1196
|
-
selectWindow,
|
|
1197
|
-
getWindowPopUpZindex
|
|
1198
|
-
} = useArea();
|
|
1199
|
-
const [currentZIndex, setZindex] = useState(zIndex || getWindowPopUpZindex());
|
|
1200
|
-
const isSelected = isWindowSelected(props.container_id);
|
|
1201
|
-
const onTouch = () => {
|
|
1202
|
-
if (!isSelected) {
|
|
1203
|
-
selectWindow(props.container_id);
|
|
1204
|
-
setZindex(getWindowPopUpZindex());
|
|
1205
|
-
}
|
|
1206
|
-
};
|
|
1207
|
-
return /* @__PURE__ */ jsx(DraggableWindow, {
|
|
1208
|
-
handle: ".m4l_draggable_handle",
|
|
1209
|
-
cancel: "",
|
|
1210
|
-
defaultPosition: rect,
|
|
1211
|
-
children: /* @__PURE__ */ jsx(ResizeableWindow, {
|
|
1212
|
-
width: rect.width,
|
|
1213
|
-
height: rect.height,
|
|
1214
|
-
style: {
|
|
1215
|
-
zIndex: currentZIndex,
|
|
1216
|
-
position: "absolute"
|
|
1217
|
-
},
|
|
1218
|
-
className: isSelected ? "m4l_selected" : "",
|
|
1219
|
-
onResizeStart: () => {
|
|
1220
|
-
onTouch();
|
|
1221
|
-
},
|
|
1222
|
-
children: /* @__PURE__ */ jsx(WrapperPopUpWindow, {
|
|
1223
|
-
onMouseDown: onTouch,
|
|
1224
|
-
children: /* @__PURE__ */ jsx(Window, {
|
|
1225
|
-
...props
|
|
1226
|
-
})
|
|
1227
|
-
})
|
|
1228
|
-
})
|
|
1229
|
-
});
|
|
1230
|
-
};
|
|
1231
|
-
const ResponsiveGridLayout = reactGridLayout.exports.WidthProvider(reactGridLayout.exports.Responsive);
|
|
1232
|
-
const GridLayout = () => {
|
|
1233
|
-
const {
|
|
1234
|
-
status,
|
|
1235
|
-
allLayouts,
|
|
1236
|
-
layouts,
|
|
1237
|
-
hashWindowsLayouts,
|
|
1238
|
-
windowsPopUps,
|
|
1239
|
-
onLayoutChange
|
|
1240
|
-
} = useArea();
|
|
1241
|
-
function onBreakpointChange(_newBreakpoint, _newCols) {
|
|
1242
|
-
}
|
|
1243
|
-
if (status === "init") {
|
|
1244
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
1245
|
-
} else if (status === "load") {
|
|
1246
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1247
|
-
children: "Loading..."
|
|
1248
|
-
});
|
|
1249
|
-
}
|
|
1250
|
-
return /* @__PURE__ */ jsxs(ResponsiveGridLayout, {
|
|
1251
|
-
className: "layout",
|
|
1252
|
-
onLayoutChange,
|
|
1253
|
-
onBreakpointChange,
|
|
1254
|
-
breakpoints: {
|
|
1255
|
-
lg: 1200,
|
|
1256
|
-
md: 996,
|
|
1257
|
-
sm: 768,
|
|
1258
|
-
xs: 480,
|
|
1259
|
-
xxs: 0
|
|
1260
|
-
},
|
|
1261
|
-
cols: {
|
|
1262
|
-
lg: 24,
|
|
1263
|
-
md: 20,
|
|
1264
|
-
sm: 12,
|
|
1265
|
-
xs: 8,
|
|
1266
|
-
xxs: 2
|
|
1267
|
-
},
|
|
1268
|
-
rowHeight: 100,
|
|
1269
|
-
margin: [5, 5],
|
|
1270
|
-
containerPadding: [3, 3],
|
|
1271
|
-
draggableHandle: ".m4l_draggable_handle",
|
|
1272
|
-
compactType: "horizontal",
|
|
1273
|
-
layouts: allLayouts,
|
|
1274
|
-
children: [/* @__PURE__ */ jsx(WrapperPoups, {
|
|
1275
|
-
id: "WrapperPoups",
|
|
1276
|
-
"data-grid": {
|
|
1277
|
-
i: "none",
|
|
1278
|
-
x: 0,
|
|
1279
|
-
y: 0,
|
|
1280
|
-
w: 0,
|
|
1281
|
-
h: 0,
|
|
1282
|
-
maxW: 0,
|
|
1283
|
-
maxH: 0,
|
|
1284
|
-
minW: 0,
|
|
1285
|
-
minH: 0,
|
|
1286
|
-
static: true,
|
|
1287
|
-
isDraggable: false,
|
|
1288
|
-
isResizable: false
|
|
1289
|
-
},
|
|
1290
|
-
children: windowsPopUps.map((wp) => /* @__PURE__ */ jsx(WindowPopUp, {
|
|
1291
|
-
...wp
|
|
1292
|
-
}, wp.container_id))
|
|
1293
|
-
}, "none"), layouts.map((l) => {
|
|
1294
|
-
if (hashWindowsLayouts[l.i]) {
|
|
1295
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1296
|
-
"data-grid": l,
|
|
1297
|
-
children: /* @__PURE__ */ jsx(MemonizedWindow, {
|
|
1298
|
-
...hashWindowsLayouts[l.i]
|
|
1299
|
-
})
|
|
1300
|
-
}, l.i);
|
|
1301
|
-
}
|
|
1302
|
-
return null;
|
|
1303
|
-
})]
|
|
1304
|
-
});
|
|
1305
|
-
};
|
|
1306
|
-
const WrapperArea = styled("div")(() => ({
|
|
1307
|
-
flexDirection: "column",
|
|
1308
|
-
flexGrow: "1",
|
|
1309
|
-
position: "absolute",
|
|
1310
|
-
height: "100%",
|
|
1311
|
-
width: "100%",
|
|
1312
|
-
overflow: "auto",
|
|
1313
|
-
justifyContent: "top",
|
|
1314
|
-
alignItems: "flex-start",
|
|
1315
|
-
border: "1px dashed black",
|
|
1316
|
-
visibility: "hidden",
|
|
1317
|
-
display: "none",
|
|
1318
|
-
"&.active": {
|
|
1319
|
-
display: "flex",
|
|
1320
|
-
visibility: "visible"
|
|
1321
|
-
},
|
|
1322
|
-
"& .layout": {
|
|
1323
|
-
overflow: "scroll",
|
|
1324
|
-
minWidth: "100%",
|
|
1325
|
-
minHeight: "100%"
|
|
1326
|
-
},
|
|
1327
|
-
"& .selected": {
|
|
1328
|
-
borderTop: "1px solid green"
|
|
1329
|
-
}
|
|
1330
|
-
}));
|
|
1331
|
-
const Area = (props) => {
|
|
1332
|
-
const {
|
|
1333
|
-
id,
|
|
1334
|
-
active
|
|
1335
|
-
} = props;
|
|
1336
|
-
const {
|
|
1337
|
-
setAreaRef
|
|
1338
|
-
} = useAreas();
|
|
1339
|
-
const setAreaProviderRef = (element) => {
|
|
1340
|
-
console.log("setAreaProviderRef", element, id);
|
|
1341
|
-
if (element) {
|
|
1342
|
-
setAreaRef(id, element);
|
|
1343
|
-
}
|
|
1344
|
-
};
|
|
1345
|
-
console.log("Render Area");
|
|
1346
|
-
return /* @__PURE__ */ jsx(WrapperArea, {
|
|
1347
|
-
className: active ? "active" : "",
|
|
1348
|
-
children: /* @__PURE__ */ jsx(AreaProvider, {
|
|
1349
|
-
...props,
|
|
1350
|
-
ref: setAreaProviderRef,
|
|
1351
|
-
children: /* @__PURE__ */ jsx(GridLayout, {})
|
|
1352
|
-
})
|
|
1353
|
-
});
|
|
1354
|
-
};
|
|
1355
|
-
Area.displayName = "Area";
|
|
1356
|
-
const WrapperAreasAdmin = styled("div")(({
|
|
1357
|
-
theme
|
|
1358
|
-
}) => ({
|
|
1359
|
-
display: "flex",
|
|
1360
|
-
width: "100%",
|
|
1361
|
-
height: "100%",
|
|
1362
|
-
flexGrow: "1",
|
|
1363
|
-
position: "relative",
|
|
1364
|
-
marginTop: theme.spacing(3)
|
|
1365
|
-
}));
|
|
1366
|
-
const WrapperAreaChips = styled("div")(() => ({
|
|
1367
|
-
display: "flex",
|
|
1368
|
-
flexDirection: "row",
|
|
1369
|
-
border: "1px solid gray",
|
|
1370
|
-
"&.active": {
|
|
1371
|
-
border: "1px solid red"
|
|
1372
|
-
}
|
|
1373
|
-
}));
|
|
1374
|
-
const AreaSelect = styled("div")(({
|
|
1375
|
-
theme
|
|
1376
|
-
}) => ({
|
|
1377
|
-
height: "100%",
|
|
1378
|
-
width: theme.spacing(1),
|
|
1379
|
-
backgroundColor: theme.palette.background.default,
|
|
1380
|
-
"&.active": {
|
|
1381
|
-
backgroundColor: theme.palette.primary.main
|
|
1382
|
-
}
|
|
1383
|
-
}));
|
|
1384
|
-
const AreaChip = (props) => {
|
|
1385
|
-
const {
|
|
1386
|
-
areaId,
|
|
1387
|
-
active,
|
|
1388
|
-
areaName
|
|
1389
|
-
} = props;
|
|
1390
|
-
const {
|
|
1391
|
-
host_static_assets,
|
|
1392
|
-
environment_assets
|
|
1393
|
-
} = useEnvironment();
|
|
1394
|
-
const {
|
|
1395
|
-
deleteArea,
|
|
1396
|
-
selectArea
|
|
1397
|
-
} = useAreas();
|
|
1398
|
-
return /* @__PURE__ */ jsxs(WrapperAreaChips, {
|
|
1399
|
-
className: active ? "active" : "",
|
|
1400
|
-
onClick: () => {
|
|
1401
|
-
selectArea(areaId);
|
|
1402
|
-
},
|
|
1403
|
-
children: [/* @__PURE__ */ jsx(AreaSelect, {
|
|
1404
|
-
className: active ? "active" : ""
|
|
1405
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
1406
|
-
children: areaName
|
|
1407
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1408
|
-
src: `${host_static_assets}/${environment_assets}/frontend/domain/microfrontends/users/assets/icons/edit.svg`,
|
|
1409
|
-
size: "small",
|
|
1410
|
-
onClick: () => {
|
|
1411
|
-
}
|
|
1412
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1413
|
-
src: `${host_static_assets}/${environment_assets}/frontend/domain/microfrontends/users/assets/icons/delete.svg`,
|
|
1414
|
-
size: "small",
|
|
1415
|
-
onClick: () => deleteArea(areaId)
|
|
1416
|
-
})]
|
|
1417
|
-
});
|
|
1418
|
-
};
|
|
1419
|
-
AreaChip.displayName = "AreaButtons";
|
|
1420
|
-
function AreasAdmin() {
|
|
1421
|
-
const {
|
|
1422
|
-
areas,
|
|
1423
|
-
currentArea,
|
|
1424
|
-
addArea,
|
|
1425
|
-
status
|
|
1426
|
-
} = useAreas();
|
|
1427
|
-
const {
|
|
1428
|
-
host_static_assets,
|
|
1429
|
-
environment_assets
|
|
1430
|
-
} = useEnvironment();
|
|
1431
|
-
if (status !== "loaded") {
|
|
1432
|
-
return null;
|
|
1433
|
-
}
|
|
1434
|
-
return /* @__PURE__ */ jsxs(WrapperAreasAdmin, {
|
|
1435
|
-
id: "ContainerTabs",
|
|
1436
|
-
children: [areas.map((area) => /* @__PURE__ */ jsx(AreaChip, {
|
|
1437
|
-
areaId: area.id,
|
|
1438
|
-
active: area.id === currentArea,
|
|
1439
|
-
areaName: area.name
|
|
1440
|
-
}, area.id)), /* @__PURE__ */ jsx(IconButton, {
|
|
1441
|
-
src: `${host_static_assets}/${environment_assets}/frontend/domain/microfrontends/users/assets/icons/add.svg`,
|
|
1442
|
-
size: "small",
|
|
1443
|
-
onClick: addArea
|
|
1444
|
-
})]
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
const ContainerAreas = styled("div")(({
|
|
1448
|
-
theme
|
|
1449
|
-
}) => ({
|
|
1450
|
-
display: "flex",
|
|
1451
|
-
width: "100%",
|
|
1452
|
-
height: "100%",
|
|
1453
|
-
flexGrow: "1",
|
|
1454
|
-
position: "relative",
|
|
1455
|
-
marginTop: theme.spacing(3)
|
|
1456
|
-
}));
|
|
1457
|
-
function AreasContainer() {
|
|
1458
|
-
const {
|
|
1459
|
-
areas,
|
|
1460
|
-
currentArea,
|
|
1461
|
-
status
|
|
1462
|
-
} = useAreas();
|
|
1463
|
-
useEffect(() => {
|
|
1464
|
-
console.log("useEffect AreasContainer");
|
|
1465
|
-
}, []);
|
|
1466
|
-
if (status !== "loaded") {
|
|
1467
|
-
return null;
|
|
1468
|
-
}
|
|
1469
|
-
console.log("Render AreasContainer", status, currentArea, areas);
|
|
1470
|
-
return /* @__PURE__ */ jsx(ContainerAreas, {
|
|
1471
|
-
id: "ContainerAreas",
|
|
1472
|
-
children: areas.map((area) => {
|
|
1473
|
-
return /* @__PURE__ */ jsx(Area, {
|
|
1474
|
-
id: area.id,
|
|
1475
|
-
active: currentArea === area.id
|
|
1476
|
-
}, area.id);
|
|
1477
|
-
})
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
const useDynamicMFParameters = () => {
|
|
1481
|
-
const context = useContext(DynamicMFParmsContext);
|
|
1482
|
-
if (!context)
|
|
1483
|
-
throw new Error("useDynamicMFParameters context must be use inside DynamicMFParmsContext");
|
|
1484
|
-
return context;
|
|
1485
|
-
};
|
|
1486
|
-
const WrapperMessageIlustration = styled("div")(() => ({
|
|
1487
|
-
display: "flex",
|
|
1488
|
-
flexDirection: "column",
|
|
1489
|
-
height: "100%"
|
|
1490
|
-
}));
|
|
1491
|
-
const ModalContent = styled("div")(({
|
|
1492
|
-
theme
|
|
1493
|
-
}) => ({
|
|
1494
|
-
display: "flex",
|
|
1495
|
-
flexDirection: "column",
|
|
1496
|
-
justifyContent: "center",
|
|
1497
|
-
alignItems: "center",
|
|
1498
|
-
gridGap: theme.spacing(5),
|
|
1499
|
-
flexGrow: 1,
|
|
1500
|
-
[theme.breakpoints.up("sm")]: {
|
|
1501
|
-
display: "grid",
|
|
1502
|
-
flexDirection: "row",
|
|
1503
|
-
gridTemplateColumns: "1fr 1fr"
|
|
1504
|
-
}
|
|
1505
|
-
}));
|
|
1506
|
-
const IllustrationContainer = styled("div")(({
|
|
1507
|
-
theme,
|
|
1508
|
-
variant
|
|
1509
|
-
}) => ({
|
|
1510
|
-
display: "flex",
|
|
1511
|
-
justifyContent: "center",
|
|
1512
|
-
alignItems: "center",
|
|
1513
|
-
"& > span": {
|
|
1514
|
-
background: variant === "warning" ? theme.palette.warning.main : variant === "delete" ? theme.palette.error.main : variant === "info" ? theme.palette.info.main : "theme.palette.text.primary"
|
|
1515
|
-
}
|
|
1516
|
-
}));
|
|
1517
|
-
const MessageContainer = styled("div")(() => ({
|
|
1518
|
-
display: "flex",
|
|
1519
|
-
alignItems: "center"
|
|
1520
|
-
}));
|
|
1521
|
-
const MessageIlustration = (props) => {
|
|
1522
|
-
const {
|
|
1523
|
-
variant = "info",
|
|
1524
|
-
msg = "Are you sure you want to perform this action? Once complete, the information will be deleted."
|
|
1525
|
-
} = props;
|
|
1526
|
-
const {
|
|
1527
|
-
host_static_assets,
|
|
1528
|
-
environment_assets
|
|
1529
|
-
} = useEnvironment();
|
|
1530
|
-
const illustrationWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_warning.svg`;
|
|
1531
|
-
const illustrationError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_danger.svg`;
|
|
1532
|
-
const illustrationInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_info.svg`;
|
|
1533
|
-
return /* @__PURE__ */ jsx(WrapperMessageIlustration, {
|
|
1534
|
-
children: /* @__PURE__ */ jsxs(ModalContent, {
|
|
1535
|
-
children: [/* @__PURE__ */ jsx(IllustrationContainer, {
|
|
1536
|
-
variant,
|
|
1537
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
1538
|
-
src: variant === "warning" ? illustrationWarning : variant === "delete" ? illustrationError : illustrationInfo,
|
|
1539
|
-
size: "230px"
|
|
1540
|
-
})
|
|
1541
|
-
}), /* @__PURE__ */ jsx(MessageContainer, {
|
|
1542
|
-
children: /* @__PURE__ */ jsx(Typography, {
|
|
1543
|
-
variant: "body1",
|
|
1544
|
-
children: msg
|
|
1545
|
-
})
|
|
1546
|
-
})]
|
|
1547
|
-
})
|
|
1548
|
-
});
|
|
1549
|
-
};
|
|
1550
|
-
const WrapperWindowBase = styled("div")(({ theme }) => ({
|
|
1551
|
-
display: "flex",
|
|
1552
|
-
flexDirection: "column",
|
|
1553
|
-
height: "100%",
|
|
1554
|
-
overflow: "hidden",
|
|
1555
|
-
padding: theme.spacing(3)
|
|
1556
|
-
}));
|
|
1557
|
-
const WrapperHeader = styled("div")(({
|
|
1558
|
-
theme
|
|
1559
|
-
}) => ({
|
|
1560
|
-
display: "flex",
|
|
1561
|
-
alignItems: "center",
|
|
1562
|
-
justifyContent: "space-between",
|
|
1563
|
-
minHeight: theme.spacing(5),
|
|
1564
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
1565
|
-
overflow: "hidden"
|
|
1566
|
-
}));
|
|
1567
|
-
styled("div")(({
|
|
1568
|
-
theme
|
|
1569
|
-
}) => ({
|
|
1570
|
-
display: "flex",
|
|
1571
|
-
flexDirection: "row",
|
|
1572
|
-
flexGrow: 1,
|
|
1573
|
-
alignItems: "center",
|
|
1574
|
-
cursor: "move",
|
|
1575
|
-
...theme.typography.subtitle1,
|
|
1576
|
-
color: theme.palette.text.primary
|
|
1577
|
-
}));
|
|
1578
|
-
const IconHeader = styled("div")(({
|
|
1579
|
-
theme,
|
|
1580
|
-
variant
|
|
1581
|
-
}) => ({
|
|
1582
|
-
display: "flex",
|
|
1583
|
-
alignItems: "center",
|
|
1584
|
-
justifyContent: "center",
|
|
1585
|
-
marginRight: theme.spacing(1.5),
|
|
1586
|
-
"& > span": {
|
|
1587
|
-
background: getThemeVariantColor(theme, variant)
|
|
1588
|
-
}
|
|
1589
|
-
}));
|
|
1590
|
-
const ModalTitle = styled("div")(({
|
|
1591
|
-
theme,
|
|
1592
|
-
variant
|
|
1593
|
-
}) => ({
|
|
1594
|
-
...theme.typography.subtitle1,
|
|
1595
|
-
color: getThemeVariantColor(theme, variant),
|
|
1596
|
-
width: "100%",
|
|
1597
|
-
whiteSpace: "nowrap",
|
|
1598
|
-
textOverflow: "ellipsis",
|
|
1599
|
-
overflow: "hidden"
|
|
1600
|
-
}));
|
|
1601
|
-
const Header = (props) => {
|
|
1602
|
-
const {
|
|
1603
|
-
host_static_assets,
|
|
1604
|
-
environment_assets
|
|
1605
|
-
} = useEnvironment();
|
|
1606
|
-
const {
|
|
1607
|
-
variant,
|
|
1608
|
-
title,
|
|
1609
|
-
onClickCancel
|
|
1610
|
-
} = props;
|
|
1611
|
-
const iconSrcWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/warning.svg`;
|
|
1612
|
-
const iconSrcError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/error.svg`;
|
|
1613
|
-
const iconSrcInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/info.svg`;
|
|
1614
|
-
const iconDefault = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/icon_bar_title.svg`;
|
|
1615
|
-
return /* @__PURE__ */ jsxs(WrapperHeader, {
|
|
1616
|
-
id: "Header",
|
|
1617
|
-
className: "m4l_draggable_handle",
|
|
1618
|
-
children: [/* @__PURE__ */ jsx(IconHeader, {
|
|
1619
|
-
variant,
|
|
1620
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
1621
|
-
src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
|
|
1622
|
-
})
|
|
1623
|
-
}), /* @__PURE__ */ jsx(ModalTitle, {
|
|
1624
|
-
variant,
|
|
1625
|
-
children: title
|
|
1626
|
-
}), /* @__PURE__ */ jsx(IconButton$1, {
|
|
1627
|
-
onClick: onClickCancel,
|
|
1628
|
-
"aria-label": "click",
|
|
1629
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
1630
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/close.svg`
|
|
1631
|
-
})
|
|
1632
|
-
})]
|
|
1633
|
-
});
|
|
1634
|
-
};
|
|
1635
|
-
const WindowBase = (props) => {
|
|
1636
|
-
const {
|
|
1637
|
-
variant,
|
|
1638
|
-
title,
|
|
1639
|
-
children,
|
|
1640
|
-
onClickCancel
|
|
1641
|
-
} = props;
|
|
1642
|
-
const {
|
|
1643
|
-
closeModal
|
|
1644
|
-
} = useModal();
|
|
1645
|
-
const onCloseCancel = () => {
|
|
1646
|
-
onClickCancel && onClickCancel();
|
|
1647
|
-
closeModal();
|
|
1648
|
-
};
|
|
1649
|
-
return /* @__PURE__ */ jsxs(WrapperWindowBase, {
|
|
1650
|
-
id: "WrapperWindowBase",
|
|
1651
|
-
children: [/* @__PURE__ */ jsx(Header, {
|
|
1652
|
-
variant,
|
|
1653
|
-
title,
|
|
1654
|
-
onClickCancel: onCloseCancel
|
|
1655
|
-
}), children]
|
|
1656
|
-
});
|
|
1657
|
-
};
|
|
1658
|
-
const WindowConfirm = (props) => {
|
|
1659
|
-
const {
|
|
1660
|
-
variant,
|
|
1661
|
-
title,
|
|
1662
|
-
onClickCancel,
|
|
1663
|
-
onClickIntro
|
|
1664
|
-
} = props;
|
|
1665
|
-
const {
|
|
1666
|
-
closeModal
|
|
1667
|
-
} = useModal();
|
|
1668
|
-
const onCloseCancel = () => {
|
|
1669
|
-
onClickCancel && onClickCancel();
|
|
1670
|
-
closeModal();
|
|
1671
|
-
};
|
|
1672
|
-
return /* @__PURE__ */ jsxs(WindowBase, {
|
|
1673
|
-
title,
|
|
1674
|
-
variant,
|
|
1675
|
-
onClickCancel,
|
|
1676
|
-
children: [/* @__PURE__ */ jsx(MessageIlustration, {}), /* @__PURE__ */ jsxs(Actions, {
|
|
1677
|
-
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
1678
|
-
onClick: onCloseCancel
|
|
1679
|
-
}), " ", /* @__PURE__ */ jsx(ActionIntro, {
|
|
1680
|
-
onClick: onClickIntro,
|
|
1681
|
-
color: getVariantColor(variant)
|
|
1682
|
-
})]
|
|
1683
|
-
})]
|
|
1684
|
-
});
|
|
1685
|
-
};
|
|
1686
123
|
const DraggableWindow = (props) => {
|
|
1687
124
|
const {
|
|
1688
125
|
children,
|
|
@@ -1717,35 +154,35 @@ const DraggableWindow = (props) => {
|
|
|
1717
154
|
});
|
|
1718
155
|
};
|
|
1719
156
|
export {
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
Area,
|
|
1727
|
-
AreasAdmin,
|
|
1728
|
-
AreasContainer,
|
|
1729
|
-
AreasContext,
|
|
1730
|
-
AreasProvider,
|
|
1731
|
-
|
|
157
|
+
A6 as Accordion,
|
|
158
|
+
A8 as ActionCancel,
|
|
159
|
+
A10 as ActionFormCancel,
|
|
160
|
+
A11 as ActionFormIntro,
|
|
161
|
+
A9 as ActionIntro,
|
|
162
|
+
A as Actions,
|
|
163
|
+
A2 as Area,
|
|
164
|
+
A3 as AreasAdmin,
|
|
165
|
+
A5 as AreasContainer,
|
|
166
|
+
A4 as AreasContext,
|
|
167
|
+
a5 as AreasProvider,
|
|
168
|
+
A7 as Avatar,
|
|
1732
169
|
B4 as BooleanFormatter,
|
|
1733
170
|
B2 as BoxIcon,
|
|
1734
171
|
B3 as Breadcrumbs,
|
|
1735
172
|
B as Button,
|
|
1736
173
|
C as CircularProgress,
|
|
1737
|
-
|
|
1738
|
-
|
|
174
|
+
D2 as DataGrid,
|
|
175
|
+
D4 as DateFormatter,
|
|
1739
176
|
DraggableWindow,
|
|
1740
|
-
|
|
1741
|
-
DynamicMFParmsContext,
|
|
1742
|
-
DynamicMFParmsProvider,
|
|
177
|
+
D3 as DynamicFilter,
|
|
178
|
+
a2 as DynamicMFParmsContext,
|
|
179
|
+
D as DynamicMFParmsProvider,
|
|
1743
180
|
E as ErrorLabel,
|
|
1744
181
|
H as HelmetPage,
|
|
1745
|
-
|
|
1746
|
-
|
|
182
|
+
I as Icon,
|
|
183
|
+
I3 as IconButton,
|
|
1747
184
|
a as IconButtonAnimate,
|
|
1748
|
-
|
|
185
|
+
I2 as Image,
|
|
1749
186
|
L3 as LanguagePopover,
|
|
1750
187
|
L4 as LinearProgress,
|
|
1751
188
|
L5 as LinkWithRoute,
|
|
@@ -1753,36 +190,36 @@ export {
|
|
|
1753
190
|
L2 as LoadingButton,
|
|
1754
191
|
L as LoadingScreen,
|
|
1755
192
|
L7 as Logo,
|
|
1756
|
-
|
|
193
|
+
M3 as MenuActions,
|
|
1757
194
|
M as ModalContext,
|
|
1758
|
-
|
|
1759
|
-
|
|
195
|
+
M2 as ModalDialog,
|
|
196
|
+
a3 as ModalProvider,
|
|
1760
197
|
M4 as MotionContainer,
|
|
1761
198
|
M5 as MotionLazyContainer,
|
|
1762
199
|
N2 as NoItemSelected,
|
|
1763
200
|
N as NumberEditor,
|
|
1764
201
|
O as ObjectLogs,
|
|
1765
|
-
|
|
202
|
+
P4 as Pager,
|
|
1766
203
|
P5 as PaperForm,
|
|
1767
|
-
|
|
204
|
+
P2 as Period,
|
|
1768
205
|
P7 as PointsFormatter,
|
|
1769
|
-
|
|
206
|
+
P3 as Popover,
|
|
1770
207
|
P8 as PriceFormatter,
|
|
1771
208
|
P as PropagateLoader,
|
|
1772
209
|
P6 as PropertyValue,
|
|
1773
|
-
|
|
210
|
+
R2 as RHFAutocomplete,
|
|
1774
211
|
R9 as RHFAutocompleteAsync,
|
|
1775
|
-
|
|
1776
|
-
|
|
212
|
+
R3 as RHFCheckbox,
|
|
213
|
+
R4 as RHFDateTime,
|
|
1777
214
|
R10 as RHFMultiCheckbox,
|
|
1778
|
-
|
|
215
|
+
R6 as RHFPeriod,
|
|
1779
216
|
R12 as RHFRadioGroup,
|
|
1780
217
|
R11 as RHFSelect,
|
|
1781
|
-
|
|
1782
|
-
|
|
218
|
+
R5 as RHFTextField,
|
|
219
|
+
a4 as RHFTextFieldPassword,
|
|
1783
220
|
R8 as RHFUploadImage,
|
|
1784
221
|
R as RHFormProvider,
|
|
1785
|
-
|
|
222
|
+
R7 as ResizeableWindow,
|
|
1786
223
|
S as ScrollBar,
|
|
1787
224
|
S3 as ScrollToTop,
|
|
1788
225
|
S2 as SplitLayout,
|
|
@@ -1790,42 +227,42 @@ export {
|
|
|
1790
227
|
T2 as TextEditor,
|
|
1791
228
|
T3 as Typography,
|
|
1792
229
|
U as UncertaintyFormatter,
|
|
1793
|
-
WindowBase,
|
|
1794
|
-
WindowConfirm,
|
|
230
|
+
W2 as WindowBase,
|
|
231
|
+
W as WindowConfirm,
|
|
1795
232
|
c as columnBooleanFormatter,
|
|
1796
|
-
|
|
233
|
+
b as columnDateFormatter,
|
|
1797
234
|
c4 as columnNestedValueFormatter,
|
|
1798
235
|
c3 as columnPointsFormatter,
|
|
1799
236
|
c5 as columnPriceFormatter,
|
|
1800
237
|
c2 as columnUncertaintyFormatter,
|
|
1801
238
|
d as defaultCommonActionsDictionary,
|
|
1802
|
-
|
|
1803
|
-
|
|
239
|
+
d3 as defaultDynamicFilterDictionary,
|
|
240
|
+
d6 as defaultFormattersDictionary,
|
|
1804
241
|
d2 as defaultModalDialogDictionary,
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
242
|
+
d4 as defaultNoItemSelectedDictionary,
|
|
243
|
+
d5 as defaultObjectLogDictionary,
|
|
244
|
+
g3 as getCommonActionsDictionary,
|
|
245
|
+
a6 as getDataGridRowsFromSet,
|
|
1809
246
|
g7 as getDynamicFilterComponentsDictionary,
|
|
1810
247
|
g12 as getFormatPoints,
|
|
1811
248
|
g13 as getFormatPrice,
|
|
1812
249
|
g14 as getFormattersComponentsDictionary,
|
|
1813
250
|
g6 as getGridComponentsDictionary,
|
|
1814
|
-
|
|
251
|
+
g4 as getModalDialogComponentsDictionary,
|
|
1815
252
|
g8 as getNoItemSelectedComponentsDictionary,
|
|
1816
253
|
g9 as getObjectLogsComponentsDictionary,
|
|
1817
|
-
|
|
1818
|
-
|
|
254
|
+
g5 as getPagerComponentsDictionary,
|
|
255
|
+
g2 as getPeriodComponetsDictionary,
|
|
1819
256
|
g10 as getRHFAutocompleteAsyncComponentsDictionary,
|
|
1820
|
-
|
|
257
|
+
g as getRHFAutocompleteComponentsDictionary,
|
|
1821
258
|
g11 as getUncertaintyFormat,
|
|
1822
|
-
useDynamicMFParameters,
|
|
1823
|
-
|
|
1824
|
-
|
|
259
|
+
u3 as useDynamicMFParameters,
|
|
260
|
+
u as useFormAddEdit,
|
|
261
|
+
u2 as useModal,
|
|
1825
262
|
v2 as varBounce,
|
|
1826
263
|
v3 as varContainer,
|
|
1827
264
|
v as varFade,
|
|
1828
265
|
v4 as varTranEnter,
|
|
1829
|
-
|
|
1830
|
-
|
|
266
|
+
a7 as varTranExit,
|
|
267
|
+
b2 as varTranHover
|
|
1831
268
|
};
|