@m4l/components 9.3.34-JT25112025.beta.2 → 9.3.34-JT25112025.beta.3

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 (67) hide show
  1. package/@types/export.d.ts +3 -0
  2. package/@types/types.d.ts +26 -5
  3. package/components/DataGrid/DataGrid.js +2 -0
  4. package/components/DataGrid/Datagrid.styles.js +45 -112
  5. package/components/DataGrid/contexts/DataGridContext/index.js +2 -0
  6. package/components/DataGrid/contexts/DataGridContext/types.d.ts +2 -2
  7. package/components/DataGrid/dictionary.d.ts +0 -1
  8. package/components/DataGrid/dictionary.js +1 -2
  9. package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +4 -0
  10. package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
  11. package/components/DataGrid/hooks/useModalCardDetail.js +1 -6
  12. package/components/DataGrid/icons.d.ts +0 -1
  13. package/components/DataGrid/icons.js +1 -2
  14. package/components/DataGrid/slots/DataGridEnum.d.ts +1 -4
  15. package/components/DataGrid/slots/DataGridEnum.js +0 -3
  16. package/components/DataGrid/slots/DataGridSlot.d.ts +0 -3
  17. package/components/DataGrid/slots/DataGridSlot.js +33 -48
  18. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
  19. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +5 -47
  20. package/components/DataGrid/subcomponents/Cards/index.js +3 -6
  21. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
  22. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +15 -59
  23. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +16 -8
  24. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
  25. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +1 -5
  26. package/components/DataGrid/subcomponents/Cards/types.d.ts +0 -16
  27. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +5 -2
  28. package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
  29. package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
  30. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
  31. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
  32. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
  33. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
  34. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +6 -2
  35. package/components/DataGrid/subcomponents/Table/index.js +1 -1
  36. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +0 -1
  37. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +14 -39
  38. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
  39. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  40. package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.d.ts +6 -0
  41. package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.js +12 -0
  42. package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.d.ts +64 -0
  43. package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.js +46 -0
  44. package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
  45. package/components/DataGrid/types.d.ts +7 -12
  46. package/components/mui_extended/RadioButton/RadioButton.d.ts +24 -0
  47. package/components/mui_extended/RadioButton/RadioButton.js +110 -0
  48. package/components/mui_extended/RadioButton/RadioButton.styles.d.ts +2 -0
  49. package/components/mui_extended/RadioButton/RadioButton.styles.js +126 -0
  50. package/components/mui_extended/RadioButton/constants.d.ts +1 -0
  51. package/components/mui_extended/RadioButton/constants.js +4 -0
  52. package/components/mui_extended/RadioButton/icons.d.ts +4 -0
  53. package/components/mui_extended/RadioButton/icons.js +7 -0
  54. package/components/mui_extended/RadioButton/index.d.ts +1 -0
  55. package/components/mui_extended/RadioButton/index.js +1 -0
  56. package/components/mui_extended/RadioButton/slots/RadioButtonEnum.d.ts +8 -0
  57. package/components/mui_extended/RadioButton/slots/RadioButtonEnum.js +12 -0
  58. package/components/mui_extended/RadioButton/slots/RadioButtonSlots.d.ts +20 -0
  59. package/components/mui_extended/RadioButton/slots/RadioButtonSlots.js +39 -0
  60. package/components/mui_extended/RadioButton/types.d.ts +50 -0
  61. package/components/mui_extended/index.d.ts +1 -0
  62. package/index.js +42 -40
  63. package/package.json +1 -1
  64. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +0 -1
  65. /package/components/DataGrid/{formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts → tests/table/subcomponents/RadioButtonFormatter.test.d.ts} +0 -0
  66. /package/components/DataGrid/{formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts → tests/table/subcomponents/RadioSelectColumn.test.d.ts} +0 -0
  67. /package/components/{DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts → mui_extended/RadioButton/tests/RadioButton.test.d.ts} +0 -0
@@ -1,22 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
4
- import { b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled, d as EditablePlaceholderStyled, I as IconButtonEditStyled } from "../../../slots/DataGridSlot.js";
5
- import { D as DICTIONARY } from "../../../dictionary.js";
6
- import { useModuleDictionary, useEnvironment } from "@m4l/core";
7
- import { p as pathIcons } from "../../../icons.js";
8
- import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
4
+ import { b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled } from "../../../slots/DataGridSlot.js";
9
5
  function useCardContent({
10
6
  row,
11
- rows,
12
- rowIndex,
13
7
  columns,
14
8
  onRowsChange
15
9
  }) {
16
10
  const { getConfigColumns, size } = useDataGrid();
17
- const { getLabel } = useModuleDictionary();
18
- const { host_static_assets, environment_assets } = useEnvironment();
19
- const { currentSize } = useComponentSize(size);
20
11
  const [editingColumnKey, setEditingColumnKey] = useState(null);
21
12
  const columnsConfig = getConfigColumns("cards");
22
13
  const cardContent = columns.map((column, index) => {
@@ -43,11 +34,8 @@ function useCardContent({
43
34
  */
44
35
  onRowChange: (updatedRow) => {
45
36
  if (onRowsChange) {
46
- const updatedRows = rows.map(
47
- (r, i) => i === rowIndex ? updatedRow : r
48
- );
49
- onRowsChange(updatedRows, {
50
- indexes: [rowIndex],
37
+ onRowsChange([updatedRow], {
38
+ indexes: [index],
51
39
  column
52
40
  });
53
41
  }
@@ -67,11 +55,8 @@ function useCardContent({
67
55
  */
68
56
  onRowChange: (updatedRow) => {
69
57
  if (onRowsChange) {
70
- const updatedRows = rows.map(
71
- (r, i) => i === rowIndex ? updatedRow : r
72
- );
73
- onRowsChange(updatedRows, {
74
- indexes: [rowIndex],
58
+ onRowsChange([updatedRow], {
59
+ indexes: [index],
75
60
  column
76
61
  });
77
62
  }
@@ -79,33 +64,6 @@ function useCardContent({
79
64
  });
80
65
  return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: cellContent });
81
66
  }
82
- const rawValue = row[column.key];
83
- const isEmpty = rawValue === null || rawValue === void 0 || rawValue === "";
84
- const isEditable = !!column.renderEditCell;
85
- if (isEditable) {
86
- return /* @__PURE__ */ jsxs(EditablePlaceholderStyled, { children: [
87
- /* @__PURE__ */ jsx(
88
- ValueColumnStyled,
89
- {
90
- variant: "body",
91
- color: isEmpty ? "text.secondary" : "text.primary",
92
- children: isEmpty ? getLabel(DICTIONARY.EDIT_PLACEHOLDER) : rawValue
93
- }
94
- ),
95
- /* @__PURE__ */ jsx(
96
- IconButtonEditStyled,
97
- {
98
- src: `${host_static_assets}/${environment_assets}/${pathIcons.edit}`,
99
- onClick: () => {
100
- setEditingColumnKey(column.key);
101
- },
102
- size: currentSize,
103
- role: "button",
104
- "aria-label": "Editar texto"
105
- }
106
- )
107
- ] });
108
- }
109
67
  return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: row[column.key] ?? "-" });
110
68
  })()
111
69
  ]
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useRef, useMemo, useEffect } from "react";
3
- import { e as CardsContainerStyled } from "../../slots/DataGridSlot.js";
3
+ import { d as CardsContainerStyled } from "../../slots/DataGridSlot.js";
4
4
  import { C as CardRow } from "./subcomponents/CardRow/index.js";
5
5
  import { u as useProcessedColumns } from "../../hooks/useProcessedColumns.js";
6
6
  import { c as calculateCardHeight } from "./helpers/calculateCardHeight.js";
@@ -28,8 +28,7 @@ function Cards(props) {
28
28
  const handleOpenDetail = useModalDetail({
29
29
  columns: allProcessedColumns,
30
30
  viewMode: "cards",
31
- onRowsChange,
32
- rows
31
+ onRowsChange
33
32
  });
34
33
  const cardHeight = useMemo(() => {
35
34
  return calculateCardHeight({
@@ -65,7 +64,7 @@ function Cards(props) {
65
64
  if (processedColumns.length === 0) {
66
65
  return null;
67
66
  }
68
- return /* @__PURE__ */ jsx(CardsContainerStyled, { "data-testid": "cards-container", ref: containerRef, children: /* @__PURE__ */ jsx(ContainerFlow, { variant: "grid-layout", minWidth: 280, children: rows.map((row, rowIndex) => {
67
+ return /* @__PURE__ */ jsx(CardsContainerStyled, { "data-testid": "cards-container", ref: containerRef, children: /* @__PURE__ */ jsx(ContainerFlow, { variant: "grid-layout", minWidth: 280, children: rows.map((row) => {
69
68
  const rowKey = rowKeyGetter(row);
70
69
  const isChecked = checkedRows?.has(rowKey) || false;
71
70
  const showCheckbox = checkedRows !== void 0 && onCheckedRowsChange !== void 0;
@@ -73,8 +72,6 @@ function Cards(props) {
73
72
  CardRow,
74
73
  {
75
74
  row,
76
- rows,
77
- rowIndex,
78
75
  columns: processedColumns,
79
76
  originalColumns: allProcessedColumns,
80
77
  rowKeyGetter,
@@ -5,4 +5,4 @@ import { CardDetailsProps } from '../../types';
5
5
  *
6
6
  * A diferencia del componente Cards, este muestra TODAS las columnas
7
7
  */
8
- export declare function CardDetails<TRow>({ row, columns, viewColumnsConfig, onRowsChange, size, rows, rowIndex, }: CardDetailsProps<TRow>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function CardDetails<TRow>({ row, columns, viewColumnsConfig, onRowsChange, size, }: CardDetailsProps<TRow>): import("react/jsx-runtime").JSX.Element;
@@ -1,25 +1,15 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useCallback } from "react";
3
- import { f as CardDetailContainerStyled, b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled, d as EditablePlaceholderStyled, I as IconButtonEditStyled } from "../../../../slots/DataGridSlot.js";
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: handleForceRefresh
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 hasInteractiveFormatter = !!modifiedColumn.onAfterChange;
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: currentRow,
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
- const updatedRows = rows.map(
68
- (r, i) => i === rowIndex ? updatedRow : r
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: modifiedColumn,
83
- row: currentRow,
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
- const updatedRows = rows.map(
93
- (r, i) => i === rowIndex ? updatedRow : r
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
- const rawValue = currentRow[modifiedColumn.key];
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 { g as CardHeaderStyled, h as CardHeaderLeftStyled, i as CardHeaderRightStyled } from "../../../../slots/DataGridSlot.js";
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";
@@ -15,7 +15,7 @@ function CardHeader({
15
15
  checkedRows,
16
16
  onCheckedRowsChange
17
17
  }) {
18
- const { rowKeyGetter, rowActionsGetter, size } = useDataGrid();
18
+ const { rowKeyGetter, rowActionsGetter, size, checkedRowsMultiple } = useDataGrid();
19
19
  const { host_static_assets, environment_assets } = useEnvironment();
20
20
  const rowKey = useMemo(() => rowKeyGetter(row), [rowKeyGetter, row]);
21
21
  const onChange = useCallback(
@@ -23,15 +23,23 @@ function CardHeader({
23
23
  if (!onCheckedRowsChange || !checkedRows) {
24
24
  return;
25
25
  }
26
- const newCheckedRows = new Set(checkedRows);
27
- if (checked) {
28
- newCheckedRows.add(rowKey);
26
+ if (checkedRowsMultiple === false) {
27
+ if (checked) {
28
+ onCheckedRowsChange(/* @__PURE__ */ new Set([rowKey]));
29
+ } else {
30
+ onCheckedRowsChange(/* @__PURE__ */ new Set());
31
+ }
29
32
  } else {
30
- newCheckedRows.delete(rowKey);
33
+ const newCheckedRows = new Set(checkedRows);
34
+ if (checked) {
35
+ newCheckedRows.add(rowKey);
36
+ } else {
37
+ newCheckedRows.delete(rowKey);
38
+ }
39
+ onCheckedRowsChange(newCheckedRows);
31
40
  }
32
- onCheckedRowsChange(newCheckedRows);
33
41
  },
34
- [checkedRows, onCheckedRowsChange, rowKey]
42
+ [checkedRows, onCheckedRowsChange, rowKey, checkedRowsMultiple]
35
43
  );
36
44
  const anchorOrigin = useMemo(
37
45
  () => ({
@@ -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, rows, rowIndex, columns, originalColumns, rowKeyGetter, selectedRows, onSelectedRowsChange, onRowsChange, customRender, minHeight, isChecked, checkedRows, showCheckbox, onCheckedRowsChange, onOpenDetail, }: CardRowProps<TRow, TKey>): import("react/jsx-runtime").JSX.Element;
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
- * Componente que muestra CardRow
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 { j as CardContentWrapperStyled, k as CardContentStyled, l as CardStyled } from "../../../../slots/DataGridSlot.js";
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
@@ -2,8 +2,9 @@ import { jsx } from "react/jsx-runtime";
2
2
  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
+ import { R as RadioButtonFormatter } from "../Table/subcomponents/RadioButtonFormatter.js";
5
6
  import { a as DataGridContext } from "../../contexts/DataGridContext/index.js";
6
- import { m as CheckboxCellWrapperStyled } from "../../slots/DataGridSlot.js";
7
+ import { l as CheckboxCellWrapperStyled } from "../../slots/DataGridSlot.js";
7
8
  const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref) {
8
9
  const {
9
10
  value,
@@ -14,12 +15,14 @@ const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref)
14
15
  } = props;
15
16
  const context = useContext(DataGridContext);
16
17
  const viewMode = context?.viewMode ?? "cards";
18
+ const checkedRowsMultiple = context?.checkedRowsMultiple;
17
19
  if (viewMode !== "table") {
18
20
  const handleClick = (e) => {
19
21
  e.stopPropagation();
20
22
  };
23
+ const FormatterComponent = checkedRowsMultiple === false ? RadioButtonFormatter : CheckboxFormatter;
21
24
  return /* @__PURE__ */ jsx(CheckboxCellWrapperStyled, { onClick: handleClick, children: /* @__PURE__ */ jsx(
22
- CheckboxFormatter,
25
+ FormatterComponent,
23
26
  {
24
27
  ref,
25
28
  checked: value,
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useIsMobile } from "@m4l/graphics";
3
- import { n as ControlNavigateStyled } from "../../slots/DataGridSlot.js";
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, o as ActionsConfigContainerStyled, p as ContainerLeftActionsStyled, q as ContainerRightActionsStyled } from "../../slots/DataGridSlot.js";
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" && viewMode !== "cards" && /* @__PURE__ */ jsx(Density, {}),
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, r as RowsCountLabelStyled, s as RowsCountValueStyled } from "../../../../slots/DataGridSlot.js";
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 { t as ColumnsConfigWrapperStyled, u as ColumnsConfigDataGridStyled, v as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, w as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
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 { t as ColumnsConfigWrapperStyled, u as ColumnsConfigDataGridStyled, v as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, w as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
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 { x as ContainerToggleCardsStyled, y as CardToggleButtonStyled, z as TextToggleCardButtonStyled } from "../../../../slots/DataGridSlot.js";
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();
@@ -2,6 +2,7 @@ import { useState, useEffect, useMemo } from "react";
2
2
  import { g as getDragHeaderRenderer } from "./getDragHeaderRenderer.js";
3
3
  import { A as ActionsColumn } from "../subcomponents/ActionsColumn.js";
4
4
  import { f as filterColumnClassName, S as SelectColumn } from "../subcomponents/SelectColumn.js";
5
+ import { R as RadioSelectColumn } from "../subcomponents/RadioSelectColumn.js";
5
6
  import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
6
7
  import { u as useFilters } from "../../../hooks/useFilters.js";
7
8
  import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
@@ -38,7 +39,7 @@ function getComparator(columns, sortColumn) {
38
39
  }
39
40
  }
40
41
  const getColumIndex = (key, columnsConfig) => columnsConfig.findIndex((columnConfig) => columnConfig.key === key);
41
- const getInOrderColumns = (columns, hasCheckedRows, columnsConfig, columnsWidths, rowActionsGetter) => {
42
+ const getInOrderColumns = (columns, hasCheckedRows, checkedRowsMultiple, columnsConfig, columnsWidths, rowActionsGetter) => {
42
43
  let filteredSortedColumns = columns.filter((column) => {
43
44
  const columnConfigIndex = getColumIndex(column.key, columnsConfig);
44
45
  const visible = columnConfigIndex > -1 ? columnsConfig[columnConfigIndex].visible : true;
@@ -64,7 +65,8 @@ const getInOrderColumns = (columns, hasCheckedRows, columnsConfig, columnsWidths
64
65
  filteredSortedColumns = [ActionsColumn, ...filteredSortedColumns];
65
66
  }
66
67
  if (hasCheckedRows) {
67
- filteredSortedColumns = [SelectColumn, ...filteredSortedColumns];
68
+ const selectionColumn = checkedRowsMultiple === false ? RadioSelectColumn : SelectColumn;
69
+ filteredSortedColumns = [selectionColumn, ...filteredSortedColumns];
68
70
  }
69
71
  return filteredSortedColumns;
70
72
  };
@@ -89,6 +91,7 @@ const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
89
91
  rowActionsGetter,
90
92
  checkedRows,
91
93
  onCheckedRowsChange,
94
+ checkedRowsMultiple,
92
95
  sortColumns,
93
96
  setSortColumns
94
97
  } = useDataGrid();
@@ -109,6 +112,7 @@ const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
109
112
  sourceColumns,
110
113
  !!checkedRows && !!onCheckedRowsChange,
111
114
  //Si están seteados se habilita el múltipe
115
+ checkedRowsMultiple,
112
116
  columnsConfig,
113
117
  columnsWidths,
114
118
  rowActionsGetter
@@ -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 { B as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
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 { useEnvironment } from "@m4l/core";
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
- const { host_static_assets, environment_assets } = useEnvironment();
7
- const uncheckedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/unchecked.svg`;
8
- return /* @__PURE__ */ jsx(
9
- Icon,
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
- const { host_static_assets, environment_assets } = useEnvironment();
21
- const checkedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/checked.svg`;
22
- return /* @__PURE__ */ jsx(
23
- Icon,
24
- {
25
- src: checkedIconUrl,
26
- size: "small",
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
- const { host_static_assets, environment_assets } = useEnvironment();
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, F as NameColumnStyled, G as IconColumnStyled, H as DraggableHeaderRootStyled, J as ButtonHeaderActionsStyled, K as DraggableWrapperInputBaseStyled, M as IconSearchStyled, O as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
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";
@@ -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 { P as MenuListStyled, Q as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
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";