@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.
Files changed (104) hide show
  1. package/components/AppBar/styles.js +1 -1
  2. package/components/Card/Card.styles.js +1 -1
  3. package/components/DataGrid/Datagrid.styles.js +39 -111
  4. package/components/DataGrid/dictionary.d.ts +0 -1
  5. package/components/DataGrid/dictionary.js +1 -2
  6. package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +4 -0
  7. package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
  8. package/components/DataGrid/hooks/useModalCardDetail.js +2 -10
  9. package/components/DataGrid/icons.d.ts +0 -1
  10. package/components/DataGrid/icons.js +1 -2
  11. package/components/DataGrid/slots/DataGridEnum.d.ts +1 -4
  12. package/components/DataGrid/slots/DataGridEnum.js +0 -3
  13. package/components/DataGrid/slots/DataGridSlot.d.ts +0 -3
  14. package/components/DataGrid/slots/DataGridSlot.js +33 -48
  15. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
  16. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +5 -47
  17. package/components/DataGrid/subcomponents/Cards/index.js +3 -6
  18. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
  19. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +15 -59
  20. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +1 -1
  21. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
  22. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +1 -5
  23. package/components/DataGrid/subcomponents/Cards/types.d.ts +0 -16
  24. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +1 -1
  25. package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
  26. package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
  27. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
  28. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
  29. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
  30. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
  31. package/components/DataGrid/subcomponents/Table/index.js +1 -1
  32. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +0 -1
  33. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +14 -39
  34. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
  35. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  36. package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
  37. package/components/DataGrid/types.d.ts +0 -12
  38. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.d.ts +3 -2
  39. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.js +3 -2
  40. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.d.ts +3 -2
  41. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +3 -2
  42. package/components/DynamicFilter/subcomponents/FieldTypes/FieldTypeInterface.d.ts +3 -4
  43. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.d.ts +3 -2
  44. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.js +3 -2
  45. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.d.ts +3 -2
  46. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.js +3 -2
  47. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.d.ts +3 -2
  48. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.js +3 -2
  49. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.d.ts +3 -2
  50. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.js +3 -2
  51. package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +1 -1
  52. package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +1 -7
  53. package/components/DynamicSort/subcomponents/FieldTypes/FieldTypeInterface.d.ts +2 -3
  54. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.d.ts +3 -2
  55. package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.js +3 -2
  56. package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +1 -1
  57. package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +1 -7
  58. package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
  59. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/AreaChip.js +4 -3
  60. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +4 -3
  61. package/components/hook-form/RHFormProvider/RHFormProvider.d.ts +14 -0
  62. package/components/hook-form/RHFormProvider/RHFormProvider.js +98 -0
  63. package/components/hook-form/RHFormProvider/index.d.ts +4 -0
  64. package/components/hook-form/RHFormProvider/index.js +1 -0
  65. package/components/hook-form/RHFormProvider/schema.d.ts +17 -0
  66. package/components/hook-form/RHFormProvider/schema.js +29 -0
  67. package/components/hook-form/RHFormProvider/types.d.ts +133 -0
  68. package/components/hook-form/RHFormProvider/types.js +8 -0
  69. package/components/hook-form/index.d.ts +1 -0
  70. package/contexts/index.d.ts +3 -3
  71. package/helpers/getStepsAndValidationSchema/getStepsAndValidationSchema.d.ts +3 -3
  72. package/helpers/getStepsAndValidationSchema/getStepsAndValidationSchema.js +3 -3
  73. package/helpers/getStepsAndValidationSchema/types.d.ts +5 -4
  74. package/hooks/index.d.ts +2 -1
  75. package/hooks/useFormAddEdit/{index.d.ts → useFormAddEdit.d.ts} +3 -2
  76. package/hooks/useWatchTyped/index.d.ts +1 -0
  77. package/hooks/useWatchTyped/index.js +1 -0
  78. package/hooks/useWatchTyped/types.d.ts +11 -0
  79. package/hooks/useWatchTyped/useTypedWatch.d.ts +9 -0
  80. package/hooks/useWatchTyped/useTypedWatch.js +30 -0
  81. package/index.js +47 -36
  82. package/package.json +1 -1
  83. package/components/DataGrid/formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts +0 -1
  84. package/components/DataGrid/formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts +0 -1
  85. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts +0 -1
  86. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +0 -1
  87. package/components/hook-form/RHFormContext/index.d.ts +0 -120
  88. package/components/hook-form/RHFormContext/index.js +0 -91
  89. package/components/hook-form/RHFormContext/types.d.ts +0 -83
  90. package/hooks/useFormReadyForUpdate/types.d.ts +0 -8
  91. /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/constants.d.ts +0 -0
  92. /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/constants.js +0 -0
  93. /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/index.d.ts +0 -0
  94. /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/index.js +0 -0
  95. /package/components/hook-form/{RHFormContext → RHFormProvider}/classes/types.d.ts +0 -0
  96. /package/components/hook-form/{RHFormContext → RHFormProvider}/dictionary.d.ts +0 -0
  97. /package/components/hook-form/{RHFormContext → RHFormProvider}/dictionary.js +0 -0
  98. /package/components/hook-form/{RHFormContext → RHFormProvider}/styles.d.ts +0 -0
  99. /package/components/hook-form/{RHFormContext → RHFormProvider}/styles.js +0 -0
  100. /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/index.d.ts +0 -0
  101. /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/skeleton.d.ts +0 -0
  102. /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/styles.d.ts +0 -0
  103. /package/components/hook-form/{RHFormContext → RHFormProvider}/subcomponents/FormActions/types.d.ts +0 -0
  104. /package/hooks/useFormAddEdit/{index.js → useFormAddEdit.js} +0 -0
@@ -8,7 +8,7 @@ const appBarStyles = {
8
8
  display: "flex",
9
9
  flexDirection: "row",
10
10
  flexWrap: "nowrap",
11
- alignItems: theme.generalSettings.isMobile ? "center" : "initial",
11
+ alignItems: "center",
12
12
  height: theme.vars.size.baseSpacings.sp12,
13
13
  minHeight: theme.vars.size.baseSpacings.sp12,
14
14
  padding: `0 ${theme.generalSettings.isMobile ? theme.vars.size.baseSpacings.sp2 : theme.vars.size.baseSpacings.sp4}`,
@@ -17,7 +17,7 @@ const cardStyles = {
17
17
  width: "100%",
18
18
  outline: "unset!important",
19
19
  borderRadius: theme.vars.size.borderRadius.r2,
20
- backgroundColor: theme.palette.background.paper,
20
+ backgroundColor: theme.vars.palette.background.default,
21
21
  height: ownerState?.height ?? "auto",
22
22
  minHeight: ownerState?.height ?? "auto",
23
23
  maxHeight: ownerState?.height ?? "auto",
@@ -24,42 +24,6 @@ const dataGridStyles = {
24
24
  flex: 1,
25
25
  overflow: "hidden",
26
26
  "& .rdg .MuiCheckbox-root": {
27
- overflow: "visible",
28
- padding: 0,
29
- ...theme.generalSettings.isMobile ? {
30
- width: theme.vars.size.mobile.small.action,
31
- height: theme.vars.size.mobile.small.action
32
- } : {
33
- width: theme.vars.size.desktop.small.action,
34
- height: theme.vars.size.desktop.small.action
35
- },
36
- display: "inline-flex",
37
- justifyContent: "center",
38
- alignItems: "center",
39
- borderRadius: theme.size.borderRadius.r1,
40
- "&:hover": {
41
- backgroundColor: theme.vars.palette.default.hoverOpacity
42
- },
43
- "&:active": {
44
- backgroundColor: theme.vars.palette.default.activeOpacity
45
- },
46
- "&.Mui-checked": {
47
- "&:hover": {
48
- backgroundColor: theme.vars.palette.primary.hoverOpacity,
49
- "& .M4LIcon-icon": {
50
- backgroundColor: theme.vars.palette.primary.hover
51
- }
52
- },
53
- "&:active": {
54
- backgroundColor: theme.vars.palette.primary.activeOpacity,
55
- "& .M4LIcon-icon": {
56
- backgroundColor: theme.vars.palette.primary.active
57
- }
58
- }
59
- },
60
- "&.Mui-focusVisible, &:focus-visible": {
61
- outline: `1px solid ${theme.vars.palette.primary.focusVisible}`
62
- },
63
27
  "& > svg": {
64
28
  color: theme.vars.palette.text.secondary
65
29
  }
@@ -416,19 +380,33 @@ const dataGridStyles = {
416
380
  outline: `2px solid var(--rdg-selection-color)`,
417
381
  outlineOffset: "-2px"
418
382
  },
419
- "&:has(> .MuiCheckbox-root)": {
420
- overflow: "visible",
421
- paddingInline: 0
422
- },
423
383
  "& .checkbox-checked": {
424
- "& .M4LIcon-icon": {
425
- backgroundColor: theme.vars.palette.primary.enabled
426
- }
384
+ "& path:first-of-type": {
385
+ fill: theme.vars.palette.primary.main
386
+ },
387
+ ...getSizeStyles(
388
+ theme,
389
+ ownerState?.size || "medium",
390
+ "base",
391
+ (size) => ({
392
+ minHeight: size,
393
+ height: size
394
+ })
395
+ )
427
396
  },
428
397
  "& .checkbox-unChecked": {
429
- "& .M4LIcon-icon": {
430
- backgroundColor: theme.vars.palette.text.primary
431
- }
398
+ "& path": {
399
+ fill: theme.vars.palette.text.primary
400
+ },
401
+ ...getSizeStyles(
402
+ theme,
403
+ ownerState?.size || "medium",
404
+ "base",
405
+ (size) => ({
406
+ minHeight: size,
407
+ height: size
408
+ })
409
+ )
432
410
  },
433
411
  "& .rdg-text-editor": {
434
412
  textAlign: "inherit",
@@ -694,54 +672,26 @@ const dataGridStyles = {
694
672
  * Estilos para el wrapper del CheckboxCellAdapter
695
673
  * Aplica los mismos estilos que los checkboxes dentro de celdas rdg
696
674
  */
697
- checkboxCellWrapper: ({ theme }) => ({
675
+ checkboxCellWrapper: ({ theme, ownerState }) => ({
698
676
  "& .checkbox-checked": {
699
- "& .M4LIcon-icon": {
700
- backgroundColor: theme.vars.palette.primary.enabled
701
- }
677
+ "& path:first-of-type": {
678
+ fill: theme.vars.palette.primary.main
679
+ },
680
+ ...getSizeStyles(theme, ownerState?.size || "medium", "base", (size) => ({
681
+ minHeight: size,
682
+ height: size
683
+ }))
702
684
  },
703
685
  "& .checkbox-unChecked": {
704
- "& .M4LIcon-icon": {
705
- backgroundColor: theme.vars.palette.text.primary
706
- }
686
+ "& path": {
687
+ fill: theme.vars.palette.text.primary
688
+ },
689
+ ...getSizeStyles(theme, ownerState?.size || "medium", "base", (size) => ({
690
+ minHeight: size,
691
+ height: size
692
+ }))
707
693
  },
708
694
  "& .MuiCheckbox-root": {
709
- overflow: "visible",
710
- padding: 0,
711
- ...theme.generalSettings.isMobile ? {
712
- width: theme.vars.size.mobile.small.action,
713
- height: theme.vars.size.mobile.small.action
714
- } : {
715
- width: theme.vars.size.desktop.small.action,
716
- height: theme.vars.size.desktop.small.action
717
- },
718
- display: "inline-flex",
719
- justifyContent: "center",
720
- alignItems: "center",
721
- borderRadius: theme.size.borderRadius.r1,
722
- "&:hover": {
723
- backgroundColor: theme.vars.palette.default.hoverOpacity
724
- },
725
- "&:active": {
726
- backgroundColor: theme.vars.palette.default.activeOpacity
727
- },
728
- "&.Mui-checked": {
729
- "&:hover": {
730
- backgroundColor: theme.vars.palette.primary.hoverOpacity,
731
- "& .M4LIcon-icon": {
732
- backgroundColor: theme.vars.palette.primary.hover
733
- }
734
- },
735
- "&:active": {
736
- backgroundColor: theme.vars.palette.primary.activeOpacity,
737
- "& .M4LIcon-icon": {
738
- backgroundColor: theme.vars.palette.primary.active
739
- }
740
- }
741
- },
742
- "&.Mui-focusVisible, &:focus-visible": {
743
- outline: `1px solid ${theme.vars.palette.primary.focusVisible}`
744
- },
745
695
  "& > svg": {
746
696
  color: theme.vars.palette.text.secondary
747
697
  }
@@ -942,28 +892,6 @@ const dataGridStyles = {
942
892
  }
943
893
  }
944
894
  }),
945
- /**
946
- * Placeholder editable
947
- */
948
- editablePlaceholder: ({ theme }) => ({
949
- display: "flex",
950
- alignItems: "center",
951
- gap: theme.spacing(1)
952
- }),
953
- /**
954
- * EditLabel
955
- */
956
- editLabel: ({ theme, ownerState }) => ({
957
- width: "auto",
958
- opacity: 1,
959
- transition: "opacity 0.3s ease",
960
- ...getTypographyStyles(
961
- theme.generalSettings.isMobile,
962
- ownerState?.size || "medium",
963
- "body"
964
- )
965
- }),
966
- iconButtonEdit: () => ({}),
967
895
  /**
968
896
  * Header de la card personalizada (avatar + nombre + email)
969
897
  */
@@ -38,5 +38,4 @@ export declare const DICTIONARY: {
38
38
  VIEW_MODE_CARDS: string;
39
39
  TOOLTIP_VIEW_MODE: string;
40
40
  DETAILS: string;
41
- EDIT_PLACEHOLDER: string;
42
41
  };
@@ -37,8 +37,7 @@ const DICTIONARY = {
37
37
  VIEW_MODE_TABLE: `${DATAGRID_ID_DICTIONARY}.view_mode_table`,
38
38
  VIEW_MODE_CARDS: `${DATAGRID_ID_DICTIONARY}.view_mode_cards`,
39
39
  TOOLTIP_VIEW_MODE: `${DATAGRID_ID_DICTIONARY}.tooltip_view_mode`,
40
- DETAILS: `${DATAGRID_ID_DICTIONARY}.details`,
41
- EDIT_PLACEHOLDER: `${DATAGRID_ID_DICTIONARY}.edit_placeholder`
40
+ DETAILS: `${DATAGRID_ID_DICTIONARY}.details`
42
41
  };
43
42
  export {
44
43
  DICTIONARY as D,
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Clave única para identificar el componente IconAction en el sistema
3
+ */
4
+ export declare const COLUMN_ICON_KEY_COMPONENT = "M4LColumnIconFormatter";
@@ -3,4 +3,4 @@ import { UseModalDetailProps } from '../types';
3
3
  * Hook que renderiza el modal de detalle para cualquier vista
4
4
  * mostrando TODAS las columnas sin excepción
5
5
  */
6
- export declare const useModalDetail: <TRow>({ columns, viewMode, onRowsChange, rows, }: UseModalDetailProps<TRow>) => (row: TRow) => void;
6
+ export declare const useModalDetail: <TRow>({ columns, viewMode, onRowsChange, }: UseModalDetailProps<TRow>) => (row: TRow) => void;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useModuleDictionary, useEnvironment } from "@m4l/core";
3
3
  import { useIsMobile } from "@m4l/graphics";
4
- import { useRef, useEffect, useCallback } from "react";
4
+ import { useCallback } from "react";
5
5
  import { u as useModal } from "../../../hooks/useModal/index.js";
6
6
  import { a as ContentModalSettingStyled, D as DataGridRootStyled } from "../slots/DataGridSlot.js";
7
7
  import { p as pathIcons } from "../icons.js";
@@ -14,22 +14,16 @@ import { A as ActionCancel } from "../../CommonActions/components/ActionCancel/A
14
14
  const useModalDetail = ({
15
15
  columns,
16
16
  viewMode,
17
- onRowsChange,
18
- rows
17
+ onRowsChange
19
18
  }) => {
20
19
  const { getConfigColumns, size } = useDataGrid();
21
20
  const { openModal, closeModal } = useModal();
22
21
  const { getLabel } = useModuleDictionary();
23
22
  const { host_static_assets, environment_assets } = useEnvironment();
24
23
  const isMobile = useIsMobile();
25
- const rowsRef = useRef(rows);
26
- useEffect(() => {
27
- rowsRef.current = rows;
28
- }, [rows]);
29
24
  const handleOpenDetail = useCallback(
30
25
  (row) => {
31
26
  const viewColumnsConfig = getConfigColumns(viewMode);
32
- const rowIndex = rowsRef.current.findIndex((r) => r === row);
33
27
  openModal({
34
28
  initialWidth: 500,
35
29
  initialHeight: 680,
@@ -48,8 +42,6 @@ const useModalDetail = ({
48
42
  CardDetails,
49
43
  {
50
44
  row,
51
- rows: rowsRef.current,
52
- rowIndex,
53
45
  columns,
54
46
  viewColumnsConfig,
55
47
  onRowsChange,
@@ -27,5 +27,4 @@ export declare const pathIcons: {
27
27
  mail: string;
28
28
  smartphone: string;
29
29
  internet: string;
30
- edit: string;
31
30
  };
@@ -23,8 +23,7 @@ const pathIcons = {
23
23
  viewTable: "frontend/components/data_grid/assets/icons/table.svg",
24
24
  viewCards: "frontend/components/data_grid/assets/icons/card.svg",
25
25
  info: "frontend/components/data_grid/assets/icons/info.svg",
26
- expanded: "frontend/components/data_grid/assets/icons/expanded.svg",
27
- edit: "frontend/components/EditLabel/assets/icons/pencil.svg"
26
+ expanded: "frontend/components/data_grid/assets/icons/expanded.svg"
28
27
  };
29
28
  export {
30
29
  pathIcons as p
@@ -50,10 +50,7 @@ export declare enum TableSlots {
50
50
  customCardFieldContent = "customCardFieldContent",
51
51
  customCardIconContainer = "customCardIconContainer",
52
52
  checkboxCellWrapper = "checkboxCellWrapper",
53
- editorCellWrapper = "editorCellWrapper",
54
- editablePlaceholder = "editablePlaceholder",
55
- editLabel = "editLabel",
56
- iconButtonEdit = "iconButtonEdit"
53
+ editorCellWrapper = "editorCellWrapper"
57
54
  }
58
55
  export declare enum TextEditorSlots {
59
56
  inputTexEditor = "inputTexEditor"
@@ -54,9 +54,6 @@ var TableSlots = /* @__PURE__ */ ((TableSlots2) => {
54
54
  TableSlots2["customCardIconContainer"] = "customCardIconContainer";
55
55
  TableSlots2["checkboxCellWrapper"] = "checkboxCellWrapper";
56
56
  TableSlots2["editorCellWrapper"] = "editorCellWrapper";
57
- TableSlots2["editablePlaceholder"] = "editablePlaceholder";
58
- TableSlots2["editLabel"] = "editLabel";
59
- TableSlots2["iconButtonEdit"] = "iconButtonEdit";
60
57
  return TableSlots2;
61
58
  })(TableSlots || {});
62
59
  var TextEditorSlots = /* @__PURE__ */ ((TextEditorSlots2) => {
@@ -76,9 +76,6 @@ export declare const ButtonHeaderActionsStyled: import('@emotion/styled').Styled
76
76
  export declare const NameColumnIconStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
77
77
  export declare const IconColumnStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
78
78
  export declare const NameColumnStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
79
- export declare const EditablePlaceholderStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
80
- export declare const EditLabelStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
81
- export declare const IconButtonEditStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
82
79
  /**
83
80
  * ****************
84
81
  * Slots TextEditor
@@ -6,7 +6,6 @@ import { d as dataGridStyles } from "../Datagrid.styles.js";
6
6
  import { I as Icon } from "../../Icon/Icon.js";
7
7
  import { C as Card } from "../../Card/Card.js";
8
8
  import { T as Typography } from "../../mui_extended/Typography/Typography.js";
9
- import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
10
9
  const DataGridRootStyled = styled("div", {
11
10
  name: DATAGRID_PREFIX_NAME,
12
11
  slot: DataGridSlots.datagridRoot
@@ -207,18 +206,6 @@ const NameColumnStyled = styled("div", {
207
206
  name: DATAGRID_PREFIX_NAME,
208
207
  slot: TableSlots.nameColumn
209
208
  })(dataGridStyles.nameColumn);
210
- const EditablePlaceholderStyled = styled("div", {
211
- name: DATAGRID_PREFIX_NAME,
212
- slot: TableSlots.editablePlaceholder
213
- })(dataGridStyles.editablePlaceholder);
214
- styled(Typography, {
215
- name: DATAGRID_PREFIX_NAME,
216
- slot: TableSlots.editLabel
217
- })(dataGridStyles.editLabel);
218
- const IconButtonEditStyled = styled(IconButton, {
219
- name: DATAGRID_PREFIX_NAME,
220
- slot: TableSlots.iconButtonEdit
221
- })(dataGridStyles.iconButtonEdit);
222
209
  const InputTextEditorStyled = styled("input", {
223
210
  name: DATAGRID_PREFIX_NAME,
224
211
  slot: TextEditorSlots.inputTexEditor
@@ -233,51 +220,49 @@ styled("div", {
233
220
  })(dataGridStyles.columnIconFormatter);
234
221
  export {
235
222
  ActionsRootStyled as A,
236
- TableContainerStyled as B,
223
+ NameColumnStyled as B,
237
224
  CustomHeaderStyled as C,
238
225
  DataGridRootStyled as D,
239
226
  EditorCellWrapperStyled as E,
240
- NameColumnStyled as F,
241
- IconColumnStyled as G,
242
- DraggableHeaderRootStyled as H,
243
- IconButtonEditStyled as I,
244
- ButtonHeaderActionsStyled as J,
245
- DraggableWrapperInputBaseStyled as K,
227
+ DraggableHeaderRootStyled as F,
228
+ ButtonHeaderActionsStyled as G,
229
+ DraggableWrapperInputBaseStyled as H,
230
+ IconColumnStyled as I,
231
+ IconSearchStyled as J,
232
+ HeaderInputBaseStyled as K,
246
233
  LabelHeaderColumnStyled as L,
247
- IconSearchStyled as M,
234
+ MenuListStyled as M,
248
235
  NameColumnIconStyled as N,
249
- HeaderInputBaseStyled as O,
250
- MenuListStyled as P,
251
- HeaderRenderClickStyled as Q,
236
+ HeaderRenderClickStyled as O,
237
+ InputTextEditorStyled as P,
252
238
  RowsCountRootStyled as R,
253
- InputTextEditorStyled as S,
254
239
  TableWrapperDataGridStyled as T,
255
240
  ValueColumnStyled as V,
256
241
  WrapperSkeletonStyled as W,
257
242
  ContentModalSettingStyled as a,
258
243
  ContainerLabelValueColumnStyled as b,
259
244
  ContentWrapperColumnStyled as c,
260
- EditablePlaceholderStyled as d,
261
- CardsContainerStyled as e,
262
- CardDetailContainerStyled as f,
263
- CardHeaderStyled as g,
264
- CardHeaderLeftStyled as h,
265
- CardHeaderRightStyled as i,
266
- CardContentWrapperStyled as j,
267
- CardContentStyled as k,
268
- CardStyled as l,
269
- CheckboxCellWrapperStyled as m,
270
- ControlNavigateStyled as n,
271
- ActionsConfigContainerStyled as o,
272
- ContainerLeftActionsStyled as p,
273
- ContainerRightActionsStyled as q,
274
- RowsCountLabelStyled as r,
275
- RowsCountValueStyled as s,
276
- ColumnsConfigWrapperStyled as t,
277
- ColumnsConfigDataGridStyled as u,
278
- ColumnsConfigSelColumnsStyled as v,
279
- ColumnsConfigActiosStyled as w,
280
- ContainerToggleCardsStyled as x,
281
- CardToggleButtonStyled as y,
282
- TextToggleCardButtonStyled as z
245
+ CardsContainerStyled as d,
246
+ CardDetailContainerStyled as e,
247
+ CardHeaderStyled as f,
248
+ CardHeaderLeftStyled as g,
249
+ CardHeaderRightStyled as h,
250
+ CardContentWrapperStyled as i,
251
+ CardContentStyled as j,
252
+ CardStyled as k,
253
+ CheckboxCellWrapperStyled as l,
254
+ ControlNavigateStyled as m,
255
+ ActionsConfigContainerStyled as n,
256
+ ContainerLeftActionsStyled as o,
257
+ ContainerRightActionsStyled as p,
258
+ RowsCountLabelStyled as q,
259
+ RowsCountValueStyled as r,
260
+ ColumnsConfigWrapperStyled as s,
261
+ ColumnsConfigDataGridStyled as t,
262
+ ColumnsConfigSelColumnsStyled as u,
263
+ ColumnsConfigActiosStyled as v,
264
+ ContainerToggleCardsStyled as w,
265
+ CardToggleButtonStyled as x,
266
+ TextToggleCardButtonStyled as y,
267
+ TableContainerStyled as z
283
268
  };
@@ -2,7 +2,7 @@ import { CardContentProps } from '../../../types';
2
2
  /**
3
3
  * Hook que encapsula toda la lógica de renderizado del contenido de una Card
4
4
  */
5
- export declare function useCardContent<TRow>({ row, rows, rowIndex, columns, onRowsChange, }: CardContentProps<TRow>): {
5
+ export declare function useCardContent<TRow>({ row, columns, onRowsChange, }: CardContentProps<TRow>): {
6
6
  cardContent: import("react/jsx-runtime").JSX.Element[];
7
7
  columnsCount: number;
8
8
  };
@@ -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;