@m4l/graphics 7.0.12 → 7.0.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.
@@ -1,43 +1,30 @@
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,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useTheme as i } from "@mui/material/styles";
3
+ import { GlobalStyles as o } from "@mui/material";
4
+ import { globalRemSize as e } from "@m4l/styles";
5
+ function n() {
6
+ const t = i();
7
+ return /* @__PURE__ */ r(
8
+ o,
9
9
  {
10
10
  styles: {
11
11
  body: {
12
12
  textRendering: "geometricPrecision",
13
13
  width: "100%",
14
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
15
  "*::-webkit-scrollbar": {
19
- // camino de la barra con radio
20
- width: "7px",
21
- height: "7px",
22
- borderRadius: "3px",
23
- backgroundColor: "transparent"
16
+ width: `${t.vars.size.baseSpacings.sp1}!important`,
17
+ height: `${t.vars.size.baseSpacings.sp1}!important`
24
18
  },
25
19
  "*::-webkit-scrollbar-track": {
26
- // Camino de la barrra sin radio
27
- backgroundColor: "transparent",
28
- border: "0px solid transparent"
29
- },
30
- "*::-webkit-scrollbar-corner": {
31
20
  backgroundColor: "transparent"
32
21
  },
33
- // FireFox
34
- // scrollbarColor: `${theme.vars.palette.primary.main} white`,
35
- // scrollbarWidth: 'thin',
36
- // Chrome
37
22
  "*::-webkit-scrollbar-thumb": {
38
- // barra que se mueve
39
- background: t.vars.palette.general.scrollBar,
40
- borderRadius: "2px!important"
23
+ backgroundColor: `${t.vars.palette.default.focusOpacity}!important`,
24
+ borderRadius: `${t.vars.size.borderRadius["r0-5"]}!important`
25
+ },
26
+ "input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active": {
27
+ color: t.vars.palette.text.primary
41
28
  },
42
29
  "& #root": {
43
30
  width: "100%",
@@ -68,9 +55,9 @@ function s() {
68
55
  }
69
56
  },
70
57
  "& html": {
71
- fontSize: r.desktop,
58
+ fontSize: e.desktop,
72
59
  [t.breakpoints.down("sm")]: {
73
- fontSize: r.mobile
60
+ fontSize: e.mobile
74
61
  }
75
62
  }
76
63
  }
@@ -78,5 +65,5 @@ function s() {
78
65
  );
79
66
  }
80
67
  export {
81
- s as G
68
+ n as G
82
69
  };
@@ -10,4 +10,5 @@ export declare const usePaginate: <TRow>(props: UsePaginateProps<TRow>) => {
10
10
  clearRows: () => void;
11
11
  Refresh: () => void;
12
12
  setRows: import('react').Dispatch<import('react').SetStateAction<TRow[]>>;
13
+ loading: boolean;
13
14
  };
@@ -1,73 +1,76 @@
1
- import { useState as n, useRef as H, useCallback as U, useEffect as m } from "react";
2
- import { i as s } from "./types.js";
3
- import { useHostTools as j, useNetwork as v } from "@m4l/core";
4
- const K = (h) => {
1
+ import { useState as s, useRef as j, useCallback as v, useEffect as u } from "react";
2
+ import { i as o } from "./types.js";
3
+ import { useHostTools as z, useNetwork as A, useModuleSkeleton as B, useModuleDictionary as I } from "@m4l/core";
4
+ const Z = (C) => {
5
5
  const {
6
- endPoint: w,
7
- timeout: C = 5e3,
8
- queryParams: P,
9
- fireOnChangeParms: i,
6
+ endPoint: R,
7
+ timeout: S = 5e3,
8
+ queryParams: c,
9
+ fireOnChangeParms: P,
10
10
  // Propiedad para permitir que un cambio en los parametros de la consulta dispare la recarga de la red
11
- fireOnFirstLoad: R = !0,
11
+ fireOnFirstLoad: k = !0,
12
12
  // propiedad que evita que se cargue la red la en el primer render del hook
13
- rowsPerPage: u = s.rowsPerPage,
14
- startProgress: d,
15
- stopProgress: S,
16
- isRemote: k = !0,
17
- bodyToSnakeCase: y = !1,
18
- responseToCamelCase: T = !1,
19
- initialRows: b = [],
20
- externalCondition: c = !0,
21
- onNetworkError: f,
22
- getLabel: E
23
- } = h, [p, g] = n(i ? 1 : 0), [O, a] = n(b), [x, o] = n({ ...s, rowsPerPage: u }), t = H({ ...s, rowsPerPage: u }), [F, L] = n(R), { startProgress: N, stopProgress: Q } = j(), { networkOperation: q } = v(), l = U(() => {
13
+ rowsPerPage: l = o.rowsPerPage,
14
+ startProgress: y,
15
+ stopProgress: O,
16
+ isRemote: T = !0,
17
+ bodyToSnakeCase: b = !1,
18
+ responseToCamelCase: E = !1,
19
+ initialRows: L = [],
20
+ externalCondition: f = !0,
21
+ onNetworkError: p,
22
+ refreshOnChangeDictionary: m = !1
23
+ } = C, [h, g] = s(P ? 1 : 0), [x, a] = s(L), [D, n] = s({ ...o, rowsPerPage: l }), t = j({ ...o, rowsPerPage: l }), [F, M] = s(k), [N, w] = s(!1), { startProgress: Q, stopProgress: q } = z(), { networkOperation: G } = A(), d = B(), { getLabel: H } = I(), i = v(() => {
24
24
  g((r) => r + 1);
25
25
  }, []);
26
- return m(() => {
26
+ return u(() => {
27
27
  if (F) {
28
- L(!1);
28
+ M(!1);
29
29
  return;
30
30
  }
31
- t.current.page = 0, i && l();
32
- }, [P]), m(() => {
31
+ t.current.page = 0, P && i();
32
+ }, [c]), u(() => {
33
33
  let r = !0;
34
- if (!(!c || p === 0))
35
- return q({
34
+ if (!(!f || h === 0))
35
+ return w(!0), G({
36
36
  method: "GET",
37
- endPoint: w,
38
- timeout: C,
37
+ endPoint: R,
38
+ timeout: S,
39
39
  parms: {
40
- ...P,
40
+ ...c,
41
41
  page: t.current.page,
42
42
  limit: t.current.rowsPerPage
43
43
  },
44
- bodyToSnakeCase: y,
45
- responseToCamelCase: T,
44
+ bodyToSnakeCase: b,
45
+ responseToCamelCase: E,
46
46
  options: {
47
- startProgress: d || N,
48
- stopProgress: S || Q
47
+ startProgress: y || Q,
48
+ stopProgress: O || q
49
49
  },
50
- isRemote: k
50
+ isRemote: T
51
51
  }).then((e) => {
52
- r && (a(e.data), t.current.page = e.pager.page, o((G) => ({
53
- ...G,
52
+ r && (a(e.data), t.current.page = e.pager.page, n((U) => ({
53
+ ...U,
54
54
  page: e.pager.page,
55
- // rowsPerPage: response.pager.limit,
56
55
  totalRecords: e.pager.total
57
56
  })));
58
57
  }).catch((e) => {
59
- a([]), o(s), f && f(e.status);
58
+ a([]), n(o), p && p(e.status);
59
+ }).finally(() => {
60
+ w(!1);
60
61
  }), function() {
61
62
  r = !1;
62
63
  };
63
- }, [p, c, E]), { onPageChange: (r) => {
64
+ }, [h, f]), u(() => {
65
+ !d && m && i();
66
+ }, [H, m, d]), { onPageChange: (r) => {
64
67
  t.current.page = r, g((e) => e + 1);
65
68
  }, onRowsPerPageChange: (r) => {
66
- t.current.rowsPerPage = r, o((e) => ({ ...e, rowsPerPage: r })), g((e) => e + 1);
67
- }, pagerState: x, rows: O, clearRows: () => {
68
- a([]), o(s);
69
- }, Refresh: l, setRows: a };
69
+ t.current.rowsPerPage = r, n((e) => ({ ...e, rowsPerPage: r })), g((e) => e + 1);
70
+ }, pagerState: D, rows: x, clearRows: () => {
71
+ a([]), n(o);
72
+ }, Refresh: i, setRows: a, loading: N };
70
73
  };
71
74
  export {
72
- K as u
75
+ Z as u
73
76
  };
@@ -13,5 +13,9 @@ export interface UsePaginateProps<TRow> extends Pick<NetworkProps, 'endPoint' |
13
13
  initialRows?: TRow[];
14
14
  externalCondition?: boolean;
15
15
  onNetworkError?: (code: number) => void;
16
+ /**
17
+ * @deprecated This property is not used
18
+ */
16
19
  getLabel?: GetLabelType;
20
+ refreshOnChangeDictionary?: boolean;
17
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "7.0.12",
3
+ "version": "7.0.14",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team*",
6
6
  "type": "module",