@m4l/components 9.1.69 → 9.1.71
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 +8 -0
- package/components/Image/Image.js +8 -5
- package/components/Image/constant.d.ts +4 -0
- package/components/Image/constant.js +4 -0
- package/components/Image/image.styles.js +1 -1
- package/components/Image/slots/ImageEnum.d.ts +1 -1
- package/components/Image/slots/ImageEnum.js +1 -1
- package/components/Image/slots/ImageSlots.js +2 -2
- package/components/Image/types.d.ts +1 -0
- package/components/Loadable/index.d.ts +8 -0
- package/components/Loadable/index.js +2 -2
- package/components/animate/index.d.ts +1 -1
- package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.d.ts +11 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.js +53 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.styles.d.ts +2 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.styles.js +39 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/constants.d.ts +1 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/constants.js +4 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/PropagateLoaderSpinnerEnum.d.ts +4 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/PropagateLoaderSpinnerEnum.js +8 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/PropagateLoaderSpinnerSlots.d.ts +6 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/PropagateLoaderSpinnerSlots.js +17 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/index.d.ts +2 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/slots/index.js +1 -0
- package/components/extended/React-Spinners/PropagateLoaderSpinner/types.d.ts +58 -0
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/MenuItem.styles.js +13 -0
- package/components/mui_extended/Select/Select.d.ts +1 -1
- package/components/mui_extended/Select/Select.js +93 -96
- package/components/mui_extended/Select/Select.styles.js +94 -230
- package/components/mui_extended/Select/constants.d.ts +23 -0
- package/components/mui_extended/Select/constants.js +11 -1
- package/components/mui_extended/Select/dictionary.d.ts +4 -2
- package/components/mui_extended/Select/dictionary.js +7 -0
- package/components/mui_extended/Select/slots/SelectEnum.d.ts +12 -7
- package/components/mui_extended/Select/slots/SelectEnum.js +14 -7
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +15 -9
- package/components/mui_extended/Select/slots/SelectSlots.js +31 -20
- package/components/mui_extended/Select/slots/index.js +1 -0
- package/components/mui_extended/Select/test/Select.test.d.ts +1 -0
- package/components/mui_extended/Select/types.d.ts +41 -29
- package/components/mui_extended/TextField/TextField.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/components/animate/PropagateLoader/index.d.ts +0 -6
- package/components/animate/PropagateLoader/index.js +0 -11
- package/components/animate/PropagateLoader/syles.d.ts +0 -1
- package/components/animate/PropagateLoader/syles.js +0 -16
- /package/components/{mui_extended/Select/Select.test.d.ts → extended/React-Spinners/PropagateLoaderSpinner/tests/PropagateLoaderSpinner.test.d.ts} +0 -0
|
@@ -2,12 +2,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEnvironment, useModuleSkeleton, useModuleDictionary, getPropertyByString } from "@m4l/core";
|
|
3
3
|
import { useTheme } from "@mui/material";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { useState, useMemo } from "react";
|
|
6
|
-
import { a as
|
|
7
|
-
import { I as
|
|
8
|
-
import { S as
|
|
5
|
+
import { forwardRef, useState, useMemo } from "react";
|
|
6
|
+
import { A as ArrowDownStyled, S as SkeletonSelectStyled, a as SelectRootStyled, M as MenuItemListStyled, b as MenuItemNoOptionStyled, c as AdormentStyled, L as LabelPlaceholerStyled, R as RenderValueContainerStyled, d as RenderValueTypography } from "./slots/SelectSlots.js";
|
|
7
|
+
import { S as SELECT_CLASSES, a as SELECT_KEY_COMPONENT, I as ICON_ARROW_DOWN } from "./constants.js";
|
|
8
|
+
import { S as SELECT_DICTIONARY } from "./dictionary.js";
|
|
9
|
+
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
9
10
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
10
|
-
|
|
11
|
+
import { S as SelectSlots } from "./slots/SelectEnum.js";
|
|
12
|
+
const Select = forwardRef((props, ref) => {
|
|
11
13
|
const {
|
|
12
14
|
value,
|
|
13
15
|
options = [],
|
|
@@ -15,141 +17,136 @@ const Select = (props) => {
|
|
|
15
17
|
size = "medium",
|
|
16
18
|
disabled = false,
|
|
17
19
|
error = false,
|
|
18
|
-
color = "default",
|
|
19
20
|
variant = "outlined",
|
|
20
|
-
placeholder
|
|
21
|
-
className
|
|
21
|
+
placeholder,
|
|
22
|
+
className,
|
|
23
|
+
dataTestId,
|
|
24
|
+
...otherProps
|
|
22
25
|
} = props;
|
|
23
26
|
const { currentSize } = useComponentSize(size);
|
|
24
27
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
25
28
|
const isSkeleton = useModuleSkeleton();
|
|
26
29
|
const { getLabel } = useModuleDictionary();
|
|
27
|
-
const theme = useTheme();
|
|
28
30
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
29
|
-
const [selectedValue, setSelectedValue] = useState(value
|
|
31
|
+
const [selectedValue, setSelectedValue] = useState(value ?? "");
|
|
32
|
+
const [open, setOpen] = useState(false);
|
|
33
|
+
const theme = useTheme();
|
|
30
34
|
const paletteColor = getPropertyByString(
|
|
31
35
|
theme.vars.palette,
|
|
32
|
-
disabled ? "default" : error ? "error" :
|
|
36
|
+
disabled ? "default" : error ? "error" : "primary",
|
|
33
37
|
theme.vars.palette.default
|
|
34
38
|
);
|
|
35
|
-
const ownerState = {
|
|
39
|
+
const ownerState = useMemo(() => ({
|
|
36
40
|
size: adjustedSize,
|
|
37
41
|
disabled,
|
|
38
42
|
error,
|
|
39
43
|
variant,
|
|
40
|
-
paletteColor
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const optionsMap = useMemo(
|
|
44
|
-
() => new Map(options.map((opt) => [opt.id.toString(), opt])),
|
|
45
|
-
[options]
|
|
46
|
-
);
|
|
47
|
-
const handleChange = (event) => {
|
|
44
|
+
paletteColor
|
|
45
|
+
}), [adjustedSize, disabled, error, variant, paletteColor]);
|
|
46
|
+
const handleLocalChange = (event) => {
|
|
48
47
|
const newValue = event.target.value;
|
|
49
48
|
setSelectedValue(newValue);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
setOpen(false);
|
|
50
|
+
const selectedOption = options.find((option) => option.id === newValue);
|
|
51
|
+
if (selectedOption && onChange) {
|
|
52
|
+
onChange(selectedOption);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
const arrowDropDownIcon = `${host_static_assets}/${environment_assets}/${ICON_ARROW_DOWN}`;
|
|
56
|
+
const ArrowIcon = useMemo(() => {
|
|
57
|
+
return () => /* @__PURE__ */ jsx(
|
|
58
|
+
ArrowDownStyled,
|
|
59
|
+
{
|
|
60
|
+
ownerState: { ...ownerState },
|
|
61
|
+
icon: arrowDropDownIcon,
|
|
62
|
+
disabled,
|
|
63
|
+
size: adjustedSize,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
!disabled && setOpen(!open);
|
|
66
|
+
},
|
|
67
|
+
rotationAngle: open ? 180 : 0
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}, [ownerState, arrowDropDownIcon, disabled, adjustedSize, open]);
|
|
71
|
+
const RenderIcon = (icon) => {
|
|
72
|
+
if (!icon) {
|
|
73
|
+
return null;
|
|
64
74
|
}
|
|
65
|
-
|
|
75
|
+
if (typeof icon !== "string") {
|
|
76
|
+
return icon;
|
|
77
|
+
} else {
|
|
78
|
+
return /* @__PURE__ */ jsx(
|
|
79
|
+
AdormentStyled,
|
|
80
|
+
{
|
|
81
|
+
ownerState: {},
|
|
82
|
+
src: icon,
|
|
83
|
+
size: adjustedSize,
|
|
84
|
+
className: SELECT_CLASSES.renderValueStartAdorment,
|
|
85
|
+
disabled
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const renderValue = (selected) => {
|
|
91
|
+
if (!Boolean(selected)) {
|
|
92
|
+
return /* @__PURE__ */ jsx(LabelPlaceholerStyled, { variant: "body", color: "text.disabled", ownerState: {}, children: placeholder });
|
|
93
|
+
}
|
|
94
|
+
const selectedOption = options.find((option) => option.id === selected);
|
|
95
|
+
return selectedOption ? /* @__PURE__ */ jsxs(RenderValueContainerStyled, { ownerState: { ...ownerState }, className: SELECT_CLASSES.renderValueContainer, children: [
|
|
96
|
+
selectedOption.startAdornment && RenderIcon(selectedOption.startAdornment),
|
|
97
|
+
/* @__PURE__ */ jsx(RenderValueTypography, { variant: "body", color: "text.primary", ownerState: {}, size: adjustedSize, className: SELECT_CLASSES.renderValueTypography, children: selectedOption.label })
|
|
98
|
+
] }) : "";
|
|
99
|
+
};
|
|
66
100
|
if (isSkeleton) {
|
|
67
|
-
return /* @__PURE__ */ jsx(SkeletonSelectStyled, { ownerState: { ...ownerState } });
|
|
101
|
+
return /* @__PURE__ */ jsx(SkeletonSelectStyled, { ownerState: { ...ownerState }, className: SELECT_CLASSES.skeletonSelect });
|
|
68
102
|
}
|
|
69
|
-
const classSelect = getComponentSlotRoot("M4LSelectClass");
|
|
70
103
|
return /* @__PURE__ */ jsx(
|
|
71
104
|
SelectRootStyled,
|
|
72
105
|
{
|
|
73
|
-
|
|
106
|
+
...otherProps,
|
|
107
|
+
...getPropDataTestId(SELECT_KEY_COMPONENT, SelectSlots.root, dataTestId),
|
|
108
|
+
ref,
|
|
109
|
+
className: clsx(SELECT_CLASSES.root, SELECT_CLASSES[variant], className),
|
|
74
110
|
ownerState: { ...ownerState },
|
|
111
|
+
IconComponent: ArrowIcon,
|
|
75
112
|
value: selectedValue,
|
|
76
|
-
onChange:
|
|
77
|
-
IconComponent: arrowIcon,
|
|
113
|
+
onChange: handleLocalChange,
|
|
78
114
|
fullWidth: true,
|
|
79
115
|
disabled,
|
|
80
116
|
error,
|
|
81
|
-
renderValue: (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
selectedOption?.startAdornment && /* @__PURE__ */ jsx(Icon, { size, src: selectedOption.startAdornment }),
|
|
88
|
-
/* @__PURE__ */ jsx(LabelOptionStyled, { size, ownerState: { ...ownerState }, children: selectedOption?.label || placeholder })
|
|
89
|
-
] });
|
|
90
|
-
},
|
|
91
|
-
MenuProps: {
|
|
92
|
-
disableAutoFocusItem: true,
|
|
93
|
-
MenuListProps: {
|
|
94
|
-
onMouseMove: (event) => {
|
|
95
|
-
event.stopPropagation();
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
/**
|
|
99
|
-
* Handles the key down event for the menu.
|
|
100
|
-
* @param {React.KeyboardEvent} event - The key down event.
|
|
101
|
-
* @author SebastianM - automatic
|
|
102
|
-
* @createdAt 2024-12-23 10:47:53 - automatic
|
|
103
|
-
* @updatedAt 2025-01-03 11:42:15 - automatic
|
|
104
|
-
* @updatedUser Andrés Quintero - automatic
|
|
105
|
-
*/
|
|
106
|
-
onKeyDown: (event) => {
|
|
107
|
-
const char = event.key.toLowerCase();
|
|
108
|
-
const matchingOption = options.find(
|
|
109
|
-
(option) => option.label.toLowerCase().startsWith(char)
|
|
110
|
-
);
|
|
111
|
-
if (matchingOption) {
|
|
112
|
-
const element = document.querySelector(
|
|
113
|
-
`[data-value='${matchingOption.id}']`
|
|
114
|
-
);
|
|
115
|
-
element?.scrollIntoView({ block: "nearest" });
|
|
116
|
-
setSelectedValue(matchingOption.id.toString());
|
|
117
|
-
const selectedOption = optionsMap.get(matchingOption.id.toString());
|
|
118
|
-
if (selectedOption) {
|
|
119
|
-
onChange?.(selectedOption);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
117
|
+
renderValue: (val) => renderValue(val),
|
|
118
|
+
size: adjustedSize,
|
|
119
|
+
open,
|
|
120
|
+
displayEmpty: true,
|
|
121
|
+
onClick: () => {
|
|
122
|
+
!disabled && setOpen(!open);
|
|
123
123
|
},
|
|
124
124
|
children: options.length > 0 ? options.map((option) => /* @__PURE__ */ jsx(
|
|
125
|
-
|
|
125
|
+
MenuItemListStyled,
|
|
126
126
|
{
|
|
127
|
+
className: SELECT_CLASSES.menuItemList,
|
|
127
128
|
ownerState: { ...ownerState },
|
|
128
|
-
size,
|
|
129
|
-
value: option.id
|
|
129
|
+
size: adjustedSize,
|
|
130
|
+
value: String(option.id),
|
|
130
131
|
disabled,
|
|
131
132
|
label: option.label,
|
|
132
|
-
selected:
|
|
133
|
-
|
|
134
|
-
selectedValue
|
|
135
|
-
),
|
|
136
|
-
startIcon: option.startAdornment,
|
|
137
|
-
endIcon: option.endAdornment,
|
|
138
|
-
"data-value": option.id
|
|
133
|
+
selected: selectedValue === option.id,
|
|
134
|
+
startIcon: RenderIcon(option.startAdornment)
|
|
139
135
|
},
|
|
140
|
-
option.id
|
|
136
|
+
String(option.id)
|
|
141
137
|
)) : /* @__PURE__ */ jsx(
|
|
142
|
-
|
|
138
|
+
MenuItemNoOptionStyled,
|
|
143
139
|
{
|
|
144
140
|
ownerState: { ...ownerState },
|
|
145
|
-
|
|
146
|
-
size,
|
|
147
|
-
label: getLabel(
|
|
141
|
+
className: SELECT_CLASSES.menuItemNoOptions,
|
|
142
|
+
size: adjustedSize,
|
|
143
|
+
label: getLabel(SELECT_DICTIONARY.noOptions),
|
|
144
|
+
disabled: true
|
|
148
145
|
}
|
|
149
146
|
)
|
|
150
147
|
}
|
|
151
148
|
);
|
|
152
|
-
};
|
|
149
|
+
});
|
|
153
150
|
export {
|
|
154
151
|
Select as S
|
|
155
152
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
|
|
2
|
+
import { S as SELECT_CLASSES } from "./constants.js";
|
|
1
3
|
const selectStyles = {
|
|
2
4
|
/**
|
|
3
5
|
* Estilos para el componente Select
|
|
@@ -6,185 +8,83 @@ const selectStyles = {
|
|
|
6
8
|
* @updatedAt 2025-01-03 11:42:15 - automatic
|
|
7
9
|
* @updatedUser Andrés Quintero - automatic
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
...ownerState.variant === "text" && {
|
|
21
|
-
"&.M4LSelectClass-root": {
|
|
22
|
-
borderColor: ownerState.paletteColor?.main
|
|
23
|
-
}
|
|
11
|
+
root: ({ theme, ownerState }) => ({
|
|
12
|
+
[`&.${SELECT_CLASSES.root}`]: {
|
|
13
|
+
width: "100%",
|
|
14
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
15
|
+
border: theme.vars.size.borderStroke.actionInput,
|
|
16
|
+
borderColor: ownerState.error ? ownerState.paletteColor?.enabled : theme.vars.palette.border.default,
|
|
17
|
+
padding: 0,
|
|
18
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
19
|
+
all: "unset",
|
|
20
|
+
display: "none"
|
|
24
21
|
},
|
|
25
|
-
"
|
|
26
|
-
|
|
22
|
+
"& .MuiSelect-nativeInput": {
|
|
23
|
+
all: "unset",
|
|
24
|
+
display: "none"
|
|
27
25
|
},
|
|
28
|
-
"& .
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
backgroundColor: theme.vars.palette.primary.hoverOpacity,
|
|
39
|
-
borderColor: theme.vars.palette.border.default + "!important",
|
|
40
|
-
...ownerState.error === true && {
|
|
41
|
-
backgroundColor: theme.vars.palette.error.hoverOpacity,
|
|
42
|
-
borderColor: theme.vars.palette.error.main + "!important"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"&.M4LSelectClass-root": {
|
|
46
|
-
display: "flex",
|
|
47
|
-
alignItems: "center",
|
|
48
|
-
justifyContent: "flex-start",
|
|
49
|
-
padding: theme.vars.size.baseSpacings.sp1,
|
|
50
|
-
borderRadius: theme.vars.size.borderRadius.r1,
|
|
51
|
-
"&:active": {
|
|
52
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
53
|
-
borderTop: "transparent",
|
|
54
|
-
borderLeft: "transparent",
|
|
55
|
-
borderRight: "transparent"
|
|
56
|
-
},
|
|
57
|
-
"&.Mui-focused": {
|
|
58
|
-
"& .MuiIconButton-root": {
|
|
59
|
-
"& .M4LIconClass-root": {
|
|
60
|
-
backgroundColor: theme.vars.palette.primary.main,
|
|
61
|
-
...ownerState.error === true && {
|
|
62
|
-
backgroundColor: ownerState.paletteColor?.main
|
|
63
|
-
}
|
|
64
|
-
}
|
|
26
|
+
"& .M4LImage-root": {
|
|
27
|
+
...getHeightSizeStyles(
|
|
28
|
+
theme.generalSettings.isMobile,
|
|
29
|
+
ownerState.size || "medium",
|
|
30
|
+
"base",
|
|
31
|
+
(val) => {
|
|
32
|
+
return {
|
|
33
|
+
height: val,
|
|
34
|
+
width: val
|
|
35
|
+
};
|
|
65
36
|
}
|
|
66
|
-
|
|
37
|
+
)
|
|
67
38
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
39
|
+
"& .MuiButtonBase-root": {
|
|
40
|
+
// Tamaño del componente
|
|
41
|
+
...getHeightSizeStyles(
|
|
42
|
+
theme.generalSettings.isMobile,
|
|
43
|
+
ownerState.size || "medium",
|
|
44
|
+
"action",
|
|
45
|
+
(height) => {
|
|
46
|
+
return {
|
|
47
|
+
width: height
|
|
48
|
+
};
|
|
79
49
|
}
|
|
80
|
-
|
|
50
|
+
)
|
|
81
51
|
},
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
borderTop: "transparent",
|
|
106
|
-
borderLeft: "transparent",
|
|
107
|
-
borderRight: "transparent"
|
|
108
|
-
},
|
|
109
|
-
"&.Mui-focused": {
|
|
110
|
-
"& .MuiIconButton-root": {
|
|
111
|
-
"& .M4LIconClass-root": {
|
|
112
|
-
backgroundColor: ownerState.paletteColor?.main
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"&.Mui-focused": {
|
|
118
|
-
borderColor: theme.vars.palette.primary.main,
|
|
119
|
-
...ownerState.error === true && {
|
|
120
|
-
borderColor: ownerState.paletteColor?.main + "!important"
|
|
121
|
-
},
|
|
122
|
-
"&.Mui-focused": {
|
|
123
|
-
"& .MuiIconButton-root": {
|
|
124
|
-
"& .M4LIconClass-root": {
|
|
125
|
-
backgroundColor: theme.vars.palette.primary.main,
|
|
126
|
-
...ownerState.error === true && {
|
|
127
|
-
backgroundColor: ownerState.paletteColor?.main
|
|
128
|
-
},
|
|
129
|
-
transform: "rotate(180deg)",
|
|
130
|
-
transition: "transform 0.3s ease"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"&:focus-active": {
|
|
136
|
-
borderTop: "transparent",
|
|
137
|
-
borderLeft: "transparent",
|
|
138
|
-
borderRight: "transparent"
|
|
139
|
-
},
|
|
140
|
-
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
141
|
-
border: "none"
|
|
52
|
+
"& .MuiSelect-select": {
|
|
53
|
+
padding: `${theme.vars.size.baseSpacings.sp1}!important`,
|
|
54
|
+
minHeight: "unset"
|
|
55
|
+
},
|
|
56
|
+
// Estilos para la variante text
|
|
57
|
+
[`&.${SELECT_CLASSES.text}`]: {
|
|
58
|
+
borderTop: 0,
|
|
59
|
+
borderRight: 0,
|
|
60
|
+
borderBottom: theme.vars.size.borderStroke.actionInput,
|
|
61
|
+
borderLeft: 0,
|
|
62
|
+
borderColor: ownerState.error ? ownerState.paletteColor?.enabled : theme.vars.palette.border.default
|
|
63
|
+
},
|
|
64
|
+
"&:hover": {
|
|
65
|
+
backgroundColor: ownerState.disabled ? "unset" : ownerState.paletteColor?.hoverOpacity
|
|
66
|
+
},
|
|
67
|
+
"&:focus-within": {
|
|
68
|
+
borderColor: ownerState.paletteColor?.focus
|
|
69
|
+
},
|
|
70
|
+
...ownerState.error && {
|
|
71
|
+
borderColor: ownerState.paletteColor?.enabled,
|
|
72
|
+
"&:hover": {
|
|
73
|
+
borderColor: ownerState.paletteColor?.hover,
|
|
74
|
+
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
142
75
|
}
|
|
143
76
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
77
|
+
// Tamaño del componente
|
|
78
|
+
...getHeightSizeStyles(
|
|
79
|
+
theme.generalSettings.isMobile,
|
|
80
|
+
ownerState.size || "medium",
|
|
81
|
+
"action",
|
|
82
|
+
(height) => {
|
|
83
|
+
return {
|
|
84
|
+
minHeight: height
|
|
85
|
+
};
|
|
152
86
|
}
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
// Estilos específicos para el tamaño small
|
|
156
|
-
...ownerState.size === "small" && {
|
|
157
|
-
...theme.generalSettings.isMobile ? {
|
|
158
|
-
height: theme.vars.size.mobile.small.action,
|
|
159
|
-
minHeight: theme.vars.size.mobile.small.action
|
|
160
|
-
} : {
|
|
161
|
-
height: theme.vars.size.desktop.small.action,
|
|
162
|
-
minHeight: theme.vars.size.desktop.small.action
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
// Estilos específicos para el tamaño medium
|
|
166
|
-
...ownerState.size === "medium" && {
|
|
167
|
-
...theme.generalSettings.isMobile ? {
|
|
168
|
-
height: theme.vars.size.mobile.medium.action,
|
|
169
|
-
minHeight: theme.vars.size.mobile.medium.action
|
|
170
|
-
} : {
|
|
171
|
-
height: theme.vars.size.desktop.medium.action,
|
|
172
|
-
minHeight: theme.vars.size.desktop.medium.action
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
"& .MuiSelect-select": {
|
|
176
|
-
display: "flex",
|
|
177
|
-
alignItems: "center",
|
|
178
|
-
justifyContent: "flex-start",
|
|
179
|
-
padding: theme.vars.size.baseSpacings.sp0,
|
|
180
|
-
"&::placeholder": {
|
|
181
|
-
color: theme.vars.palette.text.disabled
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
...ownerState.disabled === true && {
|
|
185
|
-
borderColor: theme.vars.palette.border.disabled,
|
|
186
|
-
color: theme.vars.palette.text.disabled,
|
|
187
|
-
pointerEvents: "none"
|
|
87
|
+
)
|
|
188
88
|
}
|
|
189
89
|
}),
|
|
190
90
|
/**
|
|
@@ -194,13 +94,7 @@ const selectStyles = {
|
|
|
194
94
|
* @updatedAt 2025-01-03 11:42:15 - automatic
|
|
195
95
|
* @updatedUser Andrés Quintero - automatic
|
|
196
96
|
*/
|
|
197
|
-
|
|
198
|
-
position: "absolute",
|
|
199
|
-
right: theme.vars.size.baseSpacings.sp0,
|
|
200
|
-
top: "50%",
|
|
201
|
-
transform: "translateY(-50%)",
|
|
202
|
-
pointerEvents: "none"
|
|
203
|
-
}),
|
|
97
|
+
adorment: {},
|
|
204
98
|
/**
|
|
205
99
|
* Styles for the render option container
|
|
206
100
|
* @returns {object} The styles for the render option container
|
|
@@ -209,28 +103,14 @@ const selectStyles = {
|
|
|
209
103
|
* @updatedAt 2025-01-03 11:42:15 - automatic
|
|
210
104
|
* @updatedUser Andrés Quintero - automatic
|
|
211
105
|
*/
|
|
212
|
-
|
|
106
|
+
renderValueContainer: ({ theme }) => ({
|
|
213
107
|
display: "flex",
|
|
214
108
|
alignItems: "center",
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
"& .M4LIconClass-root": {
|
|
221
|
-
backgroundColor: theme.vars.palette.text.primary
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
"&:focus": {
|
|
225
|
-
"& .M4LIconClass-root": {
|
|
226
|
-
backgroundColor: theme.vars.palette.text.primary
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
...ownerState.disabled && {
|
|
230
|
-
"& .M4LIconClass-root": {
|
|
231
|
-
backgroundColor: theme.vars.palette.text.disabled
|
|
232
|
-
}
|
|
233
|
-
}
|
|
109
|
+
gap: theme.vars.size.baseSpacings.sp1
|
|
110
|
+
}),
|
|
111
|
+
arrowDown: {},
|
|
112
|
+
renderValueTypography: () => ({
|
|
113
|
+
lineHeight: "inherit!important"
|
|
234
114
|
}),
|
|
235
115
|
/**
|
|
236
116
|
* Styles for the label option
|
|
@@ -252,35 +132,28 @@ const selectStyles = {
|
|
|
252
132
|
* @updatedUser Andrés Quintero - automatic
|
|
253
133
|
*/
|
|
254
134
|
labelPlaceholer: ({ theme }) => ({
|
|
255
|
-
|
|
256
|
-
zIndex: 100
|
|
135
|
+
paddingLeft: theme.vars.size.baseSpacings.sp1
|
|
257
136
|
}),
|
|
258
137
|
/**
|
|
259
|
-
* Styles for the menu
|
|
138
|
+
* Styles for the menu item select
|
|
260
139
|
* @param {object} theme - The theme object
|
|
261
|
-
* @returns {object} The styles for the menu
|
|
140
|
+
* @returns {object} The styles for the menu item select
|
|
262
141
|
* @author SebastianM - automatic
|
|
263
|
-
* @createdAt 2024-12-
|
|
142
|
+
* @createdAt 2024-12-26 14:16:33 - automatic
|
|
264
143
|
* @updatedAt 2025-01-03 11:42:15 - automatic
|
|
265
144
|
* @updatedUser Andrés Quintero - automatic
|
|
266
145
|
*/
|
|
267
|
-
|
|
268
|
-
padding: theme.vars.size.baseSpacings.sp2,
|
|
269
|
-
boxShadow: theme.vars.shadows[1]
|
|
270
|
-
}),
|
|
146
|
+
menuItemList: {},
|
|
271
147
|
/**
|
|
272
|
-
*
|
|
148
|
+
* Estilos del menuItem que no tiene opciones
|
|
273
149
|
* @param {object} theme - The theme object
|
|
274
150
|
* @returns {object} The styles for the menu item select
|
|
275
151
|
* @author SebastianM - automatic
|
|
276
152
|
* @createdAt 2024-12-26 14:16:33 - automatic
|
|
277
|
-
* @updatedAt
|
|
153
|
+
* @updatedAt 2024-12-31 11:23:53 - automatic
|
|
278
154
|
* @updatedUser Andrés Quintero - automatic
|
|
279
155
|
*/
|
|
280
|
-
|
|
281
|
-
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
282
|
-
paddingRight: theme.vars.size.baseSpacings.sp2
|
|
283
|
-
}),
|
|
156
|
+
menuItemNoOptions: {},
|
|
284
157
|
/**
|
|
285
158
|
* Styles for the skeleton select component
|
|
286
159
|
* @author SebastianM - automatic
|
|
@@ -295,25 +168,16 @@ const selectStyles = {
|
|
|
295
168
|
alignItems: "center",
|
|
296
169
|
background: theme.vars.palette.skeleton.transition,
|
|
297
170
|
// Estilos específicos para el tamaño small
|
|
298
|
-
...
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
171
|
+
...getHeightSizeStyles(
|
|
172
|
+
theme.generalSettings.isMobile,
|
|
173
|
+
ownerState.size || "medium",
|
|
174
|
+
"action",
|
|
175
|
+
(height) => {
|
|
176
|
+
return {
|
|
177
|
+
minHeight: `${height}!important`
|
|
178
|
+
};
|
|
305
179
|
}
|
|
306
|
-
|
|
307
|
-
// Estilos específicos para el tamaño medium
|
|
308
|
-
...ownerState.size === "medium" && {
|
|
309
|
-
...theme.generalSettings.isMobile ? {
|
|
310
|
-
height: theme.vars.size.mobile.medium.action,
|
|
311
|
-
minHeight: theme.vars.size.mobile.medium.action
|
|
312
|
-
} : {
|
|
313
|
-
height: theme.vars.size.desktop.medium.action,
|
|
314
|
-
minHeight: theme.vars.size.desktop.medium.action
|
|
315
|
-
}
|
|
316
|
-
}
|
|
180
|
+
)
|
|
317
181
|
})
|
|
318
182
|
};
|
|
319
183
|
export {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SelectComplementaryClasses, SelectSlots } from './slots';
|
|
1
2
|
/**
|
|
2
3
|
* Clave de identificación del componente Select dentro del sistema.
|
|
3
4
|
*
|
|
@@ -6,3 +7,25 @@
|
|
|
6
7
|
* @default 'M4LSelect'
|
|
7
8
|
*/
|
|
8
9
|
export declare const SELECT_KEY_COMPONENT = "M4LSelect";
|
|
10
|
+
/**
|
|
11
|
+
* url del icono de flecha hacia abajo
|
|
12
|
+
*/
|
|
13
|
+
export declare const ICON_ARROW_DOWN = "frontend/components/select/arrow_down.svg";
|
|
14
|
+
export declare const COMBINATED_TEXTFIELD_ENUMS: {
|
|
15
|
+
outlined: SelectComplementaryClasses.outlined;
|
|
16
|
+
text: SelectComplementaryClasses.text;
|
|
17
|
+
root: SelectSlots.root;
|
|
18
|
+
adorment: SelectSlots.adorment;
|
|
19
|
+
menuItemList: SelectSlots.menuItemList;
|
|
20
|
+
menuItemNoOptions: SelectSlots.menuItemNoOptions;
|
|
21
|
+
skeletonSelect: SelectSlots.skeletonSelect;
|
|
22
|
+
renderValueContainer: SelectSlots.renderValueContainer;
|
|
23
|
+
arrowDown: SelectSlots.arrowDown;
|
|
24
|
+
renderValueTypography: SelectSlots.renderValueTypography;
|
|
25
|
+
labelOption: SelectSlots.labelOption;
|
|
26
|
+
labelPlaceholer: SelectSlots.labelPlaceholer;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Inventario de clases CSS para el componente Select
|
|
30
|
+
*/
|
|
31
|
+
export declare const SELECT_CLASSES: Record<string, string>;
|