upconta.frontend-utils 2.3.2 → 2.5.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/Seeker.d.ts +10 -58
- package/.dist/cjs/components/Seeker.utils.d.ts +14 -38
- package/.dist/cjs/components/Seeker.utils.ec.d.ts +4 -0
- package/.dist/cjs/components/Seeker.utils.mx.d.ts +4 -66
- package/.dist/cjs/components/SeekerMx.d.ts +3 -2
- package/.dist/cjs/components/administrative/FormularioPersonas.d.ts +1 -1
- package/.dist/cjs/components/contability/AccountingVoucherButton.d.ts +9 -0
- package/.dist/cjs/components/contability/AccountingVoucherModal.d.ts +12 -0
- package/.dist/cjs/components/contexts/Empresa.d.ts +1 -0
- package/.dist/cjs/components/index.d.ts +5 -3
- package/.dist/cjs/components/mx/administrative/FormularioPersonasMx.d.ts +1 -1
- package/.dist/cjs/components/mx/administrative/FormularioProductoServicioMx.d.ts +1 -1
- package/.dist/cjs/components/mx/contability/FormularioCuentas.d.ts +1 -1
- package/.dist/cjs/components/production/ProductsServicesForm.d.ts +13 -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/hooks/accounting-rules.d.ts +7 -0
- package/.dist/cjs/libs/index.d.ts +1 -0
- package/.dist/cjs/libs/utils.d.ts +10 -0
- package/.dist/cjs/types/production.d.ts +78 -0
- package/.dist/cjs/types.d.ts +11 -0
- package/.dist/esm/index.js +2 -2
- package/.dist/esm/index.js.map +1 -1
- package/package.json +18 -18
|
@@ -1,68 +1,20 @@
|
|
|
1
|
+
import { TypesEc } from './Seeker.utils.ec';
|
|
1
2
|
import type { Params } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { Tipos as TiposMx } from './Seeker.utils.mx';
|
|
6
|
-
type Tipos = TiposDefault | TiposMx;
|
|
7
|
-
export interface SeekerProps {
|
|
8
|
-
name: string | number | (number | string)[];
|
|
9
|
-
label?: string | null;
|
|
10
|
-
type?: Tipos;
|
|
3
|
+
import { AutoCompleteProps, FormItemProps } from 'antd';
|
|
4
|
+
export type SeekerProps<T> = Pick<FormItemProps, 'name' | 'label' | 'className' | 'initialValue'> & Pick<AutoCompleteProps, 'disabled' | 'allowClear' | 'placeholder'> & {
|
|
5
|
+
type?: T;
|
|
11
6
|
required?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
7
|
hideMessage?: boolean;
|
|
14
|
-
|
|
15
|
-
* Indica si se debe llenar el campo cuando se tipea en el buscador.
|
|
16
|
-
*/
|
|
17
|
-
llenarCuandoTipea?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Reemplaza el `params` que será proporcionado al axios para hacer consultas
|
|
20
|
-
* mas personalizadas.
|
|
21
|
-
*/
|
|
8
|
+
fillWhileTyping?: boolean;
|
|
22
9
|
params?: Params;
|
|
23
10
|
canCreate?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Este objeto hará que se habilité el botón para poder crear recurso. Una
|
|
26
|
-
* vez que se cree el recurso esta variable debe volver a `undefined` para
|
|
27
|
-
* que se deje de mostrar el botón.
|
|
28
|
-
*/
|
|
29
11
|
cuerpoCrear?: any;
|
|
30
|
-
/**
|
|
31
|
-
* Las clases que se aplicaran al `Form.Field`
|
|
32
|
-
*/
|
|
33
|
-
classNameFormItem?: FormItemProps['className'];
|
|
34
|
-
/**
|
|
35
|
-
* Si este campo es proporcionado en la carga inicial entonces se carga
|
|
36
|
-
* automáticamente al seeker.
|
|
37
|
-
*/
|
|
38
|
-
initialValue?: any;
|
|
39
12
|
onSelect?: (data: any) => void;
|
|
40
|
-
configs?: any;
|
|
41
|
-
/**
|
|
42
|
-
* Permite decidir que valor se utilizar a mostrar
|
|
43
|
-
*/
|
|
44
13
|
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
14
|
ejecutarSelect?: boolean;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
declare const Seeker: FC<SeekerProps>;
|
|
15
|
+
};
|
|
16
|
+
declare const Seeker: {
|
|
17
|
+
<T = TypesEc>(props: SeekerProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
68
20
|
export default Seeker;
|
|
@@ -1,47 +1,21 @@
|
|
|
1
|
-
import type { Options, Params } from '../types';
|
|
2
|
-
import { VistaInsertar } from '../libs/hooks/vista-insertar';
|
|
3
1
|
import { LegacyRef, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
form: VistaInsertar['form'];
|
|
6
|
-
onSubmit: VistaInsertar['onSubmit'];
|
|
7
|
-
}
|
|
8
|
-
export type Tipos = 'clients' | 'providers' | 'sellers' | 'transporters' | 'cuentas-contables' | 'empleados' | 'mesas' | 'meseros';
|
|
2
|
+
import type { Options, Params, SeekerModalRef } from '../types';
|
|
9
3
|
export interface SeekerType {
|
|
10
|
-
/**
|
|
11
|
-
* El label que se va a mostrar en el FormItem.
|
|
12
|
-
*/
|
|
13
4
|
label: string;
|
|
14
|
-
/**
|
|
15
|
-
* El endpoint del cual debe traer los datos.
|
|
16
|
-
*/
|
|
17
5
|
endpoint: string;
|
|
18
|
-
/**
|
|
19
|
-
* Los parámetros que se madarán al axios para traer los datos.
|
|
20
|
-
*/
|
|
21
6
|
params?: Params;
|
|
22
|
-
/**
|
|
23
|
-
* El campo que se mostrará en el input del autocomplete.
|
|
24
|
-
*/
|
|
25
7
|
field: string;
|
|
26
|
-
/**
|
|
27
|
-
* El placeholder que se visualizará en el input del autocomplete.
|
|
28
|
-
*/
|
|
29
8
|
placeholder: string;
|
|
30
|
-
/**
|
|
31
|
-
* Indica que el endpoint tiene opciones y que debe ser descargadas.
|
|
32
|
-
*/
|
|
33
9
|
withOptions?: boolean;
|
|
34
10
|
title: (record: never) => string;
|
|
35
11
|
subtitle?: (record: never) => ReactNode;
|
|
36
|
-
formItemTexto?: (record: never) => string;
|
|
37
12
|
/**
|
|
38
|
-
*
|
|
13
|
+
* Obtiene el texto extra que se mostrará en el FormItem en vez del
|
|
14
|
+
* `subtitle`. Esta función es útil cuando el `subtitle` no es un string
|
|
15
|
+
* sin un `ReactNode`.
|
|
39
16
|
*/
|
|
17
|
+
getFormItemExtra?: (record: never) => string;
|
|
40
18
|
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
19
|
buscarPorQueryString?: boolean;
|
|
46
20
|
modal?: {
|
|
47
21
|
itemNoEncontrado?: string;
|
|
@@ -51,14 +25,16 @@ export interface SeekerType {
|
|
|
51
25
|
ref: LegacyRef<SeekerModalRef>;
|
|
52
26
|
}) => ReactNode;
|
|
53
27
|
};
|
|
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
28
|
preBusquedaQ?: (value: string) => string;
|
|
59
29
|
}
|
|
60
|
-
|
|
61
|
-
|
|
30
|
+
export type FnPack<T = never> = (args: {
|
|
31
|
+
type?: T;
|
|
62
32
|
options?: Options;
|
|
63
|
-
|
|
33
|
+
params?: Params;
|
|
34
|
+
}) => SeekerType | undefined;
|
|
35
|
+
export declare const initSeeker: (fc: FnPack) => FnPack<never>;
|
|
36
|
+
declare const useSeekerTypes: (args: {
|
|
37
|
+
type: never | undefined;
|
|
38
|
+
params?: Params;
|
|
39
|
+
}) => SeekerType | undefined;
|
|
64
40
|
export default useSeekerTypes;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FnPack } from './Seeker.utils';
|
|
2
|
+
export type TypesEc = 'clients' | 'providers' | 'sellers' | 'transporters' | 'cuentas-contables' | 'cost-centers' | 'empleados' | 'mesas' | 'meseros' | 'products' | 'services' | 'products-services';
|
|
3
|
+
declare const seekerPackEc: FnPack<TypesEc>;
|
|
4
|
+
export default seekerPackEc;
|
|
@@ -1,66 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
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;
|
|
1
|
+
import { FnPack } from './Seeker.utils';
|
|
2
|
+
export type TypesMx = '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';
|
|
3
|
+
declare const seekerPackMx: FnPack<TypesMx>;
|
|
4
|
+
export default seekerPackMx;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SeekerProps } from './Seeker';
|
|
2
1
|
import { FC } from 'react';
|
|
3
|
-
|
|
2
|
+
import { SeekerProps } from './Seeker';
|
|
3
|
+
import type { TypesMx } from './Seeker.utils.mx';
|
|
4
|
+
declare const SeekerMx: FC<SeekerProps<TypesMx>>;
|
|
4
5
|
export default SeekerMx;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
declare const AccountingVoucherModal: FC<{
|
|
3
|
+
accountingVoucher: string;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
getPermissions: (route?: string) => {
|
|
6
|
+
leer: boolean;
|
|
7
|
+
escribir: boolean;
|
|
8
|
+
eliminar: boolean;
|
|
9
|
+
anular: boolean;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export default AccountingVoucherModal;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { default as Header } from './Header';
|
|
2
|
-
export { default as SeekerMx } from './SeekerMx';
|
|
3
|
-
export { default as Seeker } from './Seeker';
|
|
4
2
|
export { default as TemaPrincipal } from './TemaPrincipal';
|
|
5
3
|
export { default as BotonMovimientos } from './BotonMovimientos';
|
|
6
4
|
export { default as IdentificadorPersona } from './IdentificadorPersona';
|
|
@@ -10,8 +8,12 @@ export { default as FiltroFechas } from './FiltrosFechas';
|
|
|
10
8
|
export { default as Tutoriales } from './Tutoriales';
|
|
11
9
|
export { default as Autocompletado } from './Autocompletado';
|
|
12
10
|
export { default as FormDirecciones } from './mx/administrative/FormDirecciones';
|
|
11
|
+
export { initSeeker } from './Seeker.utils';
|
|
12
|
+
export { default as Seeker } from './Seeker';
|
|
13
|
+
export { default as SeekerMx } from './SeekerMx';
|
|
14
|
+
export { default as seekerPackMx } from './Seeker.utils.mx';
|
|
13
15
|
export { default as LayoutBase } from './LayoutBase';
|
|
14
16
|
export { default as ContextoEmpresa, useContextoEmpresa, } from './contexts/Empresa';
|
|
15
17
|
export { useFrontendUtils } from './contexts/FrontendUtils';
|
|
16
18
|
export { default as FormularioPersonas } from './administrative/FormularioPersonas';
|
|
17
|
-
export
|
|
19
|
+
export { default as AccountingVoucherButton } from './contability/AccountingVoucherButton';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SeekerModalRef } from '../../types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export declare const SelectCategorias: FC<{
|
|
5
|
+
value?: string[];
|
|
6
|
+
onChange?: (value: string[]) => void;
|
|
7
|
+
}>;
|
|
8
|
+
declare const _default: React.ForwardRefExoticComponent<{
|
|
9
|
+
ocultarBotones?: boolean;
|
|
10
|
+
tipoPorDefecto?: "producto" | "servicio";
|
|
11
|
+
bordered?: boolean;
|
|
12
|
+
} & React.RefAttributes<SeekerModalRef>>;
|
|
13
|
+
export default _default;
|