@m4l/core 2.0.18 → 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.
Files changed (61) hide show
  1. package/commonjs/index.js +12 -0
  2. package/contexts/AuthContext/AuthContext.d.ts +0 -4
  3. package/contexts/BaseContext/BaseContext.d.ts +7 -0
  4. package/contexts/BaseContext/BaseContext.js +21 -0
  5. package/contexts/BaseContext/index.d.ts +1 -11
  6. package/contexts/BaseContext/index.js +1 -11
  7. package/contexts/BaseContext/store.d.ts +6 -0
  8. package/contexts/BaseContext/store.js +42 -0
  9. package/contexts/BaseContext/types.d.ts +29 -2
  10. package/contexts/DomainContext/index.d.ts +0 -4
  11. package/contexts/DomainCountryContext/index.d.ts +0 -4
  12. package/contexts/EnvironmentContext/index.d.ts +0 -4
  13. package/contexts/FlagsContext/index.d.ts +0 -4
  14. package/contexts/FlagsContext/store.d.ts +0 -4
  15. package/contexts/FlagsContext/store.js +0 -8
  16. package/contexts/HostToolsContext/index.d.ts +0 -4
  17. package/contexts/ModuleDictionaryContext/index.d.ts +0 -4
  18. package/contexts/ModulePrivilegesContext/index.d.ts +0 -4
  19. package/contexts/ModuleSkeletonContext/index.d.ts +0 -4
  20. package/contexts/NetworkContext/index.d.ts +0 -4
  21. package/hooks/index.d.ts +1 -1
  22. package/hooks/useAuth/useAuth.d.ts +0 -4
  23. package/hooks/useBase/index.d.ts +1 -9
  24. package/hooks/useBase/index.js +1 -11
  25. package/hooks/useBase/useBase.d.ts +10 -0
  26. package/hooks/useBase/useBase.js +17 -0
  27. package/hooks/useDomain/index.d.ts +0 -4
  28. package/hooks/useDomainCountry/index.d.ts +0 -4
  29. package/hooks/useEnvironment/index.d.ts +0 -4
  30. package/hooks/useFlagsStore/index.d.ts +0 -8
  31. package/hooks/useHostTools/index.d.ts +0 -4
  32. package/hooks/useLocalStorage/index.d.ts +0 -4
  33. package/hooks/useLocalStorageWithListener/index.d.ts +0 -4
  34. package/hooks/useModuleDictionary/index.d.ts +0 -4
  35. package/hooks/useModulePrivileges/index.d.ts +0 -4
  36. package/hooks/useModuleSkeleton/index.d.ts +0 -4
  37. package/hooks/useNetwork/index.d.ts +0 -4
  38. package/hooks/usePaginate/index.d.ts +1 -0
  39. package/hooks/usePaginate/index.js +9 -9
  40. package/hooks/usePropageteMF/index.d.ts +0 -4
  41. package/index.d.ts +1 -0
  42. package/index.js +116 -81
  43. package/not_recognized/index.js +16404 -0
  44. package/package.json +4 -2
  45. package/test/constants.d.ts +0 -20
  46. package/test/constants.js +72 -0
  47. package/test/index.d.ts +4 -0
  48. package/test/index.js +1 -0
  49. package/test/mocks.js +10 -0
  50. package/test/types.js +1 -0
  51. package/test/utils.d.ts +0 -4
  52. package/test/utils.js +18 -0
  53. package/types/index.d.ts +1 -1
  54. package/utils/axiosOperation/index.d.ts +0 -4
  55. package/utils/axiosOperation/index.js +0 -4
  56. package/utils/getLocalStorage/index.d.ts +0 -4
  57. package/utils/getPropertyByString/index.d.ts +2 -8
  58. package/utils/getPropertyByString/index.js +18 -19
  59. package/utils/index.d.ts +1 -0
  60. package/utils/setLocalStorage/index.d.ts +0 -4
  61. package/utils/voidFunction.d.ts +0 -4
@@ -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
+ };
@@ -3,10 +3,6 @@ import { AuthProviderProps, SessionContextType } from './types';
3
3
  declare const AuthContext: React.Context<SessionContextType | null>;
4
4
  /**
5
5
  * Proveedor de autenticación
6
- * @author Juan Escobar - automatic
7
- * @createdAt 2024-10-04 18:38:38 - automatic
8
- * @updatedAt 2024-10-04 18:38:38 - automatic
9
- * @updatedUser Juan Escobar - automatic
10
6
  */
11
7
  declare function AuthProvider(props: AuthProviderProps): React.JSX.Element;
12
8
  export { AuthContext, AuthProvider };
@@ -0,0 +1,7 @@
1
+ import { BaseProviderProps } from './types';
2
+ declare const BaseContext: import('react').Context<import('zustand').StoreApi<import('./types').BaseProviderStoreStateWithActions<Record<any, any>>> | null>;
3
+ /**
4
+ * Proveedor base para los contextos.
5
+ */
6
+ declare function BaseProvider<T extends Record<any, any>>(props: BaseProviderProps<T>): import("react").JSX.Element;
7
+ export { BaseProvider, BaseContext };
@@ -0,0 +1,21 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { createContext as u, useRef as c, useEffect as i } from "react";
3
+ import { c as l } from "./store.js";
4
+ import { d as f } from "../../not_recognized/index.js";
5
+ const d = u(null);
6
+ function x(t) {
7
+ const { children: o, value: r, storeId: a = "general", storeDevtoolsEnabled: n = !1 } = t, e = c();
8
+ return e.current || (e.current = l({
9
+ storeId: a,
10
+ value: r
11
+ }, n)), i(() => {
12
+ if (e.current && !f(r, e.current.getState().value)) {
13
+ e.current.getState().actions.setPartialValue(r);
14
+ return;
15
+ }
16
+ }, [r]), /* @__PURE__ */ s(d.Provider, { value: e.current, children: o });
17
+ }
18
+ export {
19
+ d as B,
20
+ x as a
21
+ };
@@ -1,11 +1 @@
1
- import { BaseProviderProps } from './types';
2
- declare const BaseContext: import('react').Context<unknown>;
3
- /**
4
- * Proveedor base para los contextos.
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:39:38 - automatic
7
- * @updatedAt 2024-10-04 18:39:38 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
- */
10
- declare function BaseProvider<T>(props: BaseProviderProps<T>): import("react").JSX.Element;
11
- export { BaseProvider, BaseContext };
1
+ export * from './BaseContext';
@@ -1,11 +1 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { createContext as n } from "react";
3
- const a = n(null);
4
- function c(r) {
5
- const { children: e, value: o } = r;
6
- return /* @__PURE__ */ t(a.Provider, { value: o, children: e });
7
- }
8
- export {
9
- a as B,
10
- c as a
11
- };
1
+
@@ -0,0 +1,6 @@
1
+ import { BaseProviderStoreStateWithActions, InitialBaseProviderStoreProps, KeyOFHash } from './types';
2
+ /**
3
+ * TODO: Documentar
4
+ */
5
+ export declare function createBaseProviderStore<T extends Record<KeyOFHash, any>>(initProps: InitialBaseProviderStoreProps<T>, storeDevtoolsEnabled?: boolean): import('zustand').StoreApi<BaseProviderStoreStateWithActions<T>>;
6
+ export type BaseProviderStoreReturnType<T extends Record<any, any>> = ReturnType<typeof createBaseProviderStore<T>>;
@@ -0,0 +1,42 @@
1
+ import { createStore as m } from "zustand";
2
+ import { devtools as l } from "zustand/middleware";
3
+ import { immer as c } from "zustand/middleware/immer";
4
+ import { m as u } from "../../not_recognized/index.js";
5
+ function f(e, r) {
6
+ const { enabled: t = !1 } = r;
7
+ return t && process.env.NODE_ENV === "development" ? l(e, r) : e;
8
+ }
9
+ function P(e, r = !1) {
10
+ const t = {
11
+ ...e
12
+ };
13
+ return m(
14
+ f(
15
+ c((s) => ({
16
+ ...t,
17
+ actions: {
18
+ /**
19
+ * Setea un valor parcial en el estado y lo combina con el estado actual
20
+ */
21
+ setPartialValue: (o) => {
22
+ s((a) => {
23
+ u(a.value, o);
24
+ });
25
+ },
26
+ /**
27
+ * Setea un valor en el estado
28
+ */
29
+ setKeyValue: (o, a) => {
30
+ s((n) => {
31
+ n.value[o] = a;
32
+ });
33
+ }
34
+ }
35
+ })),
36
+ { name: `BaseProviderStore: ${e.storeId}`, enabled: r }
37
+ )
38
+ );
39
+ }
40
+ export {
41
+ P as c
42
+ };
@@ -1,6 +1,33 @@
1
1
  import { ReactNode } from 'react';
2
- export interface BaseProviderProps<T> {
2
+ export type KeyOFHash = string | number;
3
+ /**
4
+ * Store del tiempo real, actualizado por sockets
5
+ */
6
+ export interface BaseProviderStoreState<T extends Record<KeyOFHash, any>> {
7
+ /**
8
+ * Id del store
9
+ */
10
+ storeId: string;
11
+ /**
12
+ * Lugar donde se almancena los datos del prveedor
13
+ */
3
14
  value: T;
15
+ }
16
+ export interface BaseProviderStoreStateWithActions<T extends Record<KeyOFHash, any>> extends BaseProviderStoreState<T> {
17
+ actions: {
18
+ /**
19
+ * Modifica parcialmente el custom data.
20
+ */
21
+ setPartialValue: (customData: Partial<T>) => void;
22
+ /**
23
+ * Modifica una propidadparcialmente el custom data.
24
+ */
25
+ setKeyValue: (key: KeyOFHash, value: T[KeyOFHash]) => void;
26
+ };
27
+ }
28
+ export type InitialBaseProviderStoreProps<T extends Record<KeyOFHash, any>> = BaseProviderStoreState<T>;
29
+ export interface BaseProviderProps<T extends Record<KeyOFHash, any>> extends Omit<InitialBaseProviderStoreProps<T>, 'storeId'> {
30
+ storeId?: string;
31
+ storeDevtoolsEnabled?: boolean;
4
32
  children: ReactNode;
5
33
  }
6
- export type BaseContextProps<P> = Omit<BaseProviderProps<P>, 'children'>;
@@ -2,10 +2,6 @@ import { DomainProviderProps, Domain } from './types';
2
2
  declare const DomainContext: import('react').Context<Domain | null>;
3
3
  /**
4
4
  * Proveedor del contexto de dominio.
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:41:02 - automatic
7
- * @updatedAt 2024-10-04 18:41:02 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function DomainProvider(props: DomainProviderProps): import("react").JSX.Element;
11
7
  export { DomainProvider, DomainContext };
@@ -2,10 +2,6 @@ import { DomainCountryContextType, DomainCountryProviderProps } from './types';
2
2
  declare const DomainCountryContext: import('react').Context<DomainCountryContextType | null>;
3
3
  /**
4
4
  * Proveedor del contexto de país de dominio.
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function DomainCountryProvider(props: DomainCountryProviderProps): import("react").JSX.Element;
11
7
  export { DomainCountryProvider, DomainCountryContext };
@@ -2,10 +2,6 @@ import { EnvironmentContextType, EnvironmentProviderProps } from './types';
2
2
  declare const EnvironmentContext: import('react').Context<EnvironmentContextType | null>;
3
3
  /**
4
4
  * Proveedor del contexto de entorno.
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function EnvironmentProvider(props: EnvironmentProviderProps): import("react").JSX.Element;
11
7
  export { EnvironmentProvider, EnvironmentContext };
@@ -10,10 +10,6 @@ declare const FlagsContext: import('react').Context<(Omit<Omit<import('zustand')
10
10
  }) | null>;
11
11
  /**
12
12
  * Proveedor del contexto de banderas.
13
- * @author Juan Escobar - automatic
14
- * @createdAt 2024-10-04 18:42:00 - automatic
15
- * @updatedAt 2024-10-04 18:42:01 - automatic
16
- * @updatedUser Juan Escobar - automatic
17
13
  */
18
14
  declare function FlagsProvider({ children }: FlagsProviderProps): import("react").JSX.Element;
19
15
  export { FlagsProvider, FlagsContext };
@@ -1,10 +1,6 @@
1
1
  import { FlagsStateWithActions, FlagsStoreState } from './types';
2
2
  /**
3
3
  * Crea el store de banderas.
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-04 18:42:00 - automatic
6
- * @updatedAt 2024-10-04 18:42:01 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
4
  */
9
5
  export declare const createFlagsStore: (initialState: FlagsStoreState) => Omit<Omit<import('zustand').StoreApi<FlagsStateWithActions>, "setState"> & {
10
6
  setState<A extends string | {
@@ -8,10 +8,6 @@ const d = (l) => t(
8
8
  flagsActions: {
9
9
  /**
10
10
  * Limpia las banderas.
11
- * @author Juan Escobar - automatic
12
- * @createdAt 2024-10-04 18:42:00 - automatic
13
- * @updatedAt 2024-10-04 18:42:01 - automatic
14
- * @updatedUser Juan Escobar - automatic
15
11
  */
16
12
  clearFlags: () => {
17
13
  r((o) => {
@@ -20,10 +16,6 @@ const d = (l) => t(
20
16
  },
21
17
  /**
22
18
  * Agrega una bandera.
23
- * @author Juan Escobar - automatic
24
- * @createdAt 2024-10-04 18:42:00 - automatic
25
- * @updatedAt 2024-10-04 18:42:01 - automatic
26
- * @updatedUser Juan Escobar - automatic
27
19
  */
28
20
  addFlag: (o) => {
29
21
  r((a) => {
@@ -3,10 +3,6 @@ import { HostToolsProviderProps } from './types';
3
3
  declare const HostToolsContext: import('react').Context<HostToolsType | null>;
4
4
  /**
5
5
  * Proveedor de contexto de herramientas del host
6
- * @author Juan Escobar - automatic
7
- * @createdAt 2024-10-04 18:42:00 - automatic
8
- * @updatedAt 2024-10-04 18:42:01 - automatic
9
- * @updatedUser Juan Escobar - automatic
10
6
  */
11
7
  declare function HostToolsProvider(props: HostToolsProviderProps): import("react").JSX.Element;
12
8
  export { HostToolsProvider, HostToolsContext };
@@ -2,10 +2,6 @@ import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './t
2
2
  declare const ModuleDictionaryContext: import('react').Context<ModuleDictionaryContextProps | null>;
3
3
  /**
4
4
  * Proveedor de contexto de diccionario de módulo
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): import("react").JSX.Element;
11
7
  export { ModuleDictionaryProvider, ModuleDictionaryContext };
@@ -2,10 +2,6 @@ import { ModulePrivilegesContextProps, ModulePrivilegesProviderProps } from './t
2
2
  declare const ModulePrivilegesContext: import('react').Context<ModulePrivilegesContextProps | null>;
3
3
  /**
4
4
  * Proveedor de contexto de privilegios
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function ModulePrivilegesProvider(props: ModulePrivilegesProviderProps): import("react").JSX.Element;
11
7
  export { ModulePrivilegesProvider, ModulePrivilegesContext };
@@ -2,10 +2,6 @@ import { ModuleSkeletonContextProps, ModuleSkeletonProviderProps } from './types
2
2
  declare const ModuleSkeletonContext: import('react').Context<ModuleSkeletonContextProps | null>;
3
3
  /**
4
4
  * Proveedor de contexto de esqueleto de módulo
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function ModuleSkeletonProvider(props: ModuleSkeletonProviderProps): import("react").JSX.Element;
11
7
  export { ModuleSkeletonProvider, ModuleSkeletonContext };
@@ -2,10 +2,6 @@ import { NetworkProviderProps } from './types';
2
2
  declare const NetworkContext: import('react').Context<import('./types').NetworkType | null>;
3
3
  /**
4
4
  * Proveedor de contexto de red
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  declare function NetworkProvider(props: NetworkProviderProps): import("react").JSX.Element;
11
7
  export { NetworkProvider, NetworkContext };
package/hooks/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { useBase } from './useBase';
1
+ export * from './useBase';
2
2
  export { useEnvironment } from './useEnvironment';
3
3
  export { useFlagsStore, useFlagsPresent } from './useFlagsStore';
4
4
  export { useHostTools } from './useHostTools';
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * Hook para obtener el contexto de autenticación
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useAuth: () => import('../../contexts/AuthContext/types').SessionContextType;
9
5
  export default useAuth;
@@ -1,9 +1 @@
1
- /**
2
- * Hook para obtener el contexto base
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
- */
8
- export declare function useBase<T>(): T;
9
- export default useBase;
1
+ export * from './useBase';
@@ -1,11 +1 @@
1
- import { useContext as t } from "react";
2
- import { B as o } from "../../contexts/BaseContext/index.js";
3
- function r() {
4
- const e = t(o);
5
- if (!e)
6
- throw new Error("useBase context must be use inside BaseContext");
7
- return e;
8
- }
9
- export {
10
- r as u
11
- };
1
+
@@ -0,0 +1,10 @@
1
+ import { BaseProviderStoreStateWithActions, KeyOFHash } from '../../contexts/BaseContext/types';
2
+ /**
3
+ * Hook para suscribirse a cambios del consumer de tiempo real.
4
+ */
5
+ export declare function useBaseStore<T extends Record<KeyOFHash, any>, R>(selector: (state: BaseProviderStoreStateWithActions<T>) => R, equalityFn?: (left: R, right: R) => boolean): R;
6
+ /**
7
+ * Hook para obtener el contexto base
8
+ */
9
+ export declare function useBase<T extends Record<any, any>>(): T;
10
+ export default useBase;
@@ -0,0 +1,17 @@
1
+ import { useContext as r } from "react";
2
+ import { useStore as s } from "zustand";
3
+ import { shallow as n } from "zustand/shallow";
4
+ import { B as u } from "../../contexts/BaseContext/BaseContext.js";
5
+ function a(e, o) {
6
+ const t = r(u);
7
+ if (!t)
8
+ throw new Error("useBase context must be use inside BaseContext");
9
+ return s(t, e, o);
10
+ }
11
+ function B() {
12
+ return a((e) => e.value, n);
13
+ }
14
+ export {
15
+ B as a,
16
+ a as u
17
+ };
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * Hook para obtener el contexto del dominio
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useDomain: () => import('../../contexts/DomainContext/types').Domain;
9
5
  export default useDomain;
@@ -1,8 +1,4 @@
1
1
  /**
2
2
  * Hook para obtener el contexto del pais del dominio
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useDomainCountry: () => import('../..').DomainCountryContextType;
@@ -1,10 +1,6 @@
1
1
  import { EnvironmentContextType } from '../../contexts/EnvironmentContext/types';
2
2
  /**
3
3
  * Hook para obtener el contexto del ambiente
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-04 18:42:00 - automatic
6
- * @updatedAt 2024-10-04 18:42:01 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
4
  */
9
5
  export declare const useEnvironment: () => EnvironmentContextType;
10
6
  export default useEnvironment;
@@ -1,17 +1,9 @@
1
1
  import { Flag, FlagsStateWithActions } from '../../contexts/FlagsContext/types';
2
2
  /**
3
3
  * Hook to get the flags store
4
- * @author Juan Escobar - automatic
5
- * @createdAt 2024-10-04 18:42:00 - automatic
6
- * @updatedAt 2024-10-04 18:42:01 - automatic
7
- * @updatedUser Juan Escobar - automatic
8
4
  */
9
5
  export declare function useFlagsStore<T>(selector: (state: FlagsStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
10
6
  /**
11
7
  * Hook to check if the flags are present
12
- * @author Juan Escobar - automatic
13
- * @createdAt 2024-10-04 18:42:00 - automatic
14
- * @updatedAt 2024-10-04 18:42:01 - automatic
15
- * @updatedUser Juan Escobar - automatic
16
8
  */
17
9
  export declare const useFlagsPresent: (compareFlags: Array<Flag>) => boolean;
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * Hook para obtener las herramientas del host
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useHostTools: () => import('../..').HostToolsType;
9
5
  export default useHostTools;
@@ -1,8 +1,4 @@
1
1
  /**
2
2
  * Hook to use local storage
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare function useLocalStorage<ValueType>(key: string, initialValue: ValueType): any[];
@@ -2,10 +2,6 @@ export type SetStateType<ValueType> = (newValue: ValueType) => void;
2
2
  /**
3
3
  * Hook to use local storage with listener, vigiala los cambios en el local storage y actualiza el estado con
4
4
  * listener de storage
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  export declare function useLocalStorageWithListener<ValueType>(key: string, initialValue: ValueType): [ValueType, SetStateType<ValueType>];
11
7
  export default useLocalStorageWithListener;
@@ -1,8 +1,4 @@
1
1
  /**
2
2
  * Hook para obtener el diccionario de un modulo
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useModuleDictionary: () => import('../../contexts/ModuleDictionaryContext/types').ModuleDictionaryContextProps;
@@ -1,8 +1,4 @@
1
1
  /**
2
2
  * Hook para obtener el contexto de privilegios de un modulo
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useModulePrivileges: () => import('../../contexts/ModulePrivilegesContext/types').ModulePrivilegesContextProps;
@@ -1,8 +1,4 @@
1
1
  /**
2
2
  * Hook para obtener el estado del esqueleto de un modulo
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useModuleSkeleton: () => boolean;
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * Hook para obtener el contexto de la red
3
- * @author Juan Escobar - automatic
4
- * @createdAt 2024-10-04 18:42:00 - automatic
5
- * @updatedAt 2024-10-04 18:42:01 - automatic
6
- * @updatedUser Juan Escobar - automatic
7
3
  */
8
4
  export declare const useNetwork: () => import('../../contexts/NetworkContext/types').NetworkType;
9
5
  export default useNetwork;
@@ -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: P,
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: u = s.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(P ? 1 : 0), [O, o] = n(E), [b, a] = n({ ...s, rowsPerPage: u }), t = H({ ...s, rowsPerPage: u }), [x, F] = n(R), { startProgress: N, stopProgress: Q } = U(), { networkOperation: q } = j(), m = L(() => {
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
- P && m();
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 && (o(e.data), t.current.page = e.pager.page, a((G) => ({
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
- o([]), a(s), f && f(e.status);
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, a((e) => ({ ...e, rowsPerPage: r })), g((e) => e + 1);
66
+ t.current.rowsPerPage = r, o((e) => ({ ...e, rowsPerPage: r })), g((e) => e + 1);
67
67
  }, pagerState: b, rows: O, clearRows: () => {
68
- o([]), a(s);
69
- }, Refresh: m, setRows: o };
68
+ a([]), o(s);
69
+ }, Refresh: m, setRows: a };
70
70
  };
71
71
  export {
72
72
  K as u
@@ -2,9 +2,5 @@ import { EmmitListenerGuard } from '../../types';
2
2
  import { usePropagateProps } from './types';
3
3
  /**
4
4
  * Hook para propagar eventos entre microfrontends
5
- * @author Juan Escobar - automatic
6
- * @createdAt 2024-10-04 18:42:00 - automatic
7
- * @updatedAt 2024-10-04 18:42:01 - automatic
8
- * @updatedUser Juan Escobar - automatic
9
5
  */
10
6
  export declare function usePropageteMF<E extends keyof EmmitListenerGuard>(props: usePropagateProps<E>): void;
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';