@m4l/layouts 0.1.43 → 0.1.44

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,4 +1,4 @@
1
1
  import "react";
2
- import "../layouts/MasterDetailLayout/index.fe6ac47b.js";
2
+ import "../layouts/MasterDetailLayout/index.f91d39eb.js";
3
3
  import "../contexts/AuthContext/index.6f966215.js";
4
4
  import "../layouts/ModuleLayout/index.e7218171.js";
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.fe6ac47b.js";
2
+ import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.f91d39eb.js";
3
3
  const useMasterDetail = () => useContext(MasterDetailContext);
4
4
  export {
5
5
  useMasterDetail as u
package/index.js CHANGED
@@ -3,9 +3,9 @@ import { M as M2 } from "./components/MFHostApp/index.420c2626.js";
3
3
  import { B } from "./components/BaseModule/index.6309486a.js";
4
4
  import { a, A } from "./contexts/AuthContext/index.6f966215.js";
5
5
  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.fe6ac47b.js";
7
- import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.82656886.js";
8
- import { u } from "./hooks/useMasterDetail/index.be4908d9.js";
6
+ import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.f91d39eb.js";
7
+ import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.7ba635bb.js";
8
+ import { u } from "./hooks/useMasterDetail/index.4ab110ce.js";
9
9
  import { u as u2 } from "./hooks/useAuth/index.cb6a3420.js";
10
10
  import { u as u3 } from "./hooks/useModule/index.b5f598b1.js";
11
11
  import "react";
@@ -5,7 +5,8 @@ export interface MasterDetailContextStateProps {
5
5
  }
6
6
  export interface MasterDetailProviderProps {
7
7
  children: ReactNode;
8
+ onClickViewDetail: () => void;
8
9
  }
9
- export interface MasterDetailContextProps extends MasterDetailContextStateProps {
10
+ export interface MasterDetailContextProps extends MasterDetailContextStateProps, Pick<MasterDetailProviderProps, 'onClickViewDetail'> {
10
11
  onChangeMasterSelection: (newMasterSelection: MasterSelecion) => void;
11
12
  }
@@ -8,18 +8,21 @@ import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/mater
8
8
  import { unstable_composeClasses } from "@mui/base";
9
9
  const initialState = {
10
10
  masterSelection: void 0,
11
- onChangeMasterSelection: voidFunction
11
+ onChangeMasterSelection: voidFunction,
12
+ onClickViewDetail: voidFunction
12
13
  };
13
14
  const MasterDetailContext = createContext(initialState);
14
15
  function MasterDetailProvider(props) {
15
16
  const {
16
- children
17
+ children,
18
+ onClickViewDetail
17
19
  } = props;
18
20
  const [masterSelection, setMasterSelection] = useState(void 0);
19
21
  return /* @__PURE__ */ jsx(MasterDetailContext.Provider, {
20
22
  value: {
21
23
  masterSelection,
22
- onChangeMasterSelection: setMasterSelection
24
+ onChangeMasterSelection: setMasterSelection,
25
+ onClickViewDetail
23
26
  },
24
27
  children
25
28
  });
@@ -115,7 +118,7 @@ function MasterDetailLayout(props) {
115
118
  urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
116
119
  onClick: onClickViewDetail,
117
120
  disabled: false,
118
- visibility: "allways",
121
+ visibility: "normal",
119
122
  label: getLabel("master_detail_layout.view_detail"),
120
123
  tag: "none",
121
124
  className: "",
@@ -128,6 +131,7 @@ function MasterDetailLayout(props) {
128
131
  }, [splitActions, moduleActions, isDesktop, viewDetailAction]);
129
132
  const classes = useMasterDetailLayoutUtilityClasses();
130
133
  return /* @__PURE__ */ jsx(MasterDetailProvider, {
134
+ onClickViewDetail,
131
135
  children: /* @__PURE__ */ jsx(MasterDetailLayoutRoot, {
132
136
  className: classes.root,
133
137
  children: /* @__PURE__ */ jsx(ModuleLayout, {
@@ -1,8 +1,8 @@
1
1
  import { useResponsiveDesktop, useLocales } from "@m4l/graphics";
2
- import { LanguagePopover, Image, Typography, ScrollBar, HelmetPage } from "@m4l/components";
2
+ import { LanguagePopover, IconButton, Image, Typography, Stack, ScrollBar, HelmetPage } from "@m4l/components";
3
3
  import { styled, alpha } from "@mui/material/styles";
4
4
  import { useBase, useModuleDictionary, useDomain, useEnvironment, BaseProvider, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider } from "@m4l/core";
5
- import { jsxs, jsx } from "react/jsx-runtime";
5
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
6
6
  const InnerModuleRoot = styled("div")(({
7
7
  theme
8
8
  }) => ({
@@ -33,6 +33,12 @@ const DesktopContentRoot = styled("div")(({ theme }) => ({
33
33
  top: "20px",
34
34
  right: "20px",
35
35
  zIndex: 1
36
+ },
37
+ "& .M4LIconButton-root.config-icon": {
38
+ position: "absolute",
39
+ top: "22px",
40
+ right: "56px",
41
+ zIndex: 1
36
42
  }
37
43
  }));
38
44
  const DesktopBanner = styled("div")(({ theme }) => ({
@@ -117,7 +123,8 @@ styled("div")(() => ({
117
123
  const DesktopContent = () => {
118
124
  const {
119
125
  children,
120
- companyLogoSmallUrl
126
+ companyLogoSmallUrl,
127
+ handleSetting
121
128
  } = useBase();
122
129
  const {
123
130
  getLabel
@@ -126,8 +133,16 @@ const DesktopContent = () => {
126
133
  name,
127
134
  slogan
128
135
  } = useDomain();
136
+ const {
137
+ host_static_assets,
138
+ environment_assets
139
+ } = useEnvironment();
129
140
  return /* @__PURE__ */ jsxs(DesktopContentRoot, {
130
- children: [/* @__PURE__ */ jsx(LanguagePopover, {}), /* @__PURE__ */ jsxs(DesktopBanner, {
141
+ children: [/* @__PURE__ */ jsx(LanguagePopover, {}), /* @__PURE__ */ jsx(IconButton, {
142
+ src: `${host_static_assets}/${environment_assets}/frontend/components/account_popover/assets/icons/configuration.svg`,
143
+ onClick: handleSetting,
144
+ className: "config-icon"
145
+ }), /* @__PURE__ */ jsxs(DesktopBanner, {
131
146
  children: [/* @__PURE__ */ jsx(ContainerLogo$1, {
132
147
  children: /* @__PURE__ */ jsx(Image, {
133
148
  src: companyLogoSmallUrl,
@@ -174,7 +189,15 @@ const DesktopContent = () => {
174
189
  skeletongHeight: "20px",
175
190
  children: getLabel("module_description")
176
191
  })]
177
- }), children]
192
+ }), /* @__PURE__ */ jsx(Stack, {
193
+ direction: "column",
194
+ height: "auto",
195
+ children: /* @__PURE__ */ jsx(ScrollBar, {
196
+ children: /* @__PURE__ */ jsx(Fragment, {
197
+ children
198
+ })
199
+ })
200
+ })]
178
201
  })
179
202
  })]
180
203
  });
@@ -201,7 +224,17 @@ const MobileBanner = styled("div")(({ theme }) => ({
201
224
  "& .M4LanguagePopover-root": {
202
225
  position: "absolute",
203
226
  top: "12px",
204
- right: "12px"
227
+ right: "12px",
228
+ zIndex: 1
229
+ },
230
+ "& .M4LIconButton-root.config-icon": {
231
+ position: "absolute",
232
+ top: "8px",
233
+ right: "40px",
234
+ zIndex: 1,
235
+ "& .M4LIcon-root .M4LIcon-icon": {
236
+ backgroundColor: theme.palette.patronus?.marbleLight[10]
237
+ }
205
238
  },
206
239
  "& .MuiTypography-root": {
207
240
  color: theme.palette.patronus?.marbleLight[10],
@@ -258,11 +291,16 @@ const ContainerModuleName = styled("div")(() => ({
258
291
  const MobileContent = () => {
259
292
  const {
260
293
  children,
261
- companyLogoSmallUrl
294
+ companyLogoSmallUrl,
295
+ handleSetting
262
296
  } = useBase();
263
297
  const {
264
298
  getLabel
265
299
  } = useModuleDictionary();
300
+ const {
301
+ host_static_assets,
302
+ environment_assets
303
+ } = useEnvironment();
266
304
  const {
267
305
  name
268
306
  } = useDomain();
@@ -287,6 +325,10 @@ const MobileContent = () => {
287
325
  skeletongHeight: "20px",
288
326
  children: getLabel("company_name_subtitle")
289
327
  })]
328
+ }), /* @__PURE__ */ jsx(IconButton, {
329
+ src: `${host_static_assets}/${environment_assets}/frontend/components/account_popover/assets/icons/configuration.svg`,
330
+ onClick: handleSetting,
331
+ className: "config-icon"
290
332
  }), /* @__PURE__ */ jsx(LanguagePopover, {})]
291
333
  }), /* @__PURE__ */ jsx(WrapperFormContent, {
292
334
  children: /* @__PURE__ */ jsx(ScrollBar, {
@@ -320,8 +362,11 @@ const InnerModule = () => {
320
362
  return /* @__PURE__ */ jsx(HelmetPage, {
321
363
  title: getModuleLabel(),
322
364
  subtitle,
323
- children: /* @__PURE__ */ jsx(InnerModuleRoot, {
324
- children: isDesktop ? /* @__PURE__ */ jsx(DesktopContent, {}) : /* @__PURE__ */ jsx(MobileContent, {})
365
+ children: /* @__PURE__ */ jsx(Fragment, {
366
+ children: /* @__PURE__ */ jsx(InnerModuleRoot, {
367
+ id: "modulerootnouth",
368
+ children: isDesktop ? /* @__PURE__ */ jsx(DesktopContent, {}) : /* @__PURE__ */ jsx(MobileContent, {})
369
+ })
325
370
  })
326
371
  });
327
372
  };
@@ -335,7 +380,8 @@ const NoAuthModuleLayout = (props) => {
335
380
  subtitle,
336
381
  companyLogoSmallUrl,
337
382
  companyLogoNormalUrl,
338
- moduleIlustrationUrl
383
+ moduleIlustrationUrl,
384
+ handleSetting
339
385
  } = props;
340
386
  const {
341
387
  host_static_assets,
@@ -355,7 +401,8 @@ const NoAuthModuleLayout = (props) => {
355
401
  companyLogoSmallUrl: finalCompanyLogoSmallUrl,
356
402
  companyLogoNormalUrl: finalCompanyLogoNormalUrl,
357
403
  moduleIlustrationUrl: finalIllustrationUrl,
358
- children
404
+ children,
405
+ handleSetting
359
406
  },
360
407
  children: /* @__PURE__ */ jsx(FlagsProvider, {
361
408
  children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
@@ -9,6 +9,7 @@ export declare interface NoAuthBaseProviderProps {
9
9
  companyLogoNormalUrl: string;
10
10
  moduleIlustrationUrl?: string;
11
11
  children: ReactNode;
12
+ handleSetting?: () => void;
12
13
  }
13
14
  export interface NoAuthModuleLayoutProps extends NoAuthBaseProviderProps {
14
15
  moduleId: string;
@@ -2,7 +2,7 @@ import "./ModuleLayout/index.e7218171.js";
2
2
  import "@m4l/components";
3
3
  import "react";
4
4
  import "@m4l/core";
5
- import "./MasterDetailLayout/index.fe6ac47b.js";
5
+ import "./MasterDetailLayout/index.f91d39eb.js";
6
6
  import "@m4l/graphics";
7
7
  import "react/jsx-runtime";
8
- import "./NoAuthModuleLayout/index.82656886.js";
8
+ import "./NoAuthModuleLayout/index.7ba635bb.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",