@m4l/components 9.2.60 → 9.2.61
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/DataGrid/DataGrid.js +17 -3
- package/components/DataGrid/Datagrid.styles.js +72 -20
- package/components/DataGrid/constants.d.ts +2 -0
- package/components/DataGrid/constants.js +7 -3
- package/components/DataGrid/contexts/DataGridContext/index.js +77 -30
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +5 -2
- package/components/DataGrid/dictionary.d.ts +8 -0
- package/components/DataGrid/dictionary.js +26 -17
- package/components/DataGrid/icons.d.ts +7 -0
- package/components/DataGrid/icons.js +8 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +7 -1
- package/components/DataGrid/slots/DataGridEnum.js +6 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +6 -0
- package/components/DataGrid/slots/DataGridSlot.js +35 -5
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Filter/index.js +9 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +3 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.js +9 -2
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +262 -0
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.d.ts +6 -4
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +35 -20
- package/components/DataGrid/subcomponents/Table/index.js +97 -34
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +79 -4
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.d.ts +5 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +146 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.js +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/types.d.ts +131 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/HeaderRenderClick.test.d.ts +1 -0
- package/components/DataGrid/tests/useHeaderMenuActions.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +53 -0
- package/components/DynamicFilter/store/DynamicFilterContext.js +63 -23
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicFilter/types.d.ts +3 -0
- package/components/DynamicSort/DynamicSort.js +10 -6
- package/components/DynamicSort/store/DynamicSortContext.js +96 -67
- package/components/DynamicSort/store/DynamicSortStore.js +53 -4
- package/components/DynamicSort/store/types.d.ts +11 -0
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +0 -2
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -5
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/mui_extended/CheckBox/CheckBox.styles.js +2 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts +3 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +334 -88
- package/index.js +7 -7
- package/package.json +1 -1
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +22 -0
- package/storybook/components/DataGrid/MswHandles.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/filterFieldsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/getRows.d.ts +4 -0
- package/storybook/components/DataGrid/helpers/getRowsWithBackendSimulation.d.ts +9 -0
- package/storybook/components/DataGrid/helpers/sortsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/useSeed.d.ts +3 -0
- package/storybook/components/DataGrid/subcomponents/DataGridRender.d.ts +2 -0
- package/storybook/components/ObjectLogs/ObjectLogs.stories.d.ts +2 -2
|
@@ -8,77 +8,106 @@ import { f as formatToRowSort } from "../helpers/formatToRowSort.js";
|
|
|
8
8
|
import { c as createDynamicSortStore } from "./DynamicSortStore.js";
|
|
9
9
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
10
10
|
const DynamicSortContext = createContext(null);
|
|
11
|
-
const DynamicSortProvider = forwardRef(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
initialAppliedSorts = [],
|
|
16
|
-
onChangeSorts,
|
|
17
|
-
dataTestId = "",
|
|
18
|
-
size = "medium",
|
|
19
|
-
storeId,
|
|
20
|
-
storeDevtoolsEnabled,
|
|
21
|
-
visibleRefresh = true,
|
|
22
|
-
children
|
|
23
|
-
} = props;
|
|
24
|
-
const { currentSize } = useComponentSize(size);
|
|
25
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
26
|
-
const { getLabel } = useModuleDictionary();
|
|
27
|
-
const dynamicSortStoreRef = useRef();
|
|
28
|
-
if (!dynamicSortStoreRef.current) {
|
|
29
|
-
dynamicSortStoreRef.current = createDynamicSortStore({
|
|
11
|
+
const DynamicSortProvider = forwardRef(
|
|
12
|
+
(props, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
automatic = true,
|
|
30
15
|
fields,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
dataTestId,
|
|
34
|
-
size,
|
|
16
|
+
initialAppliedSorts = [],
|
|
17
|
+
onChangeSorts,
|
|
18
|
+
dataTestId = "",
|
|
19
|
+
size = "medium",
|
|
35
20
|
storeId,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
const state = dynamicSortStoreRef.current?.getState();
|
|
65
|
-
if (state) {
|
|
66
|
-
onChangeSorts?.(
|
|
67
|
-
formatToInitialSorts(state.appliedSorts),
|
|
68
|
-
formatToRowSort(state.appliedSorts)
|
|
21
|
+
storeDevtoolsEnabled,
|
|
22
|
+
visibleRefresh = true,
|
|
23
|
+
children
|
|
24
|
+
} = props;
|
|
25
|
+
const { currentSize } = useComponentSize(size);
|
|
26
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
27
|
+
const { getLabel } = useModuleDictionary();
|
|
28
|
+
const dynamicSortStoreRef = useRef();
|
|
29
|
+
if (!dynamicSortStoreRef.current) {
|
|
30
|
+
dynamicSortStoreRef.current = createDynamicSortStore(
|
|
31
|
+
{
|
|
32
|
+
fields,
|
|
33
|
+
automatic,
|
|
34
|
+
getLabel,
|
|
35
|
+
dataTestId,
|
|
36
|
+
size,
|
|
37
|
+
storeId,
|
|
38
|
+
visibleRefresh,
|
|
39
|
+
ownerState: {
|
|
40
|
+
isDirty: false,
|
|
41
|
+
inEdition: false,
|
|
42
|
+
isValid: true,
|
|
43
|
+
isEmpty: true,
|
|
44
|
+
size
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
storeDevtoolsEnabled
|
|
69
48
|
);
|
|
49
|
+
dynamicSortStoreRef.current.getState().actions.init(initialAppliedSorts);
|
|
70
50
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
dynamicSortStoreRef.current
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
const fireOnChangeSort = useStore(
|
|
52
|
+
dynamicSortStoreRef.current,
|
|
53
|
+
(state) => state.actions.fireOnChangeSorts,
|
|
54
|
+
shallow
|
|
55
|
+
);
|
|
56
|
+
const addExternalSort = useStore(
|
|
57
|
+
dynamicSortStoreRef.current,
|
|
58
|
+
(state) => state.actions.addExternalSort,
|
|
59
|
+
shallow
|
|
60
|
+
);
|
|
61
|
+
const removeExternalSort = useStore(
|
|
62
|
+
dynamicSortStoreRef.current,
|
|
63
|
+
(state) => state.actions.removeExternalSort,
|
|
64
|
+
shallow
|
|
65
|
+
);
|
|
66
|
+
const getNewId = useStore(
|
|
67
|
+
dynamicSortStoreRef.current,
|
|
68
|
+
(state) => state.actions.getNewId,
|
|
69
|
+
shallow
|
|
70
|
+
);
|
|
71
|
+
const getCurrentSorts = useStore(
|
|
72
|
+
dynamicSortStoreRef.current,
|
|
73
|
+
(state) => () => state.appliedSorts,
|
|
74
|
+
shallow
|
|
75
|
+
);
|
|
76
|
+
useImperativeHandle(ref, () => ({
|
|
77
|
+
fireOnChangeSort,
|
|
78
|
+
addExternalSort,
|
|
79
|
+
removeExternalSort,
|
|
80
|
+
getNewId,
|
|
81
|
+
getCurrentSorts
|
|
82
|
+
}));
|
|
83
|
+
const countOnChangeSortsApplyed = useStore(
|
|
84
|
+
dynamicSortStoreRef.current,
|
|
85
|
+
(state) => state.countOnChangeSortsApplyed,
|
|
86
|
+
shallow
|
|
87
|
+
);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (countOnChangeSortsApplyed === 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const state = dynamicSortStoreRef.current?.getState();
|
|
93
|
+
if (state) {
|
|
94
|
+
onChangeSorts?.(
|
|
95
|
+
formatToInitialSorts(state.appliedSorts),
|
|
96
|
+
formatToRowSort(state.appliedSorts)
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}, [countOnChangeSortsApplyed]);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (dynamicSortStoreRef.current?.getState().size !== adjustedSize) {
|
|
102
|
+
dynamicSortStoreRef.current?.getState().actions.setSize(adjustedSize);
|
|
103
|
+
}
|
|
104
|
+
if (dynamicSortStoreRef.current?.getState().visibleRefresh !== visibleRefresh) {
|
|
105
|
+
dynamicSortStoreRef.current?.getState().actions.setVisibleRefresh(visibleRefresh);
|
|
106
|
+
}
|
|
107
|
+
}, [adjustedSize, visibleRefresh]);
|
|
108
|
+
return /* @__PURE__ */ jsx(DynamicSortContext.Provider, { value: dynamicSortStoreRef.current, children });
|
|
109
|
+
}
|
|
110
|
+
);
|
|
82
111
|
export {
|
|
83
112
|
DynamicSortProvider as D,
|
|
84
113
|
DynamicSortContext as a
|
|
@@ -9,7 +9,9 @@ const updateAvailableFields = (state) => {
|
|
|
9
9
|
let add;
|
|
10
10
|
const field = state.fields[index];
|
|
11
11
|
add = true;
|
|
12
|
-
const fIndx = state.appliedSorts.findIndex(
|
|
12
|
+
const fIndx = state.appliedSorts.findIndex(
|
|
13
|
+
(f) => f.field.name === field.name
|
|
14
|
+
);
|
|
13
15
|
if (fIndx > -1) {
|
|
14
16
|
add = false;
|
|
15
17
|
}
|
|
@@ -100,7 +102,26 @@ const createDynamicSortStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
100
102
|
*/
|
|
101
103
|
removeSort: (id) => {
|
|
102
104
|
set((state) => {
|
|
103
|
-
const index_to_remove = state.appliedSorts.findIndex(
|
|
105
|
+
const index_to_remove = state.appliedSorts.findIndex(
|
|
106
|
+
(f) => id === f.id && !f.fixed
|
|
107
|
+
);
|
|
108
|
+
if (index_to_remove > -1) {
|
|
109
|
+
state.appliedSorts.splice(index_to_remove, 1);
|
|
110
|
+
updateAutomatic(state);
|
|
111
|
+
if (state.appliedSorts.length === 0) {
|
|
112
|
+
state.ownerState.isDirty = false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* Elimina un campo sort por el nombre de la columna
|
|
119
|
+
*/
|
|
120
|
+
removeExternalSort: (columnName) => {
|
|
121
|
+
set((state) => {
|
|
122
|
+
const index_to_remove = state.appliedSorts.findIndex(
|
|
123
|
+
(f) => f.field.name === columnName && !f.fixed
|
|
124
|
+
);
|
|
104
125
|
if (index_to_remove > -1) {
|
|
105
126
|
state.appliedSorts.splice(index_to_remove, 1);
|
|
106
127
|
updateAutomatic(state);
|
|
@@ -186,12 +207,37 @@ const createDynamicSortStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
186
207
|
updateAutomatic(state);
|
|
187
208
|
});
|
|
188
209
|
},
|
|
210
|
+
/**
|
|
211
|
+
* Agrega un nuevo campo/atributo por el cual se va aplicar el sort externo
|
|
212
|
+
*/
|
|
213
|
+
addExternalSort: (newSort) => {
|
|
214
|
+
set((state) => {
|
|
215
|
+
const existingIndex = state.appliedSorts.findIndex(
|
|
216
|
+
(sort) => sort.field.name === newSort.field.name
|
|
217
|
+
);
|
|
218
|
+
if (existingIndex > -1) {
|
|
219
|
+
const existingSort = state.appliedSorts[existingIndex];
|
|
220
|
+
state.appliedSorts[existingIndex] = {
|
|
221
|
+
...newSort,
|
|
222
|
+
id: existingSort.id
|
|
223
|
+
};
|
|
224
|
+
} else {
|
|
225
|
+
if (!state.automatic) {
|
|
226
|
+
state.ownerState.isDirty = true;
|
|
227
|
+
}
|
|
228
|
+
state.appliedSorts.push(newSort);
|
|
229
|
+
}
|
|
230
|
+
updateAutomatic(state);
|
|
231
|
+
});
|
|
232
|
+
},
|
|
189
233
|
/**
|
|
190
234
|
* Actualiza un sort existente
|
|
191
235
|
*/
|
|
192
236
|
updateSort: (editSort) => {
|
|
193
237
|
set((state) => {
|
|
194
|
-
const index = state.appliedSorts.findIndex(
|
|
238
|
+
const index = state.appliedSorts.findIndex(
|
|
239
|
+
(ap) => ap.id === editSort.id
|
|
240
|
+
);
|
|
195
241
|
if (index > -1) {
|
|
196
242
|
state.appliedSorts[index] = editSort;
|
|
197
243
|
}
|
|
@@ -251,7 +297,10 @@ const createDynamicSortStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
251
297
|
}
|
|
252
298
|
}
|
|
253
299
|
})),
|
|
254
|
-
{
|
|
300
|
+
{
|
|
301
|
+
name: `${DYNAMIC_SORT_STORE_ID}: ${initProps.storeId}`,
|
|
302
|
+
enabled: storeDevtoolsEnabled
|
|
303
|
+
}
|
|
255
304
|
)
|
|
256
305
|
);
|
|
257
306
|
};
|
|
@@ -98,6 +98,11 @@ export interface DynamicSortStateWithActions extends DynamicSortState {
|
|
|
98
98
|
* @param id //identificador unico de un sort
|
|
99
99
|
*/
|
|
100
100
|
removeSort: (id: number) => void;
|
|
101
|
+
/**
|
|
102
|
+
* remueve un sort externo por nombre de columna (para uso desde DataGrid)
|
|
103
|
+
* @param columnName nombre de la columna
|
|
104
|
+
*/
|
|
105
|
+
removeExternalSort: (columnName: string) => void;
|
|
101
106
|
/**
|
|
102
107
|
*
|
|
103
108
|
* @param anchorEl Elemento de donde va emerger el popup
|
|
@@ -136,6 +141,12 @@ export interface DynamicSortStateWithActions extends DynamicSortState {
|
|
|
136
141
|
* @returns
|
|
137
142
|
*/
|
|
138
143
|
addSort: (newSort: SortFieldApplied) => void;
|
|
144
|
+
/**
|
|
145
|
+
* Agrega un sort externo a los sorts aplicados (applyedFilters)
|
|
146
|
+
* @param newSort Sort a agregar
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
addExternalSort: (newSort: SortFieldApplied) => void;
|
|
139
150
|
/**
|
|
140
151
|
* Modifica un sort que se encuentra en applyedFilters
|
|
141
152
|
* @param sortToEdit sort a editar
|
|
@@ -17,11 +17,11 @@ declare function usePopoverSort(): {
|
|
|
17
17
|
sortFormValue: import('../../types').FormSortValueBase;
|
|
18
18
|
formSort: FormSortFieldApplied;
|
|
19
19
|
popupValidationSchema: import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ObjectSchema<{
|
|
20
|
-
[x: string]: import('yup').ObjectSchema
|
|
20
|
+
[x: string]: import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>>, any>;
|
|
21
21
|
}, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<{
|
|
22
|
-
[x: string]: import('yup').ObjectSchema
|
|
22
|
+
[x: string]: import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>>, any>;
|
|
23
23
|
}>, import('yup/lib/object').AssertsShape<{
|
|
24
|
-
[x: string]: import('yup').ObjectSchema
|
|
24
|
+
[x: string]: import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>>, any>;
|
|
25
25
|
}>> | undefined;
|
|
26
26
|
statusLoad: "initial" | "reload_values_provider" | "ready";
|
|
27
27
|
};
|
|
@@ -175,4 +175,8 @@ export type DynamicSortSlotsType = keyof typeof DynamicSortSlots;
|
|
|
175
175
|
export type DynamicSortStyles = M4LOverridesStyleRules<DynamicSortSlotsType, typeof DYNAMIC_SORT_KEY_COMPONENT, Theme>;
|
|
176
176
|
export interface DynamicSortRef {
|
|
177
177
|
fireOnChangeSort: () => void;
|
|
178
|
+
addExternalSort: (newSort: SortFieldApplied) => void;
|
|
179
|
+
removeExternalSort: (columnKey: string) => void;
|
|
180
|
+
getNewId: () => number;
|
|
181
|
+
getCurrentSorts: () => SortFieldApplied[];
|
|
178
182
|
}
|
|
@@ -56,11 +56,9 @@ const useNumberInput = (parameters) => {
|
|
|
56
56
|
(event, field, fieldValue, reason) => {
|
|
57
57
|
if (field === "value" && typeof fieldValue !== "string") {
|
|
58
58
|
switch (reason) {
|
|
59
|
-
// only a blur event will dispatch `numberInput:clamp`
|
|
60
59
|
case "numberInput:inputChange":
|
|
61
60
|
onChange?.(event, fieldValue);
|
|
62
61
|
break;
|
|
63
|
-
// only a blur event will dispatch `numberInput:clamp`
|
|
64
62
|
case "numberInput:clamp":
|
|
65
63
|
onChange?.(event, fieldValue);
|
|
66
64
|
break;
|
|
@@ -65,11 +65,6 @@ const RHFAutocompleteAsyncReducer = (onChangeFilterParms) => (state, action) =>
|
|
|
65
65
|
...state,
|
|
66
66
|
isOpen: false
|
|
67
67
|
};
|
|
68
|
-
// case actionsType.SET_SELECTED_OPTIONS_TO_AUTOCOMPLETE:
|
|
69
|
-
// return {
|
|
70
|
-
// ...state,
|
|
71
|
-
// selectedOptions: action.payload,
|
|
72
|
-
// };
|
|
73
68
|
default:
|
|
74
69
|
return state;
|
|
75
70
|
}
|
|
@@ -3,7 +3,7 @@ import { CustomFormArguments, FormProviderCustomProps, FormProviderProps } from
|
|
|
3
3
|
/**
|
|
4
4
|
* TODO: Documentar
|
|
5
5
|
*/
|
|
6
|
-
export declare function useCustomForm({ validationSchema, values, statusLoad }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any,
|
|
6
|
+
export declare function useCustomForm({ validationSchema, values, statusLoad }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any, FieldValues>;
|
|
7
7
|
/**
|
|
8
8
|
* TODO: Documentar
|
|
9
9
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UseDynamicFilterAndSortProps } from './types';
|
|
2
|
+
import { SortSettings, FilterSettings } from '../../components/DataGrid/types';
|
|
2
3
|
/**
|
|
3
4
|
* Hook para manejar los filtros y ordenamientos dinamicos
|
|
4
5
|
*/
|
|
@@ -7,4 +8,6 @@ export declare const useDynamicFilterAndSort: (props: UseDynamicFilterAndSortPro
|
|
|
7
8
|
rightActions: import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
visibleCustomHeader: boolean;
|
|
9
10
|
customHeaderComponent: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
externalSortSettings: SortSettings | undefined;
|
|
12
|
+
externalFilterSettings: FilterSettings | undefined;
|
|
10
13
|
};
|