upconta.frontend-utils 2.2.1 → 2.3.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 (37) hide show
  1. package/.dist/cjs/components/IdentificadorPersona.d.ts +3 -1
  2. package/.dist/cjs/components/IdentificadorPersona.test.d.ts +1 -0
  3. package/.dist/cjs/components/Seeker.d.ts +31 -3
  4. package/.dist/cjs/components/Seeker.utils.mx.d.ts +66 -0
  5. package/.dist/cjs/components/SeekerMx.d.ts +4 -0
  6. package/.dist/cjs/components/Tutoriales.test.d.ts +1 -0
  7. package/.dist/cjs/components/administrative/mx/FormDirecciones.d.ts +9 -0
  8. package/.dist/cjs/components/administrative/mx/FormularioPersonasMx.d.ts +18 -0
  9. package/.dist/cjs/components/administrative/mx/FormularioProductoServicioMx.d.ts +7 -0
  10. package/.dist/cjs/components/contability/Bancos.d.ts +6 -0
  11. package/.dist/cjs/components/contability/FormularioCuentas.d.ts +5 -0
  12. package/.dist/cjs/components/contability/ModalCC.d.ts +7 -0
  13. package/.dist/cjs/components/contexts/ConfiguracionContext.d.ts +11 -0
  14. package/.dist/cjs/components/contexts/Empresa.d.ts +2 -1
  15. package/.dist/cjs/components/index.d.ts +3 -0
  16. package/.dist/cjs/components/mx/administrative/FormDirecciones.d.ts +9 -0
  17. package/.dist/cjs/components/mx/administrative/FormularioPersonasMx.d.ts +18 -0
  18. package/.dist/cjs/components/mx/administrative/FormularioProductoServicioMx.d.ts +7 -0
  19. package/.dist/cjs/components/mx/contability/Bancos.d.ts +6 -0
  20. package/.dist/cjs/components/mx/contability/FormularioCuentas.d.ts +5 -0
  21. package/.dist/cjs/components/mx/contability/ModalCC.d.ts +7 -0
  22. package/.dist/cjs/index.js +2 -2
  23. package/.dist/cjs/index.js.map +1 -1
  24. package/.dist/cjs/libs/filtros.d.ts +3 -3
  25. package/.dist/cjs/libs/filtros.test.d.ts +1 -0
  26. package/.dist/cjs/libs/hooks/vista-insertar.test.d.ts +1 -0
  27. package/.dist/cjs/libs/hooks/vista-principal.d.ts +8 -2
  28. package/.dist/cjs/libs/hooks/vista-principal.test.d.ts +1 -0
  29. package/.dist/cjs/libs/reglas.d.ts +1 -1
  30. package/.dist/cjs/libs/reglas.test.d.ts +1 -0
  31. package/.dist/cjs/types/mx/utils.d.ts +85 -0
  32. package/.dist/cjs/types.d.ts +1 -0
  33. package/.dist/esm/index.js +2 -2
  34. package/.dist/esm/index.js.map +1 -1
  35. package/jest.config.ts +11 -0
  36. package/jest.setup.js +19 -0
  37. 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;
@@ -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
- interface SeekerProps {
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: Tipos;
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,4 @@
1
+ import { SeekerProps } from './Seeker';
2
+ import { FC } from 'react';
3
+ declare const SeekerMx: FC<Omit<SeekerProps, '_useSeekerHook'>>;
4
+ export default SeekerMx;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { FormInstance } from 'antd';
3
+ export declare const FormDirecciones: FC<{
4
+ form: FormInstance;
5
+ street?: boolean;
6
+ name: (string | number)[];
7
+ nameComplete: (string | number)[];
8
+ }>;
9
+ export default FormDirecciones;
@@ -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,6 @@
1
+ import { FC } from 'react';
2
+ import { Options } from '../../types';
3
+ declare const Bancos: FC<{
4
+ options: Options;
5
+ }>;
6
+ export default Bancos;
@@ -0,0 +1,5 @@
1
+ import type { SeekerModalRef } from '../Seeker.utils.mx';
2
+ declare const _default: import("react").ForwardRefExoticComponent<{
3
+ ocultarBotones?: boolean;
4
+ } & import("react").RefAttributes<SeekerModalRef>>;
5
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { FormInstance } from 'antd';
2
+ import { FC } from 'react';
3
+ import { Options as Opciones } from '../../types';
4
+ export declare const FormularioMx: FC<{
5
+ options: Opciones;
6
+ form: FormInstance;
7
+ }>;
@@ -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: 'administrative' | 'contability' | 'payroll' | 'treasury' | 'restaurantes' | 'continuidad' | 'configurations', date?: Date | undefined | string) => boolean;
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,9 @@
1
+ import { FC } from 'react';
2
+ import { FormInstance } from 'antd';
3
+ export declare const FormDirecciones: FC<{
4
+ form: FormInstance;
5
+ street?: boolean;
6
+ name: (string | number)[];
7
+ nameComplete: (string | number)[];
8
+ }>;
9
+ export default FormDirecciones;
@@ -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;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { Options } from '../../../types';
3
+ declare const Bancos: FC<{
4
+ options: Options;
5
+ }>;
6
+ export default Bancos;
@@ -0,0 +1,5 @@
1
+ import type { SeekerModalRef } from '../../Seeker.utils.mx';
2
+ declare const _default: import("react").ForwardRefExoticComponent<{
3
+ ocultarBotones?: boolean;
4
+ } & import("react").RefAttributes<SeekerModalRef>>;
5
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { Options as Opciones } from '../../../types';
3
+ import { FormInstance } from 'antd';
4
+ export declare const FormularioMx: FC<{
5
+ options: Opciones;
6
+ form: FormInstance;
7
+ }>;