@m4l/layouts 0.1.42 → 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.2808fa44.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 }) => ({
@@ -93,6 +99,7 @@ const FormContent$1 = styled("div")(() => ({
93
99
  padding: "0 60px 0 80px",
94
100
  margin: "auto 0",
95
101
  width: "100%",
102
+ height: "auto",
96
103
  gap: "20px"
97
104
  }));
98
105
  const WrapperFormContent$1 = styled("div")(() => ({
@@ -106,10 +113,18 @@ const ContainerModuleName$1 = styled("div")(() => ({
106
113
  width: "100%",
107
114
  gap: "4px"
108
115
  }));
116
+ styled("div")(() => ({
117
+ display: "flex",
118
+ width: "100%",
119
+ height: "100%",
120
+ justifyContent: "center",
121
+ alignItems: "center"
122
+ }));
109
123
  const DesktopContent = () => {
110
124
  const {
111
125
  children,
112
- companyLogoSmallUrl
126
+ companyLogoSmallUrl,
127
+ handleSetting
113
128
  } = useBase();
114
129
  const {
115
130
  getLabel
@@ -118,8 +133,16 @@ const DesktopContent = () => {
118
133
  name,
119
134
  slogan
120
135
  } = useDomain();
136
+ const {
137
+ host_static_assets,
138
+ environment_assets
139
+ } = useEnvironment();
121
140
  return /* @__PURE__ */ jsxs(DesktopContentRoot, {
122
- 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, {
123
146
  children: [/* @__PURE__ */ jsx(ContainerLogo$1, {
124
147
  children: /* @__PURE__ */ jsx(Image, {
125
148
  src: companyLogoSmallUrl,
@@ -153,22 +176,28 @@ const DesktopContent = () => {
153
176
  })]
154
177
  })]
155
178
  }), /* @__PURE__ */ jsx(WrapperFormContent$1, {
156
- children: /* @__PURE__ */ jsx(ScrollBar, {
157
- children: /* @__PURE__ */ jsxs(FormContent$1, {
158
- children: [/* @__PURE__ */ jsxs(ContainerModuleName$1, {
159
- children: [/* @__PURE__ */ jsx(Typography, {
160
- variant: "h5",
161
- skeletonWidth: "20%",
162
- skeletongHeight: "36px",
163
- children: getLabel("module_name")
164
- }), /* @__PURE__ */ jsx(Typography, {
165
- variant: "paragraph",
166
- skeletonWidth: "40%",
167
- skeletongHeight: "20px",
168
- children: getLabel("module_description")
169
- })]
170
- }), children]
171
- })
179
+ children: /* @__PURE__ */ jsxs(FormContent$1, {
180
+ children: [/* @__PURE__ */ jsxs(ContainerModuleName$1, {
181
+ children: [/* @__PURE__ */ jsx(Typography, {
182
+ variant: "h5",
183
+ skeletonWidth: "20%",
184
+ skeletongHeight: "36px",
185
+ children: getLabel("module_name")
186
+ }), /* @__PURE__ */ jsx(Typography, {
187
+ variant: "paragraph",
188
+ skeletonWidth: "40%",
189
+ skeletongHeight: "20px",
190
+ children: getLabel("module_description")
191
+ })]
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
+ })]
172
201
  })
173
202
  })]
174
203
  });
@@ -195,7 +224,17 @@ const MobileBanner = styled("div")(({ theme }) => ({
195
224
  "& .M4LanguagePopover-root": {
196
225
  position: "absolute",
197
226
  top: "12px",
198
- 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
+ }
199
238
  },
200
239
  "& .MuiTypography-root": {
201
240
  color: theme.palette.patronus?.marbleLight[10],
@@ -252,11 +291,16 @@ const ContainerModuleName = styled("div")(() => ({
252
291
  const MobileContent = () => {
253
292
  const {
254
293
  children,
255
- companyLogoSmallUrl
294
+ companyLogoSmallUrl,
295
+ handleSetting
256
296
  } = useBase();
257
297
  const {
258
298
  getLabel
259
299
  } = useModuleDictionary();
300
+ const {
301
+ host_static_assets,
302
+ environment_assets
303
+ } = useEnvironment();
260
304
  const {
261
305
  name
262
306
  } = useDomain();
@@ -281,6 +325,10 @@ const MobileContent = () => {
281
325
  skeletongHeight: "20px",
282
326
  children: getLabel("company_name_subtitle")
283
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"
284
332
  }), /* @__PURE__ */ jsx(LanguagePopover, {})]
285
333
  }), /* @__PURE__ */ jsx(WrapperFormContent, {
286
334
  children: /* @__PURE__ */ jsx(ScrollBar, {
@@ -314,8 +362,11 @@ const InnerModule = () => {
314
362
  return /* @__PURE__ */ jsx(HelmetPage, {
315
363
  title: getModuleLabel(),
316
364
  subtitle,
317
- children: /* @__PURE__ */ jsx(InnerModuleRoot, {
318
- 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
+ })
319
370
  })
320
371
  });
321
372
  };
@@ -329,7 +380,8 @@ const NoAuthModuleLayout = (props) => {
329
380
  subtitle,
330
381
  companyLogoSmallUrl,
331
382
  companyLogoNormalUrl,
332
- moduleIlustrationUrl
383
+ moduleIlustrationUrl,
384
+ handleSetting
333
385
  } = props;
334
386
  const {
335
387
  host_static_assets,
@@ -349,7 +401,8 @@ const NoAuthModuleLayout = (props) => {
349
401
  companyLogoSmallUrl: finalCompanyLogoSmallUrl,
350
402
  companyLogoNormalUrl: finalCompanyLogoNormalUrl,
351
403
  moduleIlustrationUrl: finalIllustrationUrl,
352
- children
404
+ children,
405
+ handleSetting
353
406
  },
354
407
  children: /* @__PURE__ */ jsx(FlagsProvider, {
355
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.2808fa44.js";
8
+ import "./NoAuthModuleLayout/index.7ba635bb.js";
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
- "@mui/material": "5.10.4",
7
6
  "@m4l/components": "*",
8
7
  "@m4l/core": "*",
9
8
  "@m4l/graphics": "*",
10
- "@m4l/styles": "*"
9
+ "@m4l/styles": "*",
10
+ "@mui/material": "5.10.4"
11
11
  },
12
12
  "peerDependencies": {
13
13
  "@types/react": "^17.0.0 || ^18.0.0",