@m4l/layouts 2.0.1 → 2.0.2

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.
@@ -3,6 +3,7 @@ import { EnvironmentProvider, HostToolsProvider, NetworkProvider, DomainCountryP
3
3
  import { LocalesProvider, HostThemeProvider, ResponsiveContainerProvider, FormatterProvider } from "@m4l/graphics";
4
4
  import { BaseModule, WindowToolsMFProvider, DynamicMFParmsProvider } from "@m4l/components";
5
5
  import { jsx } from "react/jsx-runtime";
6
+ import { M as MFWindowsTitle } from "../index-uQ5qk7MJ.js";
6
7
  function MFHostApp(props) {
7
8
  const {
8
9
  children,
@@ -20,7 +21,8 @@ function MFHostApp(props) {
20
21
  componentsDictionary,
21
22
  dynamicMFStore,
22
23
  windowTools,
23
- observedDivRef
24
+ observedDivRef,
25
+ isAddEditModule = false
24
26
  } = props;
25
27
  return /* @__PURE__ */ jsx(EnvironmentProvider, {
26
28
  ...environment,
@@ -59,7 +61,10 @@ function MFHostApp(props) {
59
61
  ...windowTools,
60
62
  children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, {
61
63
  store: dynamicMFStore,
62
- children
64
+ children: /* @__PURE__ */ jsx(MFWindowsTitle, {
65
+ isAddEditModule,
66
+ children
67
+ })
63
68
  })
64
69
  })
65
70
  })
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { MFHostAppProps } from './types';
2
+ import type { MFHostAppProps } from './types';
3
3
  export declare function MFHostApp(props: MFHostAppProps): import("react").JSX.Element;
4
4
  export default MFHostApp;
@@ -12,5 +12,10 @@ export interface ByHostProps {
12
12
  dynamicMFStore: DynamicMFStore;
13
13
  windowTools: WindowToolsMF;
14
14
  observedDivRef: Element | Text | null;
15
+ /**
16
+ * isAddEditModule saber si el módulo es tipo add/edit, para poder asignar el title automáticamente
17
+ * cuando se cambia el idioma, desde MFHostApp/MFWindowsTitle
18
+ */
19
+ isAddEditModule?: boolean;
15
20
  }
16
21
  export declare type MFHostAppProps = ByHostProps & BaseModuleProps;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { MFWindowsTitleProps } from './types';
3
+ export declare function MFWindowsTitle({ isAddEditModule, children }: MFWindowsTitleProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './MFWindowsTitle';
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export interface MFWindowsTitleProps {
3
+ isAddEditModule: boolean;
4
+ children: ReactNode;
5
+ }
@@ -1,7 +1,8 @@
1
1
  import { DomainCountryProvider } from "@m4l/core";
2
2
  import { FormatterProvider, ResponsiveContainerProvider } from "@m4l/graphics";
3
- import { BaseModule } from "@m4l/components";
3
+ import { BaseModule, useSetWindowsTitle } from "@m4l/components";
4
4
  import { jsx } from "react/jsx-runtime";
5
+ import { Fragment } from "react";
5
6
  function MFNoAuthApp(props) {
6
7
  const {
7
8
  children,
@@ -42,6 +43,18 @@ function MFNoAuthApp(props) {
42
43
  })
43
44
  });
44
45
  }
46
+ function MFWindowsTitle({
47
+ isAddEditModule = false,
48
+ children
49
+ }) {
50
+ useSetWindowsTitle({
51
+ isAddEditModule
52
+ });
53
+ return /* @__PURE__ */ jsx(Fragment, {
54
+ children
55
+ });
56
+ }
45
57
  export {
46
- MFNoAuthApp as M
58
+ MFWindowsTitle as M,
59
+ MFNoAuthApp as a
47
60
  };
package/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { M } from "./components/index-BydiHRF0.js";
2
- import { M as M2 } from "./components/MFHostApp/index-CKsHsRY8.js";
3
- import { A, a } from "./contexts/AuthContext/index-DARkRRM4.js";
4
- import { a as a2, d, g } from "./layouts/ModuleLayout/index-DAtDuh6s.js";
5
- import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index-DeC4RoBs.js";
1
+ import { a } from "./components/index-uQ5qk7MJ.js";
2
+ import { M } from "./components/MFHostApp/index-_3WAKrrA.js";
3
+ import { A, a as a2 } from "./contexts/AuthContext/index-DARkRRM4.js";
4
+ import { a as a3, d, g } from "./layouts/ModuleLayout/index-DAtDuh6s.js";
5
+ import { a as a4, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index-DeC4RoBs.js";
6
6
  import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index-BxJ0vCUq.js";
7
7
  import { u } from "./hooks/useMasterDetail/index-D4QUQYYc.js";
8
8
  import { u as u2 } from "./hooks/useAuth/index-8hAi3guc.js";
9
9
  import { u as u3 } from "./hooks/useModule/index-FY5nsBmE.js";
10
10
  export {
11
11
  A as AuthContext,
12
- a as AuthProvider,
13
- M2 as MFHostApp,
14
- M as MFNoAuthApp,
15
- a3 as MasterDetailLayout,
16
- a2 as ModuleLayout,
12
+ a2 as AuthProvider,
13
+ M as MFHostApp,
14
+ a as MFNoAuthApp,
15
+ a4 as MasterDetailLayout,
16
+ a3 as ModuleLayout,
17
17
  N as NoAuthModuleLayout,
18
18
  d2 as defaultMasterDetailDictionary,
19
19
  d as defaultModuleLayoutDictionary,
@@ -1 +0,0 @@
1
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "private": false,
package/vite-env.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vitest" />
3
- /// <reference types="vitest/importMeta" />
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vitest" />
3
+ /// <reference types="vitest/importMeta" />