upconta.frontend-utils 2.2.1 → 2.3.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/.dist/cjs/components/IdentificadorPersona.d.ts +3 -1
- package/.dist/cjs/components/IdentificadorPersona.test.d.ts +1 -0
- package/.dist/cjs/components/Seeker.d.ts +31 -3
- package/.dist/cjs/components/Seeker.utils.mx.d.ts +66 -0
- package/.dist/cjs/components/SeekerMx.d.ts +4 -0
- package/.dist/cjs/components/Tutoriales.test.d.ts +1 -0
- package/.dist/cjs/components/administrative/mx/FormDirecciones.d.ts +9 -0
- package/.dist/cjs/components/administrative/mx/FormularioPersonasMx.d.ts +18 -0
- package/.dist/cjs/components/administrative/mx/FormularioProductoServicioMx.d.ts +7 -0
- package/.dist/cjs/components/contability/Bancos.d.ts +6 -0
- package/.dist/cjs/components/contability/FormularioCuentas.d.ts +5 -0
- package/.dist/cjs/components/contability/ModalCC.d.ts +7 -0
- package/.dist/cjs/components/contexts/ConfiguracionContext.d.ts +11 -0
- package/.dist/cjs/components/contexts/Empresa.d.ts +2 -1
- package/.dist/cjs/components/index.d.ts +3 -0
- package/.dist/cjs/components/mx/administrative/FormDirecciones.d.ts +9 -0
- package/.dist/cjs/components/mx/administrative/FormularioPersonasMx.d.ts +18 -0
- package/.dist/cjs/components/mx/administrative/FormularioProductoServicioMx.d.ts +7 -0
- package/.dist/cjs/components/mx/contability/Bancos.d.ts +6 -0
- package/.dist/cjs/components/mx/contability/FormularioCuentas.d.ts +5 -0
- package/.dist/cjs/components/mx/contability/ModalCC.d.ts +7 -0
- package/.dist/cjs/index.js +2 -2
- package/.dist/cjs/index.js.map +1 -1
- package/.dist/cjs/libs/filtros.d.ts +3 -3
- package/.dist/cjs/libs/filtros.test.d.ts +1 -0
- package/.dist/cjs/libs/hooks/vista-insertar.test.d.ts +1 -0
- package/.dist/cjs/libs/hooks/vista-principal.d.ts +8 -2
- package/.dist/cjs/libs/hooks/vista-principal.test.d.ts +1 -0
- package/.dist/cjs/libs/reglas.d.ts +1 -1
- package/.dist/cjs/libs/reglas.test.d.ts +1 -0
- package/.dist/cjs/types/mx/utils.d.ts +85 -0
- package/.dist/cjs/types.d.ts +1 -0
- package/.dist/esm/index.js +2 -2
- package/.dist/esm/index.js.map +1 -1
- package/jest.config.ts +11 -0
- package/jest.setup.js +19 -0
- package/package.json +22 -14
|
@@ -5,7 +5,9 @@ declare const IdentificadorPersona: FC<{
|
|
|
5
5
|
name: string | string[];
|
|
6
6
|
dependencies?: string[];
|
|
7
7
|
label?: string;
|
|
8
|
-
type: 'ruc' | 'ci' | 'other';
|
|
8
|
+
type: 'ruc' | 'ci' | 'rfc' | 'other';
|
|
9
|
+
subjectType?: string;
|
|
10
|
+
foreing?: boolean;
|
|
9
11
|
rules?: Rule[];
|
|
10
12
|
placeholder?: string;
|
|
11
13
|
disabled?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Params } from '../types';
|
|
2
2
|
import { FC } from 'react';
|
|
3
|
-
import { Tipos } from './Seeker.utils';
|
|
4
3
|
import { FormItemProps } from 'antd';
|
|
5
|
-
|
|
4
|
+
import type { Tipos as TiposDefault } from './Seeker.utils';
|
|
5
|
+
import type { Tipos as TiposMx } from './Seeker.utils.mx';
|
|
6
|
+
type Tipos = TiposDefault | TiposMx;
|
|
7
|
+
export interface SeekerProps {
|
|
6
8
|
name: string | number | (number | string)[];
|
|
7
9
|
label?: string | null;
|
|
8
|
-
type
|
|
10
|
+
type?: Tipos;
|
|
9
11
|
required?: boolean;
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
hideMessage?: boolean;
|
|
@@ -35,6 +37,32 @@ interface SeekerProps {
|
|
|
35
37
|
*/
|
|
36
38
|
initialValue?: any;
|
|
37
39
|
onSelect?: (data: any) => void;
|
|
40
|
+
configs?: any;
|
|
41
|
+
/**
|
|
42
|
+
* Permite decidir que valor se utilizar a mostrar
|
|
43
|
+
*/
|
|
44
|
+
fieldValue?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Muestra el boton de limpiar para el autocompletar
|
|
47
|
+
*/
|
|
48
|
+
allowClear?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Permite establecer un documento por defecto en el seeker
|
|
51
|
+
*/
|
|
52
|
+
documentoPorDefecto?: any;
|
|
53
|
+
/**
|
|
54
|
+
* Permite notificar cuando el documento por defecto cambia
|
|
55
|
+
*/
|
|
56
|
+
onChangeDocumentoPorDefecto?: (documento: any) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Indica si se ejecuta el onSelect en el onMounted
|
|
59
|
+
*/
|
|
60
|
+
ejecutarSelect?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
* Permite que el se estableca que Seeker.utils* usar para inicializar el seeker
|
|
64
|
+
*/
|
|
65
|
+
_useSeekerHook?: any;
|
|
38
66
|
}
|
|
39
67
|
declare const Seeker: FC<SeekerProps>;
|
|
40
68
|
export default Seeker;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Options, Params } from '../types';
|
|
2
|
+
import { VistaInsertar } from '../libs/hooks/vista-insertar';
|
|
3
|
+
import { LegacyRef, ReactNode } from 'react';
|
|
4
|
+
export interface SeekerModalRef {
|
|
5
|
+
form: VistaInsertar['form'];
|
|
6
|
+
onSubmit: VistaInsertar['onSubmit'];
|
|
7
|
+
}
|
|
8
|
+
export type Tipos = 'clients-mx' | 'clients-rfc' | 'codigo-postal' | 'sellers' | 'cuentas-contables-mx' | 'transporters' | 'providers' | 'paises' | 'bankaccounts' | 'colonias' | 'localidades' | 'municipios' | 'estados' | 'ingresos-uuid' | 'products-services' | 'products-and-services-catalog' | 'claves-de-unidad' | 'alumnos' | 'providers-mx' | 'pettycash' | 'creditcards' | 'boxes' | 'faltas' | 'percepciones' | 'deducciones' | 'departamentos' | 'empleados' | 'bodegas' | 'puestos' | 'products' | 'cost-centers' | 'categorias' | 'figuras-transportes' | 'autotransportes';
|
|
9
|
+
export interface SeekerType {
|
|
10
|
+
/**
|
|
11
|
+
* El label que se va a mostrar en el FormItem.
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* El endpoint del cual debe traer los datos.
|
|
16
|
+
*/
|
|
17
|
+
endpoint: string;
|
|
18
|
+
/**
|
|
19
|
+
* Los parámetros que se madarán al axios para traer los datos.
|
|
20
|
+
*/
|
|
21
|
+
params?: Params;
|
|
22
|
+
/**
|
|
23
|
+
* El campo que se mostrará en el input del autocomplete.
|
|
24
|
+
*/
|
|
25
|
+
field: string;
|
|
26
|
+
/**
|
|
27
|
+
* El placeholder que se visualizará en el input del autocomplete.
|
|
28
|
+
*/
|
|
29
|
+
placeholder: string;
|
|
30
|
+
/**
|
|
31
|
+
* Indica que el endpoint tiene opciones y que debe ser descargadas.
|
|
32
|
+
*/
|
|
33
|
+
withOptions?: boolean;
|
|
34
|
+
title: (record: never) => string;
|
|
35
|
+
subtitle?: (record: never) => ReactNode;
|
|
36
|
+
formItemTexto?: (record: never) => string;
|
|
37
|
+
/**
|
|
38
|
+
* El path al identificador único. Por defecto: `_id`.
|
|
39
|
+
*/
|
|
40
|
+
customDocumentId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Si es `true` se busca uno por query string, caso contratio agregando el id
|
|
43
|
+
* del documento: {api}/{id-recurso}.
|
|
44
|
+
*/
|
|
45
|
+
buscarPorQueryString?: boolean;
|
|
46
|
+
modal?: {
|
|
47
|
+
itemNoEncontrado?: string;
|
|
48
|
+
title: string;
|
|
49
|
+
getTexto: (doc: any) => string;
|
|
50
|
+
componente: (props: {
|
|
51
|
+
ref: LegacyRef<SeekerModalRef>;
|
|
52
|
+
}) => ReactNode;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Está función altera el valor con el cual se realizará una búsqueda por `q`.
|
|
56
|
+
* Ideal para hacer uso de expresiones regulares como `^`.
|
|
57
|
+
*/
|
|
58
|
+
preBusquedaQ?: (value: string) => string;
|
|
59
|
+
}
|
|
60
|
+
declare const useSeekerTypes: (args: {
|
|
61
|
+
tipo: Tipos;
|
|
62
|
+
options?: Options;
|
|
63
|
+
params?: Params;
|
|
64
|
+
configs?: SeekerType;
|
|
65
|
+
}) => SeekerType;
|
|
66
|
+
export default useSeekerTypes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ComandaUtils } from '../../../types/mx/utils';
|
|
3
|
+
import type { SeekerModalRef } from '../../Seeker.utils.mx';
|
|
4
|
+
import { FormInstance } from 'antd';
|
|
5
|
+
export declare const Direcciones: FC<{
|
|
6
|
+
form: FormInstance;
|
|
7
|
+
cartaPorte?: boolean;
|
|
8
|
+
name: string;
|
|
9
|
+
newClient?: boolean;
|
|
10
|
+
onSelectDomicilio?: (e: number) => void;
|
|
11
|
+
}>;
|
|
12
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
13
|
+
type: "client" | "provider";
|
|
14
|
+
ocultarBotones?: boolean;
|
|
15
|
+
bordered?: boolean;
|
|
16
|
+
dataExterna?: ComandaUtils;
|
|
17
|
+
} & import("react").RefAttributes<SeekerModalRef>>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SeekerModalRef } from '../../Seeker.utils';
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
ocultarBotones?: boolean;
|
|
4
|
+
tipoPorDefecto?: "producto" | "servicio";
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<SeekerModalRef>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export type Pais = 'ec' | 'mx';
|
|
3
|
+
interface ConfiguracionContextType {
|
|
4
|
+
pais: Pais;
|
|
5
|
+
}
|
|
6
|
+
export declare const ConfiguracionProvider: FC<{
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
pais: Pais;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useConfiguracion: () => ConfiguracionContextType;
|
|
11
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BusinessInfo } from '../../types/Empresa';
|
|
2
2
|
import { FC, ReactNode } from 'react';
|
|
3
|
+
export type ModuleType = 'administrative' | 'contability' | 'payroll' | 'treasury' | 'restaurantes' | 'continuidad' | 'configurations' | 'contabilidad-mx';
|
|
3
4
|
interface Empresa {
|
|
4
5
|
business: BusinessInfo;
|
|
5
6
|
nombreEmpresa: string;
|
|
@@ -9,7 +10,7 @@ interface Empresa {
|
|
|
9
10
|
/**
|
|
10
11
|
* Permite verficar la exitencia y vigencia de un módulo
|
|
11
12
|
*/
|
|
12
|
-
hasModule: (module:
|
|
13
|
+
hasModule: (module: ModuleType, date?: Date | undefined | string) => boolean;
|
|
13
14
|
getPermisos: (route?: string) => {
|
|
14
15
|
escribir: boolean;
|
|
15
16
|
leer: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Header } from './Header';
|
|
2
|
+
export { default as SeekerMx } from './SeekerMx';
|
|
2
3
|
export { default as Seeker } from './Seeker';
|
|
3
4
|
export { default as TemaPrincipal } from './TemaPrincipal';
|
|
4
5
|
export { default as BotonMovimientos } from './BotonMovimientos';
|
|
@@ -8,7 +9,9 @@ export { default as Reloj } from './Reloj';
|
|
|
8
9
|
export { default as FiltroFechas } from './FiltrosFechas';
|
|
9
10
|
export { default as Tutoriales } from './Tutoriales';
|
|
10
11
|
export { default as Autocompletado } from './Autocompletado';
|
|
12
|
+
export { default as FormDirecciones } from './mx/administrative/FormDirecciones';
|
|
11
13
|
export { default as LayoutBase } from './LayoutBase';
|
|
12
14
|
export { default as ContextoEmpresa, useContextoEmpresa, } from './contexts/Empresa';
|
|
13
15
|
export { useFrontendUtils } from './contexts/FrontendUtils';
|
|
14
16
|
export { default as FormularioPersonas } from './administrative/FormularioPersonas';
|
|
17
|
+
export type { Tipos as TiposMx } from './Seeker.utils.mx';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SeekerModalRef } from '../../Seeker.utils.mx';
|
|
2
|
+
import { ComandaUtils } from '../../../types/mx/utils';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
import { FormInstance } from 'antd';
|
|
5
|
+
export declare const Direcciones: FC<{
|
|
6
|
+
form: FormInstance;
|
|
7
|
+
cartaPorte?: boolean;
|
|
8
|
+
name: string;
|
|
9
|
+
newClient?: boolean;
|
|
10
|
+
onSelectDomicilio?: (e: number) => void;
|
|
11
|
+
}>;
|
|
12
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
13
|
+
type: "client" | "provider";
|
|
14
|
+
ocultarBotones?: boolean;
|
|
15
|
+
bordered?: boolean;
|
|
16
|
+
dataExterna?: ComandaUtils;
|
|
17
|
+
} & import("react").RefAttributes<SeekerModalRef>>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SeekerModalRef } from '../../Seeker.utils';
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
ocultarBotones?: boolean;
|
|
4
|
+
tipoPorDefecto?: "producto" | "servicio";
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<SeekerModalRef>>;
|
|
7
|
+
export default _default;
|