@m4l/components 9.3.35 → 9.3.36-JT20251128-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 (113) hide show
  1. package/@types/export.d.ts +3 -0
  2. package/@types/types.d.ts +40 -5
  3. package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +3 -3
  4. package/components/ActionsGroup/ActionsGroup.d.ts +5 -0
  5. package/components/ActionsGroup/ActionsGroup.js +40 -0
  6. package/components/ActionsGroup/ActionsGroup.styles.d.ts +2 -0
  7. package/components/ActionsGroup/ActionsGroup.styles.js +95 -0
  8. package/components/ActionsGroup/__tests__/ActionsGroup.test.d.ts +1 -0
  9. package/components/ActionsGroup/constants.d.ts +2 -0
  10. package/components/ActionsGroup/constants.js +8 -0
  11. package/components/ActionsGroup/icons.d.ts +3 -0
  12. package/components/ActionsGroup/icons.js +6 -0
  13. package/components/ActionsGroup/index.d.ts +1 -0
  14. package/components/ActionsGroup/index.js +1 -0
  15. package/components/ActionsGroup/slots/ActionsGroupEnum.d.ts +8 -0
  16. package/components/ActionsGroup/slots/ActionsGroupEnum.js +12 -0
  17. package/components/ActionsGroup/slots/ActionsGroupSlots.d.ts +15 -0
  18. package/components/ActionsGroup/slots/ActionsGroupSlots.js +35 -0
  19. package/components/ActionsGroup/subcomponents/ActionIconButton/ActionIconButton.d.ts +6 -0
  20. package/components/ActionsGroup/subcomponents/ActionIconButton/ActionIconButton.js +76 -0
  21. package/components/ActionsGroup/subcomponents/ActionIconButton/types.d.ts +7 -0
  22. package/components/ActionsGroup/types.d.ts +60 -0
  23. package/components/Chip/slots/ChipSlots.d.ts +1 -1
  24. package/components/DataGrid/DataGrid.js +2 -0
  25. package/components/DataGrid/Datagrid.styles.js +11 -2
  26. package/components/DataGrid/contexts/DataGridContext/index.js +2 -0
  27. package/components/DataGrid/contexts/DataGridContext/types.d.ts +2 -2
  28. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +15 -7
  29. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +4 -1
  30. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +6 -2
  31. package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.d.ts +6 -0
  32. package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.js +12 -0
  33. package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.d.ts +64 -0
  34. package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.js +46 -0
  35. package/components/DataGrid/tests/table/subcomponents/RadioButtonFormatter.test.d.ts +1 -0
  36. package/components/DataGrid/tests/table/subcomponents/RadioSelectColumn.test.d.ts +1 -0
  37. package/components/DataGrid/types.d.ts +7 -0
  38. package/components/EditLabel/slots/EditLabelSlots.d.ts +1 -1
  39. package/components/HelperError/slots/HelperErrorSlots.d.ts +1 -1
  40. package/components/ImageText/slots/ImageTextSlots.d.ts +2 -2
  41. package/components/Label/index.d.ts +1 -1
  42. package/components/Label/slots/LabelSlots.d.ts +2 -2
  43. package/components/Label/types.d.ts +6 -0
  44. package/components/LoadingError/slots/LoadingErrorSlots.d.ts +1 -1
  45. package/components/Pager/slots/PagerSlots.d.ts +3 -3
  46. package/components/PaperForm/slots/PaperFormSlots.d.ts +1 -1
  47. package/components/SettingsLayout/slots/SettingsLayoutSlots.d.ts +1 -1
  48. package/components/Stepper/slots/StepperSlot.d.ts +4 -4
  49. package/components/TabsNavigator/slots/TabsNavigatorSlots.d.ts +12 -12
  50. package/components/ToastContainer/slots/toastContainerSlots.d.ts +2 -2
  51. package/components/WindowBase/WindowBase.styles.js +8 -0
  52. package/components/WindowBase/slots/WindowBaseSlots.d.ts +2 -2
  53. package/components/WindowBase/subcomponents/Header/useButtonActions.js +23 -13
  54. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +1 -1
  55. package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +1 -1
  56. package/components/formatters/ConcatenatedFormatter/slots/ConcatenatedFormatterSlots.d.ts +1 -1
  57. package/components/formatters/DateFormatter/slots/DateFormatterSlots.d.ts +1 -1
  58. package/components/formatters/DistanceToNowFormatter/slots/DistanceToNowFormatterSlots.d.ts +1 -1
  59. package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +1 -1
  60. package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +1 -1
  61. package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.d.ts +1 -1
  62. package/components/formatters/PriceFormatter/slots/PriceFormatterSlots.d.ts +1 -1
  63. package/components/formatters/UncertaintyFormatter/slots/UncertaintyFormatterSlots.d.ts +1 -1
  64. package/components/hook-form/RHFActionsGroup/RHFActionsGroup.d.ts +7 -0
  65. package/components/hook-form/RHFActionsGroup/RHFActionsGroup.js +87 -0
  66. package/components/hook-form/RHFActionsGroup/RHFActionsGroupStyles.d.ts +2 -0
  67. package/components/hook-form/RHFActionsGroup/RHFActionsGroupStyles.js +14 -0
  68. package/components/hook-form/RHFActionsGroup/constants.d.ts +9 -0
  69. package/components/hook-form/RHFActionsGroup/constants.js +8 -0
  70. package/components/hook-form/RHFActionsGroup/index.d.ts +2 -0
  71. package/components/hook-form/RHFActionsGroup/index.js +1 -0
  72. package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupEnum.d.ts +3 -0
  73. package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupEnum.js +7 -0
  74. package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupSlots.d.ts +1 -0
  75. package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupSlots.js +11 -0
  76. package/components/hook-form/RHFActionsGroup/slots/index.d.ts +2 -0
  77. package/components/hook-form/RHFActionsGroup/slots/index.js +1 -0
  78. package/components/hook-form/RHFActionsGroup/tests/RHFActionsGroup.test.d.ts +1 -0
  79. package/components/hook-form/RHFActionsGroup/tests/common.d.ts +28 -0
  80. package/components/hook-form/RHFActionsGroup/types.d.ts +54 -0
  81. package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.d.ts +1 -1
  82. package/components/hook-form/RHFUpload/RHFUploadSingleFile/slots/RHFUploadSingleFileSlots.d.ts +5 -5
  83. package/components/hook-form/index.d.ts +1 -0
  84. package/components/index.d.ts +1 -0
  85. package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +1 -1
  86. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +2 -2
  87. package/components/mui_extended/Button/slots/ButtonSlots.d.ts +1 -1
  88. package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +1 -1
  89. package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +1 -1
  90. package/components/mui_extended/NavLink/slots/NavLinkSlots.d.ts +1 -1
  91. package/components/mui_extended/RadioButton/RadioButton.d.ts +24 -0
  92. package/components/mui_extended/RadioButton/RadioButton.js +110 -0
  93. package/components/mui_extended/RadioButton/RadioButton.styles.d.ts +2 -0
  94. package/components/mui_extended/RadioButton/RadioButton.styles.js +126 -0
  95. package/components/mui_extended/RadioButton/constants.d.ts +1 -0
  96. package/components/mui_extended/RadioButton/constants.js +4 -0
  97. package/components/mui_extended/RadioButton/icons.d.ts +4 -0
  98. package/components/mui_extended/RadioButton/icons.js +7 -0
  99. package/components/mui_extended/RadioButton/index.d.ts +1 -0
  100. package/components/mui_extended/RadioButton/index.js +1 -0
  101. package/components/mui_extended/RadioButton/slots/RadioButtonEnum.d.ts +8 -0
  102. package/components/mui_extended/RadioButton/slots/RadioButtonEnum.js +12 -0
  103. package/components/mui_extended/RadioButton/slots/RadioButtonSlots.d.ts +20 -0
  104. package/components/mui_extended/RadioButton/slots/RadioButtonSlots.js +39 -0
  105. package/components/mui_extended/RadioButton/tests/RadioButton.test.d.ts +1 -0
  106. package/components/mui_extended/RadioButton/types.d.ts +50 -0
  107. package/components/mui_extended/Select/slots/SelectSlots.d.ts +3 -3
  108. package/components/mui_extended/Tab/Slots/TabSlots.d.ts +1 -1
  109. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +3 -3
  110. package/components/mui_extended/Tooltip/Tooltip.styles.js +22 -4
  111. package/components/mui_extended/index.d.ts +1 -0
  112. package/index.js +76 -70
  113. package/package.json +1 -1
@@ -0,0 +1,76 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
3
+ import { a as ActionIconButtonSkeletonStyled, b as ActionIconButtonStyled, I as IconTooltipMessageStyled, T as TextTooltipMessageStyled } from "../../slots/ActionsGroupSlots.js";
4
+ import { useEnvironment, useModuleSkeleton } from "@m4l/core";
5
+ import { A as ACTIONS_GROUP_ICONS } from "../../icons.js";
6
+ import { a as actionsGroupStyles } from "../../ActionsGroup.styles.js";
7
+ import { T as Tooltip } from "../../../mui_extended/Tooltip/Tooltip.js";
8
+ const ActionIconButton = (props) => {
9
+ const { action, selected, ownerState, onChange, groupDisabled } = props;
10
+ const { iconUrl: urlIcon, onClick, disabled, label } = action;
11
+ const { host_static_assets, environment_assets } = useEnvironment();
12
+ const isSkeleton = useModuleSkeleton();
13
+ const { currentSize } = useComponentSize();
14
+ const handleClick = () => {
15
+ if (disabled) {
16
+ return;
17
+ }
18
+ onChange?.(action.id);
19
+ onClick?.(action.id);
20
+ };
21
+ if (isSkeleton) {
22
+ return /* @__PURE__ */ jsx(ActionIconButtonSkeletonStyled, { ownerState: { ...ownerState } });
23
+ }
24
+ return /* @__PURE__ */ jsx(
25
+ Tooltip,
26
+ {
27
+ arrow: true,
28
+ PopperProps: {
29
+ modifiers: [
30
+ {
31
+ name: "offset",
32
+ options: {
33
+ offset: [0, 10]
34
+ }
35
+ }
36
+ ]
37
+ },
38
+ slotProps: {
39
+ tooltip: {
40
+ /**
41
+ * Estilos del tooltip.
42
+ */
43
+ sx: (theme) => typeof actionsGroupStyles.tooltip === "function" ? actionsGroupStyles.tooltip({ theme }) : {}
44
+ }
45
+ },
46
+ title: /* @__PURE__ */ jsxs(Fragment, { children: [
47
+ (disabled || groupDisabled) && /* @__PURE__ */ jsx(
48
+ IconTooltipMessageStyled,
49
+ {
50
+ variant: "text",
51
+ size: "small",
52
+ src: `${host_static_assets}/${environment_assets}/${ACTIONS_GROUP_ICONS.blocked}`
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsx(TextTooltipMessageStyled, { variant: "body", children: label })
56
+ ] }),
57
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
58
+ ActionIconButtonStyled,
59
+ {
60
+ ownerState: { ...ownerState, itemSelected: selected, itemDisabled: disabled },
61
+ size: currentSize,
62
+ src: urlIcon,
63
+ onClick: handleClick,
64
+ disabled: disabled || groupDisabled,
65
+ variant: "text",
66
+ color: selected ? "primary" : "default",
67
+ "aria-label": label,
68
+ "aria-pressed": selected
69
+ }
70
+ ) })
71
+ }
72
+ );
73
+ };
74
+ export {
75
+ ActionIconButton as A
76
+ };
@@ -0,0 +1,7 @@
1
+ import { ActionGroupItem, ActionsGroupOwnerState, ActionsGroupProps, ActionsGroupValueType } from '../../types';
2
+ export interface ActionIconButtonProps<T extends ActionsGroupValueType> extends Pick<ActionsGroupProps<T>, 'onChange'> {
3
+ action: ActionGroupItem<T>;
4
+ ownerState: ActionsGroupOwnerState;
5
+ groupDisabled: boolean;
6
+ selected: boolean;
7
+ }
@@ -0,0 +1,60 @@
1
+ import { M4LOverridesStyleRules } from '../../@types/augmentations';
2
+ import { ActionsGroupSlots } from './slots/ActionsGroupEnum';
3
+ import { ACTIONS_GROUP_KEY_COMPONENT } from './constants';
4
+ import { Theme } from '@mui/material';
5
+ import { Sizes } from '@m4l/styles';
6
+ export type ActionsGroupValueType = string | number | null;
7
+ export interface ActionGroupItem<T extends ActionsGroupValueType> {
8
+ id: T;
9
+ label: string;
10
+ iconUrl: string;
11
+ onClick?: (item: T) => void;
12
+ disabled?: boolean;
13
+ }
14
+ export interface ActionsGroupProps<T extends ActionsGroupValueType> {
15
+ /**
16
+ * Indica si el grupo de acciones está deshabilitado.
17
+ */
18
+ disabled?: boolean;
19
+ /**
20
+ * Clase personalizada para el grupo de acciones.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Etiqueta accesible para el grupo (role toolbar).
25
+ */
26
+ ariaLabel?: string;
27
+ /**
28
+ * ID de elemento que etiqueta al grupo (alternativa a ariaLabel).
29
+ */
30
+ ariaLabelledBy?: string;
31
+ /**
32
+ * Item seleccionado.
33
+ */
34
+ value: T;
35
+ /**
36
+ * Función que se ejecuta cuando se selecciona una acción.
37
+ */
38
+ onChange: (newValue: T) => void;
39
+ /**
40
+ * Tamaño del grupo de acciones.
41
+ */
42
+ size?: Extract<Sizes, 'small' | 'medium'>;
43
+ /**
44
+ * Lista de acciones para el grupo.
45
+ */
46
+ actions: ActionGroupItem<T>[];
47
+ /**
48
+ * Variante del grupo de acciones.
49
+ */
50
+ variant?: 'vertical' | 'horizontal';
51
+ }
52
+ export type ActionsGroupSlotsType = keyof typeof ActionsGroupSlots;
53
+ export type ActionsGroupOwnerState = {
54
+ size?: Extract<Sizes, 'small' | 'medium'>;
55
+ disabled?: boolean;
56
+ variant?: 'vertical' | 'horizontal';
57
+ itemSelected?: boolean;
58
+ itemDisabled?: boolean;
59
+ };
60
+ export type ActionsGroupStyles = M4LOverridesStyleRules<ActionsGroupSlotsType, typeof ACTIONS_GROUP_KEY_COMPONENT, Theme>;
@@ -7,7 +7,7 @@ declare const SkeletonChipStyled: import('@emotion/styled').StyledComponent<Pick
7
7
  declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
8
8
  ownerState?: (Partial<import('..').ChipOwnerState> & Record<string, unknown>) | undefined;
9
9
  }, {}, {}>;
10
- declare const TextChipStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/Typography/types').TypographyProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "size" | "children" | "title" | "component" | "zIndex" | "id" | "disabled" | "paragraph" | "border" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontSize" | "textTransform" | "fontFamily" | "typography" | "flex" | "hidden" | "color" | "left" | "right" | "bottom" | "top" | "ellipsis" | "content" | "style" | "position" | "padding" | "variant" | "borderRadius" | "width" | "display" | "borderColor" | "height" | "gap" | "minHeight" | "margin" | "overflow" | "boxShadow" | "minWidth" | "justifyContent" | "alignItems" | "paddingLeft" | "borderLeft" | "borderTop" | "maxWidth" | "flexDirection" | "paddingRight" | "borderRight" | "flexGrow" | "marginLeft" | "textOverflow" | "borderBottom" | "gridTemplateColumns" | "marginBottom" | "dataTestid" | "alignContent" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateRows" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginRight" | "marginTop" | "maxHeight" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingTop" | "rowGap" | "textAlign" | "translate" | "visibility" | "whiteSpace" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "p" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "htmlFor" | "gutterBottom" | "noWrap" | "variantMapping" | "skeletonWidth" | "skeletonRows" | keyof import('react').RefAttributes<HTMLSpanElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
10
+ declare const TextChipStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/Typography/types').TypographyProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "size" | "children" | "title" | "component" | "zIndex" | "id" | "disabled" | "paragraph" | "border" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontSize" | "textTransform" | "fontFamily" | "typography" | "flex" | "hidden" | "color" | "left" | "right" | "bottom" | "top" | "content" | "style" | "position" | "ellipsis" | "padding" | "variant" | "borderRadius" | "width" | "display" | "borderColor" | "height" | "gap" | "minHeight" | "margin" | "overflow" | "boxShadow" | "minWidth" | "justifyContent" | "alignItems" | "paddingLeft" | "borderLeft" | "borderTop" | "maxWidth" | "flexDirection" | "paddingRight" | "borderRight" | "flexGrow" | "marginLeft" | "textOverflow" | "borderBottom" | "gridTemplateColumns" | "marginBottom" | "dataTestid" | "alignContent" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateRows" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginRight" | "marginTop" | "maxHeight" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingTop" | "rowGap" | "textAlign" | "translate" | "visibility" | "whiteSpace" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "p" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "htmlFor" | "gutterBottom" | "noWrap" | "variantMapping" | "skeletonWidth" | "skeletonRows" | keyof import('react').RefAttributes<HTMLSpanElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
11
11
  ownerState?: (Partial<import('..').ChipOwnerState> & Record<string, unknown>) | undefined;
12
12
  }, {}, {}>;
13
13
  declare const IconButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "value" | "size" | "children" | "title" | "component" | "name" | "id" | "type" | "selected" | "disabled" | "action" | "hidden" | "color" | "content" | "style" | "icon" | "tooltip" | "variant" | "translate" | "className" | "classes" | "src" | "sx" | "form" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "instaceDataTestId" | "placement" | "rotationAngle" | "ariaLabel" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "badgeProps" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
@@ -30,6 +30,7 @@ function DataGrid(props) {
30
30
  initialRowHeightVariant,
31
31
  checkedRows,
32
32
  onCheckedRowsChange,
33
+ checkedRowsMultiple,
33
34
  dataTestId = "",
34
35
  customHeader: CustomHeader,
35
36
  visibleCustomHeader = true,
@@ -87,6 +88,7 @@ function DataGrid(props) {
87
88
  checkedRows,
88
89
  rowActionsGetter,
89
90
  onCheckedRowsChange,
91
+ checkedRowsMultiple,
90
92
  rowKeyGetter,
91
93
  rows,
92
94
  onChangeUserColumns,
@@ -424,6 +424,10 @@ const dataGridStyles = {
424
424
  borderColor: `${theme.vars.palette?.border.disabled} !important`,
425
425
  ...theme.colorSchemes.finalTheme.typography.body
426
426
  },
427
+ "&:has(> .M4LRadioButton-root)": {
428
+ overflow: "visible",
429
+ paddingInline: 0
430
+ },
427
431
  "&.rdg-cell-frozen": {
428
432
  display: "flex",
429
433
  boxShadow: "unset",
@@ -734,7 +738,10 @@ const dataGridStyles = {
734
738
  */
735
739
  cardsContainer: () => ({
736
740
  height: "auto",
737
- overflow: "auto"
741
+ overflow: "auto",
742
+ "& > .M4LContainerFlow-root": {
743
+ alignItems: "start"
744
+ }
738
745
  }),
739
746
  /**
740
747
  * Card de la vista cards
@@ -746,6 +753,8 @@ const dataGridStyles = {
746
753
  minWidth: "280px",
747
754
  maxWidth: "580px",
748
755
  cursor: "pointer",
756
+ padding: theme.vars.size.baseSpacings["sp2-5"],
757
+ gap: "0 !important",
749
758
  // Si está checked (pero no selected), border de checked
750
759
  ...ownerState?.checked && !ownerState?.selected && {
751
760
  borderColor: theme.vars.palette.primary.activeOpacity
@@ -786,7 +795,7 @@ const dataGridStyles = {
786
795
  cardHeaderRight: ({ theme }) => ({
787
796
  display: "flex",
788
797
  alignItems: "center",
789
- gap: theme.vars.size.baseSpacings.sp1
798
+ gap: theme.vars.size.baseSpacings["sp0-5"]
790
799
  }),
791
800
  /**
792
801
  * Contenido de la card (body)
@@ -155,6 +155,7 @@ function DataGridProvider(props) {
155
155
  initialRowHeightVariant = "standard",
156
156
  checkedRows,
157
157
  onCheckedRowsChange,
158
+ checkedRowsMultiple,
158
159
  rowKeyGetter,
159
160
  onChangeUserColumns,
160
161
  externalSortSettings: sortSettings,
@@ -530,6 +531,7 @@ function DataGridProvider(props) {
530
531
  rowActionsGetter,
531
532
  setRowHeightVariant: setCurrentRowHeightInternal,
532
533
  onCheckedRowsChange,
534
+ checkedRowsMultiple,
533
535
  rowKeyGetter,
534
536
  onChangeUserColumns,
535
537
  sortColumns,
@@ -79,7 +79,7 @@ export interface IGridConfig {
79
79
  export interface IGridConfigExtended extends IGridConfig {
80
80
  columnsConfigCards?: BaseConfigColumnCards[];
81
81
  }
82
- export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'rowKeyGetter' | 'onChangeUserColumns' | 'defaultUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'defaultViewMode' | 'cardsViewConfig'> {
82
+ export interface DataGridProviderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<GridProps<TRow, TSummaryRow, TKey>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowKeyGetter' | 'onChangeUserColumns' | 'defaultUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'defaultViewMode' | 'cardsViewConfig'> {
83
83
  id: number | string;
84
84
  children: ReactNode;
85
85
  rowsCount: number;
@@ -92,7 +92,7 @@ export type RowHeightState = {
92
92
  rowHeight: number;
93
93
  rowHeaderHeight: number;
94
94
  };
95
- export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'onChangeUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'viewMode' | 'onViewModeChange' | 'defaultViewMode' | 'cardsViewConfig'> {
95
+ export interface DataGridContextProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Pick<DataGridProviderProps<TRow, TSummaryRow, TKey>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'checkedRowsMultiple' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter' | 'onChangeUserColumns' | 'externalSortSettings' | 'externalFilterSettings' | 'viewMode' | 'onViewModeChange' | 'defaultViewMode' | 'cardsViewConfig'> {
96
96
  getConfigColumns: (viewMode: ViewMode) => IViewConfig[];
97
97
  onChangeColumnsConfig: (viewMode: ViewMode, config: IViewConfig[]) => void;
98
98
  onChangeColumnsOrder: (viewMode: ViewMode, sourceKey: string, targetKey: string) => void;
@@ -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
  () => ({
@@ -2,6 +2,7 @@ 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
7
  import { l as CheckboxCellWrapperStyled } from "../../slots/DataGridSlot.js";
7
8
  const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref) {
@@ -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,
@@ -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
@@ -0,0 +1,6 @@
1
+ import { RenderCheckboxProps } from 'react-data-grid';
2
+ /**
3
+ * Componente visual del RadioButton que se renderiza dentro de cada celda del DataGrid.
4
+ * ¿Para que sirve? Es un wrapper alrededor del componente Radio del MUI que adapta las props de react-data-grid
5
+ */
6
+ export declare const RadioButtonFormatter: import('react').ForwardRefExoticComponent<RenderCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { R as RadioButton } from "../../../../mui_extended/RadioButton/RadioButton.js";
4
+ const RadioButtonFormatter = forwardRef(function RadioFormatter({ onChange, checked, ...props }, _ref) {
5
+ function handleChange(e) {
6
+ onChange(e.target.checked, e.nativeEvent.shiftKey);
7
+ }
8
+ return /* @__PURE__ */ jsx(RadioButton, { checked, onChange: handleChange, ...props });
9
+ });
10
+ export {
11
+ RadioButtonFormatter as R
12
+ };
@@ -0,0 +1,64 @@
1
+ import { Column, RenderCellProps, RenderGroupCellProps, RenderHeaderCellProps } from 'react-data-grid';
2
+ export declare const filterColumnClassName = "filter-cell";
3
+ export declare const filterHeight = 35;
4
+ /**
5
+ * Formateador para la celda de selección con radio button en filas agrupadas.
6
+ *
7
+ * **Nota:** Para radio buttons (selección única), no tiene sentido seleccionar grupos completos,
8
+ * por lo que este formateador retorna `null` y no renderiza ningún control.
9
+ * @param _props - Propiedades para renderizar la celda de grupo (no utilizadas).
10
+ * @returns `null` - No se renderiza ningún control de selección en grupos.
11
+ * @example
12
+ * // En un DataGrid con grupos, las filas de grupo no tendrán radio button
13
+ * // Solo las filas individuales tendrán radio buttons
14
+ */
15
+ export declare function RadioSelectGroupFormatter(_props: RenderGroupCellProps<unknown>): null;
16
+ /**
17
+ * Formateador para la celda de selección con radio button en filas individuales.
18
+ *
19
+ * Este componente maneja la lógica de **selección única**: cuando el usuario hace click
20
+ * en un radio button, se REEMPLAZA completamente la selección anterior con solo la fila actual.
21
+ *
22
+ * **Comportamiento:**
23
+ * - Si `checked` es `true`: El Set de `checkedRows` se reemplaza con `[rowKey actual]`
24
+ * - Si `checked` es `false`: El Set de `checkedRows` se vacía (deselección)
25
+ * @param props - Propiedades para renderizar la celda, incluyendo la fila actual.
26
+ * @returns Un componente `SelectCellFormatter` configurado como radio button.
27
+ * @example
28
+ * // Cuando el usuario hace click en el radio de la fila con ID=5:
29
+ * // checkedRows antes: Set([3])
30
+ * // checkedRows después: Set([5]) ← Reemplaza, no agrega
31
+ */
32
+ export declare function RadioSelectFormatter(props: RenderCellProps<any, any>): import("react/jsx-runtime").JSX.Element;
33
+ /**
34
+ * Renderizador para la celda de cabecera (header) de la columna de selección con radio buttons.
35
+ *
36
+ * **Nota:** A diferencia de los checkboxes, los radio buttons NO tienen funcionalidad de
37
+ * "Seleccionar Todo", ya que solo se puede seleccionar una fila a la vez. Por lo tanto,
38
+ * este renderizador retorna `null` y no muestra ningún control en el header.
39
+ * @param _props - Propiedades para renderizar la celda de cabecera (no utilizadas).
40
+ * @returns `null` - No se renderiza ningún control en la cabecera.
41
+ * @example
42
+ * // La cabecera de la columna estará vacía (sin checkbox "Select All")
43
+ */
44
+ export declare function RadioSelectColumnHeaderRenderer(_props: RenderHeaderCellProps<any, any>): null;
45
+ /**
46
+ * Definición de la columna de selección con radio buttons para el DataGrid.
47
+ *
48
+ * Esta columna permite **selección única** de filas mediante radio buttons.
49
+ *
50
+ * **Características:**
51
+ * - **Ancho fijo:** 32px (igual que la columna de checkboxes)
52
+ * - **No redimensionable:** `resizable: false`
53
+ * - **No draggable:** `isDraggable: false`
54
+ * - **No sortable:** `sortable: false`
55
+ * - **Congelada:** `frozen: true` (siempre visible al hacer scroll horizontal)
56
+ * - **Header vacío:** No tiene control "Select All"
57
+ * - **Selección única:** Solo una fila puede estar seleccionada a la vez
58
+ * @example
59
+ * // En useSortColumnsRows.tsx:
60
+ * const selectionColumn = checkedRowsMultiple === false
61
+ * ? RadioSelectColumn // ← Selección única con radio buttons
62
+ * : SelectColumn; // ← Selección múltiple con checkboxes
63
+ */
64
+ export declare const RadioSelectColumn: Column<any, any>;
@@ -0,0 +1,46 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
3
+ import { d as DATAGRID_SELECT_COLUMN_KEY } from "../../../constants.js";
4
+ import { R as RadioButtonFormatter } from "./RadioButtonFormatter.js";
5
+ function RadioSelectGroupFormatter(_props) {
6
+ return null;
7
+ }
8
+ function RadioSelectFormatter(props) {
9
+ const { checkedRows, onCheckedRowsChange, rowKeyGetter } = useDataGrid();
10
+ const onChange = (checked, _isShiftClick) => {
11
+ if (checked) {
12
+ onCheckedRowsChange && onCheckedRowsChange(/* @__PURE__ */ new Set([rowKeyGetter(props.row)]));
13
+ } else {
14
+ onCheckedRowsChange && onCheckedRowsChange(/* @__PURE__ */ new Set());
15
+ }
16
+ };
17
+ return /* @__PURE__ */ jsx(
18
+ RadioButtonFormatter,
19
+ {
20
+ checked: checkedRows?.has(rowKeyGetter(props.row)) || false,
21
+ tabIndex: props.tabIndex,
22
+ onChange,
23
+ "aria-label": "Select"
24
+ }
25
+ );
26
+ }
27
+ function RadioSelectColumnHeaderRenderer(_props) {
28
+ return null;
29
+ }
30
+ const RadioSelectColumn = {
31
+ key: DATAGRID_SELECT_COLUMN_KEY,
32
+ name: "",
33
+ width: 32,
34
+ minWidth: 32,
35
+ isDraggable: false,
36
+ resizable: false,
37
+ sortable: false,
38
+ frozen: true,
39
+ type: "boolean",
40
+ renderHeaderCell: RadioSelectColumnHeaderRenderer,
41
+ renderCell: RadioSelectFormatter,
42
+ renderGroupCell: RadioSelectGroupFormatter
43
+ };
44
+ export {
45
+ RadioSelectColumn as R
46
+ };
@@ -137,6 +137,13 @@ export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> exte
137
137
  onSelectedRowsChange?: (mapRowsSelected: ReadonlySet<TKey>) => void;
138
138
  checkedRows?: ReadonlySet<TKey>;
139
139
  onCheckedRowsChange?: (mapRowsSelected: ReadonlySet<TKey>) => void;
140
+ /**
141
+ * Define si la selección de filas es múltiple (checkboxes) o única (radio buttons).
142
+ *
143
+ * - `true` (default): Permite seleccionar múltiples filas con checkboxes
144
+ * - `false`: Permite seleccionar solo una fila con radio buttons
145
+ */
146
+ checkedRowsMultiple?: boolean;
140
147
  onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, TSummaryRow>) => void>;
141
148
  /**
142
149
  * Propiedad opcional que recibe la configuración de las columnas