@m4l/graphics 7.5.0-beta-feature-731-code-editor.0 → 7.5.0
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/FormatterContext/helpers.d.ts +7 -0
- package/contexts/FormatterContext/helpers.d.ts.map +1 -0
- package/contexts/FormatterContext/helpers.js +39 -0
- package/contexts/FormatterContext/index.d.ts +2 -2
- package/contexts/FormatterContext/index.d.ts.map +1 -1
- package/contexts/FormatterContext/index.js +49 -44
- package/contexts/FormatterContext/types.d.ts +4 -1
- package/contexts/FormatterContext/types.d.ts.map +1 -1
- package/contexts/LocalesContext/helper.d.ts +5 -1
- package/contexts/LocalesContext/helper.d.ts.map +1 -1
- package/contexts/LocalesContext/helper.js +25 -17
- package/contexts/ThemeSettingsContext/store.d.ts.map +1 -1
- package/contexts/ThemeSettingsContext/store.js +52 -70
- package/contexts/ThemeSettingsContext/types.d.ts +0 -7
- package/contexts/ThemeSettingsContext/types.d.ts.map +1 -1
- package/contexts/index.d.ts +2 -1
- package/contexts/index.d.ts.map +1 -1
- package/decorators/MFIsolationAppStorybook/constants.d.ts +2 -2
- package/decorators/MFIsolationAppStorybook/constants.d.ts.map +1 -1
- package/decorators/MFIsolationAppStorybook/constants.js +23 -11
- package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.d.ts +1 -1
- package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.d.ts.map +1 -1
- package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.js +18 -23
- package/hooks/useFormatter/index.d.ts +1 -1
- package/hooks/useFormatter/index.d.ts.map +1 -1
- package/index.js +81 -77
- package/package.json +2 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UserPreferencesSource } from '@m4l/core';
|
|
2
|
+
import { Formatters } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Build the shared formatter contract from the effective user-preferences source.
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildFormattersFromUserPreferences(source?: UserPreferencesSource | null): Formatters;
|
|
7
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGjF,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,SAAS,CAAC;AAoCjE;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,CAAC,EAAE,qBAAqB,GAAG,IAAI,GACpC,UAAU,CAwBZ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { normalizeUserPreferences as o } from "@m4l/core";
|
|
2
|
+
import { format as i } from "date-fns";
|
|
3
|
+
import { formatInTimeZone as n } from "date-fns-tz";
|
|
4
|
+
function a(t) {
|
|
5
|
+
return t.replace(/[A-Za-z]/g, "_");
|
|
6
|
+
}
|
|
7
|
+
function c(t) {
|
|
8
|
+
return t ? (r, e, m) => n(
|
|
9
|
+
r,
|
|
10
|
+
t,
|
|
11
|
+
e,
|
|
12
|
+
m
|
|
13
|
+
) : i;
|
|
14
|
+
}
|
|
15
|
+
function F(t) {
|
|
16
|
+
const r = o(t), e = `${r.dateFormat} ${r.timeFormat}`, m = c(r.timeZone?.name);
|
|
17
|
+
return {
|
|
18
|
+
currencyFormatter: {
|
|
19
|
+
code: r.currency,
|
|
20
|
+
decimalDigits: r.currencyDecimalDigits
|
|
21
|
+
},
|
|
22
|
+
numberFormatter: {
|
|
23
|
+
decimalSymbol: r.decimalSymbol,
|
|
24
|
+
thousandsSymbol: r.thousandsSymbol
|
|
25
|
+
},
|
|
26
|
+
dateFormatter: {
|
|
27
|
+
dateFormat: r.dateFormat,
|
|
28
|
+
dateMask: a(r.dateFormat),
|
|
29
|
+
datetimeFormat: e,
|
|
30
|
+
datetimeMask: a(e),
|
|
31
|
+
timeFormat: r.timeFormat,
|
|
32
|
+
timeMask: a(r.timeFormat),
|
|
33
|
+
formatDate: m
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
F as buildFormattersFromUserPreferences
|
|
39
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormatterProviderProps,
|
|
2
|
-
declare const FormatterContext: import('react').Context<
|
|
1
|
+
import { FormatterProviderProps, FormatterContextProps } from './types';
|
|
2
|
+
declare const FormatterContext: import('react').Context<FormatterContextProps | null>;
|
|
3
3
|
/**
|
|
4
4
|
* Componente encargado de proveer un contexto que permita saber los diferentes forrmatos,
|
|
5
5
|
* Segunda linea
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAc,MAAM,SAAS,CAAC;AAMpF,QAAA,MAAM,gBAAgB,uDAAoD,CAAC;AAC3E;;;;;;;GAOG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,oDAuHvD;AAED,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,74 +1,79 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useHostTools as R, usePropageteMF as
|
|
4
|
-
import { useFirstRender as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const { children:
|
|
1
|
+
import { jsx as C } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext as k, useState as p, useCallback as S, useEffect as v } from "react";
|
|
3
|
+
import { useHostTools as N, formatNumberWithDelimiters as R, usePropageteMF as V, EmitEvents as E } from "@m4l/core";
|
|
4
|
+
import { useFirstRender as x } from "../../hooks/useFirstRender/index.js";
|
|
5
|
+
const A = k(null);
|
|
6
|
+
function G(T) {
|
|
7
|
+
const { children: g, isMicroFrontEnd: F, currencyFormatter: y, numberFormatter: b, dateFormatter: t } = T, o = y?.decimalDigits || 0, m = y?.code || "USD", a = b?.decimalSymbol || 0.1.toLocaleString().substring(1, 2), s = b?.thousandsSymbol || 1e3.toLocaleString().substring(1, 2), n = t?.dateFormat || "yyyy-MM-dd", c = t?.dateMask || "____-__-__", i = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", u = t?.datetimeMask || "____-__-__ __:__:__", d = t?.timeFormat || "HH:mm:ss", _ = t?.timeMask || "__:__:__", l = t?.formatDate || (() => {
|
|
8
8
|
throw new Error("Incorrect use of formatDate");
|
|
9
|
-
}),
|
|
9
|
+
}), M = x(), { events_emit: D } = N(), [r, f] = p({
|
|
10
10
|
currencyFormatter: {
|
|
11
|
-
decimalDigits:
|
|
12
|
-
code:
|
|
11
|
+
decimalDigits: o,
|
|
12
|
+
code: m
|
|
13
13
|
},
|
|
14
14
|
numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
|
|
15
15
|
dateFormatter: {
|
|
16
|
-
dateFormat:
|
|
17
|
-
dateMask:
|
|
18
|
-
datetimeFormat:
|
|
19
|
-
datetimeMask:
|
|
20
|
-
timeFormat:
|
|
21
|
-
timeMask:
|
|
22
|
-
formatDate:
|
|
16
|
+
dateFormat: n,
|
|
17
|
+
dateMask: c,
|
|
18
|
+
datetimeFormat: i,
|
|
19
|
+
datetimeMask: u,
|
|
20
|
+
timeFormat: d,
|
|
21
|
+
timeMask: _,
|
|
22
|
+
formatDate: l
|
|
23
23
|
}
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
}, [])
|
|
27
|
-
|
|
24
|
+
}), H = S((e) => {
|
|
25
|
+
f(e);
|
|
26
|
+
}, []), h = S((e) => R({
|
|
27
|
+
...e,
|
|
28
|
+
decimalSymbol: r.numberFormatter.decimalSymbol,
|
|
29
|
+
thousandsSymbol: r.numberFormatter.thousandsSymbol
|
|
30
|
+
}), [r.numberFormatter.decimalSymbol, r.numberFormatter.thousandsSymbol]);
|
|
31
|
+
return V({
|
|
28
32
|
isMicroFrontEnd: F,
|
|
29
|
-
event:
|
|
30
|
-
setHandler:
|
|
33
|
+
event: E.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
|
|
34
|
+
setHandler: H
|
|
31
35
|
}), v(() => {
|
|
32
|
-
if (F ||
|
|
36
|
+
if (F || M)
|
|
33
37
|
return;
|
|
34
38
|
const e = {
|
|
35
|
-
currencyFormatter: { decimalDigits:
|
|
39
|
+
currencyFormatter: { decimalDigits: o, code: m },
|
|
36
40
|
numberFormatter: { decimalSymbol: a, thousandsSymbol: s },
|
|
37
41
|
dateFormatter: {
|
|
38
|
-
dateFormat:
|
|
39
|
-
dateMask:
|
|
40
|
-
datetimeFormat:
|
|
41
|
-
datetimeMask:
|
|
42
|
-
timeFormat:
|
|
43
|
-
timeMask:
|
|
44
|
-
formatDate:
|
|
42
|
+
dateFormat: n,
|
|
43
|
+
dateMask: c,
|
|
44
|
+
datetimeFormat: i,
|
|
45
|
+
datetimeMask: u,
|
|
46
|
+
timeFormat: d,
|
|
47
|
+
timeMask: _,
|
|
48
|
+
formatDate: l
|
|
45
49
|
}
|
|
46
50
|
};
|
|
47
|
-
|
|
51
|
+
f(e), D(E.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
|
|
48
52
|
}, [
|
|
49
|
-
|
|
53
|
+
M,
|
|
54
|
+
m,
|
|
50
55
|
o,
|
|
51
|
-
r,
|
|
52
56
|
a,
|
|
53
57
|
s,
|
|
54
|
-
m,
|
|
55
58
|
n,
|
|
56
59
|
c,
|
|
57
60
|
i,
|
|
58
|
-
|
|
61
|
+
u,
|
|
59
62
|
d,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
_,
|
|
64
|
+
l
|
|
65
|
+
]), /* @__PURE__ */ C(
|
|
66
|
+
A.Provider,
|
|
63
67
|
{
|
|
64
68
|
value: {
|
|
65
|
-
...
|
|
69
|
+
...r,
|
|
70
|
+
formatNumber: h
|
|
66
71
|
},
|
|
67
|
-
children:
|
|
72
|
+
children: g
|
|
68
73
|
}
|
|
69
74
|
);
|
|
70
75
|
}
|
|
71
76
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
A as FormatterContext,
|
|
78
|
+
G as FormatterProvider
|
|
74
79
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Locale } from 'date-fns';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { ResolveNumberPresentationOptions } from '@m4l/core';
|
|
3
4
|
export interface CurrencyFormatter {
|
|
4
5
|
code: string;
|
|
5
6
|
decimalDigits: number;
|
|
@@ -55,5 +56,7 @@ export interface FormatterProviderProps extends OptionalFormatters {
|
|
|
55
56
|
isMicroFrontEnd: boolean;
|
|
56
57
|
children: ReactNode;
|
|
57
58
|
}
|
|
58
|
-
export
|
|
59
|
+
export interface FormatterContextProps extends Formatters {
|
|
60
|
+
formatNumber: (options: ResolveNumberPresentationOptions) => string;
|
|
61
|
+
}
|
|
59
62
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/FormatterContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IAGb,aAAa,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AACD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,CACV,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzC,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,2BAA2B,CAAC,EAAE,OAAO,CAAC;QACtC,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC,KACE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,UAAU;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IAEjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AACD;GACG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAEhE,eAAe,EAAE,OAAO,CAAC;IAGzB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,YAAY,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,MAAM,CAAC;CACrE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseLocale, LocaleType, NetworkLocaleType } from './types';
|
|
1
|
+
import { BaseLocale, LocaleType, NetworkLocaleType, SupportedLocales } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Obtiene el locale de la red
|
|
4
4
|
* @author Juan Escobar - automatic
|
|
@@ -7,6 +7,10 @@ import { BaseLocale, LocaleType, NetworkLocaleType } from './types';
|
|
|
7
7
|
* @updatedUser Juan Escobar - automatic
|
|
8
8
|
*/
|
|
9
9
|
export declare function getLocaleFromNetwork(locale: NetworkLocaleType, host_static_assets: string, environment_assets: string): Promise<LocaleType>;
|
|
10
|
+
/**
|
|
11
|
+
* Collapse one locale string into the closest locale currently supported by the host.
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizeSupportedLocaleString(locale?: string | null): SupportedLocales | null;
|
|
10
14
|
/**
|
|
11
15
|
* Une los elementos de un locale
|
|
12
16
|
* @author Juan Escobar - automatic
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/LocalesContext/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/LocalesContext/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMtF;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,UAAU,CAAC,CA0BrB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,gBAAgB,GAAG,IAAI,CAoBzB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAYzD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAgBtD"}
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import o from "date-fns/locale/en-US";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
const s = "en-US";
|
|
3
|
+
async function f(r, n, c) {
|
|
4
|
+
const i = l(r), e = { ...r };
|
|
5
|
+
let t;
|
|
6
|
+
return i === "es" ? t = (await import("date-fns/locale/es")).default : i === "fr" ? t = (await import("date-fns/locale/fr")).default : i === "en-US" ? t = o : (t = o, e.lang = "en", e.script = void 0, e.region = "US", e.urlIcon = `${n}/${c}/frontend/commons/assets/icons/langs/lang_en.svg`, e.name = "English US*"), {
|
|
7
|
+
...e,
|
|
8
|
+
module: t,
|
|
9
|
+
localeString: l(e)
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
function a(r) {
|
|
13
|
+
if (!r)
|
|
14
|
+
return null;
|
|
15
|
+
const { lang: n } = g(r);
|
|
16
|
+
return n === "es" ? "es" : n === "fr" ? "fr" : n === "en" ? "en-US" : s;
|
|
14
17
|
}
|
|
15
|
-
function
|
|
18
|
+
function l(r) {
|
|
19
|
+
let n = r.lang;
|
|
20
|
+
return r.script && r.script !== "" && (n = n + "-" + r.script), r.region && r.region !== "" && (n = n + "-" + r.region), n;
|
|
21
|
+
}
|
|
22
|
+
function g(r) {
|
|
16
23
|
try {
|
|
17
|
-
const
|
|
24
|
+
const n = new Intl.Locale(r);
|
|
18
25
|
return {
|
|
19
|
-
lang:
|
|
20
|
-
script:
|
|
21
|
-
region:
|
|
26
|
+
lang: n.language || "",
|
|
27
|
+
script: n.script,
|
|
28
|
+
region: n.region
|
|
22
29
|
};
|
|
23
30
|
} catch {
|
|
24
31
|
return {
|
|
@@ -29,7 +36,8 @@ function a(n) {
|
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
38
|
export {
|
|
32
|
-
|
|
39
|
+
f as getLocaleFromNetwork,
|
|
33
40
|
l as joinLocale,
|
|
34
|
-
a as
|
|
41
|
+
a as normalizeSupportedLocaleString,
|
|
42
|
+
g as splitLocale
|
|
35
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAI9B,MAAM,SAAS,CAAC;AAwGjB;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc,8BAA8B;;;;;;;;CAwKpF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,54 +1,46 @@
|
|
|
1
|
-
import { createStore as
|
|
2
|
-
import { devtools as
|
|
3
|
-
import { immer as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
function c(r, o = "m4l") {
|
|
1
|
+
import { createStore as c } from "zustand";
|
|
2
|
+
import { devtools as d } from "zustand/middleware";
|
|
3
|
+
import { immer as u } from "zustand/middleware/immer";
|
|
4
|
+
import { getPaletteByPreset as a, createCustomShadows as x, shadows as s, typographyOld as U, getColorPresets as m } from "@m4l/styles";
|
|
5
|
+
import { alpha as p } from "@mui/system";
|
|
6
|
+
import { defaultThemeSettings as g } from "./constants.js";
|
|
7
|
+
function l(o, r = "m4l") {
|
|
9
8
|
const n = document.querySelector("[data-mui-color-scheme]");
|
|
10
|
-
n && Object.keys(
|
|
11
|
-
const e =
|
|
9
|
+
n && Object.keys(o).forEach((t) => {
|
|
10
|
+
const e = o[t];
|
|
12
11
|
if (typeof e == "string" || typeof e == "number") {
|
|
13
|
-
const
|
|
14
|
-
n.style.setProperty(
|
|
15
|
-
} else typeof e == "object" && e !== null &&
|
|
12
|
+
const S = `--${r}-${t}`;
|
|
13
|
+
n.style.setProperty(S, e.toString());
|
|
14
|
+
} else typeof e == "object" && e !== null && l(e, `${r}-${t}`);
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
...
|
|
22
|
-
...
|
|
17
|
+
const h = (o) => {
|
|
18
|
+
const r = o.themeUserSettings || g, n = r.themeMode === "light", t = a(r.themeColor), e = n ? t.light : t.dark;
|
|
19
|
+
o.themeOptions = {
|
|
20
|
+
...o.themeOptions,
|
|
21
|
+
...U,
|
|
23
22
|
palette: {
|
|
24
|
-
...
|
|
23
|
+
...o.themeOptions?.palette ?? {},
|
|
25
24
|
...e
|
|
26
25
|
},
|
|
27
26
|
shape: { borderRadius: 8 },
|
|
28
|
-
direction:
|
|
29
|
-
shadows: n ?
|
|
27
|
+
direction: r.themeDirection,
|
|
28
|
+
shadows: n ? s.light : s.dark,
|
|
30
29
|
customShadows: {
|
|
31
|
-
primary: n ? `0 4px 8px -4px ${
|
|
32
|
-
0 2px 27px 2px ${
|
|
33
|
-
0 2px 27px 2px ${
|
|
34
|
-
...
|
|
35
|
-
primary2: n ? `0px 2px 3px 0px ${
|
|
30
|
+
primary: n ? `0 4px 8px -4px ${p(m(r.themeColor)?.enabledLight, 0.12)},
|
|
31
|
+
0 2px 27px 2px ${p(m(r.themeColor)?.enabledLight, 0.02)}` : `0 4px 8px -4px ${p(m(r.themeColor)?.enabledDark, 0.12)},
|
|
32
|
+
0 2px 27px 2px ${p(m(r.themeColor)?.enabledDark, 0.02)}`,
|
|
33
|
+
...x(r.themeMode),
|
|
34
|
+
primary2: n ? `0px 2px 3px 0px ${p(m(r.themeColor)?.hoverOpacityLight, 0.2)}` : `0px 2px 3px 0px ${p(m(r.themeColor)?.hoverOpacityDark, 0.2)}`
|
|
36
35
|
},
|
|
37
|
-
stretch:
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
r.themeUserSettings.themeMode
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
const b = (r) => d(
|
|
49
|
-
u(
|
|
50
|
-
U((o, n) => ({
|
|
51
|
-
...r,
|
|
36
|
+
stretch: r.themeStretch
|
|
37
|
+
}, l(o.themeOptions);
|
|
38
|
+
}, i = (o) => {
|
|
39
|
+
o.themeSettingsPersistFn?.(o.themeUserSettings);
|
|
40
|
+
}, T = (o) => c(
|
|
41
|
+
d(
|
|
42
|
+
u((r, n) => ({
|
|
43
|
+
...o,
|
|
52
44
|
settingsActions: {
|
|
53
45
|
/**
|
|
54
46
|
* Inicializa la tienda de configuración del tema
|
|
@@ -58,8 +50,8 @@ const b = (r) => d(
|
|
|
58
50
|
* @updatedUser Juan Escobar - automatic
|
|
59
51
|
*/
|
|
60
52
|
init: () => {
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
r((t) => {
|
|
54
|
+
h(t);
|
|
63
55
|
});
|
|
64
56
|
},
|
|
65
57
|
/**
|
|
@@ -70,9 +62,8 @@ const b = (r) => d(
|
|
|
70
62
|
* @updatedUser Juan Escobar - automatic
|
|
71
63
|
*/
|
|
72
64
|
setThemeSettings: (t) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
e.themeUserSettings = { ...e.themeUserSettings, ...t }, h(e), m(e), p !== e.themeUserSettings.themeMode && g(e);
|
|
65
|
+
r((e) => {
|
|
66
|
+
e.themeUserSettings = { ...e.themeUserSettings, ...t }, i(e), h(e);
|
|
76
67
|
});
|
|
77
68
|
},
|
|
78
69
|
/**
|
|
@@ -83,19 +74,11 @@ const b = (r) => d(
|
|
|
83
74
|
* @updatedUser Juan Escobar - automatic
|
|
84
75
|
*/
|
|
85
76
|
onChangeMode: (t) => {
|
|
86
|
-
|
|
77
|
+
r((e) => {
|
|
87
78
|
t !== e.themeUserSettings.themeMode && (e.themeUserSettings = {
|
|
88
79
|
...e.themeUserSettings,
|
|
89
80
|
themeMode: t
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
/**
|
|
94
|
-
* Register the host-tools emitter used to broadcast theme-mode changes.
|
|
95
|
-
*/
|
|
96
|
-
registerHostToolsEventsEmit: (t) => {
|
|
97
|
-
o((e) => {
|
|
98
|
-
e.hostToolsEventsEmit = t;
|
|
81
|
+
}, i(e), h(e));
|
|
99
82
|
});
|
|
100
83
|
},
|
|
101
84
|
/**
|
|
@@ -106,7 +89,7 @@ const b = (r) => d(
|
|
|
106
89
|
* @updatedUser Juan Escobar - automatic
|
|
107
90
|
*/
|
|
108
91
|
handleOpen: () => {
|
|
109
|
-
|
|
92
|
+
r((t) => {
|
|
110
93
|
t.open = !t.open;
|
|
111
94
|
});
|
|
112
95
|
},
|
|
@@ -118,11 +101,11 @@ const b = (r) => d(
|
|
|
118
101
|
* @updatedUser Juan Escobar - automatic
|
|
119
102
|
*/
|
|
120
103
|
onChangeDirection: (t) => {
|
|
121
|
-
|
|
104
|
+
r((e) => {
|
|
122
105
|
t !== e.themeUserSettings.themeDirection && (e.themeUserSettings = {
|
|
123
106
|
...e.themeUserSettings,
|
|
124
107
|
themeDirection: t
|
|
125
|
-
},
|
|
108
|
+
}, i(e), h(e));
|
|
126
109
|
});
|
|
127
110
|
},
|
|
128
111
|
/**
|
|
@@ -133,11 +116,11 @@ const b = (r) => d(
|
|
|
133
116
|
* @updatedUser Juan Escobar - automatic
|
|
134
117
|
*/
|
|
135
118
|
onChangeColor: (t) => {
|
|
136
|
-
|
|
119
|
+
r((e) => {
|
|
137
120
|
t !== e.themeUserSettings.themeColor && (e.themeUserSettings = {
|
|
138
121
|
...e.themeUserSettings,
|
|
139
122
|
themeColor: t
|
|
140
|
-
},
|
|
123
|
+
}, i(e), h(e));
|
|
141
124
|
});
|
|
142
125
|
},
|
|
143
126
|
/**
|
|
@@ -148,11 +131,11 @@ const b = (r) => d(
|
|
|
148
131
|
* @updatedUser Juan Escobar - automatic
|
|
149
132
|
*/
|
|
150
133
|
onChangeLayout: (t) => {
|
|
151
|
-
|
|
134
|
+
r((e) => {
|
|
152
135
|
e.themeUserSettings = {
|
|
153
136
|
...e.themeUserSettings,
|
|
154
137
|
themeLayout: t.target.value
|
|
155
|
-
},
|
|
138
|
+
}, i(e), h(e);
|
|
156
139
|
});
|
|
157
140
|
},
|
|
158
141
|
/**
|
|
@@ -163,11 +146,11 @@ const b = (r) => d(
|
|
|
163
146
|
* @updatedUser Juan Escobar - automatic
|
|
164
147
|
*/
|
|
165
148
|
onToggleStretch: () => {
|
|
166
|
-
|
|
149
|
+
r((t) => {
|
|
167
150
|
t.themeUserSettings = {
|
|
168
151
|
...t.themeUserSettings,
|
|
169
152
|
themeStretch: !t.themeUserSettings.themeStretch
|
|
170
|
-
},
|
|
153
|
+
}, i(t), h(t);
|
|
171
154
|
});
|
|
172
155
|
},
|
|
173
156
|
/**
|
|
@@ -178,11 +161,10 @@ const b = (r) => d(
|
|
|
178
161
|
* @updatedUser Juan Escobar - automatic
|
|
179
162
|
*/
|
|
180
163
|
onResetSetting: () => {
|
|
181
|
-
|
|
182
|
-
const e = t.themeUserSettings.themeMode;
|
|
164
|
+
r((t) => {
|
|
183
165
|
t.themeUserSettings = {
|
|
184
|
-
...
|
|
185
|
-
},
|
|
166
|
+
...g
|
|
167
|
+
}, i(t), h(t);
|
|
186
168
|
});
|
|
187
169
|
}
|
|
188
170
|
}
|
|
@@ -191,5 +173,5 @@ const b = (r) => d(
|
|
|
191
173
|
)
|
|
192
174
|
);
|
|
193
175
|
export {
|
|
194
|
-
|
|
176
|
+
T as createThemeSettingsStore
|
|
195
177
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EmmitFunction } from '@m4l/core';
|
|
2
1
|
import { PresetsOptionsColorMain, ThemeUserColor } from '@m4l/styles';
|
|
3
2
|
import { Theme } from '@mui/material/styles';
|
|
4
3
|
import { ReactNode } from 'react';
|
|
@@ -42,11 +41,6 @@ export interface ThemeSettingsStore {
|
|
|
42
41
|
* @updatedUser Juan Escobar - automatic
|
|
43
42
|
*/
|
|
44
43
|
themeSettingsPersistFn?: (newValue: ThemeUserSettings) => void;
|
|
45
|
-
/**
|
|
46
|
-
* Host-owned event emitter injected when this store should broadcast mode changes
|
|
47
|
-
* through the shared host-tools contract.
|
|
48
|
-
*/
|
|
49
|
-
hostToolsEventsEmit?: EmmitFunction;
|
|
50
44
|
/**
|
|
51
45
|
* "open" es una variable que se encarga de abrir o cerrar el formulario
|
|
52
46
|
* @createdAt 2024-10-08 13:22:53 - automatic
|
|
@@ -65,7 +59,6 @@ export interface ThemeSettingsStateWithActions extends ThemeSettingsStore {
|
|
|
65
59
|
onChangeColor: (color: ThemeUserColor) => void;
|
|
66
60
|
onChangeLayout: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
67
61
|
handleOpen: () => void;
|
|
68
|
-
registerHostToolsEventsEmit: (eventsEmit?: EmmitFunction) => void;
|
|
69
62
|
setThemeSettings: (newValue: Partial<ThemeUserSettings>) => void;
|
|
70
63
|
};
|
|
71
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,uBAAuB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAG,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,KAAK,CAAC;AAC/C,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,YAAY,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,gBAAgB,CAAC;IAC/B,WAAW,EAAE,eAAe,CAAC;CAE9B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,YAAY,EAAE,KAAK,CAAC;IACpB;;;OAGG;IACH,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,MAAM,8BAA8B,GAAG,kBAAkB,CAAC;AAChE,MAAM,MAAM,8BAA8B,GAAG,8BAA8B,CAAC;AAE5E,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,eAAe,EAAE;QACf,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,eAAe,EAAE,MAAM,IAAI,CAAC;QAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;QAC3B,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;QAC5C,iBAAiB,EAAE,CAAC,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAC;QAC3D,aAAa,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;QAC/C,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACrE,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KAClE,CAAC;CACH;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
|
package/contexts/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export * from './FormatterContext';
|
|
2
|
+
export { buildFormattersFromUserPreferences } from './FormatterContext/helpers';
|
|
2
3
|
export type { Formatters, DateFormatter, NumberFormatter, CurrencyFormatter, } from './FormatterContext/types';
|
|
3
4
|
export * from './AppearanceComponentContext';
|
|
4
5
|
export * from './LocalesContext';
|
|
5
6
|
export * from './ResponsiveContainerContext';
|
|
6
7
|
export type { BreakpointType } from './ResponsiveContainerContext/types';
|
|
7
8
|
export type { NetworkLocaleType, LocaleType } from './LocalesContext/types';
|
|
8
|
-
export { getLocaleFromNetwork } from './LocalesContext/helper';
|
|
9
|
+
export { getLocaleFromNetwork, normalizeSupportedLocaleString, splitLocale, } from './LocalesContext/helper';
|
|
9
10
|
export * from './HostThemeContext';
|
|
10
11
|
export * from './DeviceTypeContext';
|
|
11
12
|
export * from './ThemeSettingsContext';
|
package/contexts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAChF,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAEvC,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserPreferences } from '@m4l/core';
|
|
2
2
|
import { LocaleType } from '../../contexts';
|
|
3
3
|
export declare const STORYBOOK_LOCALE_HOST_EN: LocaleType;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const STORYBOOK_USER_PREFERENCES: UserPreferences;
|
|
5
5
|
export declare const STORYBOOK_THEME_MODE = "light";
|
|
6
6
|
export declare const STORYBOOK_THEME_COLOR = "patronus";
|
|
7
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,wBAAwB,EAAE,UAStC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAkBxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,aAAa,CAAC"}
|
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "date-fns/locale/en-US";
|
|
2
2
|
const o = {
|
|
3
3
|
lang: "en",
|
|
4
4
|
script: void 0,
|
|
5
5
|
region: "US",
|
|
6
6
|
name: "English US",
|
|
7
7
|
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/commons/assets/icons/langs/lang_en.svg",
|
|
8
|
-
module:
|
|
8
|
+
module: e,
|
|
9
9
|
localeString: "en-US"
|
|
10
|
-
},
|
|
11
|
-
|
|
10
|
+
}, n = {
|
|
11
|
+
decimalSymbol: ".",
|
|
12
|
+
thousandsSymbol: ",",
|
|
13
|
+
dateFormat: "yyyy-MM-dd",
|
|
14
|
+
timeFormat: "HH:mm:ss",
|
|
15
|
+
timeZone: {
|
|
16
|
+
id: 1,
|
|
17
|
+
name: "America/Bogota",
|
|
18
|
+
title: "Bogota",
|
|
19
|
+
baseOffset: -5,
|
|
20
|
+
dstOffset: -5,
|
|
21
|
+
countryCode: "CO"
|
|
22
|
+
},
|
|
23
|
+
locale: o.localeString,
|
|
24
|
+
magnitudesSystemId: -1,
|
|
25
|
+
properties: [],
|
|
12
26
|
currency: "USD",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
thousands_symbol: ","
|
|
16
|
-
}, t = "light", O = "patronus";
|
|
27
|
+
currencyDecimalDigits: 2
|
|
28
|
+
}, s = "light", a = "patronus";
|
|
17
29
|
export {
|
|
18
|
-
e as STORYBOOK_DOMAIN_COUNTRY,
|
|
19
30
|
o as STORYBOOK_LOCALE_HOST_EN,
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
a as STORYBOOK_THEME_COLOR,
|
|
32
|
+
s as STORYBOOK_THEME_MODE,
|
|
33
|
+
n as STORYBOOK_USER_PREFERENCES
|
|
22
34
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MFAuthAppStorybookProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Provide the shared Storybook theme
|
|
3
|
+
* Provide the shared Storybook theme plus the same effective-preferences seam used by runtime shells.
|
|
4
4
|
*/
|
|
5
5
|
export declare function MFAppStorybook(props: MFAuthAppStorybookProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=MFAppStorybook.d.ts.map
|
package/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MFAppStorybook.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MFAppStorybook.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/graphics/src/decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,uBAAuB,oDAsB5D"}
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { UserPreferencesProvider as m } from "@m4l/core";
|
|
3
|
+
import { fnComponentsOverrides as s, getUserThemeOptions as n } from "@m4l/styles";
|
|
4
|
+
import { useMemo as O } from "react";
|
|
5
|
+
import { STORYBOOK_USER_PREFERENCES as o, STORYBOOK_THEME_MODE as f, STORYBOOK_THEME_COLOR as p } from "../../constants.js";
|
|
6
|
+
import { buildFormattersFromUserPreferences as E } from "../../../../contexts/FormatterContext/helpers.js";
|
|
7
|
+
import { HostThemeProvider as c } from "../../../../contexts/HostThemeContext/index.js";
|
|
8
|
+
import { FormatterProvider as d } from "../../../../contexts/FormatterContext/index.js";
|
|
9
|
+
function S(e) {
|
|
10
|
+
const { children: t } = e, i = O(() => E(o), []);
|
|
10
11
|
return /* @__PURE__ */ r(
|
|
11
|
-
|
|
12
|
+
c,
|
|
12
13
|
{
|
|
13
|
-
hostThemeOptions:
|
|
14
|
-
fnComponentsOverrides:
|
|
14
|
+
hostThemeOptions: n(f, p),
|
|
15
|
+
fnComponentsOverrides: s,
|
|
15
16
|
isMicroFrontEnd: !0,
|
|
16
|
-
children: /* @__PURE__ */ r(
|
|
17
|
-
|
|
17
|
+
children: /* @__PURE__ */ r(
|
|
18
|
+
m,
|
|
18
19
|
{
|
|
19
20
|
isMicroFrontEnd: !1,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
currencyFormatter: {
|
|
24
|
-
code: o.currency,
|
|
25
|
-
decimalDigits: o.currency_decimal_digits
|
|
26
|
-
},
|
|
27
|
-
children: e
|
|
21
|
+
...o,
|
|
22
|
+
children: /* @__PURE__ */ r(d, { isMicroFrontEnd: !1, ...i, children: t })
|
|
28
23
|
}
|
|
29
|
-
)
|
|
24
|
+
)
|
|
30
25
|
}
|
|
31
26
|
);
|
|
32
27
|
}
|
|
33
28
|
export {
|
|
34
|
-
|
|
29
|
+
S as MFAppStorybook
|
|
35
30
|
};
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @updatedAt 2024-10-06 20:07:18 - automatic
|
|
6
6
|
* @updatedUser Juan Escobar - automatic
|
|
7
7
|
*/
|
|
8
|
-
export declare const useFormatter: () => import('
|
|
8
|
+
export declare const useFormatter: () => import('../../contexts/FormatterContext/types').FormatterContextProps;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/hooks/useFormatter/index.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/hooks/useFormatter/index.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,6EAOxB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { GlobalStyles as
|
|
1
|
+
import { GlobalStyles as r } from "./components/GlobalStyles/index.js";
|
|
2
2
|
import { M4L_CHROMATIC_AUTOFILL as p, getInputAutofillBodyNestedStyles as m, getInputAutofillKeyframeStyles as n } from "./components/GlobalStyles/getInputAutofillGlobalStyles.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
3
|
+
import { buildFormattersFromUserPreferences as x } from "./contexts/FormatterContext/helpers.js";
|
|
4
|
+
import { getLocaleFromNetwork as i, normalizeSupportedLocaleString as a, splitLocale as l } from "./contexts/LocalesContext/helper.js";
|
|
5
|
+
import { FormatterContext as C, FormatterProvider as S } from "./contexts/FormatterContext/index.js";
|
|
6
|
+
import { AppearanceComponentContext as c, AppearanceComponentProvider as d } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
7
|
+
import { createAppearanceComponentStore as v } from "./contexts/AppearanceComponentContext/AppearanceComponentStore.js";
|
|
8
|
+
import { useAppearanceComponentStore as g } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
|
|
9
|
+
import { LocalesContext as L, LocalesProvider as F } from "./contexts/LocalesContext/index.js";
|
|
10
|
+
import { ResponsiveContainerContext as R, ResponsiveContainerProvider as b } from "./contexts/ResponsiveContainerContext/index.js";
|
|
11
|
+
import { HostThemeContext as M, HostThemeProvider as k } from "./contexts/HostThemeContext/index.js";
|
|
12
|
+
import { DeviceTypeContext as O, DeviceTypeProvider as _ } from "./contexts/DeviceTypeContext/index.js";
|
|
13
|
+
import { KEY_LOCAL_STORAGE_THEME_SETTINGS as z, defaultThemeSettings as W } from "./contexts/ThemeSettingsContext/constants.js";
|
|
14
|
+
import { ThemeSettingsContext as D, ThemeSettingsProvider as G } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
|
|
15
|
+
import { WithAppearanceContext as U } from "./decorators/WithAppearanceContext/WithAppearanceContext.js";
|
|
16
|
+
import { MFIsolationAppStorybook as B } from "./decorators/MFIsolationAppStorybook/MFIsolationAppStorybook.js";
|
|
17
|
+
import { MFAppStorybook as j } from "./decorators/MFIsolationAppStorybook/subcomponents/MFAppStorybook/MFAppStorybook.js";
|
|
18
|
+
import { WithStorybookThemeContext as J, createWithStorybookThemeContext as Q } from "./decorators/WithStorybookThemeContext/WithStorybookThemeContext.js";
|
|
19
|
+
import { useFirstRender as X } from "./hooks/useFirstRender/index.js";
|
|
20
|
+
import { useComponentSize as $ } from "./hooks/useComponentSize/useComponentSize.js";
|
|
21
|
+
import { useFormatter as oe } from "./hooks/useFormatter/index.js";
|
|
22
|
+
import { useIsMountedRef as te } from "./hooks/useIsMountedRef/index.js";
|
|
23
|
+
import { useLocales as me } from "./hooks/useLocales/index.js";
|
|
24
|
+
import { useResponsiveContainerStore as se } from "./hooks/useResponsiveContainer/index.js";
|
|
25
|
+
import { useUserAgent as fe } from "./hooks/useUserAgent/index.js";
|
|
26
|
+
import { useIsMobile as ae } from "./hooks/useIsMobile/index.js";
|
|
27
|
+
import { useOffSetTop as ue } from "./hooks/useOffSetTop.js";
|
|
28
|
+
import { useHostTheme as Se } from "./hooks/useHostTheme/index.js";
|
|
29
|
+
import { useResizeObserver as ce } from "./hooks/useResizeObserver/index.js";
|
|
30
|
+
import { useResponsiveDesktop as Ae } from "./hooks/useResponsive/index.js";
|
|
31
|
+
import { useThemeSettingsStore as he } from "./hooks/useThemSettingsStore/index.js";
|
|
32
|
+
import { usePaginate as ye } from "./hooks/usePaginate/index.js";
|
|
33
|
+
import { useRows as Fe } from "./hooks/useRows/index.js";
|
|
34
|
+
import { capitalize as Re } from "./utils/strings.js";
|
|
35
|
+
import { getAnchorElPositionWindow as Ie } from "./utils/anchorEl.js";
|
|
36
|
+
import { getContrastTextColor as ke } from "./utils/getContrastTextColor/getContrastTextColor.js";
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
c as AppearanceComponentContext,
|
|
39
|
+
d as AppearanceComponentProvider,
|
|
40
|
+
O as DeviceTypeContext,
|
|
41
|
+
_ as DeviceTypeProvider,
|
|
42
|
+
C as FormatterContext,
|
|
43
|
+
S as FormatterProvider,
|
|
44
|
+
r as GlobalStyles,
|
|
45
|
+
M as HostThemeContext,
|
|
46
|
+
k as HostThemeProvider,
|
|
47
|
+
z as KEY_LOCAL_STORAGE_THEME_SETTINGS,
|
|
48
|
+
L as LocalesContext,
|
|
49
|
+
F as LocalesProvider,
|
|
49
50
|
p as M4L_CHROMATIC_AUTOFILL,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
j as MFAppStorybook,
|
|
52
|
+
B as MFIsolationAppStorybook,
|
|
53
|
+
R as ResponsiveContainerContext,
|
|
54
|
+
b as ResponsiveContainerProvider,
|
|
55
|
+
D as ThemeSettingsContext,
|
|
56
|
+
G as ThemeSettingsProvider,
|
|
57
|
+
U as WithAppearanceContext,
|
|
58
|
+
J as WithStorybookThemeContext,
|
|
59
|
+
x as buildFormattersFromUserPreferences,
|
|
60
|
+
Re as capitalize,
|
|
61
|
+
v as createAppearanceComponentStore,
|
|
62
|
+
Q as createWithStorybookThemeContext,
|
|
63
|
+
W as defaultThemeSettings,
|
|
64
|
+
Ie as getAnchorElPositionWindow,
|
|
65
|
+
ke as getContrastTextColor,
|
|
64
66
|
m as getInputAutofillBodyNestedStyles,
|
|
65
67
|
n as getInputAutofillKeyframeStyles,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ue as
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
i as getLocaleFromNetwork,
|
|
69
|
+
a as normalizeSupportedLocaleString,
|
|
70
|
+
l as splitLocale,
|
|
71
|
+
g as useAppearanceComponentStore,
|
|
72
|
+
$ as useComponentSize,
|
|
73
|
+
X as useFirstRender,
|
|
74
|
+
oe as useFormatter,
|
|
75
|
+
Se as useHostTheme,
|
|
76
|
+
ae as useIsMobile,
|
|
77
|
+
te as useIsMountedRef,
|
|
78
|
+
me as useLocales,
|
|
79
|
+
ue as useOffSetTop,
|
|
80
|
+
ye as usePaginate,
|
|
81
|
+
ce as useResizeObserver,
|
|
82
|
+
se as useResponsiveContainerStore,
|
|
83
|
+
Ae as useResponsiveDesktop,
|
|
84
|
+
Fe as useRows,
|
|
85
|
+
he as useThemeSettingsStore,
|
|
86
|
+
fe as useUserAgent
|
|
83
87
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/graphics",
|
|
3
|
-
"version": "7.5.0
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@emotion/react": "11.14.0",
|
|
44
44
|
"@mui/material": "5.16.7",
|
|
45
45
|
"date-fns": "2.30.0",
|
|
46
|
+
"date-fns-tz": "2.0.0",
|
|
46
47
|
"react": "19.2.4",
|
|
47
48
|
"zustand": "4.3.6",
|
|
48
49
|
"@mui/x-date-pickers": "6.20.2",
|