@m4l/layouts 9.1.13 → 9.1.14
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/layouts/MasterDetailLayout/MasterDetailLayout.js +15 -18
- package/layouts/MasterDetailLayout/constants.d.ts +2 -0
- package/layouts/MasterDetailLayout/constants.js +6 -0
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.js +14 -5
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.d.ts +16 -0
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.js +48 -0
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/types.d.ts +28 -0
- package/layouts/MasterDetailLayout/dicctionary.d.ts +6 -2
- package/layouts/MasterDetailLayout/dicctionary.js +8 -3
- package/layouts/MasterDetailLayout/helpers/getTotalModuleActions.d.ts +5 -0
- package/layouts/MasterDetailLayout/helpers/getTotalModuleActions.js +8 -0
- package/layouts/MasterDetailLayout/icons.d.ts +5 -0
- package/layouts/MasterDetailLayout/icons.js +8 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutEnum.d.ts +3 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutEnum.js +7 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutSlot.d.ts +1 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutSlot.js +11 -0
- package/layouts/MasterDetailLayout/styles.d.ts +2 -1
- package/layouts/MasterDetailLayout/styles.js +37 -5
- package/layouts/MasterDetailLayout/tests/MasterDetailLayout.test.d.ts +1 -0
- package/layouts/MasterDetailLayout/types.d.ts +6 -0
- package/not_recognized/index.js +2 -1
- package/package.json +1 -1
- package/storybook/layouts/MasterDetailLayout/MasterDetailLayout.stories.d.ts +6 -0
- package/storybook/layouts/MasterDetailLayout/moks/mokData.d.ts +7 -0
- package/storybook/layouts/MasterDetailLayout/subcomponents/RenderMasterDetailLayout.d.ts +6 -0
- package/test/constants.d.ts +0 -2
- package/test/mocks.d.ts +2 -0
- package/layouts/MasterDetailLayout/classes/constants.d.ts +0 -1
- package/layouts/MasterDetailLayout/classes/constants.js +0 -4
- package/layouts/MasterDetailLayout/classes/index.d.ts +0 -9
- package/layouts/MasterDetailLayout/classes/index.js +0 -23
- package/layouts/MasterDetailLayout/classes/types.d.ts +0 -6
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useCallback, useMemo } from "react";
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { WindowBase, SplitLayout } from "@m4l/components";
|
|
4
|
+
import { WindowBase, getComponentSlotRoot, 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
7
|
import { useIsMobile } from "@m4l/graphics";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return totalActions;
|
|
14
|
-
}
|
|
8
|
+
import { i as icons } from "./icons.js";
|
|
9
|
+
import { d as dictionary } from "./dicctionary.js";
|
|
10
|
+
import { M as MasterDetailLayoutRootStyled } from "./slots/MasterDetailLayoutSlot.js";
|
|
11
|
+
import { M as MASTER_DETAIL_LAYOUT_PREFIX } from "./constants.js";
|
|
12
|
+
import { g as getTotalModuleActions } from "./helpers/getTotalModuleActions.js";
|
|
15
13
|
function MasterDetailLayout(props) {
|
|
16
14
|
const {
|
|
17
15
|
moduleId,
|
|
@@ -19,7 +17,6 @@ function MasterDetailLayout(props) {
|
|
|
19
17
|
detailComponent,
|
|
20
18
|
moduleActions,
|
|
21
19
|
version
|
|
22
|
-
// defaultDictionary,
|
|
23
20
|
} = props;
|
|
24
21
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
25
22
|
const [splitPosition, setSplitPosition] = useState("vertical");
|
|
@@ -32,30 +29,30 @@ function MasterDetailLayout(props) {
|
|
|
32
29
|
const splitActions = useMemo(
|
|
33
30
|
() => [
|
|
34
31
|
{
|
|
35
|
-
iconUrl: `${host_static_assets}/${environment_assets}
|
|
32
|
+
iconUrl: `${host_static_assets}/${environment_assets}/${icons.splitVertical}`,
|
|
36
33
|
onClick: () => onChangePostionInternal("vertical"),
|
|
37
34
|
visibility: "main",
|
|
38
|
-
label: getLabel(
|
|
35
|
+
label: getLabel(dictionary.LABEL_SPLIT_VERTICAL),
|
|
39
36
|
tag: "vertical",
|
|
40
37
|
className: "splitactions",
|
|
41
38
|
disabled: splitPosition === "vertical",
|
|
42
39
|
key: "vertical"
|
|
43
40
|
},
|
|
44
41
|
{
|
|
45
|
-
iconUrl: `${host_static_assets}/${environment_assets}
|
|
42
|
+
iconUrl: `${host_static_assets}/${environment_assets}/${icons.splitHorizontal}`,
|
|
46
43
|
onClick: () => onChangePostionInternal("horizontal"),
|
|
47
44
|
visibility: "main",
|
|
48
|
-
label: getLabel(
|
|
45
|
+
label: getLabel(dictionary.LABEL_SPLIT_HORIZONTAL),
|
|
49
46
|
tag: "horizontal",
|
|
50
47
|
className: "splitactions",
|
|
51
48
|
disabled: splitPosition === "horizontal",
|
|
52
49
|
key: "horizontal"
|
|
53
50
|
},
|
|
54
51
|
{
|
|
55
|
-
iconUrl: `${host_static_assets}/${environment_assets}
|
|
52
|
+
iconUrl: `${host_static_assets}/${environment_assets}/${icons.noSplit}`,
|
|
56
53
|
onClick: () => onChangePostionInternal("none"),
|
|
57
54
|
visibility: "main",
|
|
58
|
-
label: getLabel(
|
|
55
|
+
label: getLabel(dictionary.LABEL_NO_SPLIT),
|
|
59
56
|
tag: "none",
|
|
60
57
|
className: "splitactions",
|
|
61
58
|
disabled: splitPosition === "none",
|
|
@@ -71,7 +68,7 @@ function MasterDetailLayout(props) {
|
|
|
71
68
|
window: /* @__PURE__ */ jsx(
|
|
72
69
|
WindowBase,
|
|
73
70
|
{
|
|
74
|
-
title: getLabel(
|
|
71
|
+
title: getLabel(dictionary.LABEL_VIEW_DETAIL),
|
|
75
72
|
onClose: () => {
|
|
76
73
|
moduleLayoutRef.current?.closeModal();
|
|
77
74
|
},
|
|
@@ -87,8 +84,8 @@ function MasterDetailLayout(props) {
|
|
|
87
84
|
);
|
|
88
85
|
return actions;
|
|
89
86
|
}, [splitActions, moduleActions]);
|
|
90
|
-
const
|
|
91
|
-
return /* @__PURE__ */ jsx(MasterDetailProvider, { onClickViewDetail, children: /* @__PURE__ */ jsx(
|
|
87
|
+
const classRoot = getComponentSlotRoot(MASTER_DETAIL_LAYOUT_PREFIX);
|
|
88
|
+
return /* @__PURE__ */ jsx(MasterDetailProvider, { onClickViewDetail, children: /* @__PURE__ */ jsx(MasterDetailLayoutRootStyled, { className: classRoot, children: /* @__PURE__ */ jsx(
|
|
92
89
|
ModuleLayout,
|
|
93
90
|
{
|
|
94
91
|
ref: moduleLayoutRef,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext,
|
|
2
|
+
import { createContext, useRef } from "react";
|
|
3
3
|
import { voidFunction } from "@m4l/core";
|
|
4
|
+
import { c as createMasterDetailLayoutStore } from "./store.js";
|
|
5
|
+
import { u as useStore } from "../../../../not_recognized/index.js";
|
|
4
6
|
const initialState = {
|
|
5
7
|
masterSelection: void 0,
|
|
6
8
|
onChangeMasterSelection: voidFunction,
|
|
@@ -11,17 +13,24 @@ const initialState = {
|
|
|
11
13
|
const MasterDetailContext = createContext(initialState);
|
|
12
14
|
function MasterDetailProvider(props) {
|
|
13
15
|
const { children, onClickViewDetail } = props;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
+
const masterDetailLayoutStoreRef = useRef();
|
|
17
|
+
if (!masterDetailLayoutStoreRef.current) {
|
|
18
|
+
masterDetailLayoutStoreRef.current = createMasterDetailLayoutStore({
|
|
19
|
+
masterSelection: void 0,
|
|
20
|
+
refreshMaster: voidFunction
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const store = useStore(masterDetailLayoutStoreRef.current, (state) => state);
|
|
24
|
+
const { masterSelection, updateMasterSelection, updateRefreshMaster, refreshMaster } = store;
|
|
16
25
|
return /* @__PURE__ */ jsx(
|
|
17
26
|
MasterDetailContext.Provider,
|
|
18
27
|
{
|
|
19
28
|
value: {
|
|
20
29
|
masterSelection,
|
|
21
|
-
onChangeMasterSelection:
|
|
30
|
+
onChangeMasterSelection: updateMasterSelection,
|
|
22
31
|
onClickViewDetail,
|
|
23
32
|
refreshMaster,
|
|
24
|
-
setRefreshMaster
|
|
33
|
+
setRefreshMaster: updateRefreshMaster
|
|
25
34
|
},
|
|
26
35
|
children
|
|
27
36
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MasterDetailLayoutState, MasterDetailLayoutStateWithActions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Crea el Store para ModuleLayout.
|
|
4
|
+
* Este store se encarga de manejar el estado del layout de módulo.
|
|
5
|
+
* @param props Las props iniciales del store.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createMasterDetailLayoutStore: (initProps: MasterDetailLayoutState, storeDevtoolsEnabled?: boolean) => import('zustand').UseBoundStore<Omit<Omit<import('zustand').StoreApi<MasterDetailLayoutStateWithActions>, "setState"> & {
|
|
8
|
+
setState<A extends string | {
|
|
9
|
+
type: unknown;
|
|
10
|
+
}>(partial: MasterDetailLayoutStateWithActions | Partial<MasterDetailLayoutStateWithActions> | ((state: MasterDetailLayoutStateWithActions) => MasterDetailLayoutStateWithActions | Partial<MasterDetailLayoutStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
11
|
+
}, "setState"> & {
|
|
12
|
+
setState(nextStateOrUpdater: MasterDetailLayoutStateWithActions | Partial<MasterDetailLayoutStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<MasterDetailLayoutStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
13
|
+
type: unknown;
|
|
14
|
+
} | undefined): void;
|
|
15
|
+
}>;
|
|
16
|
+
export type MasterDetailLayoutStore = ReturnType<typeof createMasterDetailLayoutStore>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { c as create, i as immer, d as devtools } from "../../../../not_recognized/index.js";
|
|
2
|
+
import { a as MASTER_DETAIL_LAYOUT_STORE_ID } from "../../constants.js";
|
|
3
|
+
const createDevtools = (immerMiddlewere, config) => {
|
|
4
|
+
const { enabled = false } = config;
|
|
5
|
+
if (enabled && process.env.NODE_ENV === "development") {
|
|
6
|
+
return devtools(immerMiddlewere, config);
|
|
7
|
+
}
|
|
8
|
+
return immerMiddlewere;
|
|
9
|
+
};
|
|
10
|
+
const createMasterDetailLayoutStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
11
|
+
const { refreshMaster, masterSelection } = initProps;
|
|
12
|
+
const startProps = {
|
|
13
|
+
refreshMaster,
|
|
14
|
+
masterSelection
|
|
15
|
+
};
|
|
16
|
+
return create(
|
|
17
|
+
createDevtools(
|
|
18
|
+
immer((set) => ({
|
|
19
|
+
...startProps,
|
|
20
|
+
/**
|
|
21
|
+
* Initilize the store
|
|
22
|
+
*/
|
|
23
|
+
init: () => {
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Update the master selection
|
|
27
|
+
*/
|
|
28
|
+
updateMasterSelection: (newMasterSelection) => {
|
|
29
|
+
set((state) => {
|
|
30
|
+
state.masterSelection = newMasterSelection;
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Update the refresh master
|
|
35
|
+
*/
|
|
36
|
+
updateRefreshMaster: (callback) => {
|
|
37
|
+
set((state) => {
|
|
38
|
+
state.refreshMaster = callback;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
})),
|
|
42
|
+
{ name: `${MASTER_DETAIL_LAYOUT_STORE_ID}: ${initProps.storeId}`, enabled: storeDevtoolsEnabled }
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
createMasterDetailLayoutStore as c
|
|
48
|
+
};
|
|
@@ -6,9 +6,37 @@ export interface MasterDetailContextStateProps {
|
|
|
6
6
|
export interface MasterDetailProviderProps {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
onClickViewDetail: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* "storeDevtoolsEnabled" enable store devtools
|
|
11
|
+
*/
|
|
12
|
+
storeDevtoolsEnabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* "storeId" store identifier
|
|
15
|
+
*/
|
|
16
|
+
storeId?: string;
|
|
9
17
|
}
|
|
10
18
|
export interface MasterDetailContextProps extends MasterDetailContextStateProps, Pick<MasterDetailProviderProps, 'onClickViewDetail'> {
|
|
11
19
|
onChangeMasterSelection: (newMasterSelection: MasterSelecion) => void;
|
|
12
20
|
refreshMaster: () => void;
|
|
13
21
|
setRefreshMaster: (callback: () => void) => void;
|
|
14
22
|
}
|
|
23
|
+
export interface MasterDetailLayoutState extends Pick<MasterDetailContextStateProps, 'masterSelection'>, Pick<MasterDetailProviderProps, 'storeId'> {
|
|
24
|
+
/**
|
|
25
|
+
* Refresh master: Action to refresh data inthe master component
|
|
26
|
+
*/
|
|
27
|
+
refreshMaster: () => void;
|
|
28
|
+
}
|
|
29
|
+
export interface MasterDetailLayoutStateWithActions extends MasterDetailLayoutState {
|
|
30
|
+
/**
|
|
31
|
+
* Initialize MasterDetailLayout store.
|
|
32
|
+
*/
|
|
33
|
+
init: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Update MasterDetailLayout store.
|
|
36
|
+
*/
|
|
37
|
+
updateMasterSelection: (newMasterSelection: MasterSelecion) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Update MasterDetailLayout store.
|
|
40
|
+
*/
|
|
41
|
+
updateRefreshMaster: (callback: () => void) => void;
|
|
42
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { Dictionary } from '@m4l/core';
|
|
2
1
|
export declare function getMasterDetailLayoutComponentsDictionary(): string[];
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const dictionary: {
|
|
3
|
+
LABEL_SPLIT_VERTICAL: string;
|
|
4
|
+
LABEL_SPLIT_HORIZONTAL: string;
|
|
5
|
+
LABEL_NO_SPLIT: string;
|
|
6
|
+
LABEL_VIEW_DETAIL: string;
|
|
7
|
+
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/dicctionary.js";
|
|
2
|
-
import { getNoItemSelectedComponentsDictionary } from "@m4l/components";
|
|
3
1
|
function getMasterDetailLayoutComponentsDictionary() {
|
|
4
|
-
return ["master_detail_layout"]
|
|
2
|
+
return ["master_detail_layout"];
|
|
5
3
|
}
|
|
4
|
+
const dictionary = {
|
|
5
|
+
LABEL_SPLIT_VERTICAL: `${getMasterDetailLayoutComponentsDictionary()[0]}.split_vertical`,
|
|
6
|
+
LABEL_SPLIT_HORIZONTAL: `${getMasterDetailLayoutComponentsDictionary()[0]}.split_horizontal`,
|
|
7
|
+
LABEL_NO_SPLIT: `${getMasterDetailLayoutComponentsDictionary()[0]}.no_split`,
|
|
8
|
+
LABEL_VIEW_DETAIL: `${getMasterDetailLayoutComponentsDictionary()[0]}.view_detail`
|
|
9
|
+
};
|
|
6
10
|
export {
|
|
11
|
+
dictionary as d,
|
|
7
12
|
getMasterDetailLayoutComponentsDictionary as g
|
|
8
13
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const icons = {
|
|
2
|
+
splitVertical: "frontend/components/masterdetaillayout/assets/icons/split_vertical.svg",
|
|
3
|
+
splitHorizontal: "frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg",
|
|
4
|
+
noSplit: "frontend/components/masterdetaillayout/assets/icons/no_split.svg"
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
icons as i
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var MasterDetailLayoutSlots = /* @__PURE__ */ ((MasterDetailLayoutSlots2) => {
|
|
2
|
+
MasterDetailLayoutSlots2["masterDetailLayoutRoot"] = "MasterDetailLayoutRoot";
|
|
3
|
+
return MasterDetailLayoutSlots2;
|
|
4
|
+
})(MasterDetailLayoutSlots || {});
|
|
5
|
+
export {
|
|
6
|
+
MasterDetailLayoutSlots as M
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MasterDetailLayoutRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from "@mui/material/styles/styled";
|
|
2
|
+
import { M as MASTER_DETAIL_LAYOUT_PREFIX } from "../constants.js";
|
|
3
|
+
import { M as MasterDetailLayoutSlots } from "./MasterDetailLayoutEnum.js";
|
|
4
|
+
import { m as masterDetailLayoutStyles } from "../styles.js";
|
|
5
|
+
const MasterDetailLayoutRootStyled = styled("div", {
|
|
6
|
+
name: MASTER_DETAIL_LAYOUT_PREFIX,
|
|
7
|
+
slot: MasterDetailLayoutSlots.masterDetailLayoutRoot
|
|
8
|
+
})(masterDetailLayoutStyles.masterDetailLayoutRoot);
|
|
9
|
+
export {
|
|
10
|
+
MasterDetailLayoutRootStyled as M
|
|
11
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { MasterDetailLayoutStyles } from './types';
|
|
2
|
+
export declare const masterDetailLayoutStyles: MasterDetailLayoutStyles;
|
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { M as MASTER_DETAIL_LAYOUT_PREFIX } from "./constants.js";
|
|
2
|
+
const masterDetailLayoutStyles = {
|
|
3
|
+
/**
|
|
4
|
+
* Estilos para el componente root del MasterDetailLayout
|
|
5
|
+
*/
|
|
6
|
+
masterDetailLayoutRoot: ({ theme }) => ({
|
|
7
|
+
[`&.${MASTER_DETAIL_LAYOUT_PREFIX}-root`]: {
|
|
8
|
+
display: "flex",
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: "100%",
|
|
11
|
+
overFlow: "visible",
|
|
12
|
+
"& .M4LModuleLayout-root .M4LModuleLayout-moduleContent": {
|
|
13
|
+
display: "flex",
|
|
14
|
+
width: "100%",
|
|
15
|
+
height: "100%",
|
|
16
|
+
boxShadow: "none",
|
|
17
|
+
background: theme.vars.palette.background.default,
|
|
18
|
+
border: theme.vars.size.borderRadius.r0,
|
|
19
|
+
borderColor: "transparent",
|
|
20
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
21
|
+
overFlow: "visible",
|
|
22
|
+
"& .splitter-layout": {
|
|
23
|
+
gap: theme.vars.size.borderRadius.r2
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"& .M4LSplitLayout-secondPart": {
|
|
27
|
+
background: theme.vars.palette.background.default,
|
|
28
|
+
borderRadius: theme.vars.size.borderRadius.r1
|
|
29
|
+
},
|
|
30
|
+
"& .layout-pane-primary": {
|
|
31
|
+
background: theme.vars.palette.background.default,
|
|
32
|
+
borderRadius: theme.vars.size.borderRadius.r1
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
};
|
|
5
37
|
export {
|
|
6
|
-
|
|
38
|
+
masterDetailLayoutStyles as m
|
|
7
39
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ModuleLayoutProps } from '../ModuleLayout/types';
|
|
3
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
4
|
+
import { MasterDetailLayoutSlots } from './slots/MasterDetailLayoutEnum';
|
|
5
|
+
import { MASTER_DETAIL_LAYOUT_PREFIX } from './constants';
|
|
6
|
+
import { Theme } from '@mui/material/styles';
|
|
3
7
|
export interface ContainerProps {
|
|
4
8
|
vertical: boolean;
|
|
5
9
|
}
|
|
@@ -7,3 +11,5 @@ export interface MasterDetailLayoutProps extends Omit<ModuleLayoutProps, 'childr
|
|
|
7
11
|
masterComponent: ((props?: any) => JSX.Element) | ReactNode;
|
|
8
12
|
detailComponent: ((props?: any) => JSX.Element) | ReactNode;
|
|
9
13
|
}
|
|
14
|
+
export type MasterDetailLayoutSlotsType = keyof typeof MasterDetailLayoutSlots;
|
|
15
|
+
export type MasterDetailLayoutStyles = OverridesStyleRules<MasterDetailLayoutSlotsType, typeof MASTER_DETAIL_LAYOUT_PREFIX, Theme>;
|
package/not_recognized/index.js
CHANGED
package/package.json
CHANGED
package/test/constants.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Formatters } from '@m4l/graphics';
|
|
2
1
|
import { HostToolsType, Toaster } from '@m4l/core';
|
|
3
2
|
import { BaseDataForTesting } from './types';
|
|
4
3
|
export declare const moduleIdForTesting = "testing";
|
|
@@ -66,4 +65,3 @@ export declare const environmentDataForTesting: {
|
|
|
66
65
|
export declare const baseDataForTesting: BaseDataForTesting;
|
|
67
66
|
export declare const mock_toaster: Toaster;
|
|
68
67
|
export declare const hostToolsDataForTesting: HostToolsType;
|
|
69
|
-
export declare const formatterValues: Formatters;
|
package/test/mocks.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Formatters } from '@m4l/graphics';
|
|
1
2
|
import * as core from '@m4l/core';
|
|
2
3
|
import * as graphics from '@m4l/graphics';
|
|
3
4
|
export declare const mock_addFlag: import('vitest').Mock<(...args: any[]) => any>;
|
|
@@ -14,6 +15,7 @@ export declare const mock_useEnvironment: {
|
|
|
14
15
|
environment_assets: string;
|
|
15
16
|
domain_token: string;
|
|
16
17
|
};
|
|
18
|
+
export declare const formatterValues: Formatters;
|
|
17
19
|
export declare const mockedGraphics: {
|
|
18
20
|
useFormatter: import('vitest').MockInstance<() => graphics.Formatters>;
|
|
19
21
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const componentName = "M4LMasterDetailLayout";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MasterDetailLayoutClassesType } from './types';
|
|
2
|
-
export declare const masterDetailLayoutClasses: MasterDetailLayoutClassesType;
|
|
3
|
-
export declare function getMasterDetailLayoutUtilityClass(slot: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Hook para obtener las clases del componente MasterDetailLayout
|
|
6
|
-
*/
|
|
7
|
-
export declare const getMasterDetailLayoutUtilityClasses: () => {
|
|
8
|
-
root: string;
|
|
9
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
-
import { c as componentName } from "./constants.js";
|
|
4
|
-
generateUtilityClasses(componentName, [
|
|
5
|
-
/* elements */
|
|
6
|
-
"root"
|
|
7
|
-
/* states or variants of elements */
|
|
8
|
-
]);
|
|
9
|
-
function getMasterDetailLayoutUtilityClass(slot) {
|
|
10
|
-
return generateUtilityClass(componentName, slot);
|
|
11
|
-
}
|
|
12
|
-
const getMasterDetailLayoutUtilityClasses = () => {
|
|
13
|
-
const slots = {
|
|
14
|
-
root: ["root"]
|
|
15
|
-
};
|
|
16
|
-
const composedClasses = unstable_composeClasses(slots, getMasterDetailLayoutUtilityClass, {});
|
|
17
|
-
return {
|
|
18
|
-
...composedClasses
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
getMasterDetailLayoutUtilityClasses as g
|
|
23
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { getMasterDetailLayoutUtilityClasses } from '.';
|
|
2
|
-
export interface MasterDetailLayoutClassesType {
|
|
3
|
-
root: string;
|
|
4
|
-
}
|
|
5
|
-
export type MasterDetailLayoutClassesKey = keyof MasterDetailLayoutClassesType;
|
|
6
|
-
export type Classes = ReturnType<typeof getMasterDetailLayoutUtilityClasses>;
|