@m4l/components 9.2.63-JT14072025.beta.1 → 9.2.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/@types/types.d.ts +8 -0
  2. package/components/ContainerFlow/ContainerFlow.d.ts +7 -0
  3. package/components/ContainerFlow/ContainerFlow.js +25 -0
  4. package/components/ContainerFlow/ContainerFlow.styles.d.ts +2 -0
  5. package/components/ContainerFlow/ContainerFlow.styles.js +46 -0
  6. package/components/ContainerFlow/constants.d.ts +9 -0
  7. package/components/ContainerFlow/constants.js +21 -0
  8. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.d.ts +7 -0
  9. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.js +10 -0
  10. package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.test.d.ts +1 -0
  11. package/components/ContainerFlow/index.d.ts +2 -0
  12. package/components/ContainerFlow/index.js +1 -0
  13. package/components/ContainerFlow/slots/ContainerFlowEnum.d.ts +4 -0
  14. package/components/ContainerFlow/slots/ContainerFlowEnum.js +8 -0
  15. package/components/ContainerFlow/slots/ContainerFlowSlots.d.ts +6 -0
  16. package/components/ContainerFlow/slots/ContainerFlowSlots.js +16 -0
  17. package/components/ContainerFlow/slots/index.d.ts +0 -0
  18. package/components/ContainerFlow/tests/ContainerFlow.test.d.ts +1 -0
  19. package/components/ContainerFlow/types.d.ts +41 -0
  20. package/components/DataGrid/Datagrid.styles.js +2 -22
  21. package/components/DataGrid/formatters/ColumnBooleanFormatter/formatter.d.ts +1 -2
  22. package/components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js +3 -2
  23. package/components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.d.ts +1 -1
  24. package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.d.ts +1 -2
  25. package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js +4 -5
  26. package/components/DataGrid/formatters/ColumnChipStatusFormatter/useColumnChipStatus.d.ts +1 -1
  27. package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.d.ts +1 -2
  28. package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js +4 -11
  29. package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.d.ts +1 -1
  30. package/components/DataGrid/formatters/ColumnDateFormatter/formatter.d.ts +1 -2
  31. package/components/DataGrid/formatters/ColumnDateFormatter/formatter.js +4 -13
  32. package/components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.d.ts +1 -1
  33. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +1 -2
  34. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +2 -2
  35. package/components/DataGrid/formatters/ColumnIconFormatter/useColumnIcon.d.ts +1 -1
  36. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/types.d.ts +2 -2
  37. package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.d.ts +1 -2
  38. package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.js +3 -4
  39. package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.d.ts +1 -1
  40. package/components/DataGrid/formatters/ColumnPointsFormatter/formatter.d.ts +1 -2
  41. package/components/DataGrid/formatters/ColumnPointsFormatter/formatter.js +5 -13
  42. package/components/DataGrid/formatters/ColumnPointsFormatter/useColumnPoints.d.ts +1 -1
  43. package/components/DataGrid/formatters/ColumnPriceFormatter/formatter.d.ts +1 -2
  44. package/components/DataGrid/formatters/ColumnPriceFormatter/formatter.js +4 -11
  45. package/components/DataGrid/formatters/ColumnPriceFormatter/useColumnPrice.d.ts +1 -1
  46. package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.d.ts +2 -2
  47. package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +1 -1
  48. package/components/DataGrid/formatters/ColumnSetCheckFormatter/useColumnSetCheck.d.ts +1 -1
  49. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.d.ts +1 -2
  50. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.js +6 -15
  51. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/useColumnUncertainty.d.ts +1 -1
  52. package/components/DataGrid/index.d.ts +1 -1
  53. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +5 -4
  54. package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +2 -2
  55. package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +2 -2
  56. package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +6 -15
  57. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +7 -9
  58. package/components/DataGrid/subcomponents/Table/index.d.ts +1 -3
  59. package/components/DataGrid/subcomponents/Table/index.js +9 -39
  60. package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
  61. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.d.ts +2 -2
  62. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +2 -2
  63. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +8 -10
  64. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  65. package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +7 -7
  66. package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +3 -3
  67. package/components/DataGrid/types.d.ts +4 -5
  68. package/components/Image/Image.js +4 -2
  69. package/components/Image/image.styles.js +6 -3
  70. package/components/Image/types.d.ts +5 -0
  71. package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
  72. package/components/PropertyValue/PropertyValue.styles.js +1 -1
  73. package/components/areas/contexts/AreasContext/store.js +2 -2
  74. package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +5 -0
  75. package/components/index.d.ts +1 -0
  76. package/components/mui_extended/Accordion/styles.js +3 -5
  77. package/components/mui_extended/MenuItem/MenuItem.js +1 -2
  78. package/components/mui_extended/MenuItem/types.d.ts +0 -4
  79. package/components/mui_extended/TabContent/TabContent.styles.js +3 -0
  80. package/components/mui_extended/TabContent/constants.d.ts +1 -0
  81. package/components/mui_extended/TabContent/constants.js +2 -0
  82. package/components/mui_extended/Typography/Typography.js +3 -1
  83. package/components/mui_extended/Typography/types.d.ts +5 -0
  84. package/components/mui_extended/Typography/typography.styles.js +7 -1
  85. package/helpers/getFieldValueWithRow.js +10 -0
  86. package/index.js +32 -30
  87. package/package.json +2 -2
  88. package/storybook/components/ContainerFlow/ContainerFlow.stories.d.ts +32 -0
  89. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn/index.d.ts +5 -0
  90. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn1Wrappers/index.d.ts +5 -0
  91. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn2Wrappers/index.d.ts +5 -0
  92. package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn3Wrappers/index.d.ts +5 -0
  93. package/storybook/components/ContainerFlow/subcomponents/RenderFlexWrap/index.d.ts +5 -0
  94. package/storybook/components/ContainerFlow/subcomponents/RenderGridLayout/index.d.ts +5 -0
  95. package/storybook/components/ContainerFlow/wrapperItems/index.d.ts +10 -0
  96. package/storybook/components/DataGrid/helpers/types.d.ts +2 -2
@@ -4,7 +4,7 @@ import { ColumnPointsFormatterProps } from './types';
4
4
  * return formatter, customFilter and customSort.
5
5
  */
6
6
  export declare const useColumnPoints: <TRow>(props: ColumnPointsFormatterProps<TRow>) => {
7
- formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
7
+ formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
8
8
  customFilter: (row: TRow, value: string) => boolean;
9
9
  customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
10
10
  };
@@ -1,6 +1,5 @@
1
1
  import { ColumnPriceFormatterProps } from './types';
2
- import { RenderCellProps } from 'react-data-grid';
3
2
  /**
4
3
  * Formatter for column price in DataGrid
5
4
  */
6
- export declare function ColumnPriceFormatter<TRow>(props: ColumnPriceFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare function ColumnPriceFormatter<TRow>(props: ColumnPriceFormatterProps<TRow>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
@@ -1,19 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { P as PriceFormatter } from "../../../formatters/PriceFormatter/PriceFormatter.js";
4
+ import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
4
5
  function ColumnPriceFormatter(props) {
5
6
  const { Component = React.Fragment } = props;
6
- const fieldValue = props.fieldValue;
7
- return (formatterProps) => {
8
- return /* @__PURE__ */ jsx(
9
- PriceFormatter,
10
- {
11
- obProps: formatterProps.row,
12
- ...props,
13
- fieldValue,
14
- Component
15
- }
16
- );
7
+ const fieldValue = getFieldValueWithRow(props.fieldValue);
8
+ return (obProps) => {
9
+ return /* @__PURE__ */ jsx(PriceFormatter, { obProps, ...props, fieldValue, Component });
17
10
  };
18
11
  }
19
12
  export {
@@ -4,7 +4,7 @@ import { ColumnPriceFormatterProps } from './types';
4
4
  * Returns formatter, customFilter and customSort.
5
5
  */
6
6
  export declare const useColumnPrice: <TRow>(props: ColumnPriceFormatterProps<TRow>) => {
7
- formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
7
+ formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
8
8
  customFilter: (row: TRow, value: string) => boolean;
9
9
  customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
10
10
  };
@@ -1,4 +1,4 @@
1
- import { RenderCellProps } from 'react-data-grid';
1
+ import { FormatterProps } from 'react-data-grid';
2
2
  import { ColumnSetCheckFormatterProps } from './types';
3
3
  import { RowKey } from '../../types';
4
4
  /**
@@ -6,4 +6,4 @@ import { RowKey } from '../../types';
6
6
  * acualizando un Set/Setter por medio de un hook generico el cual es invocado con el argumento field para ,
7
7
  * sin la necesidad de entrar en edición como lo hace un editor
8
8
  */
9
- export declare function ColumnSetCheckFormatter<Row, TKey extends RowKey = RowKey>(parameters: ColumnSetCheckFormatterProps<Row, TKey>): (props: RenderCellProps<Row>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare function ColumnSetCheckFormatter<Row, TKey extends RowKey = RowKey>(parameters: ColumnSetCheckFormatterProps<Row, TKey>): (props: FormatterProps<Row>) => import("react/jsx-runtime").JSX.Element;
@@ -23,7 +23,7 @@ function ColumnSetCheckFormatter(parameters) {
23
23
  {
24
24
  value: checkedRows.has(rowKeyGetter(row)) || false,
25
25
  disabled,
26
- tabIndex: props.tabIndex,
26
+ isCellSelected: props.isCellSelected,
27
27
  onChange,
28
28
  "aria-label": "Select"
29
29
  }
@@ -5,7 +5,7 @@ import { ColumnSetCheckFormatterProps } from './types';
5
5
  * Returns formatter, customFilter and customSort.
6
6
  */
7
7
  export declare const useColumnSetCheck: <TRow, TKey extends RowKey = RowKey>(props: ColumnSetCheckFormatterProps<TRow, TKey>) => {
8
- formatter: (props: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
8
+ formatter: (props: import('react-data-grid').FormatterProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
9
9
  customFilter: (row: TRow, value: TKey) => boolean;
10
10
  customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
11
11
  };
@@ -1,6 +1,5 @@
1
1
  import { ColumnUncertaintyFormatterProps } from './types';
2
- import { RenderCellProps } from 'react-data-grid';
3
2
  /**
4
3
  * Formatter for column uncertainty in DataGrid
5
4
  */
6
- export declare function ColumnUncertaintyFormatter<TRow>(props: ColumnUncertaintyFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare function ColumnUncertaintyFormatter<TRow>(props: ColumnUncertaintyFormatterProps<TRow>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
+ import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
3
4
  import { U as UncertaintyFormatter } from "../../../formatters/UncertaintyFormatter/UncertaintyFormatter.js";
4
5
  function ColumnUncertaintyFormatter(props) {
5
6
  const { Component = React.Fragment } = props;
6
- const fieldValue = props.fieldValue;
7
- const fieldSymbol = props.fieldSymbol;
8
- const fieldUnit = props.fieldUnit;
9
- return (formatterProps) => {
10
- return /* @__PURE__ */ jsx(
11
- UncertaintyFormatter,
12
- {
13
- obProps: formatterProps.row,
14
- ...props,
15
- fieldValue,
16
- fieldSymbol,
17
- fieldUnit,
18
- Component
19
- }
20
- );
7
+ const fieldValue = getFieldValueWithRow(props.fieldValue);
8
+ const fieldSymbol = getFieldValueWithRow(props.fieldSymbol);
9
+ const fieldUnit = getFieldValueWithRow(props.fieldUnit);
10
+ return (obProps) => {
11
+ return /* @__PURE__ */ jsx(UncertaintyFormatter, { obProps, ...props, fieldValue, fieldSymbol, fieldUnit, Component });
21
12
  };
22
13
  }
23
14
  export {
@@ -4,7 +4,7 @@ import { ColumnUncertaintyFormatterProps } from './types';
4
4
  * the filter and the customSort of the uncertainty column.
5
5
  */
6
6
  export declare const useColumnUncertanity: <TRow>(props: ColumnUncertaintyFormatterProps<TRow>) => {
7
- formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
7
+ formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
8
8
  customFilter: (row: TRow, value: string) => boolean;
9
9
  customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
10
10
  };
@@ -1,6 +1,6 @@
1
1
  export { DataGrid } from './DataGrid';
2
2
  export * from './formatters';
3
- export type { Column, RenderEditCellProps, RenderCellProps } from 'react-data-grid';
3
+ export type { Column, EditorProps, FormatterProps } from 'react-data-grid';
4
4
  export type { RowKey, ChangeUserColumn } from './types';
5
5
  export { getDataGridComponentsDictionary } from './dictionary';
6
6
  export { TextEditor, NumberEditor } from './subcomponents/editors/TextEditor';
@@ -62,7 +62,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
62
62
  name: getLabel(DICTIONARY.SETTINGS_COLUMN_VISIBLE),
63
63
  width: 80,
64
64
  type: "boolean",
65
- renderCell: ColumnInteractiveCheckFormatter,
65
+ formatter: ColumnInteractiveCheckFormatter,
66
66
  ...getAlignClass("center")
67
67
  },
68
68
  {
@@ -70,7 +70,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
70
70
  name: getLabel(DICTIONARY.SETTINGS_COLUMNS_FROZEN),
71
71
  width: 80,
72
72
  type: "boolean",
73
- renderCell: ColumnInteractiveCheckFormatter,
73
+ formatter: ColumnInteractiveCheckFormatter,
74
74
  ...getAlignClass("center")
75
75
  }
76
76
  ],
@@ -176,7 +176,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
176
176
  const onInternalRowsChange = (newRows) => {
177
177
  setRows(newRows);
178
178
  };
179
- const onCellClick = ({ row }) => {
179
+ const onRowClick = (row) => {
180
180
  if (selRows.has(row.key)) {
181
181
  return;
182
182
  }
@@ -196,8 +196,9 @@ const ColumnsConfig = forwardRef((props, ref) => {
196
196
  onRowsChange: onInternalRowsChange,
197
197
  selectedRows: selRows,
198
198
  onSelectedRowsChange: onInternalSelectedRowsChange,
199
- onCellClick,
199
+ onRowClick,
200
200
  rowKeyGetter: (row) => row.key,
201
+ cellNavigationMode: "CHANGE_ROW",
201
202
  defaultColumnOptions: { resizable: true, sortable: true }
202
203
  }
203
204
  ) })
@@ -1,9 +1,9 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { RenderHeaderCellProps } from 'react-data-grid';
2
+ import { HeaderRendererProps } from 'react-data-grid';
3
3
  /**
4
4
  * Función encargada de retornar el componente de renderizado de cabecera con la capacidad de arrastrar columnas
5
5
  * @param handleColumnsReorder - Función que se ejecuta al reordenar columnas
6
6
  */
7
7
  export declare const getDragHeaderRenderer: <TRow, TSummaryRow>(handleColumnsReorder: (sourceKey: string, targetKey: string) => void, options?: {
8
8
  openPopover?: (anchorEl: HTMLElement, columnKey: string) => void;
9
- }) => FunctionComponent<RenderHeaderCellProps<TRow, TSummaryRow>>;
9
+ }) => FunctionComponent<HeaderRendererProps<TRow, TSummaryRow>>;
@@ -1,6 +1,6 @@
1
- import { Column, SortColumn } from 'react-data-grid';
1
+ import { Column } from 'react-data-grid';
2
2
  import { MenuAction } from '../subcomponents/HeaderRenderClick/types';
3
3
  /**
4
4
  * Función que retorna las acciones del menu del header de la columna
5
5
  */
6
- export declare function useHeaderMenuActions<Trow, TSummaryRow>(columnKey: string | null, finalColumns: readonly Column<Trow, TSummaryRow>[], defaultSortable: boolean, handleSortFromPopover?: (newSortColumns: SortColumn[]) => void): MenuAction[];
6
+ export declare function useHeaderMenuActions<Trow, TSummaryRow>(columnKey: string | null, finalColumns: readonly Column<Trow, TSummaryRow>[], defaultSortable: boolean): MenuAction[];
@@ -3,7 +3,7 @@ import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
3
3
  import { useEnvironment, useModuleDictionary } from "@m4l/core";
4
4
  import { D as DICTIONARY } from "../../../dictionary.js";
5
5
  import { p as pathIcons } from "../../../icons.js";
6
- function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSortFromPopover) {
6
+ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
7
7
  const {
8
8
  columnsConfig,
9
9
  onChangeColumnsConfig,
@@ -14,13 +14,6 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
14
14
  } = useDataGrid();
15
15
  const { host_static_assets, environment_assets } = useEnvironment();
16
16
  const { getLabel } = useModuleDictionary();
17
- const executeSortChange = (newSortColumns) => {
18
- if (handleSortFromPopover) {
19
- handleSortFromPopover(newSortColumns);
20
- } else {
21
- setSortColumns(newSortColumns);
22
- }
23
- };
24
17
  const column = useMemo(() => {
25
18
  return finalColumns.find((c) => c.key === columnKey);
26
19
  }, [columnKey, finalColumns]);
@@ -73,9 +66,8 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
73
66
  if (!columnKey) {
74
67
  return;
75
68
  }
76
- const newSortColumns = sortColumns.filter((s) => s.columnKey !== columnKey);
77
- executeSortChange(newSortColumns);
78
- }, [columnKey, sortColumns, executeSortChange]);
69
+ setSortColumns((prev) => prev.filter((s) => s.columnKey !== columnKey));
70
+ }, [columnKey, setSortColumns]);
79
71
  const hasAnySortApplied = useMemo(() => {
80
72
  return Boolean(currentSort);
81
73
  }, [currentSort]);
@@ -161,7 +153,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
161
153
  if (externalSortSettings) {
162
154
  addExternalSort("asc");
163
155
  } else {
164
- executeSortChange([
156
+ setSortColumns([
165
157
  {
166
158
  columnKey,
167
159
  direction: "ASC"
@@ -183,7 +175,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
183
175
  if (externalSortSettings) {
184
176
  addExternalSort("desc");
185
177
  } else {
186
- executeSortChange([
178
+ setSortColumns([
187
179
  {
188
180
  columnKey,
189
181
  direction: "DESC"
@@ -263,8 +255,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
263
255
  host_static_assets,
264
256
  environment_assets,
265
257
  getLabel,
266
- isAddFilterDisabled,
267
- executeSortChange
258
+ isAddFilterDisabled
268
259
  ]);
269
260
  }
270
261
  export {
@@ -17,6 +17,7 @@ function getComparator(columns, sortColumn) {
17
17
  return column.customSort;
18
18
  }
19
19
  switch (typeOrder) {
20
+ //Si el tipo de dato de la columna es un numerico, retorna una función de ordenamiento numérica
20
21
  case "number":
21
22
  return (a, b) => {
22
23
  try {
@@ -25,6 +26,7 @@ function getComparator(columns, sortColumn) {
25
26
  return -1;
26
27
  }
27
28
  };
29
+ //Por defecto retorna una función de ordenamiento de string
28
30
  default:
29
31
  return (a, b) => {
30
32
  try {
@@ -137,20 +139,16 @@ const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
137
139
  return newColumn;
138
140
  }
139
141
  if (isSkeleton) {
140
- newColumn.renderHeaderCell = SkeletonFormatter;
141
- newColumn.renderCell = SkeletonFormatter;
142
- } else {
143
- if (newColumn.formatter && !newColumn.renderCell) {
144
- newColumn.renderCell = newColumn.formatter;
145
- }
142
+ newColumn.headerRenderer = SkeletonFormatter;
143
+ newColumn.formatter = SkeletonFormatter;
146
144
  }
147
- if (newColumn.renderHeaderCell) {
148
- newColumn.withinHeaderRenderer = newColumn.renderHeaderCell;
145
+ if (newColumn.headerRenderer) {
146
+ newColumn.withinHeaderRenderer = newColumn.headerRenderer;
149
147
  }
150
148
  if ((newColumn?.withFilter === void 0 || newColumn.withFilter === true) && activeFilters) {
151
149
  newColumn.headerCellClass = `${newColumn.headerCellClass} ${filterColumnClassName}`.trim();
152
150
  }
153
- newColumn.renderHeaderCell = DragAndDropHeaderRenderer;
151
+ newColumn.headerRenderer = DragAndDropHeaderRenderer;
154
152
  return newColumn;
155
153
  });
156
154
  }, [
@@ -1,7 +1,5 @@
1
- import { DataGridProps } from 'react-data-grid';
2
1
  import { GridProps, RowKey } from '../../types';
3
2
  /**
4
3
  * Componente que renderiza la tabla con las filas y columnas
5
- * Acepta todos los props de DataGrid y prioriza las configuraciones personalizadas
6
4
  */
7
- export declare function Table<TRow, TSummaryRow, TKey extends RowKey = RowKey>(props: GridProps<TRow, TSummaryRow, TKey> & Omit<DataGridProps<TRow, TSummaryRow>, keyof GridProps<TRow, TSummaryRow, TKey>>): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Table<TRow, TSummaryRow, TKey extends RowKey = RowKey>(props: GridProps<TRow, TSummaryRow, TKey>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useState, useRef, useEffect } from "react";
3
3
  import DataGrid from "react-data-grid";
4
- import "react-data-grid/lib/styles.css";
5
4
  import { DndProvider } from "react-dnd";
6
5
  import { HTML5Backend } from "react-dnd-html5-backend";
7
6
  import { C as CheckboxFormatter } from "./subcomponents/CheckboxFormatter.js";
@@ -19,19 +18,8 @@ function Table(props) {
19
18
  onRowsChange,
20
19
  rowKeyGetter,
21
20
  selectedRows,
22
- onSelectedRowsChange,
23
- defaultColumnOptions: defaultColumnOptionsProp,
24
- ...restProps
21
+ onSelectedRowsChange
25
22
  } = props;
26
- const renderCheckbox = (formatterProps) => {
27
- return /* @__PURE__ */ jsx(
28
- CheckboxFormatter,
29
- {
30
- ...formatterProps,
31
- tabIndex: formatterProps.tabIndex
32
- }
33
- );
34
- };
35
23
  const { finalColumns, finalRows } = useSortColumnsRows(
36
24
  columns,
37
25
  rows,
@@ -67,18 +55,7 @@ function Table(props) {
67
55
  anchorEl: null,
68
56
  columnKey: null
69
57
  });
70
- const [allowSortChange, setAllowSortChange] = useState(false);
71
- const handleSortColumnsChange = (newSortColumns) => {
72
- if (allowSortChange) {
73
- setSortColumns(newSortColumns);
74
- setAllowSortChange(false);
75
- }
76
- };
77
- const handleSortFromPopover = (newSortColumns) => {
78
- setAllowSortChange(true);
79
- setSortColumns(newSortColumns);
80
- };
81
- const onCellClick = ({ row }) => {
58
+ const onRowClick = (row) => {
82
59
  if (selectedRows && onSelectedRowsChange) {
83
60
  if (selectedRows.entries().next().value) {
84
61
  if (selectedRows.entries().next().value?.[1] === rowKeyGetter(row)) {
@@ -113,16 +90,11 @@ function Table(props) {
113
90
  const onColumnResize = (idx, width) => {
114
91
  onChangeColumnWidth(finalColumns[idx].key, width);
115
92
  };
116
- const defaultColumnOptions = {
117
- resizable: true,
118
- sortable: true,
119
- ...defaultColumnOptionsProp || {}
120
- };
93
+ const defaultColumnOptions = { resizable: true, sortable: true };
121
94
  const menuActions = useHeaderMenuActions(
122
95
  popoverState.columnKey,
123
96
  finalColumns,
124
- Boolean(defaultColumnOptions.sortable),
125
- handleSortFromPopover
97
+ defaultColumnOptions.sortable
126
98
  );
127
99
  return /* @__PURE__ */ jsx(TableContainerStyled, { id: "WrapperTable", children: /* @__PURE__ */ jsxs(TableWrapperDataGridStyled, { ownerState: { size }, children: [
128
100
  /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsx(
@@ -133,20 +105,18 @@ function Table(props) {
133
105
  headerRowHeight: activeFilters ? currentRowHeaderHeight + filterHeight : currentRowHeaderHeight,
134
106
  columns: finalColumns,
135
107
  sortColumns,
136
- onSortColumnsChange: handleSortColumnsChange,
108
+ onSortColumnsChange: setSortColumns,
137
109
  onColumnResize,
138
110
  rows: finalRows,
139
111
  onRowsChange,
140
112
  selectedRows,
141
113
  onSelectedRowsChange,
142
- onCellClick,
114
+ onRowClick,
143
115
  rowHeight: currentRowHeight,
144
116
  rowKeyGetter,
145
- renderers: {
146
- renderCheckbox
147
- },
148
- defaultColumnOptions,
149
- ...restProps
117
+ cellNavigationMode: "LOOP_OVER_ROW",
118
+ components: { checkboxFormatter: CheckboxFormatter },
119
+ defaultColumnOptions
150
120
  }
151
121
  ) }),
152
122
  popoverState.columnKey && popoverState.anchorEl instanceof HTMLDivElement && /* @__PURE__ */ jsx(
@@ -35,7 +35,7 @@ const ActionsColumn = {
35
35
  sortable: false,
36
36
  frozen: true,
37
37
  type: "custom",
38
- renderCell: ActionsFormatter
38
+ formatter: ActionsFormatter
39
39
  };
40
40
  function getActionLabel() {
41
41
  return "";
@@ -1,2 +1,2 @@
1
- import { RenderCheckboxProps } from 'react-data-grid';
2
- export declare const CheckboxFormatter: import('react').ForwardRefExoticComponent<RenderCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
1
+ import { CheckboxFormatterProps } from 'react-data-grid';
2
+ export declare const CheckboxFormatter: import('react').ForwardRefExoticComponent<CheckboxFormatterProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,5 @@
1
- import { RenderHeaderCellProps } from 'react-data-grid';
2
- interface DraggableHeaderRendererProps<TRow> extends RenderHeaderCellProps<TRow> {
1
+ import { HeaderRendererProps } from 'react-data-grid';
2
+ interface DraggableHeaderRendererProps<TRow> extends HeaderRendererProps<TRow> {
3
3
  onColumnsReorder: (sourceKey: string, targetKey: string) => void;
4
4
  openPopover?: (anchorEl: HTMLElement, columnKey: string) => void;
5
5
  }
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { useModuleDictionary, useEnvironment } from "@m4l/core";
4
4
  import { useDrag, useDrop } from "react-dnd";
5
- import { renderHeaderCell } from "react-data-grid";
5
+ import { HeaderRenderer } 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
8
  import { N as NameColumnIconStyled, n as NameColumnStyled, I as IconColumnStyled, o as DraggableHeaderRootStyled, B as ButtonHeaderActionsStyled, p as DraggableWrapperInputBaseStyled, q as IconSearchStyled, H as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
@@ -13,13 +13,12 @@ function DraggableHeaderRenderer(props) {
13
13
  const {
14
14
  onColumnsReorder,
15
15
  column,
16
- tabIndex: headerTabIndex,
16
+ isCellSelected,
17
17
  openPopover,
18
+ onSort,
18
19
  ...others
19
20
  } = props;
20
- const { ref, tabIndex } = useFocusRef(
21
- headerTabIndex !== void 0 && headerTabIndex >= 0
22
- );
21
+ const { ref, tabIndex } = useFocusRef(isCellSelected);
23
22
  const { getLabel } = useModuleDictionary();
24
23
  const { size, classes, externalSortSettings, externalFilterSettings } = useDataGrid();
25
24
  const { host_static_assets, environment_assets } = useEnvironment();
@@ -134,9 +133,6 @@ function DraggableHeaderRenderer(props) {
134
133
  opacity: isDragging ? 0.5 : 1,
135
134
  backgroundColor: isOver ? "#ececec" : void 0
136
135
  },
137
- onClick: (e) => {
138
- e.stopPropagation();
139
- },
140
136
  children: [
141
137
  /* @__PURE__ */ jsx(
142
138
  ButtonHeaderActionsStyled,
@@ -147,10 +143,12 @@ function DraggableHeaderRenderer(props) {
147
143
  openPopover?.(e.currentTarget, column.key);
148
144
  },
149
145
  children: /* @__PURE__ */ jsx(
150
- renderHeaderCell,
146
+ HeaderRenderer,
151
147
  {
152
148
  column: newColumn,
153
- tabIndex: headerTabIndex,
149
+ isCellSelected,
150
+ onSort: () => {
151
+ },
154
152
  ...others
155
153
  }
156
154
  )
@@ -128,7 +128,7 @@ function HeaderRenderClick(props) {
128
128
  paper: {
129
129
  ...paperProps,
130
130
  sx: {
131
- mt: !activeFilters ? 0.3 : 5.6,
131
+ mt: !activeFilters ? 0.3 : 6.5,
132
132
  ...paperProps?.sx
133
133
  }
134
134
  }
@@ -5,13 +5,13 @@ import { d as DATAGRID_SELECT_COLUMN_KEY } from "../../../constants.js";
5
5
  const filterColumnClassName = "filter-cell";
6
6
  const filterHeight = 35;
7
7
  function SelectGroupFormatter(props) {
8
- const { isRowSelected, onRowSelectionChange } = useRowSelection();
8
+ const [isRowSelected, onRowSelectionChange] = useRowSelection();
9
9
  const onChange = (checked) => {
10
10
  onRowSelectionChange({ row: props.row, checked, isShiftClick: false });
11
11
  };
12
12
  const cellFormater = SelectCellFormatter({
13
13
  value: isRowSelected,
14
- tabIndex: props.tabIndex,
14
+ isCellSelected: props.isCellSelected,
15
15
  onChange,
16
16
  "aria-label": "Select Group"
17
17
  });
@@ -32,7 +32,7 @@ function SelectFormatter(props) {
32
32
  SelectCellFormatter,
33
33
  {
34
34
  value: checkedRows?.has(rowKeyGetter(props.row)) || false,
35
- tabIndex: props.tabIndex,
35
+ isCellSelected: props.isCellSelected,
36
36
  onChange,
37
37
  "aria-label": "Select"
38
38
  }
@@ -53,7 +53,7 @@ const SelectColumnHeaderRenderer = (props) => {
53
53
  const allRowsChecked = rows.length === checkedRows?.size;
54
54
  return SelectCellFormatter({
55
55
  "aria-label": "Select All",
56
- tabIndex: props.tabIndex,
56
+ isCellSelected: props.isCellSelected,
57
57
  value: allRowsChecked,
58
58
  onChange: onAllRowsCheckedChange
59
59
  });
@@ -68,9 +68,9 @@ const SelectColumn = {
68
68
  sortable: false,
69
69
  frozen: true,
70
70
  type: "boolean",
71
- renderHeaderCell: SelectColumnHeaderRenderer,
72
- renderCell: SelectFormatter,
73
- renderGroupCell: SelectGroupFormatter
71
+ headerRenderer: SelectColumnHeaderRenderer,
72
+ formatter: SelectFormatter,
73
+ groupFormatter: SelectGroupFormatter
74
74
  };
75
75
  export {
76
76
  SelectColumn as S,
@@ -1,10 +1,10 @@
1
- import { RenderEditCellProps } from 'react-data-grid';
1
+ import { EditorProps } from 'react-data-grid';
2
2
  /**
3
3
  * TODO: Documentar
4
4
  */
5
- export declare function TextEditor<TRow, TSummaryRow>({ row, column, onRowChange, onClose, }: RenderEditCellProps<TRow, TSummaryRow>): import("react/jsx-runtime").JSX.Element;
5
+ export declare function TextEditor<TRow, TSummaryRow>({ row, column, onRowChange, onClose, }: EditorProps<TRow, TSummaryRow>): import("react/jsx-runtime").JSX.Element;
6
6
  /**
7
7
  * TODO: Documentar
8
8
  */
9
- export declare function NumberEditor<TRow, TSummaryRow>({ row, column, onRowChange, onClose, }: RenderEditCellProps<TRow, TSummaryRow>): import("react/jsx-runtime").JSX.Element;
9
+ export declare function NumberEditor<TRow, TSummaryRow>({ row, column, onRowChange, onClose, }: EditorProps<TRow, TSummaryRow>): import("react/jsx-runtime").JSX.Element;
10
10
  export default TextEditor;
@@ -1,6 +1,6 @@
1
1
  import { Maybe } from '@m4l/core';
2
2
  import { Theme } from '@mui/material/styles';
3
- import { Column, RowsChangeData, RenderCellProps, DataGridProps as NativeDataGridProps } from 'react-data-grid';
3
+ import { Column, RowsChangeData, FormatterProps } from 'react-data-grid';
4
4
  import { MenuAction } from '../MenuActions/types';
5
5
  import { ActionsSlots, ColumnIconFormatterSlots, ColumnsConfigSlots, ControlNavigateSlots, DataGridSlots, RowsCountSlots, TableSlots, TextEditorSlots } from './slots/DataGridEnum';
6
6
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
@@ -9,7 +9,7 @@ import { IGridConfig } from './contexts/DataGridContext/types';
9
9
  import { Sizes } from '@m4l/styles';
10
10
  import { PagerProps } from '../Pager';
11
11
  import { SettingsProps } from './subcomponents/HeaderActions/subcomponents/Settings/types';
12
- export type GridFormatterPropss<T, SR> = RenderCellProps<T, SR>;
12
+ export type GridFormatterPropss<T, SR> = FormatterProps<T, SR>;
13
13
  export type { ColumnUncertaintyFormatter, ColumnPointsFormatter, ColumnNestedValueFormatter, } from './formatters';
14
14
  export declare type ColumnType = 'string' | 'date' | 'number' | 'boolean' | 'custom';
15
15
  export declare type ColumnAlign = 'left' | 'center' | 'right';
@@ -31,10 +31,9 @@ declare module 'react-data-grid' {
31
31
  align?: ColumnAlign;
32
32
  isDraggable?: boolean;
33
33
  withFilter?: boolean;
34
- withinHeaderRenderer?: React.FunctionComponent<RenderHeaderCellProps<TRow, TSummaryRow>>;
34
+ withinHeaderRenderer?: React.FunctionComponent<HeaderRendererProps<TRow, TSummaryRow>>;
35
35
  customFilter?: (row: TRow, value: string) => boolean;
36
36
  customSort?: (a: TRow, b: TRow) => number;
37
- formatter?: (props: any) => JSX.Element;
38
37
  }
39
38
  }
40
39
  export declare type RowKey = string | number;
@@ -108,7 +107,7 @@ export interface FilterSettings {
108
107
  onChange: (event: FilterChangeEvent) => void;
109
108
  }
110
109
  /**--------------------Termina tipado de filtros-------------------------------------------- */
111
- export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Omit<NativeDataGridProps<TRow, TSummaryRow>, 'rowKeyGetter' | 'rows' | 'columns' | 'onRowsChange' | 'selectedRows' | 'onSelectedRowsChange' | 'renderers'> {
110
+ export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> {
112
111
  id: string;
113
112
  withActions?: boolean;
114
113
  columns: readonly Column<TRow, TSummaryRow>[];
@@ -13,12 +13,14 @@ function Image(props) {
13
13
  threshold = 100,
14
14
  dataTestId,
15
15
  className,
16
+ cover,
16
17
  ...others
17
18
  } = props;
18
19
  const isSkeleton = useModuleSkeleton();
19
20
  const ownerState = useMemo(() => ({
20
- isSkeleton
21
- }), [isSkeleton]);
21
+ isSkeleton,
22
+ cover
23
+ }), [cover, isSkeleton]);
22
24
  const lazyLoadComponent = useMemo(() => {
23
25
  return /* @__PURE__ */ jsx(
24
26
  LazyLoadComponent,
@@ -2,11 +2,14 @@ const imageStyles = {
2
2
  /**
3
3
  * Estilos para Image.
4
4
  */
5
- root: {
5
+ root: ({ ownerState }) => ({
6
6
  display: "flex",
7
7
  flexDirection: "column",
8
- alignItems: "flex-start"
9
- },
8
+ alignItems: "flex-start",
9
+ ...ownerState?.cover && {
10
+ objectFit: "cover"
11
+ }
12
+ }),
10
13
  /**
11
14
  * Estilos para el intersectComponente o para el 'span'
12
15
  */