@m4l/components 0.1.65 → 0.1.66

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 (58) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.0f471356.js → index.4d0333c0.js} +1 -1
  2. package/components/CommonActions/components/ActionFormCancel/{index.4d2f599e.js → index.298e0109.js} +10 -15
  3. package/components/CommonActions/components/ActionFormIntro/{index.0eed3ba3.js → index.b45922ff.js} +1 -1
  4. package/components/CommonActions/components/ActionIntro/{index.41a598d6.js → index.138101aa.js} +2 -2
  5. package/components/CommonActions/components/Actions/{index.3b882471.js → index.77574633.js} +11 -15
  6. package/components/DataGrid/{index.dc84293a.js → index.ef23d0a9.js} +18 -22
  7. package/components/DynamicFilter/{index.abc697c7.js → index.04ed3d58.js} +28 -32
  8. package/components/HelperText/{index.1a24d41b.js → index.c35dcb93.js} +8 -8
  9. package/components/Icon/{index.6938827f.js → index.fbeeacc8.js} +2 -2
  10. package/components/Image/{index.674024d4.js → index.77396f79.js} +1 -1
  11. package/components/LanguagePopover/{index.47aa8119.js → index.c0fc94c7.js} +9 -9
  12. package/components/ModalDialog/{index.3db4480d.js → index.e600b43a.js} +5 -5
  13. package/components/NavLink/{index.0d125c6b.js → index.3f4e2417.js} +9 -9
  14. package/components/NoItemSelected/{index.1aa96110.js → index.609c3c20.js} +1 -1
  15. package/components/ObjectLogs/{index.05788334.js → index.7f93ba51.js} +14 -18
  16. package/components/PaperForm/{index.b3da0da3.js → index.fb4fa784.js} +1 -1
  17. package/components/Period/{index.a1b7b4cc.js → index.0c5bf66f.js} +12 -16
  18. package/components/Resizeable/{index.ee84ebc5.js → index.4545dd6a.js} +1 -1
  19. package/components/SideBar/{index.99ce4e06.js → index.7d970041.js} +6 -6
  20. package/components/areas/components/index.d.ts +0 -1
  21. package/components/areas/{components/AreasViewer/index.1aa4d12d.js → index.d7519516.js} +2199 -1755
  22. package/components/formatters/BooleanFormatter/{index.7b9e92f8.js → index.0edacc9b.js} +1 -1
  23. package/components/formatters/{index.01b027ad.js → index.879170b2.js} +2 -2
  24. package/components/hook-form/RHFAutocomplete/{index.73d33896.js → index.5f27e28c.js} +10 -10
  25. package/components/hook-form/RHFAutocompleteAsync/{index.21f4cb53.js → index.35e17cd6.js} +2 -2
  26. package/components/hook-form/RHFCheckbox/{index.c3b1884b.js → index.4f134f09.js} +3 -3
  27. package/components/hook-form/RHFPeriod/{index.cc624bb3.js → index.dcaa0c87.js} +2 -2
  28. package/components/hook-form/RHFTextField/{index.15659666.js → index.fc90a570.js} +6 -6
  29. package/components/hook-form/RHFUpload/{index.ecf5c788.js → index.654ad316.js} +1 -1
  30. package/components/modal/{WindowBase.1b0657de.js → WindowBase.230a498f.js} +3 -3
  31. package/components/modal/{WindowConfirm.60028bce.js → WindowConfirm.575b4d41.js} +14 -18
  32. package/components/modal/index.237881ea.js +23 -0
  33. package/components/mui_extended/Accordion/{index.95a1b021.js → index.0b15f939.js} +2 -2
  34. package/components/mui_extended/Button/{index.e4c61b66.js → index.b7b70e5f.js} +3 -3
  35. package/components/mui_extended/IconButton/{index.78a489d3.js → index.a5072cd3.js} +1 -1
  36. package/components/mui_extended/MenuActions/{index.742a57d7.js → index.3a275abb.js} +2 -2
  37. package/components/mui_extended/Pager/{index.a44594e9.js → index.5a69ab10.js} +1 -1
  38. package/components/mui_extended/Typography/{index.86505aed.js → index.eab3d85c.js} +1 -1
  39. package/components/mui_extended/index.35f74599.js +19 -0
  40. package/contexts/ModalContext/{index.bfc47ba9.js → index.de0a3457.js} +1 -1
  41. package/hooks/useModal/{index.979ab2ea.js → index.e103db09.js} +1 -1
  42. package/index.js +89 -98
  43. package/package.json +1 -1
  44. package/{react-draggable.d6441025.js → react-draggable.4d08d714.js} +1 -1
  45. package/{react-resizable.79fb7404.js → react-resizable.23b980cb.js} +3 -3
  46. package/utils/{index.64775c34.js → index.c2e62d8f.js} +1 -1
  47. package/{vendor.2d9f95b4.js → vendor.be57c149.js} +40 -47
  48. package/components/areas/components/AreasAdmin/index.46fab65b.js +0 -135
  49. package/components/areas/components/index.9de77fae.js +0 -12
  50. package/components/areas/contexts/AreasContext/index.b3b26965.js +0 -231
  51. package/components/areas/contexts/DynamicMFParmsContext/index.5b3248df.js +0 -43
  52. package/components/areas/contexts/index.4ebef035.js +0 -21
  53. package/components/areas/hooks/index.ffb1009e.js +0 -28
  54. package/components/areas/hooks/useArea/index.c7e4f3fc.js +0 -34
  55. package/components/areas/hooks/useDynamicMFParameters/index.9a25f88a.js +0 -14
  56. package/components/areas/index.bfe6bf91.js +0 -46
  57. package/components/modal/index.fde6acc3.js +0 -27
  58. package/components/mui_extended/index.61356a6a.js +0 -19
@@ -1,12 +0,0 @@
1
- import "./AreasViewer/index.1aa4d12d.js";
2
- import "react";
3
- import "@m4l/core";
4
- import "@mui/material";
5
- import "../../Icon/index.6938827f.js";
6
- import "react/jsx-runtime";
7
- import "../../mui_extended/IconButton/index.78a489d3.js";
8
- import "clsx";
9
- import "zustand";
10
- import "../contexts/AreasContext/index.b3b26965.js";
11
- import "./AreasAdmin/index.46fab65b.js";
12
- import "zustand/shallow";
@@ -1,231 +0,0 @@
1
- import { createContext, useRef, useCallback, useEffect } from "react";
2
- import { createStore, useStore } from "zustand";
3
- import { shallow } from "zustand/shallow";
4
- import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
5
- import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, EmitEvents } from "@m4l/core";
6
- import { devtools } from "zustand/middleware";
7
- import { immer } from "zustand/middleware/immer";
8
- import { g as getAreasDictionary } from "../../index.bfe6bf91.js";
9
- import { u as useAreasViewerUtilityClasses } from "../../components/AreasViewer/index.1aa4d12d.js";
10
- import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/index.46fab65b.js";
11
- import { jsx } from "react/jsx-runtime";
12
- const addArea = (state) => {
13
- let newName = "";
14
- const newId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
15
- newName = `${state.getLabel(getAreasDictionary("label_new_area"))} ${state.areas.length + 1}`;
16
- state.areas.push({ id: newId, name: newName, loadWindows: false });
17
- state.currentArea = newId;
18
- if (state.loadAreasFromNetwork) {
19
- state.networkOperation({
20
- method: "POST",
21
- endPoint: `areas`,
22
- data: { id: newId, name: newName },
23
- toastSuccess: false,
24
- toastError: false
25
- });
26
- }
27
- return newId;
28
- };
29
- const updateOwnerStateClasses = (state) => {
30
- state.viwerClasses = useAreasViewerUtilityClasses(state.ownerState);
31
- state.adminClasses = useAreasAdminUtilityClasses(state.ownerState);
32
- };
33
- const createAreasStore = (initProps) => {
34
- const startProps = {
35
- viwerClasses: useAreasViewerUtilityClasses(initProps.ownerState),
36
- adminClasses: useAreasAdminUtilityClasses(initProps.ownerState),
37
- currentArea: "",
38
- areas: [],
39
- ...initProps
40
- };
41
- return createStore(
42
- devtools(
43
- immer((set, get) => ({
44
- ...startProps,
45
- actions: {
46
- init: () => {
47
- if (get().ownerState.status === "init") {
48
- if (!get().loadAreasFromNetwork) {
49
- get().actions.addArea();
50
- set((state) => {
51
- state.ownerState.status = "loaded";
52
- updateOwnerStateClasses(state);
53
- });
54
- } else {
55
- set((state) => {
56
- state.ownerState.status = "loading";
57
- updateOwnerStateClasses(state);
58
- state.networkOperation({
59
- method: "GET",
60
- endPoint: `areas`,
61
- parms: {},
62
- toastSuccess: false
63
- }).then((response) => {
64
- set((otherState) => {
65
- if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
66
- otherState.areas = response.data;
67
- otherState.currentArea = response.data[0].id;
68
- } else {
69
- addArea(otherState);
70
- }
71
- });
72
- }).finally(() => {
73
- set((state2) => {
74
- state2.ownerState.status = "loaded";
75
- updateOwnerStateClasses(state2);
76
- });
77
- });
78
- });
79
- }
80
- }
81
- },
82
- addArea: () => {
83
- let newId = "";
84
- set((state) => {
85
- newId = addArea(state);
86
- });
87
- return newId;
88
- },
89
- deleteArea: (areaId) => {
90
- set((state) => {
91
- const removeIndex = state.areas.findIndex((area) => area.id === areaId);
92
- if (removeIndex > -1) {
93
- state.areas.splice(removeIndex, 1);
94
- }
95
- if (state.currentArea === areaId) {
96
- if (state.areas.length > 0) {
97
- state.currentArea = state.areas[0].id;
98
- } else {
99
- state.currentArea = "";
100
- }
101
- }
102
- if (state.loadAreasFromNetwork) {
103
- state.networkOperation({
104
- method: "DELETE",
105
- endPoint: `areas/${areaId}`,
106
- parms: {},
107
- toastSuccess: false,
108
- toastError: false
109
- });
110
- }
111
- });
112
- },
113
- selectArea: (newAreaId) => {
114
- set((state) => {
115
- if (state.areas.findIndex((area) => area.id === newAreaId) > -1) {
116
- state.currentArea = newAreaId;
117
- }
118
- });
119
- }
120
- },
121
- internalActions: {
122
- setHandlerGetLabel: (newHandler) => {
123
- set((state) => {
124
- state.getLabel = newHandler;
125
- });
126
- },
127
- setAreaLink: (areaId, store) => {
128
- set((state) => {
129
- const areaIndex = state.areas.findIndex((area) => area.id === areaId);
130
- if (areaIndex > -1) {
131
- state.areas[areaIndex].store = store;
132
- state.areas[areaIndex].linked = true;
133
- }
134
- });
135
- },
136
- setExternalState: (newExternalState) => {
137
- set((state) => {
138
- state.ownerState = { ...state.ownerState, ...newExternalState };
139
- updateOwnerStateClasses(state);
140
- });
141
- }
142
- }
143
- })),
144
- { name: `Areas store` }
145
- )
146
- );
147
- };
148
- const AreasContext = createContext(null);
149
- function AreasProvider(props) {
150
- const {
151
- children,
152
- loadAreasFromNetwork,
153
- loadCookiesFromNetwork,
154
- onLoad
155
- } = props;
156
- const {
157
- events_add_listener,
158
- events_remove_listener
159
- } = useHostTools();
160
- const {
161
- getLabel
162
- } = useModuleDictionary();
163
- const {
164
- networkOperation
165
- } = useNetwork();
166
- const isDesktop = useResponsiveDesktop();
167
- const isSkeleton = useModuleSkeleton();
168
- const isFirstRender = useFirstRender([getLabel]);
169
- const areasStoreRef = useRef();
170
- if (!areasStoreRef.current) {
171
- areasStoreRef.current = createAreasStore({
172
- getLabel,
173
- loadAreasFromNetwork,
174
- loadCookiesFromNetwork,
175
- networkOperation,
176
- ownerState: {
177
- status: "init",
178
- isMobile: !isDesktop,
179
- isSkeleton
180
- }
181
- });
182
- areasStoreRef.current?.getState().actions.init();
183
- }
184
- const status = useStore(areasStoreRef.current, (state) => state.ownerState.status, shallow);
185
- const {
186
- setHandlerGetLabel
187
- } = useStore(areasStoreRef.current, (state) => state.internalActions, shallow);
188
- const addWindow = useCallback((newWindow) => {
189
- const currentArea = areasStoreRef.current?.getState().currentArea;
190
- const areas = areasStoreRef.current?.getState().areas;
191
- if (currentArea && areas) {
192
- const areaIndex = areas.findIndex((area) => area.id == currentArea);
193
- if (areaIndex > -1 && areas[areaIndex].store) {
194
- areas[areaIndex].store?.getState().actions.addWindow(newWindow);
195
- }
196
- }
197
- }, []);
198
- useEffect(() => {
199
- if (status === "loaded") {
200
- onLoad && onLoad();
201
- }
202
- }, [status]);
203
- useEffect(() => {
204
- if (!isFirstRender) {
205
- setHandlerGetLabel(getLabel);
206
- }
207
- }, [getLabel]);
208
- useEffect(() => {
209
- events_add_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
210
- return () => {
211
- events_remove_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
212
- };
213
- }, []);
214
- useEffect(() => {
215
- if (isFirstRender) {
216
- return;
217
- }
218
- areasStoreRef.current?.getState().internalActions.setExternalState({
219
- isMobile: !isDesktop,
220
- isSkeleton
221
- });
222
- }, [isDesktop, isSkeleton]);
223
- return /* @__PURE__ */ jsx(AreasContext.Provider, {
224
- value: areasStoreRef.current,
225
- children
226
- });
227
- }
228
- export {
229
- AreasContext as A,
230
- AreasProvider as a
231
- };
@@ -1,43 +0,0 @@
1
- import React__default, { createContext } from "react";
2
- import { jsx } from "react/jsx-runtime";
3
- import { createStore } from "zustand";
4
- import { devtools } from "zustand/middleware";
5
- import { immer } from "zustand/middleware/immer";
6
- const DynamicMFParmsContext = createContext(null);
7
- function DynamicMFParmsProvider(props) {
8
- const {
9
- children,
10
- store
11
- } = props;
12
- return /* @__PURE__ */ jsx(DynamicMFParmsContext.Provider, {
13
- value: store,
14
- children
15
- });
16
- }
17
- const MemonizedDynamicMFParmsProvider = React__default.memo(DynamicMFParmsProvider);
18
- const createDynamicMFStore = (initProps) => {
19
- const startProps = {
20
- ...initProps
21
- };
22
- return createStore(
23
- devtools(
24
- immer((set, _get) => ({
25
- ...startProps,
26
- actions: {
27
- changeData: (newDynamicMFState) => {
28
- set((state) => {
29
- state.dynamicMFParameters = newDynamicMFState;
30
- });
31
- }
32
- }
33
- })),
34
- { name: `dyamic store ${initProps.windowId}` }
35
- )
36
- );
37
- };
38
- export {
39
- DynamicMFParmsProvider as D,
40
- MemonizedDynamicMFParmsProvider as M,
41
- DynamicMFParmsContext as a,
42
- createDynamicMFStore as c
43
- };
@@ -1,21 +0,0 @@
1
- import "./AreasContext/index.b3b26965.js";
2
- import React__default, { createContext } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- const WindowToolsMFContext = createContext(null);
5
- function WindowToolsMFProvider(props) {
6
- const {
7
- children,
8
- ...other
9
- } = props;
10
- return /* @__PURE__ */ jsx(WindowToolsMFContext.Provider, {
11
- value: {
12
- ...other
13
- },
14
- children
15
- });
16
- }
17
- React__default.memo(WindowToolsMFProvider);
18
- export {
19
- WindowToolsMFProvider as W,
20
- WindowToolsMFContext as a
21
- };
@@ -1,28 +0,0 @@
1
- import { useContext } from "react";
2
- import { useStore } from "zustand";
3
- import { W as WindowContext } from "../components/AreasViewer/index.1aa4d12d.js";
4
- import { a as WindowToolsMFContext } from "../contexts/index.4ebef035.js";
5
- import "../contexts/DynamicMFParmsContext/index.5b3248df.js";
6
- const useWindow = () => {
7
- const context = useContext(WindowContext);
8
- if (!context)
9
- throw new Error("useWindow context must be use inside WindowContext");
10
- return context;
11
- };
12
- function useWindowStore(selector, equalityFn) {
13
- const store = useContext(WindowContext);
14
- if (!store)
15
- throw new Error("useWindow context must be use inside WindowContext");
16
- return useStore(store, selector, equalityFn);
17
- }
18
- const useWindowToolsMF = () => {
19
- const context = useContext(WindowToolsMFContext);
20
- if (!context)
21
- throw new Error("useWindowToolsMF context must be use inside WindowToolsMFContext");
22
- return context;
23
- };
24
- export {
25
- useWindow as a,
26
- useWindowStore as b,
27
- useWindowToolsMF as u
28
- };
@@ -1,34 +0,0 @@
1
- import { useContext } from "react";
2
- import { useStore } from "zustand";
3
- import { A as AreasContext } from "../../contexts/AreasContext/index.b3b26965.js";
4
- import { A as AreaContext } from "../../components/AreasViewer/index.1aa4d12d.js";
5
- function useAreas() {
6
- const context = useContext(AreasContext);
7
- if (!context)
8
- throw new Error("useAreas context must be use inside AreasContext");
9
- return context;
10
- }
11
- function useAreasStore(selector, equalityFn) {
12
- const context = useContext(AreasContext);
13
- if (!context)
14
- throw new Error("useAreasStore context must be use inside AreasContext");
15
- return useStore(context, selector, equalityFn);
16
- }
17
- const useArea = () => {
18
- const context = useContext(AreaContext);
19
- if (!context)
20
- throw new Error("useArea context must be use inside AreaContext");
21
- return context;
22
- };
23
- function useAreaStore(selector, equalityFn) {
24
- const context = useContext(AreaContext);
25
- if (!context)
26
- throw new Error("useAreaStore context must be use inside AreaContext");
27
- return useStore(context, selector, equalityFn);
28
- }
29
- export {
30
- useArea as a,
31
- useAreas as b,
32
- useAreaStore as c,
33
- useAreasStore as u
34
- };
@@ -1,14 +0,0 @@
1
- import { useContext } from "react";
2
- import { useStore } from "zustand";
3
- import { a as DynamicMFParmsContext } from "../../contexts/DynamicMFParmsContext/index.5b3248df.js";
4
- function useDynamicMFParametersStore(selector, equalityFn) {
5
- const store = useContext(DynamicMFParmsContext);
6
- if (!store)
7
- throw new Error(
8
- "useDynamicMFParametersStore context must be use inside DynamicMFParmsContext"
9
- );
10
- return useStore(store, selector, equalityFn);
11
- }
12
- export {
13
- useDynamicMFParametersStore as u
14
- };
@@ -1,46 +0,0 @@
1
- import "./components/AreasViewer/index.1aa4d12d.js";
2
- import "react";
3
- import "@m4l/core";
4
- import "@mui/material";
5
- import "../Icon/index.6938827f.js";
6
- import "react/jsx-runtime";
7
- import "../mui_extended/IconButton/index.78a489d3.js";
8
- import "clsx";
9
- import "zustand";
10
- import "./contexts/AreasContext/index.b3b26965.js";
11
- import "./components/AreasAdmin/index.46fab65b.js";
12
- import "zustand/shallow";
13
- import "./contexts/index.4ebef035.js";
14
- import "./contexts/DynamicMFParmsContext/index.5b3248df.js";
15
- const AREAS_VIEWER_CLASS_NAME = "M4LAreasViewer";
16
- const AREAS_ADMIN_CLASS_NAME = "M4LAreasAdmin";
17
- const AREAS_DICTIONARY_ID = "areas";
18
- function getAreasComponentsDictionary() {
19
- return [AREAS_DICTIONARY_ID];
20
- }
21
- const LABEL_FILTER_BUTTON = "filter_tooltip";
22
- const DICCTIONARY = {
23
- label_new_area: "label_new_area",
24
- label_persist_module_cookies: "label_persist_module_cookies"
25
- };
26
- const getAreasDictionary = (key) => {
27
- return `${AREAS_DICTIONARY_ID}.${key}`;
28
- };
29
- const ICONS = {
30
- CLOSE: "close.svg",
31
- MAXIMIZE: "maximize.svg",
32
- NORMALIZE: "normalize.svg",
33
- DELETE_AREA: "delete_area.svg",
34
- ADD_AREA: "add_area.svg",
35
- EDIT_AREA: "edit_area.svg"
36
- };
37
- export {
38
- AREAS_ADMIN_CLASS_NAME as A,
39
- DICCTIONARY as D,
40
- ICONS as I,
41
- LABEL_FILTER_BUTTON as L,
42
- AREAS_VIEWER_CLASS_NAME as a,
43
- AREAS_DICTIONARY_ID as b,
44
- getAreasComponentsDictionary as c,
45
- getAreasDictionary as g
46
- };
@@ -1,27 +0,0 @@
1
- import "@mui/material";
2
- import "../../react-draggable.d6441025.js";
3
- import "react";
4
- import "../../contexts/ModalContext/index.bfc47ba9.js";
5
- import "../ModalDialog/index.3db4480d.js";
6
- import "../Resizeable/index.ee84ebc5.js";
7
- import "react/jsx-runtime";
8
- import "@m4l/graphics";
9
- import "@m4l/core";
10
- import "../CommonActions/components/Actions/index.3b882471.js";
11
- import "@mui/material/Button";
12
- import "../mui_extended/Button/index.e4c61b66.js";
13
- import "clsx";
14
- import "react-hook-form";
15
- import "./WindowBase.1b0657de.js";
16
- import "../Icon/index.6938827f.js";
17
- import "../areas/components/AreasViewer/index.1aa4d12d.js";
18
- import "../mui_extended/IconButton/index.78a489d3.js";
19
- import "zustand";
20
- import "../areas/contexts/AreasContext/index.b3b26965.js";
21
- import "../areas/components/AreasAdmin/index.46fab65b.js";
22
- import "zustand/shallow";
23
- import "../areas/contexts/index.4ebef035.js";
24
- import "../areas/contexts/DynamicMFParmsContext/index.5b3248df.js";
25
- import "@mui/lab";
26
- import "../mui_extended/Typography/index.86505aed.js";
27
- import "./WindowConfirm.60028bce.js";
@@ -1,19 +0,0 @@
1
- import "@mui/material";
2
- import "react";
3
- import "@m4l/core";
4
- import "../Icon/index.6938827f.js";
5
- import "react/jsx-runtime";
6
- import "./IconButton/index.78a489d3.js";
7
- import "clsx";
8
- import "./Accordion/index.95a1b021.js";
9
- import "./Avatar/index.fe06afd7.js";
10
- import "react-router-dom";
11
- import "@mui/material/Button";
12
- import "./Button/index.e4c61b66.js";
13
- import "../Image/index.674024d4.js";
14
- import "@mui/lab";
15
- import "./Typography/index.86505aed.js";
16
- import "./Popover/index.e271e4f0.js";
17
- import "./MenuActions/index.742a57d7.js";
18
- import "./Pager/index.a44594e9.js";
19
- import "./Tab/index.e0653a0a.js";