@m4l/components 9.3.36 → 9.3.37-JT20251128-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 +3 -0
- package/@types/types.d.ts +33 -6
- package/components/DataGrid/DataGrid.js +2 -0
- package/components/DataGrid/Datagrid.styles.js +11 -2
- package/components/DataGrid/contexts/DataGridContext/index.js +43 -268
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +5 -22
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.d.ts +19 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.js +6 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.test.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/index.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/index.js +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.d.ts +47 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.js +32 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/index.js +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.d.ts +24 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.js +12 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.test.d.ts +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/index.d.ts +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/index.js +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +48 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.js +35 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/index.js +1 -0
- package/components/DataGrid/helpers/getViewMode/getViewMode.d.ts +41 -0
- package/components/DataGrid/helpers/getViewMode/getViewMode.js +19 -0
- package/components/DataGrid/helpers/getViewMode/getViewMode.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewMode/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewMode/index.js +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.d.ts +28 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.js +22 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/index.js +1 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.d.ts +24 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.js +9 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSuffix/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSuffix/index.js +1 -0
- package/components/DataGrid/helpers/index.d.ts +13 -0
- package/components/DataGrid/helpers/index.js +1 -0
- package/components/DataGrid/helpers/loadViewConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/loadViewConfig/index.js +1 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.d.ts +23 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.js +12 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/index.js +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.d.ts +52 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.js +18 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewConfig/index.js +1 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.d.ts +35 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.js +15 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewMode/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewMode/index.js +1 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.d.ts +33 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.js +13 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.test.d.ts +1 -0
- package/components/DataGrid/hooks/index.d.ts +6 -0
- package/components/DataGrid/hooks/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/index.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +9 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.js +27 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.test.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/index.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.d.ts +10 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.js +34 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.test.d.ts +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/index.js +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.d.ts +11 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.js +29 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/hooks/useRowHeight/index.d.ts +1 -0
- package/components/DataGrid/hooks/useRowHeight/index.js +1 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.d.ts +28 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.js +51 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.test.d.ts +1 -0
- package/components/DataGrid/hooks/useViewConfig/index.d.ts +1 -0
- package/components/DataGrid/hooks/useViewConfig/index.js +1 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.d.ts +9 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.js +30 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.test.d.ts +1 -0
- package/components/DataGrid/hooks/useViewMode/index.d.ts +1 -0
- package/components/DataGrid/hooks/useViewMode/index.js +1 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.d.ts +31 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.js +44 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.test.d.ts +1 -0
- package/components/DataGrid/index.d.ts +5 -4
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +15 -7
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +4 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +6 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioButtonFormatter.js +12 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.d.ts +64 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.js +46 -0
- package/components/DataGrid/tests/table/subcomponents/RadioButtonFormatter.test.d.ts +1 -0
- package/components/DataGrid/tests/table/subcomponents/RadioSelectColumn.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +7 -0
- package/components/DataGrid/types.helpers.d.ts +55 -0
- package/components/DataGrid/types.helpers.js +1 -0
- package/components/DataGrid/types.hooks.d.ts +81 -0
- package/components/mui_extended/RadioButton/RadioButton.d.ts +24 -0
- package/components/mui_extended/RadioButton/RadioButton.js +110 -0
- package/components/mui_extended/RadioButton/RadioButton.styles.d.ts +2 -0
- package/components/mui_extended/RadioButton/RadioButton.styles.js +126 -0
- package/components/mui_extended/RadioButton/constants.d.ts +1 -0
- package/components/mui_extended/RadioButton/constants.js +4 -0
- package/components/mui_extended/RadioButton/icons.d.ts +4 -0
- package/components/mui_extended/RadioButton/icons.js +7 -0
- package/components/mui_extended/RadioButton/index.d.ts +1 -0
- package/components/mui_extended/RadioButton/index.js +1 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonEnum.d.ts +8 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonEnum.js +12 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonSlots.d.ts +20 -0
- package/components/mui_extended/RadioButton/slots/RadioButtonSlots.js +39 -0
- package/components/mui_extended/RadioButton/tests/RadioButton.test.d.ts +1 -0
- package/components/mui_extended/RadioButton/types.d.ts +50 -0
- package/components/mui_extended/index.d.ts +1 -0
- package/hooks/useDataGridPersistence/constants.d.ts +1 -0
- package/hooks/useDataGridPersistence/constants.js +4 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +5 -2
- package/index.js +44 -42
- package/package.json +1 -1
|
@@ -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
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RowKey } from './types';
|
|
2
|
+
import { BaseConfigColumn } from './contexts/DataGridContext/types';
|
|
3
|
+
/**
|
|
4
|
+
* Configuración base genérica que puede extenderse con propiedades específicas de cualquier vista.
|
|
5
|
+
*
|
|
6
|
+
* USO INTERNO: El sistema usa esto para manejar genéricamente las configuraciones
|
|
7
|
+
* de columnas sin importar el tipo de vista (table, cards, etc).
|
|
8
|
+
* @example
|
|
9
|
+
* // Para vista table
|
|
10
|
+
* BaseViewConfig<{ frozen: boolean }>
|
|
11
|
+
*
|
|
12
|
+
* // Para vista cards
|
|
13
|
+
* BaseViewConfig<{ showTitle: boolean }>
|
|
14
|
+
*/
|
|
15
|
+
export type BaseViewConfig<TViewSpecific = object> = TViewSpecific & {
|
|
16
|
+
key: string;
|
|
17
|
+
visible: boolean;
|
|
18
|
+
index: number;
|
|
19
|
+
name?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
*Este tipo define la estructura de configuración que el usuario puede
|
|
24
|
+
*pasar al DataGrid para personalizar columnas y sus anchos.
|
|
25
|
+
*
|
|
26
|
+
*- `columnsConfig`: Configuración de visibilidad y orden de columnas para vista table
|
|
27
|
+
*- `columnsWidths`: Anchos personalizados de columnas
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const userConfig: IGridConfig = {
|
|
31
|
+
* columnsConfig: [
|
|
32
|
+
* { key: 'name', visible: true, index: 0, frozen: false },
|
|
33
|
+
* { key: 'email', visible: true, index: 1, frozen: false },
|
|
34
|
+
* ],
|
|
35
|
+
* columnsWidths: { name: 200, email: 300 }
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export interface IGridConfig {
|
|
40
|
+
/** Configuración de columnas para vista table (visibilidad, orden, frozen) */
|
|
41
|
+
columnsConfig: BaseConfigColumn[];
|
|
42
|
+
/** Anchos de columnas en píxeles */
|
|
43
|
+
columnsWidths: Record<RowKey, number>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Configuración específica retornada por getViewSpecificConfig
|
|
47
|
+
*/
|
|
48
|
+
export interface ViewSpecificConfig {
|
|
49
|
+
/** Valores por defecto para propiedades específicas de la vista */
|
|
50
|
+
defaults: Record<string, unknown>;
|
|
51
|
+
/** Valores originales por defecto para tracking de cambios */
|
|
52
|
+
originalDefaults: Record<string, unknown>;
|
|
53
|
+
/** Función para obtener propiedades originales dinámicas de un item */
|
|
54
|
+
dynamicOriginalProperty: (item: unknown) => Record<string, unknown>;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { RowKey, RowHeightVariants, RowHeights, OnChangeUserColumns } from './types';
|
|
2
|
+
import { Maybe } from '@m4l/core';
|
|
3
|
+
import { IViewConfig, RowHeightState, ViewMode } from './contexts/DataGridContext/types';
|
|
4
|
+
export interface UseViewModeParams {
|
|
5
|
+
/** Identificador único del DataGrid */
|
|
6
|
+
id: RowKey;
|
|
7
|
+
/** ViewMode controlado por el padre */
|
|
8
|
+
viewMode?: ViewMode;
|
|
9
|
+
/** ViewMode por defecto cuando no hay valor guardado */
|
|
10
|
+
defaultViewMode?: ViewMode;
|
|
11
|
+
/** Callback cuando cambia el viewMode */
|
|
12
|
+
onViewModeChange?: (viewMode: ViewMode) => void;
|
|
13
|
+
/** Callback para guardar cambios en backend (cookies de red) */
|
|
14
|
+
onChangeUserColumns?: OnChangeUserColumns;
|
|
15
|
+
}
|
|
16
|
+
export interface UseViewModeReturn {
|
|
17
|
+
/** Estado actual del viewMode */
|
|
18
|
+
viewModeState: ViewMode;
|
|
19
|
+
/** Función para establecer el viewMode */
|
|
20
|
+
setViewModeState: React.Dispatch<React.SetStateAction<ViewMode>>;
|
|
21
|
+
/** Función para cambiar el viewMode y persistirlo */
|
|
22
|
+
handleViewModeChange: (newViewMode: ViewMode) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface UseRowHeightParams {
|
|
25
|
+
/** Alturas de las filas (número fijo o array de 3 elementos) */
|
|
26
|
+
rowHeights: RowHeights;
|
|
27
|
+
/** Alturas de los headers (número fijo o array de 3 elementos) */
|
|
28
|
+
rowHeaderHeights: RowHeights;
|
|
29
|
+
/** Variant inicial de altura */
|
|
30
|
+
initialRowHeightVariant: RowHeightVariants;
|
|
31
|
+
}
|
|
32
|
+
export interface UseRowHeightReturn {
|
|
33
|
+
/** Estado actual de la altura de filas */
|
|
34
|
+
currentRowHeightVariant: RowHeightState;
|
|
35
|
+
/** Función para cambiar el variant de altura */
|
|
36
|
+
setRowHeightVariant: (newVariant: RowHeightVariants) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface UseColumnsWidthParams {
|
|
39
|
+
/** Identificador único del DataGrid */
|
|
40
|
+
id: RowKey;
|
|
41
|
+
/** Callback para guardar cambios en columnas */
|
|
42
|
+
onChangeUserColumns?: OnChangeUserColumns;
|
|
43
|
+
}
|
|
44
|
+
export interface UseColumnsWidthReturn {
|
|
45
|
+
/** Mapa con el ancho de cada columna */
|
|
46
|
+
columnsWidths: Map<string, Maybe<string | number>>;
|
|
47
|
+
/** Función para establecer el mapa de anchos */
|
|
48
|
+
setColumnsWidths: React.Dispatch<React.SetStateAction<Map<string, Maybe<string | number>>>>;
|
|
49
|
+
/** Función para cambiar el ancho de una columna */
|
|
50
|
+
onChangeColumnWidth: (columnKey: string, width: number) => void;
|
|
51
|
+
}
|
|
52
|
+
export interface UseViewConfigReturn {
|
|
53
|
+
/** Estado de configuración por vista */
|
|
54
|
+
viewConfig: Record<ViewMode, IViewConfig<any, any>[]>;
|
|
55
|
+
/** Obtiene la configuración de columnas para una vista */
|
|
56
|
+
getConfigColumns: (viewMode: ViewMode) => IViewConfig<any, any>[];
|
|
57
|
+
/** Actualiza la configuración de columnas para una vista */
|
|
58
|
+
updateConfigColumns: (viewMode: ViewMode, config: IViewConfig<any, any>[]) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface UseChangeColumnsConfigParams {
|
|
61
|
+
/** Identificador único del DataGrid */
|
|
62
|
+
id: RowKey;
|
|
63
|
+
/** Callback para guardar cambios en columnas */
|
|
64
|
+
onChangeUserColumns?: OnChangeUserColumns;
|
|
65
|
+
/** Función para actualizar la configuración de columnas */
|
|
66
|
+
updateConfigColumns: (viewMode: ViewMode, config: IViewConfig<any, any>[]) => void;
|
|
67
|
+
}
|
|
68
|
+
export interface UseChangeColumnsConfigReturn {
|
|
69
|
+
/** Función para cambiar la configuración de columnas de una vista */
|
|
70
|
+
onChangeColumnsConfig: (viewMode: ViewMode, newConfig: IViewConfig<any, any>[]) => void;
|
|
71
|
+
}
|
|
72
|
+
export interface UseChangeColumnsOrderParams {
|
|
73
|
+
/** Función para obtener la configuración de columnas de una vista */
|
|
74
|
+
getConfigColumns: (viewMode: ViewMode) => IViewConfig<any, any>[];
|
|
75
|
+
/** Función para cambiar la configuración de columnas */
|
|
76
|
+
onChangeColumnsConfig: (viewMode: ViewMode, newConfig: IViewConfig<any, any>[]) => void;
|
|
77
|
+
}
|
|
78
|
+
export interface UseChangeColumnsOrderReturn {
|
|
79
|
+
/** Función para cambiar el orden de columnas de una vista */
|
|
80
|
+
onChangeColumnsOrder: (viewMode: ViewMode, sourceKey: string, targetKey: string) => void;
|
|
81
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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>>;
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RADIO_BUTTON_KEY_COMPONENT = "M4LRadioButton";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioButton } from './RadioButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const RadioButtonRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: (Partial<import('../types').RadioButtonOwnerState> & Record<string, unknown>) | undefined;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const MUIRadioStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').RadioProps, keyof import('@mui/material').RadioProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('../types').RadioButtonOwnerState> & Record<string, unknown>) | undefined;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const TypographyStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../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').Theme> & Record<string, unknown> & {
|
|
8
|
+
ownerState?: (Partial<import('../types').RadioButtonOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
11
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
12
|
+
}, "children" | "style" | "variant" | "width" | "height" | "animation" | "className" | "classes" | "sx">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "width" | "height" | "translate" | "animation" | "className" | "classes" | "sx" | "slot" | "key" | "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"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
13
|
+
ownerState?: (Partial<import('../types').RadioButtonOwnerState> & Record<string, unknown>) | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
export declare const IconCheckedStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
16
|
+
ownerState?: (Partial<import('../types').RadioButtonOwnerState> & Record<string, unknown>) | undefined;
|
|
17
|
+
}, {}, {}>;
|
|
18
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
19
|
+
ownerState?: (Partial<import('../types').RadioButtonOwnerState> & Record<string, unknown>) | undefined;
|
|
20
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { Radio, Skeleton } from "@mui/material";
|
|
3
|
+
import { R as RadioButtonSlots } from "./RadioButtonEnum.js";
|
|
4
|
+
import { R as RADIO_BUTTON_KEY_COMPONENT } from "../constants.js";
|
|
5
|
+
import { r as radioButtonStyles } from "../RadioButton.styles.js";
|
|
6
|
+
import { T as Typography } from "../../Typography/Typography.js";
|
|
7
|
+
import { I as Icon } from "../../../Icon/Icon.js";
|
|
8
|
+
const RadioButtonRootStyled = styled("div", {
|
|
9
|
+
name: RADIO_BUTTON_KEY_COMPONENT,
|
|
10
|
+
slot: RadioButtonSlots.root
|
|
11
|
+
})(radioButtonStyles.root);
|
|
12
|
+
const MUIRadioStyled = styled(Radio, {
|
|
13
|
+
name: RADIO_BUTTON_KEY_COMPONENT,
|
|
14
|
+
slot: RadioButtonSlots.muiRadio
|
|
15
|
+
})(radioButtonStyles.muiRadio);
|
|
16
|
+
const TypographyStyled = styled(Typography, {
|
|
17
|
+
name: RADIO_BUTTON_KEY_COMPONENT,
|
|
18
|
+
slot: RadioButtonSlots.typographyStyled
|
|
19
|
+
})(radioButtonStyles.typographyStyled);
|
|
20
|
+
const SkeletonStyled = styled(Skeleton, {
|
|
21
|
+
name: RADIO_BUTTON_KEY_COMPONENT,
|
|
22
|
+
slot: RadioButtonSlots.skeletonStyled
|
|
23
|
+
})(radioButtonStyles.skeletonStyled);
|
|
24
|
+
const IconCheckedStyled = styled(Icon, {
|
|
25
|
+
name: RADIO_BUTTON_KEY_COMPONENT,
|
|
26
|
+
slot: RadioButtonSlots.iconChecked
|
|
27
|
+
})(radioButtonStyles.iconChecked);
|
|
28
|
+
const IconStyled = styled(Icon, {
|
|
29
|
+
name: RADIO_BUTTON_KEY_COMPONENT,
|
|
30
|
+
slot: RadioButtonSlots.icon
|
|
31
|
+
})(radioButtonStyles.icon);
|
|
32
|
+
export {
|
|
33
|
+
IconStyled as I,
|
|
34
|
+
MUIRadioStyled as M,
|
|
35
|
+
RadioButtonRootStyled as R,
|
|
36
|
+
SkeletonStyled as S,
|
|
37
|
+
TypographyStyled as T,
|
|
38
|
+
IconCheckedStyled as a
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { RadioProps as MUIRadioProps, Theme } from '@mui/material';
|
|
2
|
+
import { RadioButtonSlots } from './slots/RadioButtonEnum';
|
|
3
|
+
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
4
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
5
|
+
import { RADIO_BUTTON_KEY_COMPONENT } from './constants';
|
|
6
|
+
import { LabelProps } from '../../Label/types';
|
|
7
|
+
export interface RadioButtonProps extends MUIRadioProps, Omit<LabelProps, 'label' | 'size'> {
|
|
8
|
+
/**
|
|
9
|
+
* El texto que se muestra junto al radio button
|
|
10
|
+
*/
|
|
11
|
+
inlineText?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Tamaño
|
|
14
|
+
*/
|
|
15
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
16
|
+
/**
|
|
17
|
+
* Color
|
|
18
|
+
*/
|
|
19
|
+
color?: Extract<ComponentPalletColor, 'default'>;
|
|
20
|
+
}
|
|
21
|
+
export interface RadioButtonOwnerState {
|
|
22
|
+
/**
|
|
23
|
+
* Indica si el RadioButton está marcado.
|
|
24
|
+
*/
|
|
25
|
+
checked?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Indica si el RadioButton está deshabilitado.
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* El tamaño del RadioButton.
|
|
32
|
+
*/
|
|
33
|
+
size: Extract<Sizes, 'small' | 'medium'>;
|
|
34
|
+
/**
|
|
35
|
+
* El color del RadioButton.
|
|
36
|
+
*/
|
|
37
|
+
color: Extract<ComponentPalletColor, 'default'>;
|
|
38
|
+
/**
|
|
39
|
+
* Indica si hay un error en el RadioButton.
|
|
40
|
+
*/
|
|
41
|
+
error?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Tipos de slots de RadioButton
|
|
45
|
+
*/
|
|
46
|
+
export type RadioButtonSlotsType = keyof typeof RadioButtonSlots;
|
|
47
|
+
/**
|
|
48
|
+
* Estilos del RadioButton
|
|
49
|
+
*/
|
|
50
|
+
export type RadioButtonStyles = M4LOverridesStyleRules<RadioButtonSlotsType, typeof RADIO_BUTTON_KEY_COMPONENT, Theme>;
|
|
@@ -8,6 +8,7 @@ export { Breadcrumbs } from './Breadcrumbs';
|
|
|
8
8
|
export type { TLink } from './Breadcrumbs/types';
|
|
9
9
|
export * from './Button/Button';
|
|
10
10
|
export * from './CheckBox';
|
|
11
|
+
export * from './RadioButton';
|
|
11
12
|
export { CircularProgress } from './CircularProgress';
|
|
12
13
|
export { Badge } from './Badge';
|
|
13
14
|
export * from './ImageButton/ImageButton';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const COOKIE_COLUMNS_WIDTHS = "columns_widths";
|
|
2
2
|
const COOKIE_COLUMNS_CONFIG = "columns_config";
|
|
3
|
+
const COOKIE_VIEW_MODE = "view_mode";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
COOKIE_VIEW_MODE as C,
|
|
6
|
+
COOKIE_COLUMNS_CONFIG as a,
|
|
7
|
+
COOKIE_COLUMNS_WIDTHS as b
|
|
6
8
|
};
|