@m4l/core 2.0.19 → 2.0.20-beta.1
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/commonjs/index.js +12 -0
- package/hooks/usePaginate/index.d.ts +1 -0
- package/hooks/usePaginate/index.js +9 -9
- package/index.d.ts +1 -0
- package/index.js +116 -82
- package/not_recognized/index.js +16173 -500
- package/package.json +1 -1
- package/test/constants.js +72 -0
- package/test/index.d.ts +4 -0
- package/test/index.js +1 -0
- package/test/mocks.js +10 -0
- package/test/types.js +1 -0
- package/test/utils.js +18 -0
- package/utils/index.d.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
function t(o) {
|
|
4
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
5
|
+
}
|
|
6
|
+
function i(o) {
|
|
7
|
+
throw new Error('Could not dynamically require "' + o + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as c,
|
|
11
|
+
t as g
|
|
12
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UsePaginateProps, PagerState } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Hook para paginar una lista de elementos
|
|
4
|
+
* @deprecated Use usePaginate instead in m4l_graphics. This hook will be removed in a future version.
|
|
4
5
|
*/
|
|
5
6
|
export declare const usePaginate: <TRow>(props: UsePaginateProps<TRow>) => {
|
|
6
7
|
onPageChange: (newPage: number) => void;
|
|
@@ -7,11 +7,11 @@ const K = (h) => {
|
|
|
7
7
|
endPoint: w,
|
|
8
8
|
timeout: C = 5e3,
|
|
9
9
|
queryParams: i,
|
|
10
|
-
fireOnChangeParms:
|
|
10
|
+
fireOnChangeParms: u,
|
|
11
11
|
// Propiedad para permitir que un cambio en los parametros de la consulta dispare la recarga de la red
|
|
12
12
|
fireOnFirstLoad: R = !0,
|
|
13
13
|
// propiedad que evita que se cargue la red la en el primer render del hook
|
|
14
|
-
rowsPerPage:
|
|
14
|
+
rowsPerPage: P = s.rowsPerPage,
|
|
15
15
|
startProgress: d,
|
|
16
16
|
stopProgress: S,
|
|
17
17
|
isRemote: k = !0,
|
|
@@ -20,7 +20,7 @@ const K = (h) => {
|
|
|
20
20
|
initialRows: E = [],
|
|
21
21
|
externalCondition: c = !0,
|
|
22
22
|
onNetworkError: f
|
|
23
|
-
} = h, [p, g] = n(
|
|
23
|
+
} = h, [p, g] = n(u ? 1 : 0), [O, a] = n(E), [b, o] = n({ ...s, rowsPerPage: P }), t = H({ ...s, rowsPerPage: P }), [x, F] = n(R), { startProgress: N, stopProgress: Q } = U(), { networkOperation: q } = j(), m = L(() => {
|
|
24
24
|
g((r) => r + 1);
|
|
25
25
|
}, []);
|
|
26
26
|
return l(() => {
|
|
@@ -28,7 +28,7 @@ const K = (h) => {
|
|
|
28
28
|
F(!1);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
t.current.page = 0, u && m();
|
|
32
32
|
}, [i]), l(() => {
|
|
33
33
|
let r = !0;
|
|
34
34
|
if (!(!c || p === 0))
|
|
@@ -49,24 +49,24 @@ const K = (h) => {
|
|
|
49
49
|
},
|
|
50
50
|
isRemote: k
|
|
51
51
|
}).then((e) => {
|
|
52
|
-
r && (
|
|
52
|
+
r && (a(e.data), t.current.page = e.pager.page, o((G) => ({
|
|
53
53
|
...G,
|
|
54
54
|
page: e.pager.page,
|
|
55
55
|
// rowsPerPage: response.pager.limit,
|
|
56
56
|
totalRecords: e.pager.total
|
|
57
57
|
})));
|
|
58
58
|
}).catch((e) => {
|
|
59
|
-
|
|
59
|
+
a([]), o(s), f && f(e.status);
|
|
60
60
|
}), function() {
|
|
61
61
|
r = !1;
|
|
62
62
|
};
|
|
63
63
|
}, [p, c]), { onPageChange: (r) => {
|
|
64
64
|
t.current.page = r, g((e) => e + 1);
|
|
65
65
|
}, onRowsPerPageChange: (r) => {
|
|
66
|
-
t.current.rowsPerPage = r,
|
|
66
|
+
t.current.rowsPerPage = r, o((e) => ({ ...e, rowsPerPage: r })), g((e) => e + 1);
|
|
67
67
|
}, pagerState: b, rows: O, clearRows: () => {
|
|
68
|
-
|
|
69
|
-
}, Refresh: m, setRows:
|
|
68
|
+
a([]), o(s);
|
|
69
|
+
}, Refresh: m, setRows: a };
|
|
70
70
|
};
|
|
71
71
|
export {
|
|
72
72
|
K as u
|
package/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { EmmitEvents as EmitEvents, CommonFlags } from './types';
|
|
|
4
4
|
export type { Maybe, HostToolsType, NetworkProps, EnvironmentType, AxiosOperation, EventListenerBase, EmmitEventsGuard, ToasterFunctionProps, Toaster, } from './types';
|
|
5
5
|
export type { GetLabelType, Dictionary, ModuleDictionary, ComponentDictionary, } from './types/dictionary';
|
|
6
6
|
export * from './utils';
|
|
7
|
+
export * from './test';
|
package/index.js
CHANGED
|
@@ -1,84 +1,118 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { M as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { u as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
import { u as
|
|
22
|
-
import { u as
|
|
23
|
-
import { u as
|
|
24
|
-
import { u as xo } from "./hooks/
|
|
25
|
-
import { u as
|
|
26
|
-
import { u as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { g as Eo } from "./utils/
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
1
|
+
import { C as s, E as n } from "./types/index.js";
|
|
2
|
+
import { l as o } from "./not_recognized/index.js";
|
|
3
|
+
import { c as m, s as u, u as x } from "./not_recognized/index.js";
|
|
4
|
+
import { B as f, a as l } from "./contexts/BaseContext/BaseContext.js";
|
|
5
|
+
import { E as d, a as v } from "./contexts/EnvironmentContext/index.js";
|
|
6
|
+
import { H as P, a as F } from "./contexts/HostToolsContext/index.js";
|
|
7
|
+
import { N as k, a as D } from "./contexts/NetworkContext/index.js";
|
|
8
|
+
import { F as M, a as _ } from "./contexts/FlagsContext/index.js";
|
|
9
|
+
import { D as S, a as E } from "./contexts/DomainContext/index.js";
|
|
10
|
+
import { M as B, a as H } from "./contexts/ModuleDictionaryContext/index.js";
|
|
11
|
+
import { M as A, a as L } from "./contexts/ModulePrivilegesContext/index.js";
|
|
12
|
+
import { M as b, a as O } from "./contexts/ModuleSkeletonContext/index.js";
|
|
13
|
+
import { D as W, a as j } from "./contexts/DomainCountryContext/index.js";
|
|
14
|
+
import { A as z, a as G } from "./contexts/AuthContext/AuthContext.js";
|
|
15
|
+
import { u as K } from "./hooks/useEnvironment/index.js";
|
|
16
|
+
import { a as R, u as U } from "./hooks/useFlagsStore/index.js";
|
|
17
|
+
import { u as X } from "./hooks/useHostTools/index.js";
|
|
18
|
+
import { u as Z } from "./hooks/useDomain/index.js";
|
|
19
|
+
import { u as oo } from "./hooks/useLocalStorage/index.js";
|
|
20
|
+
import { u as ro } from "./hooks/useLocalStorageWithListener/index.js";
|
|
21
|
+
import { u as ao } from "./hooks/useModuleDictionary/index.js";
|
|
22
|
+
import { u as no } from "./hooks/useModulePrivileges/index.js";
|
|
23
|
+
import { u as mo } from "./hooks/useModuleSkeleton/index.js";
|
|
24
|
+
import { u as xo } from "./hooks/useNetwork/index.js";
|
|
25
|
+
import { u as fo } from "./hooks/usePaginate/index.js";
|
|
26
|
+
import { u as go } from "./hooks/usePropageteMF/index.js";
|
|
27
|
+
import { u as co } from "./hooks/useDomainCountry/index.js";
|
|
28
|
+
import { u as Fo } from "./hooks/useAuth/useAuth.js";
|
|
29
|
+
import { i as ko } from "./hooks/usePaginate/types.js";
|
|
30
|
+
import { a as To, u as Mo } from "./hooks/useBase/useBase.js";
|
|
31
|
+
import { v as yo } from "./utils/voidFunction.js";
|
|
32
|
+
import { g as Eo } from "./utils/getPropertyByString/index.js";
|
|
33
|
+
import { e as Bo } from "./utils/evaluateWithContext/index.js";
|
|
34
|
+
import { g as wo } from "./utils/getLocalStorage/index.js";
|
|
35
|
+
import { s as Lo } from "./utils/setLocalStorage/index.js";
|
|
36
|
+
import { a as bo } from "./utils/axiosOperation/index.js";
|
|
37
|
+
import { h as qo, d as Wo, c as jo, e as Io, b as zo, g as Go, j as Jo, i as Ko, m as Qo, a as Ro, n as Uo, q as Vo, f as Xo, r as Yo } from "./test/constants.js";
|
|
38
|
+
import { m as $o, b as oe, d as ee, c as re, a as te, e as ae, f as se } from "./test/mocks.js";
|
|
39
|
+
import { c as ie } from "./test/utils.js";
|
|
40
|
+
import { act as ue } from "react";
|
|
41
|
+
const r = o.renderHook;
|
|
35
42
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
43
|
+
z as AuthContext,
|
|
44
|
+
G as AuthProvider,
|
|
45
|
+
f as BaseContext,
|
|
46
|
+
l as BaseProvider,
|
|
47
|
+
s as CommonFlags,
|
|
48
|
+
S as DomainContext,
|
|
49
|
+
W as DomainCountryContext,
|
|
50
|
+
j as DomainCountryProvider,
|
|
51
|
+
E as DomainProvider,
|
|
52
|
+
n as EmitEvents,
|
|
53
|
+
d as EnvironmentContext,
|
|
54
|
+
v as EnvironmentProvider,
|
|
55
|
+
M as FlagsContext,
|
|
56
|
+
_ as FlagsProvider,
|
|
57
|
+
P as HostToolsContext,
|
|
58
|
+
F as HostToolsProvider,
|
|
59
|
+
B as ModuleDictionaryContext,
|
|
60
|
+
H as ModuleDictionaryProvider,
|
|
61
|
+
A as ModulePrivilegesContext,
|
|
62
|
+
L as ModulePrivilegesProvider,
|
|
63
|
+
b as ModuleSkeletonContext,
|
|
64
|
+
O as ModuleSkeletonProvider,
|
|
65
|
+
k as NetworkContext,
|
|
66
|
+
D as NetworkProvider,
|
|
67
|
+
ue as act,
|
|
68
|
+
bo as axiosOperation,
|
|
69
|
+
qo as baseDataForTesting,
|
|
70
|
+
m as cleanup,
|
|
71
|
+
Wo as dictionaryDataForTesting,
|
|
72
|
+
jo as domainCountry1DataForTesting,
|
|
73
|
+
Io as domainCountry2DataForTesting,
|
|
74
|
+
zo as domainDataForTesting,
|
|
75
|
+
Go as environmentDataForTesting,
|
|
76
|
+
Bo as evaluateWithContext,
|
|
77
|
+
wo as getLocalStorage,
|
|
78
|
+
Eo as getPropertyByString,
|
|
79
|
+
Jo as hostToolsDataForTesting,
|
|
80
|
+
ko as initialPagerState,
|
|
81
|
+
$o as mock_addFlag,
|
|
82
|
+
oe as mock_events_add_listener,
|
|
83
|
+
ee as mock_events_emit,
|
|
84
|
+
re as mock_events_remove_listener,
|
|
85
|
+
te as mock_networkOperation,
|
|
86
|
+
ae as mock_startProgress,
|
|
87
|
+
se as mock_stopProgress,
|
|
88
|
+
Ko as mock_toaster,
|
|
89
|
+
Qo as moduleIdForTesting,
|
|
90
|
+
Ro as moduleNameForTesting,
|
|
91
|
+
Uo as networkPropsForTesting,
|
|
92
|
+
Vo as queryPrivilegesForTesting,
|
|
93
|
+
ie as render,
|
|
94
|
+
r as renderHook,
|
|
95
|
+
Xo as resultAxiosOperationForTesting,
|
|
96
|
+
Yo as resultpPrivilegesForTesting,
|
|
97
|
+
u as screen,
|
|
98
|
+
Lo as setLocalStorage,
|
|
99
|
+
Fo as useAuth,
|
|
100
|
+
To as useBase,
|
|
101
|
+
Mo as useBaseStore,
|
|
102
|
+
Z as useDomain,
|
|
103
|
+
co as useDomainCountry,
|
|
104
|
+
K as useEnvironment,
|
|
105
|
+
R as useFlagsPresent,
|
|
106
|
+
U as useFlagsStore,
|
|
107
|
+
X as useHostTools,
|
|
108
|
+
oo as useLocalStorage,
|
|
109
|
+
ro as useLocalStorageWithListener,
|
|
110
|
+
ao as useModuleDictionary,
|
|
111
|
+
no as useModulePrivileges,
|
|
112
|
+
mo as useModuleSkeleton,
|
|
113
|
+
xo as useNetwork,
|
|
114
|
+
fo as usePaginate,
|
|
115
|
+
go as usePropageteMF,
|
|
116
|
+
x as userEvent,
|
|
117
|
+
yo as voidFunction
|
|
84
118
|
};
|