@m4l/components 9.3.34-JT25112025.beta.1 → 9.3.34-JT25112025.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/export.d.ts +0 -3
- package/@types/types.d.ts +5 -26
- package/components/DataGrid/DataGrid.js +0 -2
- package/components/DataGrid/Datagrid.styles.js +111 -43
- package/components/DataGrid/contexts/DataGridContext/index.js +0 -2
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +2 -2
- package/components/DataGrid/dictionary.d.ts +1 -0
- package/components/DataGrid/dictionary.js +2 -1
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +1 -0
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
- package/components/DataGrid/hooks/useModalCardDetail.js +6 -1
- package/components/DataGrid/icons.d.ts +1 -0
- package/components/DataGrid/icons.js +2 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +4 -1
- package/components/DataGrid/slots/DataGridEnum.js +3 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +3 -0
- package/components/DataGrid/slots/DataGridSlot.js +48 -33
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +47 -5
- package/components/DataGrid/subcomponents/Cards/index.js +6 -3
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +59 -15
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +8 -16
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +5 -1
- package/components/DataGrid/subcomponents/Cards/types.d.ts +16 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +2 -5
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -6
- package/components/DataGrid/subcomponents/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +39 -14
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/types.d.ts +12 -7
- package/components/mui_extended/index.d.ts +0 -1
- package/index.js +40 -42
- package/package.json +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +0 -4
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.d.ts +0 -6
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.js +0 -20
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.d.ts +0 -64
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.js +0 -46
- package/components/mui_extended/RadioButton/RadioButton.d.ts +0 -24
- package/components/mui_extended/RadioButton/RadioButton.js +0 -110
- package/components/mui_extended/RadioButton/RadioButton.styles.d.ts +0 -2
- package/components/mui_extended/RadioButton/RadioButton.styles.js +0 -126
- package/components/mui_extended/RadioButton/constants.d.ts +0 -1
- package/components/mui_extended/RadioButton/constants.js +0 -4
- package/components/mui_extended/RadioButton/icons.d.ts +0 -4
- package/components/mui_extended/RadioButton/icons.js +0 -7
- package/components/mui_extended/RadioButton/index.d.ts +0 -1
- package/components/mui_extended/RadioButton/index.js +0 -1
- package/components/mui_extended/RadioButton/slots/RadioButtonEnum.d.ts +0 -8
- package/components/mui_extended/RadioButton/slots/RadioButtonEnum.js +0 -12
- package/components/mui_extended/RadioButton/slots/RadioButtonSlots.d.ts +0 -20
- package/components/mui_extended/RadioButton/slots/RadioButtonSlots.js +0 -39
- package/components/mui_extended/RadioButton/types.d.ts +0 -50
- /package/components/DataGrid/{tests/table/subcomponents/RadioButtonFormatter.test.d.ts → formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts} +0 -0
- /package/components/DataGrid/{tests/table/subcomponents/RadioSelectColumn.test.d.ts → formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts} +0 -0
- /package/components/{mui_extended/RadioButton/tests/RadioButton.test.d.ts → DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts} +0 -0
package/index.js
CHANGED
|
@@ -94,7 +94,6 @@ import { T as T3 } from "./components/mui_extended/Tooltip/Tooltip.js";
|
|
|
94
94
|
import { I as I2 } from "./components/mui_extended/IconButton/IconButton.js";
|
|
95
95
|
import { B as B5 } from "./components/mui_extended/Button/Button.js";
|
|
96
96
|
import { C as C18 } from "./components/mui_extended/CheckBox/CheckBox.js";
|
|
97
|
-
import { R as R4 } from "./components/mui_extended/RadioButton/RadioButton.js";
|
|
98
97
|
import { I as I3 } from "./components/mui_extended/ImageButton/ImageButton.js";
|
|
99
98
|
import { P as P2 } from "./components/mui_extended/Popover/Popover.js";
|
|
100
99
|
import { S as S4 } from "./components/mui_extended/Select/Select.js";
|
|
@@ -134,36 +133,36 @@ import { u as u16 } from "./components/formatters/DistanceToNowFormatter/hooks/u
|
|
|
134
133
|
import { g as g18 } from "./components/formatters/dictionary.js";
|
|
135
134
|
import { F as F2 } from "./components/FormContainer/FormContainer.js";
|
|
136
135
|
import { G } from "./components/GridLayout/GridLayout.js";
|
|
137
|
-
import { R as
|
|
136
|
+
import { R as R4 } from "./components/GridLayout/subcomponents/Responsive/index.js";
|
|
138
137
|
import { c as c2, e, d as d3 } from "./components/GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
139
138
|
import { i, k } from "./components/GridLayout/utils.js";
|
|
140
139
|
import { w } from "./components/GridLayout/subcomponents/withSizeProvider/index.js";
|
|
141
140
|
import { H as H2 } from "./components/HelmetPage/index.js";
|
|
142
141
|
import { H as H3 } from "./components/HelperError/HelperError.js";
|
|
143
|
-
import { R as
|
|
142
|
+
import { R as R5 } from "./components/hook-form/RHFAutocomplete/RHFAutocomplete.js";
|
|
144
143
|
import { g as g19 } from "./components/hook-form/RHFAutocomplete/dictionary.js";
|
|
145
|
-
import { R as
|
|
144
|
+
import { R as R6 } from "./components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js";
|
|
146
145
|
import { g as g20 } from "./components/hook-form/RHFAutocompleteAsync/dictionary.js";
|
|
147
|
-
import { R as
|
|
148
|
-
import { R as
|
|
149
|
-
import { R as
|
|
150
|
-
import { R as
|
|
151
|
-
import { R as
|
|
152
|
-
import { R as
|
|
153
|
-
import { R as
|
|
154
|
-
import { R as
|
|
155
|
-
import { R as
|
|
156
|
-
import { R as
|
|
146
|
+
import { R as R7 } from "./components/hook-form/RHFDateTime/RHFDateTime.js";
|
|
147
|
+
import { R as R8 } from "./components/hook-form/RHFMultiCheckbox/index.js";
|
|
148
|
+
import { R as R9 } from "./components/hook-form/RHFSelect/RHFSelect.js";
|
|
149
|
+
import { R as R10 } from "./components/hook-form/RHFHelperError/index.js";
|
|
150
|
+
import { R as R11 } from "./components/hook-form/RHFRadioGroup/RHFRadioGroup.js";
|
|
151
|
+
import { R as R12 } from "./components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js";
|
|
152
|
+
import { R as R13 } from "./components/hook-form/RHFColorPicker/RFHColorPicker.js";
|
|
153
|
+
import { R as R14 } from "./components/hook-form/RHFCheckbox/RHFCheckbox.js";
|
|
154
|
+
import { R as R15 } from "./components/hook-form/RHFTextField/RHFTextField.js";
|
|
155
|
+
import { R as R16 } from "./components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js";
|
|
157
156
|
import { g as g21 } from "./components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js";
|
|
158
157
|
import { r } from "./components/hook-form/RHFPeriod/RHFPeriod.styles.js";
|
|
159
|
-
import { R as
|
|
160
|
-
import { R as
|
|
161
|
-
import { R as
|
|
162
|
-
import { N as N3, P as P6, R as
|
|
163
|
-
import { R as
|
|
164
|
-
import { R as
|
|
158
|
+
import { R as R17 } from "./components/hook-form/RHFPeriod/RHFPeriod.js";
|
|
159
|
+
import { R as R18 } from "./components/hook-form/RHFPeriod/constants.js";
|
|
160
|
+
import { R as R19 } from "./components/hook-form/RHFPeriod/slots/RHFPeriodEnum.js";
|
|
161
|
+
import { N as N3, P as P6, R as R20, S as S7 } from "./components/hook-form/RHFPeriod/slots/RHFPeriodSlots.js";
|
|
162
|
+
import { R as R21 } from "./components/hook-form/RHFNumberInput/RHFNumberInput.js";
|
|
163
|
+
import { R as R22 } from "./components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js";
|
|
165
164
|
import { V as V2, b as b4, a as a9 } from "./components/hook-form/RHFormProvider/types.js";
|
|
166
|
-
import { F as F3, R as
|
|
165
|
+
import { F as F3, R as R23, u as u17 } from "./components/hook-form/RHFormProvider/RHFormProvider.js";
|
|
167
166
|
import { d as d4, a as a10, b as b5, c as c3 } from "./components/hook-form/RHFormProvider/schema.js";
|
|
168
167
|
import { I as I4 } from "./components/Icon/Icon.js";
|
|
169
168
|
import { I as I5 } from "./components/Image/Image.js";
|
|
@@ -374,30 +373,29 @@ export {
|
|
|
374
373
|
P11 as PrintingSystem,
|
|
375
374
|
P as PropagateLoaderSpinner,
|
|
376
375
|
P12 as PropertyValue,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
R4 as RadioButton,
|
|
376
|
+
R5 as RHFAutocomplete,
|
|
377
|
+
R6 as RHFAutocompleteAsync,
|
|
378
|
+
R14 as RHFCheckbox,
|
|
379
|
+
R13 as RHFColorPicker,
|
|
380
|
+
R7 as RHFDateTime,
|
|
381
|
+
R10 as RHFHelperError,
|
|
382
|
+
R8 as RHFMultiCheckbox,
|
|
383
|
+
R21 as RHFNumberInput,
|
|
384
|
+
R17 as RHFPeriod,
|
|
385
|
+
R20 as RHFPeriodRootStyled,
|
|
386
|
+
R19 as RHFPeriodSlots,
|
|
387
|
+
R11 as RHFRadioGroup,
|
|
388
|
+
R9 as RHFSelect,
|
|
389
|
+
R15 as RHFTextField,
|
|
390
|
+
R16 as RHFTextFieldPassword,
|
|
391
|
+
R22 as RHFUploadImage,
|
|
392
|
+
R12 as RHFUploadSingleFile,
|
|
393
|
+
R18 as RHF_PERIOD_KEY_COMPONENT,
|
|
394
|
+
R23 as RHFormProvider,
|
|
397
395
|
R3 as ReactJsonViewer,
|
|
398
396
|
R as Resizable,
|
|
399
397
|
R2 as ResizableBox,
|
|
400
|
-
|
|
398
|
+
R4 as Responsive,
|
|
401
399
|
S21 as SKELETON_SVG_ICON,
|
|
402
400
|
S8 as ScrollBar,
|
|
403
401
|
S as SectionCommercial,
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
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>>;
|
|
@@ -1,20 +0,0 @@
|
|
|
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(
|
|
9
|
-
RadioButton,
|
|
10
|
-
{
|
|
11
|
-
checked,
|
|
12
|
-
size: "small",
|
|
13
|
-
onChange: handleChange,
|
|
14
|
-
...props
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
RadioButtonFormatter as R
|
|
20
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
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>;
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RadioButtonProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Componente RadioButton 🔘
|
|
4
|
-
*
|
|
5
|
-
* Este componente representa un radio button personalizado que puede ser utilizado en formularios y otros lugares donde se necesite una opción de selección única.
|
|
6
|
-
* @param {RadioButtonProps} props - Las propiedades del componente.
|
|
7
|
-
* @param {React.Ref<HTMLButtonElement>} ref - La referencia al elemento raíz del componente.
|
|
8
|
-
* @returns {JSX.Element} El componente RadioButton renderizado.
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <RadioButton
|
|
12
|
-
* size="medium"
|
|
13
|
-
* disabled={false}
|
|
14
|
-
* color="primary"
|
|
15
|
-
* inlineText="Opción 1"
|
|
16
|
-
* mandatory={true}
|
|
17
|
-
* mandatoryMessage="Este campo es obligatorio"
|
|
18
|
-
* helperMessage="Más información"
|
|
19
|
-
* htmlFor="radio-id"
|
|
20
|
-
* error={false}
|
|
21
|
-
* />
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare const RadioButton: import('react').ForwardRefExoticComponent<Omit<RadioButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useId } from "react";
|
|
3
|
-
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
4
|
-
import { R as RadioButtonRootStyled, M as MUIRadioStyled, I as IconStyled, a as IconCheckedStyled, T as TypographyStyled, S as SkeletonStyled } from "./slots/RadioButtonSlots.js";
|
|
5
|
-
import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
|
|
6
|
-
import { R as RADIO_BUTTON_KEY_COMPONENT } from "./constants.js";
|
|
7
|
-
import clsx from "clsx";
|
|
8
|
-
import { p as pathIcons } from "./icons.js";
|
|
9
|
-
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
10
|
-
const RadioButton = forwardRef(
|
|
11
|
-
(props, ref) => {
|
|
12
|
-
const {
|
|
13
|
-
className,
|
|
14
|
-
size = "medium",
|
|
15
|
-
disabled,
|
|
16
|
-
color = "default",
|
|
17
|
-
mandatory,
|
|
18
|
-
mandatoryMessage,
|
|
19
|
-
helperMessage,
|
|
20
|
-
id,
|
|
21
|
-
htmlFor,
|
|
22
|
-
error,
|
|
23
|
-
inlineText,
|
|
24
|
-
checked = false,
|
|
25
|
-
...others
|
|
26
|
-
} = props;
|
|
27
|
-
const { currentSize } = useComponentSize(size);
|
|
28
|
-
const isSkeleton = useModuleSkeleton();
|
|
29
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
30
|
-
const classes = getComponentSlotRoot(RADIO_BUTTON_KEY_COMPONENT);
|
|
31
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
32
|
-
const hookId = useId();
|
|
33
|
-
const finalId = id || hookId;
|
|
34
|
-
const ownerState = {
|
|
35
|
-
disabled,
|
|
36
|
-
color,
|
|
37
|
-
error,
|
|
38
|
-
size,
|
|
39
|
-
checked
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
-
RadioButtonRootStyled,
|
|
43
|
-
{
|
|
44
|
-
ownerState: { ...ownerState },
|
|
45
|
-
className: clsx(className, classes),
|
|
46
|
-
children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
48
|
-
MUIRadioStyled,
|
|
49
|
-
{
|
|
50
|
-
ref,
|
|
51
|
-
ownerState: { ...ownerState },
|
|
52
|
-
disableRipple: true,
|
|
53
|
-
id: finalId,
|
|
54
|
-
checked,
|
|
55
|
-
checkedIcon: /* @__PURE__ */ jsx(
|
|
56
|
-
IconCheckedStyled,
|
|
57
|
-
{
|
|
58
|
-
src: `${host_static_assets}/${environment_assets}/${pathIcons.checked}`,
|
|
59
|
-
size: currentSize,
|
|
60
|
-
color: disabled ? "text.disabled" : error ? "error.enabled" : "primary.enabled",
|
|
61
|
-
ownerState: { ...ownerState }
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
icon: /* @__PURE__ */ jsx(
|
|
65
|
-
IconStyled,
|
|
66
|
-
{
|
|
67
|
-
src: `${host_static_assets}/${environment_assets}/${pathIcons.unchecked}`,
|
|
68
|
-
size: currentSize,
|
|
69
|
-
ownerState: { ...ownerState },
|
|
70
|
-
color: disabled ? "text.disabled" : error ? "error.enabled" : "text.secondary"
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
disabled,
|
|
74
|
-
inputProps: {
|
|
75
|
-
"aria-labelledby": finalId,
|
|
76
|
-
"aria-invalid": error ? "true" : void 0
|
|
77
|
-
},
|
|
78
|
-
...others
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
inlineText && /* @__PURE__ */ jsx(
|
|
82
|
-
TypographyStyled,
|
|
83
|
-
{
|
|
84
|
-
component: "label",
|
|
85
|
-
htmlFor: finalId,
|
|
86
|
-
variant: "body",
|
|
87
|
-
ownerState: { ...ownerState },
|
|
88
|
-
size: adjustedSize,
|
|
89
|
-
disabled,
|
|
90
|
-
ellipsis: true,
|
|
91
|
-
children: inlineText
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
-
/* @__PURE__ */ jsx(SkeletonStyled, { variant: "rounded", className: "radioSkeleton" }),
|
|
96
|
-
inlineText ? /* @__PURE__ */ jsx(
|
|
97
|
-
SkeletonStyled,
|
|
98
|
-
{
|
|
99
|
-
variant: "rectangular",
|
|
100
|
-
className: "radioSkeletonInlineText"
|
|
101
|
-
}
|
|
102
|
-
) : null
|
|
103
|
-
] })
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
export {
|
|
109
|
-
RadioButton as R
|
|
110
|
-
};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
|
-
const radioButtonStyles = {
|
|
3
|
-
/**
|
|
4
|
-
* Estilos generales para el radio button 🟦
|
|
5
|
-
* @param {object} theme - El tema de MUI.
|
|
6
|
-
* @returns {object} - Los estilos aplicados al root del radio button.
|
|
7
|
-
*/
|
|
8
|
-
root: ({ theme }) => ({
|
|
9
|
-
display: "flex",
|
|
10
|
-
alignItems: "center",
|
|
11
|
-
outline: "none",
|
|
12
|
-
overflow: "visible",
|
|
13
|
-
boxSizing: "border-box",
|
|
14
|
-
gap: theme.vars.size.baseSpacings.sp1,
|
|
15
|
-
width: "fit-content"
|
|
16
|
-
}),
|
|
17
|
-
/**
|
|
18
|
-
* Componente MuiRadio, FocusVisible para cuando está seleccionado el RadioButton 🟩
|
|
19
|
-
* @param {object} theme - El tema de MUI.
|
|
20
|
-
* @param {object} ownerState - El estado del componente.
|
|
21
|
-
* @returns {object} - Los estilos aplicados al MuiRadio.
|
|
22
|
-
*/
|
|
23
|
-
muiRadio: ({ theme, ownerState }) => {
|
|
24
|
-
const color = ownerState?.error ? "error" : "primary";
|
|
25
|
-
const opacityColor = ownerState?.error ? "error" : "default";
|
|
26
|
-
return {
|
|
27
|
-
overflow: "visible",
|
|
28
|
-
...getSizeStyles(
|
|
29
|
-
theme,
|
|
30
|
-
ownerState?.size || "medium",
|
|
31
|
-
"action",
|
|
32
|
-
(size) => {
|
|
33
|
-
return {
|
|
34
|
-
width: size,
|
|
35
|
-
height: size
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
borderRadius: theme.size.borderRadius.r4,
|
|
40
|
-
"&:hover": {
|
|
41
|
-
backgroundColor: theme.vars.palette[opacityColor].hoverOpacity
|
|
42
|
-
},
|
|
43
|
-
"&:active": {
|
|
44
|
-
backgroundColor: theme.vars.palette[opacityColor].activeOpacity
|
|
45
|
-
},
|
|
46
|
-
"&.Mui-checked": {
|
|
47
|
-
"&:hover": {
|
|
48
|
-
backgroundColor: theme.vars.palette[color].hoverOpacity,
|
|
49
|
-
"& .M4LIcon-icon": {
|
|
50
|
-
backgroundColor: theme.vars.palette[color].hover
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"&:active": {
|
|
54
|
-
backgroundColor: theme.vars.palette[color].activeOpacity,
|
|
55
|
-
"& .M4LIcon-icon": {
|
|
56
|
-
backgroundColor: theme.vars.palette[color].active
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"&.Mui-focusVisible, &:focus-visible": {
|
|
61
|
-
outline: `1px solid ${theme.vars.palette.primary.focusVisible}`
|
|
62
|
-
},
|
|
63
|
-
...ownerState?.disabled && {
|
|
64
|
-
pointerEvents: ownerState?.disabled ? "none" : "auto",
|
|
65
|
-
"&:hover": {
|
|
66
|
-
pointerEvents: ownerState?.disabled ? "none" : "auto"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* Estilos para el skeleton del RadioButton 📝
|
|
73
|
-
* @param {object} theme - El tema de MUI.
|
|
74
|
-
* @param {object} ownerState - El estado del componente.
|
|
75
|
-
* @returns {object} - Los estilos aplicados al skeletonStyled.
|
|
76
|
-
*/
|
|
77
|
-
skeletonStyled: ({ theme, ownerState }) => {
|
|
78
|
-
return {
|
|
79
|
-
borderRadius: theme.vars.size.borderRadius.r1,
|
|
80
|
-
backgroundColor: theme.vars.palette?.skeleton.default,
|
|
81
|
-
"&.radioSkeleton": {
|
|
82
|
-
...getSizeStyles(
|
|
83
|
-
theme,
|
|
84
|
-
ownerState?.size || "medium",
|
|
85
|
-
"action",
|
|
86
|
-
(size) => {
|
|
87
|
-
return {
|
|
88
|
-
width: size
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
...getSizeStyles(
|
|
93
|
-
theme,
|
|
94
|
-
ownerState?.size || "small",
|
|
95
|
-
"action",
|
|
96
|
-
(size) => {
|
|
97
|
-
return {
|
|
98
|
-
width: size
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
},
|
|
103
|
-
"&.radioSkeletonInlineText": {
|
|
104
|
-
width: theme.vars.size.baseSpacings.sp12,
|
|
105
|
-
borderRadius: theme.vars.size.borderRadius.r1,
|
|
106
|
-
...getSizeStyles(theme, ownerState?.size || "medium", "base"),
|
|
107
|
-
...getSizeStyles(theme, ownerState?.size || "small", "base")
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* Estilos para el inline-text del RadioButton 📝
|
|
113
|
-
*/
|
|
114
|
-
typographyStyled: {},
|
|
115
|
-
/**
|
|
116
|
-
* El estilado de este slot, se hace en muiRadio, debido a que el input absorbe los pseudo selectores, entonces hay que hacerlos desde el nodo padre. 🟨
|
|
117
|
-
*/
|
|
118
|
-
icon: {},
|
|
119
|
-
/**
|
|
120
|
-
* El estilado de este slot, se hace en muiRadio, debido a que el input absorbe los pseudo selectores, entonces hay que hacerlos desde el nodo padre. 🟨
|
|
121
|
-
*/
|
|
122
|
-
iconChecked: {}
|
|
123
|
-
};
|
|
124
|
-
export {
|
|
125
|
-
radioButtonStyles as r
|
|
126
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RADIO_BUTTON_KEY_COMPONENT = "M4LRadioButton";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RadioButton } from './RadioButton';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var RadioButtonSlots = /* @__PURE__ */ ((RadioButtonSlots2) => {
|
|
2
|
-
RadioButtonSlots2["root"] = "root";
|
|
3
|
-
RadioButtonSlots2["muiRadio"] = "muiRadio";
|
|
4
|
-
RadioButtonSlots2["typographyStyled"] = "typographyStyled";
|
|
5
|
-
RadioButtonSlots2["skeletonStyled"] = "skeletonStyled";
|
|
6
|
-
RadioButtonSlots2["iconChecked"] = "iconChecked";
|
|
7
|
-
RadioButtonSlots2["icon"] = "icon";
|
|
8
|
-
return RadioButtonSlots2;
|
|
9
|
-
})(RadioButtonSlots || {});
|
|
10
|
-
export {
|
|
11
|
-
RadioButtonSlots as R
|
|
12
|
-
};
|