@m4l/components 0.1.52 → 0.1.53
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/components/CommonActions/components/ActionFormCancel/{index.bd0d16d6.js → index.8dedf1d5.js} +15 -15
- package/components/CommonActions/components/ActionIntro/{index.d567aebb.js → index.5d5294f2.js} +5 -0
- package/components/CommonActions/components/ActionIntro/test/contants.d.ts +1 -0
- package/components/CommonActions/components/Actions/{index.f0a3167b.js → index.93c9823a.js} +14 -14
- package/components/DataGrid/{index.85390177.js → index.1a6508e2.js} +20 -20
- package/components/DynamicFilter/DynamicFilter.d.ts +9 -0
- package/components/DynamicFilter/classes/index.d.ts +5 -0
- package/components/DynamicFilter/classes/types.d.ts +22 -0
- package/components/DynamicFilter/constants.d.ts +14 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/helpers.d.ts +24 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/index.d.ts +18 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/store.d.ts +213 -0
- package/components/DynamicFilter/contexts/DynamicFilterContext/types.d.ts +5 -0
- package/components/DynamicFilter/dictionary.d.ts +21 -0
- package/components/DynamicFilter/hooks/useDynamicFilter.d.ts +2 -0
- package/components/DynamicFilter/index.2189989e.js +1808 -0
- package/components/DynamicFilter/index.d.ts +4 -6
- package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/index.d.ts +3 -0
- package/components/DynamicFilter/subcomponents/ClearFilters/index.d.ts +1 -1
- package/components/DynamicFilter/subcomponents/FilterButton/index.d.ts +10 -0
- package/components/DynamicFilter/subcomponents/InnerForHooks/index.d.ts +6 -0
- package/components/DynamicFilter/subcomponents/InputFilter/index.d.ts +7 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/index.d.ts +15 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.d.ts +12 -0
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/types.d.ts +6 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/helpers.d.ts +39 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/index.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/helpers.d.ts +42 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/index.d.ts +4 -3
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/helpers.d.ts +36 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/index.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/helpers.d.ts +39 -0
- package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/index.d.ts +4 -2
- package/components/DynamicFilter/subcomponents/fieldstypes/factory.d.ts +72 -4
- package/components/DynamicFilter/subcomponents/fieldstypes/validations.d.ts +25 -6
- package/components/DynamicFilter/tests/contants.d.ts +6 -0
- package/components/DynamicFilter/tests/types.d.ts +2 -0
- package/components/DynamicFilter/tests/utils.d.ts +2 -0
- package/components/DynamicFilter/types.d.ts +173 -42
- package/components/ErrorLabel/{index.78553a1e.js → index.12994bff.js} +5 -5
- package/components/Icon/{index.f6e8d810.js → index.b29ff2d9.js} +1 -1
- package/components/LanguagePopover/{index.5047b444.js → index.628fe97f.js} +5 -5
- package/components/ModalDialog/{index.5a307e29.js → index.49c40899.js} +5 -5
- package/components/ObjectLogs/{index.1315af37.js → index.d7c0092a.js} +23 -23
- package/components/PaperForm/{index.0114aa9b.js → index.c04000a9.js} +1 -1
- package/components/Period/{index.85fe764a.js → index.4f6e419d.js} +15 -15
- package/components/Resizeable/{index.8a442a8b.js → index.04fa8de5.js} +1 -1
- package/components/ScrollBar/{index.39eeb2de.js → index.35ebe9a1.js} +8 -3
- package/components/areas/components/AreasAdmin/{index.dbab59f1.js → index.25e50e70.js} +6 -6
- package/components/areas/components/AreasContainer/{index.f3f921b9.js → index.432b9d4c.js} +3 -3
- package/components/areas/components/GridLayout/{index.9953146d.js → index.359e777e.js} +5 -5
- package/components/areas/components/Window/{index.e34225ae.js → index.2b9f12fe.js} +35 -36
- package/components/areas/components/WindowPopUp/{index.90eb0348.js → index.d5fa0d74.js} +36 -37
- package/components/areas/components/{index.6d863764.js → index.912056a0.js} +10 -10
- package/components/areas/contexts/AreaContext/{index.f25f7180.js → index.b1439daf.js} +1 -1
- package/components/areas/contexts/AreasContext/{index.7406c20f.js → index.fb21af84.js} +1 -1
- package/components/areas/contexts/{index.e80d8f0f.js → index.1e46147e.js} +1 -1
- package/components/areas/hooks/{index.0fd57f88.js → index.5feefc73.js} +1 -1
- package/components/areas/hooks/useArea/{index.7bdbbb79.js → index.6f45f930.js} +2 -2
- package/components/areas/index.3df8c6d4.js +21 -0
- package/components/formatters/BooleanFormatter/{index.b3fb8a75.js → index.a50933fb.js} +1 -1
- package/components/formatters/{index.90a19f9f.js → index.7d2ad9ca.js} +2 -1
- package/components/hook-form/RHFAutocomplete/{index.74add0d0.js → index.0ffa2185.js} +69 -59
- package/components/hook-form/RHFAutocomplete/test/contants.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/{index.0aa3c224.js → index.2dfbe7aa.js} +1 -1
- package/components/hook-form/RHFCheckbox/{index.ca94a050.js → index.1fcf42c8.js} +1 -1
- package/components/hook-form/RHFDateTime/{index.7f1cbd85.js → index.6c129ce4.js} +14 -25
- package/components/hook-form/RHFPeriod/{index.5d2a2071.js → index.1f6aa4c6.js} +2 -2
- package/components/hook-form/RHFTextField/classes/index.d.ts +0 -1
- package/components/hook-form/RHFTextField/{index.bef7eced.js → index.a021a2b3.js} +21 -11
- package/components/hook-form/RHFTextField/tests/contants.d.ts +2 -0
- package/components/index.d.ts +1 -3
- package/components/modal/{WindowBase.b5e29758.js → WindowBase.66ef3c9a.js} +3 -3
- package/components/modal/{WindowConfirm.cbc7720c.js → WindowConfirm.b31ed329.js} +16 -16
- package/components/modal/index.6d5b19ef.js +29 -0
- package/components/mui_extended/Accordion/{index.1d513477.js → index.002bad72.js} +2 -2
- package/components/mui_extended/IconButton/{index.1318a283.js → index.460c0476.js} +1 -1
- package/components/mui_extended/MenuActions/{index.1261168c.js → index.aaafafc3.js} +1 -1
- package/components/mui_extended/Pager/{index.984aac44.js → index.458f9f0d.js} +1 -1
- package/components/mui_extended/{index.cb9d48d2.js → index.915e84dc.js} +5 -5
- package/contexts/ModalContext/{index.3d92d9f9.js → index.d1aaddbc.js} +1 -1
- package/contexts/RHFormContext/{index.828b60ad.js → index.3dc6e2f5.js} +1 -0
- package/hooks/useModal/{index.4454145e.js → index.f77ab08b.js} +1 -1
- package/index.js +196 -225
- package/package.json +2 -2
- package/{react-draggable.0eef011c.js → react-draggable.6471b07e.js} +1 -1
- package/{react-resizable.bb58c8fc.js → react-resizable.b620abed.js} +2 -2
- package/test/constants_no_mock.d.ts +1 -0
- package/utils/{index.e882b264.js → index.b6ae791a.js} +12 -3
- package/utils/index.d.ts +2 -0
- package/vendor.d5904857.js +145 -0
- package/components/DynamicFilter/contexts/BaseContext/index.d.ts +0 -5
- package/components/DynamicFilter/contexts/BaseContext/types.d.ts +0 -45
- package/components/DynamicFilter/hooks/useFilter.d.ts +0 -1
- package/components/DynamicFilter/index.cddd7472.js +0 -1756
- package/components/DynamicFilter/subcomponents/ApplyedFilters/components/ApplyedFilter/index.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/PopupEditFilter/index.d.ts +0 -2
- package/components/DynamicFilter/utils/Clases/index.d.ts +0 -20
- package/components/DynamicFilter/utils/Clases/types.d.ts +0 -17
- package/components/areas/index.6f09d168.js +0 -21
- package/components/modal/index.f6de895f.js +0 -29
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export declare type DynamicFilterClassesKey = keyof DynamicFilterClasses;
|
|
6
|
-
export declare const DynamicFilter: (inProps: DynamicFilterProps) => JSX.Element;
|
|
1
|
+
export * from './DynamicFilter';
|
|
2
|
+
export * from './dictionary';
|
|
3
|
+
export type { FilterFieldApplyed as FilterFieldApply, RawFilterFieldApply, InitialFilterApplyed as InitialFilterFieldApplyed, } from './types';
|
|
4
|
+
export type { DynamicFilterClassesKey } from './classes/types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const ClearFilters: () => JSX.Element;
|
|
2
|
+
export declare const ClearFilters: () => JSX.Element | null;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* @description Boton para aplicar los filtros
|
|
4
|
+
* Si es invalido, debe tener un borde que lo indique, y el tooltip debe ser de tooltip de error
|
|
5
|
+
* Si es valido:
|
|
6
|
+
* - Si es dirty debe estar resaltdo en un color (Significa que esta pendiente por aplicar filtros)
|
|
7
|
+
* * El tooltip debe ser pendiente por aplicar filtros
|
|
8
|
+
* - Si no es dirty debe estar un color que indique el estado
|
|
9
|
+
* * El tooltip debe ser de actualizar
|
|
10
|
+
* @returns JSX
|
|
11
|
+
*/
|
|
2
12
|
export declare function FilterButton(): JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* @description InnerForHooks es una estrategia de mover el componente a nivel interno para poder acceder a los hooks que acceden al contexto DynamicFilterProvider
|
|
4
|
+
* @returns Componente DynamicFilter
|
|
5
|
+
*/
|
|
6
|
+
export declare const InnerForHooks: () => JSX.Element;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @description Subcomponente encargado de cargar los campos que pueden ser filtrados
|
|
4
|
+
* Si el componente permite filtrar por todos los campos, al digita algun texto y luego se presiona anter, se aplica un filtro ALL_FIELD
|
|
5
|
+
* Permite mover la seleccion de campo en el popup a traves del KeyDown, KeyPress, Escape y si está seleccionado un item con Enter se abre el Popover de Menú de campos
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function InputFilter(): JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Subcomponente encargado de permitir agregar o modificar un filtro.
|
|
5
|
+
* El mencanismo para saber si se muestra o no este subcomponente, es si está o no establecida la variable de estado "popoverFilterData"
|
|
6
|
+
* popoverFilterData
|
|
7
|
+
* anchorEl: Funcion que retorna el anchorEl desde donde emerge la ventana
|
|
8
|
+
* openFor: 'Add' si es un para un nuevo filtro, 'Edit' si para editar un filtro actualmente aplicado
|
|
9
|
+
*
|
|
10
|
+
* Consideraciones:
|
|
11
|
+
* Internamente se muestra el subcomponente DataTypeComponent, que dependiendo del tipo de dato del Field muestra un subcomponente diferente.
|
|
12
|
+
* Este componente se puede cargar desde: El PopoverMenuFields (openFor: Add), o cuando se presiona click en un filtro aplicado (openFor: Edit)
|
|
13
|
+
* @returns JSX
|
|
14
|
+
*/
|
|
15
|
+
export declare const PopoverFilter: () => JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PopoverMenuFieldsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @description Subcomponente encargado de mostrar los campos disponibles don el esuario selecciona uno en especifico
|
|
5
|
+
* y lanza el subcomponente PopoverFilter
|
|
6
|
+
* Su visualización depende del anchorEl, que se activa cuando se digita en subcomponente InputFilter
|
|
7
|
+
* @param props
|
|
8
|
+
* selectFieldIndex: Indice del menu seleccionado, -1 si no lo está
|
|
9
|
+
* fields: Field[]: Listado de campos disponibles
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function PopoverMenuFields(props: PopoverMenuFieldsProps): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GetLabelType } from '@m4l/core';
|
|
2
|
+
import { FilterFieldApplyed, Field, DataTypeFilerLabels, FormFilterValueBoolean, FilterValue } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @description Devuelve un filtro Boolean por defecto cuando es nuevo el filtro
|
|
5
|
+
* @param field Sobre que campo se va a incializar
|
|
6
|
+
* @param fixed Indica si es fijo el filtro
|
|
7
|
+
* @returns El filtro por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDefaultBooleanFilter: (field: Field, fixed: boolean) => FilterFieldApplyed;
|
|
10
|
+
/**
|
|
11
|
+
* @description Funciona encargada de devolver los labels necesarios para visualizar un filtro
|
|
12
|
+
* @param field Campo del filtro aplicado
|
|
13
|
+
* @param filter Filtro aplicado
|
|
14
|
+
* @param getLabel Función traductora de etiquetas
|
|
15
|
+
* @returns Objeto con los labels necesarios para visualizar
|
|
16
|
+
*/
|
|
17
|
+
export declare const getBooleanLabels: (filter: FilterFieldApplyed, getLabel: GetLabelType) => DataTypeFilerLabels;
|
|
18
|
+
/**
|
|
19
|
+
* @description Funcion que retorna el esquema de validación para los boolean
|
|
20
|
+
* @param getLabel Función traductora de etiquetas
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const getBooleanSchema: (getLabel: GetLabelType) => import("yup/lib/object").OptionalObjectSchema<{
|
|
24
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
25
|
+
formValueOperand1: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
26
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
27
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
28
|
+
formValueOperand1: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
29
|
+
}>>;
|
|
30
|
+
/**
|
|
31
|
+
* @description Funcion que transforma los valores del filtro en valores compoatibles con React-hook-forms
|
|
32
|
+
* @returns Objeto con los valores que se pueden usar en hook-forms
|
|
33
|
+
*/
|
|
34
|
+
export declare const getBooleanFormValue: (field: Field, getLabel: GetLabelType, filterValueBoolean?: FilterValue | undefined) => FormFilterValueBoolean;
|
|
35
|
+
/**
|
|
36
|
+
* @description Funcion que transforma los valores de React-hook-forms a valores compatibles con el filtro
|
|
37
|
+
* @returns Objeto con los valores que se pueden en el filtro
|
|
38
|
+
*/
|
|
39
|
+
export declare const getFilterFromBooleanFormValue: (formFilterValue: FormFilterValueBoolean) => FilterValue;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @description Subcomponente encargado de los filtros con el tipo de dato "boolean"
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
4
6
|
export declare function BooleanFilter(): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GetLabelType } from '@m4l/core';
|
|
2
|
+
import { FilterFieldApplyed, Field, DataTypeFilerLabels, FormFilterValueDateTime, FilterValue } from '../../../types';
|
|
3
|
+
import { Formatters } from '@m4l/graphics';
|
|
4
|
+
/**
|
|
5
|
+
* @description Devuelve un filtro DateTime por defecto cuando es nuevo el filtro
|
|
6
|
+
* @param field Sobre que campo se va a incializar
|
|
7
|
+
* @param fixed Indica si es fijo el filtro
|
|
8
|
+
* @returns El filtro por defecto
|
|
9
|
+
*/
|
|
10
|
+
export declare const getDefaultDateTimeFilter: (field: Field, fixed: boolean) => FilterFieldApplyed;
|
|
11
|
+
/**
|
|
12
|
+
* @description Funciona encargada de devolver los labels necesarios para visualizar un filtro
|
|
13
|
+
* @param field Campo del filtro aplicado
|
|
14
|
+
* @param filter Filtro aplicado
|
|
15
|
+
* @param getLabel Función traductora de etiquetas
|
|
16
|
+
* @returns Objeto con los labels necesarios para visualizar
|
|
17
|
+
*/
|
|
18
|
+
export declare const getDateLabels: (filter: FilterFieldApplyed, getLabel: GetLabelType, formatters: Formatters) => DataTypeFilerLabels;
|
|
19
|
+
/**
|
|
20
|
+
* @description Funcion que retorna el esquema de validación para los datetime
|
|
21
|
+
* @param getLabel Función traductora de etiquetas
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const getDateTimeSchema: (getLabel: GetLabelType) => import("yup/lib/object").OptionalObjectSchema<{
|
|
25
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
26
|
+
formValueOperand1: import("yup/lib/date").RequiredDateSchema<Date | undefined, import("yup/lib/types").AnyObject>;
|
|
27
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
28
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
29
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
30
|
+
formValueOperand1: import("yup/lib/date").RequiredDateSchema<Date | undefined, import("yup/lib/types").AnyObject>;
|
|
31
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
32
|
+
}>>;
|
|
33
|
+
/**
|
|
34
|
+
* @description Funcion que transforma los valores del filtro en valores compatibles con React-hook-forms
|
|
35
|
+
* @returns Objeto con los valores que se pueden usar en hook-forms
|
|
36
|
+
*/
|
|
37
|
+
export declare const getDateTimeFormValue: (field: Field, getLabel: GetLabelType, filterValueDateTime?: FilterValue | undefined) => FormFilterValueDateTime;
|
|
38
|
+
/**
|
|
39
|
+
* @description Funcion que transforma los valores de React-hook-forms a valores compatibles con el filtro
|
|
40
|
+
* @returns Objeto con los valores que se pueden en el filtro
|
|
41
|
+
*/
|
|
42
|
+
export declare const getFilterFromDateTimeFormValue: (formFilterValue: FormFilterValueDateTime) => FilterValue;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @description Subcomponente encargado de los filtros con el tipo de dato "datetime"
|
|
4
|
+
* @returns JSX
|
|
5
|
+
*/
|
|
5
6
|
export declare function DateTimeFilter(): JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GetLabelType } from '@m4l/core';
|
|
2
|
+
import * as Yup from 'yup';
|
|
3
|
+
import { FilterFieldApplyed, Field, DataTypeFilerLabels, FormFilterValueNumber, FilterValue } from '../../../types';
|
|
4
|
+
export declare const getDefaultNumberFilter: (fieldNumber: Field, fixed: boolean) => FilterFieldApplyed;
|
|
5
|
+
/**
|
|
6
|
+
* @description Funciona encargada de devolver los labels necesarios para visualizar un filtro
|
|
7
|
+
* @param field Campo del filtro aplicado
|
|
8
|
+
* @param filter Filtro aplicado
|
|
9
|
+
* @param getLabel Función traductora de etiquetas
|
|
10
|
+
* @returns Objeto con los labels necesarios para visualizar
|
|
11
|
+
*/
|
|
12
|
+
export declare const getNumberLabels: (filter: FilterFieldApplyed, getLabel: GetLabelType) => DataTypeFilerLabels;
|
|
13
|
+
/**
|
|
14
|
+
* @description Funcion que retorna el esquema de validación para los Numbers
|
|
15
|
+
* @param getLabel Función traductora de etiquetas
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const getNumberSchema: (getLabel: GetLabelType) => import("yup/lib/object").OptionalObjectSchema<{
|
|
19
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
20
|
+
formValueOperand1: Yup.NumberSchema<number | undefined, import("yup/lib/types").AnyObject, number | undefined>;
|
|
21
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
22
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
23
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
24
|
+
formValueOperand1: Yup.NumberSchema<number | undefined, import("yup/lib/types").AnyObject, number | undefined>;
|
|
25
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
26
|
+
}>>;
|
|
27
|
+
/**
|
|
28
|
+
* @description Funcion que transforma los valores del filtro en valores compatibles con React-hook-forms
|
|
29
|
+
* @returns Objeto con los valores que se pueden usar en hook-forms
|
|
30
|
+
*/
|
|
31
|
+
export declare const getNumberFormValue: (field: Field, getLabel: GetLabelType, filterValue?: FilterValue | undefined) => FormFilterValueNumber;
|
|
32
|
+
/**
|
|
33
|
+
* @description Funcion que transforma los valores de React-hook-forms a valores compatibles con el filtro
|
|
34
|
+
* @returns Objeto con los valores que se pueden en el filtro
|
|
35
|
+
*/
|
|
36
|
+
export declare const getFilterFromNumberFormValue: (formFilterValue: FormFilterValueNumber) => FilterValue;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @description Subcomponente encargado de los filtros con el tipo de dato "number"
|
|
4
|
+
* @returns JSX
|
|
5
|
+
*/
|
|
4
6
|
export declare function NumberFilter(): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GetLabelType } from '@m4l/core';
|
|
2
|
+
import { FilterFieldApplyed, Field, DataTypeFilerLabels, FormFilterValueString, FilterValue } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @description Devuelve un filtro String por defecto cuando es nuevo el filtro
|
|
5
|
+
* @param field Sobre que campo se va a incializar
|
|
6
|
+
* @param fixed Indica si es fijo el filtro
|
|
7
|
+
* @returns El filtro por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDefaultStringFilter: (field: Field, fixed: boolean) => FilterFieldApplyed;
|
|
10
|
+
/**
|
|
11
|
+
* @description Funciona encargada de devolver los labels necesarios para visualizar un filtro
|
|
12
|
+
* @param field Campo del filtro aplicado
|
|
13
|
+
* @param filter Filtro aplicado
|
|
14
|
+
* @param getLabel Función traductora de etiquetas
|
|
15
|
+
* @returns Objeto con los labels necesarios para visualizar
|
|
16
|
+
*/
|
|
17
|
+
export declare const getStringLabels: (filter: FilterFieldApplyed, getLabel: GetLabelType) => DataTypeFilerLabels;
|
|
18
|
+
/**
|
|
19
|
+
* @description Funcion que retorna el esquema de validación para los String
|
|
20
|
+
* @param getLabel Función traductora de etiquetas
|
|
21
|
+
* @returns Esquema de validación
|
|
22
|
+
*/
|
|
23
|
+
export declare const getStringSchema: (getLabel: GetLabelType) => import("yup/lib/object").OptionalObjectSchema<{
|
|
24
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
25
|
+
formValueOperand1: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
26
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
27
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
28
|
+
formValueOperand1: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
29
|
+
}>>;
|
|
30
|
+
/**
|
|
31
|
+
* @description Funcion que transforma los valores del filtro en valores compatibles con React-hook-forms
|
|
32
|
+
* @returns Objeto con los valores que se pueden usar en hook-forms
|
|
33
|
+
*/
|
|
34
|
+
export declare const getStringFormValue: (field: Field, getLabel: GetLabelType, filterValue?: FilterValue | undefined) => FormFilterValueString;
|
|
35
|
+
/**
|
|
36
|
+
* @description Funcion que transforma los valores de React-hook-forms a valores compatibles con el filtro
|
|
37
|
+
* @returns Objeto con los valores que se pueden en el filtro
|
|
38
|
+
*/
|
|
39
|
+
export declare const getFilterFromStringFormValue: (formFilterValue: FormFilterValueString) => FilterValue;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @description Subcomponente encargado de los filtros con el tipo de dato "string"
|
|
4
|
+
* @returns JSX
|
|
5
|
+
*/
|
|
4
6
|
export declare function StringFilter(): JSX.Element;
|
|
@@ -1,7 +1,75 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { GetLabelType } from '@m4l/core';
|
|
3
3
|
import { Formatters } from '@m4l/graphics';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import type { FilterFieldApplyed, Field, DataTypeFilerLabels, FilterValue, FormFilterValue, FormFilterFieldApplyed } from '../../types';
|
|
5
|
+
import { FormStatusLoad } from '../../../../contexts';
|
|
6
|
+
/**
|
|
7
|
+
* @description Subcomponente que permite modficar el filtro basado en el tipo de dato del Field, y setear el focus en el operando1
|
|
8
|
+
* @param props
|
|
9
|
+
* formFilter: Filtro en formato hookForms
|
|
10
|
+
*
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const DataTypeComponent: (props: {
|
|
14
|
+
formFilter: FormFilterFieldApplyed;
|
|
15
|
+
statusLoad: FormStatusLoad;
|
|
7
16
|
}) => JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* @description Funciona encargada de devolver los labels necesarios para visualizar un filtro
|
|
19
|
+
* @param field Campo del filtro aplicado
|
|
20
|
+
* @param filter Filtro aplicado
|
|
21
|
+
* @param getLabel Función traductora de etiquetas
|
|
22
|
+
* @returns Objeto con los labels necesarios para visualizar
|
|
23
|
+
*/
|
|
24
|
+
export declare const getLabelsFilter: (filter: FilterFieldApplyed, getLabel: GetLabelType, formatters: Formatters) => DataTypeFilerLabels;
|
|
25
|
+
/**
|
|
26
|
+
* @description Devuelve un filtro de un tipo de dato por defecto cuando es nuevo el filtro
|
|
27
|
+
* @param field Sobre que campo se va a incializar
|
|
28
|
+
* @param fixed Indica si es fijo el filtro
|
|
29
|
+
* @returns El filtro por defecto
|
|
30
|
+
*/
|
|
31
|
+
export declare const getDefaultValues: (field: Field, fixed: boolean) => FilterFieldApplyed;
|
|
32
|
+
/**
|
|
33
|
+
* @description Funcion que retorna el esquema de validación para los boolean
|
|
34
|
+
* @param getLabel Función traductora de etiquetas
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export declare const getSchemaValidations: (field: Field, getLabel: GetLabelType) => import("yup/lib/object").OptionalObjectSchema<{
|
|
38
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
39
|
+
formValueOperand1: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
40
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
41
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
42
|
+
formValueOperand1: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
43
|
+
}>> | import("yup/lib/object").OptionalObjectSchema<{
|
|
44
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
45
|
+
formValueOperand1: import("yup/lib/date").RequiredDateSchema<Date | undefined, import("yup/lib/types").AnyObject>;
|
|
46
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
47
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
48
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
49
|
+
formValueOperand1: import("yup/lib/date").RequiredDateSchema<Date | undefined, import("yup/lib/types").AnyObject>;
|
|
50
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
51
|
+
}>> | import("yup/lib/object").OptionalObjectSchema<{
|
|
52
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
53
|
+
formValueOperand1: import("yup").NumberSchema<number | undefined, import("yup/lib/types").AnyObject, number | undefined>;
|
|
54
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
55
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
56
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
57
|
+
formValueOperand1: import("yup").NumberSchema<number | undefined, import("yup/lib/types").AnyObject, number | undefined>;
|
|
58
|
+
formValueOperand2: import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
59
|
+
}>> | import("yup/lib/object").OptionalObjectSchema<{
|
|
60
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
61
|
+
formValueOperand1: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
62
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
63
|
+
formValueOperator: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape> | null>;
|
|
64
|
+
formValueOperand1: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
65
|
+
}>>;
|
|
66
|
+
/**
|
|
67
|
+
* @description Funcion que transforma los valores del filtro en valores compoatibles con React-hook-forms
|
|
68
|
+
* @returns Objeto con los valores que se pueden usar en hook-forms
|
|
69
|
+
*/
|
|
70
|
+
export declare const getFormValue: (field: Field, getLabel: GetLabelType, filter?: FilterValue | undefined) => FormFilterValue;
|
|
71
|
+
/**
|
|
72
|
+
* @description Funcion que transforma los valores de React-hook-forms a valores compatibles con el filtro
|
|
73
|
+
* @returns Objeto con los valores que se pueden en el filtro
|
|
74
|
+
*/
|
|
75
|
+
export declare const getFilterFromFormValue: (filter: FormFilterValue) => FilterValue;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { InitialFilterApplyed } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Función que verifica si el filtro es correcto cuando el tipo de de dato es Boolean
|
|
4
|
+
* @param filter : Filtro que proviene normalmentee de las cookies ;
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const verifyBooleanFilter: (filter: InitialFilterApplyed) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description Función que verifica si el filtro es correcto cuando el tipo de de dato es DateTime
|
|
10
|
+
* @param filter : Filtro que proviene normalmentee de las cookies ;
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const verifyDateTime: (filter: InitialFilterApplyed) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @description Función que verifica si el filtro es correcto cuando el tipo de de dato es Number
|
|
16
|
+
* @param filter : Filtro que proviene normalmentee de las cookies ;
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const verifyNumberFilter: (filter: InitialFilterApplyed) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description Función que verifica si el filtro es correcto cuando el tipo de de dato es String
|
|
22
|
+
* @param filter : Filtro que proviene normalmentee de las cookies ;
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const verifyStringFilter: (filter: InitialFilterApplyed) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Field } from '../types';
|
|
2
|
+
export declare const DYNAMICFILTER_TEST_ID = "m4ldynamicfilter";
|
|
3
|
+
export declare const PREFIX_TEST_ATTRIBUTE = "data-test";
|
|
4
|
+
export declare const TEST_PROP_FIELDS: string;
|
|
5
|
+
export declare const TEST_FIELDS: Field[];
|
|
6
|
+
export declare const INITIAL_APPLYED_FILTERS_EMPTY: never[];
|