@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
package/@types/types.d.ts
CHANGED
|
@@ -136,7 +136,7 @@ import { DividerOwnerState, DividerSlotsType } from '../components/mui_extended/
|
|
|
136
136
|
import { CourseFormatterOwnerState, CourseFormatterSlotsType } from '../components/formatters/CourseFormatter/types';
|
|
137
137
|
import { NoItemSelectedOwnerState, NoItemSelectedSlotsType } from '../components/NoItemSelected/types';
|
|
138
138
|
import { ActionFormIntroOwnerState, ActionFormIntroSlotsType } from '../components/CommonActions/components/ActionFormIntro/types';
|
|
139
|
-
|
|
139
|
+
import { AreasViewerOwnerState, AreasViewerType } from '../components/areas/components/AreasViewer/types';
|
|
140
140
|
|
|
141
141
|
declare module '@mui/material/styles' {
|
|
142
142
|
// Define the slots in the theme
|
|
@@ -205,6 +205,7 @@ declare module '@mui/material/styles' {
|
|
|
205
205
|
M4LCourseFormatter: CourseFormatterSlotsType;
|
|
206
206
|
M4LNoItemSelected: NoItemSelectedSlotsType;
|
|
207
207
|
M4LActionFormIntro: ActionFormIntroSlotsType;
|
|
208
|
+
M4LAreasViewer: AreasViewerType;
|
|
208
209
|
}
|
|
209
210
|
interface ComponentsPropsList {
|
|
210
211
|
// Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
|
|
@@ -272,6 +273,7 @@ declare module '@mui/material/styles' {
|
|
|
272
273
|
M4LCourseFormatter: Partial<CourseFormatterOwnerState>;
|
|
273
274
|
M4LNoItemSelected: Partial<NoItemSelectedOwnerState>;
|
|
274
275
|
M4LActionFormIntro : Partial<ActionFormIntroOwnerState>;
|
|
276
|
+
M4LAreasViewer: Partial<AreasViewerOwnerState>;
|
|
275
277
|
}
|
|
276
278
|
interface Components {
|
|
277
279
|
M4LDynamicFilter?: {
|
|
@@ -589,10 +591,15 @@ declare module '@mui/material/styles' {
|
|
|
589
591
|
styleOverrides?: ComponentsOverrides<Theme>['M4LDivider'];
|
|
590
592
|
variants?: ComponentsVariants['M4LDivider'];
|
|
591
593
|
};
|
|
594
|
+
M4LAreasViewer?: {
|
|
595
|
+
defaultProps?: ComponentsPropsList['M4LAreasViewer'];
|
|
596
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAreasViewer'];
|
|
597
|
+
variants?: ComponentsVariants['M4LAreasViewer'];
|
|
598
|
+
};
|
|
592
599
|
M4LCourseFormatter?: {
|
|
593
600
|
defaultProps?: ComponentsPropsList['M4LCourseFormatter'];
|
|
594
601
|
styleOverrides?: ComponentsOverrides<Theme>['M4LCourseFormatter'];
|
|
595
602
|
variants?: ComponentsVariants['M4LCourseFormatter'];
|
|
596
603
|
};
|
|
597
|
-
|
|
598
|
-
|
|
604
|
+
}
|
|
605
|
+
}
|
|
@@ -4,6 +4,7 @@ import { P as PaperFormRootStyled, C as ContentStyled } from "./slots/PaperFormS
|
|
|
4
4
|
import { useRef } from "react";
|
|
5
5
|
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
6
6
|
import { P as PAPER_FORM_KEY } from "./constants.js";
|
|
7
|
+
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
7
8
|
import { P as PropertyValue } from "../PropertyValue/PropertyValue.js";
|
|
8
9
|
const isPropertyValue = (child) => typeof child === "object" && child !== null && "property" in child && "value" in child;
|
|
9
10
|
const renderChildren = (children) => {
|
|
@@ -25,14 +26,22 @@ function PaperForm(props) {
|
|
|
25
26
|
isForm = false,
|
|
26
27
|
variant = "standard"
|
|
27
28
|
} = props;
|
|
29
|
+
const { currentSize } = useComponentSize(size);
|
|
28
30
|
const paperFormRef = useRef(null);
|
|
29
31
|
const rootClass = getComponentSlotRoot(PAPER_FORM_KEY);
|
|
32
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
33
|
+
const ownerState = {
|
|
34
|
+
size: adjustedSize,
|
|
35
|
+
color,
|
|
36
|
+
isForm,
|
|
37
|
+
paperFormVariant: variant
|
|
38
|
+
};
|
|
30
39
|
return /* @__PURE__ */ jsxs(
|
|
31
40
|
PaperFormRootStyled,
|
|
32
41
|
{
|
|
33
42
|
className: rootClass,
|
|
34
43
|
ref: paperFormRef,
|
|
35
|
-
ownerState: {
|
|
44
|
+
ownerState: { ...ownerState },
|
|
36
45
|
...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {},
|
|
37
46
|
children: [
|
|
38
47
|
/* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
1
2
|
const paperFormStyles = {
|
|
2
3
|
/**
|
|
3
4
|
*************************************************************
|
|
@@ -11,8 +12,7 @@ const paperFormStyles = {
|
|
|
11
12
|
border: `${theme.size.borderStroke.container}`,
|
|
12
13
|
borderColor: theme.vars.palette.border.default,
|
|
13
14
|
width: "100%",
|
|
14
|
-
height: "auto"
|
|
15
|
-
overflow: "hidden"
|
|
15
|
+
height: "auto"
|
|
16
16
|
}),
|
|
17
17
|
/**
|
|
18
18
|
* ************************************************************
|
|
@@ -26,10 +26,15 @@ const paperFormStyles = {
|
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
gap: theme.vars.size.baseSpacings.sp1,
|
|
28
28
|
overflow: "hidden",
|
|
29
|
-
|
|
30
|
-
padding: `${theme.vars.size.baseSpacings.sp2}`,
|
|
29
|
+
padding: `${theme.vars.size.baseSpacings.sp1} ${theme.vars.size.baseSpacings.sp2}`,
|
|
31
30
|
borderRadius: `${theme.vars.size.borderRadius.r1} ${theme.vars.size.borderRadius.r1} 0 0`,
|
|
32
|
-
background: theme.vars.palette[ownerState.color ?? "default"].hoverOpacity
|
|
31
|
+
background: theme.vars.palette[ownerState.color ?? "default"].hoverOpacity,
|
|
32
|
+
alignSelf: "stretch",
|
|
33
|
+
...getHeightSizeStyles(
|
|
34
|
+
theme.generalSettings.isMobile,
|
|
35
|
+
ownerState.size || "medium",
|
|
36
|
+
"container"
|
|
37
|
+
)
|
|
33
38
|
}),
|
|
34
39
|
/**
|
|
35
40
|
* ************************************************************
|
|
@@ -43,8 +48,7 @@ const paperFormStyles = {
|
|
|
43
48
|
fontSize: theme.typography.body,
|
|
44
49
|
variants: [],
|
|
45
50
|
display: "inline-flex",
|
|
46
|
-
alignItems: "center"
|
|
47
|
-
marginTop: "1px"
|
|
51
|
+
alignItems: "center"
|
|
48
52
|
}),
|
|
49
53
|
/**
|
|
50
54
|
* ************************************************************
|
|
@@ -25,7 +25,7 @@ interface CommonsProps {
|
|
|
25
25
|
paperFormVariant?: PaperFormProps['variant'];
|
|
26
26
|
}
|
|
27
27
|
export type HeaderProps = Omit<PaperFormProps, 'children' | 'isForm' | 'variant'> & CommonsProps;
|
|
28
|
-
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color'> & CommonsProps;
|
|
28
|
+
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size'> & CommonsProps;
|
|
29
29
|
/**
|
|
30
30
|
* ***********************************
|
|
31
31
|
* Slots para los estilos utilizados
|
|
@@ -7,5 +7,5 @@ export declare const areasAdminClasses: AreasAdmninClasses;
|
|
|
7
7
|
/**
|
|
8
8
|
* Hook personalizado que devuelve las clases de utilidad para el componente AreasAdmin.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useAreasAdminUtilityClasses: (ownerState: OwnerState) => Record<"root" | "
|
|
10
|
+
export declare const useAreasAdminUtilityClasses: (ownerState: OwnerState) => Record<"root" | "areaContainerContentChips" | "areaChipRoot" | "areaContainerChipEditButton" | "areaChipMobileRoot" | "rootContent" | "areaChipTitle" | "areaContainerChips" | "areaContainerChipsIcon" | "areaEditPopover" | "areaChipMobileIconContainer" | "areaIconLayer" | "areaChipDeleteButton" | "areaChipEditButton" | "areasAddButton" | "areasPopoverMobileOptions" | "areasPopoverListWindows" | "areasPopoverListWindowsIcon" | "areaContentChips", string>;
|
|
11
11
|
export type AdminClasses = ReturnType<typeof useAreasAdminUtilityClasses>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AreasViewerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Muestra las áreas cargadas en el store, si no se han cargado muestra un componente indicando la carga.
|
|
4
|
+
* 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
|
|
5
|
+
* las ventanas que al cambiar entre áreas
|
|
6
|
+
* @returns JSX Areas
|
|
7
|
+
*/
|
|
8
|
+
export declare const AreasViewer: (props: AreasViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as Area } from "./subcomponents/Area/index.js";
|
|
2
|
+
import { A as Area } from "./subcomponents/Area/Area.js";
|
|
4
3
|
import { u as useAreasStore } from "../../hooks/useAreas/index.js";
|
|
5
|
-
import { M as MemonizedWindowModal } from "./subcomponents/Area/subcomponents/WindowModal/
|
|
4
|
+
import { M as MemonizedWindowModal } from "./subcomponents/Area/subcomponents/WindowModal/WindowModal.js";
|
|
6
5
|
import { shallow } from "zustand/shallow";
|
|
7
6
|
import { L as LoadingError } from "../../../LoadingError/LoadingError.js";
|
|
8
|
-
import { a as getNameDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
9
|
-
import {
|
|
7
|
+
import { g as getPropDataTestId, a as getNameDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
8
|
+
import { A as AREAS_VIEWER_CLASS_NAME } from "../../constants.js";
|
|
10
9
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
11
|
-
|
|
10
|
+
import { A as AreasViewerRootStyled } from "./slots/AreasViewerSlots.js";
|
|
11
|
+
import { A as AREAS_VIEWER_KEY_COMPONENT } from "./constants.js";
|
|
12
|
+
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
13
|
+
import { A as AreasViewerSlots } from "./slots/AreasViewerEnum.js";
|
|
14
|
+
import clsx from "clsx";
|
|
15
|
+
const AreasViewer = (props) => {
|
|
16
|
+
const {
|
|
17
|
+
dataTestId,
|
|
18
|
+
className
|
|
19
|
+
} = props;
|
|
12
20
|
const areas = useAreasStore((state) => state.areasIds, shallow);
|
|
13
21
|
const windowsModals = useAreasStore((state) => state.windowsModals);
|
|
14
22
|
const hashWindowsModals = useAreasStore((state) => state.hashWindowsModals);
|
|
15
23
|
const currentArea = useAreasStore((state) => state.currentAreaId);
|
|
16
24
|
const status = useAreasStore((state) => state.ownerState.status);
|
|
17
|
-
const classesRoot = useAreasStore((state) => state.viwerClasses.root);
|
|
18
25
|
const { init } = useAreasStore((state) => state.areasActions);
|
|
26
|
+
const ownerState = {
|
|
27
|
+
selected: !!currentArea
|
|
28
|
+
};
|
|
19
29
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
30
|
/* @__PURE__ */ jsx(
|
|
21
|
-
|
|
31
|
+
AreasViewerRootStyled,
|
|
22
32
|
{
|
|
23
|
-
className:
|
|
33
|
+
className: clsx(getComponentSlotRoot(AREAS_VIEWER_KEY_COMPONENT), className),
|
|
34
|
+
...getPropDataTestId(AREAS_VIEWER_KEY_COMPONENT, AreasViewerSlots.root, dataTestId),
|
|
35
|
+
ownerState,
|
|
24
36
|
...process.env.NODE_ENV !== "production" ? {
|
|
25
37
|
[TEST_PROP_ID]: getNameDataTestId(
|
|
26
38
|
AREAS_VIEWER_CLASS_NAME,
|
|
@@ -40,7 +52,7 @@ function AreasViewer() {
|
|
|
40
52
|
return null;
|
|
41
53
|
})
|
|
42
54
|
] });
|
|
43
|
-
}
|
|
55
|
+
};
|
|
44
56
|
export {
|
|
45
57
|
AreasViewer as A
|
|
46
58
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const areasViewerStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Root areas viewer Styles
|
|
4
|
+
*/
|
|
5
|
+
root: ({ theme }) => ({
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%",
|
|
8
|
+
overflow: "hidden",
|
|
9
|
+
position: "relative",
|
|
10
|
+
background: theme.vars.palette.background.neutral,
|
|
11
|
+
// areaGridLayout
|
|
12
|
+
"& .M4LAreasViewer-areaGridLayout": {
|
|
13
|
+
height: "100% !important",
|
|
14
|
+
overflow: "auto",
|
|
15
|
+
flexGrow: 1
|
|
16
|
+
}
|
|
17
|
+
}),
|
|
18
|
+
/**
|
|
19
|
+
* Areas root Styles
|
|
20
|
+
*/
|
|
21
|
+
areaRoot: ({ ownerState }) => ({
|
|
22
|
+
display: "none",
|
|
23
|
+
position: "absolute",
|
|
24
|
+
flexDirection: "row",
|
|
25
|
+
inset: 0,
|
|
26
|
+
overflow: "hidden",
|
|
27
|
+
justifyContent: "top",
|
|
28
|
+
alignItems: "flex-start",
|
|
29
|
+
visibility: "hidden",
|
|
30
|
+
...ownerState.selected && {
|
|
31
|
+
display: "block",
|
|
32
|
+
visibility: "visible"
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
/**
|
|
36
|
+
* Inner for hooks Styles
|
|
37
|
+
*/
|
|
38
|
+
baseArea: () => ({
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexDirection: "row",
|
|
41
|
+
height: "100%",
|
|
42
|
+
width: "100%",
|
|
43
|
+
overflow: "hidden"
|
|
44
|
+
}),
|
|
45
|
+
/**
|
|
46
|
+
* Window component content Styles
|
|
47
|
+
*/
|
|
48
|
+
windowContainerComponent: () => ({
|
|
49
|
+
display: "flex",
|
|
50
|
+
width: "100%",
|
|
51
|
+
height: "100%",
|
|
52
|
+
overflow: "auto"
|
|
53
|
+
}),
|
|
54
|
+
/**
|
|
55
|
+
* Wrapper window modal Styles
|
|
56
|
+
*/
|
|
57
|
+
wrapperWindowModal: ({ theme }) => ({
|
|
58
|
+
backgroundColor: theme.vars.palette.background.paper
|
|
59
|
+
})
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
areasViewerStyles as a
|
|
63
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AreasViewerClasses } from './types';
|
|
2
|
-
import { OwnerState } from '../../../contexts/AreasContext/types';
|
|
3
2
|
export declare const areasViewerClasses: AreasViewerClasses;
|
|
4
3
|
/**
|
|
5
4
|
* TODO: Documentar
|
|
6
5
|
*/
|
|
7
|
-
export declare const useAreasViewerUtilityClasses: (
|
|
6
|
+
export declare const useAreasViewerUtilityClasses: () => Record<"areaGridLayout", string>;
|
|
8
7
|
export type ViwerClasses = ReturnType<typeof useAreasViewerUtilityClasses>;
|
|
@@ -1,91 +1,13 @@
|
|
|
1
1
|
import { generateUtilityClasses } from "@mui/material";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { a as AREAS_VIEWER_CLASS_NAME } from "../../../constants.js";
|
|
2
|
+
import "@mui/base";
|
|
3
|
+
import { A as AREAS_VIEWER_CLASS_NAME } from "../../../constants.js";
|
|
5
4
|
const areasViewerClasses = generateUtilityClasses(
|
|
6
5
|
AREAS_VIEWER_CLASS_NAME,
|
|
7
6
|
[
|
|
8
|
-
|
|
9
|
-
"root",
|
|
10
|
-
"areaRoot",
|
|
11
|
-
"areaGridLayoutPanelContainer",
|
|
12
|
-
"areaGridLayout",
|
|
13
|
-
"areaGridLayoutPopupsContainer",
|
|
14
|
-
"areasWindowPopUpList",
|
|
15
|
-
"windowRoot",
|
|
16
|
-
"windowHeader",
|
|
17
|
-
"windowHeaderContent",
|
|
18
|
-
"windowHeaderTitle",
|
|
19
|
-
"windowHeaderMainActions",
|
|
20
|
-
"windowHeaderCancelHandle",
|
|
21
|
-
"windowContent",
|
|
22
|
-
"windowPopupRoot",
|
|
23
|
-
"windowModalRoot",
|
|
24
|
-
"windowLinearProgressRoot",
|
|
25
|
-
"windowLinearProgressBar",
|
|
26
|
-
"windowRootContainer",
|
|
27
|
-
"panelWindowsRoot",
|
|
28
|
-
"panelWindowsButtonContainer",
|
|
29
|
-
"panelWindowsSeparator",
|
|
30
|
-
"containerLinearProgress",
|
|
31
|
-
"loaderContainer",
|
|
32
|
-
"containerComponent",
|
|
33
|
-
/* states or variants of elements */
|
|
34
|
-
// 'active',
|
|
35
|
-
"selected",
|
|
36
|
-
"colapsed",
|
|
37
|
-
"selectedWindow",
|
|
38
|
-
"isMobile",
|
|
39
|
-
"loading",
|
|
40
|
-
"pinIn",
|
|
41
|
-
"success",
|
|
42
|
-
"info",
|
|
43
|
-
"warning",
|
|
44
|
-
"error"
|
|
7
|
+
"areaGridLayout"
|
|
45
8
|
],
|
|
46
9
|
AREAS_VIEWER_CLASS_NAME
|
|
47
10
|
);
|
|
48
|
-
const useAreasViewerUtilityClasses = (ownerState) => {
|
|
49
|
-
const slots = {
|
|
50
|
-
root: [
|
|
51
|
-
"root",
|
|
52
|
-
ownerState.status,
|
|
53
|
-
ownerState.isMobile && "isMobile",
|
|
54
|
-
ownerState.isSkeleton && "isSkeleton"
|
|
55
|
-
],
|
|
56
|
-
areaRoot: ["areaRoot"],
|
|
57
|
-
areasLoadingErrorRoot: ["areasLoadingErrorRoot"],
|
|
58
|
-
areasLoadingErrorLoading: ["areasLoadingErrorLoading"],
|
|
59
|
-
areasLoadingError: ["areasLoadingError"],
|
|
60
|
-
areasLoadingErrorIcon: ["areasLoadingErrorIcon"],
|
|
61
|
-
areasLoadingErrorTitle: ["areasLoadingErrorTitle"],
|
|
62
|
-
areasLoadingErrorDescription: ["areasLoadingErrorDescription"],
|
|
63
|
-
areasLoadingErrorDivider: ["areasLoadingErrorDivider"],
|
|
64
|
-
areaGridLayoutPanelContainer: ["areaGridLayoutPanelContainer"],
|
|
65
|
-
areaGridLayout: ["areaGridLayout"],
|
|
66
|
-
areaGridLayoutPopupsContainer: ["areaGridLayoutPopupsContainer"],
|
|
67
|
-
areasWindowPopUpList: ["areasWindowPopUpList"],
|
|
68
|
-
windowRoot: ["windowRoot"],
|
|
69
|
-
windowRootContainer: ["windowRootContainer"],
|
|
70
|
-
windowHeader: ["windowHeader"],
|
|
71
|
-
windowHeaderTitle: ["windowHeaderTitle"],
|
|
72
|
-
windowHeaderMainActions: ["windowHeaderMainActions"],
|
|
73
|
-
windowHeaderCancelHandle: ["windowHeaderCancelHandle"],
|
|
74
|
-
windowContent: ["windowContent"],
|
|
75
|
-
windowLinearProgressRoot: ["windowLinearProgressRoot"],
|
|
76
|
-
windowLinearProgressBar: ["windowLinearProgressBar"],
|
|
77
|
-
windowPopupRoot: ["windowPopupRoot"],
|
|
78
|
-
windowModalRoot: ["windowModalRoot"],
|
|
79
|
-
selectedWindow: ["selectedWindow"],
|
|
80
|
-
panelWindowsRoot: ["panelWindowsRoot"],
|
|
81
|
-
panelWindowsButtonContainer: ["panelWindowsButtonContainer"],
|
|
82
|
-
panelWindowsSeparator: ["panelWindowsSeparator"],
|
|
83
|
-
loaderContainer: ["loaderContainer"],
|
|
84
|
-
containerComponent: ["containerComponent"]
|
|
85
|
-
};
|
|
86
|
-
return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_VIEWER_CLASS_NAME), {});
|
|
87
|
-
};
|
|
88
11
|
export {
|
|
89
|
-
areasViewerClasses as a
|
|
90
|
-
useAreasViewerUtilityClasses as u
|
|
12
|
+
areasViewerClasses as a
|
|
91
13
|
};
|
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
export interface AreasViewerClasses {
|
|
2
|
-
root: string;
|
|
3
|
-
areaRoot: string;
|
|
4
|
-
areaGridLayoutPanelContainer: string;
|
|
5
2
|
areaGridLayout: string;
|
|
6
|
-
areaGridLayoutPopupsContainer: string;
|
|
7
|
-
areasWindowPopUpList: string;
|
|
8
|
-
windowRoot: string;
|
|
9
|
-
windowHeader: string;
|
|
10
|
-
windowHeaderContent: string;
|
|
11
|
-
windowHeaderTitle: string;
|
|
12
|
-
windowHeaderMainActions: string;
|
|
13
|
-
windowHeaderCancelHandle: string;
|
|
14
|
-
windowContent: string;
|
|
15
|
-
windowRootContainer: string;
|
|
16
|
-
windowLinearProgressRoot: string;
|
|
17
|
-
windowLinearProgressBar: string;
|
|
18
|
-
windowPopupRoot: string;
|
|
19
|
-
windowModalRoot: string;
|
|
20
|
-
panelWindowsRoot: string;
|
|
21
|
-
panelWindowsButtonContainer: string;
|
|
22
|
-
panelWindowsSeparator: string;
|
|
23
|
-
loaderContainer: string;
|
|
24
|
-
containerComponent: string;
|
|
25
|
-
selected: string;
|
|
26
|
-
selectedWindow: string;
|
|
27
|
-
colapsed: string;
|
|
28
|
-
isMobile: string;
|
|
29
|
-
loading: string;
|
|
30
|
-
pinIn: string;
|
|
31
|
-
success: string;
|
|
32
|
-
info: string;
|
|
33
|
-
warning: string;
|
|
34
|
-
error: string;
|
|
35
|
-
containerLinearProgress: string;
|
|
36
3
|
}
|
|
37
4
|
export type AreasViewerClassesKey = keyof AreasViewerClasses;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AREAS_VIEWER_KEY_COMPONENT = "M4LAreasViewer";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var AreasViewerSlots = /* @__PURE__ */ ((AreasViewerSlots2) => {
|
|
2
|
+
AreasViewerSlots2["root"] = "root";
|
|
3
|
+
AreasViewerSlots2["areaRoot"] = "areaRoot";
|
|
4
|
+
AreasViewerSlots2["baseArea"] = "baseArea";
|
|
5
|
+
AreasViewerSlots2["windowContainerComponent"] = "windowContainerComponent";
|
|
6
|
+
AreasViewerSlots2["wrapperWindowModal"] = "wrapperWindowModal";
|
|
7
|
+
return AreasViewerSlots2;
|
|
8
|
+
})(AreasViewerSlots || {});
|
|
9
|
+
export {
|
|
10
|
+
AreasViewerSlots as A
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const AreasViewerRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').AreasViewerOwnerState> & Record<string, unknown>;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const AreaRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState: Partial<import('../types').AreasViewerOwnerState> & Record<string, unknown>;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
7
|
+
export declare const BaseAreaStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState: Partial<import('../types').AreasViewerOwnerState> & Record<string, unknown>;
|
|
9
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
10
|
+
export declare const WindowContainerComponentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
11
|
+
ownerState: Partial<import('../types').AreasViewerOwnerState> & Record<string, unknown>;
|
|
12
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
13
|
+
export declare const WrapperWindowModalStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
14
|
+
ownerState: Partial<import('../types').AreasViewerOwnerState> & Record<string, unknown>;
|
|
15
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { A as AREAS_VIEWER_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { A as AreasViewerSlots } from "./AreasViewerEnum.js";
|
|
4
|
+
import { a as areasViewerStyles } from "../AreasViewer.styles.js";
|
|
5
|
+
const AreasViewerRootStyled = styled("div", {
|
|
6
|
+
name: AREAS_VIEWER_KEY_COMPONENT,
|
|
7
|
+
slot: AreasViewerSlots.root
|
|
8
|
+
})(areasViewerStyles?.root);
|
|
9
|
+
const AreaRootStyled = styled("div", {
|
|
10
|
+
name: AREAS_VIEWER_KEY_COMPONENT,
|
|
11
|
+
slot: AreasViewerSlots.areaRoot
|
|
12
|
+
})(areasViewerStyles?.areaRoot);
|
|
13
|
+
const BaseAreaStyled = styled("div", {
|
|
14
|
+
name: AREAS_VIEWER_KEY_COMPONENT,
|
|
15
|
+
slot: AreasViewerSlots.baseArea
|
|
16
|
+
})(areasViewerStyles?.baseArea);
|
|
17
|
+
const WindowContainerComponentStyled = styled("div", {
|
|
18
|
+
name: AREAS_VIEWER_KEY_COMPONENT,
|
|
19
|
+
slot: AreasViewerSlots.windowContainerComponent
|
|
20
|
+
})(areasViewerStyles?.windowContainerComponent);
|
|
21
|
+
const WrapperWindowModalStyled = styled("div", {
|
|
22
|
+
name: AREAS_VIEWER_KEY_COMPONENT,
|
|
23
|
+
slot: AreasViewerSlots.wrapperWindowModal
|
|
24
|
+
})(areasViewerStyles?.wrapperWindowModal);
|
|
25
|
+
export {
|
|
26
|
+
AreasViewerRootStyled as A,
|
|
27
|
+
BaseAreaStyled as B,
|
|
28
|
+
WindowContainerComponentStyled as W,
|
|
29
|
+
AreaRootStyled as a,
|
|
30
|
+
WrapperWindowModalStyled as b
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { B as BaseArea } from "./subcomponents/BaseArea/BaseArea.js";
|
|
3
|
+
import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
|
|
4
|
+
import { a as AreaRootStyled } from "../../slots/AreasViewerSlots.js";
|
|
5
|
+
const Area = (props) => {
|
|
6
|
+
const { selected, areaId } = props;
|
|
7
|
+
const status = useAreasStore((state) => state.hashAreas[areaId].status);
|
|
8
|
+
if (status === "init") {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ jsx(AreaRootStyled, { ownerState: { selected }, children: /* @__PURE__ */ jsx(BaseArea, { areaId }) });
|
|
12
|
+
};
|
|
13
|
+
Area.displayName = "Area";
|
|
14
|
+
export {
|
|
15
|
+
Area as A
|
|
16
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { shallow } from "zustand/shallow";
|
|
3
|
-
import { W as Window } from "../Window/
|
|
3
|
+
import { W as Window } from "../Window/Window.js";
|
|
4
4
|
import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
|
|
5
5
|
import { a as areasViewerClasses } from "../../../../classes/index.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { R as RESPONSIVE_COLAPSED_HEIGHTS, a as RESPONSIVE_ROW_HEIGHTS, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../../../../../contexts/AreasContext/helpers/helper.js";
|
|
8
|
+
import { d as dragResizeWindowClasses } from "../../../../../../../DragResizeWindow/classes/index.js";
|
|
8
9
|
import { w as withSizeProvider } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
|
|
9
10
|
import { R as Responsive } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
|
|
10
11
|
const ResponsiveGridLayout = withSizeProvider(Responsive);
|
|
@@ -32,8 +33,8 @@ const AreaGridLayout = (props) => {
|
|
|
32
33
|
),
|
|
33
34
|
layouts,
|
|
34
35
|
onLayoutChange: (layout, newLayouts) => onBreakpointsLayoutsChange(areaId, layout, newLayouts),
|
|
35
|
-
draggableHandle:
|
|
36
|
-
draggableCancel: `.${
|
|
36
|
+
draggableHandle: `.${dragResizeWindowClasses.draggableHandle}`,
|
|
37
|
+
draggableCancel: `.${dragResizeWindowClasses.draggableCancel}`,
|
|
37
38
|
layoutItemRender: (p) => {
|
|
38
39
|
if (hashLayoutItems.indexOf(p.i) === -1) {
|
|
39
40
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { A as AreaGridLayout } from "../AreaGridLayout/AreaGridLayout.js";
|
|
3
|
+
import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
|
|
4
|
+
import { L as LoadingError } from "../../../../../../../LoadingError/LoadingError.js";
|
|
5
|
+
import { B as BaseAreaStyled } from "../../../../slots/AreasViewerSlots.js";
|
|
6
|
+
const BaseArea = (props) => {
|
|
7
|
+
const { areaId } = props;
|
|
8
|
+
const status = useAreasStore((state) => state.hashAreas[areaId].status);
|
|
9
|
+
return /* @__PURE__ */ jsx(BaseAreaStyled, { ownerState: {}, children: status === "loaded" ? /* @__PURE__ */ jsx(AreaGridLayout, { areaId }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => {
|
|
10
|
+
} }) });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
BaseArea as B
|
|
14
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { M as MemonizedMicroFrontend } from "./subcomponents/MicroFrontend/
|
|
3
|
+
import { M as MemonizedMicroFrontend } from "./subcomponents/MicroFrontend/MicroFrontend.js";
|
|
4
4
|
import { C as Component } from "./subcomponents/Component/index.js";
|
|
5
5
|
import { T as TEST_PROP_ID } from "../../../../../../../../test/constants_no_mock.js";
|
|
6
6
|
import { a as getNameDataTestId } from "../../../../../../../../test/getNameDataTestId.js";
|
|
7
|
-
import {
|
|
7
|
+
import { A as AREAS_VIEWER_CLASS_NAME } from "../../../../../../constants.js";
|
|
8
8
|
import { u as useWindow } from "./hooks/useWindow/useWindow.js";
|
|
9
9
|
import { W as WindowBase } from "../../../../../../../WindowBase/WindowBase.js";
|
|
10
10
|
const Window = (props) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GetLabelType } from '@m4l/core';
|
|
2
2
|
import { AreaWindowAction, WindowOptions } from '../../../../../../../../types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Get the main actions for the window
|
|
5
5
|
*/
|
|
6
6
|
export declare function getMainActions(isDesktop: boolean | undefined, moduleActions: AreaWindowAction[]): AreaWindowAction[];
|
|
7
7
|
type GetMenuActionsType = {
|
|
@@ -16,7 +16,7 @@ type GetMenuActionsType = {
|
|
|
16
16
|
getLabel: GetLabelType;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Get the menu actions for the window
|
|
20
20
|
*/
|
|
21
21
|
export declare function getMenuActions(options: GetMenuActionsType): AreaWindowAction[];
|
|
22
22
|
export {};
|
|
@@ -16,7 +16,6 @@ function getMenuActions(options) {
|
|
|
16
16
|
urlPrefix,
|
|
17
17
|
saveModuleCookies,
|
|
18
18
|
resetModuleCookies,
|
|
19
|
-
//version,
|
|
20
19
|
windowOptions = { allowPersistCookies: false },
|
|
21
20
|
getLabel
|
|
22
21
|
} = options;
|
|
@@ -31,7 +30,6 @@ function getMenuActions(options) {
|
|
|
31
30
|
onClick: () => saveModuleCookies(windowId),
|
|
32
31
|
disabled: false,
|
|
33
32
|
visibility: "normal",
|
|
34
|
-
/* dictionaryId: getAreasDictionary(DICCTIONARY.label_persist_module_cookies), */
|
|
35
33
|
label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_persist_module_cookies)),
|
|
36
34
|
key: "save_cookies"
|
|
37
35
|
};
|
|
@@ -43,7 +41,6 @@ function getMenuActions(options) {
|
|
|
43
41
|
disabled: false,
|
|
44
42
|
visibility: "normal",
|
|
45
43
|
label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_reset_module_cookies)),
|
|
46
|
-
/* dictionaryId: getAreasDictionary(DICCTIONARY.label_reset_module_cookies), */
|
|
47
44
|
key: "reset_cookes"
|
|
48
45
|
};
|
|
49
46
|
menuActions.push(resetCookiesAction);
|
|
@@ -3,7 +3,7 @@ import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
|
3
3
|
import { u as useAreasStore } from "../../../../../../../../hooks/useAreas/index.js";
|
|
4
4
|
import { I as ICONS } from "../../../../../../../../icons.js";
|
|
5
5
|
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../../../../../dictionary.js";
|
|
6
|
-
import { g as getMainActions, a as getMenuActions } from "
|
|
6
|
+
import { g as getMainActions, a as getMenuActions } from "./helper.js";
|
|
7
7
|
import { shallow } from "zustand/shallow";
|
|
8
8
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
9
9
|
const useHeaderActions = ({
|