@m4l/layouts 0.1.4 → 0.1.6
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/index.js +6 -9
- package/layouts/MasterDetailLayout/index.js +1 -1
- package/layouts/ModuleLayout/index.js +1 -1
- package/layouts/NoAuthModuleLayout/index.js +21 -12
- package/package.json +1 -1
- package/hooks/useResponsive.d.ts +0 -8
- package/node_modules.js +0 -1
- package/vendor.js +0 -64
package/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
export { a as ModuleLayout, d as defaultModuleLayoutDictionary, g as getModuleLayoutComponentsDictionary } from "./layouts/ModuleLayout/index.js";
|
|
2
|
-
export { a as MasterDetailLayout, d as defaultMasterDetailDictionary, g as getMasterDetailLayoutComponentsDictionary } from "./layouts/MasterDetailLayout/index.js";
|
|
3
|
-
export { N as NoAuthModuleLayout, d as defaultNoAuthModuleLayoutDictionary, g as getNoAuthModuleLayoutComponentsDictionary } from "./layouts/NoAuthModuleLayout/index.js";
|
|
4
|
-
export { u as useMasterDetail } from "./hooks/useMasterDetail/index.js";
|
|
5
|
-
export { u as useModule } from "./hooks/useModule/index.js";
|
|
6
2
|
import "@m4l/components";
|
|
7
3
|
import "react";
|
|
8
|
-
import "@mui/material/styles";
|
|
9
4
|
import "@m4l/core";
|
|
5
|
+
export { a as MasterDetailLayout, d as defaultMasterDetailDictionary, g as getMasterDetailLayoutComponentsDictionary } from "./layouts/MasterDetailLayout/index.js";
|
|
6
|
+
import "@m4l/graphics";
|
|
10
7
|
import "@mui/material";
|
|
11
|
-
import "./vendor.js";
|
|
12
|
-
import "@mui/material/useMediaQuery";
|
|
13
8
|
import "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export { N as NoAuthModuleLayout, d as defaultNoAuthModuleLayoutDictionary, g as getNoAuthModuleLayoutComponentsDictionary } from "./layouts/NoAuthModuleLayout/index.js";
|
|
10
|
+
export { u as useMasterDetail } from "./hooks/useMasterDetail/index.js";
|
|
11
|
+
export { u as useModule } from "./hooks/useModule/index.js";
|
|
12
|
+
import "@mui/material/styles";
|
|
@@ -3,7 +3,7 @@ import { voidFunction, useEnvironment } from "@m4l/core";
|
|
|
3
3
|
import { SplitLayout } from "@m4l/components";
|
|
4
4
|
import { g as getModuleLayoutComponentsDictionary, a as ModuleLayout } from "../ModuleLayout/index.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
7
|
import { Button } from "@mui/material";
|
|
8
8
|
import { u as useMasterDetail } from "../../hooks/useMasterDetail/index.js";
|
|
9
9
|
function getMasterDetailLayoutComponentsDictionary() {
|
|
@@ -3,7 +3,7 @@ import { createContext, useState, useMemo, forwardRef, useRef, useImperativeHand
|
|
|
3
3
|
import { styled, useTheme } from "@mui/material/styles";
|
|
4
4
|
import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, ModulePrivilegesProvider } from "@m4l/core";
|
|
5
5
|
import { Skeleton, Typography, IconButton } from "@mui/material";
|
|
6
|
-
import {
|
|
6
|
+
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
7
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
8
8
|
import { u as useModule } from "../../hooks/useModule/index.js";
|
|
9
9
|
const WrapperModule = styled("div")(() => ({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { useResponsive, useLocales } from "@m4l/graphics";
|
|
1
2
|
import { Page, CompanyLogo, LanguagePopover, Typography, Image } from "@m4l/components";
|
|
2
3
|
import { Card, Container, Stack } from "@mui/material";
|
|
3
4
|
import { styled } from "@mui/material/styles";
|
|
4
|
-
import { useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider } from "@m4l/core";
|
|
5
|
+
import { useModuleDictionary, useFlagsPresent, FlagsProvider, DomainProvider, ModuleDictionaryProvider, ModuleSkeletonProvider } from "@m4l/core";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { a as useResponsive, b as useLocales } from "../../vendor.js";
|
|
7
7
|
const RootStyle = styled("div")(({
|
|
8
8
|
theme
|
|
9
9
|
}) => ({
|
|
@@ -160,17 +160,26 @@ const NoAuthModuleLayout = (props) => {
|
|
|
160
160
|
const {
|
|
161
161
|
currentLang
|
|
162
162
|
} = useLocales();
|
|
163
|
+
const finalSkeletonFlags = skeletonFlags;
|
|
164
|
+
if (finalSkeletonFlags.findIndex((f) => f === "dictionary_loaded") < 0) {
|
|
165
|
+
finalSkeletonFlags.push("dictionary_loaded");
|
|
166
|
+
}
|
|
167
|
+
if (finalSkeletonFlags.findIndex((f) => f === "domain_loaded") < 0) {
|
|
168
|
+
finalSkeletonFlags.push("domain_loaded");
|
|
169
|
+
}
|
|
163
170
|
return /* @__PURE__ */ jsx(FlagsProvider, {
|
|
164
|
-
children: /* @__PURE__ */ jsx(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
children
|
|
171
|
+
children: /* @__PURE__ */ jsx(DomainProvider, {
|
|
172
|
+
children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
|
|
173
|
+
isAuth: false,
|
|
174
|
+
moduleId,
|
|
175
|
+
moduleName,
|
|
176
|
+
componentsDictionary,
|
|
177
|
+
currentLang: currentLang.value,
|
|
178
|
+
children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
|
|
179
|
+
flags: finalSkeletonFlags,
|
|
180
|
+
children: /* @__PURE__ */ jsx(ModuleWrapper, {
|
|
181
|
+
children
|
|
182
|
+
})
|
|
174
183
|
})
|
|
175
184
|
})
|
|
176
185
|
})
|
package/package.json
CHANGED
package/hooks/useResponsive.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Breakpoint } from '@mui/material';
|
|
2
|
-
declare type Query = 'up' | 'down' | 'between' | 'only';
|
|
3
|
-
declare type Key = Breakpoint | number;
|
|
4
|
-
declare type Start = Breakpoint | number;
|
|
5
|
-
declare type End = Breakpoint | number;
|
|
6
|
-
export declare function useResponsive(query: Query, key?: Key, start?: Start, end?: End): boolean | undefined;
|
|
7
|
-
export declare function useResponsiveDesktop(): boolean | undefined;
|
|
8
|
-
export {};
|
package/node_modules.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/vendor.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { useTheme } from "@mui/material/styles";
|
|
2
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
3
|
-
import "@mui/material";
|
|
4
|
-
import "react/jsx-runtime";
|
|
5
|
-
import { createContext, useContext } from "react";
|
|
6
|
-
import "@m4l/core";
|
|
7
|
-
import "@mui/x-date-pickers/AdapterDateFns";
|
|
8
|
-
import "@mui/x-date-pickers";
|
|
9
|
-
import "./layouts/ModuleLayout/index.js";
|
|
10
|
-
import "@m4l/components";
|
|
11
|
-
import "./layouts/MasterDetailLayout/index.js";
|
|
12
|
-
import "./layouts/NoAuthModuleLayout/index.js";
|
|
13
|
-
import "./hooks/useMasterDetail/index.js";
|
|
14
|
-
import "./hooks/useModule/index.js";
|
|
15
|
-
function useResponsive$1(query, key, start, end) {
|
|
16
|
-
const theme = useTheme();
|
|
17
|
-
const mediaUp = useMediaQuery(theme.breakpoints.up(key));
|
|
18
|
-
const mediaDown = useMediaQuery(theme.breakpoints.down(key));
|
|
19
|
-
const mediaBetween = useMediaQuery(theme.breakpoints.between(start, end));
|
|
20
|
-
const mediaOnly = useMediaQuery(theme.breakpoints.only(key));
|
|
21
|
-
if (query === "up") {
|
|
22
|
-
return mediaUp;
|
|
23
|
-
}
|
|
24
|
-
if (query === "down") {
|
|
25
|
-
return mediaDown;
|
|
26
|
-
}
|
|
27
|
-
if (query === "between") {
|
|
28
|
-
return mediaBetween;
|
|
29
|
-
}
|
|
30
|
-
if (query === "only") {
|
|
31
|
-
return mediaOnly;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function useResponsiveDesktop() {
|
|
35
|
-
const isDesktop = useResponsive$1("up", "sm");
|
|
36
|
-
return isDesktop;
|
|
37
|
-
}
|
|
38
|
-
const LocalesContext = createContext(null);
|
|
39
|
-
function useResponsive(query, key, start, end) {
|
|
40
|
-
const theme = useTheme();
|
|
41
|
-
const mediaUp = useMediaQuery(theme.breakpoints.up(key));
|
|
42
|
-
const mediaDown = useMediaQuery(theme.breakpoints.down(key));
|
|
43
|
-
const mediaBetween = useMediaQuery(theme.breakpoints.between(start, end));
|
|
44
|
-
const mediaOnly = useMediaQuery(theme.breakpoints.only(key));
|
|
45
|
-
if (query === "up") {
|
|
46
|
-
return mediaUp;
|
|
47
|
-
}
|
|
48
|
-
if (query === "down") {
|
|
49
|
-
return mediaDown;
|
|
50
|
-
}
|
|
51
|
-
if (query === "between") {
|
|
52
|
-
return mediaBetween;
|
|
53
|
-
}
|
|
54
|
-
if (query === "only") {
|
|
55
|
-
return mediaOnly;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const useLocales = () => {
|
|
59
|
-
const context = useContext(LocalesContext);
|
|
60
|
-
if (!context)
|
|
61
|
-
throw new Error("useLocales context must be use inside LocalesProvider");
|
|
62
|
-
return context;
|
|
63
|
-
};
|
|
64
|
-
export { useResponsive as a, useLocales as b, useResponsiveDesktop as u };
|