@m4l/layouts 0.1.44 → 0.1.46

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.
@@ -1,5 +1,6 @@
1
1
  import { ModalProvider } from "@m4l/components";
2
2
  import { FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, ModulePrivilegesProvider } from "@m4l/core";
3
+ import { useLocales } from "@m4l/graphics";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  function BaseModule(props) {
5
6
  const {
@@ -10,12 +11,14 @@ function BaseModule(props) {
10
11
  privileges,
11
12
  componentsDictionary
12
13
  } = props;
14
+ const localeString = useLocales().currentLocale?.localeString;
13
15
  return /* @__PURE__ */ jsx(FlagsProvider, {
14
16
  children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
15
17
  isAuth: true,
16
18
  moduleId,
17
19
  moduleNameField,
18
20
  componentsDictionary,
21
+ currentLang: localeString,
19
22
  children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
20
23
  flags: skeletonFlags,
21
24
  children: /* @__PURE__ */ jsx(ModulePrivilegesProvider, {
@@ -2,7 +2,7 @@ import { unstable_HistoryRouter } from "react-router-dom";
2
2
  import { EnvironmentProvider, HostToolsProvider, NetworkProvider, DomainCountryProvider } from "@m4l/core";
3
3
  import { LocalesProvider, HostThemeProvider, FormatterProvider } from "@m4l/graphics";
4
4
  import { WindowToolsMFProvider, DynamicMFParmsProvider } from "@m4l/components";
5
- import { B as BaseModule } from "../BaseModule/index.6309486a.js";
5
+ import { B as BaseModule } from "../BaseModule/index.6659c50e.js";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  function MFHostApp(props) {
8
8
  const {
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useCallback } from "react";
2
2
  import { unstable_HistoryRouter } from "react-router-dom";
3
- import { ToastContainer, toast } from "react-toastify";
3
+ import { toast } from "react-toastify";
4
4
  import { HostThemeProvider, GlobalStyles, FormatterProvider, LocalesProvider, getLocaleFromNetwork } from "@m4l/graphics";
5
5
  import { A as AuthProvider } from "../../contexts/AuthContext/index.6f966215.js";
6
6
  import { DomainCountryProvider, EnvironmentProvider, HostToolsProvider, NetworkProvider, axiosOperation } from "@m4l/core";
@@ -9,10 +9,10 @@ import EventEmitter from "eventemitter3";
9
9
  import { format } from "date-fns";
10
10
  import { defaultThemeOptions, fnComponentsOverrides } from "@m4l/styles";
11
11
  import { u as useAuth } from "../../hooks/useAuth/index.cb6a3420.js";
12
+ import { ToastContainer, AreasProvider } from "@m4l/components";
12
13
  import { jsx, jsxs } from "react/jsx-runtime";
13
14
  import NProgress from "nprogress";
14
- import { B as BaseModule } from "../BaseModule/index.6309486a.js";
15
- import { AreasProvider } from "@m4l/components";
15
+ import { B as BaseModule } from "../BaseModule/index.6659c50e.js";
16
16
  function MFAuthApp(props) {
17
17
  const {
18
18
  children,
@@ -52,7 +52,7 @@ function MFAuthApp(props) {
52
52
  hostThemeOptions: defaultThemeOptions,
53
53
  fnComponentsOverrides,
54
54
  isMicroFrontEnd: true,
55
- children: [/* @__PURE__ */ jsx(ToastContainer, {}), /* @__PURE__ */ jsx(GlobalStyles, {}), /* @__PURE__ */ jsx(DomainCountryProvider, {
55
+ children: [/* @__PURE__ */ jsx(GlobalStyles, {}), /* @__PURE__ */ jsx(DomainCountryProvider, {
56
56
  ...domianCountry,
57
57
  isMicroFrontEnd: false,
58
58
  children: /* @__PURE__ */ jsx(FormatterProvider, {
@@ -64,7 +64,9 @@ function MFAuthApp(props) {
64
64
  code: domianCountry.currency,
65
65
  decimalDigits: domianCountry.currency_decimal_digits
66
66
  },
67
- children
67
+ children: /* @__PURE__ */ jsx(ToastContainer, {
68
+ children
69
+ })
68
70
  })
69
71
  })]
70
72
  });
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { MFNoAuthAppProps } from './types';
3
+ export declare function MFNoAuthApp(props: MFNoAuthAppProps): import("react").JSX.Element;
4
+ export default MFNoAuthApp;
@@ -0,0 +1,8 @@
1
+ import { Formatters } from '@m4l/graphics';
2
+ import { WindowToolsMF } from '@m4l/components';
3
+ import { BaseModuleProps } from '../BaseModule/types';
4
+ export interface ByHostProps {
5
+ formatters: Formatters;
6
+ windowTools: WindowToolsMF;
7
+ }
8
+ export declare type MFNoAuthAppProps = ByHostProps & BaseModuleProps;
@@ -0,0 +1,41 @@
1
+ import { DomainCountryProvider } from "@m4l/core";
2
+ import { FormatterProvider } from "@m4l/graphics";
3
+ import { B as BaseModule } from "./BaseModule/index.6659c50e.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function MFNoAuthApp(props) {
6
+ const {
7
+ children,
8
+ formatters,
9
+ moduleId,
10
+ moduleNameField,
11
+ skeletonFlags,
12
+ privileges,
13
+ componentsDictionary
14
+ } = props;
15
+ const domianCountry = {
16
+ id: 1,
17
+ currency: "USD",
18
+ currency_decimal_digits: 2,
19
+ decimal_symbol: ".",
20
+ thousands_symbol: ","
21
+ };
22
+ return /* @__PURE__ */ jsx(DomainCountryProvider, {
23
+ isMicroFrontEnd: true,
24
+ ...domianCountry,
25
+ children: /* @__PURE__ */ jsx(BaseModule, {
26
+ moduleId,
27
+ moduleNameField,
28
+ componentsDictionary,
29
+ skeletonFlags,
30
+ privileges,
31
+ children: /* @__PURE__ */ jsx(FormatterProvider, {
32
+ isMicroFrontEnd: true,
33
+ ...formatters,
34
+ children
35
+ })
36
+ })
37
+ });
38
+ }
39
+ export {
40
+ MFNoAuthApp as M
41
+ };
@@ -1,4 +1,5 @@
1
1
  export { MFIsolationApp } from './MFIsolationApp';
2
+ export { MFNoAuthApp } from './MFNoAuthApp';
2
3
  export { MFHostApp } from './MFHostApp';
3
4
  export { BaseModule } from './BaseModule';
4
5
  export type { ByHostProps } from './MFHostApp/types';
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.f91d39eb.js";
2
+ import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.748f7ada.js";
3
3
  const useMasterDetail = () => useContext(MasterDetailContext);
4
4
  export {
5
5
  useMasterDetail as u
package/index.js CHANGED
@@ -1,11 +1,12 @@
1
- import { M } from "./components/MFIsolationApp/index.e36cf308.js";
2
- import { M as M2 } from "./components/MFHostApp/index.420c2626.js";
3
- import { B } from "./components/BaseModule/index.6309486a.js";
1
+ import { M } from "./components/MFIsolationApp/index.43c26757.js";
2
+ import { M as M2 } from "./components/index.2a8eff7c.js";
3
+ import { M as M3 } from "./components/MFHostApp/index.dbfb66ee.js";
4
+ import { B } from "./components/BaseModule/index.6659c50e.js";
4
5
  import { a, A } from "./contexts/AuthContext/index.6f966215.js";
5
6
  import { a as a2, d, g } from "./layouts/ModuleLayout/index.e7218171.js";
6
- import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.f91d39eb.js";
7
+ import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.748f7ada.js";
7
8
  import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.7ba635bb.js";
8
- import { u } from "./hooks/useMasterDetail/index.4ab110ce.js";
9
+ import { u } from "./hooks/useMasterDetail/index.d45f2a86.js";
9
10
  import { u as u2 } from "./hooks/useAuth/index.cb6a3420.js";
10
11
  import { u as u3 } from "./hooks/useModule/index.b5f598b1.js";
11
12
  import "react";
@@ -17,9 +18,9 @@ import "history";
17
18
  import "eventemitter3";
18
19
  import "date-fns";
19
20
  import "@m4l/styles";
21
+ import "@m4l/components";
20
22
  import "react/jsx-runtime";
21
23
  import "nprogress";
22
- import "@m4l/components";
23
24
  import "@mui/material/styles";
24
25
  import "@mui/material";
25
26
  import "@mui/base";
@@ -27,8 +28,9 @@ export {
27
28
  a as AuthContext,
28
29
  A as AuthProvider,
29
30
  B as BaseModule,
30
- M2 as MFHostApp,
31
+ M3 as MFHostApp,
31
32
  M as MFIsolationApp,
33
+ M2 as MFNoAuthApp,
32
34
  a3 as MasterDetailLayout,
33
35
  a2 as ModuleLayout,
34
36
  N as NoAuthModuleLayout,
@@ -46,8 +46,8 @@ const useMasterDetailLayoutUtilityClasses = () => {
46
46
  const MasterDetailLayoutRoot = styled("div")(({ theme }) => ({
47
47
  ...theme.components?.M4LMasterDetailLayout?.styleOverrides
48
48
  }));
49
- function getTotalModuleActions(splitActions, moduleActions = [], viewDetailAction, isDesktop) {
50
- let totalActions = isDesktop !== void 0 && isDesktop ? [...splitActions] : [viewDetailAction];
49
+ function getTotalModuleActions(splitActions, moduleActions = []) {
50
+ let totalActions = [...splitActions];
51
51
  totalActions = moduleActions.concat(totalActions);
52
52
  return totalActions;
53
53
  }
@@ -113,22 +113,10 @@ function MasterDetailLayout(props) {
113
113
  )
114
114
  });
115
115
  }, [detailComponent, getLabel]);
116
- const viewDetailAction = useMemo(() => {
117
- return {
118
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
119
- onClick: onClickViewDetail,
120
- disabled: false,
121
- visibility: "normal",
122
- label: getLabel("master_detail_layout.view_detail"),
123
- tag: "none",
124
- className: "",
125
- key: "detail"
126
- };
127
- }, [environment_assets, onClickViewDetail]);
128
116
  const finalModuleActions = useMemo(() => {
129
- const actions = getTotalModuleActions(splitActions, moduleActions, viewDetailAction, isDesktop);
117
+ const actions = getTotalModuleActions(splitActions, moduleActions);
130
118
  return actions;
131
- }, [splitActions, moduleActions, isDesktop, viewDetailAction]);
119
+ }, [splitActions, moduleActions]);
132
120
  const classes = useMasterDetailLayoutUtilityClasses();
133
121
  return /* @__PURE__ */ jsx(MasterDetailProvider, {
134
122
  onClickViewDetail,
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.44",
3
+ "version": "0.1.46",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",
@@ -1,6 +0,0 @@
1
- import "./MFIsolationApp/index.e36cf308.js";
2
- import "react-router-dom";
3
- import "@m4l/core";
4
- import "@m4l/graphics";
5
- import "@m4l/components";
6
- import "react/jsx-runtime";
@@ -1 +0,0 @@
1
- import "./AuthContext/index.6f966215.js";
@@ -1,4 +0,0 @@
1
- import "react";
2
- import "../layouts/MasterDetailLayout/index.f91d39eb.js";
3
- import "../contexts/AuthContext/index.6f966215.js";
4
- import "../layouts/ModuleLayout/index.e7218171.js";
@@ -1,8 +0,0 @@
1
- import "./ModuleLayout/index.e7218171.js";
2
- import "@m4l/components";
3
- import "react";
4
- import "@m4l/core";
5
- import "./MasterDetailLayout/index.f91d39eb.js";
6
- import "@m4l/graphics";
7
- import "react/jsx-runtime";
8
- import "./NoAuthModuleLayout/index.7ba635bb.js";