@m4l/components 9.3.29-JT19112025.beta.6 → 9.3.30-BE211125-beta.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.
- package/components/AppBar/styles.js +1 -1
- package/components/Card/Card.styles.js +1 -1
- package/components/DataGrid/Datagrid.styles.js +39 -111
- package/components/DataGrid/dictionary.d.ts +0 -1
- package/components/DataGrid/dictionary.js +1 -2
- package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +4 -0
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
- package/components/DataGrid/hooks/useModalCardDetail.js +2 -10
- package/components/DataGrid/icons.d.ts +0 -1
- package/components/DataGrid/icons.js +1 -2
- package/components/DataGrid/slots/DataGridEnum.d.ts +1 -4
- package/components/DataGrid/slots/DataGridEnum.js +0 -3
- package/components/DataGrid/slots/DataGridSlot.d.ts +0 -3
- package/components/DataGrid/slots/DataGridSlot.js +33 -48
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +5 -47
- package/components/DataGrid/subcomponents/Cards/index.js +3 -6
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +15 -59
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +1 -5
- package/components/DataGrid/subcomponents/Cards/types.d.ts +0 -16
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +1 -1
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +0 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +14 -39
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/types.d.ts +0 -12
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.d.ts +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.d.ts +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.d.ts +3 -4
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.d.ts +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.d.ts +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.d.ts +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.d.ts +3 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +1 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +1 -7
- package/components/DynamicSort/subcomponents/FieldTypes/FieldTypeInterface.d.ts +2 -3
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.d.ts +3 -2
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.js +3 -2
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +1 -1
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +1 -7
- package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/AreaChip.js +4 -3
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +4 -3
- package/components/hook-form/RHFormProvider/RHFormProvider.d.ts +14 -0
- package/components/hook-form/RHFormProvider/RHFormProvider.js +98 -0
- package/components/hook-form/RHFormProvider/index.d.ts +4 -0
- package/components/hook-form/RHFormProvider/index.js +1 -0
- package/components/hook-form/RHFormProvider/schema.d.ts +17 -0
- package/components/hook-form/RHFormProvider/schema.js +29 -0
- package/components/hook-form/RHFormProvider/types.d.ts +133 -0
- package/components/hook-form/RHFormProvider/types.js +8 -0
- package/components/hook-form/index.d.ts +1 -0
- package/contexts/index.d.ts +3 -3
- package/helpers/getStepsAndValidationSchema/getStepsAndValidationSchema.d.ts +3 -3
- package/helpers/getStepsAndValidationSchema/getStepsAndValidationSchema.js +3 -3
- package/helpers/getStepsAndValidationSchema/types.d.ts +5 -4
- package/hooks/index.d.ts +2 -1
- package/hooks/useFormAddEdit/{index.d.ts → useFormAddEdit.d.ts} +3 -2
- package/hooks/useWatchTyped/index.d.ts +1 -0
- package/hooks/useWatchTyped/index.js +1 -0
- package/hooks/useWatchTyped/types.d.ts +11 -0
- package/hooks/useWatchTyped/useTypedWatch.d.ts +9 -0
- package/hooks/useWatchTyped/useTypedWatch.js +30 -0
- package/index.js +47 -36
- package/package.json +1 -1
- package/components/DataGrid/formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts +0 -1
- package/components/DataGrid/formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts +0 -1
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts +0 -1
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +0 -1
- package/components/hook-form/RHFormContext/index.d.ts +0 -120
- package/components/hook-form/RHFormContext/index.js +0 -91
- package/components/hook-form/RHFormContext/types.d.ts +0 -83
- package/hooks/useFormReadyForUpdate/types.d.ts +0 -8
- /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/constants.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/constants.js +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/index.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/index.js +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/types.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/dictionary.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/dictionary.js +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/styles.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/styles.js +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/index.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/skeleton.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/styles.d.ts +0 -0
- /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/types.d.ts +0 -0
- /package/hooks/useFormAddEdit/{index.js → useFormAddEdit.js} +0 -0
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
5
|
-
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
6
|
-
import { p as pathIcons } from "../../../../icons.js";
|
|
7
|
-
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
3
|
+
import { e as CardDetailContainerStyled, b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled } from "../../../../slots/DataGridSlot.js";
|
|
8
4
|
function CardDetails({
|
|
9
5
|
row,
|
|
10
6
|
columns,
|
|
11
7
|
viewColumnsConfig,
|
|
12
8
|
onRowsChange,
|
|
13
|
-
size = "medium"
|
|
14
|
-
rows,
|
|
15
|
-
rowIndex
|
|
9
|
+
size = "medium"
|
|
16
10
|
}) {
|
|
17
11
|
const [editingColumnKey, setEditingColumnKey] = useState(null);
|
|
18
12
|
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
19
|
-
const { getLabel } = useModuleDictionary();
|
|
20
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
21
|
-
const { currentSize } = useComponentSize(size);
|
|
22
|
-
const currentRow = rows[rowIndex] || row;
|
|
23
13
|
const handleForceRefresh = useCallback(() => {
|
|
24
14
|
setRefreshCounter((prev) => prev + 1);
|
|
25
15
|
}, []);
|
|
@@ -27,8 +17,10 @@ function CardDetails({
|
|
|
27
17
|
if (column.renderCell) {
|
|
28
18
|
return {
|
|
29
19
|
...column,
|
|
30
|
-
// Agregar onAfterChange al objeto de la columna
|
|
31
|
-
onAfterChange
|
|
20
|
+
// Agregar onAfterChange al objeto de la columna si no existe
|
|
21
|
+
...!column.onAfterChange && {
|
|
22
|
+
onAfterChange: handleForceRefresh
|
|
23
|
+
}
|
|
32
24
|
};
|
|
33
25
|
}
|
|
34
26
|
return column;
|
|
@@ -38,8 +30,7 @@ function CardDetails({
|
|
|
38
30
|
(config) => config.key === modifiedColumn.key
|
|
39
31
|
);
|
|
40
32
|
const originalColumn = columns[index];
|
|
41
|
-
const
|
|
42
|
-
const columnKey = hasInteractiveFormatter ? `${originalColumn.key}-${refreshCounter}` : `${originalColumn.key}`;
|
|
33
|
+
const columnKey = `${originalColumn.key}-${refreshCounter}`;
|
|
43
34
|
const shouldShowTitle = configColumn?.showTitle !== false;
|
|
44
35
|
return /* @__PURE__ */ jsx(ContainerLabelValueColumnStyled, { children: /* @__PURE__ */ jsxs(
|
|
45
36
|
ContentWrapperColumnStyled,
|
|
@@ -57,21 +48,17 @@ function CardDetails({
|
|
|
57
48
|
if (modifiedColumn.renderEditCell && editingColumnKey === modifiedColumn.key) {
|
|
58
49
|
return /* @__PURE__ */ jsx(EditorCellWrapperStyled, { ownerState: { size }, children: modifiedColumn.renderEditCell({
|
|
59
50
|
column: originalColumn,
|
|
60
|
-
row
|
|
51
|
+
row,
|
|
61
52
|
rowIdx: index,
|
|
62
53
|
/**
|
|
63
54
|
* onRowChange es una función que se ejecuta cuando el usuario edita una celda.
|
|
64
55
|
*/
|
|
65
56
|
onRowChange: (updatedRow) => {
|
|
66
57
|
if (onRowsChange) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
onRowsChange(updatedRows, {
|
|
71
|
-
indexes: [rowIndex],
|
|
58
|
+
onRowsChange([updatedRow], {
|
|
59
|
+
indexes: [index],
|
|
72
60
|
column: originalColumn
|
|
73
61
|
});
|
|
74
|
-
handleForceRefresh();
|
|
75
62
|
}
|
|
76
63
|
},
|
|
77
64
|
onClose: () => setEditingColumnKey(null)
|
|
@@ -79,8 +66,8 @@ function CardDetails({
|
|
|
79
66
|
}
|
|
80
67
|
if (modifiedColumn.renderCell) {
|
|
81
68
|
const cellContent = modifiedColumn.renderCell({
|
|
82
|
-
column:
|
|
83
|
-
row
|
|
69
|
+
column: originalColumn,
|
|
70
|
+
row,
|
|
84
71
|
rowIdx: index,
|
|
85
72
|
isCellSelected: false,
|
|
86
73
|
tabIndex: -1,
|
|
@@ -89,47 +76,16 @@ function CardDetails({
|
|
|
89
76
|
*/
|
|
90
77
|
onRowChange: (updatedRow) => {
|
|
91
78
|
if (onRowsChange) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
95
|
-
onRowsChange(updatedRows, {
|
|
96
|
-
indexes: [rowIndex],
|
|
79
|
+
onRowsChange([updatedRow], {
|
|
80
|
+
indexes: [index],
|
|
97
81
|
column: originalColumn
|
|
98
82
|
});
|
|
99
|
-
handleForceRefresh();
|
|
100
83
|
}
|
|
101
84
|
}
|
|
102
85
|
});
|
|
103
86
|
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: cellContent });
|
|
104
87
|
}
|
|
105
|
-
|
|
106
|
-
const isEmpty = rawValue === null || rawValue === void 0 || rawValue === "";
|
|
107
|
-
const isEditable = !!modifiedColumn.renderEditCell;
|
|
108
|
-
if (isEditable) {
|
|
109
|
-
return /* @__PURE__ */ jsxs(EditablePlaceholderStyled, { children: [
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
ValueColumnStyled,
|
|
112
|
-
{
|
|
113
|
-
variant: "body",
|
|
114
|
-
color: isEmpty ? "text.secondary" : "text.primary",
|
|
115
|
-
children: isEmpty ? getLabel(DICTIONARY.EDIT_PLACEHOLDER) : rawValue
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
119
|
-
IconButtonEditStyled,
|
|
120
|
-
{
|
|
121
|
-
src: `${host_static_assets}/${environment_assets}/${pathIcons.edit}`,
|
|
122
|
-
onClick: () => {
|
|
123
|
-
setEditingColumnKey(modifiedColumn.key);
|
|
124
|
-
},
|
|
125
|
-
size: currentSize,
|
|
126
|
-
role: "button",
|
|
127
|
-
"aria-label": "Editar texto"
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] });
|
|
131
|
-
}
|
|
132
|
-
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: rawValue ?? "-" });
|
|
88
|
+
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: row[modifiedColumn.key] ?? "-" });
|
|
133
89
|
})()
|
|
134
90
|
]
|
|
135
91
|
}
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo, useCallback } from "react";
|
|
3
3
|
import { useEnvironment } from "@m4l/core";
|
|
4
4
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
5
|
-
import {
|
|
5
|
+
import { f as CardHeaderStyled, g as CardHeaderLeftStyled, h as CardHeaderRightStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../icons.js";
|
|
7
7
|
import { C as CheckboxCellAdapter } from "../../../CheckboxCellAdapter/index.js";
|
|
8
8
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
@@ -3,9 +3,9 @@ import { CardRowProps } from '../../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Componente que muestra una fila de tarjetas.
|
|
5
5
|
*/
|
|
6
|
-
declare function CardRowComponent<TRow, TKey extends RowKey = RowKey>({ row,
|
|
6
|
+
declare function CardRowComponent<TRow, TKey extends RowKey = RowKey>({ row, columns, originalColumns, rowKeyGetter, selectedRows, onSelectedRowsChange, onRowsChange, customRender, minHeight, isChecked, checkedRows, showCheckbox, onCheckedRowsChange, onOpenDetail, }: CardRowProps<TRow, TKey>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
*/
|
|
10
10
|
export declare const CardRow: typeof CardRowComponent;
|
|
11
11
|
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { i as CardContentWrapperStyled, j as CardContentStyled, k as CardStyled } from "../../../../slots/DataGridSlot.js";
|
|
4
4
|
import { L as LazyLoadCard } from "../LazyLoadCard/index.js";
|
|
5
5
|
import { u as useCardContent } from "../../hooks/useCardContent.js";
|
|
6
6
|
import { C as CardHeader } from "../CardHeader/index.js";
|
|
7
7
|
import { deepEqual } from "fast-equals";
|
|
8
8
|
function CardRowComponent({
|
|
9
9
|
row,
|
|
10
|
-
rows,
|
|
11
|
-
rowIndex,
|
|
12
10
|
columns,
|
|
13
11
|
originalColumns,
|
|
14
12
|
rowKeyGetter,
|
|
@@ -26,8 +24,6 @@ function CardRowComponent({
|
|
|
26
24
|
const hasCustomRender = customRender !== void 0;
|
|
27
25
|
const { cardContent } = useCardContent({
|
|
28
26
|
row,
|
|
29
|
-
rows,
|
|
30
|
-
rowIndex,
|
|
31
27
|
columns,
|
|
32
28
|
onRowsChange
|
|
33
29
|
});
|
|
@@ -78,14 +78,6 @@ export interface CardRowProps<TRow, TKey extends RowKey = RowKey> {
|
|
|
78
78
|
* Fila que se mostrará en la tarjeta
|
|
79
79
|
*/
|
|
80
80
|
row: TRow;
|
|
81
|
-
/**
|
|
82
|
-
* Array completo de todas las filas (necesario para reconstruir el array al editar)
|
|
83
|
-
*/
|
|
84
|
-
rows: readonly TRow[];
|
|
85
|
-
/**
|
|
86
|
-
* Índice de la fila actual en el array de filas
|
|
87
|
-
*/
|
|
88
|
-
rowIndex: number;
|
|
89
81
|
/**
|
|
90
82
|
* Columnas que se mostrarán en la tarjeta (procesadas, filtradas por visibilidad)
|
|
91
83
|
*/
|
|
@@ -148,14 +140,6 @@ export interface CardDetailsProps<TRow> {
|
|
|
148
140
|
viewColumnsConfig: IViewConfig<any, any>[];
|
|
149
141
|
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
150
142
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
151
|
-
/**
|
|
152
|
-
* Array completo de todas las filas (necesario para reconstruir el array al editar)
|
|
153
|
-
*/
|
|
154
|
-
rows: readonly TRow[];
|
|
155
|
-
/**
|
|
156
|
-
* Índice de la fila actual en el array de filas
|
|
157
|
-
*/
|
|
158
|
-
rowIndex: number;
|
|
159
143
|
}
|
|
160
144
|
/**
|
|
161
145
|
* Props para el componente CardHeader
|
|
@@ -3,7 +3,7 @@ import { forwardRef, useContext } from "react";
|
|
|
3
3
|
import { SelectCellFormatter } from "react-data-grid";
|
|
4
4
|
import { C as CheckboxFormatter } from "../Table/subcomponents/CheckboxFormatter.js";
|
|
5
5
|
import { a as DataGridContext } from "../../contexts/DataGridContext/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { l as CheckboxCellWrapperStyled } from "../../slots/DataGridSlot.js";
|
|
7
7
|
const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref) {
|
|
8
8
|
const {
|
|
9
9
|
value,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIsMobile } from "@m4l/graphics";
|
|
3
|
-
import {
|
|
3
|
+
import { m as ControlNavigateStyled } from "../../slots/DataGridSlot.js";
|
|
4
4
|
import { R as RowsCount } from "../HeaderActions/subcomponents/RowsCount/index.js";
|
|
5
5
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
6
6
|
import { P as Pager } from "../../../Pager/Pager.js";
|
|
@@ -6,7 +6,7 @@ import { V as ViewMode } from "./subcomponents/ViewMode/index.js";
|
|
|
6
6
|
import { u as useDataGrid } from "../../hooks/useDataGrid.js";
|
|
7
7
|
import { useIsMobile } from "@m4l/graphics";
|
|
8
8
|
import { M as MobileMenuActions } from "./subcomponents/MobileMenuActions/index.js";
|
|
9
|
-
import { A as ActionsRootStyled,
|
|
9
|
+
import { A as ActionsRootStyled, n as ActionsConfigContainerStyled, o as ContainerLeftActionsStyled, p as ContainerRightActionsStyled } from "../../slots/DataGridSlot.js";
|
|
10
10
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
11
11
|
function HeaderActions(props) {
|
|
12
12
|
const {
|
|
@@ -29,7 +29,7 @@ function HeaderActions(props) {
|
|
|
29
29
|
] }) : /* @__PURE__ */ jsxs(ActionsConfigContainerStyled, { ownerState: { withPager }, children: [
|
|
30
30
|
/* @__PURE__ */ jsxs(ContainerLeftActionsStyled, { children: [
|
|
31
31
|
leftActions,
|
|
32
|
-
typeof rowHeights !== "number" &&
|
|
32
|
+
typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}),
|
|
33
33
|
withLocalFilters && /* @__PURE__ */ jsx(Filter, {}),
|
|
34
34
|
withSettings && !(viewMode === "cards" && cardsViewConfig?.customRender) && /* @__PURE__ */ jsx(Settings, { ...settingsProps, columns }),
|
|
35
35
|
cardsViewConfig !== void 0 && /* @__PURE__ */ jsx(ViewMode, {})
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
3
|
import { Skeleton } from "@mui/material";
|
|
4
4
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
5
|
-
import { R as RowsCountRootStyled,
|
|
5
|
+
import { R as RowsCountRootStyled, q as RowsCountLabelStyled, r as RowsCountValueStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
function RowsCount() {
|
|
7
7
|
const { rowsCount, size } = useDataGrid();
|
|
8
8
|
const { getLabel } = useModuleDictionary();
|
|
@@ -4,7 +4,7 @@ import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
|
-
import {
|
|
7
|
+
import { s as ColumnsConfigWrapperStyled, t as ColumnsConfigDataGridStyled, u as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, v as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../../../dictionary.js";
|
|
9
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
10
10
|
function getRowsFromColumnsConfig(columnsConfig, columns) {
|
|
@@ -4,7 +4,7 @@ import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
|
-
import {
|
|
7
|
+
import { s as ColumnsConfigWrapperStyled, t as ColumnsConfigDataGridStyled, u as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, v as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../../../dictionary.js";
|
|
9
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
10
10
|
function getRowsFromColumnsConfigCards(columnsConfigCards, columns) {
|
|
@@ -6,7 +6,7 @@ import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButt
|
|
|
6
6
|
import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
|
|
7
7
|
import { p as pathIcons } from "../../../../icons.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
9
|
-
import {
|
|
9
|
+
import { w as ContainerToggleCardsStyled, x as CardToggleButtonStyled, y as TextToggleCardButtonStyled } from "../../../../slots/DataGridSlot.js";
|
|
10
10
|
import { I as Icon } from "../../../../../Icon/Icon.js";
|
|
11
11
|
function ViewMode() {
|
|
12
12
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -8,7 +8,7 @@ import { a as filterHeight } from "./subcomponents/SelectColumn.js";
|
|
|
8
8
|
import { u as useSortColumnsRows } from "./hooks/useSortColumnsRows.js";
|
|
9
9
|
import { u as useFilters } from "../../hooks/useFilters.js";
|
|
10
10
|
import { u as useDataGrid } from "../../hooks/useDataGrid.js";
|
|
11
|
-
import {
|
|
11
|
+
import { z as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
|
|
12
12
|
import { u as useHeaderMenuActions } from "./hooks/useHeaderMenuActions.js";
|
|
13
13
|
import { H as HeaderRenderClick } from "./subcomponents/HeaderRenderClick/HeaderRenderClick.js";
|
|
14
14
|
function Table(props) {
|
|
@@ -12,7 +12,6 @@ const CheckboxFormatter = forwardRef(function CheckboxFormatter2({ onChange, che
|
|
|
12
12
|
checked,
|
|
13
13
|
size: "small",
|
|
14
14
|
icon: /* @__PURE__ */ jsx(CheckboxIcon, {}),
|
|
15
|
-
disableRipple: true,
|
|
16
15
|
checkedIcon: /* @__PURE__ */ jsx(CheckboxCheckedIcon, {}),
|
|
17
16
|
indeterminateIcon: /* @__PURE__ */ jsx(CheckboxIndeterminateIcon, {}),
|
|
18
17
|
onChange: handleChange,
|
|
@@ -1,47 +1,22 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import "@mui/material";
|
|
4
|
-
import { I as Icon } from "../../../../Icon/Icon.js";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SvgIcon } from "@mui/material";
|
|
5
3
|
function CheckboxIcon(props) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
src: uncheckedIconUrl,
|
|
12
|
-
size: "small",
|
|
13
|
-
color: "text.primary",
|
|
14
|
-
className: "checkbox-unChecked",
|
|
15
|
-
...props
|
|
16
|
-
}
|
|
17
|
-
);
|
|
4
|
+
return /* @__PURE__ */ jsx(SvgIcon, { ...props, viewBox: "0 0 16 17", className: "checkbox-unChecked", children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5
|
+
/* @__PURE__ */ jsx("g", { "clip-path": "url(#clip0_13395_49048)", children: /* @__PURE__ */ jsx("path", { d: "M13.0156 2.5H3.01562C2.75041 2.5 2.49605 2.60536 2.30852 2.79289C2.12098 2.98043 2.01563 3.23478 2.01562 3.5V13.5C2.01563 13.7652 2.12098 14.0196 2.30852 14.2071C2.49605 14.3946 2.75041 14.5 3.01562 14.5H13.0156C13.2808 14.5 13.5352 14.3946 13.7227 14.2071C13.9103 14.0196 14.0156 13.7652 14.0156 13.5V3.5C14.0156 3.23478 13.9103 2.98043 13.7227 2.79289C13.5352 2.60536 13.2808 2.5 13.0156 2.5ZM3.01562 13.5V3.5H13.0156V13.5H3.01562Z", fill: "#323B3B" }) }),
|
|
6
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_13395_49048", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0 0.5)" }) }) })
|
|
7
|
+
] }) });
|
|
18
8
|
}
|
|
19
9
|
function CheckboxCheckedIcon(props) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
color: "primary.enabled",
|
|
28
|
-
className: "checkbox-checked",
|
|
29
|
-
...props
|
|
30
|
-
}
|
|
31
|
-
);
|
|
10
|
+
return /* @__PURE__ */ jsxs(SvgIcon, { ...props, viewBox: "0 0 16 17", className: "checkbox-checked", children: [
|
|
11
|
+
/* @__PURE__ */ jsxs("g", { "clip-path": "url(#clip0_13395_49057)", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("path", { d: "M13.4323 2H2.59896C2.31164 2 2.03609 2.11414 1.83293 2.3173C1.62976 2.52047 1.51563 2.79602 1.51562 3.08333V13.9167C1.51563 14.204 1.62976 14.4795 1.83293 14.6827C2.03609 14.8859 2.31164 15 2.59896 15H13.4323C13.7196 15 13.9952 14.8859 14.1983 14.6827C14.4015 14.4795 14.5156 14.204 14.5156 13.9167V3.08333C14.5156 2.79602 14.4015 2.52047 14.1983 2.3173C13.9952 2.11414 13.7196 2 13.4323 2Z", fill: "#323B3B" }),
|
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M6.92119 11.6245L4.10001 8.8274L4.99759 7.95696L6.92119 9.84467L11.1014 5.70001L11.9996 6.58993L6.92119 11.6245Z", fill: "#F3F5F7" })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_13395_49057", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0 0.5)" }) }) })
|
|
16
|
+
] });
|
|
32
17
|
}
|
|
33
18
|
function CheckboxIndeterminateIcon(props) {
|
|
34
|
-
|
|
35
|
-
const indeterminateIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/indeterminate.svg`;
|
|
36
|
-
return /* @__PURE__ */ jsx(
|
|
37
|
-
Icon,
|
|
38
|
-
{
|
|
39
|
-
src: indeterminateIconUrl,
|
|
40
|
-
size: "small",
|
|
41
|
-
color: "primary.enabled",
|
|
42
|
-
...props
|
|
43
|
-
}
|
|
44
|
-
);
|
|
19
|
+
return /* @__PURE__ */ jsx(SvgIcon, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M17 3a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4h10zm-1.75 8h-6.5a.75.75 0 00-.75.75v.5c0 .414.336.75.75.75h6.5a.75.75 0 00.75-.75v-.5a.75.75 0 00-.75-.75z" }) });
|
|
45
20
|
}
|
|
46
21
|
export {
|
|
47
22
|
CheckboxIndeterminateIcon as C,
|
|
@@ -5,7 +5,7 @@ import { useDrag, useDrop } from "react-dnd";
|
|
|
5
5
|
import { renderHeaderCell } from "react-data-grid";
|
|
6
6
|
import { u as useFocusRef } from "../hooks/useFocusRef.js";
|
|
7
7
|
import { u as useFilters } from "../../../hooks/useFilters.js";
|
|
8
|
-
import { N as NameColumnIconStyled,
|
|
8
|
+
import { N as NameColumnIconStyled, B as NameColumnStyled, I as IconColumnStyled, F as DraggableHeaderRootStyled, G as ButtonHeaderActionsStyled, H as DraggableWrapperInputBaseStyled, J as IconSearchStyled, K as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
|
|
9
9
|
import { p as pathIcons } from "../../../icons.js";
|
|
10
10
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
11
11
|
import { I as Icon } from "../../../../Icon/Icon.js";
|
package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useMemo, useEffect, useCallback } from "react";
|
|
3
3
|
import { useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
|
|
5
|
-
import {
|
|
5
|
+
import { M as MenuListStyled, O as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
import { M as MenuDivider } from "../../../../../mui_extended/MenuDivider/MenuDivider.js";
|
|
7
7
|
import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { P as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
|
|
3
3
|
function autoFocusAndSelect(input) {
|
|
4
4
|
input?.focus();
|
|
5
5
|
input?.select();
|
|
@@ -193,10 +193,6 @@ export interface UseModalDetailProps<TRow> {
|
|
|
193
193
|
columns: readonly Column<TRow, any>[];
|
|
194
194
|
viewMode: ViewMode;
|
|
195
195
|
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
196
|
-
/**
|
|
197
|
-
* Array completo de todas las filas (necesario para reconstruir el array al editar en el modal)
|
|
198
|
-
*/
|
|
199
|
-
rows: readonly TRow[];
|
|
200
196
|
}
|
|
201
197
|
/**
|
|
202
198
|
* Configuración de una columna específica en vista "cards"
|
|
@@ -256,14 +252,6 @@ export interface CardContentProps<TRow> {
|
|
|
256
252
|
columns: readonly Column<TRow, any>[];
|
|
257
253
|
originalColumns: readonly Column<TRow, any>[];
|
|
258
254
|
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
259
|
-
/**
|
|
260
|
-
* Array completo de todas las filas (necesario para reconstruir el array al editar)
|
|
261
|
-
*/
|
|
262
|
-
rows: readonly TRow[];
|
|
263
|
-
/**
|
|
264
|
-
* Índice de la fila actual en el array de filas
|
|
265
|
-
*/
|
|
266
|
-
rowIndex: number;
|
|
267
255
|
}
|
|
268
256
|
/**
|
|
269
257
|
* Configuración de densidad para el DataGrid.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GetLabelType } from '@m4l/core';
|
|
2
2
|
import { Formatters } from '@m4l/graphics';
|
|
3
3
|
import { DataTypeFilerLabels, FilterField, FilterFieldApplied, FilterValue, FormFilterValueBoolean, InitialFilterApplied } from '../../../types';
|
|
4
|
-
import { IFieldType
|
|
4
|
+
import { IFieldType } from '../FieldTypeInterface';
|
|
5
5
|
import { BooleanFilter } from './index';
|
|
6
|
+
import { ValidationSchema } from '../../../../hook-form/RHFormProvider';
|
|
6
7
|
/**
|
|
7
8
|
* BooleanFilterHelpers es una clase que implementa la interfaz IFieldType
|
|
8
9
|
* para manejar filtros booleanos en un componente de filtro dinámico.
|
|
@@ -28,7 +29,7 @@ export declare class BooleanFilterHelpers implements IFieldType<FormFilterValueB
|
|
|
28
29
|
/**
|
|
29
30
|
* getschema devuelve un esquema de validación para el filtro booleano.
|
|
30
31
|
*/
|
|
31
|
-
getSchema(getLabel: GetLabelType):
|
|
32
|
+
getSchema(getLabel: GetLabelType): ValidationSchema<FormFilterValueBoolean>;
|
|
32
33
|
/**
|
|
33
34
|
* verifyFilter verifica si el filtro es válido.
|
|
34
35
|
*/
|
|
@@ -2,6 +2,7 @@ import * as Yup from "yup";
|
|
|
2
2
|
import { B as BOOLEAN_OPERATORS } from "../../../constants.js";
|
|
3
3
|
import { B as BooleanFilter } from "./index.js";
|
|
4
4
|
import { D as DYNAMIC_FILTER_DICTIONARY_ID, a as DICCTIONARY } from "../../../dictionary.js";
|
|
5
|
+
import { c as createValidationSchema, a as createValidationFullObject, b as createValidationPartialObject } from "../../../../hook-form/RHFormProvider/schema.js";
|
|
5
6
|
class BooleanFilterHelpers {
|
|
6
7
|
getComponent() {
|
|
7
8
|
return BooleanFilter;
|
|
@@ -79,10 +80,10 @@ class BooleanFilterHelpers {
|
|
|
79
80
|
* getschema devuelve un esquema de validación para el filtro booleano.
|
|
80
81
|
*/
|
|
81
82
|
getSchema(getLabel) {
|
|
82
|
-
return
|
|
83
|
+
return createValidationSchema(createValidationFullObject(createValidationPartialObject({
|
|
83
84
|
formValueOperator: Yup.object().nullable().required(getLabel(DICCTIONARY.error_operator_required)),
|
|
84
85
|
formValueOperand1: Yup.object().nullable().required(getLabel(DICCTIONARY.error_operand_required))
|
|
85
|
-
});
|
|
86
|
+
})));
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
88
89
|
* verifyFilter verifica si el filtro es válido.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GetLabelType } from '@m4l/core';
|
|
2
2
|
import { Formatters } from '@m4l/graphics';
|
|
3
3
|
import { DataTypeFilerLabels, FilterField, FilterFieldApplied, FilterValue, FormFilterValueDateTime, InitialFilterApplied } from '../../../types';
|
|
4
|
-
import { IFieldType
|
|
4
|
+
import { IFieldType } from '../FieldTypeInterface';
|
|
5
5
|
import { DateTimeFilter } from './index';
|
|
6
|
+
import { ValidationSchema } from '../../../../hook-form/RHFormProvider';
|
|
6
7
|
/**
|
|
7
8
|
* DateTimeFilterHelpers es una clase que implementa la interfaz IFieldType
|
|
8
9
|
*/
|
|
@@ -27,7 +28,7 @@ export declare class DateTimeFilterHelpers implements IFieldType<FormFilterValue
|
|
|
27
28
|
/**
|
|
28
29
|
* getschema devuelve el esquema de validación de Yup para un filtro de fecha y hora.
|
|
29
30
|
*/
|
|
30
|
-
getSchema(getLabel: GetLabelType):
|
|
31
|
+
getSchema(getLabel: GetLabelType): ValidationSchema<FormFilterValueDateTime>;
|
|
31
32
|
/**
|
|
32
33
|
* verifyFilter verifica si un filtro de fecha y hora es válido.
|
|
33
34
|
*/
|
|
@@ -4,6 +4,7 @@ import { D as DYNAMIC_FILTER_DICTIONARY_ID, a as DICCTIONARY } from "../../../di
|
|
|
4
4
|
import { D as DateTimeFilter } from "./index.js";
|
|
5
5
|
import { startOfDay, endOfDay } from "date-fns";
|
|
6
6
|
import { i as isValidDate } from "../../../../../utils/isValidDate.js";
|
|
7
|
+
import { c as createValidationSchema, a as createValidationFullObject, b as createValidationPartialObject } from "../../../../hook-form/RHFormProvider/schema.js";
|
|
7
8
|
class DateTimeFilterHelpers {
|
|
8
9
|
getComponent() {
|
|
9
10
|
return DateTimeFilter;
|
|
@@ -109,7 +110,7 @@ class DateTimeFilterHelpers {
|
|
|
109
110
|
* getschema devuelve el esquema de validación de Yup para un filtro de fecha y hora.
|
|
110
111
|
*/
|
|
111
112
|
getSchema(getLabel) {
|
|
112
|
-
return
|
|
113
|
+
return createValidationSchema(createValidationFullObject(createValidationPartialObject({
|
|
113
114
|
formValueOperator: Yup.object().nullable().required(getLabel(DICCTIONARY.error_operator_required)),
|
|
114
115
|
formValueOperand1: Yup.date().required(getLabel(DICCTIONARY.error_invalid_date)).typeError(getLabel(DICCTIONARY.error_invalid_date)),
|
|
115
116
|
formValueOperand2: Yup.mixed().when(["formValueOperator.id"], {
|
|
@@ -119,7 +120,7 @@ class DateTimeFilterHelpers {
|
|
|
119
120
|
getLabel(DICCTIONARY.error_invalid_date)
|
|
120
121
|
)
|
|
121
122
|
})
|
|
122
|
-
});
|
|
123
|
+
})));
|
|
123
124
|
}
|
|
124
125
|
/**
|
|
125
126
|
* verifyFilter verifica si un filtro de fecha y hora es válido.
|
|
@@ -2,18 +2,17 @@ import { GetLabelType } from '@m4l/core';
|
|
|
2
2
|
import { Formatters } from '@m4l/graphics';
|
|
3
3
|
import { FC } from 'react';
|
|
4
4
|
import { DataTypeFilerLabels, FilterField, FilterFieldApplied, FilterValue, InitialFilterApplied } from '../../types';
|
|
5
|
-
import
|
|
6
|
-
export type YupSchema = Yup.SchemaOf<any>;
|
|
5
|
+
import { RHFormValues, ValidationSchema } from '../../../hook-form/RHFormProvider/types';
|
|
7
6
|
/**
|
|
8
7
|
* Interface para crear los helpers de cada tipo de campo
|
|
9
8
|
*/
|
|
10
|
-
export interface IFieldType<T> {
|
|
9
|
+
export interface IFieldType<T extends RHFormValues> {
|
|
11
10
|
getComponent(): FC<{
|
|
12
11
|
[key: string]: any;
|
|
13
12
|
}>;
|
|
14
13
|
getDefaultFilter(field: FilterField, fixed: boolean): FilterFieldApplied;
|
|
15
14
|
getLabels(filter: FilterFieldApplied, getLabel: GetLabelType, formatters: Formatters, field: FilterField): DataTypeFilerLabels;
|
|
16
|
-
getSchema(getLabel: GetLabelType):
|
|
15
|
+
getSchema(getLabel: GetLabelType): ValidationSchema<T>;
|
|
17
16
|
getFormValue(field: FilterField, getLabel: GetLabelType, filterValue?: FilterValue): T;
|
|
18
17
|
getFilterFromFormValue(formFilterValue: T): FilterValue;
|
|
19
18
|
verifyFilter(filter: InitialFilterApplied, field?: FilterField): boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GetLabelType } from '@m4l/core';
|
|
2
2
|
import { Formatters } from '@m4l/graphics';
|
|
3
3
|
import { DataTypeFilerLabels, FilterField, FilterFieldApplied, FilterValue, FormFilterValueNumber, InitialFilterApplied } from '../../../types';
|
|
4
|
-
import { IFieldType
|
|
4
|
+
import { IFieldType } from '../FieldTypeInterface';
|
|
5
5
|
import { NumberFilter } from './index';
|
|
6
|
+
import { ValidationSchema } from '../../../../hook-form/RHFormProvider/types';
|
|
6
7
|
/**
|
|
7
8
|
* NumberFilterHelpers es una clase que implementa la interfaz IFieldType
|
|
8
9
|
*/
|
|
@@ -27,7 +28,7 @@ export declare class NumberFilterHelpers implements IFieldType<FormFilterValueNu
|
|
|
27
28
|
/**
|
|
28
29
|
* getSchema devuelve el esquema de validación para el filtro.
|
|
29
30
|
*/
|
|
30
|
-
getSchema(getLabel: GetLabelType):
|
|
31
|
+
getSchema(getLabel: GetLabelType): ValidationSchema<FormFilterValueNumber>;
|
|
31
32
|
/**
|
|
32
33
|
* verifyFilter verifica si el filtro es válido.
|
|
33
34
|
*/
|
|
@@ -2,6 +2,7 @@ import * as Yup from "yup";
|
|
|
2
2
|
import { N as NUMBER_OPERATORS } from "../../../constants.js";
|
|
3
3
|
import { N as NumberFilter } from "./index.js";
|
|
4
4
|
import { D as DYNAMIC_FILTER_DICTIONARY_ID, a as DICCTIONARY } from "../../../dictionary.js";
|
|
5
|
+
import { c as createValidationSchema, a as createValidationFullObject, b as createValidationPartialObject } from "../../../../hook-form/RHFormProvider/schema.js";
|
|
5
6
|
class NumberFilterHelpers {
|
|
6
7
|
getComponent() {
|
|
7
8
|
return NumberFilter;
|
|
@@ -93,7 +94,7 @@ class NumberFilterHelpers {
|
|
|
93
94
|
* getSchema devuelve el esquema de validación para el filtro.
|
|
94
95
|
*/
|
|
95
96
|
getSchema(getLabel) {
|
|
96
|
-
return
|
|
97
|
+
return createValidationSchema(createValidationFullObject(createValidationPartialObject({
|
|
97
98
|
formValueOperator: Yup.object().nullable().required(getLabel(DICCTIONARY.error_operator_required)),
|
|
98
99
|
formValueOperand1: Yup.number().typeError(
|
|
99
100
|
getLabel(DICCTIONARY.error_operand_mustbe_number)
|
|
@@ -105,7 +106,7 @@ class NumberFilterHelpers {
|
|
|
105
106
|
getLabel(DICCTIONARY.error_less_than_start)
|
|
106
107
|
)
|
|
107
108
|
})
|
|
108
|
-
});
|
|
109
|
+
})));
|
|
109
110
|
}
|
|
110
111
|
/**
|
|
111
112
|
* verifyFilter verifica si el filtro es válido.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GetLabelType } from '@m4l/core';
|
|
2
2
|
import { Formatters } from '@m4l/graphics';
|
|
3
3
|
import { DataTypeFilerLabels, FilterField, FilterFieldApplied, FilterValue, FilterValueSelectAsync, FormFilterValueSelectAsync, OperandSelectAsync, InitialFilterApplied } from '../../../types';
|
|
4
|
-
import { IFieldType
|
|
4
|
+
import { IFieldType } from '../FieldTypeInterface';
|
|
5
5
|
import { SelectAsyncFilter } from './index';
|
|
6
|
+
import { ValidationSchema } from '../../../../hook-form/RHFormProvider/types';
|
|
6
7
|
/**
|
|
7
8
|
* Filtra los valores de operandArray para que solo tengan valores validos
|
|
8
9
|
* @param operandsArray valores del OperandsArray
|
|
@@ -34,7 +35,7 @@ export declare class SelectAsyncFilterHelpers implements IFieldType<FormFilterVa
|
|
|
34
35
|
/**
|
|
35
36
|
* getschema devuelve el esquema de validación de Yup para el filtro.
|
|
36
37
|
*/
|
|
37
|
-
getSchema(getLabel: GetLabelType):
|
|
38
|
+
getSchema(getLabel: GetLabelType): ValidationSchema<FormFilterValueSelectAsync>;
|
|
38
39
|
/**
|
|
39
40
|
* verifyFilter verifica si el filtro es válido.
|
|
40
41
|
*/
|