@m4l/graphics 7.2.2 → 7.2.3-beta.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/index.d.ts +1 -0
- package/index.js +43 -43
- package/lib/graphics.d.ts +6 -0
- package/lib/graphics.d.ts.map +1 -0
- package/package.json +29 -57
- package/components/GlobalStyles/index.d.ts +0 -8
- package/components/GlobalStyles/index.js +0 -82
- package/components/index.d.ts +0 -1
- package/components/index.js +0 -1
- package/contexts/DeviceTypeContext/helper.d.ts +0 -9
- package/contexts/DeviceTypeContext/helper.js +0 -4
- package/contexts/DeviceTypeContext/index.d.ts +0 -15
- package/contexts/DeviceTypeContext/index.js +0 -18
- package/contexts/DeviceTypeContext/store.d.ts +0 -18
- package/contexts/DeviceTypeContext/store.js +0 -36
- package/contexts/DeviceTypeContext/types.d.ts +0 -36
- package/contexts/FormatterContext/index.d.ts +0 -12
- package/contexts/FormatterContext/index.js +0 -74
- package/contexts/FormatterContext/types.d.ts +0 -58
- package/contexts/HostThemeContext/index.d.ts +0 -11
- package/contexts/HostThemeContext/index.js +0 -46
- package/contexts/HostThemeContext/types.d.ts +0 -17
- package/contexts/LocalesContext/helper.d.ts +0 -25
- package/contexts/LocalesContext/helper.js +0 -35
- package/contexts/LocalesContext/index.d.ts +0 -11
- package/contexts/LocalesContext/index.js +0 -71
- package/contexts/LocalesContext/types.d.ts +0 -26
- package/contexts/ResponsiveContainerContext/constants.d.ts +0 -2
- package/contexts/ResponsiveContainerContext/constants.js +0 -4
- package/contexts/ResponsiveContainerContext/index.d.ts +0 -16
- package/contexts/ResponsiveContainerContext/index.js +0 -51
- package/contexts/ResponsiveContainerContext/store.d.ts +0 -18
- package/contexts/ResponsiveContainerContext/store.js +0 -33
- package/contexts/ResponsiveContainerContext/types.d.ts +0 -26
- package/contexts/ThemeSettingsContext/ThemeSettingsContext.d.ts +0 -19
- package/contexts/ThemeSettingsContext/ThemeSettingsContext.js +0 -32
- package/contexts/ThemeSettingsContext/constants.d.ts +0 -2
- package/contexts/ThemeSettingsContext/constants.js +0 -10
- package/contexts/ThemeSettingsContext/index.d.ts +0 -3
- package/contexts/ThemeSettingsContext/index.js +0 -1
- package/contexts/ThemeSettingsContext/store.d.ts +0 -19
- package/contexts/ThemeSettingsContext/store.js +0 -177
- package/contexts/ThemeSettingsContext/types.d.ts +0 -71
- package/contexts/index.d.ts +0 -12
- package/contexts/index.js +0 -1
- package/hooks/index.d.ts +0 -14
- package/hooks/index.js +0 -1
- package/hooks/useFirstRender/index.d.ts +0 -9
- package/hooks/useFirstRender/index.js +0 -10
- package/hooks/useFormatter/index.d.ts +0 -8
- package/hooks/useFormatter/index.js +0 -11
- package/hooks/useHostTheme/index.d.ts +0 -8
- package/hooks/useHostTheme/index.js +0 -11
- package/hooks/useIsMobile/index.d.ts +0 -14
- package/hooks/useIsMobile/index.js +0 -16
- package/hooks/useIsMountedRef/index.d.ts +0 -8
- package/hooks/useIsMountedRef/index.js +0 -13
- package/hooks/useLocales/index.d.ts +0 -8
- package/hooks/useLocales/index.js +0 -11
- package/hooks/useOffSetTop.d.ts +0 -8
- package/hooks/useOffSetTop.js +0 -12
- package/hooks/usePaginate/index.d.ts +0 -14
- package/hooks/usePaginate/index.js +0 -76
- package/hooks/usePaginate/index.test.d.ts +0 -35
- package/hooks/usePaginate/types.d.ts +0 -21
- package/hooks/usePaginate/types.js +0 -8
- package/hooks/useResizeObserver/index.d.ts +0 -9
- package/hooks/useResizeObserver/index.js +0 -18
- package/hooks/useResponsive/index.d.ts +0 -5
- package/hooks/useResponsive/index.js +0 -7
- package/hooks/useResponsiveContainer/index.d.ts +0 -6
- package/hooks/useResponsiveContainer/index.js +0 -12
- package/hooks/useRows/index.d.ts +0 -11
- package/hooks/useRows/index.js +0 -70
- package/hooks/useRows/index.test.d.ts +0 -1
- package/hooks/useRows/state.d.ts +0 -29
- package/hooks/useRows/state.js +0 -25
- package/hooks/useRows/state.test.d.ts +0 -1
- package/hooks/useRows/types.d.ts +0 -9
- package/hooks/useThemSettingsStore/index.d.ts +0 -9
- package/hooks/useThemSettingsStore/index.js +0 -12
- package/hooks/useUserAgent/index.d.ts +0 -4
- package/hooks/useUserAgent/index.js +0 -25
- package/test/setup.d.ts +0 -0
- package/test/utils.d.ts +0 -9
- package/utils/anchorEl.d.ts +0 -20
- package/utils/anchorEl.js +0 -49
- package/utils/getContrastTextColor/getContrastTextColor.d.ts +0 -5
- package/utils/getContrastTextColor/getContrastTextColor.js +0 -14
- package/utils/getContrastTextColor/index.d.ts +0 -2
- package/utils/getContrastTextColor/index.js +0 -1
- package/utils/getContrastTextColor/types.d.ts +0 -2
- package/utils/index.d.ts +0 -3
- package/utils/index.js +0 -1
- package/utils/strings.d.ts +0 -1
- package/utils/strings.js +0 -4
- package/vite-env.d.ts +0 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 {
|
|
1
|
+
import { GlobalStyles as r } from "./components/GlobalStyles/index.js";
|
|
2
|
+
import { FormatterContext as s, FormatterProvider as m } from "./contexts/FormatterContext/index.js";
|
|
3
|
+
import { LocalesContext as x, LocalesProvider as f } from "./contexts/LocalesContext/index.js";
|
|
4
|
+
import { ResponsiveContainerContext as n, ResponsiveContainerProvider as a } from "./contexts/ResponsiveContainerContext/index.js";
|
|
5
|
+
import { getLocaleFromNetwork as v } from "./contexts/LocalesContext/helper.js";
|
|
6
|
+
import { HostThemeContext as C, HostThemeProvider as T } from "./contexts/HostThemeContext/index.js";
|
|
7
|
+
import { DeviceTypeContext as g, DeviceTypeProvider as c } from "./contexts/DeviceTypeContext/index.js";
|
|
8
|
+
import { ThemeSettingsContext as P, ThemeSettingsProvider as R } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
|
|
9
|
+
import { defaultThemeSettings as F } from "./contexts/ThemeSettingsContext/constants.js";
|
|
10
|
+
import { useFirstRender as b } from "./hooks/useFirstRender/index.js";
|
|
11
|
+
import { useFormatter as y } from "./hooks/useFormatter/index.js";
|
|
12
|
+
import { useIsMountedRef as H } from "./hooks/useIsMountedRef/index.js";
|
|
13
|
+
import { useLocales as z } from "./hooks/useLocales/index.js";
|
|
14
|
+
import { useResponsiveContainerStore as I } from "./hooks/useResponsiveContainer/index.js";
|
|
15
|
+
import { useUserAgent as O } from "./hooks/useUserAgent/index.js";
|
|
16
|
+
import { useIsMobile as G } from "./hooks/useIsMobile/index.js";
|
|
17
|
+
import { useOffSetTop as U } from "./hooks/useOffSetTop.js";
|
|
18
|
+
import { useHostTheme as j } from "./hooks/useHostTheme/index.js";
|
|
19
|
+
import { useResizeObserver as B } from "./hooks/useResizeObserver/index.js";
|
|
20
|
+
import { useResponsiveDesktop as K } from "./hooks/useResponsive/index.js";
|
|
21
|
+
import { useThemeSettingsStore as V } from "./hooks/useThemSettingsStore/index.js";
|
|
22
|
+
import { usePaginate as Y } from "./hooks/usePaginate/index.js";
|
|
23
|
+
import { useRows as _ } from "./hooks/useRows/index.js";
|
|
24
|
+
import { capitalize as ee } from "./utils/strings.js";
|
|
25
|
+
import { getAnchorElPositionWindow as re } from "./utils/anchorEl.js";
|
|
26
|
+
import { getContrastTextColor as se } from "./utils/getContrastTextColor/getContrastTextColor.js";
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
g as DeviceTypeContext,
|
|
29
29
|
c as DeviceTypeProvider,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
s as FormatterContext,
|
|
31
|
+
m as FormatterProvider,
|
|
32
32
|
r as GlobalStyles,
|
|
33
|
-
|
|
33
|
+
C as HostThemeContext,
|
|
34
34
|
T as HostThemeProvider,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
x as LocalesContext,
|
|
36
|
+
f as LocalesProvider,
|
|
37
37
|
n as ResponsiveContainerContext,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
a as ResponsiveContainerProvider,
|
|
39
|
+
P as ThemeSettingsContext,
|
|
40
|
+
R as ThemeSettingsProvider,
|
|
41
41
|
ee as capitalize,
|
|
42
|
-
|
|
42
|
+
F as defaultThemeSettings,
|
|
43
43
|
re as getAnchorElPositionWindow,
|
|
44
44
|
se as getContrastTextColor,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
v as getLocaleFromNetwork,
|
|
46
|
+
b as useFirstRender,
|
|
47
|
+
y as useFormatter,
|
|
48
48
|
j as useHostTheme,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
G as useIsMobile,
|
|
50
|
+
H as useIsMountedRef,
|
|
51
51
|
z as useLocales,
|
|
52
52
|
U as useOffSetTop,
|
|
53
53
|
Y as usePaginate,
|
|
54
54
|
B as useResizeObserver,
|
|
55
|
-
|
|
55
|
+
I as useResponsiveContainerStore,
|
|
56
56
|
K as useResponsiveDesktop,
|
|
57
57
|
_ as useRows,
|
|
58
58
|
V as useThemeSettingsStore,
|
|
59
|
-
|
|
59
|
+
O as useUserAgent
|
|
60
60
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphics.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/lib/graphics.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,WAAW,qDAM1B;AAED,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,68 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/graphics",
|
|
3
|
-
"version": "7.2.
|
|
4
|
-
"license": "UNLICENSED",
|
|
5
|
-
"author": "M4L Team*",
|
|
6
|
-
"type": "module",
|
|
3
|
+
"version": "7.2.3-beta.0",
|
|
7
4
|
"publishConfig": {
|
|
8
5
|
"access": "public"
|
|
9
6
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"date-fns": "^2.30.0",
|
|
15
|
-
"lodash-es": "^4.17.21",
|
|
16
|
-
"zustand": "4.3.6"
|
|
17
|
-
},
|
|
18
|
-
"peerDependencies": {
|
|
19
|
-
"@m4l/core": "^2.0.0",
|
|
20
|
-
"@m4l/styles": "^7.0.0",
|
|
21
|
-
"@mui/material": "5.16.7",
|
|
22
|
-
"@mui/x-date-pickers": "6.20.2",
|
|
23
|
-
"@types/react": "^18.0.0",
|
|
24
|
-
"react": "^18.0.0"
|
|
25
|
-
},
|
|
26
|
-
"peerDependenciesMeta": {
|
|
27
|
-
"@mui/material": {
|
|
28
|
-
"optional": true
|
|
29
|
-
},
|
|
30
|
-
"@mui/x-date-pickers": {
|
|
31
|
-
"optional": true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"resolutions": {
|
|
35
|
-
"eslint": "9.28.0",
|
|
36
|
-
"react": "^18.0.0",
|
|
37
|
-
"@types/react": "^18.0.0",
|
|
38
|
-
"@types/react-dom": "^18.0.0",
|
|
39
|
-
"react-dom": "^18.0.0",
|
|
40
|
-
"vite": "6.3.5"
|
|
41
|
-
},
|
|
42
|
-
"overrides": {
|
|
43
|
-
"eslint": "9.28.0",
|
|
44
|
-
"react": "^18.0.0",
|
|
45
|
-
"@types/react": "^18.0.0",
|
|
46
|
-
"@types/react-dom": "^18.0.0",
|
|
47
|
-
"react-dom": "^18.0.0",
|
|
48
|
-
"vite": "6.3.5"
|
|
49
|
-
},
|
|
50
|
-
"files": [
|
|
51
|
-
"*"
|
|
52
|
-
],
|
|
53
|
-
"source": "./index.js",
|
|
54
|
-
"main": "src/index.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./index.js",
|
|
55
9
|
"module": "./index.js",
|
|
56
10
|
"types": "./index.d.ts",
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"private": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"index.d.ts",
|
|
14
|
+
"lib/**/*"
|
|
15
|
+
],
|
|
63
16
|
"exports": {
|
|
17
|
+
"./package.json": "./package.json",
|
|
64
18
|
".": {
|
|
65
|
-
"
|
|
19
|
+
"types": "./index.d.ts",
|
|
20
|
+
"import": "./index.js",
|
|
21
|
+
"default": "./index.js"
|
|
66
22
|
}
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@emotion/react": "11.14.0",
|
|
26
|
+
"@emotion/styled": "11.14.1",
|
|
27
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
28
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@emotion/react": "11.14.0",
|
|
32
|
+
"@mui/material": "5.16.7",
|
|
33
|
+
"react": "^19.0.0",
|
|
34
|
+
"@mui/x-date-pickers": "6.20.2",
|
|
35
|
+
"lodash-es": "^4.17.21",
|
|
36
|
+
"date-fns": "^2.30.0",
|
|
37
|
+
"zustand": "4.3.6",
|
|
38
|
+
"fast-equals": "^5.0.1"
|
|
67
39
|
}
|
|
68
|
-
}
|
|
40
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Estilos globales
|
|
3
|
-
* @author Juan Escobar - automatic
|
|
4
|
-
* @createdAt 2024-10-06 20:07:17 - automatic
|
|
5
|
-
* @updatedAt 2024-10-06 20:07:18 - automatic
|
|
6
|
-
* @updatedUser Juan Escobar - automatic
|
|
7
|
-
*/
|
|
8
|
-
export declare function GlobalStyles(): import("react").JSX.Element;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx as e, Fragment as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme as r } from "@mui/material/styles";
|
|
3
|
-
import { GlobalStyles as a } from "@mui/material";
|
|
4
|
-
import { globalRemSize as i } from "@m4l/styles";
|
|
5
|
-
function h() {
|
|
6
|
-
const t = r();
|
|
7
|
-
return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
|
|
8
|
-
a,
|
|
9
|
-
{
|
|
10
|
-
styles: {
|
|
11
|
-
body: {
|
|
12
|
-
fontFamily: 'Inter, "Segoe UI", Roboto, "Helvetica Neue", sans-serif, Open Sans',
|
|
13
|
-
textRendering: "geometricPrecision",
|
|
14
|
-
width: "100%",
|
|
15
|
-
height: "100vh",
|
|
16
|
-
"#rootIsolation": {
|
|
17
|
-
width: "100vw",
|
|
18
|
-
height: "100vh"
|
|
19
|
-
},
|
|
20
|
-
"*::-webkit-scrollbar": {
|
|
21
|
-
width: `${t.vars.size.baseSpacings.sp1}!important`,
|
|
22
|
-
height: `${t.vars.size.baseSpacings.sp1}!important`
|
|
23
|
-
},
|
|
24
|
-
"*::-webkit-scrollbar-track": {
|
|
25
|
-
backgroundColor: "transparent"
|
|
26
|
-
},
|
|
27
|
-
"*::-webkit-scrollbar-thumb": {
|
|
28
|
-
backgroundColor: `${t.vars.palette.default.focusOpacity}!important`,
|
|
29
|
-
borderRadius: `${t.vars.size.borderRadius["r0-5"]}!important`
|
|
30
|
-
},
|
|
31
|
-
"input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
|
|
32
|
-
color: t.vars.palette.text.primary
|
|
33
|
-
},
|
|
34
|
-
"& #root": {
|
|
35
|
-
width: "100%",
|
|
36
|
-
height: "100%"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"#nprogress": {
|
|
40
|
-
pointerEvents: "none",
|
|
41
|
-
"& .bar": {
|
|
42
|
-
top: 0,
|
|
43
|
-
left: 0,
|
|
44
|
-
height: 2,
|
|
45
|
-
width: "100%",
|
|
46
|
-
position: "fixed",
|
|
47
|
-
zIndex: t.zIndex.snackbar,
|
|
48
|
-
backgroundColor: t.vars.palette.primary.main,
|
|
49
|
-
boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
|
|
50
|
-
},
|
|
51
|
-
"& .peg": {
|
|
52
|
-
right: 0,
|
|
53
|
-
opacity: 1,
|
|
54
|
-
width: 100,
|
|
55
|
-
height: "100%",
|
|
56
|
-
display: "block",
|
|
57
|
-
position: "absolute",
|
|
58
|
-
transform: "rotate(3deg) translate(0px, -4px)",
|
|
59
|
-
boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"& html": {
|
|
63
|
-
fontSize: i.desktop,
|
|
64
|
-
[t.breakpoints.down("sm")]: {
|
|
65
|
-
fontSize: i.mobile
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
// Global styles for native tags html
|
|
69
|
-
img: {
|
|
70
|
-
width: "100%"
|
|
71
|
-
},
|
|
72
|
-
// Global styles for native tags h1, h2, h3, h4, h5, h6
|
|
73
|
-
"h1, h2, h3, h4, h5, h6, p": {
|
|
74
|
-
margin: "unset"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
) });
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
h as G
|
|
82
|
-
};
|
package/components/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { GlobalStyles } from './GlobalStyles';
|
package/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DeviceType } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Check if the device type
|
|
4
|
-
* @author Juan Escobar - automatic
|
|
5
|
-
* @createdAt 2024-10-06 20:07:18 - automatic
|
|
6
|
-
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
7
|
-
* @updatedUser Juan Escobar - automatic
|
|
8
|
-
*/
|
|
9
|
-
export declare const getDeviceType: (userAgent: string | undefined) => DeviceType;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DeviceTypePrivderProps } from './types';
|
|
2
|
-
declare const DeviceTypeContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').DeviceTypeWithActions>, "setState"> & {
|
|
3
|
-
setState<A extends string | {
|
|
4
|
-
type: unknown;
|
|
5
|
-
}>(partial: import('./types').DeviceTypeWithActions | Partial<import('./types').DeviceTypeWithActions> | ((state: import('./types').DeviceTypeWithActions) => import('./types').DeviceTypeWithActions | Partial<import('./types').DeviceTypeWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
-
}, "setState"> & {
|
|
7
|
-
setState(nextStateOrUpdater: import('./types').DeviceTypeWithActions | Partial<import('./types').DeviceTypeWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').DeviceTypeWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
-
type: unknown;
|
|
9
|
-
} | undefined): void;
|
|
10
|
-
}) | null>;
|
|
11
|
-
/**
|
|
12
|
-
* Proveedor de contenedor responsivo
|
|
13
|
-
*/
|
|
14
|
-
declare const DeviceTypeProvider: (props: DeviceTypePrivderProps) => import("react").JSX.Element;
|
|
15
|
-
export { DeviceTypeProvider, DeviceTypeContext };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as a, useRef as u, useEffect as v } from "react";
|
|
3
|
-
import { c as f } from "./store.js";
|
|
4
|
-
import { g as m } from "./helper.js";
|
|
5
|
-
import { u as d } from "../../hooks/useUserAgent/index.js";
|
|
6
|
-
const y = a(null), S = (r) => {
|
|
7
|
-
const { children: o, forcedDeviceType: c, storeId: s, storeDevtoolsEnabled: i } = r, n = d(), e = u(), t = c ?? m(n);
|
|
8
|
-
return e.current || (e.current = f({
|
|
9
|
-
deviceType: t,
|
|
10
|
-
storeId: s
|
|
11
|
-
}, i)), v(() => {
|
|
12
|
-
e.current?.getState().deviceType !== t && e.current?.getState().actions.setDeviceType(t);
|
|
13
|
-
}, [t]), /* @__PURE__ */ p(y.Provider, { value: e.current, children: o });
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
y as D,
|
|
17
|
-
S as a
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { InitialDeviceTypeProps, DeviceTypeWithActions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Crea la tienda de contenedor responsivo
|
|
4
|
-
* @author Juan Escobar - automatic
|
|
5
|
-
* @createdAt 2024-10-06 20:07:18 - automatic
|
|
6
|
-
* @updatedAt 2024-10-06 20:07:18 - automatic
|
|
7
|
-
* @updatedUser Juan Escobar - automatic
|
|
8
|
-
*/
|
|
9
|
-
export declare const createDeviceTypeStore: (initProps: InitialDeviceTypeProps, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<DeviceTypeWithActions>, "setState"> & {
|
|
10
|
-
setState<A extends string | {
|
|
11
|
-
type: unknown;
|
|
12
|
-
}>(partial: DeviceTypeWithActions | Partial<DeviceTypeWithActions> | ((state: DeviceTypeWithActions) => DeviceTypeWithActions | Partial<DeviceTypeWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
13
|
-
}, "setState"> & {
|
|
14
|
-
setState(nextStateOrUpdater: DeviceTypeWithActions | Partial<DeviceTypeWithActions> | ((state: import('immer/dist/internal').WritableDraft<DeviceTypeWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
15
|
-
type: unknown;
|
|
16
|
-
} | undefined): void;
|
|
17
|
-
};
|
|
18
|
-
export type DeviceTypeStore = ReturnType<typeof createDeviceTypeStore>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createStore as a } from "zustand";
|
|
2
|
-
import { devtools as n } from "zustand/middleware";
|
|
3
|
-
import { immer as p } from "zustand/middleware/immer";
|
|
4
|
-
const m = (e, t) => {
|
|
5
|
-
const { enabled: o = !1 } = t;
|
|
6
|
-
return o && process.env.NODE_ENV === "development" ? n(e, t) : e;
|
|
7
|
-
}, D = (e, t = !1) => {
|
|
8
|
-
const o = {
|
|
9
|
-
...e
|
|
10
|
-
};
|
|
11
|
-
return a(
|
|
12
|
-
m(
|
|
13
|
-
p((r, v) => ({
|
|
14
|
-
...o,
|
|
15
|
-
actions: {
|
|
16
|
-
/**
|
|
17
|
-
* Establece el punto de interrupción
|
|
18
|
-
* @author Juan Escobar - automatic
|
|
19
|
-
* @createdAt 2024-10-06 20:07:18 - automatic
|
|
20
|
-
* @updatedAt 2024-10-06 20:07:18 - automatic
|
|
21
|
-
* @updatedUser Juan Escobar - automatic
|
|
22
|
-
*/
|
|
23
|
-
setDeviceType: (s) => {
|
|
24
|
-
r((c) => {
|
|
25
|
-
c.deviceType = s;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
})),
|
|
30
|
-
{ name: `DeviceTypeStore: ${e.storeId}`, enabled: t }
|
|
31
|
-
)
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
D as c
|
|
36
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export type DeviceType = 'mobile' | 'desktop';
|
|
3
|
-
export interface DeviceTypeState {
|
|
4
|
-
/**
|
|
5
|
-
* "storeId" Id del store
|
|
6
|
-
*/
|
|
7
|
-
storeId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* "deviceType" Tipo de dispositivo detectado
|
|
10
|
-
*/
|
|
11
|
-
deviceType: DeviceType;
|
|
12
|
-
}
|
|
13
|
-
export type InitialDeviceTypeProps = Pick<DeviceTypeState, 'deviceType' | 'storeId'>;
|
|
14
|
-
export interface DeviceTypePrivderProps {
|
|
15
|
-
/**
|
|
16
|
-
* "storeId" Id del store
|
|
17
|
-
*/
|
|
18
|
-
storeId?: string;
|
|
19
|
-
/**
|
|
20
|
-
* "storeDevtoolsEnabled" Determina si se debe usar devtools para el store
|
|
21
|
-
*/
|
|
22
|
-
storeDevtoolsEnabled?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* "forcedDeviceType" Tipo de dispositivo forzado, para no usar el detectado del userAgent
|
|
25
|
-
*/
|
|
26
|
-
forcedDeviceType?: DeviceType;
|
|
27
|
-
/**
|
|
28
|
-
* "children" Componentes hijos
|
|
29
|
-
*/
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
}
|
|
32
|
-
export interface DeviceTypeWithActions extends DeviceTypeState {
|
|
33
|
-
actions: {
|
|
34
|
-
setDeviceType: (newDeviceType: DeviceType) => void;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FormatterProviderProps, Formatters } from './types';
|
|
2
|
-
declare const FormatterContext: import('react').Context<Formatters | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Componente encargado de proveer un contexto que permita saber los diferentes forrmatos,
|
|
5
|
-
* Segunda linea
|
|
6
|
-
* @author Juan Escobar - automatic
|
|
7
|
-
* @createdAt 2024-10-06 20:07:18 - automatic
|
|
8
|
-
* @updatedAt 2024-10-06 20:07:18 - automatic
|
|
9
|
-
* @updatedUser Juan Escobar - automatic
|
|
10
|
-
*/
|
|
11
|
-
declare function FormatterProvider(props: FormatterProviderProps): import("react").JSX.Element;
|
|
12
|
-
export { FormatterProvider, FormatterContext };
|
|
@@ -1,74 +0,0 @@
|
|
|
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.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,58 +0,0 @@
|
|
|
1
|
-
import { Locale } from 'date-fns';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
export interface CurrencyFormatter {
|
|
4
|
-
code: string;
|
|
5
|
-
decimalDigits: number;
|
|
6
|
-
}
|
|
7
|
-
export interface NumberFormatter {
|
|
8
|
-
decimalSymbol: string;
|
|
9
|
-
thousandsSymbol: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Formateador de fechas
|
|
13
|
-
* @author Juan Escobar - automatic
|
|
14
|
-
* @createdAt 2024-10-06 20:07:18 - automatic
|
|
15
|
-
* @updatedAt 2024-10-06 20:07:18 - automatic
|
|
16
|
-
* @updatedUser Juan Escobar - automatic
|
|
17
|
-
*/
|
|
18
|
-
export interface DateFormatter {
|
|
19
|
-
dateFormat: string;
|
|
20
|
-
datetimeFormat: string;
|
|
21
|
-
dateMask: string;
|
|
22
|
-
datetimeMask: string;
|
|
23
|
-
timeFormat: string;
|
|
24
|
-
timeMask: string;
|
|
25
|
-
formatDate: (date: Date | number, format: string, options?: any) => string;
|
|
26
|
-
}
|
|
27
|
-
export interface OptionalDateFormatter {
|
|
28
|
-
dateFormat?: string;
|
|
29
|
-
datetimeFormat?: string;
|
|
30
|
-
dateMask?: string;
|
|
31
|
-
datetimeMask?: string;
|
|
32
|
-
timeFormat?: string;
|
|
33
|
-
timeMask?: string;
|
|
34
|
-
formatDate: (date: Date | number, format: string, options?: {
|
|
35
|
-
locale?: Locale;
|
|
36
|
-
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
37
|
-
firstWeekContainsDate?: number;
|
|
38
|
-
useAdditionalWeekYearTokens?: boolean;
|
|
39
|
-
useAdditionalDayOfYearTokens?: boolean;
|
|
40
|
-
}) => string;
|
|
41
|
-
}
|
|
42
|
-
export interface Formatters {
|
|
43
|
-
currencyFormatter: CurrencyFormatter;
|
|
44
|
-
dateFormatter: DateFormatter;
|
|
45
|
-
numberFormatter: NumberFormatter;
|
|
46
|
-
}
|
|
47
|
-
export interface OptionalFormatters {
|
|
48
|
-
currencyFormatter?: CurrencyFormatter;
|
|
49
|
-
dateFormatter?: OptionalDateFormatter;
|
|
50
|
-
numberFormatter?: NumberFormatter;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
*/
|
|
54
|
-
export interface FormatterProviderProps extends OptionalFormatters {
|
|
55
|
-
isMicroFrontEnd: boolean;
|
|
56
|
-
children: ReactNode;
|
|
57
|
-
}
|
|
58
|
-
export type FormatterContextProps = Formatters;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HostThemeProviderProps } from './types';
|
|
2
|
-
declare const HostThemeContext: import('react').Context<import('./types').HostThemeType | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Host theme provider
|
|
5
|
-
* @author Juan Escobar - automatic
|
|
6
|
-
* @createdAt 2024-10-06 20:07:18 - automatic
|
|
7
|
-
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
8
|
-
* @updatedUser Juan Escobar - automatic
|
|
9
|
-
*/
|
|
10
|
-
declare function HostThemeProvider(props: HostThemeProviderProps): import("react").JSX.Element;
|
|
11
|
-
export { HostThemeProvider, HostThemeContext };
|