@m4l/graphics 3.0.2 → 3.0.3
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/components/GlobalStyle/index-C3p7OfnO.js +82 -0
- package/contexts/FormatterContext/index-Ch6IW7j8.js +74 -0
- package/contexts/HostThemeContext/{index-B8iD1cO8.js → index-BMSwOCtA.js} +19 -23
- package/contexts/LocalesContext/{index--VwMF60R.js → index-C89UlO0s.js} +35 -42
- package/contexts/{index-DqxwPAZr.js → index-DEyJidab.js} +30 -38
- package/hooks/{index-jy_ocazP.js → index-Y3uj_IzK.js} +2 -2
- package/hooks/useFormatter/{index-DfdAcbzw.js → index-BBgQ4lJL.js} +1 -1
- package/hooks/useLocales/{index-mTHn9nqY.js → index-_thMBNE7.js} +1 -1
- package/hooks/useResponsive/{index-P9e5eab1.js → index-Dki-WJi8.js} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/vite-env.d.ts +1 -1
- package/components/GlobalStyle/index-BwMNLyTC.js +0 -79
- package/contexts/FormatterContext/index-BHG3bJJo.js +0 -75
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as o } from "@mui/material/styles";
|
|
3
|
+
import { GlobalStyles as a } from "@mui/material";
|
|
4
|
+
import { globalRemSize as r } from "@m4l/styles";
|
|
5
|
+
function s() {
|
|
6
|
+
const t = o();
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
styles: {
|
|
11
|
+
body: {
|
|
12
|
+
textRendering: "geometricPrecision",
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: "100vh",
|
|
15
|
+
"input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
|
|
16
|
+
color: t.vars.palette.text.primary
|
|
17
|
+
},
|
|
18
|
+
"*::-webkit-scrollbar": {
|
|
19
|
+
// camino de la barra con radio
|
|
20
|
+
width: "7px",
|
|
21
|
+
height: "7px",
|
|
22
|
+
borderRadius: "3px",
|
|
23
|
+
backgroundColor: "transparent"
|
|
24
|
+
},
|
|
25
|
+
"*::-webkit-scrollbar-track": {
|
|
26
|
+
// Camino de la barrra sin radio
|
|
27
|
+
backgroundColor: "transparent",
|
|
28
|
+
border: "0px solid transparent"
|
|
29
|
+
},
|
|
30
|
+
"*::-webkit-scrollbar-corner": {
|
|
31
|
+
backgroundColor: "transparent"
|
|
32
|
+
},
|
|
33
|
+
// FireFox
|
|
34
|
+
// scrollbarColor: `${theme.vars.palette.primary.main} white`,
|
|
35
|
+
// scrollbarWidth: 'thin',
|
|
36
|
+
// Chrome
|
|
37
|
+
"*::-webkit-scrollbar-thumb": {
|
|
38
|
+
// barra que se mueve
|
|
39
|
+
background: t.vars.palette.general.scrollBar,
|
|
40
|
+
borderRadius: "2px!important"
|
|
41
|
+
},
|
|
42
|
+
"& #root": {
|
|
43
|
+
width: "100%",
|
|
44
|
+
height: "100%"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"#nprogress": {
|
|
48
|
+
pointerEvents: "none",
|
|
49
|
+
"& .bar": {
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
height: 2,
|
|
53
|
+
width: "100%",
|
|
54
|
+
position: "fixed",
|
|
55
|
+
zIndex: t.zIndex.snackbar,
|
|
56
|
+
backgroundColor: t.vars.palette.primary.main,
|
|
57
|
+
boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
|
|
58
|
+
},
|
|
59
|
+
"& .peg": {
|
|
60
|
+
right: 0,
|
|
61
|
+
opacity: 1,
|
|
62
|
+
width: 100,
|
|
63
|
+
height: "100%",
|
|
64
|
+
display: "block",
|
|
65
|
+
position: "absolute",
|
|
66
|
+
transform: "rotate(3deg) translate(0px, -4px)",
|
|
67
|
+
boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"& html": {
|
|
71
|
+
fontSize: r.desktop,
|
|
72
|
+
[t.breakpoints.down("sm")]: {
|
|
73
|
+
fontSize: r.mobile
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
s as G
|
|
82
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as C, useState as k, useCallback as p, useEffect as v } from "react";
|
|
3
|
+
import { useHostTools as R, usePropageteMF as h, EmitEvents as f } from "@m4l/core";
|
|
4
|
+
import { u as V } from "../../hooks/useFirstRender/index-B-Q0TTn0.js";
|
|
5
|
+
const x = C(null);
|
|
6
|
+
function I(T) {
|
|
7
|
+
const { children: b, isMicroFrontEnd: F, currencyFormatter: l, numberFormatter: M, dateFormatter: t } = T, r = l?.decimalDigits || 0, o = l?.code || "USD", a = M?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = M?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), m = t?.dateFormat || "yyyy-MM-dd", n = t?.dateMask || "____-__-__", c = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", i = t?.datetimeMask || "____-__-__ __:__:__", _ = t?.timeFormat || "HH:mm:ss", d = t?.timeMask || "__:__:__", u = t?.formatDate || (() => {
|
|
8
|
+
throw new Error("Incorrect use of formatDate");
|
|
9
|
+
}), y = V(), { events_emit: g } = R(), [H, E] = k({
|
|
10
|
+
currencyFormatter: {
|
|
11
|
+
decimalDigits: r,
|
|
12
|
+
code: o
|
|
13
|
+
},
|
|
14
|
+
numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
|
|
15
|
+
dateFormatter: {
|
|
16
|
+
dateFormat: m,
|
|
17
|
+
dateMask: n,
|
|
18
|
+
datetimeFormat: c,
|
|
19
|
+
datetimeMask: i,
|
|
20
|
+
timeFormat: _,
|
|
21
|
+
timeMask: d,
|
|
22
|
+
formatDate: u
|
|
23
|
+
}
|
|
24
|
+
}), S = p((e) => {
|
|
25
|
+
E(e);
|
|
26
|
+
}, []);
|
|
27
|
+
return h({
|
|
28
|
+
isMicroFrontEnd: F,
|
|
29
|
+
event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
|
|
30
|
+
setHandler: S
|
|
31
|
+
}), v(() => {
|
|
32
|
+
if (F || y)
|
|
33
|
+
return;
|
|
34
|
+
const e = {
|
|
35
|
+
currencyFormatter: { decimalDigits: r, code: o },
|
|
36
|
+
numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
|
|
37
|
+
dateFormatter: {
|
|
38
|
+
dateFormat: m,
|
|
39
|
+
dateMask: n,
|
|
40
|
+
datetimeFormat: c,
|
|
41
|
+
datetimeMask: i,
|
|
42
|
+
timeFormat: _,
|
|
43
|
+
timeMask: d,
|
|
44
|
+
formatDate: u
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
|
|
48
|
+
}, [
|
|
49
|
+
y,
|
|
50
|
+
o,
|
|
51
|
+
r,
|
|
52
|
+
a,
|
|
53
|
+
s,
|
|
54
|
+
m,
|
|
55
|
+
n,
|
|
56
|
+
c,
|
|
57
|
+
i,
|
|
58
|
+
_,
|
|
59
|
+
d,
|
|
60
|
+
u
|
|
61
|
+
]), /* @__PURE__ */ D(
|
|
62
|
+
x.Provider,
|
|
63
|
+
{
|
|
64
|
+
value: {
|
|
65
|
+
...H
|
|
66
|
+
},
|
|
67
|
+
children: b
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
x as F,
|
|
73
|
+
I as a
|
|
74
|
+
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
1
2
|
import { createContext as c, useMemo as h } from "react";
|
|
2
3
|
import { CssBaseline as d } from "@mui/material";
|
|
3
|
-
import { G as p } from "../../components/GlobalStyle/index-
|
|
4
|
+
import { G as p } from "../../components/GlobalStyle/index-C3p7OfnO.js";
|
|
4
5
|
import { createTheme as x, experimental_extendTheme as f, Experimental_CssVarsProvider as u, StyledEngineProvider as T } from "@mui/material/styles";
|
|
5
|
-
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
6
6
|
const v = c(null);
|
|
7
7
|
function j(m) {
|
|
8
|
-
const {
|
|
9
|
-
children: l,
|
|
10
|
-
hostThemeOptions: o,
|
|
11
|
-
fnComponentsOverrides: n,
|
|
12
|
-
isMobile: s
|
|
13
|
-
} = m, a = h(() => {
|
|
8
|
+
const { children: l, hostThemeOptions: o, fnComponentsOverrides: n, isMobile: s } = m, a = h(() => {
|
|
14
9
|
const e = x({
|
|
15
10
|
...o
|
|
16
11
|
}), r = f({
|
|
@@ -26,21 +21,22 @@ function j(m) {
|
|
|
26
21
|
});
|
|
27
22
|
return r.components = n(r), r;
|
|
28
23
|
}, [s]);
|
|
29
|
-
return /* @__PURE__ */ i(u, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children:
|
|
39
|
-
enableColorScheme: !0
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
return /* @__PURE__ */ i(u, { theme: a, children: [
|
|
25
|
+
/* @__PURE__ */ t(p, {}),
|
|
26
|
+
/* @__PURE__ */ t(
|
|
27
|
+
v.Provider,
|
|
28
|
+
{
|
|
29
|
+
value: {
|
|
30
|
+
hostThemeOptions: o,
|
|
31
|
+
fnComponentsOverrides: n
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ i(T, { injectFirst: !0, children: [
|
|
34
|
+
/* @__PURE__ */ t(d, { enableColorScheme: !0 }),
|
|
35
|
+
l
|
|
36
|
+
] })
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] });
|
|
44
40
|
}
|
|
45
41
|
export {
|
|
46
42
|
v as H,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as k, useState as _, useCallback as x, useEffect as L } from "react";
|
|
2
3
|
import { AdapterDateFns as F } from "@mui/x-date-pickers/AdapterDateFns";
|
|
3
4
|
import { LocalizationProvider as U } from "@mui/x-date-pickers";
|
|
4
5
|
import { useEnvironment as P, useNetwork as I, useHostTools as j, useLocalStorageWithListener as w, EmitEvents as u } from "@m4l/core";
|
|
5
|
-
import
|
|
6
|
-
import { jsx as S } from "react/jsx-runtime";
|
|
6
|
+
import S from "date-fns/locale/en-US";
|
|
7
7
|
async function B(t, e, o) {
|
|
8
8
|
const s = g(t), r = { ...t };
|
|
9
9
|
let i;
|
|
10
|
-
return s === "es" ? i = (await import("date-fns/locale/es")).default : s === "fr" ? i = (await import("date-fns/locale/fr")).default : s === "en-US" ? i =
|
|
10
|
+
return s === "es" ? i = (await import("date-fns/locale/es")).default : s === "fr" ? i = (await import("date-fns/locale/fr")).default : s === "en-US" ? i = S : (i = S, r.lang = "en", r.script = void 0, r.region = "US", r.url_icon = `${e}/${o}/frontend/commons/assets/icons/langs/lang_en.svg`, r.name = "English US*"), {
|
|
11
11
|
...r,
|
|
12
12
|
module: i,
|
|
13
13
|
localeString: g(r)
|
|
@@ -35,46 +35,35 @@ function y(t) {
|
|
|
35
35
|
}
|
|
36
36
|
const G = k(null);
|
|
37
37
|
function J(t) {
|
|
38
|
-
const {
|
|
39
|
-
children: e,
|
|
40
|
-
isMicroFrontEnd: o,
|
|
41
|
-
localeHost: s,
|
|
42
|
-
getLocaleFromNetwork: r
|
|
43
|
-
} = t;
|
|
38
|
+
const { children: e, isMicroFrontEnd: o, localeHost: s, getLocaleFromNetwork: r } = t;
|
|
44
39
|
if (o && !s)
|
|
45
40
|
throw Error("Must set localeHost in microfrontend");
|
|
46
41
|
if (!o && !r)
|
|
47
42
|
throw Error("Must set getLocaleFromNetwork in host");
|
|
48
|
-
const {
|
|
49
|
-
domain_token: i,
|
|
50
|
-
host_static_assets: v,
|
|
51
|
-
environment_assets: h
|
|
52
|
-
} = P(), {
|
|
53
|
-
networkOperation: C
|
|
54
|
-
} = I(), {
|
|
55
|
-
events_add_listener: N,
|
|
56
|
-
events_remove_listener: T,
|
|
57
|
-
events_emit: H
|
|
58
|
-
} = j(), [a, f] = E(() => {
|
|
43
|
+
const { domain_token: i, host_static_assets: v, environment_assets: h } = P(), { networkOperation: C } = I(), { events_add_listener: N, events_remove_listener: T, events_emit: H } = j(), [a, f] = _(() => {
|
|
59
44
|
if (o)
|
|
60
45
|
return s;
|
|
61
|
-
}), [l, m] = w(
|
|
46
|
+
}), [l, m] = w(
|
|
47
|
+
"localeHost",
|
|
48
|
+
navigator.language
|
|
49
|
+
), [M, A] = _(""), d = x((n) => {
|
|
62
50
|
f(n);
|
|
63
51
|
}, []);
|
|
64
|
-
if (
|
|
52
|
+
if (L(() => (o && N(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, d), () => {
|
|
65
53
|
o && T(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, d);
|
|
66
|
-
}), []),
|
|
54
|
+
}), []), L(() => {
|
|
67
55
|
let n = !0;
|
|
68
56
|
if (!o && r && !(l === M && l !== ""))
|
|
69
57
|
return C({
|
|
70
58
|
method: "POST",
|
|
71
59
|
endPoint: "na/locales",
|
|
72
|
-
data: {
|
|
73
|
-
...y(l),
|
|
74
|
-
domain_token: i
|
|
75
|
-
}
|
|
60
|
+
data: { ...y(l), domain_token: i }
|
|
76
61
|
}).then((p) => {
|
|
77
|
-
n && r(
|
|
62
|
+
n && r(
|
|
63
|
+
p.data,
|
|
64
|
+
v,
|
|
65
|
+
h
|
|
66
|
+
).then((c) => {
|
|
78
67
|
f(c), A(c.localeString), l !== c.localeString && m(c.localeString), H(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, c);
|
|
79
68
|
});
|
|
80
69
|
}).finally(() => {
|
|
@@ -86,20 +75,24 @@ function J(t) {
|
|
|
86
75
|
const O = (n) => {
|
|
87
76
|
(n.lang !== a.lang || n.script !== a.script || n.region !== a.region) && m(g(n));
|
|
88
77
|
};
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
dateAdapter: F,
|
|
96
|
-
adapterLocale: a.module,
|
|
97
|
-
dateFormats: {
|
|
98
|
-
hours24h: "23"
|
|
78
|
+
return /* @__PURE__ */ E(
|
|
79
|
+
G.Provider,
|
|
80
|
+
{
|
|
81
|
+
value: {
|
|
82
|
+
currentLocale: a,
|
|
83
|
+
onChangeLocale: O
|
|
99
84
|
},
|
|
100
|
-
children:
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
children: /* @__PURE__ */ E(
|
|
86
|
+
U,
|
|
87
|
+
{
|
|
88
|
+
dateAdapter: F,
|
|
89
|
+
adapterLocale: a.module,
|
|
90
|
+
dateFormats: { hours24h: "23" },
|
|
91
|
+
children: e
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
);
|
|
103
96
|
}
|
|
104
97
|
export {
|
|
105
98
|
G as L,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as f, useRef as T, useMemo as R, useLayoutEffect as k, useEffect as P } from "react";
|
|
3
|
+
import { c as C, d as v, i as y, l as O } from "../node_modules-BHhXVwYT.js";
|
|
4
4
|
import { useNetwork as x, useLocalStorageWithListener as M } from "@m4l/core";
|
|
5
5
|
import { getPaletteByPreset as w, typography as E, shadows as d, getColorPresets as L, createCustomShadows as B, defaultThemeOptions as A, presetsOptions as D } from "@m4l/styles";
|
|
6
6
|
import { alpha as z } from "@mui/system";
|
|
@@ -9,9 +9,9 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
|
|
|
9
9
|
const n = {
|
|
10
10
|
...r
|
|
11
11
|
};
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return C(
|
|
13
|
+
v(
|
|
14
|
+
y((o, t) => ({
|
|
15
15
|
...n,
|
|
16
16
|
responsiveContainerActions: {
|
|
17
17
|
setBreakpoint: (e) => {
|
|
@@ -24,11 +24,8 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
|
|
|
24
24
|
{ name: "Responsive Relative Store" }
|
|
25
25
|
)
|
|
26
26
|
);
|
|
27
|
-
}, W =
|
|
28
|
-
const {
|
|
29
|
-
children: n,
|
|
30
|
-
observedDivRef: o
|
|
31
|
-
} = r, t = f();
|
|
27
|
+
}, W = f(null), F = (r) => {
|
|
28
|
+
const { children: n, observedDivRef: o } = r, t = T();
|
|
32
29
|
t.current || (t.current = j({
|
|
33
30
|
breakPoint: "md",
|
|
34
31
|
isUpSm: !1,
|
|
@@ -37,7 +34,9 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
|
|
|
37
34
|
const e = () => {
|
|
38
35
|
const s = o;
|
|
39
36
|
if (s instanceof HTMLElement && s.clientWidth) {
|
|
40
|
-
const h = Object.keys(
|
|
37
|
+
const h = Object.keys(
|
|
38
|
+
g
|
|
39
|
+
);
|
|
41
40
|
for (let a = 0; a < h.length; a++) {
|
|
42
41
|
const u = h[a];
|
|
43
42
|
if (s.clientWidth <= g[u]) {
|
|
@@ -46,10 +45,13 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
|
|
|
46
45
|
} else a === h.length - 1 && s.clientWidth >= g[u] && t.current?.getState().responsiveContainerActions.setBreakpoint(u);
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
}, i = R(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
}, i = R(
|
|
49
|
+
() => O.throttle(e, 200, {
|
|
50
|
+
leading: !1,
|
|
51
|
+
trailing: !0
|
|
52
|
+
}),
|
|
53
|
+
[e]
|
|
54
|
+
);
|
|
53
55
|
return k(() => {
|
|
54
56
|
const s = () => {
|
|
55
57
|
i();
|
|
@@ -62,10 +64,7 @@ const g = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, j = (r) => {
|
|
|
62
64
|
a.disconnect();
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
|
-
}, [o]), /* @__PURE__ */
|
|
66
|
-
value: t.current,
|
|
67
|
-
children: n
|
|
68
|
-
});
|
|
67
|
+
}, [o]), /* @__PURE__ */ S(W.Provider, { value: t.current, children: n });
|
|
69
68
|
}, p = {
|
|
70
69
|
themeMode: "light",
|
|
71
70
|
themeDirection: "ltr",
|
|
@@ -162,9 +161,9 @@ const l = {
|
|
|
162
161
|
}, b(r.themeOptions);
|
|
163
162
|
}, m = (r) => {
|
|
164
163
|
r.setterThemeSettings && r.setterThemeSettings(r.currentThemeSettings);
|
|
165
|
-
}, _ = (r) =>
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
}, _ = (r) => C(
|
|
165
|
+
v(
|
|
166
|
+
y((n, o) => ({
|
|
168
167
|
...r,
|
|
169
168
|
settingsActions: {
|
|
170
169
|
init: () => {
|
|
@@ -233,14 +232,12 @@ const l = {
|
|
|
233
232
|
})),
|
|
234
233
|
{ name: "ThemeSettingsStore" }
|
|
235
234
|
)
|
|
236
|
-
), N =
|
|
237
|
-
function G({
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
networkOperation: o
|
|
243
|
-
} = x(), t = $(), [e, i] = M("theme_setting", {}), s = f();
|
|
235
|
+
), N = f(null);
|
|
236
|
+
function G({ children: r, themeSettings: n }) {
|
|
237
|
+
const { networkOperation: o } = x(), t = $(), [e, i] = M(
|
|
238
|
+
"theme_setting",
|
|
239
|
+
{}
|
|
240
|
+
), s = T();
|
|
244
241
|
return s.current || (s.current = _({
|
|
245
242
|
networkOperation: o,
|
|
246
243
|
currentThemeSettings: {
|
|
@@ -253,13 +250,8 @@ function G({
|
|
|
253
250
|
open: !1,
|
|
254
251
|
setterThemeSettings: n ? void 0 : i
|
|
255
252
|
}), s.current.getState().settingsActions.init()), P(() => {
|
|
256
|
-
s.current?.getState().settingsActions.setThemeSettings({
|
|
257
|
-
|
|
258
|
-
});
|
|
259
|
-
}, [t]), /* @__PURE__ */ y(N.Provider, {
|
|
260
|
-
value: s.current,
|
|
261
|
-
children: r
|
|
262
|
-
});
|
|
253
|
+
s.current?.getState().settingsActions.setThemeSettings({ isMobile: t });
|
|
254
|
+
}, [t]), /* @__PURE__ */ S(N.Provider, { value: s.current, children: r });
|
|
263
255
|
}
|
|
264
256
|
export {
|
|
265
257
|
W as R,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef as n, useEffect as r, useState as i, useContext as u, useLayoutEffect as c } from "react";
|
|
2
|
-
import { H as m } from "../contexts/HostThemeContext/index-
|
|
2
|
+
import { H as m } from "../contexts/HostThemeContext/index-BMSwOCtA.js";
|
|
3
3
|
import { u as a } from "../node_modules-BHhXVwYT.js";
|
|
4
|
-
import { T as l } from "../contexts/index-
|
|
4
|
+
import { T as l } from "../contexts/index-DEyJidab.js";
|
|
5
5
|
function S() {
|
|
6
6
|
const e = n(!0);
|
|
7
7
|
return r(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext as r } from "react";
|
|
2
|
-
import { F as e } from "../../contexts/FormatterContext/index-
|
|
2
|
+
import { F as e } from "../../contexts/FormatterContext/index-Ch6IW7j8.js";
|
|
3
3
|
const m = () => {
|
|
4
4
|
const t = r(e);
|
|
5
5
|
if (!t) throw new Error("useFormatter context must be use inside FormatterProvider");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext as o } from "react";
|
|
2
|
-
import { L as t } from "../../contexts/LocalesContext/index
|
|
2
|
+
import { L as t } from "../../contexts/LocalesContext/index-C89UlO0s.js";
|
|
3
3
|
const n = () => {
|
|
4
4
|
const e = o(t);
|
|
5
5
|
if (!e) throw new Error("useLocales context must be use inside LocalesProvider");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext as t } from "react";
|
|
2
2
|
import { u as r } from "../../node_modules-BHhXVwYT.js";
|
|
3
|
-
import { R as n } from "../../contexts/index-
|
|
3
|
+
import { R as n } from "../../contexts/index-DEyJidab.js";
|
|
4
4
|
import { useResponsive as i } from "@m4l/styles";
|
|
5
5
|
function f(e, s) {
|
|
6
6
|
const o = t(n);
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { G as s } from "./components/GlobalStyle/index-
|
|
2
|
-
import { L as r, a, g as i } from "./contexts/LocalesContext/index
|
|
3
|
-
import { F as m, a as p } from "./contexts/FormatterContext/index-
|
|
4
|
-
import { R as x, a as f, T as d, b as l, d as v } from "./contexts/index-
|
|
5
|
-
import { H as T, a as g } from "./contexts/HostThemeContext/index-
|
|
1
|
+
import { G as s } from "./components/GlobalStyle/index-C3p7OfnO.js";
|
|
2
|
+
import { L as r, a, g as i } from "./contexts/LocalesContext/index-C89UlO0s.js";
|
|
3
|
+
import { F as m, a as p } from "./contexts/FormatterContext/index-Ch6IW7j8.js";
|
|
4
|
+
import { R as x, a as f, T as d, b as l, d as v } from "./contexts/index-DEyJidab.js";
|
|
5
|
+
import { H as T, a as g } from "./contexts/HostThemeContext/index-BMSwOCtA.js";
|
|
6
6
|
import { u as R } from "./hooks/useFirstRender/index-B-Q0TTn0.js";
|
|
7
|
-
import { u as c } from "./hooks/useFormatter/index-
|
|
8
|
-
import { b as P, u as b, a as L, c as H, d as k } from "./hooks/index-
|
|
9
|
-
import { u as z } from "./hooks/useLocales/index-
|
|
10
|
-
import { u as I, a as M } from "./hooks/useResponsive/index-
|
|
7
|
+
import { u as c } from "./hooks/useFormatter/index-BBgQ4lJL.js";
|
|
8
|
+
import { b as P, u as b, a as L, c as H, d as k } from "./hooks/index-Y3uj_IzK.js";
|
|
9
|
+
import { u as z } from "./hooks/useLocales/index-_thMBNE7.js";
|
|
10
|
+
import { u as I, a as M } from "./hooks/useResponsive/index-Dki-WJi8.js";
|
|
11
11
|
import { u as y } from "./hooks/useIsMobile/index-Bro0dV28.js";
|
|
12
12
|
import { C as D, g as E } from "./utils/index-DZG6QXjf.js";
|
|
13
13
|
export {
|
package/package.json
CHANGED
package/vite-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { useTheme as e } from "@mui/material/styles";
|
|
2
|
-
import { GlobalStyles as o } from "@mui/material";
|
|
3
|
-
import { globalRemSize as r } from "@m4l/styles";
|
|
4
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
-
function s() {
|
|
6
|
-
const t = e();
|
|
7
|
-
return /* @__PURE__ */ a(o, {
|
|
8
|
-
styles: {
|
|
9
|
-
body: {
|
|
10
|
-
textRendering: "geometricPrecision",
|
|
11
|
-
width: "100%",
|
|
12
|
-
height: "100vh",
|
|
13
|
-
"input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
|
|
14
|
-
color: t.vars.palette.text.primary
|
|
15
|
-
},
|
|
16
|
-
"*::-webkit-scrollbar": {
|
|
17
|
-
// camino de la barra con radio
|
|
18
|
-
width: "7px",
|
|
19
|
-
height: "7px",
|
|
20
|
-
borderRadius: "3px",
|
|
21
|
-
backgroundColor: "transparent"
|
|
22
|
-
},
|
|
23
|
-
"*::-webkit-scrollbar-track": {
|
|
24
|
-
// Camino de la barrra sin radio
|
|
25
|
-
backgroundColor: "transparent",
|
|
26
|
-
border: "0px solid transparent"
|
|
27
|
-
},
|
|
28
|
-
"*::-webkit-scrollbar-corner": {
|
|
29
|
-
backgroundColor: "transparent"
|
|
30
|
-
},
|
|
31
|
-
// FireFox
|
|
32
|
-
// scrollbarColor: `${theme.vars.palette.primary.main} white`,
|
|
33
|
-
// scrollbarWidth: 'thin',
|
|
34
|
-
// Chrome
|
|
35
|
-
"*::-webkit-scrollbar-thumb": {
|
|
36
|
-
// barra que se mueve
|
|
37
|
-
background: t.vars.palette.general.scrollBar,
|
|
38
|
-
borderRadius: "2px!important"
|
|
39
|
-
},
|
|
40
|
-
"& #root": {
|
|
41
|
-
width: "100%",
|
|
42
|
-
height: "100%"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"#nprogress": {
|
|
46
|
-
pointerEvents: "none",
|
|
47
|
-
"& .bar": {
|
|
48
|
-
top: 0,
|
|
49
|
-
left: 0,
|
|
50
|
-
height: 2,
|
|
51
|
-
width: "100%",
|
|
52
|
-
position: "fixed",
|
|
53
|
-
zIndex: t.zIndex.snackbar,
|
|
54
|
-
backgroundColor: t.vars.palette.primary.main,
|
|
55
|
-
boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
|
|
56
|
-
},
|
|
57
|
-
"& .peg": {
|
|
58
|
-
right: 0,
|
|
59
|
-
opacity: 1,
|
|
60
|
-
width: 100,
|
|
61
|
-
height: "100%",
|
|
62
|
-
display: "block",
|
|
63
|
-
position: "absolute",
|
|
64
|
-
transform: "rotate(3deg) translate(0px, -4px)",
|
|
65
|
-
boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"& html": {
|
|
69
|
-
fontSize: r.desktop,
|
|
70
|
-
[t.breakpoints.down("sm")]: {
|
|
71
|
-
fontSize: r.mobile
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
s as G
|
|
79
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { createContext as D, useState as C, useCallback as k, useEffect as p } from "react";
|
|
2
|
-
import { useHostTools as v, usePropageteMF as R, EmitEvents as f } from "@m4l/core";
|
|
3
|
-
import { u as h } from "../../hooks/useFirstRender/index-B-Q0TTn0.js";
|
|
4
|
-
import { jsx as V } from "react/jsx-runtime";
|
|
5
|
-
const x = D(null);
|
|
6
|
-
function I(T) {
|
|
7
|
-
const {
|
|
8
|
-
children: b,
|
|
9
|
-
isMicroFrontEnd: F,
|
|
10
|
-
currencyFormatter: l,
|
|
11
|
-
numberFormatter: M,
|
|
12
|
-
dateFormatter: t
|
|
13
|
-
} = T, r = l?.decimalDigits || 0, o = l?.code || "USD", a = M?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = M?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), m = t?.dateFormat || "yyyy-MM-dd", n = t?.dateMask || "____-__-__", c = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", i = t?.datetimeMask || "____-__-__ __:__:__", _ = t?.timeFormat || "HH:mm:ss", d = t?.timeMask || "__:__:__", u = t?.formatDate || (() => {
|
|
14
|
-
throw new Error("Incorrect use of formatDate");
|
|
15
|
-
}), y = h(), {
|
|
16
|
-
events_emit: g
|
|
17
|
-
} = v(), [H, E] = C({
|
|
18
|
-
currencyFormatter: {
|
|
19
|
-
decimalDigits: r,
|
|
20
|
-
code: o
|
|
21
|
-
},
|
|
22
|
-
numberFormatter: {
|
|
23
|
-
decimalSymbol: a,
|
|
24
|
-
thousandsSymbol: s
|
|
25
|
-
},
|
|
26
|
-
dateFormatter: {
|
|
27
|
-
dateFormat: m,
|
|
28
|
-
dateMask: n,
|
|
29
|
-
datetimeFormat: c,
|
|
30
|
-
datetimeMask: i,
|
|
31
|
-
timeFormat: _,
|
|
32
|
-
timeMask: d,
|
|
33
|
-
formatDate: u
|
|
34
|
-
}
|
|
35
|
-
}), S = k((e) => {
|
|
36
|
-
E(e);
|
|
37
|
-
}, []);
|
|
38
|
-
return R({
|
|
39
|
-
isMicroFrontEnd: F,
|
|
40
|
-
event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
|
|
41
|
-
setHandler: S
|
|
42
|
-
}), p(() => {
|
|
43
|
-
if (F || y)
|
|
44
|
-
return;
|
|
45
|
-
const e = {
|
|
46
|
-
currencyFormatter: {
|
|
47
|
-
decimalDigits: r,
|
|
48
|
-
code: o
|
|
49
|
-
},
|
|
50
|
-
numberFormatter: {
|
|
51
|
-
decimalSymbol: a,
|
|
52
|
-
thousandsSymbol: s
|
|
53
|
-
},
|
|
54
|
-
dateFormatter: {
|
|
55
|
-
dateFormat: m,
|
|
56
|
-
dateMask: n,
|
|
57
|
-
datetimeFormat: c,
|
|
58
|
-
datetimeMask: i,
|
|
59
|
-
timeFormat: _,
|
|
60
|
-
timeMask: d,
|
|
61
|
-
formatDate: u
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
|
|
65
|
-
}, [y, o, r, a, s, m, n, c, i, _, d, u]), /* @__PURE__ */ V(x.Provider, {
|
|
66
|
-
value: {
|
|
67
|
-
...H
|
|
68
|
-
},
|
|
69
|
-
children: b
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
x as F,
|
|
74
|
-
I as a
|
|
75
|
-
};
|