@m4l/components 9.1.54 → 9.1.56
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/components/Chip/Chip.js +6 -2
- package/components/Chip/ChipStyles.js +7 -7
- package/components/Chip/constants.d.ts +4 -0
- package/components/Chip/constants.js +5 -1
- package/components/Chip/slots/ChipEnum.d.ts +7 -7
- package/components/Chip/slots/ChipEnum.js +8 -7
- package/components/Chip/slots/ChipSlots.js +3 -3
- package/components/Chip/types.d.ts +41 -11
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +9 -21
- package/components/formatters/PeriodFormatter/PeriodFormatter.d.ts +25 -0
- package/components/formatters/PeriodFormatter/PeriodFormatter.js +87 -0
- package/components/formatters/PeriodFormatter/PeriodFormatter.styles.d.ts +2 -0
- package/components/formatters/PeriodFormatter/PeriodFormatter.styles.js +29 -0
- package/components/formatters/PeriodFormatter/constants.d.ts +1 -0
- package/components/formatters/PeriodFormatter/constants.js +4 -0
- package/components/formatters/PeriodFormatter/dictionary.d.ts +6 -9
- package/components/formatters/PeriodFormatter/slots/PeriodFomatterEnum.d.ts +4 -0
- package/components/formatters/PeriodFormatter/slots/PeriodFomatterEnum.js +8 -0
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +2 -0
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.js +18 -0
- package/components/formatters/PeriodFormatter/slots/index.d.ts +2 -0
- package/components/formatters/PeriodFormatter/slots/index.js +1 -0
- package/components/formatters/PeriodFormatter/tests/PeriodFormatter.test.d.ts +1 -0
- package/components/formatters/PeriodFormatter/types.d.ts +22 -2
- package/components/formatters/index.d.ts +1 -1
- package/components/mui_extended/Autocomplete/Autocomplete.js +13 -9
- package/components/mui_extended/Autocomplete/AutocompleteStyles.js +18 -58
- package/components/mui_extended/Autocomplete/dictionary.d.ts +0 -2
- package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +1 -1
- package/components/mui_extended/Autocomplete/renderOptions/index.js +3 -2
- package/components/mui_extended/Autocomplete/slots /AutocompleteSlots.js +3 -2
- package/components/mui_extended/MenuItem/MenuItem.js +7 -6
- package/components/mui_extended/MenuItem/MenuItem.styles.js +55 -64
- package/components/mui_extended/MenuItem/constants.d.ts +4 -0
- package/components/mui_extended/MenuItem/constants.js +5 -1
- package/components/mui_extended/MenuItem/slots/MenuItemEnum.d.ts +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemEnum.js +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +3 -3
- package/components/mui_extended/MenuItem/types.d.ts +32 -11
- package/components/mui_extended/TextField/TextField.js +2 -1
- package/components/mui_extended/TextField/TextField.styles.js +26 -10
- package/components/mui_extended/TextField/constants.d.ts +3 -3
- package/components/mui_extended/TextField/constants.js +2 -2
- package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldEnum.js +6 -6
- package/components/mui_extended/Typography/Typography.js +4 -3
- package/components/mui_extended/Typography/constants.d.ts +4 -0
- package/components/mui_extended/Typography/constants.js +5 -1
- package/components/mui_extended/Typography/slots/typographySlots.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/getHeightSizeStyles.js +1 -1
- package/components/formatters/PeriodFormatter/index.d.ts +0 -15
- package/components/formatters/PeriodFormatter/index.js +0 -60
- package/components/formatters/PeriodFormatter/index.test.d.ts +0 -4
|
@@ -3,6 +3,7 @@ import { useModuleDictionary, useModuleSkeleton, useEnvironment, getPropertyBySt
|
|
|
3
3
|
import { useTheme } from "@mui/material";
|
|
4
4
|
import { forwardRef, useState, useMemo, useEffect, useCallback } from "react";
|
|
5
5
|
import { w as withRenderOption } from "./renderOptions/index.js";
|
|
6
|
+
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
6
7
|
import { A as AutocompleteStyled, P as PopperComponentStyled, R as RenderInputStyled, C as ChipStyled, I as ImageStyled, a as CircularProgressStyled, b as IconButtonStyled } from "./slots /AutocompleteSlots.js";
|
|
7
8
|
import { T as Typography } from "../Typography/Typography.js";
|
|
8
9
|
const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
@@ -40,6 +41,8 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
40
41
|
const theme = useTheme();
|
|
41
42
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
42
43
|
const [open, setOpen] = useState(false);
|
|
44
|
+
const { currentSize } = useComponentSize(size);
|
|
45
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
43
46
|
useMemo(
|
|
44
47
|
() => getOptionUrlImage !== void 0,
|
|
45
48
|
[getOptionUrlImage]
|
|
@@ -133,7 +136,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
133
136
|
theme.vars.palette.default
|
|
134
137
|
);
|
|
135
138
|
const ownerState = {
|
|
136
|
-
size,
|
|
139
|
+
size: adjustedSize,
|
|
137
140
|
variant,
|
|
138
141
|
disabled,
|
|
139
142
|
paletteColor,
|
|
@@ -173,7 +176,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
173
176
|
disableClearable: true,
|
|
174
177
|
multiple,
|
|
175
178
|
onKeyDown: checkKeyDown,
|
|
176
|
-
size,
|
|
179
|
+
size: adjustedSize,
|
|
177
180
|
ref,
|
|
178
181
|
autoSelect: false,
|
|
179
182
|
options,
|
|
@@ -185,6 +188,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
185
188
|
PopperComponentStyled,
|
|
186
189
|
{
|
|
187
190
|
...otherPopperProps,
|
|
191
|
+
size: adjustedSize,
|
|
188
192
|
placement: "bottom-start",
|
|
189
193
|
ownerState: { ...ownerState }
|
|
190
194
|
}
|
|
@@ -200,9 +204,9 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
200
204
|
onChange: handleChange,
|
|
201
205
|
filterOptions: onChangeFilterParmsLocal ? (x) => x : void 0,
|
|
202
206
|
loading,
|
|
203
|
-
loadingText: /* @__PURE__ */ jsx(Typography, { variant: "body", children: getLabel("autocomplete.loading_options") }),
|
|
207
|
+
loadingText: /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: getLabel("autocomplete.loading_options") }),
|
|
204
208
|
disabled,
|
|
205
|
-
noOptionsText: getLabel("autocomplete.no_options"),
|
|
209
|
+
noOptionsText: /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: getLabel("autocomplete.no_options") }),
|
|
206
210
|
renderOption: (renderProps, option) => {
|
|
207
211
|
const isSelected = multiple ? Array.isArray(selectedValue) && selectedValue.some((val) => isOptionEqualToValueLocal(option, val)) : isOptionEqualToValueLocal(option, selectedValue);
|
|
208
212
|
return withRenderOption(color)(renderProps, {
|
|
@@ -224,7 +228,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
224
228
|
...params,
|
|
225
229
|
color,
|
|
226
230
|
error,
|
|
227
|
-
size,
|
|
231
|
+
size: adjustedSize,
|
|
228
232
|
variant,
|
|
229
233
|
InputLabelProps: {
|
|
230
234
|
...params.InputLabelProps,
|
|
@@ -240,7 +244,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
240
244
|
startAdornment: multiple ? Array.isArray(selectedValue) ? selectedValue.map((option, index) => /* @__PURE__ */ jsx(
|
|
241
245
|
ChipStyled,
|
|
242
246
|
{
|
|
243
|
-
size,
|
|
247
|
+
size: adjustedSize,
|
|
244
248
|
label: getOptionLabelLocal(option),
|
|
245
249
|
opacity: true,
|
|
246
250
|
onDeleted: () => handleDelete(option),
|
|
@@ -260,7 +264,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
260
264
|
{
|
|
261
265
|
ownerState: { ...ownerState },
|
|
262
266
|
color,
|
|
263
|
-
size
|
|
267
|
+
size: adjustedSize
|
|
264
268
|
}
|
|
265
269
|
) : /* @__PURE__ */ jsx("div", { children: refresh ? /* @__PURE__ */ jsx(
|
|
266
270
|
IconButtonStyled,
|
|
@@ -269,7 +273,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
269
273
|
src: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/round_refresh.svg`,
|
|
270
274
|
onClick: handleRefresh,
|
|
271
275
|
disabled,
|
|
272
|
-
size
|
|
276
|
+
size: adjustedSize
|
|
273
277
|
}
|
|
274
278
|
) : /* @__PURE__ */ jsx(
|
|
275
279
|
IconButtonStyled,
|
|
@@ -278,7 +282,7 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
278
282
|
src: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/chevronDown.svg`,
|
|
279
283
|
onClick: (event) => onOpenLocal(event),
|
|
280
284
|
disabled,
|
|
281
|
-
size
|
|
285
|
+
size: adjustedSize
|
|
282
286
|
}
|
|
283
287
|
) })
|
|
284
288
|
},
|
|
@@ -6,16 +6,11 @@ const autocompleteSyles = {
|
|
|
6
6
|
* @updatedAt 2024-12-10 15:24:11 - automatic
|
|
7
7
|
* @updatedUser SebastianM - automatic
|
|
8
8
|
*/
|
|
9
|
-
iconButton: (
|
|
9
|
+
iconButton: () => ({
|
|
10
10
|
position: "absolute",
|
|
11
11
|
top: "50%",
|
|
12
|
-
right:
|
|
13
|
-
transform: "translateY(-50%)"
|
|
14
|
-
...ownerState.disabled && {
|
|
15
|
-
"& .M4LIconClass-root": {
|
|
16
|
-
backgroundColor: theme.vars.palette.text.disabled
|
|
17
|
-
}
|
|
18
|
-
}
|
|
12
|
+
right: 0,
|
|
13
|
+
transform: "translateY(-50%)"
|
|
19
14
|
}),
|
|
20
15
|
/**
|
|
21
16
|
* Styles for the autocomplete component.
|
|
@@ -26,58 +21,19 @@ const autocompleteSyles = {
|
|
|
26
21
|
* @updatedAt 2024-12-10 15:24:11 - automatic
|
|
27
22
|
* @updatedUser SebastianM - automatic
|
|
28
23
|
*/
|
|
29
|
-
autocomplete:
|
|
30
|
-
"& .MuiFormControl-root": {
|
|
31
|
-
height: "auto",
|
|
32
|
-
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
33
|
-
paddingRight: theme.vars.size.baseSpacings.sp1,
|
|
34
|
-
"& .MuiInputBase-root": {
|
|
35
|
-
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
36
|
-
paddingRight: theme.vars.size.baseSpacings.sp0,
|
|
37
|
-
gap: theme.vars.size.baseSpacings.sp1,
|
|
38
|
-
":focus-within": {
|
|
39
|
-
'&:focus-within .MuiIconButton-root:not([role="button-chip"] .MuiIconButton-root)': {
|
|
40
|
-
"& .M4LIconClass-root": {
|
|
41
|
-
transform: "rotate(180deg)",
|
|
42
|
-
transition: "transform 0.3s ease"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
...ownerState.disabled && {
|
|
49
|
-
"& .MuiInputBase-root": {
|
|
50
|
-
borderColor: theme.vars.palette.text.disabled
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}),
|
|
24
|
+
autocomplete: {},
|
|
54
25
|
/**
|
|
55
26
|
* Styles for the typography component.
|
|
56
27
|
*/
|
|
57
|
-
typography:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
minHeight: theme.vars.size.desktop.small.action
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
// Estilos específicos para el tamaño medium
|
|
69
|
-
...ownerState.size === "medium" && {
|
|
70
|
-
...theme.generalSettings.isMobile ? {
|
|
71
|
-
height: theme.vars.size.mobile.medium.action,
|
|
72
|
-
minHeight: theme.vars.size.mobile.medium.action
|
|
73
|
-
} : {
|
|
74
|
-
height: theme.vars.size.desktop.medium.action,
|
|
75
|
-
minHeight: theme.vars.size.desktop.medium.action
|
|
76
|
-
}
|
|
77
|
-
}
|
|
28
|
+
typography: {},
|
|
29
|
+
menuList: {},
|
|
30
|
+
/**
|
|
31
|
+
* Styles for the menu item component.
|
|
32
|
+
*/
|
|
33
|
+
menuItem: ({ theme }) => ({
|
|
34
|
+
padding: `${theme.vars.size.baseSpacings.sp1}!important`,
|
|
35
|
+
borderRadius: `${theme.vars.size.borderRadius.r0}!important`
|
|
78
36
|
}),
|
|
79
|
-
menuList: () => ({}),
|
|
80
|
-
menuItem: () => ({}),
|
|
81
37
|
/**
|
|
82
38
|
* Styles for the image component.
|
|
83
39
|
* @author SebastianM - automatic
|
|
@@ -108,9 +64,13 @@ const autocompleteSyles = {
|
|
|
108
64
|
* @updatedAt 2024-12-10 15:24:11 - automatic
|
|
109
65
|
* @updatedUser SebastianM - automatic
|
|
110
66
|
*/
|
|
111
|
-
textField: () => ({
|
|
67
|
+
textField: ({ theme }) => ({
|
|
112
68
|
position: "relative",
|
|
113
|
-
height: "auto"
|
|
69
|
+
height: "auto",
|
|
70
|
+
"& .MuiInputBase-root": {
|
|
71
|
+
padding: theme.vars.size.baseSpacings.sp1,
|
|
72
|
+
gap: theme.vars.size.baseSpacings.sp1
|
|
73
|
+
}
|
|
114
74
|
}),
|
|
115
75
|
/**
|
|
116
76
|
* Styles for the popper component.
|
|
@@ -15,5 +15,5 @@ export declare function withRenderOption<T>(color?: 'primary' | 'default' | 'err
|
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
startAdornment?: ReactNode;
|
|
17
17
|
endAdornment?: ReactNode;
|
|
18
|
-
size
|
|
18
|
+
size: Extract<Sizes, "small" | "medium">;
|
|
19
19
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
import { M as
|
|
2
|
+
import { M as MenuItemStyled } from "../slots /AutocompleteSlots.js";
|
|
3
3
|
function withRenderOption(color) {
|
|
4
4
|
return function RenderOption(optionProps, option) {
|
|
5
5
|
return /* @__PURE__ */ createElement(
|
|
6
|
-
|
|
6
|
+
MenuItemStyled,
|
|
7
7
|
{
|
|
8
|
+
ownerState: {},
|
|
8
9
|
...optionProps,
|
|
9
10
|
selected: option.selected,
|
|
10
11
|
color,
|
|
@@ -6,12 +6,12 @@ import { a as autocompleteSyles } from "../AutocompleteStyles.js";
|
|
|
6
6
|
import { A as AUTOCOMPLETE_KEY_COMPONENT } from "../constants.js";
|
|
7
7
|
import { A as AutocompleteSlots } from "./AutocompleteEnum.js";
|
|
8
8
|
import { I as IconButton } from "../../IconButton/IconButton.js";
|
|
9
|
+
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
9
10
|
import { C as CircularProgress } from "../../CircularProgress/CircularProgress.js";
|
|
10
11
|
import { T as TextField } from "../../TextField/TextField.js";
|
|
11
12
|
import { T as Typography } from "../../Typography/Typography.js";
|
|
12
13
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
13
14
|
import { P as Popper } from "../../Popper/Popper.js";
|
|
14
|
-
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
15
15
|
const IconButtonStyled = styled(IconButton, {
|
|
16
16
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
17
17
|
slot: AutocompleteSlots.iconButton
|
|
@@ -24,7 +24,7 @@ const ChipStyled = styled(Chip, {
|
|
|
24
24
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
25
25
|
slot: AutocompleteSlots.chip
|
|
26
26
|
})(autocompleteSyles?.chip);
|
|
27
|
-
styled(MenuItem, {
|
|
27
|
+
const MenuItemStyled = styled(MenuItem, {
|
|
28
28
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
29
29
|
slot: AutocompleteSlots.menuItem
|
|
30
30
|
})(autocompleteSyles?.menuItem);
|
|
@@ -64,6 +64,7 @@ export {
|
|
|
64
64
|
AutocompleteStyled as A,
|
|
65
65
|
ChipStyled as C,
|
|
66
66
|
ImageStyled as I,
|
|
67
|
+
MenuItemStyled as M,
|
|
67
68
|
PopperComponentStyled as P,
|
|
68
69
|
RenderInputStyled as R,
|
|
69
70
|
CircularProgressStyled as a,
|
|
@@ -3,7 +3,7 @@ import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
|
3
3
|
import { useTheme } from "@mui/material";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
|
|
6
|
-
import { M as
|
|
6
|
+
import { M as MENUITEM_CLASSES } from "./constants.js";
|
|
7
7
|
import { M as MenuItemSkeletonStyled, a as MenuItemRootStyled, b as MenuItemIconCheckedStyled, c as MenuItemContainerStyled, d as MenuItemTypographyStyled, e as MenuItemIconStyled } from "./slots/MenuItemSlots.js";
|
|
8
8
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
9
9
|
const MenuItem = (props) => {
|
|
@@ -18,6 +18,7 @@ const MenuItem = (props) => {
|
|
|
18
18
|
disabled = false,
|
|
19
19
|
size = "medium",
|
|
20
20
|
checked = false,
|
|
21
|
+
className,
|
|
21
22
|
...other
|
|
22
23
|
} = props;
|
|
23
24
|
const { currentSize } = useComponentSize(size);
|
|
@@ -42,11 +43,12 @@ const MenuItem = (props) => {
|
|
|
42
43
|
{
|
|
43
44
|
"data-testid": "SkeletonMenuItem",
|
|
44
45
|
width: skeletonWidth,
|
|
45
|
-
ownerState: { ...ownerState }
|
|
46
|
+
ownerState: { ...ownerState },
|
|
47
|
+
className: MENUITEM_CLASSES.skeleton
|
|
46
48
|
}
|
|
47
49
|
);
|
|
48
50
|
}
|
|
49
|
-
const renderIcon = (icon, instaceDataTestId,
|
|
51
|
+
const renderIcon = (icon, instaceDataTestId, classNameIcon) => {
|
|
50
52
|
if (!icon) {
|
|
51
53
|
return null;
|
|
52
54
|
}
|
|
@@ -62,14 +64,13 @@ const MenuItem = (props) => {
|
|
|
62
64
|
size: adjustedSize,
|
|
63
65
|
disabled,
|
|
64
66
|
instaceDataTestId,
|
|
65
|
-
className
|
|
67
|
+
className: classNameIcon
|
|
66
68
|
}
|
|
67
69
|
);
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
72
|
const checkedIcon = "https://s3.us-east-1.amazonaws.com/static.made4labs/environments/d1/frontend/components/menu_item/checked.svg";
|
|
71
73
|
const hasCheckedIcon = checked && checkedIcon;
|
|
72
|
-
const classRoot = getComponentSlotRoot(MENUITEM_KEY_COMPONENT);
|
|
73
74
|
return /* @__PURE__ */ jsxs(
|
|
74
75
|
MenuItemRootStyled,
|
|
75
76
|
{
|
|
@@ -79,7 +80,7 @@ const MenuItem = (props) => {
|
|
|
79
80
|
disabled,
|
|
80
81
|
disableRipple: true,
|
|
81
82
|
size: adjustedSize,
|
|
82
|
-
className: clsx(
|
|
83
|
+
className: clsx(className, MENUITEM_CLASSES.root),
|
|
83
84
|
"data-testid": "MenuItemRoot",
|
|
84
85
|
children: [
|
|
85
86
|
hasCheckedIcon && /* @__PURE__ */ jsx(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
|
|
1
2
|
const menuItemStyles = {
|
|
2
3
|
/**
|
|
3
4
|
* Estilos para el contenedor de los items del menú
|
|
@@ -14,80 +15,85 @@ const menuItemStyles = {
|
|
|
14
15
|
* @createdAt 2024-12-27 08:28:33 - automatic
|
|
15
16
|
* @author Andrés Quintero - automatic
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
root: ({ theme, ownerState }) => ({
|
|
18
19
|
width: "100%",
|
|
19
20
|
gap: theme.vars.size.baseSpacings.sp3,
|
|
20
21
|
padding: theme.vars.size.baseSpacings.sp1,
|
|
21
22
|
borderRadius: theme.vars.size.borderRadius.r0,
|
|
22
23
|
...ownerState.selected && {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
"& .M4lclassCssSpecificity.M4lclassCssSpecificity": {
|
|
24
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
25
|
+
borderColor: ownerState.paletteColor?.main,
|
|
26
|
+
"& .M4LTypography-root": {
|
|
28
27
|
color: ownerState.paletteColor?.enabled
|
|
29
28
|
},
|
|
30
|
-
"& .
|
|
29
|
+
"& .M4LIcon-icon": {
|
|
31
30
|
backgroundColor: ownerState.paletteColor?.enabled
|
|
32
31
|
},
|
|
33
32
|
"&:hover": {
|
|
34
33
|
backgroundColor: ownerState.paletteColor?.hoverOpacity,
|
|
35
|
-
"
|
|
36
|
-
backgroundColor: ownerState.paletteColor?.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
"& .M4LIcon-icon": {
|
|
35
|
+
backgroundColor: ownerState.paletteColor?.hover
|
|
36
|
+
},
|
|
37
|
+
"& .M4LTypography-root": {
|
|
38
|
+
color: ownerState.paletteColor?.hover
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"&:active": {
|
|
42
|
+
backgroundColor: ownerState.paletteColor?.activeOpacity,
|
|
43
|
+
"& .M4LIcon-icon": {
|
|
44
|
+
backgroundColor: ownerState.paletteColor?.active
|
|
45
|
+
},
|
|
46
|
+
"& .M4LTypography-root": {
|
|
47
|
+
color: ownerState.paletteColor?.active
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"&:focus-visible": {
|
|
51
|
+
backgroundColor: ownerState.paletteColor?.activeOpacity,
|
|
52
|
+
outline: theme.vars.size.borderStroke.container,
|
|
53
|
+
outlineColor: theme.vars.palette.border.main,
|
|
54
|
+
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
55
|
+
"& .M4LIcon-icon": {
|
|
56
|
+
color: ownerState.paletteColor?.active
|
|
43
57
|
}
|
|
44
58
|
}
|
|
45
59
|
},
|
|
46
60
|
...ownerState.color === "default" && {
|
|
47
|
-
"& .
|
|
61
|
+
"& .M4LTypography-root": {
|
|
48
62
|
color: theme.vars.palette.text.primary
|
|
49
63
|
},
|
|
50
|
-
"& .
|
|
64
|
+
"& .M4LIcon-icon": {
|
|
51
65
|
backgroundColor: theme.vars.palette.text.primary
|
|
52
66
|
},
|
|
53
67
|
"&:hover": {
|
|
54
|
-
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"& .M4LIconClass-root": {
|
|
61
|
-
backgroundColor: theme.vars.palette.text.primary
|
|
62
|
-
}
|
|
68
|
+
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
69
|
+
},
|
|
70
|
+
"&:active": {
|
|
71
|
+
backgroundColor: ownerState.paletteColor?.activeOpacity,
|
|
72
|
+
"& .M4LIcon-icon": {
|
|
73
|
+
backgroundColor: theme.vars.palette.text.primary
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
},
|
|
66
77
|
...ownerState.disabled && {
|
|
67
78
|
pointerEvents: "none",
|
|
68
|
-
"& .
|
|
79
|
+
"& .M4LTypography-root": {
|
|
69
80
|
color: theme.vars.palette.text.disabled
|
|
70
81
|
},
|
|
71
|
-
"& .
|
|
82
|
+
"& .M4LIcon-icon": {
|
|
72
83
|
backgroundColor: theme.vars.palette.text.disabled
|
|
73
84
|
}
|
|
74
85
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
...getHeightSizeStyles(
|
|
87
|
+
theme.generalSettings.isMobile,
|
|
88
|
+
ownerState.size || "medium",
|
|
89
|
+
"action",
|
|
90
|
+
(height) => {
|
|
91
|
+
return {
|
|
92
|
+
height: "auto!important",
|
|
93
|
+
minHeight: `${height}!important`
|
|
94
|
+
};
|
|
81
95
|
}
|
|
82
|
-
|
|
83
|
-
// Estilos específicos para el tamaño medium
|
|
84
|
-
...ownerState.size === "medium" && {
|
|
85
|
-
...theme.generalSettings.isMobile ? {
|
|
86
|
-
minHeight: theme.vars.size.mobile.medium.action
|
|
87
|
-
} : {
|
|
88
|
-
minHeight: theme.vars.size.desktop.medium.action
|
|
89
|
-
}
|
|
90
|
-
}
|
|
96
|
+
)
|
|
91
97
|
}),
|
|
92
98
|
/**
|
|
93
99
|
* Estilos para el icono de los items del menú
|
|
@@ -110,7 +116,7 @@ const menuItemStyles = {
|
|
|
110
116
|
*/
|
|
111
117
|
menuItemIconChecked: ({ ownerState }) => ({
|
|
112
118
|
...ownerState.selected && {
|
|
113
|
-
"& .
|
|
119
|
+
"& .M4LIcon-icon": {
|
|
114
120
|
backgroundColor: ownerState.paletteColor?.main
|
|
115
121
|
}
|
|
116
122
|
}
|
|
@@ -146,26 +152,11 @@ const menuItemStyles = {
|
|
|
146
152
|
display: "flex",
|
|
147
153
|
alignItems: "center",
|
|
148
154
|
background: theme.vars.palette.skeleton.transition,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
} : {
|
|
155
|
-
height: theme.vars.size.desktop.small.action,
|
|
156
|
-
minHeight: theme.vars.size.desktop.small.action
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
// Estilos específicos para el tamaño medium
|
|
160
|
-
...ownerState.size === "medium" && {
|
|
161
|
-
...theme.generalSettings.isMobile ? {
|
|
162
|
-
height: theme.vars.size.mobile.medium.action,
|
|
163
|
-
minHeight: theme.vars.size.mobile.medium.action
|
|
164
|
-
} : {
|
|
165
|
-
height: theme.vars.size.desktop.medium.action,
|
|
166
|
-
minHeight: theme.vars.size.desktop.medium.action
|
|
167
|
-
}
|
|
168
|
-
}
|
|
155
|
+
...getHeightSizeStyles(
|
|
156
|
+
theme.generalSettings.isMobile,
|
|
157
|
+
ownerState.size || "medium",
|
|
158
|
+
"action"
|
|
159
|
+
)
|
|
169
160
|
})
|
|
170
161
|
};
|
|
171
162
|
export {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { M as MenuItemSlots } from "./slots/MenuItemEnum.js";
|
|
1
3
|
const MENUITEM_KEY_COMPONENT = "M4LMenuItem";
|
|
4
|
+
const MENUITEM_CLASSES = getComponentClasses(MENUITEM_KEY_COMPONENT, MenuItemSlots);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
MENUITEM_CLASSES as M,
|
|
7
|
+
MENUITEM_KEY_COMPONENT as a
|
|
4
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var MenuItemSlots = /* @__PURE__ */ ((MenuItemSlots2) => {
|
|
2
|
-
MenuItemSlots2["
|
|
2
|
+
MenuItemSlots2["root"] = "menuItemRoot";
|
|
3
3
|
MenuItemSlots2["menuItemIcon"] = "menuItemIcon";
|
|
4
4
|
MenuItemSlots2["menuItemIconChecked"] = "menuItemIconChecked";
|
|
5
5
|
MenuItemSlots2["menuItemContainer"] = "menuItemContainer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
2
|
import { MenuItem } from "@mui/material";
|
|
3
|
-
import {
|
|
3
|
+
import { a as MENUITEM_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { m as menuItemStyles } from "../MenuItem.styles.js";
|
|
5
5
|
import { M as MenuItemSlots } from "./MenuItemEnum.js";
|
|
6
6
|
import { T as Typography } from "../../Typography/Typography.js";
|
|
@@ -8,8 +8,8 @@ import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
|
8
8
|
import { I as Icon } from "../../../Icon/Icon.js";
|
|
9
9
|
const MenuItemRootStyled = styled(MenuItem, {
|
|
10
10
|
name: MENUITEM_KEY_COMPONENT,
|
|
11
|
-
slot: MenuItemSlots.
|
|
12
|
-
})(menuItemStyles?.
|
|
11
|
+
slot: MenuItemSlots.root
|
|
12
|
+
})(menuItemStyles?.root);
|
|
13
13
|
const MenuItemContainerStyled = styled("div", {
|
|
14
14
|
name: MENUITEM_KEY_COMPONENT,
|
|
15
15
|
slot: MenuItemSlots.menuItemContainer
|
|
@@ -5,27 +5,48 @@ import { MenuItemSlots } from './slots';
|
|
|
5
5
|
import { MENUITEM_KEY_COMPONENT } from './constants';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Omit<MUIMenuItemProps, 'size' | 'color'>
|
|
10
|
-
* [startIcon] - Prop opcional para el ícono a la izquierda en el `MenuItem`.
|
|
11
|
-
* [endIcon] - Prop opcional para el ícono a la derecha en el `MenuItem`.
|
|
12
|
-
* label - Texto que describe el `MenuItem`.
|
|
13
|
-
* [selected] - Indica si el item está seleccionado.
|
|
14
|
-
* [componentPaletteColor] - Personalización del color de la paleta del componente.
|
|
15
|
-
* [color] - Define el color del `MenuItem` (solo 'primary' permitido).
|
|
16
|
-
* [disabled] - Indica si el `MenuItem` está deshabilitado.
|
|
17
|
-
* [size] - Tamaño del `MenuItem` (por defecto 'medium').
|
|
8
|
+
* Propiedades del componente `MenuItem`.
|
|
18
9
|
*/
|
|
19
10
|
export interface MenuItemProps extends Omit<MUIMenuItemProps, 'size' | 'color'> {
|
|
11
|
+
/**
|
|
12
|
+
* Prop opcional para el ícono a la izquierda en el `MenuItem`
|
|
13
|
+
*/
|
|
20
14
|
startIcon?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Prop opcional para el ícono a la derecha en el `MenuItem`
|
|
17
|
+
*/
|
|
21
18
|
endIcon?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Texto que describe el `MenuItem`
|
|
21
|
+
*/
|
|
22
22
|
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* Indica si el item está seleccionado
|
|
25
|
+
*/
|
|
23
26
|
selected?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Define el color del `MenuItem`
|
|
29
|
+
*/
|
|
24
30
|
color?: Extract<ComponentPalletColor, 'primary' | 'default' | 'error'>;
|
|
31
|
+
/**
|
|
32
|
+
* Personalización del color de la paleta del componente
|
|
33
|
+
*/
|
|
25
34
|
componentPaletteColor?: ComponentPalletColor;
|
|
35
|
+
/**
|
|
36
|
+
* Indica si el `MenuItem` está deshabilitado
|
|
37
|
+
*/
|
|
26
38
|
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Define el tamaño del `MenuItem`
|
|
41
|
+
*/
|
|
27
42
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
43
|
+
/**
|
|
44
|
+
* Define el with of skeleton mode
|
|
45
|
+
*/
|
|
28
46
|
skeletonWidth?: string | number;
|
|
47
|
+
/**
|
|
48
|
+
* Define si el ícono de check está activo
|
|
49
|
+
*/
|
|
29
50
|
checked?: boolean;
|
|
30
51
|
}
|
|
31
52
|
/**
|
|
@@ -43,4 +64,4 @@ export type MenuItemSlotsType = keyof typeof MenuItemSlots;
|
|
|
43
64
|
/**
|
|
44
65
|
* Estilos aplicables al `MenuItem` utilizando temas y slots personalizados.
|
|
45
66
|
*/
|
|
46
|
-
export type MenuItemStyles =
|
|
67
|
+
export type MenuItemStyles = OverridesStyleRules<MenuItemSlotsType, typeof MENUITEM_KEY_COMPONENT, Theme>;
|
|
@@ -47,11 +47,12 @@ const TextField = (props) => {
|
|
|
47
47
|
TextFieldRootStyled,
|
|
48
48
|
{
|
|
49
49
|
ownerState: { ...ownerState },
|
|
50
|
-
className: clsx(TEXT_FIELD_CLASSES.root, TEXT_FIELD_CLASSES
|
|
50
|
+
className: clsx(TEXT_FIELD_CLASSES.root, TEXT_FIELD_CLASSES.variant, className),
|
|
51
51
|
...getPropDataTestId(TEXT_FIELD_KEY_COMPONENT, TextFieldSlots.root, dataTestId),
|
|
52
52
|
autoComplete,
|
|
53
53
|
value,
|
|
54
54
|
inputMode: "numeric",
|
|
55
|
+
disabled,
|
|
55
56
|
inputProps: {
|
|
56
57
|
...inputProps,
|
|
57
58
|
disabled,
|