@m4l/layouts 9.1.13 → 9.1.15

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.
Files changed (44) hide show
  1. package/components/ModuleDetailTabs/useModuleDatailTabs.d.ts +83 -83
  2. package/hooks/index.d.ts +1 -0
  3. package/hooks/useDynamicAccordions/useBaseAccordions.js +2 -2
  4. package/hooks/useDynamicPaperForm/index.d.ts +2 -0
  5. package/hooks/useDynamicPaperForm/index.js +1 -0
  6. package/hooks/useDynamicPaperForm/types.d.ts +25 -0
  7. package/hooks/useDynamicPaperForm/useDynamicPaperForm.d.ts +9 -0
  8. package/hooks/useDynamicPaperForm/useDynamicPaperForm.js +55 -0
  9. package/index.js +5 -2
  10. package/layouts/MasterDetailLayout/MasterDetailLayout.js +15 -18
  11. package/layouts/MasterDetailLayout/constants.d.ts +2 -0
  12. package/layouts/MasterDetailLayout/constants.js +6 -0
  13. package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.js +14 -5
  14. package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.d.ts +16 -0
  15. package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.js +50 -0
  16. package/layouts/MasterDetailLayout/contexts/MasterDetailContext/types.d.ts +28 -0
  17. package/layouts/MasterDetailLayout/dicctionary.d.ts +6 -2
  18. package/layouts/MasterDetailLayout/dicctionary.js +8 -3
  19. package/layouts/MasterDetailLayout/helpers/getTotalModuleActions.d.ts +5 -0
  20. package/layouts/MasterDetailLayout/helpers/getTotalModuleActions.js +8 -0
  21. package/layouts/MasterDetailLayout/icons.d.ts +5 -0
  22. package/layouts/MasterDetailLayout/icons.js +8 -0
  23. package/layouts/MasterDetailLayout/slots/MasterDetailLayoutEnum.d.ts +3 -0
  24. package/layouts/MasterDetailLayout/slots/MasterDetailLayoutEnum.js +7 -0
  25. package/layouts/MasterDetailLayout/slots/MasterDetailLayoutSlot.d.ts +1 -0
  26. package/layouts/MasterDetailLayout/slots/MasterDetailLayoutSlot.js +11 -0
  27. package/layouts/MasterDetailLayout/styles.d.ts +2 -1
  28. package/layouts/MasterDetailLayout/styles.js +37 -5
  29. package/layouts/MasterDetailLayout/tests/MasterDetailLayout.test.d.ts +1 -0
  30. package/layouts/MasterDetailLayout/types.d.ts +6 -0
  31. package/layouts/ModuleLayout/contexts/ModuleContext/store.js +3 -1
  32. package/package.json +1 -1
  33. package/storybook/layouts/MasterDetailLayout/MasterDetailLayout.stories.d.ts +6 -0
  34. package/storybook/layouts/MasterDetailLayout/moks/mokData.d.ts +7 -0
  35. package/storybook/layouts/MasterDetailLayout/subcomponents/RenderMasterDetailLayout.d.ts +6 -0
  36. package/test/constants.d.ts +0 -2
  37. package/test/mocks.d.ts +2 -0
  38. package/commonjs/index.js +0 -7
  39. package/layouts/MasterDetailLayout/classes/constants.d.ts +0 -1
  40. package/layouts/MasterDetailLayout/classes/constants.js +0 -4
  41. package/layouts/MasterDetailLayout/classes/index.d.ts +0 -9
  42. package/layouts/MasterDetailLayout/classes/index.js +0 -23
  43. package/layouts/MasterDetailLayout/classes/types.d.ts +0 -6
  44. package/not_recognized/index.js +0 -963
@@ -0,0 +1,5 @@
1
+ import { ModuleAction } from '@m4l/components';
2
+ /**
3
+ * Obtiene las acciones totales del modulo
4
+ */
5
+ export declare function getTotalModuleActions(splitActions: ModuleAction[], moduleActions?: ModuleAction[]): ModuleAction[];
@@ -0,0 +1,8 @@
1
+ function getTotalModuleActions(splitActions, moduleActions = []) {
2
+ let totalActions = [...splitActions];
3
+ totalActions = moduleActions.concat(totalActions);
4
+ return totalActions;
5
+ }
6
+ export {
7
+ getTotalModuleActions as g
8
+ };
@@ -0,0 +1,5 @@
1
+ export declare const icons: {
2
+ splitVertical: string;
3
+ splitHorizontal: string;
4
+ noSplit: string;
5
+ };
@@ -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,3 @@
1
+ export declare enum MasterDetailLayoutSlots {
2
+ masterDetailLayoutRoot = "MasterDetailLayoutRoot"
3
+ }
@@ -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
- export declare const MasterDetailLayoutRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ import { MasterDetailLayoutStyles } from './types';
2
+ export declare const masterDetailLayoutStyles: MasterDetailLayoutStyles;
@@ -1,7 +1,39 @@
1
- import { styled } from "@mui/material";
2
- const MasterDetailLayoutRoot = styled("div")(({ theme }) => ({
3
- ...theme.components?.M4LMasterDetailLayout?.styleOverrides
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
- MasterDetailLayoutRoot as M
38
+ masterDetailLayoutStyles as m
7
39
  };
@@ -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>;
@@ -1,4 +1,6 @@
1
- import { c as create, i as immer, d as devtools } from "../../../../not_recognized/index.js";
1
+ import { create } from "zustand";
2
+ import { devtools } from "zustand/middleware";
3
+ import { immer } from "zustand/middleware/immer";
2
4
  import { M as MODULE_LAYOUT_STORE_ID } from "../../constants.js";
3
5
  const createDevtools = (immerMiddlewere, config) => {
4
6
  const { enabled = false } = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "9.1.13",
3
+ "version": "9.1.15",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "lint-staged": {
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { AreasAdmin, PaperForm } from '@m4l/components';
3
+ declare const meta: Meta<typeof AreasAdmin>;
4
+ type Story = StoryObj<typeof PaperForm>;
5
+ export declare const Default: Story;
6
+ export default meta;
@@ -0,0 +1,7 @@
1
+ export declare const MOCK_USERS: {
2
+ nombre: string;
3
+ apellido: string;
4
+ email: string;
5
+ telefono: string;
6
+ activo: boolean;
7
+ }[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Render para utilizar el componente ModuleLayout
3
+ * en AreasViewer en el storybook
4
+ */
5
+ declare const RenderMasterDetailLayout: () => import("react/jsx-runtime").JSX.Element;
6
+ export default RenderMasterDetailLayout;
@@ -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
  };
package/commonjs/index.js DELETED
@@ -1,7 +0,0 @@
1
- import "react";
2
- function getDefaultExportFromCjs(x) {
3
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
- }
5
- export {
6
- getDefaultExportFromCjs as g
7
- };
@@ -1 +0,0 @@
1
- export declare const componentName = "M4LMasterDetailLayout";
@@ -1,4 +0,0 @@
1
- const componentName = "M4LMasterDetailLayout";
2
- export {
3
- componentName as c
4
- };
@@ -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>;