@m4l/components 0.1.71 → 0.1.73

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 (75) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.ff90f2c0.js → index.583dd385.js} +2 -2
  2. package/components/CommonActions/components/ActionFormCancel/{index.392a17c0.js → index.673cb6bc.js} +19 -18
  3. package/components/CommonActions/components/ActionFormIntro/{index.f88d8849.js → index.ca18700c.js} +2 -2
  4. package/components/CommonActions/components/ActionIntro/{index.e31ab7e9.js → index.41d66b77.js} +3 -3
  5. package/components/CommonActions/components/Actions/{index.6b7d480a.js → index.665b1d56.js} +18 -17
  6. package/components/DataGrid/{index.77ae9b4c.js → index.860f4d1c.js} +20 -19
  7. package/components/DynamicFilter/{index.b2ba5167.js → index.09d83f9d.js} +31 -30
  8. package/components/HelperText/{index.d7b1b21a.js → index.581ddb8f.js} +8 -8
  9. package/components/Icon/{index.6f2a5618.js → index.4eeb3de9.js} +2 -2
  10. package/components/Image/{index.1e3b7ff6.js → index.52c84d9f.js} +1 -1
  11. package/components/LanguagePopover/{index.310e9a3a.js → index.f7ee5a9c.js} +9 -9
  12. package/components/ModalDialog/{index.598f9a86.js → index.1e6150f6.js} +7 -7
  13. package/components/NavLink/{index.ac3778af.js → index.5f3e2493.js} +9 -9
  14. package/components/NoItemSelected/{index.3809e3d1.js → index.b51f007c.js} +1 -1
  15. package/components/ObjectLogs/{index.949d3595.js → index.26644722.js} +16 -15
  16. package/components/PaperForm/{index.cf8af08b.js → index.be12afa3.js} +1 -1
  17. package/components/Period/{index.53ea0562.js → index.f24d7084.js} +18 -17
  18. package/components/Resizeable/{index.ff4ce7a4.js → index.949b18ff.js} +1 -1
  19. package/components/SideBar/{index.4daafbab.js → index.e716e9e0.js} +6 -6
  20. package/components/areas/components/AreasAdmin/index.b26ee1b2.js +289 -0
  21. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +1 -1
  22. package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
  23. package/components/areas/components/AreasViewer/classes/types.d.ts +14 -2
  24. package/components/areas/components/{index.31f39977.js → AreasViewer/index.d33b4a7d.js} +204 -305
  25. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +3 -3
  26. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Toasties/index.d.ts +6 -0
  27. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Toasties/subcomponents/Toasty/index.d.ts +7 -0
  28. package/components/areas/components/index.b2ee7610.js +14 -0
  29. package/components/areas/constants.66529246.js +6 -0
  30. package/components/areas/contexts/AreasContext/helper.d.ts +6 -4
  31. package/components/areas/contexts/AreasContext/{index.e14d6799.js → index.9c35425b.js} +132 -21
  32. package/components/areas/contexts/AreasContext/types.d.ts +5 -3
  33. package/components/areas/contexts/DynamicMFParmsContext/store.d.ts +1 -1
  34. package/components/areas/contexts/DynamicMFParmsContext/types.d.ts +1 -1
  35. package/components/areas/contexts/WindowToolsMFContext/types.d.ts +3 -10
  36. package/components/areas/contexts/index.d.ts +2 -1
  37. package/components/areas/contexts/{index.5ba05323.js → index.d2f1c19a.js} +1 -1
  38. package/components/areas/dictionary.e72db809.js +22 -0
  39. package/components/areas/hooks/index.0184c6f7.js +4 -0
  40. package/components/areas/hooks/{useArea/index.c135e0cf.js → useAreas/index.6540b5ab.js} +1 -1
  41. package/components/areas/hooks/{index.ae8d8631.js → useWindowToolsMF/index.b7afaf88.js} +1 -3
  42. package/components/areas/icons.3ec589d3.js +19 -0
  43. package/components/areas/icons.d.ts +2 -0
  44. package/components/areas/index.8ed127ca.js +16 -0
  45. package/components/areas/index.d.ts +1 -0
  46. package/components/areas/types.d.ts +28 -3
  47. package/components/formatters/BooleanFormatter/{index.99c7fe49.js → index.87ca7bb3.js} +1 -1
  48. package/components/formatters/{index.1a92006b.js → index.83c50bdb.js} +2 -2
  49. package/components/hook-form/RHFAutocomplete/{index.c4ba070a.js → index.743b5558.js} +10 -10
  50. package/components/hook-form/RHFAutocompleteAsync/{index.a63f3704.js → index.5be9ea91.js} +2 -2
  51. package/components/hook-form/RHFCheckbox/{index.9055f88d.js → index.77758da5.js} +3 -3
  52. package/components/hook-form/RHFDateTime/{index.2cb94a66.js → index.d554d467.js} +9 -9
  53. package/components/hook-form/RHFPeriod/{index.14dcf762.js → index.02253c2d.js} +2 -2
  54. package/components/hook-form/RHFTextField/{index.7ce2b16e.js → index.5066b599.js} +6 -6
  55. package/components/hook-form/RHFUpload/{index.c57a43f8.js → index.6ecf3230.js} +1 -1
  56. package/components/modal/{WindowBase.32d35d71.js → WindowBase.e59ef8a1.js} +10 -10
  57. package/components/modal/{WindowConfirm.70bcbb69.js → WindowConfirm.a9e351fa.js} +16 -15
  58. package/components/modal/index.2e83c400.js +36 -0
  59. package/components/mui_extended/Accordion/{index.44e96bb8.js → index.9c36b7a5.js} +2 -2
  60. package/components/mui_extended/Button/{index.ec6525e0.js → index.1cb53ba2.js} +3 -3
  61. package/components/mui_extended/IconButton/{index.7aab3e04.js → index.89428485.js} +1 -1
  62. package/components/mui_extended/MenuActions/{index.bff47c06.js → index.d426f50b.js} +2 -2
  63. package/components/mui_extended/Pager/{index.907d5801.js → index.2c081f2c.js} +1 -1
  64. package/components/mui_extended/Typography/{index.d5e0f69f.js → index.1ff05abe.js} +1 -1
  65. package/components/mui_extended/{index.1f766f93.js → index.bc3da862.js} +8 -8
  66. package/contexts/ModalContext/{index.fca184e2.js → index.ca4ffa64.js} +1 -1
  67. package/hooks/useModal/{index.9b244379.js → index.97628a64.js} +1 -1
  68. package/index.js +84 -81
  69. package/package.json +4 -4
  70. package/{react-draggable.29f78f6d.js → react-draggable.64706389.js} +1 -1
  71. package/{react-resizable.baf54eb2.js → react-resizable.67e38975.js} +2 -2
  72. package/utils/{index.ee16888d.js → index.94b9dc32.js} +1 -1
  73. package/{vendor.619c3533.js → vendor.fcb620ee.js} +45 -44
  74. package/components/areas/index.bd29b1db.js +0 -56
  75. 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.67e38975.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.94b9dc32.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.4eeb3de9.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.89428485.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.6540b5ab.js";
21
+ import "../AreasAdmin/index.b26ee1b2.js";
22
+ import { I as ICONS } from "../../icons.3ec589d3.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.9c35425b.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.743b5558.js";
30
+ import { I as Image } from "../../../Image/index.52c84d9f.js";
31
+ import { T as Typography } from "../../../mui_extended/Typography/index.1ff05abe.js";
32
+ import "../../../mui_extended/Accordion/index.9c36b7a5.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.1cb53ba2.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.d426f50b.js";
39
+ import "../../../mui_extended/Pager/index.2c081f2c.js";
40
+ import "../../../mui_extended/Tab/index.e0653a0a.js";
41
+ import "../../../HelperText/index.581ddb8f.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.5be9ea91.js";
44
+ import "../../../hook-form/RHFCheckbox/index.77758da5.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.d554d467.js";
47
+ import "../../../hook-form/RHFTextField/index.5066b599.js";
48
+ import "../../../hook-form/RHFPeriod/index.02253c2d.js";
49
+ import "../../../Period/index.f24d7084.js";
50
+ import "../../../CommonActions/components/Actions/index.665b1d56.js";
51
+ import "../../../../contexts/ModalContext/index.ca4ffa64.js";
52
+ import { c as cjs } from "../../../../react-draggable.64706389.js";
53
+ import "../../../ModalDialog/index.1e6150f6.js";
54
+ import { R as ResizeableWindow } from "../../../Resizeable/index.949b18ff.js";
55
+ import "../../../modal/WindowConfirm.a9e351fa.js";
56
+ import "../../../modal/WindowBase.e59ef8a1.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.6ecf3230.js";
60
+ import "../../../DataGrid/index.860f4d1c.js";
63
61
  import "react-dnd";
64
62
  import "react-dnd-html5-backend";
65
- import "../../DynamicFilter/index.b2ba5167.js";
63
+ import "../../../DynamicFilter/index.09d83f9d.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.f7ee5a9c.js";
68
+ import "../../../NavLink/index.5f3e2493.js";
69
+ import "../../../NoItemSelected/index.b51f007c.js";
70
+ import "../../../ObjectLogs/index.26644722.js";
71
+ import "../../../../react-json-view.57125fcf.js";
72
+ import "../../../PaperForm/index.be12afa3.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.e716e9e0.js";
78
+ import { D as DraggableWindow } from "../../../../vendor.fcb620ee.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",
@@ -93,12 +94,24 @@ const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
93
94
  "windowPopupRoot",
94
95
  "windowModalRoot",
95
96
  "windowRootContainer",
97
+ "windowToastiesContainer",
98
+ "windowToastyContainer",
99
+ "windowToastyMeesageButtonsContainer",
100
+ "windowToastyMessage",
101
+ "windowToastyButtonsContainer",
102
+ "windowToastyPin",
103
+ "windowToastyClose",
96
104
  "panelWindowsRoot",
97
105
  "panelWindowsButtonContainer",
98
106
  "selected",
99
107
  "selectedWindow",
100
108
  "isMobile",
101
- "loading"
109
+ "loading",
110
+ "pinIn",
111
+ "success",
112
+ "info",
113
+ "warning",
114
+ "error"
102
115
  ], AREAS_VIEWER_CLASS_NAME);
103
116
  const useAreasViewerUtilityClasses = (ownerState) => {
104
117
  const slots = {
@@ -116,237 +129,18 @@ const useAreasViewerUtilityClasses = (ownerState) => {
116
129
  windowPopupRoot: ["windowPopupRoot"],
117
130
  windowModalRoot: ["windowModalRoot"],
118
131
  selectedWindow: ["selectedWindow"],
132
+ windowToastiesContainer: ["windowToastiesContainer"],
133
+ windowToastyContainer: ["windowToastiesContainer"],
134
+ windowToastyMeesageButtonsContainer: ["windowToastyMeesageButtonsContainer"],
135
+ windowToastyMessage: ["windowToastyMessage"],
136
+ windowToastyButtonsContainer: ["windowToastyButtonsContainer"],
137
+ windowToastyPin: ["windowToastyPin"],
138
+ windowToastyClose: ["windowToastyClose"],
119
139
  panelWindowsRoot: ["panelWindowsRoot"],
120
140
  panelWindowsButtonContainer: ["panelWindowsButtonContainer"]
121
141
  };
122
142
  return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_VIEWER_CLASS_NAME), {});
123
143
  };
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
144
  const AreasViewerRoot = styled("div")`
351
145
  /* display: flex; */
352
146
  width: 100%;
@@ -420,7 +214,7 @@ const AreasViewerRoot = styled("div")`
420
214
 
421
215
  // windowRoot
422
216
  & .${areasViewerClasses.windowRoot} {
423
- inset:0;
217
+ inset: 0;
424
218
  position: absolute;
425
219
  display: flex;
426
220
  flex-direction: column;
@@ -440,21 +234,19 @@ const AreasViewerRoot = styled("div")`
440
234
  & .${areasViewerClasses.windowHeader} {
441
235
  display: flex;
442
236
  gap: 4px;
443
-
237
+
444
238
  align-items: center;
445
239
  position: relative;
446
240
 
447
241
  padding: 8px;
448
242
  justify-content: end;
449
- min-height: ${(props) => props.theme.spacing(5)} ;
243
+ min-height: ${(props) => props.theme.spacing(5)};
450
244
 
451
245
  border-bottom: 1px solid ${(props) => props.theme.palette.divider};
452
246
  overflow: hidden;
453
247
  cursor: move;
454
248
  height: 60px;
455
249
 
456
-
457
-
458
250
  > span: {
459
251
  margin-right: 12px;
460
252
  }
@@ -477,7 +269,6 @@ const AreasViewerRoot = styled("div")`
477
269
  gap: 4px;
478
270
  }
479
271
 
480
-
481
272
  // windowHeaderMainActions
482
273
  & .${areasViewerClasses.windowContent} {
483
274
  flex-grow: 1;
@@ -1219,7 +1010,10 @@ const Component = (props) => {
1219
1010
  ...windowTools,
1220
1011
  children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, {
1221
1012
  store: dynamicMFStore,
1222
- children: typeof component === "function" ? component() : component
1013
+ children: typeof component === "function" ? component({
1014
+ windowTools,
1015
+ dynamicMFStore
1016
+ }) : component
1223
1017
  })
1224
1018
  });
1225
1019
  };
@@ -1296,10 +1090,111 @@ const WindowRoot = styled("div")`
1296
1090
  padding: 16px;
1297
1091
  }
1298
1092
 
1093
+ // windowToastiesContainer
1094
+ & .${areasViewerClasses.windowToastiesContainer} {
1095
+ padding: 4px;
1096
+ }
1097
+
1098
+ // windowToastyContainer
1099
+ & .${areasViewerClasses.windowToastyContainer} {
1100
+ display: flex;
1101
+ flex-direction: column;
1102
+ }
1103
+ // windowToastyContainer
1104
+ & .${areasViewerClasses.windowToastyContainer}.${areasViewerClasses.success} {
1105
+ background-color: ${(props) => props.theme.palette.success.main}
1106
+ }
1107
+
1108
+ // windowToastyMeesageButtonsContainer
1109
+ & .${areasViewerClasses.windowToastyMeesageButtonsContainer} {
1110
+ display: flex;
1111
+
1112
+ }
1113
+ & .MuiLinearProgress-root {
1114
+ width: 100%;
1115
+ }
1116
+
1117
+
1118
+
1119
+
1120
+ // windowToastyMessage
1121
+ & .${areasViewerClasses.windowToastyMessage} {
1122
+ flex-grow: 1;
1123
+ }
1124
+
1125
+ // windowToastyContainer
1126
+ & .${areasViewerClasses.windowToastyPin}.${areasViewerClasses.pinIn} {
1127
+ border: 1px solid red;
1128
+ }
1129
+
1130
+
1131
+
1299
1132
  ${(props) => props.theme.components?.M4LAreasViewerWindow?.styleOverrides}
1300
1133
 
1301
1134
 
1302
1135
  `;
1136
+ function Toasty(props) {
1137
+ const {
1138
+ windowId,
1139
+ toastyId
1140
+ } = props;
1141
+ const toasty = useAreasStore((state) => state.hashWindows[windowId].hashToasties[toastyId], shallow);
1142
+ console.log("percentExecuted", toasty.percentExecuted, toasty.timer);
1143
+ const {
1144
+ pinToasty,
1145
+ closeToasty
1146
+ } = useAreasStore((state) => state.windowActions, shallow);
1147
+ const {
1148
+ host_static_assets,
1149
+ environment_assets
1150
+ } = useEnvironment();
1151
+ return /* @__PURE__ */ jsxs("div", {
1152
+ className: clsx(areasViewerClasses.windowToastyContainer, areasViewerClasses[toasty.type]),
1153
+ children: [toasty.timer ? /* @__PURE__ */ jsx(LinearProgress, {
1154
+ variant: "determinate",
1155
+ value: toasty.percentExecuted
1156
+ }) : null, /* @__PURE__ */ jsxs("div", {
1157
+ className: areasViewerClasses.windowToastyMeesageButtonsContainer,
1158
+ children: [/* @__PURE__ */ jsx("div", {
1159
+ className: areasViewerClasses.windowToastyMessage,
1160
+ children: toasty.message
1161
+ }), /* @__PURE__ */ jsxs("div", {
1162
+ className: areasViewerClasses.windowToastyButtonsContainer,
1163
+ children: [/* @__PURE__ */ jsx(IconButton, {
1164
+ className: clsx(areasViewerClasses.windowToastyPin, toasty.timer ? null : areasViewerClasses.pinIn),
1165
+ onClick: () => {
1166
+ pinToasty(windowId, toastyId);
1167
+ },
1168
+ src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.TOASTY_PIN}`
1169
+ }), /* @__PURE__ */ jsx(IconButton, {
1170
+ className: areasViewerClasses.windowToastyClose,
1171
+ onClick: () => {
1172
+ closeToasty(windowId, toastyId);
1173
+ },
1174
+ src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.TOASTY_CLOSE}`
1175
+ })]
1176
+ })]
1177
+ })]
1178
+ });
1179
+ }
1180
+ function Toasties(props) {
1181
+ const {
1182
+ windowId
1183
+ } = props;
1184
+ const tosties = useAreasStore((state) => state.hashWindows[windowId].toasties, shallow);
1185
+ if (tosties.length === 0) {
1186
+ return null;
1187
+ }
1188
+ return /* @__PURE__ */ jsx("div", {
1189
+ className: areasViewerClasses.windowToastiesContainer,
1190
+ children: tosties.map((t) => {
1191
+ return /* @__PURE__ */ jsx(Toasty, {
1192
+ windowId,
1193
+ toastyId: t.id
1194
+ }, t.id);
1195
+ })
1196
+ });
1197
+ }
1303
1198
  const Window = (props) => {
1304
1199
  const {
1305
1200
  emergeType,
@@ -1315,7 +1210,8 @@ const Window = (props) => {
1315
1210
  getCookies,
1316
1211
  setCookie,
1317
1212
  close,
1318
- setLoading
1213
+ setLoading,
1214
+ toasty
1319
1215
  } = useAreasStore((state) => state.windowActions, shallow);
1320
1216
  const {
1321
1217
  selectWindowPopUp,
@@ -1346,6 +1242,9 @@ const Window = (props) => {
1346
1242
  close: () => close(windowId),
1347
1243
  setLoading: (isLoading) => {
1348
1244
  setLoading(windowId, isLoading);
1245
+ },
1246
+ toasty: (toastyOptions) => {
1247
+ toasty(windowId, toastyOptions);
1349
1248
  }
1350
1249
  }), []);
1351
1250
  useEffect(() => {
@@ -1359,6 +1258,8 @@ const Window = (props) => {
1359
1258
  areaId,
1360
1259
  windowId,
1361
1260
  emergeType
1261
+ }), /* @__PURE__ */ jsx(Toasties, {
1262
+ windowId
1362
1263
  }), /* @__PURE__ */ jsx("div", {
1363
1264
  className: areasViewerClasses.windowContent,
1364
1265
  children: wd.status === "init" ? /* @__PURE__ */ jsx("div", {
@@ -1699,9 +1600,7 @@ function AreasViewer() {
1699
1600
  });
1700
1601
  }
1701
1602
  export {
1702
- AreasAdmin as A,
1703
- useAreasAdminUtilityClasses as a,
1704
- areasViewerClasses as b,
1705
- AreasViewer as c,
1603
+ AreasViewer as A,
1604
+ areasViewerClasses as a,
1706
1605
  useAreasViewerUtilityClasses as u
1707
1606
  };
@@ -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,6 @@
1
+ /// <reference types="react" />
2
+ declare type ToastiesProps = {
3
+ windowId: string;
4
+ };
5
+ export declare function Toasties(props: ToastiesProps): import("react").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare type ToastyProps = {
3
+ windowId: string;
4
+ toastyId: number;
5
+ };
6
+ export declare function Toasty(props: ToastyProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import "react";
2
+ import "@m4l/core";
3
+ import "@mui/material";
4
+ import "../../Icon/index.4eeb3de9.js";
5
+ import "clsx";
6
+ import "react/jsx-runtime";
7
+ import "../../mui_extended/IconButton/index.89428485.js";
8
+ import "@m4l/graphics";
9
+ import "zustand";
10
+ import "../contexts/AreasContext/index.9c35425b.js";
11
+ import "./AreasAdmin/index.b26ee1b2.js";
12
+ import "zustand/shallow";
13
+ import "../../ScrollBar/index.bbe48f4d.js";
14
+ import "./AreasViewer/index.d33b4a7d.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
+ };