@m4l/components 0.1.66 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CommonActions/components/ActionCancel/{index.4d0333c0.js → index.1254308b.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.298e0109.js → index.ddf330a8.js} +12 -10
- package/components/CommonActions/components/ActionFormIntro/{index.b45922ff.js → index.8248f431.js} +1 -1
- package/components/CommonActions/components/ActionIntro/{index.138101aa.js → index.dbf2ad66.js} +2 -2
- package/components/CommonActions/components/Actions/{index.77574633.js → index.5da399f8.js} +12 -11
- package/components/DataGrid/{index.ef23d0a9.js → index.775deb12.js} +19 -18
- package/components/DynamicFilter/{index.04ed3d58.js → index.7c7c9d30.js} +29 -28
- package/components/HelperText/{index.c35dcb93.js → index.5d8bc10a.js} +8 -8
- package/components/Icon/{index.fbeeacc8.js → index.321976e8.js} +2 -2
- package/components/Image/{index.77396f79.js → index.c5b14688.js} +1 -1
- package/components/LanguagePopover/{index.c0fc94c7.js → index.6f0bca65.js} +9 -9
- package/components/ModalDialog/{index.e600b43a.js → index.c07975ed.js} +5 -5
- package/components/NavLink/{index.3f4e2417.js → index.da57f87d.js} +9 -9
- package/components/NoItemSelected/{index.609c3c20.js → index.09faa02c.js} +1 -1
- package/components/ObjectLogs/{index.7f93ba51.js → index.a48a013c.js} +15 -14
- package/components/PaperForm/{index.fb4fa784.js → index.15002e62.js} +1 -1
- package/components/Period/{index.0c5bf66f.js → index.c5179eae.js} +13 -12
- package/components/Resizeable/{index.4545dd6a.js → index.d3469af2.js} +1 -1
- package/components/SideBar/{index.7d970041.js → index.9c026180.js} +6 -6
- package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/helper.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/types.d.ts +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/index.d.ts +1 -1
- package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/DynamicMFParmsContext/store.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/store.d.ts +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/types.d.ts +1 -1
- package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/WindowToolsMFContext/types.d.ts +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/index.d.ts +1 -1
- package/components/areas/components/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/MicroFrontend/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +3 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowPopUp/index.d.ts +1 -1
- package/components/areas/{index.d7519516.js → components/index.98d1c90a.js} +71 -360
- package/components/areas/components/index.d.ts +1 -1
- package/components/areas/contexts/AreasContext/index.7dc6f386.js +230 -0
- package/components/areas/contexts/AreasContext/types.d.ts +1 -1
- package/components/areas/contexts/index.3e99c2da.js +2 -0
- package/components/areas/contexts/index.d.ts +4 -4
- package/components/areas/hooks/index.1a0b8ab0.js +26 -0
- package/components/areas/hooks/useArea/index.443ac11d.js +34 -0
- package/components/areas/hooks/useDynamicMFParameters/index.2a963454.js +14 -0
- package/components/areas/hooks/useDynamicMFParameters/index.d.ts +4 -4
- package/components/areas/hooks/useWindowToolsMF/index.d.ts +1 -1
- package/components/areas/index.6aec2efe.js +43 -0
- package/components/areas/{components/AreasViewer/subcomponents/Area/types.d.ts → types.d.ts} +3 -3
- package/components/formatters/BooleanFormatter/{index.0edacc9b.js → index.a3c6f613.js} +1 -1
- package/components/formatters/{index.879170b2.js → index.a09541d3.js} +2 -2
- package/components/hook-form/RHFAutocomplete/{index.5f27e28c.js → index.9f9d4ed7.js} +10 -10
- package/components/hook-form/RHFAutocompleteAsync/{index.35e17cd6.js → index.af16b28e.js} +2 -2
- package/components/hook-form/RHFCheckbox/{index.4f134f09.js → index.938fb1da.js} +3 -3
- package/components/hook-form/RHFPeriod/{index.dcaa0c87.js → index.1b1fafa6.js} +2 -2
- package/components/hook-form/RHFTextField/{index.fc90a570.js → index.e42cd9c0.js} +6 -6
- package/components/hook-form/RHFUpload/{index.654ad316.js → index.d79721d2.js} +1 -1
- package/components/modal/{WindowBase.230a498f.js → WindowBase.39f1310d.js} +3 -3
- package/components/modal/{WindowConfirm.575b4d41.js → WindowConfirm.993a8ed9.js} +15 -14
- package/components/modal/index.c63957d7.js +24 -0
- package/components/mui_extended/Accordion/{index.0b15f939.js → index.466d66d5.js} +2 -2
- package/components/mui_extended/Button/{index.b7b70e5f.js → index.680f7d77.js} +3 -3
- package/components/mui_extended/IconButton/{index.a5072cd3.js → index.d31f1039.js} +1 -1
- package/components/mui_extended/MenuActions/{index.3a275abb.js → index.e1749afa.js} +2 -2
- package/components/mui_extended/Pager/{index.5a69ab10.js → index.bc67d954.js} +1 -1
- package/components/mui_extended/Typography/{index.eab3d85c.js → index.1d866b8b.js} +1 -1
- package/components/mui_extended/index.a6c77aa1.js +19 -0
- package/contexts/ModalContext/{index.de0a3457.js → index.53e8904e.js} +1 -1
- package/contexts/index.d.ts +1 -1
- package/hooks/useModal/{index.e103db09.js → index.2a4b4b65.js} +1 -1
- package/index.js +85 -80
- package/package.json +1 -1
- package/{react-draggable.4d08d714.js → react-draggable.18cf453f.js} +1 -1
- package/{react-resizable.23b980cb.js → react-resizable.f3de2742.js} +2 -2
- package/utils/{index.c2e62d8f.js → index.3a4700cd.js} +1 -1
- package/{vendor.be57c149.js → vendor.31965c93.js} +44 -40
- package/components/modal/index.237881ea.js +0 -23
- package/components/mui_extended/index.35f74599.js +0 -19
- /package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/DynamicMFParmsContext/index.d.ts +0 -0
- /package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/DynamicMFParmsContext/types.d.ts +0 -0
- /package/components/areas/{contexts → components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts}/WindowToolsMFContext/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WindowProps } from '
|
|
2
|
+
import { WindowProps } from '../../../../../../../../types';
|
|
3
3
|
export declare const InnerForHooks: (props: WindowProps) => JSX.Element | null;
|
|
4
4
|
export declare const MemonizedInnerForHooks: React.MemoExoticComponent<(props: WindowProps) => JSX.Element | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MFBaseProps } from '
|
|
2
|
+
import { MFBaseProps } from '../../../../../../../../../../types';
|
|
3
3
|
export declare const MicroFrontend: (props: MFBaseProps) => JSX.Element;
|
|
4
4
|
export declare const MemonizedMF: React.MemoExoticComponent<(props: MFBaseProps) => JSX.Element>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WindowToolsMF } from '
|
|
2
|
-
import { MFBaseProps } from '
|
|
3
|
-
import { DynamicMFStore } from '
|
|
1
|
+
import { WindowToolsMF } from '../../../../contexts/WindowToolsMFContext/types';
|
|
2
|
+
import { MFBaseProps } from '../../../../../../../../../../types';
|
|
3
|
+
import { DynamicMFStore } from '../../../../contexts/DynamicMFParmsContext/store';
|
|
4
4
|
export interface MicroFrontendProps extends MFBaseProps {
|
|
5
5
|
moduleId: string;
|
|
6
6
|
dynamicMFStore?: DynamicMFStore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ModalProps } from '
|
|
2
|
+
import { ModalProps } from '../../../../../../types';
|
|
3
3
|
export declare const WindowModal: (props: ModalProps) => JSX.Element;
|
|
4
4
|
export declare const MemonizedWindowModal: React.MemoExoticComponent<(props: ModalProps) => JSX.Element>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PopUpProps } from '
|
|
2
|
+
import { PopUpProps } from '../../../../../../types';
|
|
3
3
|
export declare const WindowPopUp: (props: PopUpProps) => JSX.Element;
|
|
4
4
|
export declare const MemonizedWindowPopUp: React.MemoExoticComponent<(props: PopUpProps) => JSX.Element>;
|
|
@@ -1,93 +1,83 @@
|
|
|
1
|
-
import { I as IconButton } from "
|
|
2
|
-
import {
|
|
1
|
+
import { I as IconButton } from "../../mui_extended/IconButton/index.d31f1039.js";
|
|
2
|
+
import { u as useAreasStore, a as useArea, b as useAreas, c as useAreaStore } from "../hooks/useArea/index.443ac11d.js";
|
|
3
|
+
import { useEnvironment, useNetwork, useModuleDictionary, useModuleSkeleton, useHostTools, axiosOperation } from "@m4l/core";
|
|
3
4
|
import { shallow } from "zustand/shallow";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
5
|
+
import { A as AREAS_VIEWER_CLASS_NAME, a as AREAS_ADMIN_CLASS_NAME, I as ICONS, g as getAreasDictionary } from "../index.6aec2efe.js";
|
|
6
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
7
|
+
import React__default, { createContext, useRef, useEffect, useMemo, useState, useCallback } from "react";
|
|
6
8
|
import { generateUtilityClasses, Skeleton, styled as styled$1, Typography as Typography$1, Dialog } from "@mui/material";
|
|
7
|
-
import { I as Icon } from "
|
|
9
|
+
import { I as Icon } from "../../Icon/index.321976e8.js";
|
|
8
10
|
import clsx from "clsx";
|
|
9
11
|
import { createStore, useStore } from "zustand";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
14
|
-
import { g as getComponentUtilityClass } from "../../utils/index.c2e62d8f.js";
|
|
15
|
-
import "../mui_extended/Accordion/index.0b15f939.js";
|
|
16
|
-
import "../mui_extended/Avatar/index.fe06afd7.js";
|
|
12
|
+
import "../contexts/AreasContext/index.7dc6f386.js";
|
|
13
|
+
import "../../mui_extended/Accordion/index.466d66d5.js";
|
|
14
|
+
import "../../mui_extended/Avatar/index.fe06afd7.js";
|
|
17
15
|
import "react-router-dom";
|
|
18
16
|
import "@mui/material/Button";
|
|
19
|
-
import { B as Button } from "
|
|
20
|
-
import { I as Image } from "
|
|
17
|
+
import { B as Button } from "../../mui_extended/Button/index.680f7d77.js";
|
|
18
|
+
import { I as Image } from "../../Image/index.c5b14688.js";
|
|
21
19
|
import "@mui/lab";
|
|
22
|
-
import { T as Typography } from "
|
|
23
|
-
import "
|
|
24
|
-
import { M as MenuActions } from "
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
20
|
+
import { T as Typography } from "../../mui_extended/Typography/index.1d866b8b.js";
|
|
21
|
+
import "../../mui_extended/Popover/index.e271e4f0.js";
|
|
22
|
+
import { M as MenuActions } from "../../mui_extended/MenuActions/index.e1749afa.js";
|
|
23
|
+
import "../../mui_extended/Pager/index.bc67d954.js";
|
|
24
|
+
import "../../mui_extended/Tab/index.e0653a0a.js";
|
|
25
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
26
|
+
import { g as getComponentUtilityClass } from "../../../utils/index.3a4700cd.js";
|
|
27
27
|
import { styled } from "@mui/material/styles";
|
|
28
|
-
import { r as react_resizable_css } from "
|
|
28
|
+
import { r as react_resizable_css } from "../../../react-resizable.f3de2742.js";
|
|
29
|
+
import { immer } from "zustand/middleware/immer";
|
|
30
|
+
import { devtools } from "zustand/middleware";
|
|
29
31
|
import debounce from "lodash/debounce";
|
|
30
32
|
import cloneDeep from "lodash.clonedeep";
|
|
33
|
+
import { useResponsiveDesktop, useFirstRender, useHostTheme, useFormatter, useLocales } from "@m4l/graphics";
|
|
31
34
|
import { WidthProvider, Responsive } from "react-grid-layout";
|
|
32
35
|
import { m } from "framer-motion";
|
|
33
|
-
import "
|
|
34
|
-
import "
|
|
36
|
+
import "../../animate/LoadingScreen/index.1d0c4307.js";
|
|
37
|
+
import "../../animate/PropagateLoader/index.be5b02c3.js";
|
|
35
38
|
import "react-hook-form";
|
|
36
|
-
import "
|
|
37
|
-
import "
|
|
38
|
-
import "
|
|
39
|
-
import "
|
|
39
|
+
import "../../hook-form/RHFAutocomplete/index.9f9d4ed7.js";
|
|
40
|
+
import "../../HelperText/index.5d8bc10a.js";
|
|
41
|
+
import "../../hook-form/RHFAutocompleteAsync/index.af16b28e.js";
|
|
42
|
+
import "../../hook-form/RHFCheckbox/index.938fb1da.js";
|
|
40
43
|
import "@mui/x-date-pickers";
|
|
41
|
-
import "
|
|
42
|
-
import "
|
|
43
|
-
import "
|
|
44
|
-
import "
|
|
45
|
-
import "
|
|
46
|
-
import "
|
|
47
|
-
import { c as cjs } from "
|
|
48
|
-
import "
|
|
49
|
-
import { R as ResizeableWindow } from "
|
|
50
|
-
import "
|
|
51
|
-
import "
|
|
44
|
+
import "../../hook-form/RHFDateTime/index.6c129ce4.js";
|
|
45
|
+
import "../../hook-form/RHFTextField/index.e42cd9c0.js";
|
|
46
|
+
import "../../hook-form/RHFPeriod/index.1b1fafa6.js";
|
|
47
|
+
import "../../Period/index.c5179eae.js";
|
|
48
|
+
import "../../CommonActions/components/Actions/index.5da399f8.js";
|
|
49
|
+
import "../../../contexts/ModalContext/index.53e8904e.js";
|
|
50
|
+
import { c as cjs } from "../../../react-draggable.18cf453f.js";
|
|
51
|
+
import "../../ModalDialog/index.c07975ed.js";
|
|
52
|
+
import { R as ResizeableWindow } from "../../Resizeable/index.d3469af2.js";
|
|
53
|
+
import "../../modal/WindowConfirm.993a8ed9.js";
|
|
54
|
+
import "../../modal/WindowBase.39f1310d.js";
|
|
52
55
|
import "lodash/isString";
|
|
53
56
|
import "react-dropzone";
|
|
54
|
-
import "
|
|
55
|
-
import "
|
|
57
|
+
import "../../hook-form/RHFUpload/index.d79721d2.js";
|
|
58
|
+
import "../../DataGrid/index.775deb12.js";
|
|
56
59
|
import "react-dnd";
|
|
57
60
|
import "react-dnd-html5-backend";
|
|
58
|
-
import "
|
|
59
|
-
import "
|
|
61
|
+
import "../../DynamicFilter/index.7c7c9d30.js";
|
|
62
|
+
import "../../ScrollBar/index.bbe48f4d.js";
|
|
60
63
|
import "yup";
|
|
61
64
|
import "@hookform/resolvers/yup";
|
|
62
|
-
import "
|
|
63
|
-
import { D as DraggableWindow } from "
|
|
64
|
-
import "
|
|
65
|
-
import "
|
|
66
|
-
import "
|
|
67
|
-
import "
|
|
68
|
-
import "
|
|
69
|
-
import "
|
|
70
|
-
import "
|
|
71
|
-
import "
|
|
72
|
-
import "
|
|
73
|
-
import "
|
|
74
|
-
import "
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
|
|
78
|
-
function getAreasComponentsDictionary() {
|
|
79
|
-
return [AREAS_DICTIONARY_ID];
|
|
80
|
-
}
|
|
81
|
-
const LABEL_FILTER_BUTTON = "filter_tooltip";
|
|
82
|
-
const DICCTIONARY = {
|
|
83
|
-
label_new_area: "label_new_area",
|
|
84
|
-
label_persist_module_cookies: "label_persist_module_cookies"
|
|
85
|
-
};
|
|
86
|
-
const getAreasDictionary = (key) => {
|
|
87
|
-
return `${AREAS_DICTIONARY_ID}.${key}`;
|
|
88
|
-
};
|
|
89
|
-
const AREAS_VIEWER_CLASS_NAME = "M4LAreasViewer";
|
|
90
|
-
const AREAS_ADMIN_CLASS_NAME = "M4LAreasAdmin";
|
|
65
|
+
import "../../../contexts/RHFormContext/index.a7511399.js";
|
|
66
|
+
import { D as DraggableWindow } from "../../../vendor.31965c93.js";
|
|
67
|
+
import "../../LanguagePopover/index.6f0bca65.js";
|
|
68
|
+
import "../../NavLink/index.da57f87d.js";
|
|
69
|
+
import "../../NoItemSelected/index.09faa02c.js";
|
|
70
|
+
import "../../ObjectLogs/index.a48a013c.js";
|
|
71
|
+
import "../../../react-json-view.57125fcf.js";
|
|
72
|
+
import "../../PaperForm/index.15002e62.js";
|
|
73
|
+
import "../../Page/index.4237c241.js";
|
|
74
|
+
import "../../PropertyValue/index.dfcfe1ba.js";
|
|
75
|
+
import "../../../react-splitter-layout.8b1655c8.js";
|
|
76
|
+
import "../../SplitLayout/index.5a8355d8.js";
|
|
77
|
+
import "../../SideBar/index.9c026180.js";
|
|
78
|
+
import { a as useWindow, b as useWindowStore } from "../hooks/index.1a0b8ab0.js";
|
|
79
|
+
import { L as LinearProgress } from "../../mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
80
|
+
import { v as varBounce } from "../../animate/variants/bounce.784aaaaa.js";
|
|
91
81
|
const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
|
|
92
82
|
"root",
|
|
93
83
|
"areaRoot",
|
|
@@ -146,242 +136,6 @@ const useAreasAdminUtilityClasses = (ownerState) => {
|
|
|
146
136
|
};
|
|
147
137
|
return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
|
|
148
138
|
};
|
|
149
|
-
const addArea = (state) => {
|
|
150
|
-
let newName = "";
|
|
151
|
-
const newId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
|
|
152
|
-
newName = `${state.getLabel(getAreasDictionary("label_new_area"))} ${state.areas.length + 1}`;
|
|
153
|
-
state.areas.push({ id: newId, name: newName, loadWindows: false });
|
|
154
|
-
state.currentArea = newId;
|
|
155
|
-
if (state.loadAreasFromNetwork) {
|
|
156
|
-
state.networkOperation({
|
|
157
|
-
method: "POST",
|
|
158
|
-
endPoint: `areas`,
|
|
159
|
-
data: { id: newId, name: newName },
|
|
160
|
-
toastSuccess: false,
|
|
161
|
-
toastError: false
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
return newId;
|
|
165
|
-
};
|
|
166
|
-
const updateOwnerStateClasses = (state) => {
|
|
167
|
-
state.viwerClasses = useAreasViewerUtilityClasses(state.ownerState);
|
|
168
|
-
state.adminClasses = useAreasAdminUtilityClasses(state.ownerState);
|
|
169
|
-
};
|
|
170
|
-
const createAreasStore = (initProps) => {
|
|
171
|
-
const startProps = {
|
|
172
|
-
viwerClasses: useAreasViewerUtilityClasses(initProps.ownerState),
|
|
173
|
-
adminClasses: useAreasAdminUtilityClasses(initProps.ownerState),
|
|
174
|
-
currentArea: "",
|
|
175
|
-
areas: [],
|
|
176
|
-
...initProps
|
|
177
|
-
};
|
|
178
|
-
return createStore(
|
|
179
|
-
devtools(
|
|
180
|
-
immer((set, get) => ({
|
|
181
|
-
...startProps,
|
|
182
|
-
actions: {
|
|
183
|
-
init: () => {
|
|
184
|
-
if (get().ownerState.status === "init") {
|
|
185
|
-
if (!get().loadAreasFromNetwork) {
|
|
186
|
-
get().actions.addArea();
|
|
187
|
-
set((state) => {
|
|
188
|
-
state.ownerState.status = "loaded";
|
|
189
|
-
updateOwnerStateClasses(state);
|
|
190
|
-
});
|
|
191
|
-
} else {
|
|
192
|
-
set((state) => {
|
|
193
|
-
state.ownerState.status = "loading";
|
|
194
|
-
updateOwnerStateClasses(state);
|
|
195
|
-
state.networkOperation({
|
|
196
|
-
method: "GET",
|
|
197
|
-
endPoint: `areas`,
|
|
198
|
-
parms: {},
|
|
199
|
-
toastSuccess: false
|
|
200
|
-
}).then((response) => {
|
|
201
|
-
set((otherState) => {
|
|
202
|
-
if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
|
|
203
|
-
otherState.areas = response.data;
|
|
204
|
-
otherState.currentArea = response.data[0].id;
|
|
205
|
-
} else {
|
|
206
|
-
addArea(otherState);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}).finally(() => {
|
|
210
|
-
set((state2) => {
|
|
211
|
-
state2.ownerState.status = "loaded";
|
|
212
|
-
updateOwnerStateClasses(state2);
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
addArea: () => {
|
|
220
|
-
let newId = "";
|
|
221
|
-
set((state) => {
|
|
222
|
-
newId = addArea(state);
|
|
223
|
-
});
|
|
224
|
-
return newId;
|
|
225
|
-
},
|
|
226
|
-
deleteArea: (areaId) => {
|
|
227
|
-
set((state) => {
|
|
228
|
-
const removeIndex = state.areas.findIndex((area) => area.id === areaId);
|
|
229
|
-
if (removeIndex > -1) {
|
|
230
|
-
state.areas.splice(removeIndex, 1);
|
|
231
|
-
}
|
|
232
|
-
if (state.currentArea === areaId) {
|
|
233
|
-
if (state.areas.length > 0) {
|
|
234
|
-
state.currentArea = state.areas[0].id;
|
|
235
|
-
} else {
|
|
236
|
-
state.currentArea = "";
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
if (state.loadAreasFromNetwork) {
|
|
240
|
-
state.networkOperation({
|
|
241
|
-
method: "DELETE",
|
|
242
|
-
endPoint: `areas/${areaId}`,
|
|
243
|
-
parms: {},
|
|
244
|
-
toastSuccess: false,
|
|
245
|
-
toastError: false
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
},
|
|
250
|
-
selectArea: (newAreaId) => {
|
|
251
|
-
set((state) => {
|
|
252
|
-
if (state.areas.findIndex((area) => area.id === newAreaId) > -1) {
|
|
253
|
-
state.currentArea = newAreaId;
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
internalActions: {
|
|
259
|
-
setHandlerGetLabel: (newHandler) => {
|
|
260
|
-
set((state) => {
|
|
261
|
-
state.getLabel = newHandler;
|
|
262
|
-
});
|
|
263
|
-
},
|
|
264
|
-
setAreaLink: (areaId, store) => {
|
|
265
|
-
set((state) => {
|
|
266
|
-
const areaIndex = state.areas.findIndex((area) => area.id === areaId);
|
|
267
|
-
if (areaIndex > -1) {
|
|
268
|
-
state.areas[areaIndex].store = store;
|
|
269
|
-
state.areas[areaIndex].linked = true;
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
},
|
|
273
|
-
setExternalState: (newExternalState) => {
|
|
274
|
-
set((state) => {
|
|
275
|
-
state.ownerState = { ...state.ownerState, ...newExternalState };
|
|
276
|
-
updateOwnerStateClasses(state);
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
})),
|
|
281
|
-
{ name: `Areas store` }
|
|
282
|
-
)
|
|
283
|
-
);
|
|
284
|
-
};
|
|
285
|
-
const AreasContext = createContext(null);
|
|
286
|
-
function AreasProvider(props) {
|
|
287
|
-
const {
|
|
288
|
-
children,
|
|
289
|
-
loadAreasFromNetwork,
|
|
290
|
-
loadCookiesFromNetwork,
|
|
291
|
-
onLoad
|
|
292
|
-
} = props;
|
|
293
|
-
const {
|
|
294
|
-
events_add_listener,
|
|
295
|
-
events_remove_listener
|
|
296
|
-
} = useHostTools();
|
|
297
|
-
const {
|
|
298
|
-
getLabel
|
|
299
|
-
} = useModuleDictionary();
|
|
300
|
-
const {
|
|
301
|
-
networkOperation
|
|
302
|
-
} = useNetwork();
|
|
303
|
-
const isDesktop = useResponsiveDesktop();
|
|
304
|
-
const isSkeleton = useModuleSkeleton();
|
|
305
|
-
const isFirstRender = useFirstRender([getLabel]);
|
|
306
|
-
const areasStoreRef = useRef();
|
|
307
|
-
if (!areasStoreRef.current) {
|
|
308
|
-
areasStoreRef.current = createAreasStore({
|
|
309
|
-
getLabel,
|
|
310
|
-
loadAreasFromNetwork,
|
|
311
|
-
loadCookiesFromNetwork,
|
|
312
|
-
networkOperation,
|
|
313
|
-
ownerState: {
|
|
314
|
-
status: "init",
|
|
315
|
-
isMobile: !isDesktop,
|
|
316
|
-
isSkeleton
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
areasStoreRef.current?.getState().actions.init();
|
|
320
|
-
}
|
|
321
|
-
const status = useStore(areasStoreRef.current, (state) => state.ownerState.status, shallow);
|
|
322
|
-
const {
|
|
323
|
-
setHandlerGetLabel
|
|
324
|
-
} = useStore(areasStoreRef.current, (state) => state.internalActions, shallow);
|
|
325
|
-
const addWindow = useCallback((newWindow) => {
|
|
326
|
-
const currentArea = areasStoreRef.current?.getState().currentArea;
|
|
327
|
-
const areas = areasStoreRef.current?.getState().areas;
|
|
328
|
-
if (currentArea && areas) {
|
|
329
|
-
const areaIndex = areas.findIndex((area) => area.id == currentArea);
|
|
330
|
-
if (areaIndex > -1 && areas[areaIndex].store) {
|
|
331
|
-
areas[areaIndex].store?.getState().actions.addWindow(newWindow);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}, []);
|
|
335
|
-
useEffect(() => {
|
|
336
|
-
if (status === "loaded") {
|
|
337
|
-
onLoad && onLoad();
|
|
338
|
-
}
|
|
339
|
-
}, [status]);
|
|
340
|
-
useEffect(() => {
|
|
341
|
-
if (!isFirstRender) {
|
|
342
|
-
setHandlerGetLabel(getLabel);
|
|
343
|
-
}
|
|
344
|
-
}, [getLabel]);
|
|
345
|
-
useEffect(() => {
|
|
346
|
-
events_add_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
|
|
347
|
-
return () => {
|
|
348
|
-
events_remove_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
|
|
349
|
-
};
|
|
350
|
-
}, []);
|
|
351
|
-
useEffect(() => {
|
|
352
|
-
if (isFirstRender) {
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
areasStoreRef.current?.getState().internalActions.setExternalState({
|
|
356
|
-
isMobile: !isDesktop,
|
|
357
|
-
isSkeleton
|
|
358
|
-
});
|
|
359
|
-
}, [isDesktop, isSkeleton]);
|
|
360
|
-
return /* @__PURE__ */ jsx(AreasContext.Provider, {
|
|
361
|
-
value: areasStoreRef.current,
|
|
362
|
-
children
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
function useAreas() {
|
|
366
|
-
const context = useContext(AreasContext);
|
|
367
|
-
if (!context)
|
|
368
|
-
throw new Error("useAreas context must be use inside AreasContext");
|
|
369
|
-
return context;
|
|
370
|
-
}
|
|
371
|
-
function useAreasStore(selector, equalityFn) {
|
|
372
|
-
const context = useContext(AreasContext);
|
|
373
|
-
if (!context)
|
|
374
|
-
throw new Error("useAreasStore context must be use inside AreasContext");
|
|
375
|
-
return useStore(context, selector, equalityFn);
|
|
376
|
-
}
|
|
377
|
-
const ICONS = {
|
|
378
|
-
CLOSE: "close.svg",
|
|
379
|
-
MAXIMIZE: "maximize.svg",
|
|
380
|
-
NORMALIZE: "normalize.svg",
|
|
381
|
-
DELETE_AREA: "delete_area.svg",
|
|
382
|
-
ADD_AREA: "add_area.svg",
|
|
383
|
-
EDIT_AREA: "edit_area.svg"
|
|
384
|
-
};
|
|
385
139
|
const AreaChip = (props) => {
|
|
386
140
|
const {
|
|
387
141
|
areaId,
|
|
@@ -443,7 +197,7 @@ function AreasAdmin() {
|
|
|
443
197
|
const status = useAreasStore((state) => state.ownerState.status);
|
|
444
198
|
const classesRoot = useAreasStore((state) => state.adminClasses.root);
|
|
445
199
|
const {
|
|
446
|
-
addArea
|
|
200
|
+
addArea
|
|
447
201
|
} = useAreasStore((state) => state.actions, shallow);
|
|
448
202
|
const {
|
|
449
203
|
host_static_assets,
|
|
@@ -463,7 +217,7 @@ function AreasAdmin() {
|
|
|
463
217
|
className: areasAdminClasses.areasAddButton,
|
|
464
218
|
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
|
|
465
219
|
size: "small",
|
|
466
|
-
onClick:
|
|
220
|
+
onClick: addArea
|
|
467
221
|
})]
|
|
468
222
|
});
|
|
469
223
|
}
|
|
@@ -1237,18 +991,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
1237
991
|
AreaProvider.displayName = "AreaProvider";
|
|
1238
992
|
}
|
|
1239
993
|
React__default.memo(AreaProvider);
|
|
1240
|
-
const useArea = () => {
|
|
1241
|
-
const context = useContext(AreaContext);
|
|
1242
|
-
if (!context)
|
|
1243
|
-
throw new Error("useArea context must be use inside AreaContext");
|
|
1244
|
-
return context;
|
|
1245
|
-
};
|
|
1246
|
-
function useAreaStore(selector, equalityFn) {
|
|
1247
|
-
const context = useContext(AreaContext);
|
|
1248
|
-
if (!context)
|
|
1249
|
-
throw new Error("useAreaStore context must be use inside AreaContext");
|
|
1250
|
-
return useStore(context, selector, equalityFn);
|
|
1251
|
-
}
|
|
1252
994
|
const WindowToolsMFContext = createContext(null);
|
|
1253
995
|
function WindowToolsMFProvider(props) {
|
|
1254
996
|
const {
|
|
@@ -1468,18 +1210,6 @@ function WindowMFProvider(props) {
|
|
|
1468
1210
|
children
|
|
1469
1211
|
});
|
|
1470
1212
|
}
|
|
1471
|
-
const useWindow = () => {
|
|
1472
|
-
const context = useContext(WindowContext);
|
|
1473
|
-
if (!context)
|
|
1474
|
-
throw new Error("useWindow context must be use inside WindowContext");
|
|
1475
|
-
return context;
|
|
1476
|
-
};
|
|
1477
|
-
function useWindowStore(selector, equalityFn) {
|
|
1478
|
-
const store = useContext(WindowContext);
|
|
1479
|
-
if (!store)
|
|
1480
|
-
throw new Error("useWindow context must be use inside WindowContext");
|
|
1481
|
-
return useStore(store, selector, equalityFn);
|
|
1482
|
-
}
|
|
1483
1213
|
const Component = (props) => {
|
|
1484
1214
|
const {
|
|
1485
1215
|
component
|
|
@@ -2382,35 +2112,16 @@ function AreasViewer() {
|
|
|
2382
2112
|
})
|
|
2383
2113
|
});
|
|
2384
2114
|
}
|
|
2385
|
-
function useDynamicMFParametersStore(selector, equalityFn) {
|
|
2386
|
-
const store = useContext(DynamicMFParmsContext);
|
|
2387
|
-
if (!store)
|
|
2388
|
-
throw new Error(
|
|
2389
|
-
"useDynamicMFParametersStore context must be use inside DynamicMFParmsContext"
|
|
2390
|
-
);
|
|
2391
|
-
return useStore(store, selector, equalityFn);
|
|
2392
|
-
}
|
|
2393
|
-
const useWindowToolsMF = () => {
|
|
2394
|
-
const context = useContext(WindowToolsMFContext);
|
|
2395
|
-
if (!context)
|
|
2396
|
-
throw new Error("useWindowToolsMF context must be use inside WindowToolsMFContext");
|
|
2397
|
-
return context;
|
|
2398
|
-
};
|
|
2399
2115
|
export {
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
LABEL_FILTER_BUTTON as L,
|
|
2116
|
+
AreaContext as A,
|
|
2117
|
+
DynamicMFParmsContext as D,
|
|
2403
2118
|
MemonizedDynamicMFParmsProvider as M,
|
|
2404
|
-
|
|
2405
|
-
|
|
2119
|
+
WindowContext as W,
|
|
2120
|
+
useAreasAdminUtilityClasses as a,
|
|
2406
2121
|
WindowToolsMFContext as b,
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
getAreasDictionary as h,
|
|
2413
|
-
DynamicMFParmsProvider as i,
|
|
2414
|
-
DynamicMFParmsContext as j,
|
|
2415
|
-
useWindowToolsMF as u
|
|
2122
|
+
AreasAdmin as c,
|
|
2123
|
+
AreasViewer as d,
|
|
2124
|
+
WindowToolsMFProvider as e,
|
|
2125
|
+
DynamicMFParmsProvider as f,
|
|
2126
|
+
useAreasViewerUtilityClasses as u
|
|
2416
2127
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './AreasAdmin';
|
|
2
2
|
export * from './AreasViewer';
|
|
3
|
-
export type { NewWindowProps as NewWindow } from '
|
|
3
|
+
export type { NewWindowProps as NewWindow } from '../types';
|
|
4
4
|
export type { MicroFrontendProps } from './AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types';
|