@m4l/graphics 0.1.17 → 0.1.18

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,23 +1,23 @@
1
- import { createContext as D, useState as k, useCallback as C, useEffect as p } from "react";
2
- import { useHostTools as v, usePropageteMF as R, EmitEvents as b } from "@m4l/core";
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
3
  import { u as h } from "../../hooks/useFirstRender/index.1e9b02fb.js";
4
4
  import { jsx as V } from "react/jsx-runtime";
5
5
  const x = D(null);
6
- function I(f) {
6
+ function I(T) {
7
7
  const {
8
- children: T,
9
- isMicroFrontEnd: l,
10
- currencyFormatter: F,
11
- numberFormatter: y,
8
+ children: b,
9
+ isMicroFrontEnd: F,
10
+ currencyFormatter: l,
11
+ numberFormatter: M,
12
12
  dateFormatter: t
13
- } = f, r = F?.decimalDigits || 0, o = F?.symbol || "$", a = y?.decimalSymbol || 0.1 .toLocaleString().substring(1, 2), s = y?.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", u = t?.timeMask || "__:__:__", d = t?.formatDate || (() => {
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
14
  throw new Error("Incorrect use of formatDate");
15
- }), M = h(), {
15
+ }), y = h(), {
16
16
  events_emit: g
17
- } = v(), [H, E] = k({
17
+ } = v(), [H, E] = C({
18
18
  currencyFormatter: {
19
19
  decimalDigits: r,
20
- symbol: o
20
+ code: o
21
21
  },
22
22
  numberFormatter: {
23
23
  decimalSymbol: a,
@@ -29,23 +29,23 @@ function I(f) {
29
29
  datetimeFormat: c,
30
30
  datetimeMask: i,
31
31
  timeFormat: _,
32
- timeMask: u,
33
- formatDate: d
32
+ timeMask: d,
33
+ formatDate: u
34
34
  }
35
- }), S = C((e) => {
35
+ }), S = k((e) => {
36
36
  E(e);
37
37
  }, []);
38
38
  return R({
39
- isMicroFrontEnd: l,
40
- event: b.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
39
+ isMicroFrontEnd: F,
40
+ event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
41
41
  setHandler: S
42
42
  }), p(() => {
43
- if (l || M)
43
+ if (F || y)
44
44
  return;
45
45
  const e = {
46
46
  currencyFormatter: {
47
47
  decimalDigits: r,
48
- symbol: o
48
+ code: o
49
49
  },
50
50
  numberFormatter: {
51
51
  decimalSymbol: a,
@@ -57,16 +57,16 @@ function I(f) {
57
57
  datetimeFormat: c,
58
58
  datetimeMask: i,
59
59
  timeFormat: _,
60
- timeMask: u,
61
- formatDate: d
60
+ timeMask: d,
61
+ formatDate: u
62
62
  }
63
63
  };
64
- E(e), g(b.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
65
- }, [M, o, r, a, s, m, n, c, i, _, u, d]), /* @__PURE__ */ V(x.Provider, {
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
66
  value: {
67
67
  ...H
68
68
  },
69
- children: T
69
+ children: b
70
70
  });
71
71
  }
72
72
  export {
@@ -1,7 +1,7 @@
1
1
  import type { Locale } from 'date-fns';
2
2
  import { ReactNode } from 'react';
3
3
  export interface CurrencyFormatter {
4
- symbol: string;
4
+ code: string;
5
5
  decimalDigits: number;
6
6
  }
7
7
  export interface NumberFormatter {
@@ -1,4 +1,4 @@
1
- import "./FormatterContext/index.0a135b60.js";
1
+ import "./FormatterContext/index.92336f4c.js";
2
2
  import "./LocalesContext/index.3fcfbe02.js";
3
3
  import "date-fns/locale/en-US";
4
4
  import "./HostThemeContext/index.a6a62c70.js";
@@ -1,5 +1,5 @@
1
1
  import { useRef as f, useEffect as s, useState as n } from "react";
2
- import "../contexts/FormatterContext/index.0a135b60.js";
2
+ import "../contexts/FormatterContext/index.92336f4c.js";
3
3
  import "../contexts/HostThemeContext/index.a6a62c70.js";
4
4
  import "../contexts/LocalesContext/index.3fcfbe02.js";
5
5
  import "@mui/material/styles";
@@ -1,5 +1,5 @@
1
1
  import { useContext as r } from "react";
2
- import { F as e } from "../../contexts/FormatterContext/index.0a135b60.js";
2
+ import { F as e } from "../../contexts/FormatterContext/index.92336f4c.js";
3
3
  const m = () => {
4
4
  const t = r(e);
5
5
  if (!t)
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { P as d } from "./components/ProgressBarStyle/index.fb6fd9ed.js";
2
- import { F as n, a as c } from "./contexts/FormatterContext/index.0a135b60.js";
2
+ import { F as n, a as c } from "./contexts/FormatterContext/index.92336f4c.js";
3
3
  import { L as C, a as F, g as h } from "./contexts/LocalesContext/index.3fcfbe02.js";
4
4
  import { H as g, a as L } from "./contexts/HostThemeContext/index.a6a62c70.js";
5
5
  import { u as H } from "./hooks/useFirstRender/index.1e9b02fb.js";
6
- import { u as w } from "./hooks/useFormatter/index.6463a320.js";
6
+ import { u as w } from "./hooks/useFormatter/index.57ac8cca.js";
7
7
  import { u as S } from "./hooks/useHostTheme/index.1c8e4ad7.js";
8
- import { u as y, a as z } from "./hooks/index.54438d3f.js";
8
+ import { u as y, a as z } from "./hooks/index.a0cce694.js";
9
9
  import { u as D } from "./hooks/useLocales/index.8154a401.js";
10
10
  import { u as I, a as M } from "./hooks/useResponsive/index.fc5e1b4f.js";
11
11
  import { d as V } from "./theme/defaultThemeOptions.9b9e7503.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "dependencies": {