@m4l/core 2.0.26 → 2.0.27-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/contexts/AuthContext/AuthContext.js +52 -48
- package/contexts/AuthContext/constants.js +2 -2
- package/contexts/AuthContext/helpers.js +1 -1
- package/contexts/BaseContext/BaseContext.js +11 -11
- package/contexts/BaseContext/store.js +1 -1
- package/contexts/DomainContext/index.js +23 -23
- package/contexts/DomainCountryContext/index.js +17 -17
- package/contexts/EnvironmentContext/index.js +8 -8
- package/contexts/FlagsContext/index.js +9 -9
- package/contexts/FlagsContext/store.js +4 -4
- package/contexts/HostToolsContext/index.js +7 -7
- package/contexts/ModuleDictionaryContext/index.js +20 -20
- package/contexts/ModulePrivilegesContext/index.js +9 -9
- package/contexts/ModuleSkeletonContext/index.js +8 -8
- package/contexts/NetworkContext/index.js +10 -10
- package/hooks/useAuth/useAuth.js +5 -4
- package/hooks/useBase/useBase.js +10 -9
- package/hooks/useDomain/index.js +8 -7
- package/hooks/useDomainCountry/index.js +2 -2
- package/hooks/useEnvironment/index.js +8 -7
- package/hooks/useFlagsStore/index.js +9 -9
- package/hooks/useHostTools/index.js +3 -2
- package/hooks/useLocalStorage/index.js +4 -4
- package/hooks/useLocalStorageWithListener/index.js +2 -1
- package/hooks/useModuleDictionary/index.js +2 -2
- package/hooks/useModulePrivileges/index.js +3 -3
- package/hooks/useModuleSkeleton/index.js +3 -3
- package/hooks/useNetwork/index.js +3 -2
- package/hooks/usePaginate/index.js +19 -19
- package/hooks/usePaginate/types.js +2 -2
- package/hooks/usePropageteMF/index.js +6 -6
- package/index.js +68 -68
- package/package.json +30 -52
- package/types/index.js +2 -2
- package/utils/axiosOperation/index.js +15 -15
- package/utils/evaluateWithContext/index.js +1 -1
- package/utils/getLocalStorage/index.js +1 -1
- package/utils/getPropertyByString/index.js +4 -4
- package/utils/setLocalStorage/index.js +3 -3
- package/utils/voidFunction.js +1 -1
- package/contexts/AuthContext/AuthContext.d.ts +0 -8
- package/contexts/AuthContext/AuthContext.test.d.ts +0 -1
- package/contexts/AuthContext/constants.d.ts +0 -7
- package/contexts/AuthContext/helpers.d.ts +0 -5
- package/contexts/AuthContext/index.d.ts +0 -2
- package/contexts/AuthContext/index.js +0 -1
- package/contexts/AuthContext/types.d.ts +0 -67
- package/contexts/BaseContext/BaseContext.d.ts +0 -7
- package/contexts/BaseContext/index.d.ts +0 -2
- package/contexts/BaseContext/index.js +0 -1
- package/contexts/BaseContext/index.test.d.ts +0 -1
- package/contexts/BaseContext/store.d.ts +0 -6
- package/contexts/BaseContext/types.d.ts +0 -37
- package/contexts/DomainContext/index.d.ts +0 -7
- package/contexts/DomainContext/index.test.d.ts +0 -1
- package/contexts/DomainContext/types.d.ts +0 -11
- package/contexts/DomainCountryContext/index.d.ts +0 -7
- package/contexts/DomainCountryContext/index.test.d.ts +0 -1
- package/contexts/DomainCountryContext/types.d.ts +0 -15
- package/contexts/EnvironmentContext/index.d.ts +0 -7
- package/contexts/EnvironmentContext/index.test.d.ts +0 -1
- package/contexts/EnvironmentContext/types.d.ts +0 -14
- package/contexts/FlagsContext/index.d.ts +0 -15
- package/contexts/FlagsContext/index.test.d.ts +0 -1
- package/contexts/FlagsContext/store.d.ts +0 -14
- package/contexts/FlagsContext/types.d.ts +0 -46
- package/contexts/HostToolsContext/index.d.ts +0 -8
- package/contexts/HostToolsContext/index.test.d.ts +0 -1
- package/contexts/HostToolsContext/types.d.ts +0 -6
- package/contexts/ModuleDictionaryContext/index.d.ts +0 -7
- package/contexts/ModuleDictionaryContext/index.test.d.ts +0 -1
- package/contexts/ModuleDictionaryContext/types.d.ts +0 -16
- package/contexts/ModulePrivilegesContext/index.d.ts +0 -7
- package/contexts/ModulePrivilegesContext/index.test.d.ts +0 -1
- package/contexts/ModulePrivilegesContext/types.d.ts +0 -9
- package/contexts/ModuleSkeletonContext/index.d.ts +0 -7
- package/contexts/ModuleSkeletonContext/index.test.d.ts +0 -1
- package/contexts/ModuleSkeletonContext/types.d.ts +0 -8
- package/contexts/NetworkContext/index.d.ts +0 -7
- package/contexts/NetworkContext/index.test.d.ts +0 -1
- package/contexts/NetworkContext/types.d.ts +0 -11
- package/contexts/index.d.ts +0 -12
- package/contexts/index.js +0 -1
- package/hooks/index.d.ts +0 -17
- package/hooks/index.js +0 -1
- package/hooks/useAuth/index.d.ts +0 -1
- package/hooks/useAuth/index.js +0 -1
- package/hooks/useAuth/useAuth.d.ts +0 -5
- package/hooks/useAuth/useAuth.test.d.ts +0 -1
- package/hooks/useBase/index.d.ts +0 -1
- package/hooks/useBase/index.js +0 -1
- package/hooks/useBase/index.test.d.ts +0 -1
- package/hooks/useBase/useBase.d.ts +0 -10
- package/hooks/useDomain/index.d.ts +0 -5
- package/hooks/useDomain/index.test.d.ts +0 -1
- package/hooks/useDomainCountry/index.d.ts +0 -4
- package/hooks/useDomainCountry/index.test.d.ts +0 -1
- package/hooks/useEnvironment/index.d.ts +0 -6
- package/hooks/useEnvironment/index.test.d.ts +0 -1
- package/hooks/useFlagsStore/index.d.ts +0 -9
- package/hooks/useFlagsStore/index.test.d.ts +0 -1
- package/hooks/useHostTools/index.d.ts +0 -5
- package/hooks/useHostTools/index.test.d.ts +0 -1
- package/hooks/useLocalStorage/index.d.ts +0 -4
- package/hooks/useLocalStorage/index.test.d.ts +0 -1
- package/hooks/useLocalStorageWithListener/index.d.ts +0 -7
- package/hooks/useLocalStorageWithListener/index.test.d.ts +0 -1
- package/hooks/useModuleDictionary/index.d.ts +0 -4
- package/hooks/useModuleDictionary/index.test.d.ts +0 -1
- package/hooks/useModulePrivileges/index.d.ts +0 -4
- package/hooks/useModulePrivileges/index.test.d.ts +0 -1
- package/hooks/useModuleSkeleton/index.d.ts +0 -4
- package/hooks/useModuleSkeleton/index.test.d.ts +0 -1
- package/hooks/useNetwork/index.d.ts +0 -5
- package/hooks/useNetwork/index.test.d.ts +0 -1
- package/hooks/usePaginate/index.d.ts +0 -14
- package/hooks/usePaginate/index.test.d.ts +0 -1
- package/hooks/usePaginate/types.d.ts +0 -17
- package/hooks/usePropageteMF/index.d.ts +0 -6
- package/hooks/usePropageteMF/types.d.ts +0 -6
- package/index.d.ts +0 -6
- package/test/constants.d.ts +0 -69
- package/test/index.d.ts +0 -3
- package/test/mocks.d.ts +0 -7
- package/test/setup.d.ts +0 -0
- package/test/types.d.ts +0 -4
- package/test/utils.d.ts +0 -9
- package/types/dictionary.d.ts +0 -13
- package/types/index.d.ts +0 -117
- package/utils/axiosOperation/index.d.ts +0 -5
- package/utils/axiosOperation/index.test.d.ts +0 -1
- package/utils/axiosOperation/types.d.ts +0 -9
- package/utils/evaluateWithContext/index.d.ts +0 -7
- package/utils/getLocalStorage/index.d.ts +0 -4
- package/utils/getLocalStorage/index.test.d.ts +0 -1
- package/utils/getPropertyByString/index.d.ts +0 -7
- package/utils/getPropertyByString/index.test.d.ts +0 -1
- package/utils/index.d.ts +0 -7
- package/utils/index.js +0 -1
- package/utils/setLocalStorage/index.d.ts +0 -4
- package/utils/setLocalStorage/index.test.d.ts +0 -1
- package/utils/voidFunction.d.ts +0 -4
- package/vite-env.d.ts +0 -4
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/hooks/useBase/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useBase';
|
package/hooks/useBase/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Flag, FlagsStateWithActions } from '../../contexts/FlagsContext/types';
|
|
2
|
-
/**
|
|
3
|
-
* Hook to get the flags store
|
|
4
|
-
*/
|
|
5
|
-
export declare function useFlagsStore<T>(selector: (state: FlagsStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
6
|
-
/**
|
|
7
|
-
* Hook to check if the flags are present
|
|
8
|
-
*/
|
|
9
|
-
export declare const useFlagsPresent: (compareFlags: Array<Flag>) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type SetStateType<ValueType> = (newValue: ValueType) => void;
|
|
2
|
-
/**
|
|
3
|
-
* Hook to use local storage with listener, vigiala los cambios en el local storage y actualiza el estado con
|
|
4
|
-
* listener de storage
|
|
5
|
-
*/
|
|
6
|
-
export declare function useLocalStorageWithListener<ValueType>(key: string, initialValue: ValueType): [ValueType, SetStateType<ValueType>];
|
|
7
|
-
export default useLocalStorageWithListener;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mockUseFlagsPresent: jest.Mock;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { UsePaginateProps, PagerState } from './types';
|
|
2
|
-
/**
|
|
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.
|
|
5
|
-
*/
|
|
6
|
-
export declare const usePaginate: <TRow>(props: UsePaginateProps<TRow>) => {
|
|
7
|
-
onPageChange: (newPage: number) => void;
|
|
8
|
-
onRowsPerPageChange: (newRowsPerPage: number) => void;
|
|
9
|
-
pagerState: PagerState;
|
|
10
|
-
rows: TRow[];
|
|
11
|
-
clearRows: () => void;
|
|
12
|
-
Refresh: () => void;
|
|
13
|
-
setRows: import('react').Dispatch<import('react').SetStateAction<TRow[]>>;
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NetworkProps } from '../../types';
|
|
2
|
-
import { AxiosOptions } from '../../utils/axiosOperation/types';
|
|
3
|
-
export declare interface PagerState {
|
|
4
|
-
page: number;
|
|
5
|
-
rowsPerPage: number;
|
|
6
|
-
totalRecords: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const initialPagerState: PagerState;
|
|
9
|
-
export interface UsePaginateProps<TRow> extends Pick<NetworkProps, 'endPoint' | 'timeout' | 'isRemote' | 'bodyToSnakeCase' | 'responseToCamelCase'>, AxiosOptions {
|
|
10
|
-
fireOnChangeParms?: boolean;
|
|
11
|
-
fireOnFirstLoad?: boolean;
|
|
12
|
-
queryParams: Record<string, unknown>;
|
|
13
|
-
rowsPerPage?: number;
|
|
14
|
-
initialRows?: TRow[];
|
|
15
|
-
externalCondition?: boolean;
|
|
16
|
-
onNetworkError?: (code: number) => void;
|
|
17
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { EmmitListenerGuard } from '../../types';
|
|
2
|
-
import { usePropagateProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Hook para propagar eventos entre microfrontends
|
|
5
|
-
*/
|
|
6
|
-
export declare function usePropageteMF<E extends keyof EmmitListenerGuard>(props: usePropagateProps<E>): void;
|
package/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './contexts';
|
|
2
|
-
export * from './hooks';
|
|
3
|
-
export { EmmitEvents as EmitEvents, CommonFlags } from './types';
|
|
4
|
-
export type { Maybe, HostToolsType, NetworkProps, EnvironmentType, AxiosOperation, EventListenerBase, EmmitEventsGuard, ToasterFunctionProps, Toaster, } from './types';
|
|
5
|
-
export type { GetLabelType, Dictionary, ModuleDictionary, ComponentDictionary, } from './types/dictionary';
|
|
6
|
-
export * from './utils';
|
package/test/constants.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { HostToolsType, Toaster } from '../types';
|
|
2
|
-
import { BaseDataForTesting } from './types';
|
|
3
|
-
export declare const moduleIdForTesting = "testing";
|
|
4
|
-
export declare const moduleNameForTesting = "label_for_module_name";
|
|
5
|
-
export declare const dictionaryDataForTesting: {
|
|
6
|
-
data: {
|
|
7
|
-
module_name: string;
|
|
8
|
-
label1: string;
|
|
9
|
-
};
|
|
10
|
-
comp1: {
|
|
11
|
-
key1: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export declare const queryPrivilegesForTesting: string[];
|
|
15
|
-
export declare const resultpPrivilegesForTesting: {
|
|
16
|
-
data: {
|
|
17
|
-
priv1: boolean;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const domainDataForTesting: {
|
|
21
|
-
data: {
|
|
22
|
-
name: string;
|
|
23
|
-
company_logo_small_url: string;
|
|
24
|
-
company_logo_normal_url: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare const domainCountry1DataForTesting: {
|
|
28
|
-
id: number;
|
|
29
|
-
currency: string;
|
|
30
|
-
currency_decimal_digits: number;
|
|
31
|
-
decimal_symbol: string;
|
|
32
|
-
thousands_symbol: string;
|
|
33
|
-
};
|
|
34
|
-
export declare const domainCountry2DataForTesting: {
|
|
35
|
-
id: number;
|
|
36
|
-
currency: string;
|
|
37
|
-
currency_decimal_digits: number;
|
|
38
|
-
decimal_symbol: string;
|
|
39
|
-
thousands_symbol: string;
|
|
40
|
-
};
|
|
41
|
-
export declare const resultAxiosOperationForTesting: {
|
|
42
|
-
data: {
|
|
43
|
-
a: number;
|
|
44
|
-
b: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export declare const networkPropsForTesting: {
|
|
48
|
-
method: string;
|
|
49
|
-
endPoint: string;
|
|
50
|
-
parms: {};
|
|
51
|
-
};
|
|
52
|
-
export declare const environmentDataForTesting: {
|
|
53
|
-
isLocalhost: boolean;
|
|
54
|
-
host: string;
|
|
55
|
-
domain_token: string;
|
|
56
|
-
host_api_local: string;
|
|
57
|
-
host_api_remote: string;
|
|
58
|
-
host_static_assets: string;
|
|
59
|
-
environment_assets: string;
|
|
60
|
-
isMicroFrontend: boolean;
|
|
61
|
-
isIsolatation: boolean;
|
|
62
|
-
database: string;
|
|
63
|
-
};
|
|
64
|
-
export declare const baseDataForTesting: BaseDataForTesting;
|
|
65
|
-
/**
|
|
66
|
-
* Mock toaster
|
|
67
|
-
*/
|
|
68
|
-
export declare const mock_toaster: Toaster;
|
|
69
|
-
export declare const hostToolsDataForTesting: HostToolsType;
|
package/test/index.d.ts
DELETED
package/test/mocks.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const mock_addFlag: import('vitest').Mock<(...args: any[]) => any>;
|
|
2
|
-
export declare const mock_networkOperation: import('vitest').Mock<(...args: any[]) => any>;
|
|
3
|
-
export declare const mock_events_add_listener: import('vitest').Mock<(...args: any[]) => any>;
|
|
4
|
-
export declare const mock_events_remove_listener: import('vitest').Mock<(...args: any[]) => any>;
|
|
5
|
-
export declare const mock_events_emit: import('vitest').Mock<(...args: any[]) => any>;
|
|
6
|
-
export declare const mock_startProgress: import('vitest').Mock<(...args: any[]) => any>;
|
|
7
|
-
export declare const mock_stopProgress: import('vitest').Mock<(...args: any[]) => any>;
|
package/test/setup.d.ts
DELETED
|
File without changes
|
package/test/types.d.ts
DELETED
package/test/utils.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { cleanup, screen } from '@testing-library/react';
|
|
2
|
-
import { renderHook } from '@testing-library/react-hooks';
|
|
3
|
-
import { default as React, act } from 'react';
|
|
4
|
-
/**
|
|
5
|
-
* customRender
|
|
6
|
-
*/
|
|
7
|
-
declare const customRender: (ui: React.ReactElement, options?: {}) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
8
|
-
export { default as userEvent } from '@testing-library/user-event';
|
|
9
|
-
export { customRender as render, renderHook, screen, cleanup, act };
|
package/types/dictionary.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type GetLabelType = (key: string, ...args: (string | number)[]) => string;
|
|
2
|
-
export interface ComponentDictionary {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
}
|
|
5
|
-
export interface Dictionary {
|
|
6
|
-
[key: string]: ComponentDictionary | boolean | undefined | string;
|
|
7
|
-
}
|
|
8
|
-
export interface DataDictionary extends ComponentDictionary {
|
|
9
|
-
module_name: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ModuleDictionary extends Dictionary {
|
|
12
|
-
data: DataDictionary;
|
|
13
|
-
}
|
package/types/index.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Id, ToastOptions } from 'react-toastify';
|
|
3
|
-
import { BrowserHistory } from 'history';
|
|
4
|
-
import { AxiosProgressEvent, ResponseType } from 'axios';
|
|
5
|
-
import { DomainCountry } from '../contexts';
|
|
6
|
-
import { AxiosOptions } from '../utils/axiosOperation/types';
|
|
7
|
-
export type Maybe<T> = T | undefined | null;
|
|
8
|
-
type MFProps = {
|
|
9
|
-
moduleId: string;
|
|
10
|
-
debugPort: number;
|
|
11
|
-
};
|
|
12
|
-
export type EnvironmentType = {
|
|
13
|
-
/**
|
|
14
|
-
* "isIsolatation" Indica si la aplicacion esta ejecutando stand alone sin el host.
|
|
15
|
-
* Por defecto es false.
|
|
16
|
-
* El componente ByIsolation pone esta configuración.
|
|
17
|
-
*/
|
|
18
|
-
isIsolatation?: boolean;
|
|
19
|
-
isMicroFrontend?: boolean;
|
|
20
|
-
mfProps?: MFProps;
|
|
21
|
-
/**
|
|
22
|
-
* "isLocalhost": Indica si la aplicacion esta en localhost.
|
|
23
|
-
* Se determina con base en el window.host.
|
|
24
|
-
*/
|
|
25
|
-
isLocalhost: boolean;
|
|
26
|
-
host: string;
|
|
27
|
-
domain_token: string;
|
|
28
|
-
/**
|
|
29
|
-
* Base de datos a la que la plataforma se conectará
|
|
30
|
-
*/
|
|
31
|
-
database: string;
|
|
32
|
-
host_api_remote: string;
|
|
33
|
-
host_api_local: string;
|
|
34
|
-
host_static_assets: string;
|
|
35
|
-
environment_assets: string;
|
|
36
|
-
hostApiIcons?: string;
|
|
37
|
-
googleMapsApiKey?: string;
|
|
38
|
-
};
|
|
39
|
-
export declare type NetworkProps = {
|
|
40
|
-
method: any;
|
|
41
|
-
endPoint: string;
|
|
42
|
-
/**
|
|
43
|
-
* "database" Indica la base de datos a la que se conectara. Cuando se instancia axiosOperation se pone el valor por defecto.
|
|
44
|
-
* Para made4Labs es domain
|
|
45
|
-
* Para guardian es operative
|
|
46
|
-
*/
|
|
47
|
-
database?: string;
|
|
48
|
-
timeout?: number;
|
|
49
|
-
parms?: object;
|
|
50
|
-
data?: Record<string, any>;
|
|
51
|
-
headers?: Record<string, string | number | boolean>;
|
|
52
|
-
checkUnAuthorized?: boolean;
|
|
53
|
-
isRemote?: boolean;
|
|
54
|
-
toastSuccess?: boolean;
|
|
55
|
-
toastError?: boolean;
|
|
56
|
-
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
|
57
|
-
isExternalUrl?: boolean;
|
|
58
|
-
responseType?: ResponseType;
|
|
59
|
-
signal?: AbortSignal;
|
|
60
|
-
options?: AxiosOptions;
|
|
61
|
-
bodyToSnakeCase?: boolean;
|
|
62
|
-
responseToCamelCase?: boolean;
|
|
63
|
-
};
|
|
64
|
-
export interface ToasterFunctionProps {
|
|
65
|
-
title: ReactNode;
|
|
66
|
-
description?: ReactNode;
|
|
67
|
-
}
|
|
68
|
-
export type Toaster = {
|
|
69
|
-
(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
70
|
-
success(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
71
|
-
info(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
72
|
-
warning(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
73
|
-
error(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
74
|
-
};
|
|
75
|
-
export declare enum EmmitEvents {
|
|
76
|
-
EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED = "netsevice_unauthorized",
|
|
77
|
-
EMMIT_EVENT_HOST_LOCALE_CHANGE = "host_locale_change",
|
|
78
|
-
EMMIT_EVENT_HOST_THEME_CHANGE = "host_theme_change",
|
|
79
|
-
EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE = "domain_country_change",
|
|
80
|
-
EMMIT_EVENT_HOST_FORMATTER_CHANGE = "formatter_change",
|
|
81
|
-
EMMIT_EVENT_HOST_EMERGE_WINDOW = "host_emerge_window"
|
|
82
|
-
}
|
|
83
|
-
export type EmptyObject = Record<string, any>;
|
|
84
|
-
export type EmmitBaseGuard = {
|
|
85
|
-
[K in EmmitEvents]: any;
|
|
86
|
-
};
|
|
87
|
-
export interface EmmitEventsGuard extends EmmitBaseGuard {
|
|
88
|
-
domain_country_change: DomainCountry;
|
|
89
|
-
netsevice_unauthorized: EmptyObject;
|
|
90
|
-
}
|
|
91
|
-
export type EmmitFunction = <E extends keyof EmmitEventsGuard>(event: E, arg1: EmmitEventsGuard[E]) => void;
|
|
92
|
-
export declare type EventListenerBase = (...args: any[]) => void;
|
|
93
|
-
export type EmmitListenerBaseGuard = {
|
|
94
|
-
[K in EmmitEvents]: EventListenerBase;
|
|
95
|
-
};
|
|
96
|
-
export interface EmmitListenerGuard extends EmmitListenerBaseGuard {
|
|
97
|
-
domain_country_change: (newDomainCountry: DomainCountry) => void;
|
|
98
|
-
}
|
|
99
|
-
export type EmmitEventListener = <E extends keyof EmmitListenerGuard>(event: E, handler: EmmitListenerGuard[E]) => void;
|
|
100
|
-
export declare interface HostToolsType {
|
|
101
|
-
history: BrowserHistory;
|
|
102
|
-
toast: Toaster;
|
|
103
|
-
startProgress: VoidFunction;
|
|
104
|
-
stopProgress: VoidFunction;
|
|
105
|
-
events_add_listener: EmmitEventListener;
|
|
106
|
-
events_remove_listener: EmmitEventListener;
|
|
107
|
-
events_emit: EmmitFunction;
|
|
108
|
-
}
|
|
109
|
-
export declare enum CommonFlags {
|
|
110
|
-
FLAG_PRIVILEGES_LOADED = "privileges_loaded",
|
|
111
|
-
FLAG_DICTIONARY_LOADED = "dictionary_loaded",
|
|
112
|
-
FLAG_DOMAIN_LOADED = "domain_loaded",
|
|
113
|
-
FLAG_FORM_LOADED = "form_loaded",
|
|
114
|
-
FLAG_AREAS_LOADED = "areas_loaded"
|
|
115
|
-
}
|
|
116
|
-
export declare type AxiosOperation = (props: NetworkProps, enviroment: EnvironmentType, hostTools: HostToolsType) => Promise<any>;
|
|
117
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { EnvironmentType, HostToolsType, NetworkProps } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Esta función se encarga de realizar las operaciones de red.
|
|
4
|
-
*/
|
|
5
|
-
export declare const axiosOperation: <T = any>(props: NetworkProps, enviroment: EnvironmentType, hostTools: HostToolsType) => Promise<T>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Evalúa un fragmento de código dentro de un contexto específico.
|
|
3
|
-
* @param context - El contexto en el que se evaluará el código.
|
|
4
|
-
* @param code - El código a evaluar.
|
|
5
|
-
* @returns El resultado de la evaluación como una cadena.
|
|
6
|
-
*/
|
|
7
|
-
export declare function evaluateWithContext(context: any, code: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Maybe } from '../../types';
|
|
2
|
-
type PropertyType = string | number | boolean | any[] | Record<any, any>;
|
|
3
|
-
export declare function getPropertyByString<T extends PropertyType>(object: any, key: string): Maybe<T>;
|
|
4
|
-
export declare function getPropertyByString<T extends PropertyType>(object: any, key: string, defaultValue: T): T;
|
|
5
|
-
export declare function getPropertyByString<T extends PropertyType>(object: any, key: string, defaultValue: null): T | null;
|
|
6
|
-
export declare function getPropertyByString<T extends PropertyType>(object: any, key: string, defaultValue: undefined): T | undefined;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/utils/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { voidFunction } from './voidFunction';
|
|
2
|
-
export { getPropertyByString } from './getPropertyByString';
|
|
3
|
-
export { evaluateWithContext } from './evaluateWithContext';
|
|
4
|
-
export { getLocalStorage } from './getLocalStorage';
|
|
5
|
-
export { setLocalStorage } from './setLocalStorage';
|
|
6
|
-
export { axiosOperation } from './axiosOperation';
|
|
7
|
-
export type { AxiosOptions } from './axiosOperation/types';
|
package/utils/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/utils/voidFunction.d.ts
DELETED
package/vite-env.d.ts
DELETED