@m4l/layouts 0.0.13 → 0.0.16
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.
- package/dist/layouts/MasterDetailLayout/index.js +3 -1
- package/dist/layouts/ModuleLayout/contexts/ModuleContext/types.d.ts +1 -1
- package/dist/layouts/ModuleLayout/index.js +17 -13
- package/dist/layouts/ModuleLayout/types.d.ts +2 -1
- package/dist/layouts/NoAuthModuleLayout/contexts/NoAuthModuleContext/types.d.ts +1 -1
- package/dist/layouts/NoAuthModuleLayout/index.js +1 -1
- package/dist/layouts/NoAuthModuleLayout/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -68,7 +68,8 @@ function MasterDetailLayout(props) {
|
|
|
68
68
|
urlIcon,
|
|
69
69
|
masterComponent,
|
|
70
70
|
componentsDictionary,
|
|
71
|
-
breadcrumbLinks
|
|
71
|
+
breadcrumbLinks,
|
|
72
|
+
privileges
|
|
72
73
|
} = props;
|
|
73
74
|
const {
|
|
74
75
|
host_static_assets,
|
|
@@ -150,6 +151,7 @@ function MasterDetailLayout(props) {
|
|
|
150
151
|
moduleNameField,
|
|
151
152
|
urlIcon,
|
|
152
153
|
initialModuleActions: finalModuleActions,
|
|
154
|
+
privileges,
|
|
153
155
|
componentsDictionary: finalComponentsDictionary,
|
|
154
156
|
breadcrumbLinks,
|
|
155
157
|
children: /* @__PURE__ */ jsx(SplitLayout, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoxIcon, Breadcrumbs as Breadcrumbs$1, MenuActions, useModal, ModalProvider, getModalDialogComponentsDictionary } from "@m4l/components";
|
|
2
2
|
import { createContext, useState, useMemo, forwardRef, useRef, useImperativeHandle } from "react";
|
|
3
3
|
import { styled, useTheme } from "@mui/material/styles";
|
|
4
|
-
import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider } from "@m4l/core";
|
|
4
|
+
import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModulePrivilegesProvider } from "@m4l/core";
|
|
5
5
|
import { Skeleton, Typography, IconButton } from "@mui/material";
|
|
6
6
|
import { u as useResponsiveDesktop } from "../../vendor.js";
|
|
7
7
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
@@ -178,7 +178,7 @@ function SKTModuleHeader() {
|
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
const initialState = {
|
|
181
|
-
moduleId:
|
|
181
|
+
moduleId: "",
|
|
182
182
|
moduleNameField: "module_name",
|
|
183
183
|
urlIcon: "",
|
|
184
184
|
moduleActions: [],
|
|
@@ -340,7 +340,8 @@ const ModuleLayout = forwardRef((props, ref) => {
|
|
|
340
340
|
urlIcon,
|
|
341
341
|
children,
|
|
342
342
|
componentsDictionary,
|
|
343
|
-
breadcrumbLinks
|
|
343
|
+
breadcrumbLinks,
|
|
344
|
+
privileges
|
|
344
345
|
} = props;
|
|
345
346
|
const moduleRef = useRef(null);
|
|
346
347
|
const openModal = (modalOpenProps) => {
|
|
@@ -354,16 +355,19 @@ const ModuleLayout = forwardRef((props, ref) => {
|
|
|
354
355
|
children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
|
|
355
356
|
moduleId,
|
|
356
357
|
componentsDictionary,
|
|
357
|
-
children: /* @__PURE__ */ jsx(
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
children
|
|
358
|
+
children: /* @__PURE__ */ jsx(ModulePrivilegesProvider, {
|
|
359
|
+
queryPrivileges: privileges,
|
|
360
|
+
children: /* @__PURE__ */ jsx(ModuleProvider, {
|
|
361
|
+
moduleId,
|
|
362
|
+
urlIcon,
|
|
363
|
+
moduleNameField,
|
|
364
|
+
initialModuleActions,
|
|
365
|
+
breadcrumbLinks,
|
|
366
|
+
children: /* @__PURE__ */ jsx(ModalProvider, {
|
|
367
|
+
children: /* @__PURE__ */ jsx(Module, {
|
|
368
|
+
ref: moduleRef,
|
|
369
|
+
children
|
|
370
|
+
})
|
|
367
371
|
})
|
|
368
372
|
})
|
|
369
373
|
})
|
|
@@ -16,9 +16,10 @@ export interface ModuleAction extends MenuAction {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
}
|
|
18
18
|
export interface ModuleLayoutProps extends HeaderProps {
|
|
19
|
-
moduleId:
|
|
19
|
+
moduleId: string;
|
|
20
20
|
urlIcon: string;
|
|
21
21
|
moduleNameField?: string;
|
|
22
|
+
privileges: string[];
|
|
22
23
|
breadcrumbLinks: TLink[];
|
|
23
24
|
initialModuleActions: ModuleAction[];
|
|
24
25
|
componentsDictionary: string[];
|
|
@@ -4,7 +4,7 @@ export interface DomainStyleOptions {
|
|
|
4
4
|
company_logo_normal_url: string;
|
|
5
5
|
}
|
|
6
6
|
export interface NoAuthModuleLayoutProviderProps {
|
|
7
|
-
moduleId:
|
|
7
|
+
moduleId: string;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export interface NoAuthModuleLayoutContextProps extends Pick<NoAuthModuleLayoutProviderProps, 'moduleId'> {
|
|
@@ -4,7 +4,7 @@ export interface ContainerProps {
|
|
|
4
4
|
}
|
|
5
5
|
export declare type MenuActionType = 'main' | 'allways' | 'normal';
|
|
6
6
|
export interface NoAuthModuleLayoutProps {
|
|
7
|
-
moduleId:
|
|
7
|
+
moduleId: string;
|
|
8
8
|
moduleName?: string;
|
|
9
9
|
componentsDictionary: string[];
|
|
10
10
|
children: ReactNode;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/layouts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.16",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"format": "npm run prettier:fix && npm run lint:fix"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@m4l/components": "^0.0.
|
|
17
|
+
"@m4l/components": "^0.0.38",
|
|
18
18
|
"react": "^17.0.0 || 18.x",
|
|
19
19
|
"react-dom": "^18.0.0"
|
|
20
20
|
},
|