@m4l/layouts 9.1.9 → 9.1.10-beta.1
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/.storybook/constants.d.ts +21 -0
- package/.storybook/decorators/WithContexts/WithContexts.d.ts +5 -0
- package/.storybook/decorators/WithContexts/constants.d.ts +10 -0
- package/.storybook/decorators/WithContexts/index.d.ts +1 -0
- package/.storybook/decorators/WithContexts/styles.d.ts +1 -0
- package/.storybook/decorators/WithContexts/subcomponents/AppWithTheme.d.ts +6 -0
- package/.storybook/decorators/WithContexts/types.d.ts +7 -0
- package/.storybook/decorators/index.d.ts +1 -0
- package/.storybook/main.d.ts +3 -0
- package/.storybook/storybook.vite.d.ts +2 -0
- package/.storybook/utils/getGlobalsFromSearchParams.d.ts +7 -0
- package/.storybook/utils/getStylesColorsByMode.d.ts +744 -0
- package/components/MFHostApp/MFHostApp.d.ts +6 -0
- package/components/MFHostApp/MFHostApp.js +59 -0
- package/components/MFHostApp/index.d.ts +2 -6
- package/components/MFHostApp/index.js +1 -60
- package/components/MFHostApp/types.d.ts +4 -1
- package/components/MFNoAuthApp/index.js +3 -4
- package/components/MFNoAuthApp/types.d.ts +4 -1
- package/components/ModuleDetailTabs/ModuleDetailTabs.d.ts +5 -0
- package/components/ModuleDetailTabs/ModuleDetailTabs.js +42 -0
- package/components/ModuleDetailTabs/index.d.ts +2 -0
- package/components/ModuleDetailTabs/index.js +1 -0
- package/components/ModuleDetailTabs/types.d.ts +88 -0
- package/components/ModuleDetailTabs/useModuleDatailTabs.d.ts +308 -0
- package/components/ModuleDetailTabs/useModuleDatailTabs.js +86 -0
- package/components/index.d.ts +3 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/useDynamicAccordions/index.d.ts +2 -0
- package/hooks/useDynamicAccordions/index.js +1 -0
- package/hooks/useDynamicAccordions/types.d.ts +42 -0
- package/hooks/useDynamicAccordions/useBaseAccordions.d.ts +5 -0
- package/hooks/useDynamicAccordions/useBaseAccordions.js +38 -0
- package/hooks/useDynamicAccordions/useDynamicAccordions.d.ts +6 -0
- package/hooks/useDynamicAccordions/useDynamicAccordions.js +18 -0
- package/hooks/useMasterDetail/index.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +14 -9
- package/layouts/MasterDetailLayout/MasterDetailLayout.js +6 -6
- package/layouts/MasterDetailLayout/dicctionary.js +2 -11
- package/layouts/MasterDetailLayout/index.d.ts +2 -0
- package/layouts/MasterDetailLayout/index.js +1 -0
- package/layouts/ModuleLayout/ModuleLayout.js +4 -0
- package/layouts/ModuleLayout/slots/ModuleLayoutSlots.d.ts +1 -1
- package/layouts/ModuleLayout/subcomponents/BaseModuleLayout/index.js +2 -1
- package/layouts/ModuleLayout/subcomponents/BaseModuleLayout/types.d.ts +1 -0
- package/layouts/ModuleLayout/types.d.ts +1 -0
- package/layouts/NoAuthModuleLayout/slots/NoAuthModuleLayoutSlots.d.ts +18 -18
- package/layouts/index.d.ts +1 -2
- package/package.json +2 -6
- package/storybook/layouts/ModuleLayout/ModuleLayout.stories.d.ts +6 -0
- package/storybook/layouts/ModuleLayout/moks/mokData.d.ts +14 -0
- package/storybook/layouts/ModuleLayout/subcomponents/ClientsHeaderActions.d.ts +4 -0
- package/storybook/layouts/ModuleLayout/subcomponents/RenderModuleLayout.d.ts +6 -0
- package/storybook/layouts/ModuleLayout/subcomponents/UsersHeaderActions.d.ts +4 -0
- package/storybook/layouts/ModuleLayout/subcomponents/WithExtendedContainer.d.ts +5 -0
- package/storybook/layouts/NoAuthModuleLayout/NoAuthModuleLayout.stories.d.ts +9 -0
- package/utils/createAppMF.d.ts +13 -0
- package/utils/createAppMF.js +58 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/vite-env.d.ts +19 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useEffect } from "react";
|
|
3
|
+
import { u as useMasterDetail } from "../../hooks/useMasterDetail/index.js";
|
|
4
|
+
import { useModuleDictionary, useNetwork } from "@m4l/core";
|
|
5
|
+
import { useWindowToolsMF, ObjectLogs, Icon } from "@m4l/components";
|
|
6
|
+
function useModuleDetailTabs(props) {
|
|
7
|
+
const { tabs, defaultTab, urlAssetsPrefix, objectLogsProps, getEndPoint } = props;
|
|
8
|
+
const [currentTab, setCurrentTab] = useState(defaultTab);
|
|
9
|
+
const [detailData, setDetailData] = useState(void 0);
|
|
10
|
+
const [endPointData, setEndPointData] = useState(void 0);
|
|
11
|
+
const [hasPrivilegeDetail, setHasPrivilegeDetail] = useState(true);
|
|
12
|
+
const { masterSelection } = useMasterDetail();
|
|
13
|
+
const { getLabel } = useModuleDictionary();
|
|
14
|
+
const { startProgress, stopProgress } = useWindowToolsMF();
|
|
15
|
+
const { networkOperation } = useNetwork();
|
|
16
|
+
const handleChangeTab = (newValue) => {
|
|
17
|
+
setCurrentTab(newValue);
|
|
18
|
+
};
|
|
19
|
+
const finalTabs = useMemo(() => {
|
|
20
|
+
if (masterSelection === void 0 || masterSelection.length === 0) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const arrTabs = [...tabs];
|
|
24
|
+
if (objectLogsProps) {
|
|
25
|
+
arrTabs.push({
|
|
26
|
+
...objectLogsProps,
|
|
27
|
+
value: "objectLogs",
|
|
28
|
+
tabContent: ObjectLogs,
|
|
29
|
+
unmountable: false,
|
|
30
|
+
componentProps: {
|
|
31
|
+
resourceId: objectLogsProps.resourceId.toString(),
|
|
32
|
+
objectId: objectLogsProps.getObjectId(masterSelection[0])
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return arrTabs.map((tab) => ({
|
|
37
|
+
...tab,
|
|
38
|
+
unmountable: tab.unmountable === void 0 ? true : tab.unmountable,
|
|
39
|
+
icon: typeof tab.icon === "string" ? /* @__PURE__ */ jsx(Icon, { src: `${urlAssetsPrefix}/${tab.icon}` }) : tab.icon,
|
|
40
|
+
label: tab.dictionaryId ? getLabel(tab.dictionaryId) : void 0
|
|
41
|
+
}));
|
|
42
|
+
}, [masterSelection, tabs, objectLogsProps, urlAssetsPrefix, getLabel]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (masterSelection === void 0 || masterSelection.length === 0) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setDetailData(masterSelection[0]);
|
|
48
|
+
}, [masterSelection]);
|
|
49
|
+
const conditionNoMasterSelection = masterSelection === void 0 || masterSelection.length === 0;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!getEndPoint) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (masterSelection === void 0 || masterSelection.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
networkOperation({
|
|
58
|
+
options: {
|
|
59
|
+
startProgress,
|
|
60
|
+
stopProgress
|
|
61
|
+
},
|
|
62
|
+
...getEndPoint(masterSelection[masterSelection.length - 1])
|
|
63
|
+
}).then((response) => {
|
|
64
|
+
{
|
|
65
|
+
setHasPrivilegeDetail(true);
|
|
66
|
+
setEndPointData(response);
|
|
67
|
+
}
|
|
68
|
+
}).catch((error) => {
|
|
69
|
+
if (error.status === 403) {
|
|
70
|
+
setHasPrivilegeDetail(false);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}, [masterSelection, startProgress, stopProgress, networkOperation, getEndPoint]);
|
|
74
|
+
return {
|
|
75
|
+
conditionNoMasterSelection,
|
|
76
|
+
currentTab,
|
|
77
|
+
detailData,
|
|
78
|
+
endPointData,
|
|
79
|
+
hasPrivilegeDetail,
|
|
80
|
+
finalTabs,
|
|
81
|
+
handleChangeTab
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
useModuleDetailTabs as u
|
|
86
|
+
};
|
package/components/index.d.ts
CHANGED
package/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AccordionProps } from '@m4l/components';
|
|
2
|
+
import { ModuleDetailTabContent } from '../../components/ModuleDetailTabs';
|
|
3
|
+
export type DynamicAccordionValue<T extends any = any, K extends any = any> = (data: T, endPointData?: K) => string | React.ReactNode;
|
|
4
|
+
export interface ConfigDynamicAccordion<T extends any = any, K extends any = any> {
|
|
5
|
+
/**
|
|
6
|
+
* "icon": Icono de la propiedad
|
|
7
|
+
*/
|
|
8
|
+
icon?: string;
|
|
9
|
+
/**
|
|
10
|
+
* "dictionaryId": Id de la propiedad en el diccionario para mostrar en el label
|
|
11
|
+
*/
|
|
12
|
+
dictionaryId: string;
|
|
13
|
+
/**
|
|
14
|
+
* "accordionProps" Propiedades del accordion
|
|
15
|
+
*/
|
|
16
|
+
accordionProps?: AccordionProps['accordionProps'];
|
|
17
|
+
/**
|
|
18
|
+
* "properties": Propiedades que se ven en el accordion
|
|
19
|
+
*/
|
|
20
|
+
properties: {
|
|
21
|
+
/**
|
|
22
|
+
* "icon": Icono de la propiedad
|
|
23
|
+
*/
|
|
24
|
+
icon?: string | React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* "dictionaryId": Id de la propiedad en el diccionario para mostrar en el label
|
|
27
|
+
*/
|
|
28
|
+
dictionaryId: string;
|
|
29
|
+
/**
|
|
30
|
+
* "getValue": Función que se encarga de obtener el valor de la propiedad
|
|
31
|
+
*/
|
|
32
|
+
getValue: DynamicAccordionValue<T, K>;
|
|
33
|
+
/**
|
|
34
|
+
* "privilegeToView": Si se requiere un privilegio para ver el valor
|
|
35
|
+
*/
|
|
36
|
+
privilegeToView?: string;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
export interface useDynamicAccordionsProps<T extends any = any, K extends any = any> {
|
|
40
|
+
configDynamicAccordions: ConfigDynamicAccordion<T, K>[];
|
|
41
|
+
}
|
|
42
|
+
export type useBaseDynamicAccordionsProps<T extends any = any, K extends any = any> = useDynamicAccordionsProps<T, K> & ModuleDetailTabContent;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Accordion, PropertyValue } from "@m4l/components";
|
|
4
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
5
|
+
function useBaseAccordions(props) {
|
|
6
|
+
const { data, endPointData, configDynamicAccordions: accordions } = props;
|
|
7
|
+
const { getLabel } = useModuleDictionary();
|
|
8
|
+
const AccordionsComponents = useMemo(() => {
|
|
9
|
+
return accordions.map((accordion) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Accordion,
|
|
12
|
+
{
|
|
13
|
+
icon: accordion.icon,
|
|
14
|
+
label: getLabel(accordion.dictionaryId),
|
|
15
|
+
accordionProps: {
|
|
16
|
+
...accordion.accordionProps
|
|
17
|
+
},
|
|
18
|
+
children: accordion.properties.map((property) => {
|
|
19
|
+
const value = property.getValue(data, endPointData);
|
|
20
|
+
return value ? /* @__PURE__ */ jsx(
|
|
21
|
+
PropertyValue,
|
|
22
|
+
{
|
|
23
|
+
property: getLabel(property.dictionaryId),
|
|
24
|
+
value
|
|
25
|
+
},
|
|
26
|
+
property.dictionaryId
|
|
27
|
+
) : null;
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
accordion.dictionaryId
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
}, [accordions, data, endPointData, getLabel]);
|
|
34
|
+
return AccordionsComponents;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
useBaseAccordions as u
|
|
38
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModuleDetailTabContent } from '../../components/ModuleDetailTabs';
|
|
2
|
+
import { useDynamicAccordionsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Componente que muestra los datos generales de un inventario
|
|
5
|
+
*/
|
|
6
|
+
export declare function useDynamicAccordions(props: useDynamicAccordionsProps): (propsGeneral: ModuleDetailTabContent) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollBar, Stack } from "@m4l/components";
|
|
3
|
+
import { u as useBaseAccordions } from "./useBaseAccordions.js";
|
|
4
|
+
function useDynamicAccordions(props) {
|
|
5
|
+
const { configDynamicAccordions } = props;
|
|
6
|
+
return function General(propsGeneral) {
|
|
7
|
+
const { data, endPointData } = propsGeneral;
|
|
8
|
+
const accordionsComponents = useBaseAccordions({
|
|
9
|
+
data,
|
|
10
|
+
endPointData,
|
|
11
|
+
configDynamicAccordions
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx(Stack, { direction: "column", gap: "4px", style: { height: "auto" }, children: accordionsComponents }) });
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
useDynamicAccordions as u
|
|
18
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useMasterDetail: () => import('
|
|
1
|
+
export declare const useMasterDetail: () => import('../..').MasterDetailContextProps;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { M } from "./components/MFNoAuthApp/index.js";
|
|
2
|
-
import { M as M2 } from "./components/MFHostApp/
|
|
2
|
+
import { M as M2 } from "./components/MFHostApp/MFHostApp.js";
|
|
3
|
+
import { M as M3 } from "./components/ModuleDetailTabs/ModuleDetailTabs.js";
|
|
3
4
|
import { A, a } from "./contexts/AuthContext/index.js";
|
|
4
|
-
import { M as
|
|
5
|
-
import { M as M4 } from "./layouts/MasterDetailLayout/MasterDetailLayout.js";
|
|
5
|
+
import { M as M4 } from "./layouts/ModuleLayout/ModuleLayout.js";
|
|
6
6
|
import { N } from "./layouts/NoAuthModuleLayout/index.js";
|
|
7
7
|
import { d, g } from "./layouts/ModuleLayout/dicctionary.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { M as M5 } from "./layouts/MasterDetailLayout/MasterDetailLayout.js";
|
|
9
|
+
import { g as g2 } from "./layouts/MasterDetailLayout/dicctionary.js";
|
|
10
|
+
import { d as d2, g as g3 } from "./layouts/NoAuthModuleLayout/dicctionary.js";
|
|
10
11
|
import { u } from "./hooks/useMasterDetail/index.js";
|
|
11
12
|
import { u as u2 } from "./hooks/useAuth/index.js";
|
|
12
13
|
import { u as u3 } from "./hooks/useModule/index.js";
|
|
14
|
+
import { u as u4 } from "./hooks/useDynamicAccordions/useDynamicAccordions.js";
|
|
15
|
+
import { c } from "./utils/createAppMF.js";
|
|
13
16
|
export {
|
|
14
17
|
A as AuthContext,
|
|
15
18
|
a as AuthProvider,
|
|
16
19
|
M2 as MFHostApp,
|
|
17
20
|
M as MFNoAuthApp,
|
|
18
|
-
|
|
19
|
-
M3 as
|
|
21
|
+
M5 as MasterDetailLayout,
|
|
22
|
+
M3 as ModuleDetailTabs,
|
|
23
|
+
M4 as ModuleLayout,
|
|
20
24
|
N as NoAuthModuleLayout,
|
|
21
|
-
|
|
25
|
+
c as createAppMF,
|
|
22
26
|
d as defaultModuleLayoutDictionary,
|
|
23
|
-
|
|
27
|
+
d2 as defaultNoAuthModuleLayoutDictionary,
|
|
24
28
|
g2 as getMasterDetailLayoutComponentsDictionary,
|
|
25
29
|
g as getModuleLayoutComponentsDictionary,
|
|
26
30
|
g3 as getNoAuthModuleLayoutComponentsDictionary,
|
|
27
31
|
u2 as useAuth,
|
|
32
|
+
u4 as useDynamicAccordions,
|
|
28
33
|
u as useMasterDetail,
|
|
29
34
|
u3 as useModule
|
|
30
35
|
};
|
|
@@ -4,7 +4,7 @@ import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
|
4
4
|
import { WindowBase, SplitLayout } from "@m4l/components";
|
|
5
5
|
import { M as ModuleLayout } from "../ModuleLayout/ModuleLayout.js";
|
|
6
6
|
import { a as MasterDetailProvider } from "./contexts/MasterDetailContext/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useIsMobile } from "@m4l/graphics";
|
|
8
8
|
import { g as getMasterDetailLayoutUtilityClasses } from "./classes/index.js";
|
|
9
9
|
import { M as MasterDetailLayoutRoot } from "./styles.js";
|
|
10
10
|
function getTotalModuleActions(splitActions, moduleActions = []) {
|
|
@@ -23,7 +23,7 @@ function MasterDetailLayout(props) {
|
|
|
23
23
|
} = props;
|
|
24
24
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
25
25
|
const [splitPosition, setSplitPosition] = useState("vertical");
|
|
26
|
-
const
|
|
26
|
+
const isMobile = useIsMobile();
|
|
27
27
|
const moduleLayoutRef = useRef(null);
|
|
28
28
|
const { getLabel } = useModuleDictionary();
|
|
29
29
|
const onChangePostionInternal = useCallback((newPostion) => {
|
|
@@ -32,7 +32,6 @@ function MasterDetailLayout(props) {
|
|
|
32
32
|
const splitActions = useMemo(
|
|
33
33
|
() => [
|
|
34
34
|
{
|
|
35
|
-
type: "menuItem",
|
|
36
35
|
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
|
|
37
36
|
onClick: () => onChangePostionInternal("vertical"),
|
|
38
37
|
visibility: "main",
|
|
@@ -43,7 +42,6 @@ function MasterDetailLayout(props) {
|
|
|
43
42
|
key: "vertical"
|
|
44
43
|
},
|
|
45
44
|
{
|
|
46
|
-
type: "menuItem",
|
|
47
45
|
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
|
|
48
46
|
onClick: () => onChangePostionInternal("horizontal"),
|
|
49
47
|
visibility: "main",
|
|
@@ -54,7 +52,6 @@ function MasterDetailLayout(props) {
|
|
|
54
52
|
key: "horizontal"
|
|
55
53
|
},
|
|
56
54
|
{
|
|
57
|
-
type: "menuItem",
|
|
58
55
|
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
|
|
59
56
|
onClick: () => onChangePostionInternal("none"),
|
|
60
57
|
visibility: "main",
|
|
@@ -75,6 +72,9 @@ function MasterDetailLayout(props) {
|
|
|
75
72
|
WindowBase,
|
|
76
73
|
{
|
|
77
74
|
title: getLabel("master_detail_layout.view_detail"),
|
|
75
|
+
onClose: () => {
|
|
76
|
+
moduleLayoutRef.current?.closeModal();
|
|
77
|
+
},
|
|
78
78
|
children: typeof detailComponent === "function" ? detailComponent({}) : detailComponent
|
|
79
79
|
}
|
|
80
80
|
)
|
|
@@ -99,7 +99,7 @@ function MasterDetailLayout(props) {
|
|
|
99
99
|
children: /* @__PURE__ */ jsx(
|
|
100
100
|
SplitLayout,
|
|
101
101
|
{
|
|
102
|
-
splitPosition:
|
|
102
|
+
splitPosition: isMobile ? "none" : splitPosition,
|
|
103
103
|
firstPart: masterComponent,
|
|
104
104
|
secondPart: detailComponent
|
|
105
105
|
}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/dicctionary.js";
|
|
2
|
+
import { getNoItemSelectedComponentsDictionary } from "@m4l/components";
|
|
2
3
|
function getMasterDetailLayoutComponentsDictionary() {
|
|
3
|
-
return ["master_detail_layout"].concat(getModuleLayoutComponentsDictionary());
|
|
4
|
+
return ["master_detail_layout"].concat(getModuleLayoutComponentsDictionary()).concat(getNoItemSelectedComponentsDictionary());
|
|
4
5
|
}
|
|
5
|
-
const defaultMasterDetailDictionary = {
|
|
6
|
-
master_detail_layout: {
|
|
7
|
-
split_vertical: "Split vertically",
|
|
8
|
-
split_horizontal: "Split horizontally",
|
|
9
|
-
no_split: "No split",
|
|
10
|
-
view_detail: "View detail"
|
|
11
|
-
}
|
|
12
|
-
//...defaultModuleLayoutDictionary,
|
|
13
|
-
};
|
|
14
6
|
export {
|
|
15
|
-
defaultMasterDetailDictionary as d,
|
|
16
7
|
getMasterDetailLayoutComponentsDictionary as g
|
|
17
8
|
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { MasterDetailLayout } from './MasterDetailLayout';
|
|
2
2
|
export type { MasterDetailLayoutProps } from './types';
|
|
3
|
+
export type { MasterDetailContextProps } from './contexts/MasterDetailContext/types';
|
|
4
|
+
export { getMasterDetailLayoutComponentsDictionary } from './dicctionary';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -6,11 +6,15 @@ import { a as ModuleProvider } from "./contexts/ModuleContext/index.js";
|
|
|
6
6
|
const ModuleLayout = forwardRef((props, ref) => {
|
|
7
7
|
const { moduleId, moduleActions, version, children } = props;
|
|
8
8
|
const moduleRef = useRef(null);
|
|
9
|
+
const closeModal = () => {
|
|
10
|
+
moduleRef.current?.closeModal();
|
|
11
|
+
};
|
|
9
12
|
const openModal = (modalOpenProps) => {
|
|
10
13
|
moduleRef.current?.openModal(modalOpenProps);
|
|
11
14
|
};
|
|
12
15
|
useImperativeHandle(ref, () => ({
|
|
13
16
|
openModal,
|
|
17
|
+
closeModal,
|
|
14
18
|
current: moduleRef.current
|
|
15
19
|
}));
|
|
16
20
|
return /* @__PURE__ */ jsx(ModuleProvider, { moduleId, moduleActions, version, children: /* @__PURE__ */ jsx(ModalProvider, { children: /* @__PURE__ */ jsx(BaseModuleLayout, { ref: moduleRef, children }) }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ModuleLayoutRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
1
|
+
export declare const ModuleLayoutRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -5,10 +5,11 @@ import { M as ModuleLayoutRootStyled } from "../../slots/ModuleLayoutSlots.js";
|
|
|
5
5
|
import { M as MODULE_LAYOUT_KEY } from "../../constants.js";
|
|
6
6
|
const BaseModuleLayout = forwardRef((props, ref) => {
|
|
7
7
|
const { children } = props;
|
|
8
|
-
const { openModal } = useModal();
|
|
8
|
+
const { openModal, closeModal } = useModal();
|
|
9
9
|
const divRef = useRef(null);
|
|
10
10
|
useImperativeHandle(ref, () => ({
|
|
11
11
|
openModal,
|
|
12
|
+
closeModal,
|
|
12
13
|
current: divRef.current
|
|
13
14
|
}));
|
|
14
15
|
const classRoot = getComponentSlotRoot(MODULE_LAYOUT_KEY);
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { ModalOpenOptions } from '@m4l/components';
|
|
3
3
|
export type ModuleRef = {
|
|
4
4
|
openModal: (modalOpenProps: ModalOpenOptions) => void;
|
|
5
|
+
closeModal: () => void;
|
|
5
6
|
current: HTMLDivElement | null;
|
|
6
7
|
};
|
|
7
8
|
export interface ModuleProps {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare const BaseNoAuthModuleLayoutRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
2
|
-
export declare const MobileContentRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
3
|
-
export declare const MobileBannerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
4
|
-
export declare const ContainerImageLanguageStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
5
|
-
export declare const ContainerLogoStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
6
|
-
export declare const CompanyNameStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
7
|
-
export declare const FormContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
8
|
-
export declare const WrapperFormContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
9
|
-
export declare const ContainerModuleNameStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
10
|
-
export declare const DesktopContentRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
11
|
-
export declare const DesktopBannerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
12
|
-
export declare const ContainerLogoDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
13
|
-
export declare const CompanyNameDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
14
|
-
export declare const CompanyLeyendDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
15
|
-
export declare const FormContentDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
16
|
-
export declare const WrapperFormContentDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
17
|
-
export declare const ContainerModuleNameDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
18
|
-
export declare const ContentFormDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').
|
|
1
|
+
export declare const BaseNoAuthModuleLayoutRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
2
|
+
export declare const MobileContentRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
3
|
+
export declare const MobileBannerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const ContainerImageLanguageStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
5
|
+
export declare const ContainerLogoStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
6
|
+
export declare const CompanyNameStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
7
|
+
export declare const FormContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
8
|
+
export declare const WrapperFormContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
9
|
+
export declare const ContainerModuleNameStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
10
|
+
export declare const DesktopContentRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
11
|
+
export declare const DesktopBannerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
12
|
+
export declare const ContainerLogoDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
13
|
+
export declare const CompanyNameDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
14
|
+
export declare const CompanyLeyendDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
15
|
+
export declare const FormContentDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
16
|
+
export declare const WrapperFormContentDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
17
|
+
export declare const ContainerModuleNameDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
18
|
+
export declare const ContentFormDesktopStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
19
19
|
export declare const TypographyBannerStyled: import('@emotion/styled').StyledComponent<Pick<import('@m4l/components/src/components/mui_extended/Typography/types').TypographyProps, keyof import('@m4l/components/src/components/mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
|
package/layouts/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { ModuleLayout } from './ModuleLayout/ModuleLayout';
|
|
2
2
|
export * from './ModuleLayout/dicctionary';
|
|
3
|
-
export
|
|
4
|
-
export * from './MasterDetailLayout/dicctionary';
|
|
3
|
+
export * from './MasterDetailLayout';
|
|
5
4
|
export { NoAuthModuleLayout } from './NoAuthModuleLayout';
|
|
6
5
|
export * from './NoAuthModuleLayout/dicctionary';
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/layouts",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.10-beta.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "M4L Team",
|
|
6
6
|
"lint-staged": {
|
|
7
7
|
"*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@m4l/components": "^9.
|
|
10
|
+
"@m4l/components": "^9.2.15-beta.2",
|
|
11
11
|
"@m4l/core": "^2.0.0",
|
|
12
12
|
"@m4l/graphics": "^7.0.0",
|
|
13
13
|
"@m4l/styles": "^7.0.0"
|
|
@@ -45,10 +45,6 @@
|
|
|
45
45
|
"node": ">=12.0.0"
|
|
46
46
|
},
|
|
47
47
|
"packageManager": "yarn@4.5.0",
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"cross-fetch": "^4.1.0",
|
|
50
|
-
"storybook-multilevel-sort": "^2.0.1"
|
|
51
|
-
},
|
|
52
48
|
"private": false,
|
|
53
49
|
"exports": {
|
|
54
50
|
".": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const MOCK_CLIENTS: {
|
|
2
|
+
nombre: string;
|
|
3
|
+
correo: string;
|
|
4
|
+
telefono: string;
|
|
5
|
+
direccion: string;
|
|
6
|
+
ciudad: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const MOCK_USERS: {
|
|
9
|
+
nombre: string;
|
|
10
|
+
apellido: string;
|
|
11
|
+
email: string;
|
|
12
|
+
telefono: string;
|
|
13
|
+
activo: boolean;
|
|
14
|
+
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
+
import { NoAuthModuleLayout } from '../../../src/layouts/NoAuthModuleLayout/index';
|
|
3
|
+
declare const meta: Meta<typeof NoAuthModuleLayout>;
|
|
4
|
+
type Story = StoryObj<typeof NoAuthModuleLayout>;
|
|
5
|
+
/**
|
|
6
|
+
* NoAuthModuleLayout component por defecto con el logo de la compañía.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
export default meta;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type CreateAppMFProps = {
|
|
2
|
+
prefixMF: string;
|
|
3
|
+
moduleId: string;
|
|
4
|
+
App: () => JSX.Element;
|
|
5
|
+
privileges: string[];
|
|
6
|
+
appVersion: string;
|
|
7
|
+
componentsDictionary: string[];
|
|
8
|
+
skeletonFlags: string[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Create a new app for a microfrontend
|
|
12
|
+
*/
|
|
13
|
+
export declare function createAppMF(props: CreateAppMFProps): void;
|