@m4l/layouts 9.3.3-beta.1 → 9.3.4-13062025.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.
@@ -3,7 +3,6 @@ import { unstable_HistoryRouter } from "react-router-dom";
3
3
  import { EnvironmentProvider, HostToolsProvider, NetworkProvider, DomainCountryProvider } from "@m4l/core";
4
4
  import { DeviceTypeProvider, LocalesProvider, HostThemeProvider, FormatterProvider } from "@m4l/graphics";
5
5
  import { BaseModule, WindowToolsMFProvider, DynamicMFParmsProvider, AppearanceComponentProvider } from "@m4l/components";
6
- import { M as MFWindowsTitle } from "../MFWindowsTitle/MFWindowsTitle.js";
7
6
  function MFHostApp(props) {
8
7
  const {
9
8
  children,
@@ -20,8 +19,7 @@ function MFHostApp(props) {
20
19
  privileges,
21
20
  componentsDictionary,
22
21
  dynamicMFStore,
23
- windowTools,
24
- isAddEditModule = false
22
+ windowTools
25
23
  } = props;
26
24
  return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation, children: /* @__PURE__ */ jsx(DeviceTypeProvider, { children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: true, localeHost: currentLocale, children: /* @__PURE__ */ jsx(
27
25
  HostThemeProvider,
@@ -46,7 +44,7 @@ function MFHostApp(props) {
46
44
  componentsDictionary,
47
45
  skeletonFlags,
48
46
  privileges,
49
- children: /* @__PURE__ */ jsx(FormatterProvider, { isMicroFrontEnd: true, ...formatters, children: /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(MFWindowsTitle, { isAddEditModule, children: /* @__PURE__ */ jsx(AppearanceComponentProvider, { children }) }) }) }) })
47
+ children: /* @__PURE__ */ jsx(FormatterProvider, { isMicroFrontEnd: true, ...formatters, children: /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(AppearanceComponentProvider, { children }) }) }) })
50
48
  }
51
49
  )
52
50
  }
@@ -17,6 +17,7 @@ export interface ByHostProps {
17
17
  /**
18
18
  * isAddEditModule saber si el módulo es tipo add/edit, para poder asignar el title automáticamente
19
19
  * cuando se cambia el idioma, desde MFHostApp/MFWindowsTitle
20
+ * @deprecated no usar, no tiene efecto. utilizar el hook useMFWindowsTitle
20
21
  */
21
22
  isAddEditModule?: boolean;
22
23
  }
@@ -1,11 +1,11 @@
1
- import { PropertyValueProps } from '@m4l/components';
1
+ import { PropertyValueProps, RHFTextFieldProps } from '@m4l/components';
2
2
  interface PropertyValueFieldBase extends Pick<PropertyValueProps, 'semanticWidth'> {
3
3
  name: string;
4
4
  type: 'RHFTexfField' | 'component';
5
5
  label: string;
6
6
  mandatory?: boolean;
7
7
  }
8
- interface PropertyValueRHFTexfField extends PropertyValueFieldBase {
8
+ interface PropertyValueRHFTexfField extends PropertyValueFieldBase, Pick<RHFTextFieldProps, 'multiline' | 'rows'> {
9
9
  type: 'RHFTexfField';
10
10
  readOnly?: boolean;
11
11
  disabled?: boolean;
@@ -22,6 +22,8 @@ function useDynamicPaperForm(props) {
22
22
  name: field.name,
23
23
  disabled: field.disabled,
24
24
  type: field.textFieldType,
25
+ multiline: field.multiline,
26
+ rows: field.rows,
25
27
  InputProps: {
26
28
  readOnly: field.readOnly
27
29
  }
@@ -0,0 +1 @@
1
+ export * from './useUpdateWindowTitleAndEditionInfoMF';
@@ -0,0 +1,6 @@
1
+ export type ModuleNameField = 'module_name' | 'module_name_add' | 'module_name_edit';
2
+ export interface UseSetWindowPropsMFProps {
3
+ moduleNameField?: ModuleNameField;
4
+ subtitle?: string;
5
+ editionInfo?: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { UseSetWindowPropsMFProps } from './types';
2
+ /**
3
+ * Hook para actualizar el titulo y el subtitulo de la ventana del microfrontend
4
+ * Cuando se actualiza o carga el diccionario
5
+ */
6
+ export declare function useUpdateWindowTitleAndEditionInfoMF(props?: UseSetWindowPropsMFProps): void;
@@ -0,0 +1,23 @@
1
+ import { useEffect } from "react";
2
+ import { useFlagsPresent, CommonFlags, useModuleDictionary } from "@m4l/core";
3
+ import { useWindowToolsMF } from "@m4l/components";
4
+ function useUpdateWindowTitleAndEditionInfoMF(props) {
5
+ const { moduleNameField: dictionaryIdForName = "module_name", subtitle, editionInfo } = props || {};
6
+ const isFlagPresent = useFlagsPresent([CommonFlags.FLAG_DICTIONARY_LOADED]);
7
+ const { getLabel } = useModuleDictionary();
8
+ const { setWindowTitle, setWindowSubTitle, setWindowEditionInfo } = useWindowToolsMF();
9
+ useEffect(() => {
10
+ if (isFlagPresent) {
11
+ setWindowTitle(getLabel(dictionaryIdForName));
12
+ if (subtitle) {
13
+ setWindowSubTitle(subtitle);
14
+ }
15
+ if (editionInfo) {
16
+ setWindowEditionInfo(editionInfo);
17
+ }
18
+ }
19
+ }, [getLabel, isFlagPresent, subtitle, editionInfo]);
20
+ }
21
+ export {
22
+ useUpdateWindowTitleAndEditionInfoMF as u
23
+ };
@@ -18,7 +18,10 @@ function MasterDetailLayout(props) {
18
18
  moduleActions,
19
19
  version,
20
20
  buildTime,
21
- splitPosition
21
+ splitPosition,
22
+ moduleNameField,
23
+ subtitle,
24
+ editionInfo
22
25
  } = props;
23
26
  const { host_static_assets, environment_assets } = useEnvironment();
24
27
  const [splitPositionState, setSplitPositionState] = useState(splitPosition ?? "vertical");
@@ -100,6 +103,9 @@ function MasterDetailLayout(props) {
100
103
  moduleActions: finalModuleActions,
101
104
  version,
102
105
  buildTime,
106
+ moduleNameField,
107
+ subtitle,
108
+ editionInfo,
103
109
  children: /* @__PURE__ */ jsx(
104
110
  SplitLayout,
105
111
  {
@@ -3,8 +3,9 @@ import { ModalProvider } from "@m4l/components";
3
3
  import { forwardRef, useRef, useImperativeHandle } from "react";
4
4
  import { B as BaseModuleLayout } from "./subcomponents/BaseModuleLayout/index.js";
5
5
  import { a as ModuleProvider } from "./contexts/ModuleContext/index.js";
6
+ import { u as useUpdateWindowTitleAndEditionInfoMF } from "../../hooks/useUpdateWindowTitleAndEditionInfoMF/useUpdateWindowTitleAndEditionInfoMF.js";
6
7
  const ModuleLayout = forwardRef((props, ref) => {
7
- const { moduleId, moduleActions, version, children, buildTime } = props;
8
+ const { moduleId, moduleActions, version, children, buildTime, moduleNameField, subtitle, editionInfo } = props;
8
9
  const moduleRef = useRef(null);
9
10
  const closeModal = () => {
10
11
  moduleRef.current?.closeModal();
@@ -17,6 +18,11 @@ const ModuleLayout = forwardRef((props, ref) => {
17
18
  closeModal,
18
19
  current: moduleRef.current
19
20
  }));
21
+ useUpdateWindowTitleAndEditionInfoMF({
22
+ moduleNameField,
23
+ subtitle,
24
+ editionInfo
25
+ });
20
26
  return /* @__PURE__ */ jsx(
21
27
  ModuleProvider,
22
28
  {
@@ -5,6 +5,7 @@ import { ModuleLayoutSlots } from './slots/ModuleLayoutEnum';
5
5
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
6
6
  import { MODULE_LAYOUT_KEY } from './constants';
7
7
  import { Theme } from '@mui/material/styles';
8
+ import { ModuleNameField } from '../../hooks/useUpdateWindowTitleAndEditionInfoMF/types';
8
9
  export interface ContainerProps {
9
10
  vertical: boolean;
10
11
  }
@@ -19,6 +20,9 @@ export interface ModuleLayoutProps {
19
20
  children: ReactNode;
20
21
  version: string;
21
22
  buildTime?: string;
23
+ moduleNameField?: ModuleNameField;
24
+ subtitle?: string;
25
+ editionInfo?: string;
22
26
  }
23
27
  export type ModuleLayoutSlotsType = keyof typeof ModuleLayoutSlots;
24
28
  export type ModuleLayoutStyles = OverridesStyleRules<ModuleLayoutSlotsType, typeof MODULE_LAYOUT_KEY, Theme>;
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "9.3.3-beta.1",
3
+ "version": "9.3.4-13062025.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.2.58-beta.1",
10
+ "@m4l/components": "9.2.60-13062025.beta.1",
11
11
  "@m4l/core": "^2.0.0",
12
- "@m4l/graphics": "^7.0.0",
13
- "@m4l/styles": "^7.0.0"
12
+ "@m4l/graphics": "7.1.2-13062025.beta.1",
13
+ "@m4l/styles": "7.1.29-13062025.beta.1"
14
14
  },
15
15
  "resolutions": {
16
16
  "glob": "^10.4.5",
17
- "react": "^18.0.0",
18
- "@types/react": "^18.0.0",
19
- "@types/react-dom": "^18.0.0",
20
- "react-dom": "^18.0.0",
17
+ "react": "18.3.1",
18
+ "@types/react": "18.3.23",
19
+ "@types/react-dom": "18.3.7",
20
+ "react-dom": "18.3.1",
21
21
  "@vitejs/plugin-react": "^4.0.0",
22
22
  "storybook": "^8.3.4"
23
23
  },
24
24
  "overrides": {
25
25
  "glob": "^10.4.5",
26
- "eslint": "^9.0.0",
27
- "react": "^18.0.0",
28
- "@types/react": "^18.0.0",
29
- "@types/react-dom": "^18.0.0",
30
- "react-dom": "^18.0.0"
26
+ "eslint": "9.28.0",
27
+ "react": "18.3.1",
28
+ "@types/react": "18.3.23",
29
+ "@types/react-dom": "18.3.7",
30
+ "react-dom": "18.3.1"
31
31
  },
32
32
  "files": [
33
33
  "*"
@@ -1,5 +0,0 @@
1
- import { MFWindowsTitleProps } from './types';
2
- /**
3
- * Titulo de la ventana del microfrontend
4
- */
5
- export declare function MFWindowsTitle({ isAddEditModule, children }: MFWindowsTitleProps): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Fragment } from "react";
3
- import { useSetWindowsTitle } from "@m4l/components";
4
- function MFWindowsTitle({ isAddEditModule = false, children }) {
5
- useSetWindowsTitle({ isAddEditModule });
6
- return /* @__PURE__ */ jsx(Fragment, { children });
7
- }
8
- export {
9
- MFWindowsTitle as M
10
- };
@@ -1 +0,0 @@
1
- export * from './MFWindowsTitle';
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface MFWindowsTitleProps {
3
- isAddEditModule: boolean;
4
- children: ReactNode;
5
- }