@m4l/components 9.1.77 → 9.1.78
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/types.d.ts +11 -2
- package/components/HelperError/HelperError.d.ts +1 -1
- package/components/HelperError/HelperError.js +16 -21
- package/components/HelperError/HelperError.styles.js +25 -15
- package/components/HelperError/constant.d.ts +0 -1
- package/components/HelperError/constant.js +0 -2
- package/components/HelperError/slots/HelperErrorSlots.js +2 -1
- package/components/HelperError/types.d.ts +6 -10
- package/components/Label/Label.js +1 -1
- package/components/Label/Label.styles.js +62 -19
- package/components/Label/types.d.ts +1 -0
- package/components/hook-form/RHFCheckbox/RHFCheckBox.styles.d.ts +2 -0
- package/components/hook-form/RHFCheckbox/RHFCheckBox.styles.js +31 -0
- package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +2 -2
- package/components/hook-form/RHFCheckbox/RHFCheckbox.js +57 -67
- package/components/hook-form/RHFCheckbox/constants.d.ts +2 -0
- package/components/hook-form/RHFCheckbox/constants.js +7 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxEnum.d.ts +6 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxEnum.js +10 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +4 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.js +28 -0
- package/components/hook-form/RHFCheckbox/slots/index.d.ts +2 -0
- package/components/hook-form/RHFCheckbox/types.d.ts +33 -5
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.js +1 -1
- package/components/mui_extended/CheckBox/CheckBox.d.ts +2 -2
- package/components/mui_extended/CheckBox/CheckBox.js +4 -3
- package/components/mui_extended/CheckBox/CheckBox.styles.js +64 -15
- package/components/mui_extended/CheckBox/types.d.ts +31 -6
- package/package.json +1 -1
- package/components/HelperError/HelperError.stories.d.ts +0 -13
- package/components/hook-form/RHFCheckbox/classes/index.d.ts +0 -12
- package/components/hook-form/RHFCheckbox/classes/index.js +0 -44
- package/components/hook-form/RHFCheckbox/classes/types.d.ts +0 -12
- package/components/hook-form/RHFCheckbox/styles.d.ts +0 -6
- package/components/hook-form/RHFCheckbox/styles.js +0 -24
- package/components/hook-form/RHFCheckbox/test/constants.d.ts +0 -4
- package/components/hook-form/RHFCheckbox/test/constants.js +0 -4
- package/components/hook-form/RHFCheckbox/test/utils.d.ts +0 -2
- package/components/hook-form/RHFCheckbox/test/utils.js +0 -7
package/@types/types.d.ts
CHANGED
|
@@ -142,6 +142,7 @@ import { PropagateLoaderSpinnerOwnerState, PropagateLoaderSpinnerType } from '..
|
|
|
142
142
|
import { LinearProgressIndeterminateOwnerState, LinearProgressIndeterminateType } from '../components/LinearProgressIndeterminate/types';
|
|
143
143
|
import { MenuDividerOwnerState, MenuDividerSlotsType } from '../components/mui_extended/MenuDivider/types';
|
|
144
144
|
import { RHFSelectSlotsType, RHFSelectOwnerState } from '../components/hook-form/RHFSelect/types';
|
|
145
|
+
import { RHFCheckBoxOwnerState, RHFCheckBoxSlotsType } from '../components/hook-form/RHFCheckbox/types';
|
|
145
146
|
|
|
146
147
|
declare module '@mui/material/styles' {
|
|
147
148
|
// Define the slots in the theme
|
|
@@ -191,6 +192,7 @@ declare module '@mui/material/styles' {
|
|
|
191
192
|
M4LToggleButton: ToggleButtonSlotsType;
|
|
192
193
|
M4LBooleanFormatter: PresentationType;
|
|
193
194
|
M4LToggleIconButton: ToggleIconButtonSlotsType;
|
|
195
|
+
M4LRHFCheckBox: RHFCheckBoxSlotsType;
|
|
194
196
|
M4LTabs: TabsSlotsType;
|
|
195
197
|
RHFM4LAutocomplete: RHFAutocompleteSlotsType;
|
|
196
198
|
M4LAccountPopover: AccountPopoverSlotsType;
|
|
@@ -247,6 +249,7 @@ declare module '@mui/material/styles' {
|
|
|
247
249
|
M4LToggleButton: Partial<ToggleButtonOwnerState>;
|
|
248
250
|
M4LBooleanFormatter: Partial<BooleanFormatterOwnerState>;
|
|
249
251
|
M4LToggleIconButton: Partial<ToggleIconButtonOwnerState>;
|
|
252
|
+
M4LRHFCheckBox: Partial<RHFCheckBoxOwnerState>;
|
|
250
253
|
M4LTabs: Partial<TabsOwnerState>;
|
|
251
254
|
RHFM4LAutocomplete: Partial<RHFAutocompleteOwnerState>;
|
|
252
255
|
M4LAccountPopover: Partial<AccountPopoverOwnerState>;
|
|
@@ -481,6 +484,11 @@ declare module '@mui/material/styles' {
|
|
|
481
484
|
styleOverrides?: ComponentsOverrides<Theme>['M4LPropertyValue'];
|
|
482
485
|
variants?: ComponentsVariants['M4LPropertyValue'];
|
|
483
486
|
};
|
|
487
|
+
M4LRHFCheckBox?: {
|
|
488
|
+
defaultProps?: ComponentsPropsList['M4LRHFCheckBox'];
|
|
489
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFCheckBox'];
|
|
490
|
+
variants?: ComponentsVariants['M4LRHFCheckBox'];
|
|
491
|
+
};
|
|
484
492
|
M4LTabs?: {
|
|
485
493
|
defaultProps?: ComponentsPropsList['M4LTabs'];
|
|
486
494
|
styleOverrides?: ComponentsOverrides<Theme>['M4LTabs'];
|
|
@@ -525,11 +533,12 @@ declare module '@mui/material/styles' {
|
|
|
525
533
|
defaultProps?: ComponentsPropsList['M4LMenuDivider'];
|
|
526
534
|
styleOverrides?: ComponentsOverrides<Theme>['M4LMenuDivider'];
|
|
527
535
|
variants?: ComponentsVariants['M4LMenuDivider'];
|
|
528
|
-
|
|
536
|
+
};
|
|
537
|
+
|
|
529
538
|
M4LRHFSelect?: {
|
|
530
539
|
defaultProps?: ComponentsPropsList['M4LRHFSelect'];
|
|
531
540
|
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFSelect'];
|
|
532
541
|
variants?: ComponentsVariants['M4LRHFSelect'];
|
|
533
542
|
};
|
|
534
|
-
|
|
543
|
+
}
|
|
535
544
|
}
|
|
@@ -10,4 +10,4 @@ import { HelperErrorProps } from './types';
|
|
|
10
10
|
* @updatedAt 2025-01-08 10:36:40 - automatic
|
|
11
11
|
* @updatedUser Andrés Quintero - automatic
|
|
12
12
|
*/
|
|
13
|
-
export declare const HelperError: (
|
|
13
|
+
export declare const HelperError: import('react').ForwardRefExoticComponent<HelperErrorProps & import('react').RefAttributes<HTMLLabelElement>>;
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
|
-
import { H as HELPER_ERROR_KEY_COMPONENT, c as classHelperErrorRoot
|
|
5
|
+
import { H as HELPER_ERROR_KEY_COMPONENT, c as classHelperErrorRoot } from "./constant.js";
|
|
6
6
|
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
7
|
-
import { T as TypographyStyled } from "./slots/HelperErrorSlots.js";
|
|
8
|
-
const HelperError = (props)
|
|
9
|
-
const { message = "",
|
|
7
|
+
import { T as TypographyStyled, S as SkeletonStyled } from "./slots/HelperErrorSlots.js";
|
|
8
|
+
const HelperError = forwardRef(function HelperError2(props, ref) {
|
|
9
|
+
const { message = "", size = "medium", className, ...other } = props;
|
|
10
|
+
const isSkeleton = useModuleSkeleton();
|
|
10
11
|
const { currentSize } = useComponentSize(size);
|
|
11
12
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
const paletteColor = getPropertyByString(
|
|
14
|
-
theme.palette,
|
|
15
|
-
"error",
|
|
16
|
-
theme.palette.default
|
|
17
|
-
);
|
|
18
13
|
const ownerState = {
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
size,
|
|
15
|
+
color: "error"
|
|
21
16
|
};
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
+
return /* @__PURE__ */ jsx(Fragment, { children: !isSkeleton ? /* @__PURE__ */ jsx(
|
|
23
18
|
TypographyStyled,
|
|
24
19
|
{
|
|
20
|
+
ref,
|
|
25
21
|
"aria-errormessage": HELPER_ERROR_KEY_COMPONENT,
|
|
26
|
-
className: clsx(classHelperErrorRoot,
|
|
27
|
-
ownerState: { ...ownerState
|
|
22
|
+
className: clsx(classHelperErrorRoot, className),
|
|
23
|
+
ownerState: { ...ownerState },
|
|
28
24
|
size: adjustedSize,
|
|
29
25
|
variant: "body",
|
|
30
|
-
skeletonWidth,
|
|
31
26
|
component: "label",
|
|
32
27
|
...other,
|
|
33
28
|
children: message
|
|
34
29
|
}
|
|
35
|
-
);
|
|
36
|
-
};
|
|
30
|
+
) : /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "text" }) });
|
|
31
|
+
});
|
|
37
32
|
export {
|
|
38
33
|
HelperError as H
|
|
39
34
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
|
|
2
2
|
const helperErrorStyles = {
|
|
3
3
|
/**
|
|
4
4
|
* Estilos para el slot del root HelperError
|
|
@@ -8,13 +8,19 @@ const helperErrorStyles = {
|
|
|
8
8
|
* @updatedUser Andrés Quintero - automatic
|
|
9
9
|
*/
|
|
10
10
|
root: ({ theme, ownerState }) => ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
...
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
"&.MuiTypography-root": {
|
|
12
|
+
"&.M4lclassCssSpecificity": {
|
|
13
|
+
color: theme.vars.palette.error.enabled,
|
|
14
|
+
...getTypographyStyles(
|
|
15
|
+
theme.generalSettings.isMobile,
|
|
16
|
+
ownerState.size || "medium",
|
|
17
|
+
"body"
|
|
18
|
+
),
|
|
19
|
+
...getTypographyStyles(
|
|
20
|
+
theme.generalSettings.isMobile,
|
|
21
|
+
ownerState.size || "small",
|
|
22
|
+
"body"
|
|
23
|
+
)
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
}),
|
|
@@ -26,13 +32,17 @@ const helperErrorStyles = {
|
|
|
26
32
|
* @updatedUser Andrés Quintero - automatic
|
|
27
33
|
*/
|
|
28
34
|
skeletonStyled: ({ theme, ownerState }) => ({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
width: theme.vars.size.baseSpacings.sp14,
|
|
36
|
+
...getTypographyStyles(
|
|
37
|
+
theme.generalSettings.isMobile,
|
|
38
|
+
ownerState.size || "medium",
|
|
39
|
+
"body"
|
|
40
|
+
),
|
|
41
|
+
...getTypographyStyles(
|
|
42
|
+
theme.generalSettings.isMobile,
|
|
43
|
+
ownerState.size || "small",
|
|
44
|
+
"body"
|
|
45
|
+
),
|
|
36
46
|
variants: []
|
|
37
47
|
})
|
|
38
48
|
};
|
|
@@ -7,5 +7,4 @@ export declare const HELPER_ERROR_KEY_COMPONENT = "M4LHelperError";
|
|
|
7
7
|
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
8
8
|
* tener la necesidad de agregar valores en !important.
|
|
9
9
|
*/
|
|
10
|
-
export declare const HELPER_ERROR_CLASS_SPECIFY = "M4lclassCssSpecificity";
|
|
11
10
|
export declare const classHelperErrorRoot: string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
2
2
|
const HELPER_ERROR_KEY_COMPONENT = "M4LHelperError";
|
|
3
|
-
const HELPER_ERROR_CLASS_SPECIFY = "M4lclassCssSpecificity";
|
|
4
3
|
const classHelperErrorRoot = getComponentSlotRoot(HELPER_ERROR_KEY_COMPONENT);
|
|
5
4
|
export {
|
|
6
5
|
HELPER_ERROR_KEY_COMPONENT as H,
|
|
7
|
-
HELPER_ERROR_CLASS_SPECIFY as a,
|
|
8
6
|
classHelperErrorRoot as c
|
|
9
7
|
};
|
|
@@ -8,10 +8,11 @@ const TypographyStyled = styled(Typography, {
|
|
|
8
8
|
name: HELPER_ERROR_KEY_COMPONENT,
|
|
9
9
|
slot: HelperErrorSlots.root
|
|
10
10
|
})(helperErrorStyles?.root);
|
|
11
|
-
styled(Skeleton, {
|
|
11
|
+
const SkeletonStyled = styled(Skeleton, {
|
|
12
12
|
name: HELPER_ERROR_KEY_COMPONENT,
|
|
13
13
|
slot: HelperErrorSlots.skeletonStyled
|
|
14
14
|
})(helperErrorStyles?.skeletonStyled);
|
|
15
15
|
export {
|
|
16
|
+
SkeletonStyled as S,
|
|
16
17
|
TypographyStyled as T
|
|
17
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
2
|
import { TypographyProps } from '../mui_extended/Typography/types';
|
|
3
3
|
import { HELPER_ERROR_KEY_COMPONENT } from './constant';
|
|
4
4
|
import { HelperErrorSlots } from './slots';
|
|
@@ -28,21 +28,17 @@ export interface HelperErrorProps extends Pick<TypographyProps, 'skeletonWidth'
|
|
|
28
28
|
*/
|
|
29
29
|
export interface HelperErrorOwnerState {
|
|
30
30
|
/**
|
|
31
|
-
* Color de la paleta del
|
|
31
|
+
* Color de la paleta del texto.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
color?: Extract<ComponentPalletColor, 'error'>;
|
|
34
34
|
/**
|
|
35
35
|
* Color de la paleta del componente del campo de texto.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
componentPaletteColor?: ComponentPalletColor;
|
|
38
38
|
/**
|
|
39
39
|
* Tamaño del campo de texto.
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Indica si el campo de texto es error.
|
|
44
|
-
*/
|
|
45
|
-
helperStateError?: boolean;
|
|
41
|
+
size: Extract<Sizes, 'small' | 'medium'>;
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
48
44
|
* Define los tipos de slots disponibles en HelperError utilizando las claves de HelperErrorSlots.
|
|
@@ -51,4 +47,4 @@ export type HelperErrorSlotsType = keyof typeof HelperErrorSlots;
|
|
|
51
47
|
/**
|
|
52
48
|
* Define los estilos personalizables para HelperError, permitiendo la sobrescritura de estilos por defecto.
|
|
53
49
|
*/
|
|
54
|
-
export type HelperErrorStyles =
|
|
50
|
+
export type HelperErrorStyles = OverridesStyleRules<HelperErrorSlotsType, typeof HELPER_ERROR_KEY_COMPONENT, Theme>;
|
|
@@ -57,7 +57,7 @@ const Label = (props) => {
|
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
-
/* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "
|
|
60
|
+
/* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "rectangular", className: "SkeletonWidthLabel" }),
|
|
61
61
|
mandatory && /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "circular", className: "MandatoryLabel" }),
|
|
62
62
|
helperMessage && /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: { ...ownerState }, variant: "circular", className: "HelperIconLabel" })
|
|
63
63
|
] })
|
|
@@ -2,7 +2,10 @@ import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
|
|
|
2
2
|
import { g as getHeightSizeStyles } from "../../utils/getHeightSizeStyles.js";
|
|
3
3
|
const labelStyles = {
|
|
4
4
|
/**
|
|
5
|
-
* Estilos para el contenedor raíz del Label
|
|
5
|
+
* Estilos para el contenedor raíz del Label 🏷️
|
|
6
|
+
* @param {object} theme - El tema de MUI.
|
|
7
|
+
* @param {object} ownerState - El estado del componente.
|
|
8
|
+
* @returns {object} - Los estilos aplicados al root del Label.
|
|
6
9
|
* @author Bruce Escobar - automatic
|
|
7
10
|
* @createdAt 2024-10-22 09:34:39 - automatic
|
|
8
11
|
* @updatedAt 2025-01-08 10:36:40 - automatic
|
|
@@ -10,22 +13,21 @@ const labelStyles = {
|
|
|
10
13
|
*/
|
|
11
14
|
root: ({ theme, ownerState }) => ({
|
|
12
15
|
display: "flex",
|
|
13
|
-
|
|
16
|
+
flexDirection: "row",
|
|
14
17
|
alignItems: "center",
|
|
15
18
|
flexWrap: "wrap",
|
|
16
19
|
width: "fit-content",
|
|
17
|
-
...getHeightSizeStyles(
|
|
18
|
-
theme.generalSettings.isMobile,
|
|
19
|
-
ownerState.size || "small",
|
|
20
|
-
"base"
|
|
21
|
-
),
|
|
22
20
|
gap: theme.size.baseSpacings.sp1,
|
|
21
|
+
/** Estilos para el estado disabled del Label 😶🌫️ */
|
|
23
22
|
...ownerState.disabled && {
|
|
24
23
|
color: theme.vars.palette.text.disabled
|
|
25
24
|
}
|
|
26
25
|
}),
|
|
27
26
|
/**
|
|
28
|
-
* Estilos para el slot Typography del Label
|
|
27
|
+
* Estilos para el slot Typography del Label 📝
|
|
28
|
+
* @param {object} theme - El tema de MUI.
|
|
29
|
+
* @param {object} ownerState - El estado del componente.
|
|
30
|
+
* @returns {object} - Los estilos aplicados al Typography del Label.
|
|
29
31
|
*/
|
|
30
32
|
typographyStyled: ({ theme, ownerState }) => ({
|
|
31
33
|
"&.MuiTypography-root": {
|
|
@@ -48,7 +50,10 @@ const labelStyles = {
|
|
|
48
50
|
}
|
|
49
51
|
}),
|
|
50
52
|
/**
|
|
51
|
-
* Estilos para el slot Typography del mensaje obligatorio del Label
|
|
53
|
+
* Estilos para el slot Typography del mensaje obligatorio del Label ❗
|
|
54
|
+
* @param {object} theme - El tema de MUI.
|
|
55
|
+
* @param {object} ownerState - El estado del componente.
|
|
56
|
+
* @returns {object} - Los estilos aplicados al Typography del mensaje obligatorio del Label.
|
|
52
57
|
*/
|
|
53
58
|
typographyMandatoryMessageStyled: ({ theme, ownerState }) => ({
|
|
54
59
|
"&.MuiTypography-root": {
|
|
@@ -71,7 +76,10 @@ const labelStyles = {
|
|
|
71
76
|
}
|
|
72
77
|
}),
|
|
73
78
|
/**
|
|
74
|
-
* Estilos para el slot Icon del Label
|
|
79
|
+
* Estilos para el slot Icon del Label 🛠️
|
|
80
|
+
* @param {object} theme - El tema de MUI.
|
|
81
|
+
* @param {object} ownerState - El estado del componente.
|
|
82
|
+
* @returns {object} - Los estilos aplicados al Icon del Label.
|
|
75
83
|
*/
|
|
76
84
|
iconHelperMessageStyled: ({ theme, ownerState }) => ({
|
|
77
85
|
borderRadius: theme.vars.size.borderRadius.r1,
|
|
@@ -85,10 +93,18 @@ const labelStyles = {
|
|
|
85
93
|
theme.generalSettings.isMobile,
|
|
86
94
|
ownerState.size || "small",
|
|
87
95
|
"base"
|
|
96
|
+
),
|
|
97
|
+
...getHeightSizeStyles(
|
|
98
|
+
theme.generalSettings.isMobile,
|
|
99
|
+
ownerState.size || "medium",
|
|
100
|
+
"base"
|
|
88
101
|
)
|
|
89
102
|
}),
|
|
90
103
|
/**
|
|
91
|
-
* Estilos para el slot Skeleton del Label
|
|
104
|
+
* Estilos para el slot Skeleton del Label 💀
|
|
105
|
+
* @param {object} theme - El tema de MUI.
|
|
106
|
+
* @param {object} ownerState - El estado del componente.
|
|
107
|
+
* @returns {object} - Los estilos aplicados al Skeleton del Label.
|
|
92
108
|
*/
|
|
93
109
|
skeletonStyled: ({ ownerState, theme }) => ({
|
|
94
110
|
width: "100%",
|
|
@@ -99,27 +115,54 @@ const labelStyles = {
|
|
|
99
115
|
...getHeightSizeStyles(
|
|
100
116
|
theme.generalSettings.isMobile,
|
|
101
117
|
ownerState.size || "medium",
|
|
102
|
-
"
|
|
118
|
+
"base"
|
|
103
119
|
),
|
|
104
120
|
...getHeightSizeStyles(
|
|
105
121
|
theme.generalSettings.isMobile,
|
|
106
122
|
ownerState.size || "small",
|
|
107
|
-
"
|
|
123
|
+
"base"
|
|
108
124
|
),
|
|
109
125
|
"&.MandatoryLabel": {
|
|
110
126
|
width: theme.vars.size.baseSpacings["sp0-5"],
|
|
111
|
-
|
|
112
|
-
|
|
127
|
+
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
128
|
+
paddingRight: theme.vars.size.baseSpacings.sp1
|
|
113
129
|
},
|
|
114
130
|
"&.SkeletonWidthLabel": {
|
|
115
131
|
width: theme.vars.size.baseSpacings.sp14,
|
|
116
|
-
borderRadius: theme.vars.size.borderRadius.r1
|
|
132
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
133
|
+
...getHeightSizeStyles(
|
|
134
|
+
theme.generalSettings.isMobile,
|
|
135
|
+
ownerState.size || "medium",
|
|
136
|
+
"base"
|
|
137
|
+
),
|
|
138
|
+
...getHeightSizeStyles(
|
|
139
|
+
theme.generalSettings.isMobile,
|
|
140
|
+
ownerState.size || "small",
|
|
141
|
+
"base"
|
|
142
|
+
)
|
|
117
143
|
},
|
|
118
144
|
"&.HelperIconLabel": {
|
|
119
|
-
width: theme.vars.size.baseSpacings.sp2,
|
|
120
145
|
borderRadius: theme.vars.size.borderRadius.r4,
|
|
121
|
-
|
|
122
|
-
|
|
146
|
+
...getHeightSizeStyles(
|
|
147
|
+
theme.generalSettings.isMobile,
|
|
148
|
+
ownerState.size || "small",
|
|
149
|
+
"base",
|
|
150
|
+
(val) => {
|
|
151
|
+
return {
|
|
152
|
+
width: val
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
...getHeightSizeStyles(
|
|
157
|
+
theme.generalSettings.isMobile,
|
|
158
|
+
ownerState.size || "medium",
|
|
159
|
+
"base",
|
|
160
|
+
(val) => {
|
|
161
|
+
return {
|
|
162
|
+
width: val
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
)
|
|
123
166
|
}
|
|
124
167
|
})
|
|
125
168
|
};
|
|
@@ -32,6 +32,7 @@ export interface LabelProps extends Pick<TypographyProps, 'skeletonWidth'> {
|
|
|
32
32
|
error?: boolean;
|
|
33
33
|
/** Indica si el componente está deshabilitado. */
|
|
34
34
|
disabled?: boolean;
|
|
35
|
+
/** Indica si el componente está deshabilitado. */
|
|
35
36
|
helperText?: string;
|
|
36
37
|
}
|
|
37
38
|
export type OwnerState = Pick<LabelProps, 'size'>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const rhfCheckBoxStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Estilo raíz del componente 🏠
|
|
4
|
+
* @param {object} theme - El tema de MUI.
|
|
5
|
+
* @returns {object} - Los estilos aplicados al root del componente.
|
|
6
|
+
*/
|
|
7
|
+
root: ({ theme }) => ({
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
gap: theme.vars.size.baseSpacings["sp0-5"]
|
|
11
|
+
}),
|
|
12
|
+
/**
|
|
13
|
+
* Estilo del CheckBox ✅
|
|
14
|
+
*/
|
|
15
|
+
checkBox: {},
|
|
16
|
+
/**
|
|
17
|
+
* Estilo del Label de Checkbox 🏷️
|
|
18
|
+
* @returns {object} - Los estilos aplicados al Label del Checkbox.
|
|
19
|
+
*/
|
|
20
|
+
labelComponent: () => ({}),
|
|
21
|
+
/**
|
|
22
|
+
* Estilo del contenedor de Typography del CheckBox 📝
|
|
23
|
+
* @returns {object} - Los estilos aplicados al contenedor de Typography del CheckBox.
|
|
24
|
+
*/
|
|
25
|
+
containerCheckTypography: () => ({
|
|
26
|
+
"&.MuiSkeleton-root": {}
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
rhfCheckBoxStyles as r
|
|
31
|
+
};
|
|
@@ -5,6 +5,6 @@ import { RHFCheckboxProps } from './types';
|
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* El RHFCheckbox es un componente de checkbox que se integra con react-hook-form para manejar formularios en React. Proporciona características adicionales como validación, mensajes de ayuda, y soporte para un estado de esqueleto. Es útil para asegurar que los formularios sean manejados de manera eficiente y consistente, con una experiencia de usuario mejorada.
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare const RHFCheckbox: import('react').ForwardRefExoticComponent<Omit<RHFCheckboxProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,89 +1,79 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
2
3
|
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { R as RHFCheckboxRoot, C as ContainerCheckTypography } from "./
|
|
4
|
-
import { u as
|
|
5
|
-
import { g as getNameDataTestId } from "./test/utils.js";
|
|
6
|
-
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.js";
|
|
7
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
8
|
-
import { u as useFormFocus } from "../../../hooks/useFormFocus/index.js";
|
|
9
|
-
import { useModuleSkeleton } from "@m4l/core";
|
|
10
|
-
import { C as CheckBox } from "../../mui_extended/CheckBox/CheckBox.js";
|
|
4
|
+
import { R as RHFCheckboxRoot, L as LabelComponent, C as ContainerCheckTypography, a as CheckBoxStyled } from "./slots/RHFCheckBoxSlots.js";
|
|
5
|
+
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
11
6
|
import { H as HelperError } from "../../HelperError/HelperError.js";
|
|
12
|
-
|
|
7
|
+
const RHFCheckbox = forwardRef(function RHFCheckbox2(props, ref) {
|
|
13
8
|
const {
|
|
14
9
|
name,
|
|
15
|
-
|
|
10
|
+
size = "medium",
|
|
16
11
|
label,
|
|
17
12
|
disabled = false,
|
|
18
13
|
mandatory,
|
|
14
|
+
id,
|
|
19
15
|
mandatoryMessage,
|
|
20
|
-
helperMessage
|
|
16
|
+
helperMessage,
|
|
17
|
+
inlineText,
|
|
18
|
+
helperText
|
|
21
19
|
} = props;
|
|
22
20
|
const {
|
|
23
21
|
control,
|
|
24
22
|
formState: { errors }
|
|
25
23
|
} = useFormContext();
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const isDesktop = useResponsiveDesktop();
|
|
24
|
+
const { currentSize } = useComponentSize(size);
|
|
25
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
29
26
|
const ownerState = {
|
|
30
|
-
isFocus: !isSkeleton ? isFocus : false,
|
|
31
|
-
isTabSelected: !isSkeleton ? isTabSelected : false,
|
|
32
|
-
sizeCheck: !isDesktop ? "medium" : sizeCheck,
|
|
33
27
|
disabled,
|
|
34
|
-
error: errors[name] ? true : false
|
|
28
|
+
error: errors[name] ? true : false,
|
|
29
|
+
name,
|
|
30
|
+
size: adjustedSize,
|
|
31
|
+
paletteColor: "default"
|
|
35
32
|
};
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
helperMessage,
|
|
73
|
-
htmlFor: name
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
error?.message && /* @__PURE__ */ jsx(HelperError, { message: error?.message + "" })
|
|
79
|
-
] });
|
|
33
|
+
const htmlForId = useId();
|
|
34
|
+
const hookId = useId();
|
|
35
|
+
const finalId = id || hookId;
|
|
36
|
+
return /* @__PURE__ */ jsx(RHFCheckboxRoot, { ownerState, children: /* @__PURE__ */ jsx(
|
|
37
|
+
Controller,
|
|
38
|
+
{
|
|
39
|
+
name,
|
|
40
|
+
control,
|
|
41
|
+
render: ({ field: { onChange, value }, fieldState: { error } }) => {
|
|
42
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
LabelComponent,
|
|
45
|
+
{
|
|
46
|
+
ownerState: { ...ownerState },
|
|
47
|
+
size: adjustedSize,
|
|
48
|
+
label: label || "",
|
|
49
|
+
mandatory,
|
|
50
|
+
mandatoryMessage,
|
|
51
|
+
helperMessage,
|
|
52
|
+
helperText
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsx(ContainerCheckTypography, { children: /* @__PURE__ */ jsx(
|
|
56
|
+
CheckBoxStyled,
|
|
57
|
+
{
|
|
58
|
+
ownerState: { ownerState, error: !!error },
|
|
59
|
+
size: adjustedSize,
|
|
60
|
+
onChange,
|
|
61
|
+
checked: value,
|
|
62
|
+
disabled: disabled ? true : false,
|
|
63
|
+
disableRipple: true,
|
|
64
|
+
inlineText,
|
|
65
|
+
htmlFor: finalId,
|
|
66
|
+
error: !!error,
|
|
67
|
+
id: htmlForId,
|
|
68
|
+
ref
|
|
80
69
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
70
|
+
) }),
|
|
71
|
+
error?.message && /* @__PURE__ */ jsx(HelperError, { htmlFor: htmlForId, size: adjustedSize, message: error?.message + "" })
|
|
72
|
+
] });
|
|
83
73
|
}
|
|
84
|
-
|
|
85
|
-
);
|
|
86
|
-
}
|
|
74
|
+
}
|
|
75
|
+
) });
|
|
76
|
+
});
|
|
87
77
|
export {
|
|
88
78
|
RHFCheckbox as R
|
|
89
79
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { R as RHFCheckBoxSlots } from "./slots/RHFCheckBoxEnum.js";
|
|
3
|
+
const RHF_CHECKBOX_KEY_COMPONENT = "M4LRHFCheckbox";
|
|
4
|
+
getComponentClasses(RHF_CHECKBOX_KEY_COMPONENT, RHFCheckBoxSlots);
|
|
5
|
+
export {
|
|
6
|
+
RHF_CHECKBOX_KEY_COMPONENT as R
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var RHFCheckBoxSlots = /* @__PURE__ */ ((RHFCheckBoxSlots2) => {
|
|
2
|
+
RHFCheckBoxSlots2["root"] = "root";
|
|
3
|
+
RHFCheckBoxSlots2["checkBox"] = "checkBox";
|
|
4
|
+
RHFCheckBoxSlots2["containerCheckTypography"] = "containerCheckTypography";
|
|
5
|
+
RHFCheckBoxSlots2["labelComponent"] = "labelComponent";
|
|
6
|
+
return RHFCheckBoxSlots2;
|
|
7
|
+
})(RHFCheckBoxSlots || {});
|
|
8
|
+
export {
|
|
9
|
+
RHFCheckBoxSlots as R
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const RHFCheckboxRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
2
|
+
export declare const CheckBoxStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/CheckBox/types').CheckboxProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "children" | "value" | "title" | "component" | "size" | "name" | "error" | "id" | "action" | "hidden" | "color" | "content" | "style" | "icon" | "mandatory" | "disabled" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "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" | "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" | "onResize" | "onResizeCapture" | "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" | "form" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "checked" | "readOnly" | "required" | "htmlFor" | "skeletonWidth" | keyof import('react').RefAttributes<HTMLButtonElement> | "indeterminate" | "helperText" | "inputProps" | "inputRef" | "helperMessage" | "mandatoryMessage" | "checkedIcon" | "indeterminateIcon" | "inlineText"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
|
|
3
|
+
export declare const ContainerCheckTypography: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const LabelComponent: import('@emotion/styled').StyledComponent<Pick<import('../../../Label/types').LabelProps, keyof import('../../../Label/types').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { r as rhfCheckBoxStyles } from "../RHFCheckBox.styles.js";
|
|
3
|
+
import { R as RHFCheckBoxSlots } from "./RHFCheckBoxEnum.js";
|
|
4
|
+
import { R as RHF_CHECKBOX_KEY_COMPONENT } from "../constants.js";
|
|
5
|
+
import { C as CheckBox } from "../../../mui_extended/CheckBox/CheckBox.js";
|
|
6
|
+
import { L as Label } from "../../../Label/Label.js";
|
|
7
|
+
const RHFCheckboxRoot = styled("div", {
|
|
8
|
+
name: RHF_CHECKBOX_KEY_COMPONENT,
|
|
9
|
+
slot: RHFCheckBoxSlots.root
|
|
10
|
+
})(rhfCheckBoxStyles?.root);
|
|
11
|
+
const CheckBoxStyled = styled(CheckBox, {
|
|
12
|
+
name: RHF_CHECKBOX_KEY_COMPONENT,
|
|
13
|
+
slot: RHFCheckBoxSlots.checkBox
|
|
14
|
+
})(rhfCheckBoxStyles?.checkBox);
|
|
15
|
+
const ContainerCheckTypography = styled("div", {
|
|
16
|
+
name: RHF_CHECKBOX_KEY_COMPONENT,
|
|
17
|
+
slot: RHFCheckBoxSlots.containerCheckTypography
|
|
18
|
+
})(rhfCheckBoxStyles?.containerCheckTypography);
|
|
19
|
+
const LabelComponent = styled(Label, {
|
|
20
|
+
name: RHF_CHECKBOX_KEY_COMPONENT,
|
|
21
|
+
slot: RHFCheckBoxSlots.labelComponent
|
|
22
|
+
})(rhfCheckBoxStyles?.labelComponent);
|
|
23
|
+
export {
|
|
24
|
+
ContainerCheckTypography as C,
|
|
25
|
+
LabelComponent as L,
|
|
26
|
+
RHFCheckboxRoot as R,
|
|
27
|
+
CheckBoxStyled as a
|
|
28
|
+
};
|
|
@@ -1,16 +1,44 @@
|
|
|
1
1
|
import { FormControlLabelProps } from '@mui/material';
|
|
2
2
|
import { LabelProps } from '../../Label/types';
|
|
3
|
+
import { ComponentPalletColor } from '@m4l/styles';
|
|
4
|
+
import { RHFCheckBoxSlots } from './slots';
|
|
5
|
+
import { Theme } from '@mui/material/styles';
|
|
6
|
+
import { RHF_CHECKBOX_KEY_COMPONENT } from './constants';
|
|
7
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
8
|
+
/** Propiedades del componente RHFCheckbox. */
|
|
3
9
|
export interface RHFCheckboxProps extends Omit<FormControlLabelProps, 'control' | 'label'>, Omit<LabelProps, 'label'> {
|
|
10
|
+
/** El nombre del campo de formulario. */
|
|
4
11
|
name: string;
|
|
12
|
+
/** El tamaño del CheckBox. */
|
|
5
13
|
sizeCheck?: 'small' | 'medium';
|
|
14
|
+
/** La etiqueta de texto principal del componente. */
|
|
6
15
|
label?: string;
|
|
16
|
+
/** Indica si hay un error en el campo asociado al CheckBox. */
|
|
17
|
+
error?: boolean;
|
|
18
|
+
/** El texto que se muestra en línea con el CheckBox. */
|
|
19
|
+
inlineText?: string;
|
|
20
|
+
/** El tamaño del CheckBox. */
|
|
21
|
+
size?: 'small' | 'medium';
|
|
22
|
+
/** Texto de ayuda adicional. */
|
|
23
|
+
helperText?: string;
|
|
7
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Propiedades del componente RHFMultiCheckbox.
|
|
27
|
+
*/
|
|
8
28
|
export interface RHFMultiCheckboxProps extends Omit<FormControlLabelProps, 'control' | 'label'> {
|
|
9
29
|
name: string;
|
|
10
30
|
options: string[];
|
|
11
31
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
32
|
+
export type RHFCheckBoxOwnerState = RHFCheckboxProps & {
|
|
33
|
+
paletteColor: ComponentPalletColor;
|
|
34
|
+
error?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Tipos de slots del RHFCheckBox.
|
|
39
|
+
*/
|
|
40
|
+
export type RHFCheckBoxSlotsType = keyof typeof RHFCheckBoxSlots;
|
|
41
|
+
/**
|
|
42
|
+
* Estilos del RHFCheckBox.
|
|
43
|
+
*/
|
|
44
|
+
export type RHFCheckBoxStyles = M4LOverridesStyleRules<RHFCheckBoxSlotsType, typeof RHF_CHECKBOX_KEY_COMPONENT, Theme>;
|
|
@@ -17,4 +17,4 @@ export declare const SelectStyled: import('@emotion/styled').StyledComponent<Pic
|
|
|
17
17
|
* Elemento HelperError construido a través de styled,
|
|
18
18
|
* sirve para mostrar el mensaje de error del componente `RHFSelect`
|
|
19
19
|
*/
|
|
20
|
-
export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps
|
|
20
|
+
export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps & import('react').RefAttributes<HTMLLabelElement>, keyof import('../../../HelperError').HelperErrorProps | keyof import('react').RefAttributes<HTMLLabelElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
|
|
@@ -7,6 +7,6 @@ export declare const LabelStyled: import('@emotion/styled').StyledComponent<Pick
|
|
|
7
7
|
export declare const TextFieldStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/TextField/types').TextFieldProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "children" | "value" | "title" | "component" | "size" | "name" | "error" | "select" | "rows" | "id" | "type" | "hidden" | "content" | "style" | "disabled" | "variant" | "margin" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "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" | "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" | "onResize" | "onResizeCapture" | "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" | "label" | keyof import('react').RefAttributes<HTMLDivElement> | "autoComplete" | "placeholder" | "required" | "dataTestId" | "maxRows" | "fullWidth" | "focused" | "hiddenLabel" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps" | "inputProps" | "inputRef" | "multiline" | "minRows" | "SelectProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').RHFTextFieldOwnerState> & Record<string, unknown> & {
|
|
8
8
|
ownerState: Partial<import('..').RHFTextFieldOwnerState> & Record<string, unknown>;
|
|
9
9
|
}, {}, {}>;
|
|
10
|
-
export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps
|
|
10
|
+
export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps & import('react').RefAttributes<HTMLLabelElement>, keyof import('../../../HelperError').HelperErrorProps | keyof import('react').RefAttributes<HTMLLabelElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').RHFTextFieldOwnerState> & Record<string, unknown> & {
|
|
11
11
|
ownerState: Partial<import('..').RHFTextFieldOwnerState> & Record<string, unknown>;
|
|
12
12
|
}, {}, {}>;
|
|
@@ -7,9 +7,9 @@ import { u as useStateRef } from "../../../../../../../../../../../../hooks/useS
|
|
|
7
7
|
import { m as mapClasses } from "../../../../../../../../classes/index.js";
|
|
8
8
|
import clsx from "clsx";
|
|
9
9
|
import { M as MAP_ICONS } from "../../../../../../../../icons.js";
|
|
10
|
-
import { C as CheckBox } from "../../../../../../../../../../../mui_extended/CheckBox/CheckBox.js";
|
|
11
10
|
import { u as useMapStore } from "../../../../../../../../hooks/useMapStore/index.js";
|
|
12
11
|
import { I as Icon } from "../../../../../../../../../../../Icon/Icon.js";
|
|
12
|
+
import { C as CheckBox } from "../../../../../../../../../../../mui_extended/CheckBox/CheckBox.js";
|
|
13
13
|
function MapSourcesTool() {
|
|
14
14
|
const { getLabel } = useModuleDictionary();
|
|
15
15
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CheckboxProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Componente CheckBox
|
|
3
|
+
* Componente CheckBox 🟦
|
|
4
4
|
*
|
|
5
5
|
* Este componente representa un checkbox personalizado que puede ser utilizado en formularios y otros lugares donde se necesite una opción de selección.
|
|
6
6
|
* @param {CheckboxProps} props - Las propiedades del componente.
|
|
7
|
-
* @param {React.Ref<
|
|
7
|
+
* @param {React.Ref<HTMLButtonElement>} ref - La referencia al elemento raíz del componente.
|
|
8
8
|
* @returns {JSX.Element} El componente CheckBox renderizado.
|
|
9
9
|
* @example
|
|
10
10
|
* ```tsx
|
|
@@ -7,7 +7,7 @@ import clsx from "clsx";
|
|
|
7
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
8
|
import { C as CheckBoxRootStyled, M as MUICheckboxStyled, I as IconCheckedStyled, a as IconStyled, T as TypographyStyled, S as SkeletonStyled } from "./slots/CheckBoxSlots.js";
|
|
9
9
|
import { C as CheckBoxSlots } from "./slots/CheckBoxEnum.js";
|
|
10
|
-
const CheckBox = forwardRef((props) => {
|
|
10
|
+
const CheckBox = forwardRef((props, ref) => {
|
|
11
11
|
const {
|
|
12
12
|
className,
|
|
13
13
|
size = "medium",
|
|
@@ -43,6 +43,7 @@ const CheckBox = forwardRef((props) => {
|
|
|
43
43
|
/* @__PURE__ */ jsx(
|
|
44
44
|
MUICheckboxStyled,
|
|
45
45
|
{
|
|
46
|
+
ref,
|
|
46
47
|
ownerState: { ...ownerState },
|
|
47
48
|
disableRipple: true,
|
|
48
49
|
id: finalId,
|
|
@@ -67,8 +68,8 @@ const CheckBox = forwardRef((props) => {
|
|
|
67
68
|
}
|
|
68
69
|
)
|
|
69
70
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
-
/* @__PURE__ */ jsx(SkeletonStyled, { ownerState: {}, variant: "rounded",
|
|
71
|
-
inlineText ? /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: {}, variant: "
|
|
71
|
+
/* @__PURE__ */ jsx(SkeletonStyled, { ownerState: {}, variant: "rounded", className: "checkSkeleton" }),
|
|
72
|
+
inlineText ? /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: {}, variant: "rectangular", className: "checkSkeletonInlineText" }) : null
|
|
72
73
|
] }) });
|
|
73
74
|
});
|
|
74
75
|
export {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
|
|
1
2
|
const checkBoxStyles = {
|
|
2
3
|
/**
|
|
3
|
-
* Estilos generales para el checkbox
|
|
4
|
+
* Estilos generales para el checkbox 🟦
|
|
5
|
+
* @param {object} theme - El tema de MUI.
|
|
6
|
+
* @returns {object} - Los estilos aplicados al root del checkbox.
|
|
4
7
|
*/
|
|
5
8
|
root: ({ theme }) => {
|
|
6
9
|
return {
|
|
@@ -11,11 +14,13 @@ const checkBoxStyles = {
|
|
|
11
14
|
overflow: "visible",
|
|
12
15
|
boxSizing: "border-box",
|
|
13
16
|
gap: theme.vars.size.baseSpacings.sp1
|
|
14
|
-
// height: theme.vars.size[device][size].action,
|
|
15
17
|
};
|
|
16
18
|
},
|
|
17
19
|
/**
|
|
18
|
-
* Componente MuiCheckBox, FocusVisible para cuando
|
|
20
|
+
* Componente MuiCheckBox, FocusVisible para cuando está seleccionado el CheckBox 🟩
|
|
21
|
+
* @param {object} theme - El tema de MUI.
|
|
22
|
+
* @param {object} ownerState - El estado del componente.
|
|
23
|
+
* @returns {object} - Los estilos aplicados al MuiCheckBox.
|
|
19
24
|
*/
|
|
20
25
|
muiCheckBox: ({ theme, ownerState }) => {
|
|
21
26
|
const color = ownerState.error ? "error" : "primary";
|
|
@@ -51,7 +56,7 @@ const checkBoxStyles = {
|
|
|
51
56
|
outline: `1px solid ${theme.vars.palette["primary"].focusVisible}`,
|
|
52
57
|
outlineOffset: 2
|
|
53
58
|
},
|
|
54
|
-
// Historia Disabled para CheckBox
|
|
59
|
+
// Historia Disabled para CheckBox 😶🌫️
|
|
55
60
|
...ownerState.disabled && {
|
|
56
61
|
pointerEvents: ownerState.disabled ? "none" : "auto",
|
|
57
62
|
"&:hover": {
|
|
@@ -61,24 +66,68 @@ const checkBoxStyles = {
|
|
|
61
66
|
};
|
|
62
67
|
},
|
|
63
68
|
/**
|
|
64
|
-
* Estilos para el inline-text del CheckBox
|
|
69
|
+
* Estilos para el inline-text del CheckBox 📝
|
|
70
|
+
* @param {object} theme - El tema de MUI.
|
|
71
|
+
* @param {object} ownerState - El estado del componente.
|
|
72
|
+
* @returns {object} - Los estilos aplicados al skeletonStyled.
|
|
65
73
|
*/
|
|
66
|
-
skeletonStyled: ({ theme }) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
skeletonStyled: ({ theme, ownerState }) => {
|
|
75
|
+
const device = theme.generalSettings.isMobile ? "mobile" : "desktop";
|
|
76
|
+
const size = ownerState.size ?? "medium";
|
|
77
|
+
return {
|
|
78
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
79
|
+
backgroundColor: theme.vars.palette?.skeleton.transition,
|
|
80
|
+
"&.checkSkeleton": {
|
|
81
|
+
width: theme.vars.size[device][size].action,
|
|
82
|
+
...getHeightSizeStyles(
|
|
83
|
+
theme.generalSettings.isMobile,
|
|
84
|
+
ownerState.size || "medium",
|
|
85
|
+
"action",
|
|
86
|
+
(val) => {
|
|
87
|
+
return {
|
|
88
|
+
width: val
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
...getHeightSizeStyles(
|
|
93
|
+
theme.generalSettings.isMobile,
|
|
94
|
+
ownerState.size || "small",
|
|
95
|
+
"action",
|
|
96
|
+
(val) => {
|
|
97
|
+
return {
|
|
98
|
+
width: val
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
},
|
|
103
|
+
"&.checkSkeletonInlineText": {
|
|
104
|
+
width: theme.vars.size.baseSpacings.sp12,
|
|
105
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
106
|
+
...getHeightSizeStyles(
|
|
107
|
+
theme.generalSettings.isMobile,
|
|
108
|
+
ownerState.size || "medium",
|
|
109
|
+
"base"
|
|
110
|
+
),
|
|
111
|
+
...getHeightSizeStyles(
|
|
112
|
+
theme.generalSettings.isMobile,
|
|
113
|
+
ownerState.size || "small",
|
|
114
|
+
"base"
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
},
|
|
70
119
|
/**
|
|
71
|
-
*
|
|
120
|
+
* Estilos para el inline-text del CheckBox 📝
|
|
72
121
|
*/
|
|
73
|
-
|
|
122
|
+
typographyStyled: {},
|
|
74
123
|
/**
|
|
75
|
-
* El estilado de este slot, se hace en muiCheckBox, debido a que el input
|
|
124
|
+
* El estilado de este slot, se hace en muiCheckBox, debido a que el input absorbe los pseudo selectores, entonces hay que hacerlos desde el nodo padre. 🟨
|
|
76
125
|
*/
|
|
77
|
-
|
|
126
|
+
icon: {},
|
|
78
127
|
/**
|
|
79
|
-
*
|
|
128
|
+
* El estilado de este slot, se hace en muiCheckBox, debido a que el input absorbe los pseudo selectores, entonces hay que hacerlos desde el nodo padre. 🟨
|
|
80
129
|
*/
|
|
81
|
-
|
|
130
|
+
iconChecked: {}
|
|
82
131
|
};
|
|
83
132
|
export {
|
|
84
133
|
checkBoxStyles as c
|
|
@@ -4,37 +4,62 @@ import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
|
4
4
|
import { CheckBoxSlots } from './slots';
|
|
5
5
|
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
6
6
|
import { CHECK_BOX_KEY_COMPONENT } from './constants';
|
|
7
|
+
/**
|
|
8
|
+
* Propiedades del estado del propietario del CheckBox.
|
|
9
|
+
* size - El tamaño del CheckBox.
|
|
10
|
+
* disabled - Indica si el CheckBox está deshabilitado.
|
|
11
|
+
*/
|
|
7
12
|
export type OwnerState = Pick<CheckboxProps, 'size' | 'disabled'>;
|
|
8
13
|
/**
|
|
9
|
-
*
|
|
14
|
+
* Variantes para el componente CheckBox.
|
|
10
15
|
*/
|
|
11
16
|
export type CheckBoxVariants = 'standard';
|
|
17
|
+
/**
|
|
18
|
+
* Propiedades del componente CheckBox.
|
|
19
|
+
* [size] - El tamaño del CheckBox.
|
|
20
|
+
* [color] - El color del CheckBox.
|
|
21
|
+
* [inlineText] - El texto que se muestra en línea con el CheckBox.
|
|
22
|
+
*/
|
|
12
23
|
export interface CheckboxProps extends MUICheckboxProps, Omit<LabelProps, 'label' | 'size'> {
|
|
13
24
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
14
25
|
color?: Extract<ComponentPalletColor, 'default'>;
|
|
15
26
|
inlineText?: string;
|
|
16
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Estado del propietario del CheckBox.
|
|
30
|
+
* [checked] - Indica si el CheckBox está marcado.
|
|
31
|
+
* [disabled] - Indica si el CheckBox está deshabilitado.
|
|
32
|
+
* size - El tamaño del CheckBox.
|
|
33
|
+
* [error] - Indica si hay un error en el CheckBox.
|
|
34
|
+
* color - El color del CheckBox.
|
|
35
|
+
*/
|
|
17
36
|
export interface CheckBoxOwnerState {
|
|
18
37
|
/**
|
|
19
|
-
*
|
|
38
|
+
* Indica si el CheckBox está marcado.
|
|
20
39
|
*/
|
|
21
40
|
checked?: boolean;
|
|
22
41
|
/**
|
|
23
|
-
* Indica si el
|
|
42
|
+
* Indica si el CheckBox está deshabilitado.
|
|
24
43
|
*/
|
|
25
44
|
disabled?: boolean;
|
|
26
45
|
/**
|
|
27
|
-
*
|
|
46
|
+
* El tamaño del CheckBox.
|
|
28
47
|
*/
|
|
29
48
|
size: Extract<Sizes, 'small' | 'medium'>;
|
|
30
49
|
/**
|
|
31
|
-
* Indica si
|
|
50
|
+
* Indica si hay un error en el CheckBox.
|
|
32
51
|
*/
|
|
33
52
|
error?: boolean;
|
|
34
53
|
/**
|
|
35
|
-
*
|
|
54
|
+
* El color del CheckBox.
|
|
36
55
|
*/
|
|
37
56
|
color: Extract<ComponentPalletColor, 'default'>;
|
|
38
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Tipos de slots del CheckBox.
|
|
60
|
+
*/
|
|
39
61
|
export type CheckBoxSlotsType = keyof typeof CheckBoxSlots;
|
|
62
|
+
/**
|
|
63
|
+
* Estilos del CheckBox.
|
|
64
|
+
*/
|
|
40
65
|
export type CheckBoxStyles = OverridesStyleRules<CheckBoxSlotsType, typeof CHECK_BOX_KEY_COMPONENT, Theme>;
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HelperError } from './HelperError';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
declare const meta: Meta<typeof HelperError>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof HelperError>;
|
|
6
|
-
/** Base HelperError component */
|
|
7
|
-
export declare const ErrorBase: Story;
|
|
8
|
-
/** Small HelperError component */
|
|
9
|
-
export declare const small: Story;
|
|
10
|
-
/** Medium HelperError component */
|
|
11
|
-
export declare const medium: Story;
|
|
12
|
-
/** Skeleton HelperError component */
|
|
13
|
-
export declare const Skeleton: Story;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RHFCheckboxClassesType } from './types';
|
|
2
|
-
import { OwnerState } from '../types';
|
|
3
|
-
export declare const RHFCheckboxClasses: RHFCheckboxClassesType;
|
|
4
|
-
export declare function getRHFCheckboxUtilityClass(slot: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* TODO: Documentar
|
|
7
|
-
*/
|
|
8
|
-
export declare const useUtilityClasses: (ownerState: OwnerState) => {
|
|
9
|
-
skeleton: string;
|
|
10
|
-
root: string;
|
|
11
|
-
checkTypography: string;
|
|
12
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
-
generateUtilityClasses("M4LRHFCheckbox", [
|
|
4
|
-
/* elements */
|
|
5
|
-
"root",
|
|
6
|
-
"checkTypography",
|
|
7
|
-
"skeleton",
|
|
8
|
-
/* states or variants of elements */
|
|
9
|
-
"small",
|
|
10
|
-
"medium",
|
|
11
|
-
"stateDisabled",
|
|
12
|
-
"stateError",
|
|
13
|
-
"isFocus",
|
|
14
|
-
"isTabSelected"
|
|
15
|
-
]);
|
|
16
|
-
function getRHFCheckboxUtilityClass(slot) {
|
|
17
|
-
return generateUtilityClass("M4LRHFCheckbox", slot);
|
|
18
|
-
}
|
|
19
|
-
const useUtilityClasses = (ownerState) => {
|
|
20
|
-
const slots = {
|
|
21
|
-
root: [
|
|
22
|
-
"root",
|
|
23
|
-
ownerState.isFocus && "isFocus",
|
|
24
|
-
ownerState.isTabSelected && "isTabSelected",
|
|
25
|
-
ownerState.sizeCheck === "small" && "small",
|
|
26
|
-
ownerState.sizeCheck === "medium" && "medium",
|
|
27
|
-
ownerState.disabled && "stateDisabled",
|
|
28
|
-
ownerState.error && "stateError"
|
|
29
|
-
],
|
|
30
|
-
skeleton: ["skeleton"],
|
|
31
|
-
checkTypography: [
|
|
32
|
-
"checkTypography",
|
|
33
|
-
ownerState.sizeCheck === "small" ? "small" : "medium",
|
|
34
|
-
ownerState.disabled && "stateDisabled"
|
|
35
|
-
]
|
|
36
|
-
};
|
|
37
|
-
const composedClasses = unstable_composeClasses(slots, getRHFCheckboxUtilityClass, {});
|
|
38
|
-
return {
|
|
39
|
-
...composedClasses
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
useUtilityClasses as u
|
|
44
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface RHFCheckboxClassesType {
|
|
2
|
-
root: string;
|
|
3
|
-
checkTypography: string;
|
|
4
|
-
skeleton: string;
|
|
5
|
-
small: string;
|
|
6
|
-
medium: string;
|
|
7
|
-
stateDisabled: string;
|
|
8
|
-
stateError: string;
|
|
9
|
-
isFocus: string;
|
|
10
|
-
isTabSelected: string;
|
|
11
|
-
}
|
|
12
|
-
export type RHFCheckboxClassesKey = keyof RHFCheckboxClassesType;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const RHFCheckboxRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
-
export declare const WrapperSKTRHFCheckbox: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
|
-
export declare const SKTCheckSkeleton: import('@emotion/styled').StyledComponent<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
4
|
-
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;
|
|
5
|
-
}, "children" | "style" | "variant" | "width" | "height" | "animation" | "sx" | "classes" | "className"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
6
|
-
export declare const ContainerCheckTypography: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { Skeleton } from "@mui/material";
|
|
3
|
-
const RHFCheckboxRoot = styled("div")(({ theme }) => ({
|
|
4
|
-
...theme.components?.M4LRHFCheckbox?.styleOverrides || {}
|
|
5
|
-
}));
|
|
6
|
-
styled("div")(() => ({
|
|
7
|
-
display: "flex",
|
|
8
|
-
justifyContent: "center",
|
|
9
|
-
alignItems: "center",
|
|
10
|
-
padding: "8px"
|
|
11
|
-
}));
|
|
12
|
-
styled(Skeleton)(() => ({
|
|
13
|
-
width: "20px",
|
|
14
|
-
height: "20px",
|
|
15
|
-
borderRadius: "4px"
|
|
16
|
-
}));
|
|
17
|
-
const ContainerCheckTypography = styled("div")(() => ({
|
|
18
|
-
display: "flex",
|
|
19
|
-
alignItems: "center"
|
|
20
|
-
}));
|
|
21
|
-
export {
|
|
22
|
-
ContainerCheckTypography as C,
|
|
23
|
-
RHFCheckboxRoot as R
|
|
24
|
-
};
|