@m4l/components 9.1.97 → 9.1.99
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/components/WindowBase/WindowBase.d.ts +1 -1
- package/components/WindowBase/WindowBase.js +2 -0
- package/components/WindowBase/types.d.ts +24 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/index.d.ts +4 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.d.ts +4 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.js +4 -10
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.d.ts +32 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions/useHeaderActions.js +163 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow/useWindow.d.ts +35 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow/useWindow.js +88 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +14 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.js +47 -113
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +12 -8
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.js +3 -16
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +7 -1
- package/components/areas/contexts/AreasContext/helpers/generateModuleCount.d.ts +4 -0
- package/components/areas/contexts/AreasContext/helpers/helper.d.ts +36 -0
- package/components/areas/contexts/AreasContext/index.d.ts +2 -2
- package/components/areas/contexts/AreasContext/store.d.ts +1 -1
- package/components/areas/contexts/AreasContext/store.js +37 -33
- package/components/areas/contexts/AreasContext/tests/fnNetworkImplementation.d.ts +21 -0
- package/components/areas/contexts/AreasContext/types.d.ts +53 -2
- package/components/areas/types.d.ts +7 -1
- package/package.json +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/index.js +0 -99
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.js +0 -69
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.js +0 -154
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.js +0 -44
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/index.js +0 -57
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +0 -9
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/types.d.ts +0 -2
package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { styled } from "@mui/material";
|
|
2
|
-
import { a as areasViewerClasses } from "../../../../classes/index.js";
|
|
3
|
-
const WindowRoot = styled("div")`
|
|
4
|
-
inset: 0;
|
|
5
|
-
position: absolute;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
/* height: 100%; */
|
|
9
|
-
/* width: 100%; */
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
border: 1px solid gray;
|
|
12
|
-
|
|
13
|
-
background-color: ${(props) => props.theme.vars.palette.background.default};
|
|
14
|
-
padding: ${(props) => props.theme.spacing(0)};
|
|
15
|
-
&.${areasViewerClasses.selected} {
|
|
16
|
-
border-top: 1px solid green;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// windowHeader
|
|
20
|
-
/*
|
|
21
|
-
&.${areasViewerClasses.loading} .${areasViewerClasses.windowHeader} {
|
|
22
|
-
border-bottom: 2px solid red !important;
|
|
23
|
-
}
|
|
24
|
-
*/
|
|
25
|
-
// windowHeaderTitle
|
|
26
|
-
& .${areasViewerClasses.windowHeaderTitle} {
|
|
27
|
-
width: 100%;
|
|
28
|
-
max-width: 100%;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
white-space: nowrap;
|
|
31
|
-
color: ${(props) => props.theme.vars.palette.text.primary};
|
|
32
|
-
text-overflow: ellipsis;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
& .${areasViewerClasses.windowHeaderCancelHandle} {
|
|
36
|
-
display: flex;
|
|
37
|
-
cursor: default;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// windowHeaderMainActions
|
|
41
|
-
& .${areasViewerClasses.windowHeaderMainActions} {
|
|
42
|
-
display: flex;
|
|
43
|
-
|
|
44
|
-
gap: 4px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// windowHeaderMainActions
|
|
48
|
-
& .${areasViewerClasses.windowContent} {
|
|
49
|
-
flex-grow: 1;
|
|
50
|
-
position: relative;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
& .${areasViewerClasses.windowContent}.${areasViewerClasses.colapsed} {
|
|
54
|
-
display: none !important;
|
|
55
|
-
}
|
|
56
|
-
// windowModalRoot
|
|
57
|
-
& .${areasViewerClasses.windowModalRoot} {
|
|
58
|
-
padding: 16px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
& .MuiLinearProgress-root {
|
|
62
|
-
width: 100%;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
${(props) => props.theme.components?.M4LAreasViewerWindow?.styleOverrides}
|
|
66
|
-
`;
|
|
67
|
-
export {
|
|
68
|
-
WindowRoot as W
|
|
69
|
-
};
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { shallow } from "zustand/shallow";
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
import { useEnvironment, useModuleSkeleton, useModuleDictionary } from "@m4l/core";
|
|
6
|
-
import { W as WindowHeaderSkeleton } from "./subcomponents/WindowHeaderSkeleton/index.js";
|
|
7
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
8
|
-
import { u as useAreasStore } from "../../../../../../../../hooks/useAreas/index.js";
|
|
9
|
-
import { I as ICONS } from "../../../../../../../../icons.js";
|
|
10
|
-
import { a as areasViewerClasses } from "../../../../../../classes/index.js";
|
|
11
|
-
import { g as getMenuActions } from "./helper.js";
|
|
12
|
-
import { M as MainActions } from "./subcomponents/MainActions/index.js";
|
|
13
|
-
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../../../../../dictionary.js";
|
|
14
|
-
import { L as LinearProgressIndeterminate } from "../../../../../../../../../LinearProgressIndeterminate/LinearProgressIndeterminate.js";
|
|
15
|
-
import { T as Typography } from "../../../../../../../../../mui_extended/Typography/Typography.js";
|
|
16
|
-
import { a as MemonizedMenuActions } from "../../../../../../../../../MenuActions/MenuActions.js";
|
|
17
|
-
import { I as IconButton } from "../../../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
18
|
-
import { I as Icon } from "../../../../../../../../../Icon/Icon.js";
|
|
19
|
-
function Header(props) {
|
|
20
|
-
const { areaId, windowId, emergeType } = props;
|
|
21
|
-
const [url_icon, title, moduleActions, onClose, version, windowOptions, fnQueryClose, moduleCount] = useAreasStore((state) => {
|
|
22
|
-
const window = state.hashWindows[windowId];
|
|
23
|
-
return [
|
|
24
|
-
window.iconUrl,
|
|
25
|
-
window.title,
|
|
26
|
-
window.moduleActions,
|
|
27
|
-
window.onClose,
|
|
28
|
-
window.version,
|
|
29
|
-
window.windowOptions,
|
|
30
|
-
window.fnQueryClose,
|
|
31
|
-
window.moduleCount
|
|
32
|
-
];
|
|
33
|
-
}, shallow);
|
|
34
|
-
const { saveModuleCookies, resetModuleCookies } = useAreasStore(
|
|
35
|
-
(state) => state.windowActions,
|
|
36
|
-
shallow
|
|
37
|
-
);
|
|
38
|
-
const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
|
|
39
|
-
const collapsed = useAreasStore((state) => {
|
|
40
|
-
const currentBreakpoint = state.hashAreas[areaId].currentBreakpoint;
|
|
41
|
-
if (currentBreakpoint) {
|
|
42
|
-
return state.hashAreas[areaId].layouts[currentBreakpoint].find((li) => li.i === windowId)?.colapsed;
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}, shallow);
|
|
46
|
-
const { maximizeLayout, normalizeLayouts, colapseLayoutItem, unColapseLayoutItem } = useAreasStore((state) => state.areaActions, shallow);
|
|
47
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
48
|
-
const isDesktop = useResponsiveDesktop();
|
|
49
|
-
const isSkeleton = useModuleSkeleton();
|
|
50
|
-
const { getLabel } = useModuleDictionary();
|
|
51
|
-
const urlPrefix = `${host_static_assets}/${environment_assets}`;
|
|
52
|
-
const menuActions = useMemo(() => {
|
|
53
|
-
return getMenuActions({
|
|
54
|
-
windowId,
|
|
55
|
-
isDesktop,
|
|
56
|
-
moduleActions,
|
|
57
|
-
urlPrefix,
|
|
58
|
-
saveModuleCookies,
|
|
59
|
-
resetModuleCookies,
|
|
60
|
-
version,
|
|
61
|
-
windowOptions,
|
|
62
|
-
getLabel
|
|
63
|
-
});
|
|
64
|
-
}, [moduleActions, isDesktop]);
|
|
65
|
-
const onCloseLocal = () => {
|
|
66
|
-
const fnClose = fnQueryClose || onClose;
|
|
67
|
-
fnClose && fnClose(windowId);
|
|
68
|
-
};
|
|
69
|
-
const maxNormalize = (e) => {
|
|
70
|
-
if (maximizedId === windowId) {
|
|
71
|
-
normalizeLayouts(areaId);
|
|
72
|
-
} else {
|
|
73
|
-
maximizeLayout(areaId, windowId);
|
|
74
|
-
}
|
|
75
|
-
e.stopPropagation();
|
|
76
|
-
};
|
|
77
|
-
const collapsedToggle = (e) => {
|
|
78
|
-
if (!collapsed) {
|
|
79
|
-
colapseLayoutItem(areaId, windowId);
|
|
80
|
-
} else {
|
|
81
|
-
unColapseLayoutItem(areaId, windowId);
|
|
82
|
-
}
|
|
83
|
-
e.stopPropagation();
|
|
84
|
-
};
|
|
85
|
-
if (isSkeleton) {
|
|
86
|
-
return /* @__PURE__ */ jsx(WindowHeaderSkeleton, {});
|
|
87
|
-
}
|
|
88
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx(areasViewerClasses.windowHeader, "m4l_draggable_handle"), children: [
|
|
89
|
-
/* @__PURE__ */ jsx(LinearProgressIndeterminate, {}),
|
|
90
|
-
/* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
|
|
91
|
-
/* @__PURE__ */ jsx(Icon, { src: url_icon, size: "medium" }),
|
|
92
|
-
/* @__PURE__ */ jsxs(Typography, { className: areasViewerClasses.windowHeaderTitle, variant: "h5", children: [
|
|
93
|
-
title,
|
|
94
|
-
moduleCount ? `:${moduleCount}` : null
|
|
95
|
-
] }),
|
|
96
|
-
/* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: [
|
|
97
|
-
!collapsed && /* @__PURE__ */ jsx(MainActions, { windowId }),
|
|
98
|
-
!collapsed && menuActions.length > 0 && /* @__PURE__ */ jsx(
|
|
99
|
-
MemonizedMenuActions,
|
|
100
|
-
{
|
|
101
|
-
arrowType: "no-arrow",
|
|
102
|
-
marginTop: "12px!important",
|
|
103
|
-
marginLeft: "14px!important",
|
|
104
|
-
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
105
|
-
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
106
|
-
menuActions,
|
|
107
|
-
toolTip: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_module_actions))
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
!collapsed && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(
|
|
111
|
-
IconButton,
|
|
112
|
-
{
|
|
113
|
-
className: "m4l_draggableCancel",
|
|
114
|
-
onClick: maxNormalize,
|
|
115
|
-
"aria-label": "click",
|
|
116
|
-
src: maximizedId === windowId ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.NORMALIZE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.MAXIMIZE}`,
|
|
117
|
-
tooltip: getLabel(
|
|
118
|
-
getAreasDictionary(
|
|
119
|
-
maximizedId === windowId ? AREAS_DICCTIONARY.label_minimize_window : AREAS_DICCTIONARY.label_maximize_window
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
!maximizedId && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(
|
|
125
|
-
IconButton,
|
|
126
|
-
{
|
|
127
|
-
className: "m4l_draggableCancel",
|
|
128
|
-
onClick: collapsedToggle,
|
|
129
|
-
"aria-label": "click",
|
|
130
|
-
src: !collapsed ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.COLAPSE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.UNCOLPASE}`,
|
|
131
|
-
tooltip: getLabel(
|
|
132
|
-
getAreasDictionary(
|
|
133
|
-
!collapsed ? AREAS_DICCTIONARY.label_collapse_window : AREAS_DICCTIONARY.label_uncollapse_window
|
|
134
|
-
)
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
onClose && /* @__PURE__ */ jsx(
|
|
139
|
-
IconButton,
|
|
140
|
-
{
|
|
141
|
-
className: "m4l_draggableCancel",
|
|
142
|
-
onPointerDown: onCloseLocal,
|
|
143
|
-
"aria-label": "click",
|
|
144
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
|
|
145
|
-
tooltip: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_close_window))
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
] })
|
|
149
|
-
] })
|
|
150
|
-
] });
|
|
151
|
-
}
|
|
152
|
-
export {
|
|
153
|
-
Header as H
|
|
154
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { shallow } from "zustand/shallow";
|
|
4
|
-
import { useModuleDictionary } from "@m4l/core";
|
|
5
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
6
|
-
import { a as areasViewerClasses } from "../../../../../../../../classes/index.js";
|
|
7
|
-
import { a as getMainActions } from "../../helper.js";
|
|
8
|
-
import { u as useAreasStore } from "../../../../../../../../../../hooks/useAreas/index.js";
|
|
9
|
-
import clsx from "clsx";
|
|
10
|
-
import { I as IconButton } from "../../../../../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
11
|
-
function MainActions(props) {
|
|
12
|
-
const { windowId } = props;
|
|
13
|
-
const moduleActions = useAreasStore((state) => {
|
|
14
|
-
const window = state.hashWindows[windowId];
|
|
15
|
-
return window?.moduleActions || [];
|
|
16
|
-
}, shallow);
|
|
17
|
-
const { getLabel } = useModuleDictionary();
|
|
18
|
-
const isDesktop = useResponsiveDesktop();
|
|
19
|
-
const mainActions = useMemo(() => {
|
|
20
|
-
return getMainActions(isDesktop, moduleActions);
|
|
21
|
-
}, [moduleActions, isDesktop]);
|
|
22
|
-
return /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderMainActions, children: mainActions.map((mainAction) => {
|
|
23
|
-
const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.label || "");
|
|
24
|
-
const onClick = (e) => {
|
|
25
|
-
mainAction.onClick && mainAction.onClick(e);
|
|
26
|
-
e.stopPropagation();
|
|
27
|
-
};
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
IconButton,
|
|
30
|
-
{
|
|
31
|
-
src: typeof mainAction.startIcon === "string" ? mainAction.startIcon : "",
|
|
32
|
-
className: clsx(mainAction.className, "m4l_draggableCancel"),
|
|
33
|
-
onClick,
|
|
34
|
-
"aria-label": mainAction.label,
|
|
35
|
-
disabled: mainAction.disabled,
|
|
36
|
-
tooltip
|
|
37
|
-
},
|
|
38
|
-
mainAction.key
|
|
39
|
-
);
|
|
40
|
-
}) });
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
MainActions as M
|
|
44
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Skeleton } from "@mui/material";
|
|
3
|
-
import { a as areasViewerClasses } from "../../../../../../../../classes/index.js";
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
function WindowHeaderSkeleton(props) {
|
|
6
|
-
const { colapsed } = props;
|
|
7
|
-
return /* @__PURE__ */ jsx("div", { className: clsx(areasViewerClasses.windowHeader), children: /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
|
|
8
|
-
/* @__PURE__ */ jsx(
|
|
9
|
-
Skeleton,
|
|
10
|
-
{
|
|
11
|
-
variant: "circular",
|
|
12
|
-
sx: { margin: "0 5px", minWidth: "18px", minHeight: "18px" }
|
|
13
|
-
}
|
|
14
|
-
),
|
|
15
|
-
/* @__PURE__ */ jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 80, height: 16 }) }),
|
|
16
|
-
/* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: !colapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
-
/* @__PURE__ */ jsx(
|
|
18
|
-
Skeleton,
|
|
19
|
-
{
|
|
20
|
-
variant: "circular",
|
|
21
|
-
sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
|
|
22
|
-
}
|
|
23
|
-
),
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
Skeleton,
|
|
26
|
-
{
|
|
27
|
-
variant: "circular",
|
|
28
|
-
sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
Skeleton,
|
|
33
|
-
{
|
|
34
|
-
variant: "circular",
|
|
35
|
-
sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
] }) }),
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
Skeleton,
|
|
41
|
-
{
|
|
42
|
-
variant: "circular",
|
|
43
|
-
sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
|
|
44
|
-
}
|
|
45
|
-
),
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
Skeleton,
|
|
48
|
-
{
|
|
49
|
-
variant: "circular",
|
|
50
|
-
sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
] }) });
|
|
54
|
-
}
|
|
55
|
-
export {
|
|
56
|
-
WindowHeaderSkeleton as W
|
|
57
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { WindowPopUpsListProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* TODO: Documentar
|
|
4
|
-
* @author Andrés Quintero - automatic
|
|
5
|
-
* @createdAt 2024-12-27 08:27:31 - automatic
|
|
6
|
-
* @updatedAt 2025-01-31 11:37:44 - automatic
|
|
7
|
-
* @updatedUser cesar - automatic
|
|
8
|
-
*/
|
|
9
|
-
export declare const WindowPopUpsList: (props: WindowPopUpsListProps) => import("react/jsx-runtime").JSX.Element | null;
|