@m4l/components 0.1.71 → 0.1.72

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.
Files changed (69) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.ff90f2c0.js → index.07ba5a89.js} +2 -2
  2. package/components/CommonActions/components/ActionFormCancel/{index.392a17c0.js → index.9bdae569.js} +19 -18
  3. package/components/CommonActions/components/ActionFormIntro/{index.f88d8849.js → index.e077d11f.js} +2 -2
  4. package/components/CommonActions/components/ActionIntro/{index.e31ab7e9.js → index.a454d0e4.js} +3 -3
  5. package/components/CommonActions/components/Actions/{index.6b7d480a.js → index.e190561b.js} +18 -17
  6. package/components/DataGrid/{index.77ae9b4c.js → index.549bd646.js} +20 -19
  7. package/components/DynamicFilter/{index.b2ba5167.js → index.c1a3e2f1.js} +31 -30
  8. package/components/HelperText/{index.d7b1b21a.js → index.4c27bfc1.js} +8 -8
  9. package/components/Icon/{index.6f2a5618.js → index.9839297c.js} +2 -2
  10. package/components/Image/{index.1e3b7ff6.js → index.a88f6341.js} +1 -1
  11. package/components/LanguagePopover/{index.310e9a3a.js → index.84c51cd3.js} +9 -9
  12. package/components/ModalDialog/{index.598f9a86.js → index.75ddf6de.js} +7 -7
  13. package/components/NavLink/{index.ac3778af.js → index.e88494ef.js} +9 -9
  14. package/components/NoItemSelected/{index.3809e3d1.js → index.c3b67da1.js} +1 -1
  15. package/components/ObjectLogs/{index.949d3595.js → index.88bcf75a.js} +16 -15
  16. package/components/PaperForm/{index.cf8af08b.js → index.b141d583.js} +1 -1
  17. package/components/Period/{index.53ea0562.js → index.2ab4f2a1.js} +18 -17
  18. package/components/Resizeable/{index.ff4ce7a4.js → index.086ff29e.js} +1 -1
  19. package/components/SideBar/{index.4daafbab.js → index.90137dc5.js} +6 -6
  20. package/components/areas/components/AreasAdmin/index.218451cf.js +289 -0
  21. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +1 -1
  22. package/components/areas/components/{index.31f39977.js → AreasViewer/index.51ee3d38.js} +69 -296
  23. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +3 -3
  24. package/components/areas/components/index.ae4cbf2e.js +14 -0
  25. package/components/areas/constants.66529246.js +6 -0
  26. package/components/areas/contexts/AreasContext/helper.d.ts +6 -4
  27. package/components/areas/contexts/AreasContext/{index.e14d6799.js → index.0b50676d.js} +88 -16
  28. package/components/areas/contexts/AreasContext/types.d.ts +3 -3
  29. package/components/areas/contexts/DynamicMFParmsContext/store.d.ts +1 -1
  30. package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +1 -1
  31. package/components/areas/contexts/WindowToolsMFContext/types.d.ts +2 -10
  32. package/components/areas/contexts/{index.5ba05323.js → index.b0ce327e.js} +1 -1
  33. package/components/areas/contexts/index.d.ts +2 -1
  34. package/components/areas/dictionary.e72db809.js +22 -0
  35. package/components/areas/hooks/index.0184c6f7.js +4 -0
  36. package/components/areas/hooks/{useArea/index.c135e0cf.js → useAreas/index.e868e3d9.js} +1 -1
  37. package/components/areas/hooks/{index.ae8d8631.js → useWindowToolsMF/index.b7afaf88.js} +1 -3
  38. package/components/areas/icons.b36751f2.js +17 -0
  39. package/components/areas/index.05b7b8e2.js +16 -0
  40. package/components/areas/types.d.ts +25 -3
  41. package/components/formatters/BooleanFormatter/{index.99c7fe49.js → index.e610de08.js} +1 -1
  42. package/components/formatters/{index.1a92006b.js → index.982e909b.js} +2 -2
  43. package/components/hook-form/RHFAutocomplete/{index.c4ba070a.js → index.b185393e.js} +10 -10
  44. package/components/hook-form/RHFAutocompleteAsync/{index.a63f3704.js → index.7a569646.js} +2 -2
  45. package/components/hook-form/RHFCheckbox/{index.9055f88d.js → index.7a9ea396.js} +3 -3
  46. package/components/hook-form/RHFDateTime/{index.2cb94a66.js → index.2fd1d56b.js} +9 -9
  47. package/components/hook-form/RHFPeriod/{index.14dcf762.js → index.df3d3f69.js} +2 -2
  48. package/components/hook-form/RHFTextField/{index.7ce2b16e.js → index.e1b50c30.js} +6 -6
  49. package/components/hook-form/RHFUpload/{index.c57a43f8.js → index.ec977af6.js} +1 -1
  50. package/components/modal/{WindowBase.32d35d71.js → WindowBase.e5ec6128.js} +10 -10
  51. package/components/modal/{WindowConfirm.70bcbb69.js → WindowConfirm.b89712de.js} +16 -15
  52. package/components/modal/index.97752555.js +36 -0
  53. package/components/mui_extended/Accordion/{index.44e96bb8.js → index.d420b666.js} +2 -2
  54. package/components/mui_extended/Button/{index.ec6525e0.js → index.1cd0c4e4.js} +3 -3
  55. package/components/mui_extended/IconButton/{index.7aab3e04.js → index.590049b4.js} +1 -1
  56. package/components/mui_extended/MenuActions/{index.bff47c06.js → index.f9eb6463.js} +2 -2
  57. package/components/mui_extended/Pager/{index.907d5801.js → index.c058b933.js} +1 -1
  58. package/components/mui_extended/Typography/{index.d5e0f69f.js → index.1659d310.js} +1 -1
  59. package/components/mui_extended/{index.1f766f93.js → index.ec312b5a.js} +8 -8
  60. package/contexts/ModalContext/{index.fca184e2.js → index.92e80136.js} +1 -1
  61. package/hooks/useModal/{index.9b244379.js → index.18a7cb8f.js} +1 -1
  62. package/index.js +84 -81
  63. package/package.json +4 -4
  64. package/{react-draggable.29f78f6d.js → react-draggable.21aa9ee1.js} +1 -1
  65. package/{react-resizable.baf54eb2.js → react-resizable.e78d1cc8.js} +2 -2
  66. package/utils/{index.ee16888d.js → index.8608d16c.js} +1 -1
  67. package/{vendor.619c3533.js → vendor.d194839d.js} +45 -44
  68. package/components/areas/index.bd29b1db.js +0 -56
  69. package/components/modal/index.ef3aa9ac.js +0 -35
@@ -1,83 +1,84 @@
1
- import { I as IconButton } from "../../mui_extended/IconButton/index.7aab3e04.js";
2
- import { u as useAreasStore } from "../hooks/useArea/index.c135e0cf.js";
3
- import { useEnvironment, useModuleDictionary, useModuleSkeleton, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
1
+ import { styled } from "@mui/material/styles";
2
+ import { r as react_resizable_css } from "../../../../react-resizable.e78d1cc8.js";
3
+ import { generateUtilityClasses, Skeleton, styled as styled$1, Typography as Typography$1, Dialog } from "@mui/material";
4
+ import { unstable_composeClasses } from "@mui/base";
5
+ import { g as getComponentUtilityClass } from "../../../../utils/index.8608d16c.js";
6
+ import { a as AREAS_VIEWER_CLASS_NAME } from "../../constants.66529246.js";
7
+ import React__default, { useMemo, useState, useRef, useCallback, useEffect } from "react";
8
+ import { WidthProvider, Responsive } from "react-grid-layout";
4
9
  import { shallow } from "zustand/shallow";
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";
10
+ import { I as Icon } from "../../../Icon/index.9839297c.js";
11
+ import { m } from "framer-motion";
8
12
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
9
- import React__default, { useState, useRef, useMemo, useCallback, useEffect } from "react";
10
- import { generateUtilityClasses, Skeleton, styled as styled$1, Typography as Typography$1, Dialog } from "@mui/material";
13
+ import "react-router-dom";
14
+ import "../../../animate/LoadingScreen/index.1d0c4307.js";
15
+ import "../../../animate/PropagateLoader/index.be5b02c3.js";
16
+ import { useModuleDictionary, useEnvironment, useModuleSkeleton, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
17
+ import { I as IconButton } from "../../../mui_extended/IconButton/index.590049b4.js";
11
18
  import clsx from "clsx";
12
19
  import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender, useResizeObserver } from "@m4l/graphics";
20
+ import { u as useAreasStore } from "../../hooks/useAreas/index.e868e3d9.js";
21
+ import "../AreasAdmin/index.218451cf.js";
22
+ import { I as ICONS } from "../../icons.b36751f2.js";
23
+ import "../../../ScrollBar/index.bbe48f4d.js";
24
+ import { R as ROW_HEIGTH_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, C as CONTAINER_PADDING_GRIDLAYOUT, T as THROTTLE_RESIZE_TIME } from "../../contexts/AreasContext/index.0b50676d.js";
25
+ import { W as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/index.8f3e2a04.js";
13
26
  import "zustand";
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";
17
- import "../../mui_extended/Avatar/index.fe06afd7.js";
18
- import "react-router-dom";
27
+ import { D as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/index.1607c78e.js";
28
+ import "react-hook-form";
29
+ import "../../../hook-form/RHFAutocomplete/index.b185393e.js";
30
+ import { I as Image } from "../../../Image/index.a88f6341.js";
31
+ import { T as Typography } from "../../../mui_extended/Typography/index.1659d310.js";
32
+ import "../../../mui_extended/Accordion/index.d420b666.js";
33
+ import "../../../mui_extended/Avatar/index.fe06afd7.js";
19
34
  import "@mui/material/Button";
20
- import { B as Button } from "../../mui_extended/Button/index.ec6525e0.js";
21
- import { I as Image } from "../../Image/index.1e3b7ff6.js";
35
+ import { B as Button } from "../../../mui_extended/Button/index.1cd0c4e4.js";
22
36
  import "@mui/lab";
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";
27
- import "../../mui_extended/Tab/index.e0653a0a.js";
28
- import { unstable_composeClasses } from "@mui/base";
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";
37
+ import "../../../mui_extended/Popover/index.9f35d0eb.js";
38
+ import { M as MenuActions } from "../../../mui_extended/MenuActions/index.f9eb6463.js";
39
+ import "../../../mui_extended/Pager/index.c058b933.js";
40
+ import "../../../mui_extended/Tab/index.e0653a0a.js";
41
+ import "../../../HelperText/index.4c27bfc1.js";
36
42
  import debounce from "lodash/debounce";
37
- import "../../hook-form/RHFAutocompleteAsync/index.a63f3704.js";
38
- import "../../hook-form/RHFCheckbox/index.9055f88d.js";
43
+ import "../../../hook-form/RHFAutocompleteAsync/index.7a569646.js";
44
+ import "../../../hook-form/RHFCheckbox/index.7a9ea396.js";
39
45
  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";
52
- import { styled } from "@mui/material/styles";
53
- import { r as react_resizable_css } from "../../../react-resizable.baf54eb2.js";
54
- import { WidthProvider, Responsive } from "react-grid-layout";
55
- import { m } from "framer-motion";
56
- import "../../animate/LoadingScreen/index.1d0c4307.js";
57
- import "../../animate/PropagateLoader/index.be5b02c3.js";
58
- import { W as WindowToolsMFProvider } from "../contexts/WindowToolsMFContext/index.8f3e2a04.js";
46
+ import "../../../hook-form/RHFDateTime/index.2fd1d56b.js";
47
+ import "../../../hook-form/RHFTextField/index.e1b50c30.js";
48
+ import "../../../hook-form/RHFPeriod/index.df3d3f69.js";
49
+ import "../../../Period/index.2ab4f2a1.js";
50
+ import "../../../CommonActions/components/Actions/index.e190561b.js";
51
+ import "../../../../contexts/ModalContext/index.92e80136.js";
52
+ import { c as cjs } from "../../../../react-draggable.21aa9ee1.js";
53
+ import "../../../ModalDialog/index.75ddf6de.js";
54
+ import { R as ResizeableWindow } from "../../../Resizeable/index.086ff29e.js";
55
+ import "../../../modal/WindowConfirm.b89712de.js";
56
+ import "../../../modal/WindowBase.e5ec6128.js";
59
57
  import "lodash/isString";
60
58
  import "react-dropzone";
61
- import "../../hook-form/RHFUpload/index.c57a43f8.js";
62
- import "../../DataGrid/index.77ae9b4c.js";
59
+ import "../../../hook-form/RHFUpload/index.ec977af6.js";
60
+ import "../../../DataGrid/index.549bd646.js";
63
61
  import "react-dnd";
64
62
  import "react-dnd-html5-backend";
65
- import "../../DynamicFilter/index.b2ba5167.js";
63
+ import "../../../DynamicFilter/index.c1a3e2f1.js";
64
+ import "yup";
66
65
  import "@hookform/resolvers/yup";
67
- import "../../LanguagePopover/index.310e9a3a.js";
68
- import "../../NavLink/index.ac3778af.js";
69
- import "../../NoItemSelected/index.3809e3d1.js";
70
- import "../../ObjectLogs/index.949d3595.js";
71
- import "../../../react-json-view.57125fcf.js";
72
- import "../../PaperForm/index.cf8af08b.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.4daafbab.js";
78
- import { D as DraggableWindow } from "../../../vendor.619c3533.js";
79
- import { L as LinearProgress } from "../../mui_extended/LinearProgress/index.c92b9ba9.js";
80
- import { v as varBounce } from "../../animate/variants/bounce.784aaaaa.js";
66
+ import "../../../../contexts/RHFormContext/index.a7511399.js";
67
+ import "../../../LanguagePopover/index.84c51cd3.js";
68
+ import "../../../NavLink/index.e88494ef.js";
69
+ import "../../../NoItemSelected/index.c3b67da1.js";
70
+ import "../../../ObjectLogs/index.88bcf75a.js";
71
+ import "../../../../react-json-view.57125fcf.js";
72
+ import "../../../PaperForm/index.b141d583.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.90137dc5.js";
78
+ import { D as DraggableWindow } from "../../../../vendor.d194839d.js";
79
+ import { g as getAreasDictionary } from "../../dictionary.e72db809.js";
80
+ import { L as LinearProgress } from "../../../mui_extended/LinearProgress/index.c92b9ba9.js";
81
+ import { v as varBounce } from "../../../animate/variants/bounce.784aaaaa.js";
81
82
  import { throttle } from "lodash";
82
83
  const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
83
84
  "root",
@@ -121,232 +122,6 @@ const useAreasViewerUtilityClasses = (ownerState) => {
121
122
  };
122
123
  return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_VIEWER_CLASS_NAME), {});
123
124
  };
124
- const areasAdminClasses = generateUtilityClasses(AREAS_ADMIN_CLASS_NAME, [
125
- "root",
126
- "areaChipRoot",
127
- "areaChipTitle",
128
- "areaChipDeleteButton",
129
- "areasAddButton",
130
- "areaContainerChips",
131
- "areaIconLayer",
132
- "areaChipEditButton",
133
- "selected",
134
- "isMobile",
135
- "disabled"
136
- ], AREAS_ADMIN_CLASS_NAME);
137
- const useAreasAdminUtilityClasses = (ownerState) => {
138
- const slots = {
139
- root: ["root", ownerState.status, ownerState.isMobile && "isMobile", ownerState.isSkeleton && "isSkeleton"],
140
- areaChipRoot: ["areaChipRoot"],
141
- areaIconLayer: ["areaIconLayer"],
142
- areaContainerChips: ["areaContainerChips"],
143
- areaChipTitle: ["areaChipTitle"],
144
- areaChipDeleteButton: ["areaChipDeleteButton"],
145
- areaChipEditButton: ["areaChipEditButton"],
146
- areasAddButton: ["areasAddButton"]
147
- };
148
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
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
- }));
179
- const AreaChip = (props) => {
180
- const {
181
- areaId,
182
- selected,
183
- areaName,
184
- disabled
185
- } = props;
186
- const {
187
- host_static_assets,
188
- environment_assets
189
- } = useEnvironment();
190
- const {
191
- deleteArea,
192
- selectArea,
193
- editArea
194
- } = useAreasStore((state) => state.areasActions);
195
- const [open, setOpen] = useState(false);
196
- const {
197
- getLabel
198
- } = useModuleDictionary();
199
- const anchorRef = useRef(null);
200
- const onClickDeleteArea = (e) => {
201
- e.stopPropagation();
202
- deleteArea(areaId);
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]);
218
- return /* @__PURE__ */ jsxs("div", {
219
- role: "presentation",
220
- className: clsx(areasAdminClasses.areaChipRoot, selected ? areasAdminClasses.selected : null, disabled ? areasAdminClasses.disabled : null),
221
- onClick: () => {
222
- selectArea(areaId);
223
- },
224
- ref: anchorRef,
225
- children: [/* @__PURE__ */ jsx("div", {
226
- className: areasAdminClasses.areaChipTitle,
227
- children: areaName
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
- })
288
- })]
289
- });
290
- };
291
- AreaChip.displayName = "AreaButtons";
292
- const AreasAdminRoot = styled("div")`
293
- display: flex;
294
- position: relative;
295
-
296
- //areaRoot
297
- & .${areasAdminClasses.areaChipRoot} {
298
- display: flex;
299
- }
300
-
301
-
302
- ${(props) => props.theme.components?.M4LAreasAdmin?.styleOverrides}
303
-
304
-
305
- `;
306
- function AreasAdmin() {
307
- const areas = useAreasStore((state) => state.areas, shallow);
308
- const currentArea = useAreasStore((state) => state.currentAreaId, shallow);
309
- const status = useAreasStore((state) => state.ownerState.status);
310
- const classesRoot = useAreasStore((state) => state.adminClasses.root);
311
- const areasLength = useAreasStore((state) => state.areas.length);
312
- const {
313
- addArea
314
- } = useAreasStore((state) => state.areasActions, shallow);
315
- const {
316
- host_static_assets,
317
- environment_assets
318
- } = useEnvironment();
319
- console.log("Render AreasAdmin", areas);
320
- if (status !== "loaded") {
321
- return null;
322
- }
323
- return /* @__PURE__ */ jsxs(AreasAdminRoot, {
324
- className: classesRoot,
325
- children: [/* @__PURE__ */ jsx("div", {
326
- className: areasAdminClasses.areaIconLayer,
327
- children: /* @__PURE__ */ jsx(Icon, {
328
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`
329
- })
330
- }), /* @__PURE__ */ jsx("div", {
331
- className: areasAdminClasses.areaContainerChips,
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
- })
342
- }), /* @__PURE__ */ jsx(IconButton, {
343
- className: areasAdminClasses.areasAddButton,
344
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
345
- size: "small",
346
- onClick: addArea
347
- })]
348
- });
349
- }
350
125
  const AreasViewerRoot = styled("div")`
351
126
  /* display: flex; */
352
127
  width: 100%;
@@ -1699,9 +1474,7 @@ function AreasViewer() {
1699
1474
  });
1700
1475
  }
1701
1476
  export {
1702
- AreasAdmin as A,
1703
- useAreasAdminUtilityClasses as a,
1704
- areasViewerClasses as b,
1705
- AreasViewer as c,
1477
+ AreasViewer as A,
1478
+ areasViewerClasses as a,
1706
1479
  useAreasViewerUtilityClasses as u
1707
1480
  };
@@ -1,3 +1,3 @@
1
- import { ModuleAction } from '../../../../../../../../contexts';
2
- export declare function getMainActions(isDesktop: boolean | undefined, moduleActions: ModuleAction[]): ModuleAction[];
3
- export declare function getMenuActions(windowId: string, isDesktop: boolean | undefined, moduleActions: ModuleAction[], urlPrefix: string, saveModuleCookies: (wd: string) => void, resetModuleCookies: (wd: string) => void, version?: string): ModuleAction[];
1
+ import { AreaWindowAction } from '../../../../../../../../types';
2
+ export declare function getMainActions(isDesktop: boolean | undefined, moduleActions: AreaWindowAction[]): AreaWindowAction[];
3
+ export declare function getMenuActions(windowId: string, isDesktop: boolean | undefined, moduleActions: AreaWindowAction[], urlPrefix: string, saveModuleCookies: (wd: string) => void, resetModuleCookies: (wd: string) => void, version?: string): AreaWindowAction[];
@@ -0,0 +1,14 @@
1
+ import "react";
2
+ import "@m4l/core";
3
+ import "@mui/material";
4
+ import "../../Icon/index.9839297c.js";
5
+ import "clsx";
6
+ import "react/jsx-runtime";
7
+ import "../../mui_extended/IconButton/index.590049b4.js";
8
+ import "@m4l/graphics";
9
+ import "zustand";
10
+ import "../contexts/AreasContext/index.0b50676d.js";
11
+ import "./AreasAdmin/index.218451cf.js";
12
+ import "zustand/shallow";
13
+ import "../../ScrollBar/index.bbe48f4d.js";
14
+ import "./AreasViewer/index.51ee3d38.js";
@@ -0,0 +1,6 @@
1
+ const AREAS_VIEWER_CLASS_NAME = "M4LAreasViewer";
2
+ const AREAS_ADMIN_CLASS_NAME = "M4LAreasAdmin";
3
+ export {
4
+ AREAS_ADMIN_CLASS_NAME as A,
5
+ AREAS_VIEWER_CLASS_NAME as a
6
+ };
@@ -1,8 +1,8 @@
1
1
  import { WritableDraft } from 'immer/dist/internal';
2
- import { Layouts } from 'react-grid-layout';
3
- import { Area, AreasStateWithActions } from './types';
4
- import { WinLayout } from './types';
5
- import { HashWindowsByLayouts } from '../../types';
2
+ import type { Layouts } from 'react-grid-layout';
3
+ import type { Area, AreasStateWithActions } from './types';
4
+ import type { WinLayout } from './types';
5
+ import type { HashWindowsByLayouts, WindowState, WindowStateProps } from '../../types';
6
6
  export declare const ROW_HEIGTH_GRIDLAYOUT = 20;
7
7
  export declare const CONTAINER_PADDING_GRIDLAYOUT = 3;
8
8
  export declare const MARGIN_GRIDLAYOUT = 5;
@@ -31,6 +31,7 @@ export declare const MAXIMIZED_COLS: {
31
31
  xs: number;
32
32
  xxs: number;
33
33
  };
34
+ export declare const DEFAULT_WINDOW: Pick<WindowState, 'status' | 'moduleActions' | 'cookies' | 'loading' | 'tosties' | 'toastyCount'>;
34
35
  export declare const DEFAULT_AREA: Omit<Area, 'id' | 'name' | 'loadWindows' | 'viewMode'>;
35
36
  /**
36
37
  * @description Función de apoyo que crea un área de trabajo,
@@ -57,3 +58,4 @@ export declare function getDataFromResponse(data: any, state: WritableDraft<Area
57
58
  newHashWindowLayouts: HashWindowsByLayouts;
58
59
  };
59
60
  export declare function getCookiesContainer(data: any, containerId: string): Record<string, any>;
61
+ export declare const removeToasty: (state: WritableDraft<WindowStateProps>, toastyId: number) => void;
@@ -5,9 +5,10 @@ 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.31f39977.js";
9
- import { g as getAreasDictionary } from "../../index.bd29b1db.js";
8
+ import { u as useAreasViewerUtilityClasses, a as areasViewerClasses } from "../../components/AreasViewer/index.51ee3d38.js";
9
+ import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/index.218451cf.js";
10
10
  import { c as createDynamicMFStore } from "../DynamicMFParmsContext/index.1607c78e.js";
11
+ import { g as getAreasDictionary } from "../../dictionary.e72db809.js";
11
12
  import { debounce, cloneDeep } from "lodash";
12
13
  import { jsx } from "react/jsx-runtime";
13
14
  const ROW_HEIGTH_GRIDLAYOUT = 20;
@@ -20,6 +21,14 @@ const COOKIE_WINDOWS = "windows";
20
21
  const BREAKPOINT_SIZES = { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 };
21
22
  const NORMALIZED_COLS = { lg: 24, md: 20, sm: 12, xs: 8, xxs: 1 };
22
23
  const MAXIMIZED_COLS = { lg: 24, md: 20, sm: 12, xs: 8, xxs: 1 };
24
+ const DEFAULT_WINDOW = {
25
+ status: "init",
26
+ moduleActions: [],
27
+ cookies: { moduleCookies: {}, windowCookies: {} },
28
+ loading: false,
29
+ tosties: [],
30
+ toastyCount: 0
31
+ };
23
32
  const DEFAULT_AREA = {
24
33
  status: "init",
25
34
  zPopUpIndex: 0,
@@ -36,7 +45,23 @@ const DEFAULT_AREA = {
36
45
  };
37
46
  const addArea = (state) => {
38
47
  const areaId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
39
- const name = `${state.getLabel(getAreasDictionary("label_new_area"))} ${state.areas.length + 1}`;
48
+ const labelNewArea = state.getLabel(getAreasDictionary("label_new_area"));
49
+ let isFree;
50
+ let name = `${labelNewArea} 1`;
51
+ for (let indexNames = 1; indexNames <= state.areas.length + 1; indexNames++) {
52
+ name = `${labelNewArea} ${indexNames + state.areas.length}`;
53
+ isFree = true;
54
+ for (let index = 0; index < state.areas.length; index++) {
55
+ const area = state.areas[index];
56
+ if (area.name === name) {
57
+ isFree = false;
58
+ break;
59
+ }
60
+ }
61
+ if (isFree) {
62
+ break;
63
+ }
64
+ }
40
65
  const newArea = {
41
66
  id: areaId,
42
67
  name,
@@ -195,6 +220,16 @@ function getCookiesContainer(data, containerId) {
195
220
  }
196
221
  return cookies;
197
222
  }
223
+ const removeToasty = (state, toastyId) => {
224
+ const tosties = state.tosties;
225
+ for (let i = 0; i < tosties.length; i++) {
226
+ const findToasty = tosties[i];
227
+ if (findToasty.id === toastyId) {
228
+ state.tosties.splice(i, 1);
229
+ return;
230
+ }
231
+ }
232
+ };
198
233
  const createAreasStore = (initProps) => {
199
234
  const startProps = {
200
235
  viwerClasses: useAreasViewerUtilityClasses(initProps.ownerState),
@@ -262,7 +297,7 @@ const createAreasStore = (initProps) => {
262
297
  },
263
298
  editArea: (idArea, newName) => {
264
299
  set((state) => {
265
- let index = state.areas.findIndex((element) => element.id === idArea);
300
+ const index = state.areas.findIndex((element) => element.id === idArea);
266
301
  if (index > -1 && state.areas[index].name !== newName) {
267
302
  state.areas[index].name = newName;
268
303
  state.networkOperation({
@@ -397,10 +432,7 @@ const createAreasStore = (initProps) => {
397
432
  ...newWindowModalProps,
398
433
  areaId,
399
434
  windowId,
400
- status: "init",
401
- moduleActions: [],
402
- cookies: { moduleCookies: {}, windowCookies: {} },
403
- loading: false,
435
+ ...DEFAULT_WINDOW,
404
436
  onClose: get().areaActions.closeWindowModal,
405
437
  dynamicMFStore
406
438
  };
@@ -481,10 +513,7 @@ const createAreasStore = (initProps) => {
481
513
  areaId,
482
514
  onClose: (removePopUpId) => get().areaActions.closeWindowPopUp(areaId, removePopUpId),
483
515
  zIndex: area.zPopUpIndex,
484
- status: "init",
485
- moduleActions: [],
486
- cookies: { moduleCookies: {}, windowCookies: {} },
487
- loading: false,
516
+ ...DEFAULT_WINDOW,
488
517
  dynamicMFStore
489
518
  };
490
519
  state.hashWindows[windowId] = area.hashWindowsPopups[windowId];
@@ -540,10 +569,7 @@ const createAreasStore = (initProps) => {
540
569
  onClose: (removeLayoutId) => {
541
570
  get().areaActions.closeWindowLayout(areaId, removeLayoutId);
542
571
  },
543
- status: "init",
544
- moduleActions: [],
545
- cookies: { moduleCookies: {}, windowCookies: {} },
546
- loading: false,
572
+ ...DEFAULT_WINDOW,
547
573
  dynamicMFStore
548
574
  };
549
575
  state.hashWindows[windowId] = area.hashWindowsLayouts[windowId];
@@ -924,6 +950,52 @@ const createAreasStore = (initProps) => {
924
950
  toastError: false
925
951
  });
926
952
  }
953
+ },
954
+ toasty: (windowId, options) => {
955
+ const hW = get().hashWindows[windowId];
956
+ if (hW) {
957
+ if (options.replaceMeId) {
958
+ for (let index = 0; index < hW.tosties.length; index++) {
959
+ const t = hW.tosties[index];
960
+ if (options.replaceMeId === t.replaceMeId) {
961
+ const toastyId = t.id;
962
+ if (t.timer) {
963
+ clearTimeout(t.timer);
964
+ }
965
+ set((stateSetTimer) => {
966
+ stateSetTimer.hashWindows[windowId].tosties[index].timer = setTimeout(() => {
967
+ set((state) => {
968
+ removeToasty(
969
+ state.hashWindows[windowId],
970
+ toastyId
971
+ );
972
+ });
973
+ }, t.timeoutMs);
974
+ });
975
+ return;
976
+ }
977
+ }
978
+ }
979
+ set((state) => {
980
+ const timeoutMs = options.timeoutMs || 1e4;
981
+ state.hashWindows[windowId].toastyCount++;
982
+ const toastyId = state.hashWindows[windowId].toastyCount;
983
+ const newToasty = {
984
+ id: state.hashWindows[windowId].toastyCount,
985
+ ...options,
986
+ timeoutMs,
987
+ timer: setTimeout(() => {
988
+ set((stateRemoveToasty) => {
989
+ removeToasty(
990
+ stateRemoveToasty.hashWindows[windowId],
991
+ toastyId
992
+ );
993
+ });
994
+ }, timeoutMs)
995
+ };
996
+ state.hashWindows[windowId].tosties.push(newToasty);
997
+ });
998
+ }
927
999
  }
928
1000
  }
929
1001
  })),
@@ -1,10 +1,9 @@
1
1
  import { GetLabelType, NetworkProps } from '@m4l/core';
2
2
  import { ReactNode } from 'react';
3
- import { CookieType, HashWindowsByLayouts, HashWindowsByModals, HashWindowsByPopups, ModalStateProps, NewLayoutProps, NewModalProps, NewPopUpProps, NewWindowProps, WinType, WindowStateProps } from '../../types';
3
+ import { CookieType, HashWindowsByLayouts, HashWindowsByModals, HashWindowsByPopups, ModalStateProps, AreaWindowAction, NewLayoutProps, NewModalProps, NewPopUpProps, NewWindowProps, ToastyOptions, WinType, WindowStateProps } from '../../types';
4
4
  import { ViwerClasses } from '../../components/AreasViewer/classes';
5
5
  import { AdminClasses } from '../../components/AreasAdmin/classes';
6
6
  import { Layout, Layouts } from 'react-grid-layout';
7
- import { ModuleAction } from '../..';
8
7
  import { DebouncedFunc } from 'lodash';
9
8
  export declare type WinLayout = Layout & {
10
9
  winType: WinType;
@@ -181,7 +180,7 @@ export interface AreasStateWithActions extends AreasState {
181
180
  loadWindowsFromApi: (areaId: string) => void;
182
181
  };
183
182
  windowActions: {
184
- setActions: (windowId: string, newActions: ModuleAction[], version?: string) => void;
183
+ setActions: (windowId: string, newActions: AreaWindowAction[], version?: string) => void;
185
184
  getCookie: (windowId: string, id: string) => Record<string, any> | undefined;
186
185
  getCookies: (windowId: string, type: CookieType) => Record<string, any>;
187
186
  setCookie: (windowId: string, id: string, type: CookieType, cookie: Record<string, any>) => void;
@@ -190,6 +189,7 @@ export interface AreasStateWithActions extends AreasState {
190
189
  loadCookiesFromApi: (windowId: string) => void;
191
190
  saveModuleCookies: (windowId: string) => void;
192
191
  resetModuleCookies: (windowId: string) => void;
192
+ toasty: (windowId: string, options: ToastyOptions) => void;
193
193
  };
194
194
  }
195
195
  export declare type DefaultAreasStoreProps = Omit<AreasState, 'currentArea'>;
@@ -1,4 +1,4 @@
1
- import { DynamicMFParameters } from '..';
1
+ import { DynamicMFParameters } from './types';
2
2
  export interface DynamicMFState {
3
3
  dynamicMFParameters: DynamicMFParameters;
4
4
  windowId: string;