@m4l/components 9.1.116 → 9.1.118
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/types.d.ts +10 -3
- package/components/PaperForm/PaperForm.js +10 -1
- package/components/PaperForm/styles.js +11 -7
- package/components/PaperForm/types.d.ts +1 -1
- package/components/areas/components/AreasAdmin/classes/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/AreasViewer.d.ts +8 -0
- package/components/areas/components/AreasViewer/{index.js → AreasViewer.js} +22 -10
- package/components/areas/components/AreasViewer/AreasViewer.styles.d.ts +2 -0
- package/components/areas/components/AreasViewer/AreasViewer.styles.js +63 -0
- package/components/areas/components/AreasViewer/classes/index.d.ts +1 -2
- package/components/areas/components/AreasViewer/classes/index.js +4 -82
- package/components/areas/components/AreasViewer/classes/types.d.ts +0 -33
- package/components/areas/components/AreasViewer/constants.d.ts +1 -0
- package/components/areas/components/AreasViewer/constants.js +4 -0
- package/components/areas/components/AreasViewer/slots/AreasViewerEnum.d.ts +7 -0
- package/components/areas/components/AreasViewer/slots/AreasViewerEnum.js +11 -0
- package/components/areas/components/AreasViewer/slots/AreasViewerSlots.d.ts +15 -0
- package/components/areas/components/AreasViewer/slots/AreasViewerSlots.js +31 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/Area.js +16 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/{index.js → AreaGridLayout.js} +4 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/BaseArea/BaseArea.d.ts +5 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/BaseArea/BaseArea.js +14 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/{index.js → Window.js} +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/{subcomponents/Header → hooks/useHeaderActions}/helper.d.ts +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/{subcomponents/Header → hooks/useHeaderActions}/helper.js +0 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/index.js +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/{index.d.ts → MicroFrontend.d.ts} +4 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/{index.d.ts → WindowModal.d.ts} +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/{index.js → WindowModal.js} +5 -6
- package/components/areas/components/AreasViewer/types.d.ts +22 -0
- package/components/areas/components/index.d.ts +1 -1
- package/components/areas/constants.js +1 -3
- package/components/areas/contexts/AreasContext/helpers/helper.d.ts +0 -1
- package/components/areas/contexts/AreasContext/helpers/helper.js +1 -8
- package/components/areas/contexts/AreasContext/store.js +1 -163
- package/components/areas/contexts/AreasContext/types.d.ts +0 -4
- package/components/modal/classes/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/components/areas/components/AreasAdmin/classes/index.js +0 -69
- package/components/areas/components/AreasViewer/index.d.ts +0 -7
- package/components/areas/components/AreasViewer/styles.d.ts +0 -1
- package/components/areas/components/AreasViewer/styles.js +0 -111
- package/components/areas/components/AreasViewer/subcomponents/Area/index.js +0 -28
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.d.ts +0 -5
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.js +0 -24
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/index.d.ts +0 -10
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/styles.d.ts +0 -9
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/types.d.ts +0 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +0 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +0 -5
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/styles.d.ts +0 -4
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.d.ts +0 -8
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/index.d.ts +0 -5
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/types.d.ts +0 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/types.d.ts +0 -6
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/LinearProgress/LinearProgress.d.ts +0 -4
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/styles.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/styles.js +0 -26
- /package/components/areas/components/AreasViewer/subcomponents/Area/{index.d.ts → Area.d.ts} +0 -0
- /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/{index.d.ts → AreaGridLayout.d.ts} +0 -0
- /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/{InnerForHooks → BaseArea}/types.d.ts +0 -0
- /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/{index.d.ts → Window.d.ts} +0 -0
- /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/{index.js → MicroFrontend.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ComponentProps } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Componente encargado de renderizar el componente de la ventana.
|
|
5
5
|
*/
|
|
6
6
|
export declare const Component: (props: ComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const MemonizedComponent: React.MemoExoticComponent<(props: ComponentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { W as WindowToolsMFProvider } from "../../../../../../../../contexts/WindowToolsMFContext/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { W as WindowContainerComponentStyled } from "../../../../../../slots/AreasViewerSlots.js";
|
|
5
5
|
import { D as DynamicMFParmsProvider } from "../../../../../../../../contexts/DynamicMFParmsContext/index.js";
|
|
6
6
|
const Component = (props) => {
|
|
7
7
|
const { component, dynamicMFStore, windowTools } = props;
|
|
8
|
-
return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(
|
|
8
|
+
return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(WindowContainerComponentStyled, { ownerState: {}, children: typeof component === "function" ? component({ windowTools, dynamicMFStore }) : component }) }) });
|
|
9
9
|
};
|
|
10
10
|
React.memo(Component);
|
|
11
11
|
export {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { MicroFrontendProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Componente encargado de renderizar un microfrontend.
|
|
5
|
+
* @param props MicroFrontendProps
|
|
6
|
+
*/
|
|
3
7
|
export declare const MicroFrontend: (props: MicroFrontendProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
8
|
export declare const MemonizedMicroFrontend: React.MemoExoticComponent<(props: MicroFrontendProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ModalProps } from '../../../../../../types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Componente encargado de renderizar una ventana modal.
|
|
5
5
|
*/
|
|
6
6
|
export declare const WindowModal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const MemonizedWindowModal: React.MemoExoticComponent<(props: ModalProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { R as ResizableBox } from "../../../../../../../extended/React-Resizable/ResizableBox/ResizableBox.js";
|
|
3
4
|
import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
|
|
4
|
-
import { W as Window } from "../Window/
|
|
5
|
-
import { W as WrapperWindowModal } from "./styles.js";
|
|
5
|
+
import { W as Window } from "../Window/Window.js";
|
|
6
6
|
import Draggable from "react-draggable";
|
|
7
7
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
8
|
-
import {
|
|
9
|
-
import { R as ResizableBox } from "../../../../../../../extended/React-Resizable/ResizableBox/ResizableBox.js";
|
|
8
|
+
import { b as WrapperWindowModalStyled } from "../../../../slots/AreasViewerSlots.js";
|
|
10
9
|
const WindowModal = (props) => {
|
|
11
10
|
const { windowId } = props;
|
|
12
11
|
const { onClose } = useAreasStore((state) => state.hashWindowsModals[windowId]);
|
|
@@ -32,9 +31,9 @@ const WindowModal = (props) => {
|
|
|
32
31
|
return /* @__PURE__ */ jsx(Window, { ...props });
|
|
33
32
|
}
|
|
34
33
|
return /* @__PURE__ */ jsx(
|
|
35
|
-
|
|
34
|
+
WrapperWindowModalStyled,
|
|
36
35
|
{
|
|
37
|
-
|
|
36
|
+
ownerState: {},
|
|
38
37
|
open: true,
|
|
39
38
|
scroll: "paper",
|
|
40
39
|
onKeyDown: (event) => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { M4LOverridesStyleRules } from 'src/@types/augmentations';
|
|
2
|
+
import { AreasViewerSlots } from './slots/AreasViewerEnum';
|
|
3
|
+
import { Theme } from '@mui/material';
|
|
4
|
+
import { AREAS_VIEWER_KEY_COMPONENT } from './constants';
|
|
5
|
+
import { AreaProps } from './subcomponents/Area/types';
|
|
6
|
+
export type AreasViewerType = keyof typeof AreasViewerSlots;
|
|
7
|
+
export interface AreasViewerProps {
|
|
8
|
+
/**
|
|
9
|
+
* data-testid para pruebas unitarias.
|
|
10
|
+
*/
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Clase CSS para sobrescribir los estilos predeterminados.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Props adicionales que se pueden pasar.
|
|
18
|
+
*/
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export type AreasViewerOwnerState = Pick<AreaProps, 'selected'>;
|
|
22
|
+
export type AreasViewerStyles = M4LOverridesStyleRules<AreasViewerType, typeof AREAS_VIEWER_KEY_COMPONENT, Theme>;
|
|
@@ -61,7 +61,6 @@ export declare const addArea: (state: WritableDraft<AreasStateWithActions>) => s
|
|
|
61
61
|
* Actualiza la clases basado en owner state
|
|
62
62
|
* @param state immer State
|
|
63
63
|
*/
|
|
64
|
-
export declare const updateOwnerStateClasses: (state: WritableDraft<AreasStateWithActions>) => void;
|
|
65
64
|
/**
|
|
66
65
|
* TODO: Documentar
|
|
67
66
|
*/
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { u as useAreasViewerUtilityClasses } from "../../../components/AreasViewer/classes/index.js";
|
|
2
|
-
import { u as useAreasAdminUtilityClasses } from "../../../components/AreasAdmin/classes/index.js";
|
|
3
1
|
import { c as createDynamicMFStore } from "../../DynamicMFParmsContext/store.js";
|
|
4
2
|
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../dictionary.js";
|
|
5
3
|
import { c as addLayoutItemToBreakPointIfNoExists } from "../../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
@@ -72,10 +70,6 @@ const addArea = (state) => {
|
|
|
72
70
|
}
|
|
73
71
|
return areaId;
|
|
74
72
|
};
|
|
75
|
-
const updateOwnerStateClasses = (state) => {
|
|
76
|
-
state.viwerClasses = useAreasViewerUtilityClasses(state.ownerState);
|
|
77
|
-
state.adminClasses = useAreasAdminUtilityClasses(state.ownerState);
|
|
78
|
-
};
|
|
79
73
|
const getParmsFromValue = (key, data) => {
|
|
80
74
|
try {
|
|
81
75
|
if (Array.isArray(data)) {
|
|
@@ -218,6 +212,5 @@ export {
|
|
|
218
212
|
getDataFromResponse as k,
|
|
219
213
|
getParmsFromValue as l,
|
|
220
214
|
getCookiesContainer as m,
|
|
221
|
-
setColapsedLayoutBreakPoints as s
|
|
222
|
-
updateOwnerStateClasses as u
|
|
215
|
+
setColapsedLayoutBreakPoints as s
|
|
223
216
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createStore } from "zustand";
|
|
2
2
|
import { devtools } from "zustand/middleware";
|
|
3
3
|
import { immer } from "zustand/middleware/immer";
|
|
4
|
-
import {
|
|
5
|
-
import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/classes/index.js";
|
|
6
|
-
import { u as updateOwnerStateClasses, C as COOKIE_AREAS_ADMIN_CONTAINER_ID, b as COOKIE_AREAS_ADMIN_ID, D as DEFAULT_AREA, c as addArea, g as getSelectedAreaIdFromCookies, d as COOKIE_WINDOW_SELECTED, e as DEFAULT_WINDOW, a as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, N as NORMALIZED_COLS, f as deleteLayoutFromBreakPoints, h as COOKIE_WINDOWS, i as COOKIE_BREAKPOINT_LAYOUTS, j as DEBOUCED_SAVE_TIME, s as setColapsedLayoutBreakPoints, k as getDataFromResponse, l as getParmsFromValue, m as getCookiesContainer } from "./helpers/helper.js";
|
|
4
|
+
import { C as COOKIE_AREAS_ADMIN_CONTAINER_ID, b as COOKIE_AREAS_ADMIN_ID, D as DEFAULT_AREA, c as addArea, g as getSelectedAreaIdFromCookies, d as COOKIE_WINDOW_SELECTED, e as DEFAULT_WINDOW, a as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, N as NORMALIZED_COLS, f as deleteLayoutFromBreakPoints, h as COOKIE_WINDOWS, i as COOKIE_BREAKPOINT_LAYOUTS, j as DEBOUCED_SAVE_TIME, s as setColapsedLayoutBreakPoints, k as getDataFromResponse, l as getParmsFromValue, m as getCookiesContainer } from "./helpers/helper.js";
|
|
7
5
|
import { c as createDynamicMFStore } from "../DynamicMFParmsContext/store.js";
|
|
8
6
|
import cloneDeep from "lodash-es/cloneDeep";
|
|
9
7
|
import debounce from "lodash-es/debounce";
|
|
@@ -13,8 +11,6 @@ import { d as addLayoutItemToBreakPoints, e as cloneLayouts } from "../../../Gri
|
|
|
13
11
|
import { k as isEqualLayouts } from "../../../GridLayout/utils.js";
|
|
14
12
|
const createAreasStore = (initProps) => {
|
|
15
13
|
const startProps = {
|
|
16
|
-
viwerClasses: useAreasViewerUtilityClasses(initProps.ownerState),
|
|
17
|
-
adminClasses: useAreasAdminUtilityClasses(initProps.ownerState),
|
|
18
14
|
currentAreaId: "",
|
|
19
15
|
currentModuleId: "",
|
|
20
16
|
areasIds: [],
|
|
@@ -40,13 +36,11 @@ const createAreasStore = (initProps) => {
|
|
|
40
36
|
get().areasActions.addArea();
|
|
41
37
|
set((state) => {
|
|
42
38
|
state.ownerState.status = "loaded";
|
|
43
|
-
updateOwnerStateClasses(state);
|
|
44
39
|
});
|
|
45
40
|
return;
|
|
46
41
|
}
|
|
47
42
|
set((state) => {
|
|
48
43
|
state.ownerState.status = "loading";
|
|
49
|
-
updateOwnerStateClasses(state);
|
|
50
44
|
});
|
|
51
45
|
const cookiePromise = getCookie({
|
|
52
46
|
networkOperation: get().networkOperation,
|
|
@@ -90,7 +84,6 @@ const createAreasStore = (initProps) => {
|
|
|
90
84
|
}).finally(() => {
|
|
91
85
|
set((state) => {
|
|
92
86
|
state.ownerState.status = "loaded";
|
|
93
|
-
updateOwnerStateClasses(state);
|
|
94
87
|
});
|
|
95
88
|
if (get().areasIds.length > 0 && get().currentAreaId === "") {
|
|
96
89
|
const selectedAreaId = selectedAreaIdCookie && get().areasIds?.includes?.(selectedAreaIdCookie) ? selectedAreaIdCookie : get().areasIds[0];
|
|
@@ -213,7 +206,6 @@ const createAreasStore = (initProps) => {
|
|
|
213
206
|
setExternalState: (newExternalState) => {
|
|
214
207
|
set((state) => {
|
|
215
208
|
state.ownerState = { ...state.ownerState, ...newExternalState };
|
|
216
|
-
updateOwnerStateClasses(state);
|
|
217
209
|
});
|
|
218
210
|
}
|
|
219
211
|
},
|
|
@@ -361,7 +353,6 @@ const createAreasStore = (initProps) => {
|
|
|
361
353
|
title: true,
|
|
362
354
|
url_icon: true,
|
|
363
355
|
windowOptions: true,
|
|
364
|
-
// layoutProps: false,
|
|
365
356
|
moduleId: true,
|
|
366
357
|
windowId: true,
|
|
367
358
|
mfProps: true,
|
|
@@ -619,158 +610,6 @@ const createAreasStore = (initProps) => {
|
|
|
619
610
|
});
|
|
620
611
|
});
|
|
621
612
|
}
|
|
622
|
-
// addWindowLayoutPendiente: (
|
|
623
|
-
// areaId: string,
|
|
624
|
-
// windowId: string,
|
|
625
|
-
// newWindow: NewLayoutMagnetizableProps,
|
|
626
|
-
// ) => {
|
|
627
|
-
// const newLayoutItem: WinLayoutItem = {
|
|
628
|
-
// ...newWindow.layoutProps,
|
|
629
|
-
// i: windowId,
|
|
630
|
-
// isDraggable: true,
|
|
631
|
-
// isResizable: true,
|
|
632
|
-
// winType: newWindow.winType,
|
|
633
|
-
// freeMove: false,
|
|
634
|
-
// };
|
|
635
|
-
// set(state => {
|
|
636
|
-
// const area = state.hashAreas[areaId];
|
|
637
|
-
// if (!area) {
|
|
638
|
-
// return;
|
|
639
|
-
// }
|
|
640
|
-
// const dynamicMFStore = createDynamicMFStore({
|
|
641
|
-
// dynamicMFParameters: newWindow.dynamicParams,
|
|
642
|
-
// windowId,
|
|
643
|
-
// });
|
|
644
|
-
// area.windowsLayouts.push(newLayoutItem);
|
|
645
|
-
// area.hashWindowsLayouts[windowId] = {
|
|
646
|
-
// ...newWindow,
|
|
647
|
-
// areaId,
|
|
648
|
-
// windowId,
|
|
649
|
-
// emergeType: 'layout',
|
|
650
|
-
// onClose: (removeLayoutId: string) => {
|
|
651
|
-
// get().areaActions.closeWindowLayout(areaId, removeLayoutId);
|
|
652
|
-
// },
|
|
653
|
-
// ...DEFAULT_WINDOW,
|
|
654
|
-
// dynamicMFStore,
|
|
655
|
-
// };
|
|
656
|
-
// area.baseResponsivelayoutItems.push({ i: windowId });
|
|
657
|
-
// //Agregar la ventana al hash general de todas las ventanas
|
|
658
|
-
// state.hashWindows[windowId] = area.hashWindowsLayouts[windowId];
|
|
659
|
-
// setAddBreakPoints(area, newLayoutItem);
|
|
660
|
-
// });
|
|
661
|
-
// get().areaActions.selectLayout(areaId, windowId);
|
|
662
|
-
// if (
|
|
663
|
-
// get().hashAreas[areaId].viewMode === 'single' ||
|
|
664
|
-
// newWindow?.openType === 'maximized'
|
|
665
|
-
// ) {
|
|
666
|
-
// get().areaActions.maximizeLayout(areaId, windowId);
|
|
667
|
-
// }
|
|
668
|
-
// get().areaActions.saveLayouts(areaId);
|
|
669
|
-
// get().areaActions.bouncedSaveBreakpointsLayouts(areaId);
|
|
670
|
-
// },
|
|
671
|
-
// closeLayout: (areaId: string, removePopUpId: string) => {
|
|
672
|
-
// set(state => {
|
|
673
|
-
// const area = state.hashAreas[areaId];
|
|
674
|
-
// if (!area) {
|
|
675
|
-
// return;
|
|
676
|
-
// }
|
|
677
|
-
// const removeIndex = area.windowsPopUps.findIndex(
|
|
678
|
-
// wpId => wpId === removePopUpId,
|
|
679
|
-
// );
|
|
680
|
-
// if (removeIndex > -1) {
|
|
681
|
-
// area.windowsPopUps.splice(removeIndex, 1);
|
|
682
|
-
// }
|
|
683
|
-
// delete area.hashWindowsPopups[removePopUpId];
|
|
684
|
-
// delete state.hashWindows[removePopUpId];
|
|
685
|
-
// });
|
|
686
|
-
// },
|
|
687
|
-
// selectWindowPopUp: (areaId: string, popUpId: string) => {
|
|
688
|
-
// set(state => {
|
|
689
|
-
// state.hashAreas[areaId].zPopUpIndex++;
|
|
690
|
-
// state.hashAreas[areaId].currentPopUpId = popUpId;
|
|
691
|
-
// state.hashAreas[areaId].zPopUpIndex++;
|
|
692
|
-
// state.hashAreas[areaId].currentPopUpId = popUpId;
|
|
693
|
-
// state.hashAreas[areaId].hashWindowsPopups[popUpId].zIndex =
|
|
694
|
-
// state.hashAreas[areaId].zPopUpIndex;
|
|
695
|
-
// //Seleccionar el layout padre si lo tiene
|
|
696
|
-
// if (
|
|
697
|
-
// state.hashAreas[areaId].hashWindowsPopups[popUpId].parentLayoutId &&
|
|
698
|
-
// state.hashAreas[areaId].hashWindowsPopups[popUpId]
|
|
699
|
-
// .parentLayoutId !== ''
|
|
700
|
-
// ) {
|
|
701
|
-
// state.hashAreas[areaId].currentLayoutId =
|
|
702
|
-
// state.hashAreas[areaId].hashWindowsPopups[
|
|
703
|
-
// popUpId
|
|
704
|
-
// ].parentLayoutId;
|
|
705
|
-
// } else {
|
|
706
|
-
// state.hashAreas[areaId].currentLayoutId = '';
|
|
707
|
-
// }
|
|
708
|
-
// });
|
|
709
|
-
// //Enfocar el componente despues de la renderización.
|
|
710
|
-
// setTimeout(() => {
|
|
711
|
-
// //Asegurar visibilidad si es un reemplazo
|
|
712
|
-
// const container = document.getElementsByClassName(
|
|
713
|
-
// `${areasViewerClasses.areaGridLayoutPanelContainer}-${areaId}`,
|
|
714
|
-
// )[0];
|
|
715
|
-
// const element = document.getElementsByClassName(
|
|
716
|
-
// `${areasViewerClasses.windowPopupRoot}-${popUpId}`,
|
|
717
|
-
// )[0]; //`M4L_WindowPopUp_${popUpId}`,
|
|
718
|
-
// //TODO: Proteeccion de los vectores
|
|
719
|
-
// if (element && container) {
|
|
720
|
-
// const { top, left } = element.getBoundingClientRect();
|
|
721
|
-
// const { top: containerTop, left: containerLeft } =
|
|
722
|
-
// container.getBoundingClientRect();
|
|
723
|
-
// container.scrollTop = container.scrollTop + top - containerTop;
|
|
724
|
-
// container.scrollLeft = container.scrollLeft + left - containerLeft;
|
|
725
|
-
// }
|
|
726
|
-
// }, 100);
|
|
727
|
-
// // windowsPopUps.findIndex(wp => wp.container_id === lookForThisId) > -1) {
|
|
728
|
-
// // setSelectedWindow(newSeletectedId);
|
|
729
|
-
// },
|
|
730
|
-
// resizeMaximixedLayout: (areaId: string) => {
|
|
731
|
-
// set(state => {
|
|
732
|
-
// const area = state.hashAreas[areaId];
|
|
733
|
-
// if (!area) return;
|
|
734
|
-
// if (areaId !== state.currentAreaId) {
|
|
735
|
-
// return;
|
|
736
|
-
// }
|
|
737
|
-
// if (area.viewMode === 'single' && area.currentLayoutId !== '') {
|
|
738
|
-
// console.log('Rezigning', areaId);
|
|
739
|
-
// const layoutsBreakPoints = area.layouts;
|
|
740
|
-
// const container = document.getElementsByClassName(
|
|
741
|
-
// `${areasViewerClasses.areaGridLayout}-${area.id}`,
|
|
742
|
-
// )[0];
|
|
743
|
-
// window.dispatchEvent(new Event('resize'));
|
|
744
|
-
// for (const key in layoutsBreakPoints) {
|
|
745
|
-
// const layoutBreakpoint = layoutsBreakPoints[key];
|
|
746
|
-
// if (layoutBreakpoint) {
|
|
747
|
-
// const clientHeight = container.clientHeight;
|
|
748
|
-
// //Formula que sale de despejar de acuerdo al grid layout en el codigo fuente: heigthpx = colOrRowSize * gridUnits + Math.max(0, gridUnits - 1) * marginPx
|
|
749
|
-
// const heigthUnits =
|
|
750
|
-
// (clientHeight +
|
|
751
|
-
// MARGIN_GRIDLAYOUT -
|
|
752
|
-
// 2 * PADDING_GRIDLAYOUT) /
|
|
753
|
-
// (ROW_HEIGTH_GRIDLAYOUT + MARGIN_GRIDLAYOUT);
|
|
754
|
-
// for (
|
|
755
|
-
// let index = 0;
|
|
756
|
-
// index < layoutBreakpoint.length;
|
|
757
|
-
// index++
|
|
758
|
-
// ) {
|
|
759
|
-
// const l = layoutBreakpoint[index];
|
|
760
|
-
// if (l.i === area.currentLayoutId) {
|
|
761
|
-
// l.h = heigthUnits;
|
|
762
|
-
// l.maxH = heigthUnits;
|
|
763
|
-
// }
|
|
764
|
-
// }
|
|
765
|
-
// }
|
|
766
|
-
// }
|
|
767
|
-
// }
|
|
768
|
-
// //TODO: Corregir cuando arranca en celular,
|
|
769
|
-
// // no se han cargado las ventanas y no se puede encontrar
|
|
770
|
-
// // Adicionalmente no se ha posicionado el panelWindows, y calcula
|
|
771
|
-
// // state.cols = MAXIMIZED_COLS;
|
|
772
|
-
// });
|
|
773
|
-
// },
|
|
774
613
|
},
|
|
775
614
|
windowActions: {
|
|
776
615
|
/**
|
|
@@ -958,7 +797,6 @@ const createAreasStore = (initProps) => {
|
|
|
958
797
|
setFocus: (newValue) => {
|
|
959
798
|
set((state) => {
|
|
960
799
|
state.ownerState = { ...state.ownerState, focus: newValue };
|
|
961
|
-
updateOwnerStateClasses(state);
|
|
962
800
|
});
|
|
963
801
|
}
|
|
964
802
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { GetLabelType, NetworkProps } from '@m4l/core';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { CookieType, HashWindowsByModals, ModalStateProps, AreaWindowAction, NewModalProps, NewLayoutMoveableProps, NewWindowProps, WinType, WindowStateProps, NewLayoutMagnetizableProps } from '../../types';
|
|
4
|
-
import { ViwerClasses } from '../../components/AreasViewer/classes';
|
|
5
|
-
import { AdminClasses } from '../../components/AreasAdmin/classes';
|
|
6
4
|
import { DebouncedFunc } from 'lodash';
|
|
7
5
|
import { LayoutItem } from '../../../GridLayout';
|
|
8
6
|
import { ContainerChangeEvent } from '../../../GridLayout/subcomponents/Responsive/types';
|
|
@@ -94,11 +92,9 @@ export interface AreasState {
|
|
|
94
92
|
/**
|
|
95
93
|
* "viwerClasses" enfocado al funcionamiento de las clases a nivel de viewer
|
|
96
94
|
*/
|
|
97
|
-
viwerClasses: ViwerClasses;
|
|
98
95
|
/**
|
|
99
96
|
* "adminClasses" enfocado al funcionamiento de las clases a nivel de Admin
|
|
100
97
|
*/
|
|
101
|
-
adminClasses: AdminClasses;
|
|
102
98
|
/**
|
|
103
99
|
* "windowsModals" id de ventans modales abiertas
|
|
104
100
|
*/
|
|
@@ -8,7 +8,6 @@ export declare function getModalUtilityClass(slot: string): string;
|
|
|
8
8
|
export declare const modalUtilityClasses: (ownerState: OwnerStateWindowConfirm) => {
|
|
9
9
|
root: string;
|
|
10
10
|
resizeHandle: string;
|
|
11
|
-
windowContent: string;
|
|
12
11
|
windowBaseRoot: string;
|
|
13
12
|
illustrationContainer: string;
|
|
14
13
|
containerWindow: string;
|
|
@@ -21,4 +20,5 @@ export declare const modalUtilityClasses: (ownerState: OwnerStateWindowConfirm)
|
|
|
21
20
|
messageContainer: string;
|
|
22
21
|
illustration: string;
|
|
23
22
|
windowConfirm: string;
|
|
23
|
+
windowContent: string;
|
|
24
24
|
};
|
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { v as v2 } from "./components/animate/variants/bounce.js";
|
|
|
17
17
|
import { v as v3 } from "./components/animate/variants/container.js";
|
|
18
18
|
import { v as v4, a, b } from "./components/animate/variants/transition.js";
|
|
19
19
|
import { A as A2 } from "./components/areas/components/AreasAdmin/AreasAdmin.js";
|
|
20
|
-
import { A as A3 } from "./components/areas/components/AreasViewer/
|
|
20
|
+
import { A as A3 } from "./components/areas/components/AreasViewer/AreasViewer.js";
|
|
21
21
|
import { a as a2, W } from "./components/areas/contexts/WindowToolsMFContext/index.js";
|
|
22
22
|
import { c as c2 } from "./components/areas/contexts/DynamicMFParmsContext/store.js";
|
|
23
23
|
import { a as a3, A as A4 } from "./components/areas/contexts/AreasContext/index.js";
|
package/package.json
CHANGED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { generateUtilityClasses } from "@mui/material";
|
|
2
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
-
import { g as getComponentUtilityClass } from "../../../../../utils/index.js";
|
|
4
|
-
import { A as AREAS_ADMIN_CLASS_NAME } from "../../../constants.js";
|
|
5
|
-
generateUtilityClasses(
|
|
6
|
-
AREAS_ADMIN_CLASS_NAME,
|
|
7
|
-
[
|
|
8
|
-
/* elements */
|
|
9
|
-
"root",
|
|
10
|
-
"rootContent",
|
|
11
|
-
"areaChipRoot",
|
|
12
|
-
"areaChipTitle",
|
|
13
|
-
"areaChipDeleteButton",
|
|
14
|
-
"areasAddButton",
|
|
15
|
-
"areaContainerChipEditButton",
|
|
16
|
-
"areaContainerChips",
|
|
17
|
-
"areaContainerContentChips",
|
|
18
|
-
"areaContainerChipsIcon",
|
|
19
|
-
"areaEditPopover",
|
|
20
|
-
"areaChipMobileRoot",
|
|
21
|
-
"areaChipMobileIconContainer",
|
|
22
|
-
"areaIconLayer",
|
|
23
|
-
"areaIconLayerContent",
|
|
24
|
-
"areaChipEditButton",
|
|
25
|
-
"areasPopoverMobileOptions",
|
|
26
|
-
"areasPopoverListWindows",
|
|
27
|
-
"areasPopoverListWindowsIcon",
|
|
28
|
-
"areaContentChips",
|
|
29
|
-
/* states or variants of elements */
|
|
30
|
-
"selected",
|
|
31
|
-
"isMobile",
|
|
32
|
-
"disabled",
|
|
33
|
-
"isFocus"
|
|
34
|
-
],
|
|
35
|
-
AREAS_ADMIN_CLASS_NAME
|
|
36
|
-
);
|
|
37
|
-
const useAreasAdminUtilityClasses = (ownerState) => {
|
|
38
|
-
const slots = {
|
|
39
|
-
root: [
|
|
40
|
-
"root",
|
|
41
|
-
ownerState.status,
|
|
42
|
-
ownerState.isMobile && "isMobile",
|
|
43
|
-
ownerState.isSkeleton && "isSkeleton",
|
|
44
|
-
ownerState.focus && "isFocus"
|
|
45
|
-
],
|
|
46
|
-
rootContent: ["rootContent"],
|
|
47
|
-
areaChipRoot: ["areaChipRoot"],
|
|
48
|
-
areaIconLayer: ["areaIconLayer"],
|
|
49
|
-
areaContainerChipsIcon: ["areaContainerChipsIcon"],
|
|
50
|
-
areaContainerChips: ["areaContainerChips"],
|
|
51
|
-
areaContainerContentChips: ["areaContainerContentChips"],
|
|
52
|
-
areaEditPopover: ["areaEditPopover"],
|
|
53
|
-
areaChipMobileRoot: ["areaChipMobileRoot"],
|
|
54
|
-
areaChipMobileIconContainer: ["areaChipMobileIconContainer"],
|
|
55
|
-
areaChipTitle: ["areaChipTitle"],
|
|
56
|
-
areaContainerChipEditButton: ["areaContainerChipEditButton"],
|
|
57
|
-
areaChipDeleteButton: ["areaChipDeleteButton"],
|
|
58
|
-
areaChipEditButton: ["areaChipEditButton"],
|
|
59
|
-
areasAddButton: ["areasAddButton"],
|
|
60
|
-
areasPopoverMobileOptions: ["areasPopoverMobileOptions"],
|
|
61
|
-
areasPopoverListWindows: ["areasPopoverListWindows"],
|
|
62
|
-
areasPopoverListWindowsIcon: ["areasPopoverListWindowsIcon"],
|
|
63
|
-
areaContentChips: ["areaContentChips"]
|
|
64
|
-
};
|
|
65
|
-
return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
|
|
66
|
-
};
|
|
67
|
-
export {
|
|
68
|
-
useAreasAdminUtilityClasses as u
|
|
69
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Muestra las áreas cargadas en el store, si no se han cargado muestra un componente indicando la carga.
|
|
3
|
-
* Se debe visualizar todas las areas, y con display:none para todas menos para la activa, para que no se tengan que estar montando y destruyendo
|
|
4
|
-
* las ventanas que al cambiar entre áreas
|
|
5
|
-
* @returns JSX Areas
|
|
6
|
-
*/
|
|
7
|
-
export declare function AreasViewer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AreasViewerRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import "react-resizable/css/styles.css";
|
|
2
|
-
import { styled } from "@mui/material/styles";
|
|
3
|
-
import { a as areasViewerClasses } from "./classes/index.js";
|
|
4
|
-
const AreasViewerRoot = styled("div")`
|
|
5
|
-
/* display: flex; */
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
/* flex-grow: 1; */
|
|
10
|
-
position: relative;
|
|
11
|
-
//areaRoot
|
|
12
|
-
& .${areasViewerClasses.areaRoot} {
|
|
13
|
-
display: none;
|
|
14
|
-
position: absolute;
|
|
15
|
-
/* flex-grow: 1; */
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
inset: 0;
|
|
18
|
-
/* width: 100%; */
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
justify-content: top;
|
|
21
|
-
align-items: flex-start;
|
|
22
|
-
visibility: hidden;
|
|
23
|
-
}
|
|
24
|
-
& .${areasViewerClasses.areaRoot}.${areasViewerClasses.selected} {
|
|
25
|
-
display: block;
|
|
26
|
-
visibility: visible;
|
|
27
|
-
}
|
|
28
|
-
&.${areasViewerClasses.isMobile} .${areasViewerClasses.areaRoot} {
|
|
29
|
-
}
|
|
30
|
-
// areaGridLayoutPanelContainer
|
|
31
|
-
& .${areasViewerClasses.areaGridLayoutPanelContainer} {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
height: 100%;
|
|
35
|
-
width: 100%;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
}
|
|
38
|
-
&.${areasViewerClasses.isMobile} .${areasViewerClasses.areaGridLayoutPanelContainer} {
|
|
39
|
-
flex-direction: column-reverse;
|
|
40
|
-
}
|
|
41
|
-
// areaGridLayout
|
|
42
|
-
& .${areasViewerClasses.areaGridLayout} {
|
|
43
|
-
height: 100% !important;
|
|
44
|
-
overflow: auto;
|
|
45
|
-
flex-grow: 1;
|
|
46
|
-
}
|
|
47
|
-
&.${areasViewerClasses.isMobile} .${areasViewerClasses.areaGridLayout} {
|
|
48
|
-
flex-direction: column-reverse;
|
|
49
|
-
height: unset;
|
|
50
|
-
width: 100%;
|
|
51
|
-
}
|
|
52
|
-
// areaGridLayoutPopupsContainer
|
|
53
|
-
& .${areasViewerClasses.areaGridLayoutPopupsContainer} {
|
|
54
|
-
z-index: 1; //Garantizar q el contenedor de los popus este por encima de los layouts
|
|
55
|
-
// // ' .react-draggable': {
|
|
56
|
-
// // position: 'absolute',
|
|
57
|
-
// // },
|
|
58
|
-
}
|
|
59
|
-
// PanelWindowsRoot
|
|
60
|
-
& .${areasViewerClasses.panelWindowsRoot} {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
position: relative;
|
|
64
|
-
}
|
|
65
|
-
&.${areasViewerClasses.isMobile} .${areasViewerClasses.panelWindowsRoot} {
|
|
66
|
-
flex-direction: row;
|
|
67
|
-
}
|
|
68
|
-
// windowRoot
|
|
69
|
-
& .${areasViewerClasses.windowRoot} {
|
|
70
|
-
inset: 0;
|
|
71
|
-
position: absolute;
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
/* height: 100%; */
|
|
75
|
-
/* width: 100%; */
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
border: 1px solid gray;
|
|
78
|
-
background-color: ${(props) => props.theme.vars.palette.background.default};
|
|
79
|
-
padding: ${(props) => props.theme.spacing(0)};
|
|
80
|
-
}
|
|
81
|
-
& .${areasViewerClasses.windowRoot}.${areasViewerClasses.selected} {
|
|
82
|
-
border-top: 1px solid green;
|
|
83
|
-
}
|
|
84
|
-
// windowHeaderTitle
|
|
85
|
-
& .${areasViewerClasses.windowHeaderTitle} {
|
|
86
|
-
width: 100%;
|
|
87
|
-
max-width: 100%;
|
|
88
|
-
overflow: hidden;
|
|
89
|
-
white-space: nowrap;
|
|
90
|
-
color: ${(props) => props.theme.vars.palette.text.primary};
|
|
91
|
-
text-overflow: ellipsis;
|
|
92
|
-
}
|
|
93
|
-
// windowHeaderMainActions
|
|
94
|
-
& .${areasViewerClasses.windowHeaderMainActions} {
|
|
95
|
-
display: flex;
|
|
96
|
-
gap: 4px;
|
|
97
|
-
}
|
|
98
|
-
// windowHeaderMainActions
|
|
99
|
-
& .${areasViewerClasses.windowContent} {
|
|
100
|
-
flex-grow: 1;
|
|
101
|
-
position: relative;
|
|
102
|
-
}
|
|
103
|
-
// windowModalRoot
|
|
104
|
-
& .${areasViewerClasses.windowModalRoot} {
|
|
105
|
-
padding: 16px;
|
|
106
|
-
}
|
|
107
|
-
${(props) => props.theme.components?.M4LAreasViewer?.styleOverrides}
|
|
108
|
-
`;
|
|
109
|
-
export {
|
|
110
|
-
AreasViewerRoot as A
|
|
111
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { I as InnerForHooks } from "./subcomponents/InnerForHooks/index.js";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
|
|
5
|
-
import { a as areasViewerClasses } from "../../classes/index.js";
|
|
6
|
-
const Area = (props) => {
|
|
7
|
-
const { selected, areaId } = props;
|
|
8
|
-
const classesAreaRoot = useAreasStore((state) => state.viwerClasses.areaRoot);
|
|
9
|
-
const status = useAreasStore((state) => state.hashAreas[areaId].status);
|
|
10
|
-
if (status === "init") {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
"div",
|
|
15
|
-
{
|
|
16
|
-
className: clsx(
|
|
17
|
-
classesAreaRoot,
|
|
18
|
-
selected ? areasViewerClasses.selected : null,
|
|
19
|
-
status === "loading" ? areasViewerClasses.loading : null
|
|
20
|
-
),
|
|
21
|
-
children: /* @__PURE__ */ jsx(InnerForHooks, { areaId })
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
Area.displayName = "Area";
|
|
26
|
-
export {
|
|
27
|
-
Area as A
|
|
28
|
-
};
|