@m4l/components 0.1.70 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/export.d.ts +20 -0
- package/components/CommonActions/components/ActionCancel/{index.9d521b2a.js → index.ff90f2c0.js} +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index.4756457f.js → index.392a17c0.js} +19 -18
- package/components/CommonActions/components/ActionFormIntro/{index.40321b1b.js → index.f88d8849.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.1ba5b02b.js → index.e31ab7e9.js} +3 -3
- package/components/CommonActions/components/Actions/{index.154d7cb6.js → index.6b7d480a.js} +19 -18
- package/components/DataGrid/{index.2f4a0e64.js → index.77ae9b4c.js} +21 -20
- package/components/DynamicFilter/{index.789ab474.js → index.b2ba5167.js} +47 -98
- package/components/HelperText/{index.a69e9509.js → index.d7b1b21a.js} +11 -10
- package/components/Icon/{index.caaed284.js → index.6f2a5618.js} +6 -4
- package/components/Icon/types.d.ts +1 -0
- package/components/Image/{index.82a6cd46.js → index.1e3b7ff6.js} +3 -3
- package/components/LanguagePopover/{index.5af28b9e.js → index.310e9a3a.js} +11 -11
- package/components/ModalDialog/{index.cdfd1ae8.js → index.598f9a86.js} +19 -5
- package/components/NavLink/{index.251fcf0d.js → index.ac3778af.js} +12 -11
- package/components/NoItemSelected/{index.3b9d16e3.js → index.3809e3d1.js} +1 -1
- package/components/ObjectLogs/{index.57ea68b3.js → index.949d3595.js} +16 -15
- package/components/PaperForm/{index.d2d492ea.js → index.cf8af08b.js} +1 -1
- package/components/Period/{index.fbf074d3.js → index.53ea0562.js} +19 -18
- package/components/Resizeable/{index.aafda79e.js → index.ff4ce7a4.js} +20 -6
- package/components/SideBar/{index.3bc6a634.js → index.4daafbab.js} +55 -40
- package/components/SideBar/subcomponents/ContentMobile/subcomponents/Drawer.d.ts +3 -0
- package/components/SideBar/subcomponents/ContentMobile/subcomponents/types.d.ts +8 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +4 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +4 -0
- package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/classes/types.d.ts +2 -0
- package/components/areas/components/{index.359c2b18.js → index.31f39977.js} +267 -74
- package/components/areas/contexts/AreasContext/{index.de8b4e78.js → index.e14d6799.js} +17 -2
- package/components/areas/contexts/AreasContext/types.d.ts +5 -0
- package/components/areas/contexts/{index.771827bb.js → index.5ba05323.js} +1 -1
- package/components/areas/dictionary.d.ts +2 -0
- package/components/areas/hooks/useArea/{index.2adbe001.js → index.c135e0cf.js} +1 -1
- package/components/areas/icons.d.ts +2 -0
- package/components/areas/{index.8a58bcbf.js → index.bd29b1db.js} +13 -7
- package/components/formatters/BooleanFormatter/{index.7eb0498c.js → index.99c7fe49.js} +1 -1
- package/components/formatters/{index.f6b9ed01.js → index.1a92006b.js} +3 -2
- package/components/hook-form/RHFAutocomplete/{index.09c400c3.js → index.c4ba070a.js} +12 -11
- package/components/hook-form/RHFAutocompleteAsync/{index.e8acff04.js → index.a63f3704.js} +2 -2
- package/components/hook-form/RHFCheckbox/{index.70310f35.js → index.9055f88d.js} +3 -3
- package/components/hook-form/RHFDateTime/{index.7b815072.js → index.2cb94a66.js} +10 -10
- package/components/hook-form/RHFPeriod/{index.3c7d393c.js → index.14dcf762.js} +2 -2
- package/components/hook-form/RHFTextField/{index.d4c39859.js → index.7ce2b16e.js} +7 -6
- package/components/hook-form/RHFUpload/{index.31044674.js → index.c57a43f8.js} +1 -1
- package/components/modal/{WindowBase.6a40a945.js → WindowBase.32d35d71.js} +11 -11
- package/components/modal/{WindowConfirm.e21763cb.js → WindowConfirm.70bcbb69.js} +16 -15
- package/components/modal/index.ef3aa9ac.js +35 -0
- package/components/mui_extended/Accordion/{index.437bb3f8.js → index.44e96bb8.js} +2 -2
- package/components/mui_extended/Button/{index.f8ce9ccd.js → index.ec6525e0.js} +6 -4
- package/components/mui_extended/Button/types.d.ts +2 -0
- package/components/mui_extended/IconButton/{index.57824447.js → index.7aab3e04.js} +7 -3
- package/components/mui_extended/MenuActions/{index.37043326.js → index.bff47c06.js} +3 -3
- package/components/mui_extended/Pager/{index.eeed3bd5.js → index.907d5801.js} +1 -1
- package/components/mui_extended/Popover/{index.226f247e.js → index.9f35d0eb.js} +1 -3
- package/components/mui_extended/Popover/types.d.ts +6 -2
- package/components/mui_extended/Typography/{index.b3c6e71c.js → index.d5e0f69f.js} +1 -1
- package/components/mui_extended/index.1f766f93.js +20 -0
- package/contexts/ModalContext/{index.8e3cd7a8.js → index.fca184e2.js} +1 -1
- package/hooks/useModal/{index.d590f506.js → index.9b244379.js} +1 -1
- package/index.js +53 -53
- package/package.json +5 -3
- package/{react-draggable.0d64c8b1.js → react-draggable.29f78f6d.js} +1 -1
- package/{react-resizable.8307e056.js → react-resizable.baf54eb2.js} +3 -3
- package/utils/{index.a2312a73.js → index.ee16888d.js} +1 -1
- package/{vendor.8edaef93.js → vendor.619c3533.js} +46 -46
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/styles.d.ts +0 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/styles.d.ts +0 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/styles.d.ts +0 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/styles.d.ts +0 -2
- package/components/modal/index.438777d9.js +0 -34
- package/components/mui_extended/index.dacbb059.js +0 -19
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { I as IconButton } from "../../mui_extended/IconButton/index.
|
|
2
|
-
import { u as useAreasStore } from "../hooks/useArea/index.
|
|
1
|
+
import { I as IconButton } from "../../mui_extended/IconButton/index.7aab3e04.js";
|
|
2
|
+
import { u as useAreasStore } from "../hooks/useArea/index.c135e0cf.js";
|
|
3
3
|
import { useEnvironment, useModuleDictionary, useModuleSkeleton, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
|
|
4
4
|
import { shallow } from "zustand/shallow";
|
|
5
|
-
import { A as AREAS_VIEWER_CLASS_NAME, a as AREAS_ADMIN_CLASS_NAME, I as ICONS,
|
|
6
|
-
import { I as Icon } from "../../Icon/index.
|
|
5
|
+
import { A as AREAS_VIEWER_CLASS_NAME, a as AREAS_ADMIN_CLASS_NAME, g as getAreasDictionary, I as ICONS, D as DICCTIONARY } from "../index.bd29b1db.js";
|
|
6
|
+
import { I as Icon } from "../../Icon/index.6f2a5618.js";
|
|
7
|
+
import { S as ScrollBar } from "../../ScrollBar/index.bbe48f4d.js";
|
|
7
8
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
8
|
-
import React__default, {
|
|
9
|
+
import React__default, { useState, useRef, useMemo, useCallback, useEffect } from "react";
|
|
9
10
|
import { generateUtilityClasses, Skeleton, styled as styled$1, Typography as Typography$1, Dialog } from "@mui/material";
|
|
10
11
|
import clsx from "clsx";
|
|
12
|
+
import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender, useResizeObserver } from "@m4l/graphics";
|
|
11
13
|
import "zustand";
|
|
12
|
-
import { R as ROW_HEIGTH_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, C as CONTAINER_PADDING_GRIDLAYOUT, T as THROTTLE_RESIZE_TIME } from "../contexts/AreasContext/index.
|
|
13
|
-
import "
|
|
14
|
+
import { R as ROW_HEIGTH_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, C as CONTAINER_PADDING_GRIDLAYOUT, T as THROTTLE_RESIZE_TIME } from "../contexts/AreasContext/index.e14d6799.js";
|
|
15
|
+
import * as Yup from "yup";
|
|
16
|
+
import "../../mui_extended/Accordion/index.44e96bb8.js";
|
|
14
17
|
import "../../mui_extended/Avatar/index.fe06afd7.js";
|
|
15
18
|
import "react-router-dom";
|
|
16
19
|
import "@mui/material/Button";
|
|
17
|
-
import { B as Button } from "../../mui_extended/Button/index.
|
|
18
|
-
import { I as Image } from "../../Image/index.
|
|
20
|
+
import { B as Button } from "../../mui_extended/Button/index.ec6525e0.js";
|
|
21
|
+
import { I as Image } from "../../Image/index.1e3b7ff6.js";
|
|
19
22
|
import "@mui/lab";
|
|
20
|
-
import { T as Typography } from "../../mui_extended/Typography/index.
|
|
21
|
-
import "../../mui_extended/Popover/index.
|
|
22
|
-
import { M as MenuActions } from "../../mui_extended/MenuActions/index.
|
|
23
|
-
import "../../mui_extended/Pager/index.
|
|
23
|
+
import { T as Typography } from "../../mui_extended/Typography/index.d5e0f69f.js";
|
|
24
|
+
import { P as Popover } from "../../mui_extended/Popover/index.9f35d0eb.js";
|
|
25
|
+
import { M as MenuActions } from "../../mui_extended/MenuActions/index.bff47c06.js";
|
|
26
|
+
import "../../mui_extended/Pager/index.907d5801.js";
|
|
24
27
|
import "../../mui_extended/Tab/index.e0653a0a.js";
|
|
25
28
|
import { unstable_composeClasses } from "@mui/base";
|
|
26
|
-
import { g as getComponentUtilityClass } from "../../../utils/index.
|
|
29
|
+
import { g as getComponentUtilityClass } from "../../../utils/index.ee16888d.js";
|
|
30
|
+
import { D as DynamicMFParmsProvider } from "../contexts/DynamicMFParmsContext/index.1607c78e.js";
|
|
31
|
+
import "../../../contexts/ModalContext/index.fca184e2.js";
|
|
32
|
+
import { R as RHFormProvider } from "../../../contexts/RHFormContext/index.a7511399.js";
|
|
33
|
+
import "react-hook-form";
|
|
34
|
+
import "../../hook-form/RHFAutocomplete/index.c4ba070a.js";
|
|
35
|
+
import "../../HelperText/index.d7b1b21a.js";
|
|
36
|
+
import debounce from "lodash/debounce";
|
|
37
|
+
import "../../hook-form/RHFAutocompleteAsync/index.a63f3704.js";
|
|
38
|
+
import "../../hook-form/RHFCheckbox/index.9055f88d.js";
|
|
39
|
+
import "@mui/x-date-pickers";
|
|
40
|
+
import "../../hook-form/RHFDateTime/index.2cb94a66.js";
|
|
41
|
+
import { R as RHFTextField } from "../../hook-form/RHFTextField/index.7ce2b16e.js";
|
|
42
|
+
import "../../hook-form/RHFPeriod/index.14dcf762.js";
|
|
43
|
+
import "../../Period/index.53ea0562.js";
|
|
44
|
+
import { A as Actions } from "../../CommonActions/components/Actions/index.6b7d480a.js";
|
|
45
|
+
import { A as ActionCancel } from "../../CommonActions/components/ActionCancel/index.ff90f2c0.js";
|
|
46
|
+
import { A as ActionIntro } from "../../CommonActions/components/ActionIntro/index.e31ab7e9.js";
|
|
47
|
+
import { c as cjs } from "../../../react-draggable.29f78f6d.js";
|
|
48
|
+
import "../../ModalDialog/index.598f9a86.js";
|
|
49
|
+
import { R as ResizeableWindow } from "../../Resizeable/index.ff4ce7a4.js";
|
|
50
|
+
import "../../modal/WindowConfirm.70bcbb69.js";
|
|
51
|
+
import "../../modal/WindowBase.32d35d71.js";
|
|
27
52
|
import { styled } from "@mui/material/styles";
|
|
28
|
-
import { r as react_resizable_css } from "../../../react-resizable.
|
|
53
|
+
import { r as react_resizable_css } from "../../../react-resizable.baf54eb2.js";
|
|
29
54
|
import { WidthProvider, Responsive } from "react-grid-layout";
|
|
30
55
|
import { m } from "framer-motion";
|
|
31
56
|
import "../../animate/LoadingScreen/index.1d0c4307.js";
|
|
32
57
|
import "../../animate/PropagateLoader/index.be5b02c3.js";
|
|
33
58
|
import { W as WindowToolsMFProvider } from "../contexts/WindowToolsMFContext/index.8f3e2a04.js";
|
|
34
|
-
import { D as DynamicMFParmsProvider } from "../contexts/DynamicMFParmsContext/index.1607c78e.js";
|
|
35
|
-
import "react-hook-form";
|
|
36
|
-
import "../../hook-form/RHFAutocomplete/index.09c400c3.js";
|
|
37
|
-
import "../../HelperText/index.a69e9509.js";
|
|
38
|
-
import debounce from "lodash/debounce";
|
|
39
|
-
import "../../hook-form/RHFAutocompleteAsync/index.e8acff04.js";
|
|
40
|
-
import "../../hook-form/RHFCheckbox/index.70310f35.js";
|
|
41
|
-
import "@mui/x-date-pickers";
|
|
42
|
-
import "../../hook-form/RHFDateTime/index.7b815072.js";
|
|
43
|
-
import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender, useResizeObserver } from "@m4l/graphics";
|
|
44
|
-
import "../../hook-form/RHFTextField/index.d4c39859.js";
|
|
45
|
-
import "../../hook-form/RHFPeriod/index.3c7d393c.js";
|
|
46
|
-
import "../../Period/index.fbf074d3.js";
|
|
47
|
-
import "../../CommonActions/components/Actions/index.154d7cb6.js";
|
|
48
|
-
import "../../../contexts/ModalContext/index.8e3cd7a8.js";
|
|
49
|
-
import { c as cjs } from "../../../react-draggable.0d64c8b1.js";
|
|
50
|
-
import "../../ModalDialog/index.cdfd1ae8.js";
|
|
51
|
-
import { R as ResizeableWindow } from "../../Resizeable/index.aafda79e.js";
|
|
52
|
-
import "../../modal/WindowConfirm.e21763cb.js";
|
|
53
|
-
import "../../modal/WindowBase.6a40a945.js";
|
|
54
59
|
import "lodash/isString";
|
|
55
60
|
import "react-dropzone";
|
|
56
|
-
import "../../hook-form/RHFUpload/index.
|
|
57
|
-
import "../../DataGrid/index.
|
|
61
|
+
import "../../hook-form/RHFUpload/index.c57a43f8.js";
|
|
62
|
+
import "../../DataGrid/index.77ae9b4c.js";
|
|
58
63
|
import "react-dnd";
|
|
59
64
|
import "react-dnd-html5-backend";
|
|
60
|
-
import "../../DynamicFilter/index.
|
|
61
|
-
import "../../ScrollBar/index.bbe48f4d.js";
|
|
62
|
-
import "yup";
|
|
65
|
+
import "../../DynamicFilter/index.b2ba5167.js";
|
|
63
66
|
import "@hookform/resolvers/yup";
|
|
64
|
-
import "
|
|
65
|
-
import "../../
|
|
66
|
-
import "../../
|
|
67
|
-
import "../../
|
|
68
|
-
import "../../ObjectLogs/index.57ea68b3.js";
|
|
67
|
+
import "../../LanguagePopover/index.310e9a3a.js";
|
|
68
|
+
import "../../NavLink/index.ac3778af.js";
|
|
69
|
+
import "../../NoItemSelected/index.3809e3d1.js";
|
|
70
|
+
import "../../ObjectLogs/index.949d3595.js";
|
|
69
71
|
import "../../../react-json-view.57125fcf.js";
|
|
70
|
-
import "../../PaperForm/index.
|
|
72
|
+
import "../../PaperForm/index.cf8af08b.js";
|
|
71
73
|
import "../../Page/index.4237c241.js";
|
|
72
74
|
import "../../PropertyValue/index.dfcfe1ba.js";
|
|
73
75
|
import "../../../react-splitter-layout.8b1655c8.js";
|
|
74
76
|
import "../../SplitLayout/index.5a8355d8.js";
|
|
75
|
-
import "../../SideBar/index.
|
|
76
|
-
import { D as DraggableWindow } from "../../../vendor.
|
|
77
|
+
import "../../SideBar/index.4daafbab.js";
|
|
78
|
+
import { D as DraggableWindow } from "../../../vendor.619c3533.js";
|
|
77
79
|
import { L as LinearProgress } from "../../mui_extended/LinearProgress/index.c92b9ba9.js";
|
|
78
80
|
import { v as varBounce } from "../../animate/variants/bounce.784aaaaa.js";
|
|
79
81
|
import { throttle } from "lodash";
|
|
@@ -90,9 +92,11 @@ const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
|
|
|
90
92
|
"windowContent",
|
|
91
93
|
"windowPopupRoot",
|
|
92
94
|
"windowModalRoot",
|
|
95
|
+
"windowRootContainer",
|
|
93
96
|
"panelWindowsRoot",
|
|
94
97
|
"panelWindowsButtonContainer",
|
|
95
98
|
"selected",
|
|
99
|
+
"selectedWindow",
|
|
96
100
|
"isMobile",
|
|
97
101
|
"loading"
|
|
98
102
|
], AREAS_VIEWER_CLASS_NAME);
|
|
@@ -104,12 +108,14 @@ const useAreasViewerUtilityClasses = (ownerState) => {
|
|
|
104
108
|
areaGridLayout: ["areaGridLayout"],
|
|
105
109
|
areaGridLayoutPopupsContainer: ["areaGridLayoutPopupsContainer"],
|
|
106
110
|
windowRoot: ["windowRoot"],
|
|
111
|
+
windowRootContainer: ["windowRootContainer"],
|
|
107
112
|
windowHeader: ["windowHeader"],
|
|
108
113
|
windowHeaderTitle: ["windowHeaderTitle"],
|
|
109
114
|
windowHeaderMainActions: ["windowHeaderMainActions"],
|
|
110
115
|
windowContent: ["windowContent"],
|
|
111
116
|
windowPopupRoot: ["windowPopupRoot"],
|
|
112
117
|
windowModalRoot: ["windowModalRoot"],
|
|
118
|
+
selectedWindow: ["selectedWindow"],
|
|
113
119
|
panelWindowsRoot: ["panelWindowsRoot"],
|
|
114
120
|
panelWindowsButtonContainer: ["panelWindowsButtonContainer"]
|
|
115
121
|
};
|
|
@@ -120,10 +126,10 @@ const areasAdminClasses = generateUtilityClasses(AREAS_ADMIN_CLASS_NAME, [
|
|
|
120
126
|
"areaChipRoot",
|
|
121
127
|
"areaChipTitle",
|
|
122
128
|
"areaChipDeleteButton",
|
|
123
|
-
"areaChipEditButton",
|
|
124
129
|
"areasAddButton",
|
|
125
130
|
"areaContainerChips",
|
|
126
131
|
"areaIconLayer",
|
|
132
|
+
"areaChipEditButton",
|
|
127
133
|
"selected",
|
|
128
134
|
"isMobile",
|
|
129
135
|
"disabled"
|
|
@@ -141,6 +147,35 @@ const useAreasAdminUtilityClasses = (ownerState) => {
|
|
|
141
147
|
};
|
|
142
148
|
return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
|
|
143
149
|
};
|
|
150
|
+
styled("div")(() => ({
|
|
151
|
+
display: "flex",
|
|
152
|
+
flexDirection: "row",
|
|
153
|
+
border: "1px solid gray",
|
|
154
|
+
"&.active": {
|
|
155
|
+
border: "1px solid red"
|
|
156
|
+
}
|
|
157
|
+
}));
|
|
158
|
+
styled("div")(({
|
|
159
|
+
theme
|
|
160
|
+
}) => ({
|
|
161
|
+
height: "100%",
|
|
162
|
+
width: theme.spacing(1),
|
|
163
|
+
backgroundColor: theme.palette.background.default,
|
|
164
|
+
"&.active": {
|
|
165
|
+
backgroundColor: theme.palette.primary.main
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
const EditAreaHeader = styled("div")(({
|
|
169
|
+
theme
|
|
170
|
+
}) => ({
|
|
171
|
+
display: "flex",
|
|
172
|
+
width: "100%",
|
|
173
|
+
height: "25px",
|
|
174
|
+
borderBottom: "1px solid",
|
|
175
|
+
borderColor: theme.palette.state.default,
|
|
176
|
+
justifyContent: "space-between",
|
|
177
|
+
alignItems: "center"
|
|
178
|
+
}));
|
|
144
179
|
const AreaChip = (props) => {
|
|
145
180
|
const {
|
|
146
181
|
areaId,
|
|
@@ -154,27 +189,102 @@ const AreaChip = (props) => {
|
|
|
154
189
|
} = useEnvironment();
|
|
155
190
|
const {
|
|
156
191
|
deleteArea,
|
|
157
|
-
selectArea
|
|
192
|
+
selectArea,
|
|
193
|
+
editArea
|
|
158
194
|
} = useAreasStore((state) => state.areasActions);
|
|
195
|
+
const [open, setOpen] = useState(false);
|
|
196
|
+
const {
|
|
197
|
+
getLabel
|
|
198
|
+
} = useModuleDictionary();
|
|
199
|
+
const anchorRef = useRef(null);
|
|
159
200
|
const onClickDeleteArea = (e) => {
|
|
160
201
|
e.stopPropagation();
|
|
161
202
|
deleteArea(areaId);
|
|
162
203
|
};
|
|
204
|
+
const onSubmit = (data) => {
|
|
205
|
+
console.log("data areachip", data);
|
|
206
|
+
editArea(areaId, data.inputEditArea);
|
|
207
|
+
setOpen(false);
|
|
208
|
+
};
|
|
209
|
+
const handlerOpenPopover = () => {
|
|
210
|
+
setOpen(true);
|
|
211
|
+
};
|
|
212
|
+
const initialValues = {
|
|
213
|
+
inputEditArea: areaName
|
|
214
|
+
};
|
|
215
|
+
const validationSchema = useMemo(() => Yup.object().shape({
|
|
216
|
+
inputEditArea: Yup.string().required(getLabel(getAreasDictionary("validation_edit_area")))
|
|
217
|
+
}), [getLabel]);
|
|
163
218
|
return /* @__PURE__ */ jsxs("div", {
|
|
164
219
|
role: "presentation",
|
|
165
220
|
className: clsx(areasAdminClasses.areaChipRoot, selected ? areasAdminClasses.selected : null, disabled ? areasAdminClasses.disabled : null),
|
|
166
221
|
onClick: () => {
|
|
167
222
|
selectArea(areaId);
|
|
168
223
|
},
|
|
169
|
-
|
|
224
|
+
ref: anchorRef,
|
|
225
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
170
226
|
className: areasAdminClasses.areaChipTitle,
|
|
171
227
|
children: areaName
|
|
172
|
-
}), /* @__PURE__ */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
228
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
229
|
+
style: {
|
|
230
|
+
display: "flex"
|
|
231
|
+
},
|
|
232
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
233
|
+
className: areasAdminClasses.areaChipEditButton,
|
|
234
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
|
|
235
|
+
size: "extraSmall",
|
|
236
|
+
onClick: handlerOpenPopover
|
|
237
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
238
|
+
className: areasAdminClasses.areaChipDeleteButton,
|
|
239
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
|
|
240
|
+
size: "extraSmall",
|
|
241
|
+
onClick: onClickDeleteArea
|
|
242
|
+
})]
|
|
243
|
+
}), /* @__PURE__ */ jsx(Popover, {
|
|
244
|
+
arrowType: "top-center",
|
|
245
|
+
open,
|
|
246
|
+
anchorEl: anchorRef.current,
|
|
247
|
+
anchorOrigin: {
|
|
248
|
+
vertical: "bottom",
|
|
249
|
+
horizontal: "center"
|
|
250
|
+
},
|
|
251
|
+
transformOrigin: {
|
|
252
|
+
vertical: "top",
|
|
253
|
+
horizontal: "center"
|
|
254
|
+
},
|
|
255
|
+
onClose: () => setOpen(false),
|
|
256
|
+
sx: {
|
|
257
|
+
mt: "10px"
|
|
258
|
+
},
|
|
259
|
+
children: /* @__PURE__ */ jsxs(RHFormProvider, {
|
|
260
|
+
onSubmit,
|
|
261
|
+
values: initialValues,
|
|
262
|
+
validationSchema,
|
|
263
|
+
children: [/* @__PURE__ */ jsxs(EditAreaHeader, {
|
|
264
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
265
|
+
children: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area))
|
|
266
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
267
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
|
|
268
|
+
size: "small",
|
|
269
|
+
onClick: () => setOpen(false)
|
|
270
|
+
})]
|
|
271
|
+
}), /* @__PURE__ */ jsx(RHFTextField, {
|
|
272
|
+
name: "inputEditArea",
|
|
273
|
+
skeletonWidth: "70%",
|
|
274
|
+
skeletonHeight: "18px",
|
|
275
|
+
sx: {
|
|
276
|
+
mt: "20px"
|
|
277
|
+
}
|
|
278
|
+
}), /* @__PURE__ */ jsxs(Actions, {
|
|
279
|
+
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
280
|
+
onClick: () => setOpen(false),
|
|
281
|
+
variant: "outlined",
|
|
282
|
+
skeletonWidth: "100%"
|
|
283
|
+
}), /* @__PURE__ */ jsx(ActionIntro, {
|
|
284
|
+
skeletonWidth: "100%"
|
|
285
|
+
})]
|
|
286
|
+
})]
|
|
287
|
+
})
|
|
178
288
|
})]
|
|
179
289
|
});
|
|
180
290
|
};
|
|
@@ -188,12 +298,6 @@ const AreasAdminRoot = styled("div")`
|
|
|
188
298
|
display: flex;
|
|
189
299
|
}
|
|
190
300
|
|
|
191
|
-
& .${areasAdminClasses.areaChipRoot}.${areasAdminClasses.selected}::before {
|
|
192
|
-
content: "";
|
|
193
|
-
background-color: ${(props) => props.theme.palette.primary.main};
|
|
194
|
-
height: 100%;
|
|
195
|
-
width: 8px;
|
|
196
|
-
}
|
|
197
301
|
|
|
198
302
|
${(props) => props.theme.components?.M4LAreasAdmin?.styleOverrides}
|
|
199
303
|
|
|
@@ -225,12 +329,16 @@ function AreasAdmin() {
|
|
|
225
329
|
})
|
|
226
330
|
}), /* @__PURE__ */ jsx("div", {
|
|
227
331
|
className: areasAdminClasses.areaContainerChips,
|
|
228
|
-
children:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
332
|
+
children: /* @__PURE__ */ jsx(ScrollBar, {
|
|
333
|
+
children: /* @__PURE__ */ jsx(Fragment, {
|
|
334
|
+
children: areas.map((area) => /* @__PURE__ */ jsx(AreaChip, {
|
|
335
|
+
areaId: area.id,
|
|
336
|
+
selected: area.id === currentArea,
|
|
337
|
+
areaName: area.name,
|
|
338
|
+
disabled: areasLength === 1
|
|
339
|
+
}, area.id))
|
|
340
|
+
})
|
|
341
|
+
})
|
|
234
342
|
}), /* @__PURE__ */ jsx(IconButton, {
|
|
235
343
|
className: areasAdminClasses.areasAddButton,
|
|
236
344
|
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
|
|
@@ -309,11 +417,72 @@ const AreasViewerRoot = styled("div")`
|
|
|
309
417
|
&.${areasViewerClasses.isMobile} .${areasViewerClasses.panelWindowsRoot} {
|
|
310
418
|
flex-direction: row;
|
|
311
419
|
}
|
|
312
|
-
& .${areasViewerClasses.panelWindowsButtonContainer}.${areasViewerClasses.selected} {
|
|
313
|
-
border: 1px solid red;
|
|
314
|
-
}
|
|
315
420
|
|
|
316
421
|
// windowRoot
|
|
422
|
+
& .${areasViewerClasses.windowRoot} {
|
|
423
|
+
inset:0;
|
|
424
|
+
position: absolute;
|
|
425
|
+
display: flex;
|
|
426
|
+
flex-direction: column;
|
|
427
|
+
/* height: 100%; */
|
|
428
|
+
/* width: 100%; */
|
|
429
|
+
overflow: hidden;
|
|
430
|
+
border: 1px solid gray;
|
|
431
|
+
|
|
432
|
+
background-color: ${(props) => props.theme.palette.background.default};
|
|
433
|
+
padding: ${(props) => props.theme.spacing(0)};
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
& .${areasViewerClasses.windowRoot}.${areasViewerClasses.selected} {
|
|
437
|
+
border-top: 1px solid green;
|
|
438
|
+
}
|
|
439
|
+
// windowHeader
|
|
440
|
+
& .${areasViewerClasses.windowHeader} {
|
|
441
|
+
display: flex;
|
|
442
|
+
gap: 4px;
|
|
443
|
+
|
|
444
|
+
align-items: center;
|
|
445
|
+
position: relative;
|
|
446
|
+
|
|
447
|
+
padding: 8px;
|
|
448
|
+
justify-content: end;
|
|
449
|
+
min-height: ${(props) => props.theme.spacing(5)} ;
|
|
450
|
+
|
|
451
|
+
border-bottom: 1px solid ${(props) => props.theme.palette.divider};
|
|
452
|
+
overflow: hidden;
|
|
453
|
+
cursor: move;
|
|
454
|
+
height: 60px;
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
> span: {
|
|
459
|
+
margin-right: 12px;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
// windowHeaderTitle
|
|
463
|
+
& .${areasViewerClasses.windowHeaderTitle} {
|
|
464
|
+
width: 100%;
|
|
465
|
+
max-width: 100%;
|
|
466
|
+
overflow: hidden;
|
|
467
|
+
white-space: nowrap;
|
|
468
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
469
|
+
margin-left: 12px;
|
|
470
|
+
margin-right: 24px;
|
|
471
|
+
text-overflow: ellipsis;
|
|
472
|
+
}
|
|
473
|
+
// windowHeaderMainActions
|
|
474
|
+
& .${areasViewerClasses.windowHeaderMainActions} {
|
|
475
|
+
display: flex;
|
|
476
|
+
|
|
477
|
+
gap: 4px;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
// windowHeaderMainActions
|
|
482
|
+
& .${areasViewerClasses.windowContent} {
|
|
483
|
+
flex-grow: 1;
|
|
484
|
+
position: relative;
|
|
485
|
+
}
|
|
317
486
|
|
|
318
487
|
// windowModalRoot
|
|
319
488
|
& .${areasViewerClasses.windowModalRoot} {
|
|
@@ -774,7 +943,8 @@ function Header(props) {
|
|
|
774
943
|
}
|
|
775
944
|
const WrapperLinearProgress = styled$1("div")(() => ({
|
|
776
945
|
width: "70%",
|
|
777
|
-
margin: "auto auto"
|
|
946
|
+
margin: "auto auto",
|
|
947
|
+
position: "absolute"
|
|
778
948
|
}));
|
|
779
949
|
const WrapperFallBackNotFound = styled$1("div")(({
|
|
780
950
|
theme
|
|
@@ -1183,7 +1353,7 @@ const Window = (props) => {
|
|
|
1183
1353
|
}, []);
|
|
1184
1354
|
return /* @__PURE__ */ jsxs(WindowRoot, {
|
|
1185
1355
|
role: "presentation",
|
|
1186
|
-
className: clsx(areasViewerClasses.windowRoot, selected ? areasViewerClasses.
|
|
1356
|
+
className: clsx(areasViewerClasses.windowRoot, selected ? areasViewerClasses.selectedWindow : null, wd.loading ? areasViewerClasses.loading : null),
|
|
1187
1357
|
onMouseDown: onTouch,
|
|
1188
1358
|
children: [/* @__PURE__ */ jsx(Header, {
|
|
1189
1359
|
areaId,
|
|
@@ -1214,6 +1384,10 @@ const WindowPopUp = (props) => {
|
|
|
1214
1384
|
windowProps,
|
|
1215
1385
|
windowId
|
|
1216
1386
|
} = props;
|
|
1387
|
+
const {
|
|
1388
|
+
host_static_assets,
|
|
1389
|
+
environment_assets
|
|
1390
|
+
} = useEnvironment();
|
|
1217
1391
|
const {
|
|
1218
1392
|
selectWindowPopUp
|
|
1219
1393
|
} = useAreasStore((store) => store.areaActions);
|
|
@@ -1240,6 +1414,13 @@ const WindowPopUp = (props) => {
|
|
|
1240
1414
|
onResizeStart: () => {
|
|
1241
1415
|
onTouch();
|
|
1242
1416
|
},
|
|
1417
|
+
handle: (resizeHandle, ref) => /* @__PURE__ */ jsx("div", {
|
|
1418
|
+
ref,
|
|
1419
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1420
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.RESIZE}`,
|
|
1421
|
+
className: `custom-handle custom-handle-${resizeHandle}`
|
|
1422
|
+
})
|
|
1423
|
+
}, resizeHandle),
|
|
1243
1424
|
children: /* @__PURE__ */ jsx(Window, {
|
|
1244
1425
|
...props
|
|
1245
1426
|
})
|
|
@@ -1439,6 +1620,10 @@ const WindowModal = (props) => {
|
|
|
1439
1620
|
const {
|
|
1440
1621
|
onClose
|
|
1441
1622
|
} = useAreasStore((state) => state.hashWindowsModals[windowId]);
|
|
1623
|
+
const {
|
|
1624
|
+
host_static_assets,
|
|
1625
|
+
environment_assets
|
|
1626
|
+
} = useEnvironment();
|
|
1442
1627
|
const isDesktop = useResponsiveDesktop();
|
|
1443
1628
|
const DragabblePaperComponent = (_props) => {
|
|
1444
1629
|
return /* @__PURE__ */ jsx(cjs.exports, {
|
|
@@ -1447,6 +1632,14 @@ const WindowModal = (props) => {
|
|
|
1447
1632
|
children: /* @__PURE__ */ jsx(ResizeableWindow, {
|
|
1448
1633
|
width: props.windowProps?.width || 400,
|
|
1449
1634
|
height: props.windowProps?.height || 300,
|
|
1635
|
+
className: areasViewerClasses.windowModalRoot,
|
|
1636
|
+
handle: (resizeHandle, ref) => /* @__PURE__ */ jsx("div", {
|
|
1637
|
+
ref,
|
|
1638
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1639
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.RESIZE}`,
|
|
1640
|
+
className: `custom-handle custom-handle-${resizeHandle}`
|
|
1641
|
+
})
|
|
1642
|
+
}, resizeHandle),
|
|
1450
1643
|
children: /* @__PURE__ */ jsx(Window, {
|
|
1451
1644
|
...props
|
|
1452
1645
|
})
|
|
@@ -5,8 +5,8 @@ import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
|
|
|
5
5
|
import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, EmitEvents } from "@m4l/core";
|
|
6
6
|
import { devtools } from "zustand/middleware";
|
|
7
7
|
import { immer } from "zustand/middleware/immer";
|
|
8
|
-
import { u as useAreasViewerUtilityClasses, a as useAreasAdminUtilityClasses, b as areasViewerClasses } from "../../components/index.
|
|
9
|
-
import { g as getAreasDictionary } from "../../index.
|
|
8
|
+
import { u as useAreasViewerUtilityClasses, a as useAreasAdminUtilityClasses, b as areasViewerClasses } from "../../components/index.31f39977.js";
|
|
9
|
+
import { g as getAreasDictionary } from "../../index.bd29b1db.js";
|
|
10
10
|
import { c as createDynamicMFStore } from "../DynamicMFParmsContext/index.1607c78e.js";
|
|
11
11
|
import { debounce, cloneDeep } from "lodash";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -260,6 +260,21 @@ const createAreasStore = (initProps) => {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
|
+
editArea: (idArea, newName) => {
|
|
264
|
+
set((state) => {
|
|
265
|
+
let index = state.areas.findIndex((element) => element.id === idArea);
|
|
266
|
+
if (index > -1 && state.areas[index].name !== newName) {
|
|
267
|
+
state.areas[index].name = newName;
|
|
268
|
+
state.networkOperation({
|
|
269
|
+
method: "PATCH",
|
|
270
|
+
endPoint: `areas/${idArea}`,
|
|
271
|
+
data: { name: newName },
|
|
272
|
+
toastSuccess: false,
|
|
273
|
+
toastError: false
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
},
|
|
263
278
|
addArea: () => {
|
|
264
279
|
let newId = "";
|
|
265
280
|
set((state) => {
|
|
@@ -131,6 +131,11 @@ export interface AreasStateWithActions extends AreasState {
|
|
|
131
131
|
* @returns id del ara de trabajo
|
|
132
132
|
*/
|
|
133
133
|
addArea: () => string;
|
|
134
|
+
/**
|
|
135
|
+
* @description Edita el nombre del área de trabajo y sincroniza los cambios en la API.
|
|
136
|
+
* @returns nombre del area de trabajo
|
|
137
|
+
*/
|
|
138
|
+
editArea: (idArea: string, newName: string) => void;
|
|
134
139
|
/**
|
|
135
140
|
*
|
|
136
141
|
* @param newAreaId Id de area a seleccionar
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./AreasContext/index.
|
|
1
|
+
import "./AreasContext/index.e14d6799.js";
|
|
2
2
|
import "./WindowToolsMFContext/index.8f3e2a04.js";
|
|
@@ -5,6 +5,8 @@ export declare const DICCTIONARY: {
|
|
|
5
5
|
readonly label_new_area: "label_new_area";
|
|
6
6
|
readonly label_persist_module_cookies: "label_persist_module_cookies";
|
|
7
7
|
readonly label_reset_module_cookies: "label_reset_module_cookies";
|
|
8
|
+
readonly validation_edit_area: "validation_edit_area";
|
|
9
|
+
readonly label_edit_area: "label_edit_area";
|
|
8
10
|
};
|
|
9
11
|
export declare type TypeDictionary = typeof DICCTIONARY;
|
|
10
12
|
export declare const getAreasDictionary: (key: keyof TypeDictionary) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { useStore } from "zustand";
|
|
3
|
-
import { A as AreasContext } from "../../contexts/AreasContext/index.
|
|
3
|
+
import { A as AreasContext } from "../../contexts/AreasContext/index.e14d6799.js";
|
|
4
4
|
function useAreasStore(selector, equalityFn) {
|
|
5
5
|
const context = useContext(AreasContext);
|
|
6
6
|
if (!context)
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "@m4l/core";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import "../Icon/index.
|
|
5
|
-
import "react/jsx-runtime";
|
|
6
|
-
import "../mui_extended/IconButton/index.57824447.js";
|
|
4
|
+
import "../Icon/index.6f2a5618.js";
|
|
7
5
|
import "clsx";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "../mui_extended/IconButton/index.7aab3e04.js";
|
|
8
|
+
import "@m4l/graphics";
|
|
8
9
|
import "zustand";
|
|
9
|
-
import "./contexts/AreasContext/index.
|
|
10
|
-
import "./components/index.
|
|
10
|
+
import "./contexts/AreasContext/index.e14d6799.js";
|
|
11
|
+
import "./components/index.31f39977.js";
|
|
11
12
|
import "zustand/shallow";
|
|
13
|
+
import "../ScrollBar/index.bbe48f4d.js";
|
|
12
14
|
import "./contexts/WindowToolsMFContext/index.8f3e2a04.js";
|
|
13
15
|
import "./contexts/DynamicMFParmsContext/index.1607c78e.js";
|
|
14
16
|
const AREAS_VIEWER_CLASS_NAME = "M4LAreasViewer";
|
|
@@ -21,7 +23,9 @@ const LABEL_FILTER_BUTTON = "filter_tooltip";
|
|
|
21
23
|
const DICCTIONARY = {
|
|
22
24
|
label_new_area: "label_new_area",
|
|
23
25
|
label_persist_module_cookies: "label_persist_module_cookies",
|
|
24
|
-
label_reset_module_cookies: "label_reset_module_cookies"
|
|
26
|
+
label_reset_module_cookies: "label_reset_module_cookies",
|
|
27
|
+
validation_edit_area: "validation_edit_area",
|
|
28
|
+
label_edit_area: "label_edit_area"
|
|
25
29
|
};
|
|
26
30
|
const getAreasDictionary = (key) => {
|
|
27
31
|
return `${AREAS_DICTIONARY_ID}.${key}`;
|
|
@@ -35,7 +39,9 @@ const ICONS = {
|
|
|
35
39
|
DELETE_AREA: "delete_area.svg",
|
|
36
40
|
ADD_AREA: "add_area.svg",
|
|
37
41
|
LAYERS: "layers.svg",
|
|
38
|
-
EDIT_AREA: "
|
|
42
|
+
EDIT_AREA: "edit.svg",
|
|
43
|
+
CHECK: "checkmarkInCircle.svg",
|
|
44
|
+
RESIZE: "controlSize.svg",
|
|
39
45
|
VERSION: "version.svg"
|
|
40
46
|
};
|
|
41
47
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
|
-
import { I as Icon } from "../../Icon/index.
|
|
3
|
+
import { I as Icon } from "../../Icon/index.6f2a5618.js";
|
|
4
4
|
import { W as WrapperComponent } from "../../WrapperComponent/index.5e872594.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
const BOOLEAN_FORMATTER_DICTIONARY_KEY = `boolean_formatter`;
|
|
@@ -2,10 +2,11 @@ import { W as WrapperComponent } from "../WrapperComponent/index.5e872594.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import "react";
|
|
5
|
-
import "../Icon/index.
|
|
5
|
+
import "../Icon/index.6f2a5618.js";
|
|
6
6
|
import "@mui/material";
|
|
7
|
+
import "clsx";
|
|
7
8
|
import "@m4l/graphics";
|
|
8
|
-
import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY, b as BOOLEAN_FORMATTER_DICTIONARY_LABELS } from "./BooleanFormatter/index.
|
|
9
|
+
import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY, b as BOOLEAN_FORMATTER_DICTIONARY_LABELS } from "./BooleanFormatter/index.99c7fe49.js";
|
|
9
10
|
function getFormatConcatenated(values, separator) {
|
|
10
11
|
const returnSymbol = "";
|
|
11
12
|
if (values === null)
|