@m4l/graphics 0.1.13 → 0.1.14
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/contexts/{index.bd12693a.js → FormatterContext/index.06536651.js} +15 -18
- package/contexts/index.f665068e.js +4 -0
- package/hooks/index.f7923b00.js +37 -0
- package/hooks/useFormatter/index.d30c615c.js +11 -0
- package/index.js +28 -27
- package/package.json +1 -1
- package/hooks/index.de62e8aa.js +0 -44
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
import { useHostTools as
|
|
3
|
-
import { u as h } from "
|
|
1
|
+
import { createContext as D, useState as k, useCallback as v, useEffect as C } from "react";
|
|
2
|
+
import { useHostTools as p, usePropageteMF as R, EmitEvents as b } from "@m4l/core";
|
|
3
|
+
import { u as h } from "../../hooks/index.f7923b00.js";
|
|
4
4
|
import { jsx as V } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "./HostThemeContext/index.a6a62c70.js";
|
|
8
|
-
const x = p(null);
|
|
9
|
-
function L(g) {
|
|
5
|
+
const x = D(null);
|
|
6
|
+
function w(g) {
|
|
10
7
|
const {
|
|
11
8
|
children: T,
|
|
12
9
|
isMicroFrontEnd: r,
|
|
13
10
|
currencyFormatter: F,
|
|
14
11
|
numberFormatter: y,
|
|
15
12
|
dateFormatter: t
|
|
16
|
-
} = g, o = F?.decimalDigits || 0, a = F?.symbol || "$",
|
|
13
|
+
} = g, o = F?.decimalDigits || 0, a = F?.symbol || "$", s = y?.decimalSymbol || 0.1 .toLocaleString().substring(1, 2), m = y?.thousandsSymbol || 1e3 .toLocaleString().substring(1, 2), n = t?.dateFormat || "yyyy-MM-dd", c = t?.dateMask || "____-__-__", i = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", _ = t?.datetimeMask || "____-__-__ __:__:__", d = t?.timeFormat || "HH:mm:ss", u = t?.timeMask || "__:__:__", l = t?.formatDate || (() => {
|
|
17
14
|
throw new Error("Incorrect use of formatDate");
|
|
18
15
|
}), M = h(), {
|
|
19
16
|
events_emit: H
|
|
20
|
-
} =
|
|
17
|
+
} = p(), [f, E] = k({
|
|
21
18
|
currencyFormatter: {
|
|
22
19
|
decimalDigits: o,
|
|
23
20
|
symbol: a
|
|
24
21
|
},
|
|
25
22
|
numberFormatter: {
|
|
26
|
-
decimalSymbol:
|
|
27
|
-
thousandsSymbol:
|
|
23
|
+
decimalSymbol: s,
|
|
24
|
+
thousandsSymbol: m
|
|
28
25
|
},
|
|
29
26
|
dateFormatter: {
|
|
30
27
|
dateFormat: n,
|
|
@@ -37,14 +34,14 @@ function L(g) {
|
|
|
37
34
|
}
|
|
38
35
|
});
|
|
39
36
|
console.log("FormatterProvider", r, f.dateFormatter.formatDate);
|
|
40
|
-
const S =
|
|
37
|
+
const S = v((e) => {
|
|
41
38
|
E(e);
|
|
42
39
|
}, []);
|
|
43
40
|
return R({
|
|
44
41
|
isMicroFrontEnd: r,
|
|
45
42
|
event: b.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
|
|
46
43
|
setHandler: S
|
|
47
|
-
}),
|
|
44
|
+
}), C(() => {
|
|
48
45
|
if (r || M)
|
|
49
46
|
return;
|
|
50
47
|
const e = {
|
|
@@ -53,8 +50,8 @@ function L(g) {
|
|
|
53
50
|
symbol: a
|
|
54
51
|
},
|
|
55
52
|
numberFormatter: {
|
|
56
|
-
decimalSymbol:
|
|
57
|
-
thousandsSymbol:
|
|
53
|
+
decimalSymbol: s,
|
|
54
|
+
thousandsSymbol: m
|
|
58
55
|
},
|
|
59
56
|
dateFormatter: {
|
|
60
57
|
dateFormat: n,
|
|
@@ -67,7 +64,7 @@ function L(g) {
|
|
|
67
64
|
}
|
|
68
65
|
};
|
|
69
66
|
E(e), H(b.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
|
|
70
|
-
}, [M, a, o,
|
|
67
|
+
}, [M, a, o, s, m, n, c, i, _, d, u, l]), /* @__PURE__ */ V(x.Provider, {
|
|
71
68
|
value: {
|
|
72
69
|
...f
|
|
73
70
|
},
|
|
@@ -76,5 +73,5 @@ function L(g) {
|
|
|
76
73
|
}
|
|
77
74
|
export {
|
|
78
75
|
x as F,
|
|
79
|
-
|
|
76
|
+
w as a
|
|
80
77
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useRef as s, useEffect as t, useState as u } from "react";
|
|
2
|
+
import "../contexts/FormatterContext/index.06536651.js";
|
|
3
|
+
import "@mui/material/styles";
|
|
4
|
+
import "@mui/material/useMediaQuery";
|
|
5
|
+
import "../contexts/LocalesContext/index.3fcfbe02.js";
|
|
6
|
+
import "../contexts/HostThemeContext/index.a6a62c70.js";
|
|
7
|
+
function d() {
|
|
8
|
+
const e = s(!0);
|
|
9
|
+
return t(
|
|
10
|
+
() => () => {
|
|
11
|
+
e.current = !1;
|
|
12
|
+
},
|
|
13
|
+
[]
|
|
14
|
+
), e.current;
|
|
15
|
+
}
|
|
16
|
+
function m() {
|
|
17
|
+
const e = s(!0);
|
|
18
|
+
return t(
|
|
19
|
+
() => () => {
|
|
20
|
+
e.current = !1;
|
|
21
|
+
},
|
|
22
|
+
[]
|
|
23
|
+
), e;
|
|
24
|
+
}
|
|
25
|
+
function w(e) {
|
|
26
|
+
const [n, o] = u(!1), r = e || 100;
|
|
27
|
+
return t(() => (window.onscroll = () => {
|
|
28
|
+
window.pageYOffset > r ? o(!0) : o(!1);
|
|
29
|
+
}, () => {
|
|
30
|
+
window.onscroll = null;
|
|
31
|
+
}), [r]), n;
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
m as a,
|
|
35
|
+
w as b,
|
|
36
|
+
d as u
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext as r } from "react";
|
|
2
|
+
import { F as e } from "../../contexts/FormatterContext/index.06536651.js";
|
|
3
|
+
const m = () => {
|
|
4
|
+
const t = r(e);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error("useFormatter context must be use inside FormatterProvider");
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
m as u
|
|
11
|
+
};
|
package/index.js
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
import { P as l } from "./components/ProgressBarStyle/index.fb6fd9ed.js";
|
|
2
|
-
import { F as n, a as c } from "./contexts/index.
|
|
2
|
+
import { F as n, a as c } from "./contexts/FormatterContext/index.06536651.js";
|
|
3
3
|
import { L as C, a as h, g as v } from "./contexts/LocalesContext/index.3fcfbe02.js";
|
|
4
4
|
import { H as g, a as L } from "./contexts/HostThemeContext/index.a6a62c70.js";
|
|
5
|
-
import {
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
5
|
+
import { u as H } from "./hooks/useFormatter/index.d30c615c.js";
|
|
6
|
+
import { u as O, a as R } from "./hooks/useResponsive/index.fc5e1b4f.js";
|
|
7
|
+
import { a as k, b } from "./hooks/index.f7923b00.js";
|
|
8
|
+
import { u as z } from "./hooks/useLocales/index.8154a401.js";
|
|
9
|
+
import { u as D } from "./hooks/useHostTheme/index.1c8e4ad7.js";
|
|
10
|
+
import { d as I } from "./theme/defaultThemeOptions.9b9e7503.js";
|
|
11
|
+
import { c as N, s as V } from "./theme/shadows.bf8dc290.js";
|
|
12
|
+
import { p as q } from "./theme/palette.2baf72f5.js";
|
|
13
|
+
import { C as E, a as J, c as K, d as Q, g as U } from "./utils/index.d8b24456.js";
|
|
14
|
+
import { f as X } from "./theme/overrides.7958c0ab.js";
|
|
14
15
|
import "@mui/material/styles";
|
|
15
16
|
import "@mui/material";
|
|
16
17
|
import "react/jsx-runtime";
|
|
17
18
|
import "react";
|
|
18
19
|
import "@m4l/core";
|
|
19
|
-
import "date-fns/locale/en-US";
|
|
20
20
|
import "@mui/x-date-pickers/AdapterDateFns";
|
|
21
21
|
import "@mui/x-date-pickers";
|
|
22
|
+
import "date-fns/locale/en-US";
|
|
22
23
|
import "@mui/material/useMediaQuery";
|
|
23
24
|
import "./theme/typography.f5eadf47.js";
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
E as Capitalize,
|
|
26
27
|
n as FormatterContext,
|
|
27
28
|
c as FormatterProvider,
|
|
28
|
-
|
|
29
|
+
J as GetFontValue,
|
|
29
30
|
g as HostThemeContext,
|
|
30
31
|
L as HostThemeProvider,
|
|
31
32
|
C as LocalesContext,
|
|
32
33
|
h as LocalesProvider,
|
|
33
34
|
l as ProgressBarStyle,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
K as colorPresets,
|
|
36
|
+
N as customShadows,
|
|
37
|
+
Q as defaultPreset,
|
|
38
|
+
I as defaultThemeOptions,
|
|
39
|
+
X as fnComponentsOverrides,
|
|
40
|
+
U as getColorPresets,
|
|
40
41
|
v as getLocaleFromNetwork,
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
q as palette,
|
|
43
|
+
V as shadows,
|
|
43
44
|
H as useFormatter,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
D as useHostTheme,
|
|
46
|
+
k as useIsMountedRef,
|
|
47
|
+
z as useLocales,
|
|
48
|
+
b as useOffSetTop,
|
|
49
|
+
O as useResponsive,
|
|
50
|
+
R as useResponsiveDesktop
|
|
50
51
|
};
|
package/package.json
CHANGED
package/hooks/index.de62e8aa.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useRef as s, useEffect as e, useContext as u, useState as f } from "react";
|
|
2
|
-
import { F as i } from "../contexts/index.bd12693a.js";
|
|
3
|
-
import "@mui/material/styles";
|
|
4
|
-
import "@mui/material/useMediaQuery";
|
|
5
|
-
import "../contexts/LocalesContext/index.3fcfbe02.js";
|
|
6
|
-
import "../contexts/HostThemeContext/index.a6a62c70.js";
|
|
7
|
-
function w() {
|
|
8
|
-
const t = s(!0);
|
|
9
|
-
return e(
|
|
10
|
-
() => () => {
|
|
11
|
-
t.current = !1;
|
|
12
|
-
},
|
|
13
|
-
[]
|
|
14
|
-
), t.current;
|
|
15
|
-
}
|
|
16
|
-
const F = () => {
|
|
17
|
-
const t = u(i);
|
|
18
|
-
if (!t)
|
|
19
|
-
throw new Error("useFormatter context must be use inside FormatterProvider");
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
function x() {
|
|
23
|
-
const t = s(!0);
|
|
24
|
-
return e(
|
|
25
|
-
() => () => {
|
|
26
|
-
t.current = !1;
|
|
27
|
-
},
|
|
28
|
-
[]
|
|
29
|
-
), t;
|
|
30
|
-
}
|
|
31
|
-
function T(t) {
|
|
32
|
-
const [n, r] = f(!1), o = t || 100;
|
|
33
|
-
return e(() => (window.onscroll = () => {
|
|
34
|
-
window.pageYOffset > o ? r(!0) : r(!1);
|
|
35
|
-
}, () => {
|
|
36
|
-
window.onscroll = null;
|
|
37
|
-
}), [o]), n;
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
F as a,
|
|
41
|
-
x as b,
|
|
42
|
-
T as c,
|
|
43
|
-
w as u
|
|
44
|
-
};
|