@m4l/components 9.1.130 → 9.1.132
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 +21 -21
- package/components/Chip/ChipStyles.js +22 -50
- package/components/Chip/slots/ChipSlots.js +2 -2
- package/components/Chip/types.d.ts +3 -3
- package/components/DynamicSort/DynamicSort.d.ts +4 -1
- package/components/DynamicSort/DynamicSort.styles.js +88 -126
- package/components/DynamicSort/constants.d.ts +0 -1
- package/components/DynamicSort/constants.js +0 -1
- package/components/DynamicSort/icons.d.ts +2 -0
- package/components/DynamicSort/icons.js +6 -0
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +23 -43
- package/components/DynamicSort/slots/DynamicSortSlots.js +30 -57
- package/components/DynamicSort/slots/SlotsEnum.d.ts +2 -9
- package/components/DynamicSort/slots/SlotsEnum.js +1 -8
- package/components/DynamicSort/store/DynamicSortContext.d.ts +3 -3
- package/components/DynamicSort/store/DynamicSortContext.js +10 -4
- package/components/DynamicSort/store/DynamicSortStore.d.ts +1 -177
- package/components/DynamicSort/store/DynamicSortStore.js +10 -1
- package/components/DynamicSort/store/type.d.ts +186 -0
- package/components/DynamicSort/store/useDynamicSortStore.d.ts +2 -2
- package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSortChip/AppliedSortChip.js +18 -20
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.d.ts +2 -2
- package/components/DynamicSort/subcomponents/AppliedSortChip/useAppliedSortChip.js +4 -4
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.d.ts +1 -1
- package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +14 -2
- package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +4 -3
- package/components/DynamicSort/subcomponents/DynamicSortBase/useDynamicSortBase.d.ts +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/useDynamicSortBase.js +2 -1
- package/components/DynamicSort/subcomponents/FieldTypes/DataTypeComponent.d.ts +1 -1
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.d.ts +8 -8
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/helpers.js +11 -14
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +16 -12
- package/components/DynamicSort/subcomponents/FieldTypes/fieldFactory.d.ts +1 -1
- package/components/DynamicSort/subcomponents/InputSort/InputSort.d.ts +1 -1
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +8 -10
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +9 -8
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +8 -6
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +8 -9
- package/components/DynamicSort/tests/DynamicSort.test.d.ts +1 -0
- package/components/DynamicSort/types.d.ts +9 -2
- package/components/Icon/Icon.js +13 -7
- package/components/Icon/Icon.styles.js +23 -20
- package/components/Icon/types.d.ts +9 -6
- package/components/Label/Label.styles.js +1 -1
- package/components/NumberInput/NumberInput.styles.js +1 -1
- package/components/PaperForm/styles.js +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +1 -1
- package/components/areas/components/AreasAdmin/AreasAdmin.styles.js +1 -1
- package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.styles.js +1 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.styles.js +1 -1
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +1 -1
- package/components/mui_extended/CheckBox/CheckBox.styles.js +1 -1
- package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +1 -1
- package/components/mui_extended/IconButton/IconButton.d.ts +2 -1
- package/components/mui_extended/IconButton/IconButton.js +18 -20
- package/components/mui_extended/IconButton/IconButton.styles.js +118 -162
- package/components/mui_extended/IconButton/types.d.ts +3 -4
- package/components/mui_extended/MenuDivider/MenuDivider.styles.js +1 -1
- package/components/mui_extended/MenuItem/MenuItem.js +27 -20
- package/components/mui_extended/MenuItem/MenuItem.styles.js +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +6 -6
- package/components/mui_extended/NavLink/NavLink.styles.js +1 -1
- package/components/mui_extended/Select/Select.styles.js +1 -3
- package/components/mui_extended/TextField/TextField.styles.js +1 -1
- package/components/mui_extended/Typography/typography.styles.js +1 -2
- package/index.js +7 -7
- package/package.json +1 -1
- package/utils/getSizeStyles/getSizeStyles.d.ts +1 -2
- package/utils/getSizeStyles/getSizeStyles.js +4 -4
- package/components/DynamicSort/DynamicSort.stories.d.ts +0 -21
- package/components/DynamicSort/subcomponents/InputSort/InputSortSkeleton.d.ts +0 -5
- package/components/DynamicSort/subcomponents/InputSort/InputSortSkeleton.js +0 -19
- package/components/DynamicSort/subcomponents/SortActions/SortActionsSkeleton.d.ts +0 -5
- package/components/DynamicSort/subcomponents/SortActions/SortActionsSkeleton.js +0 -12
|
@@ -1,194 +1,150 @@
|
|
|
1
|
+
import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
1
2
|
const iconButtonStyles = {
|
|
2
3
|
/**
|
|
3
4
|
* TODO: Documentar
|
|
4
5
|
*/
|
|
5
|
-
styledMUIIconButton: ({ ownerState, theme }) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
width: theme.vars.size.mobile.medium.action,
|
|
30
|
-
height: theme.vars.size.mobile.medium.action
|
|
31
|
-
} : {
|
|
32
|
-
width: theme.vars.size.desktop.medium.action,
|
|
33
|
-
height: theme.vars.size.desktop.medium.action
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
// Variante text en Finalizado
|
|
37
|
-
...ownerState.variant === "text" && {
|
|
38
|
-
...ownerState.selected === true ? {
|
|
39
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity,
|
|
40
|
-
'& [class*="M4LIcon-icon"]': {
|
|
41
|
-
backgroundColor: ownerState.componentPaletteColor === "default" ? ownerState.paletteColor?.contrastText : ownerState.paletteColor?.active
|
|
6
|
+
styledMUIIconButton: ({ ownerState, theme }) => {
|
|
7
|
+
const paletteColor = ownerState.disabled ? theme.vars.palette["default"] : ownerState.selected ? theme.vars.palette["primary"] : theme.vars.palette[ownerState.componentPaletteColor || "default"];
|
|
8
|
+
return {
|
|
9
|
+
overflow: "hidden",
|
|
10
|
+
cursor: ownerState.disabled ? "not-allowed" : "pointer",
|
|
11
|
+
color: theme.vars.palette.text.primary,
|
|
12
|
+
borderRadius: theme.size.borderRadius.r1,
|
|
13
|
+
pointerEvents: ownerState.disabled ? "none" : "auto",
|
|
14
|
+
display: ownerState.isSkeleton ? "none" : "flex",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
// Override de estilos de Material UI
|
|
17
|
+
padding: 0,
|
|
18
|
+
// condiciones de tamaño
|
|
19
|
+
// condiciones de tamaño Small
|
|
20
|
+
// Tamaño del componente
|
|
21
|
+
...getSizeStyles(
|
|
22
|
+
theme,
|
|
23
|
+
ownerState.size || "medium",
|
|
24
|
+
"action",
|
|
25
|
+
(size) => {
|
|
26
|
+
return {
|
|
27
|
+
width: size,
|
|
28
|
+
height: size
|
|
29
|
+
};
|
|
42
30
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
),
|
|
32
|
+
// Variante text en Finalizado
|
|
33
|
+
...ownerState.variant === "text" && {
|
|
34
|
+
...ownerState.selected === true ? {
|
|
35
|
+
backgroundColor: paletteColor.activeOpacity,
|
|
36
|
+
'& [class*="M4LIcon-icon"]': {
|
|
37
|
+
backgroundColor: ownerState.componentPaletteColor === "default" ? paletteColor.contrastText : paletteColor.semanticText
|
|
38
|
+
}
|
|
39
|
+
} : {
|
|
40
|
+
"&:hover": {
|
|
41
|
+
backgroundColor: paletteColor.hoverOpacity
|
|
42
|
+
},
|
|
43
|
+
//FocusActive
|
|
44
|
+
"&:active": {
|
|
45
|
+
backgroundColor: paletteColor.activeOpacity,
|
|
46
|
+
'& [class*="M4LIcon-icon"]': {
|
|
47
|
+
backgroundColor: ownerState.componentPaletteColor === "default" ? paletteColor.contrastText : paletteColor.active
|
|
48
|
+
}
|
|
49
|
+
}
|
|
46
50
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
"&:focus-visible": {
|
|
52
|
+
background: paletteColor.activeOpacity,
|
|
53
|
+
outline: `1px solid ${theme.vars.palette.border.main}`,
|
|
50
54
|
'& [class*="M4LIcon-icon"]': {
|
|
51
|
-
backgroundColor: ownerState.componentPaletteColor === "default" ?
|
|
55
|
+
backgroundColor: ownerState.componentPaletteColor === "default" ? paletteColor.contrastText : paletteColor.active
|
|
52
56
|
}
|
|
57
|
+
},
|
|
58
|
+
// Variantes text en disabled
|
|
59
|
+
...ownerState.disabled === true && {
|
|
60
|
+
color: theme.vars.palette.action.disabled
|
|
53
61
|
}
|
|
54
62
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// Variantes text en disabled
|
|
63
|
-
...ownerState.disabled === true && {
|
|
64
|
-
color: theme.vars.palette.action.disabled
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
// Variante outline en Finalizada
|
|
68
|
-
...ownerState.variant === "outline" && {
|
|
69
|
-
...ownerState.componentPaletteColor !== "default" && {
|
|
70
|
-
border: `1px solid ${ownerState.paletteColor?.main}`
|
|
71
|
-
},
|
|
72
|
-
...ownerState.componentPaletteColor === "default" && {
|
|
73
|
-
border: `1px solid ${theme.vars.palette.border.default}`
|
|
74
|
-
},
|
|
75
|
-
...ownerState.selected === true ? {
|
|
76
|
-
background: ownerState.paletteColor?.activeOpacity,
|
|
77
|
-
border: `1px solid ${ownerState.paletteColor?.active}`,
|
|
78
|
-
'& [class*="M4LIcon-icon"]': {
|
|
79
|
-
backgroundColor: ownerState.componentPaletteColor === "default" ? theme.vars.palette.text.primary : ownerState.paletteColor?.active
|
|
80
|
-
}
|
|
81
|
-
} : {
|
|
82
|
-
"&:hover": {
|
|
83
|
-
background: ownerState.paletteColor?.hoverOpacity
|
|
63
|
+
// Variante outline en Finalizada
|
|
64
|
+
...ownerState.variant === "outline" && {
|
|
65
|
+
...ownerState.componentPaletteColor !== "default" && {
|
|
66
|
+
border: `1px solid ${paletteColor.main}`
|
|
67
|
+
},
|
|
68
|
+
...ownerState.componentPaletteColor === "default" && {
|
|
69
|
+
border: `1px solid ${theme.vars.palette.border.default}`
|
|
84
70
|
},
|
|
85
|
-
|
|
86
|
-
background:
|
|
87
|
-
border: `1px solid ${
|
|
71
|
+
...ownerState.selected === true ? {
|
|
72
|
+
background: paletteColor.activeOpacity,
|
|
73
|
+
border: `1px solid ${paletteColor.active}`,
|
|
88
74
|
'& [class*="M4LIcon-icon"]': {
|
|
89
|
-
backgroundColor: ownerState.componentPaletteColor === "default" ? theme.vars.palette.text.primary :
|
|
75
|
+
backgroundColor: ownerState.componentPaletteColor === "default" ? theme.vars.palette.text.primary : paletteColor.active
|
|
76
|
+
}
|
|
77
|
+
} : {
|
|
78
|
+
"&:hover": {
|
|
79
|
+
background: paletteColor.hoverOpacity
|
|
80
|
+
},
|
|
81
|
+
"&:active": {
|
|
82
|
+
background: paletteColor.activeOpacity,
|
|
83
|
+
border: `1px solid ${paletteColor.active}`,
|
|
84
|
+
'& [class*="M4LIcon-icon"]': {
|
|
85
|
+
backgroundColor: ownerState.componentPaletteColor === "default" ? theme.vars.palette.text.primary : paletteColor.active
|
|
86
|
+
}
|
|
90
87
|
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
...ownerState.disabled === true && {
|
|
94
|
-
border: `1px solid ${theme.vars.palette.border.default}`
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
// Variantes contained Finalizada
|
|
98
|
-
...ownerState.variant === "contained" && {
|
|
99
|
-
backgroundColor: ownerState.paletteColor?.enabled,
|
|
100
|
-
//Color del icono que cambia
|
|
101
|
-
'& [class*="M4LIcon-icon"]': {
|
|
102
|
-
backgroundColor: ownerState.paletteColor?.contrastText
|
|
103
|
-
},
|
|
104
|
-
// Cuando recibe en la prop `selected` un true se visualiza el modo :active
|
|
105
|
-
...ownerState.selected === true ? {
|
|
106
|
-
background: ownerState.paletteColor?.active
|
|
107
|
-
} : {
|
|
108
|
-
//Estado Hover
|
|
109
|
-
"&:hover": {
|
|
110
|
-
background: ownerState.paletteColor?.hover
|
|
111
88
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
background: ownerState.paletteColor?.active
|
|
89
|
+
...ownerState.disabled === true && {
|
|
90
|
+
border: `1px solid ${theme.vars.palette.border.default}`
|
|
115
91
|
}
|
|
116
92
|
},
|
|
117
|
-
// Variantes contained
|
|
118
|
-
...ownerState.
|
|
119
|
-
|
|
93
|
+
// Variantes contained Finalizada
|
|
94
|
+
...ownerState.variant === "contained" && {
|
|
95
|
+
backgroundColor: paletteColor.enabled,
|
|
96
|
+
//Color del icono que cambia
|
|
120
97
|
'& [class*="M4LIcon-icon"]': {
|
|
121
|
-
|
|
98
|
+
backgroundColor: paletteColor.contrastText
|
|
99
|
+
},
|
|
100
|
+
// Cuando recibe en la prop `selected` un true se visualiza el modo :active
|
|
101
|
+
...ownerState.selected === true ? {
|
|
102
|
+
background: paletteColor.active
|
|
103
|
+
} : {
|
|
104
|
+
//Estado Hover
|
|
105
|
+
"&:hover": {
|
|
106
|
+
background: paletteColor.hover
|
|
107
|
+
},
|
|
108
|
+
//Estado Active
|
|
109
|
+
"&:active": {
|
|
110
|
+
background: paletteColor.active
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
// Variantes contained en disabled
|
|
114
|
+
...ownerState.disabled === true && {
|
|
115
|
+
background: `${paletteColor.main} !important`,
|
|
116
|
+
'& [class*="M4LIcon-icon"]': {
|
|
117
|
+
color: theme.vars.palette.action.disabled
|
|
118
|
+
}
|
|
122
119
|
}
|
|
120
|
+
},
|
|
121
|
+
...ownerState.selected === true && {
|
|
122
|
+
outline: `1px solid ${paletteColor.selected}`,
|
|
123
|
+
outlineOffset: 2
|
|
123
124
|
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
outline: `1px solid ${ownerState.paletteColor?.selected}`,
|
|
127
|
-
outlineOffset: 2
|
|
128
|
-
}
|
|
129
|
-
}),
|
|
125
|
+
};
|
|
126
|
+
},
|
|
130
127
|
/**
|
|
131
128
|
* Comentado por el momento, falta de documentación en Figma de Badge
|
|
132
129
|
*/
|
|
133
|
-
badgeIconButton:
|
|
134
|
-
// '& [class*="MuiBadge-badge"]': {
|
|
135
|
-
// display: 'flex',
|
|
136
|
-
// justifyContent: 'center',
|
|
137
|
-
// alignItems: 'center',
|
|
138
|
-
// fontSize: '11px',
|
|
139
|
-
// backgroundColor: ownerState.paletteColor?.active,
|
|
140
|
-
// color: ownerState.paletteColor?.contrastText,
|
|
141
|
-
// // condiciones de tamaño Small
|
|
142
|
-
// ...(ownerState.size === 'small' && {
|
|
143
|
-
// ...(theme.generalSettings.isMobile
|
|
144
|
-
// ? {
|
|
145
|
-
// width: theme.size.desktop.base.small,
|
|
146
|
-
// height: theme.size.desktop.base.small,
|
|
147
|
-
// }
|
|
148
|
-
// : {
|
|
149
|
-
// width: theme.size.desktop.base.small,
|
|
150
|
-
// height: theme.size.desktop.base.small,
|
|
151
|
-
// }),
|
|
152
|
-
// }),
|
|
153
|
-
// // condiciones de tamaño Medium
|
|
154
|
-
// ...(ownerState.size === 'medium' && {
|
|
155
|
-
// ...(theme.generalSettings.isMobile
|
|
156
|
-
// ? {
|
|
157
|
-
// width: theme.size.mobile.base.medium,
|
|
158
|
-
// height: theme.size.mobile.base.medium,
|
|
159
|
-
// }
|
|
160
|
-
// : {
|
|
161
|
-
// width: theme.size.desktop.base.medium,
|
|
162
|
-
// height: theme.size.desktop.base.medium,
|
|
163
|
-
// }),
|
|
164
|
-
// }),
|
|
165
|
-
// },
|
|
166
|
-
}),
|
|
130
|
+
badgeIconButton: {},
|
|
167
131
|
/**
|
|
168
132
|
* Slot skeleton con sus estilos de tamaño
|
|
169
133
|
*/
|
|
170
134
|
skeleton: ({ theme, ownerState }) => ({
|
|
171
135
|
"&.M4lclassCssSpecificity": {
|
|
172
136
|
// condiciones de tamaño Small
|
|
173
|
-
...
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
137
|
+
...getSizeStyles(
|
|
138
|
+
theme,
|
|
139
|
+
ownerState.size || "medium",
|
|
140
|
+
"action",
|
|
141
|
+
(size) => {
|
|
142
|
+
return {
|
|
143
|
+
width: size,
|
|
144
|
+
height: size
|
|
145
|
+
};
|
|
180
146
|
}
|
|
181
|
-
|
|
182
|
-
// condiciones de tamaño Medium
|
|
183
|
-
...ownerState.size === "medium" && {
|
|
184
|
-
...theme.generalSettings.isMobile ? {
|
|
185
|
-
width: theme.vars.size.mobile.medium.action,
|
|
186
|
-
height: theme.vars.size.mobile.medium.action
|
|
187
|
-
} : {
|
|
188
|
-
width: theme.vars.size.desktop.medium.action,
|
|
189
|
-
height: theme.vars.size.desktop.medium.action
|
|
190
|
-
}
|
|
191
|
-
}
|
|
147
|
+
)
|
|
192
148
|
}
|
|
193
149
|
})
|
|
194
150
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
2
|
-
import {
|
|
2
|
+
import { Theme } from '@mui/material/styles';
|
|
3
3
|
import { IconProps } from '../../Icon/types';
|
|
4
4
|
import { IconButtonProps as MUIIconButtonProps } from '@mui/material';
|
|
5
5
|
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
@@ -32,7 +32,7 @@ export type IconButtonSize = 'small' | 'medium';
|
|
|
32
32
|
* [disabled] - Whether the IconButton is disabled.
|
|
33
33
|
* [instaceDataTestId] - A unique identifier for the HTML element, useful for unit and integration testing.
|
|
34
34
|
*/
|
|
35
|
-
export interface IconButtonProps extends Omit<IconProps, 'size' | 'color' | 'src'>, Omit<MUIIconButtonProps, 'size' | 'color' | 'disabled' | 'src'>, Pick<BadgeProps, 'badgeContent'>, Pick<TooltipProps, 'placement'> {
|
|
35
|
+
export interface IconButtonProps extends Omit<IconProps, 'size' | 'color' | 'src' | 'selected' | 'enabledSelected'>, Omit<MUIIconButtonProps, 'size' | 'color' | 'disabled' | 'src'>, Pick<BadgeProps, 'badgeContent'>, Pick<TooltipProps, 'placement'> {
|
|
36
36
|
/**
|
|
37
37
|
* Define el uso de tooltip en IconButton
|
|
38
38
|
*/
|
|
@@ -48,7 +48,7 @@ export interface IconButtonProps extends Omit<IconProps, 'size' | 'color' | 'src
|
|
|
48
48
|
/**
|
|
49
49
|
* Define el tamaño del componente
|
|
50
50
|
*/
|
|
51
|
-
size?: Sizes
|
|
51
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
52
52
|
/**
|
|
53
53
|
* Define el mensaje interno del tooltip
|
|
54
54
|
*/
|
|
@@ -85,7 +85,6 @@ export interface IconButtonProps extends Omit<IconProps, 'size' | 'color' | 'src
|
|
|
85
85
|
*/
|
|
86
86
|
export type IconButtonOwnerState = Pick<IconButtonProps, 'size' | 'variant' | 'componentPaletteColor' | 'selected'> & {
|
|
87
87
|
disabled?: boolean;
|
|
88
|
-
paletteColor: PaletteColor;
|
|
89
88
|
isSkeleton: boolean;
|
|
90
89
|
};
|
|
91
90
|
/**
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import React, { useMemo, cloneElement } from "react";
|
|
4
5
|
import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
|
|
5
6
|
import { M as MENUITEM_CLASSES } from "./constants.js";
|
|
6
|
-
import { M as
|
|
7
|
+
import { M as MenuItemIconStyled, a as MenuItemSkeletonStyled, b as MenuItemRootStyled, c as MenuItemIconCheckedStyled, d as MenuItemContainerStyled, e as MenuItemTypographyStyled } from "./slots/MenuItemSlots.js";
|
|
7
8
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
9
|
const MenuItem = (props) => {
|
|
9
10
|
const {
|
|
@@ -25,36 +26,25 @@ const MenuItem = (props) => {
|
|
|
25
26
|
const isSkeleton = useModuleSkeleton();
|
|
26
27
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
27
28
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
28
|
-
const ownerState = {
|
|
29
|
+
const ownerState = useMemo(() => ({
|
|
29
30
|
size: adjustedSize,
|
|
30
31
|
disabled,
|
|
31
32
|
selected,
|
|
32
33
|
color,
|
|
33
34
|
checkable,
|
|
34
35
|
checked
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
MenuItemSkeletonStyled,
|
|
39
|
-
{
|
|
40
|
-
"data-testid": "SkeletonMenuItem",
|
|
41
|
-
width: skeletonWidth,
|
|
42
|
-
ownerState: { ...ownerState },
|
|
43
|
-
className: MENUITEM_CLASSES.skeleton
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
const renderIcon = (icon, instaceDataTestId, classNameIcon) => {
|
|
48
|
-
if (!icon) {
|
|
36
|
+
}), [adjustedSize, disabled, selected, color, checkable, checked]);
|
|
37
|
+
const renderIcon = useMemo(() => (icon, instaceDataTestId, classNameIcon) => {
|
|
38
|
+
if (!icon || typeof icon === "boolean" || typeof icon === "number") {
|
|
49
39
|
return null;
|
|
50
40
|
}
|
|
51
|
-
if (typeof icon
|
|
52
|
-
return icon;
|
|
53
|
-
} else {
|
|
41
|
+
if (typeof icon === "string") {
|
|
54
42
|
return /* @__PURE__ */ jsx(
|
|
55
43
|
MenuItemIconStyled,
|
|
56
44
|
{
|
|
57
45
|
ownerState: { ...ownerState },
|
|
46
|
+
selected,
|
|
47
|
+
enabledSelected: true,
|
|
58
48
|
src: icon,
|
|
59
49
|
alt: "icon",
|
|
60
50
|
size: adjustedSize,
|
|
@@ -64,7 +54,24 @@ const MenuItem = (props) => {
|
|
|
64
54
|
}
|
|
65
55
|
);
|
|
66
56
|
}
|
|
67
|
-
|
|
57
|
+
if (React.isValidElement(icon)) {
|
|
58
|
+
return cloneElement(icon, {
|
|
59
|
+
selected
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}, [ownerState, adjustedSize, disabled, selected]);
|
|
64
|
+
if (isSkeleton) {
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
MenuItemSkeletonStyled,
|
|
67
|
+
{
|
|
68
|
+
"data-testid": "SkeletonMenuItem",
|
|
69
|
+
width: skeletonWidth,
|
|
70
|
+
ownerState: { ...ownerState },
|
|
71
|
+
className: MENUITEM_CLASSES.skeleton
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
68
75
|
const checkedIcon = `${host_static_assets}/${environment_assets}/frontend/components/menu_item/checked.svg`;
|
|
69
76
|
return /* @__PURE__ */ jsxs(
|
|
70
77
|
MenuItemRootStyled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
2
|
const menuItemStyles = {
|
|
3
3
|
/**
|
|
4
4
|
* Estilos para el contenedor de los items del menú contenedor
|
|
@@ -31,10 +31,10 @@ const MenuItemSkeletonStyled = styled(Skeleton, {
|
|
|
31
31
|
slot: MenuItemSlots.skeletonMenuItem
|
|
32
32
|
})(menuItemStyles?.skeletonMenuItem);
|
|
33
33
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
MenuItemIconStyled as M,
|
|
35
|
+
MenuItemSkeletonStyled as a,
|
|
36
|
+
MenuItemRootStyled as b,
|
|
37
|
+
MenuItemIconCheckedStyled as c,
|
|
38
|
+
MenuItemContainerStyled as d,
|
|
39
|
+
MenuItemTypographyStyled as e
|
|
40
40
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
2
|
import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
|
|
3
3
|
const navLinkStyles = {
|
|
4
4
|
/* *
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SELECT_CLASSES } from "./constants.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as getHeightSizeStyles, g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
3
|
const selectStyles = {
|
|
4
4
|
/**
|
|
5
5
|
* Estilos para el componente Select
|
|
@@ -64,7 +64,6 @@ const selectStyles = {
|
|
|
64
64
|
// Tamaño del componente
|
|
65
65
|
...getSizeStyles(
|
|
66
66
|
theme,
|
|
67
|
-
theme.generalSettings.isMobile,
|
|
68
67
|
ownerState.size || "medium",
|
|
69
68
|
"action",
|
|
70
69
|
(height) => {
|
|
@@ -136,7 +135,6 @@ const selectStyles = {
|
|
|
136
135
|
// Estilos específicos para el tamaño small
|
|
137
136
|
...getSizeStyles(
|
|
138
137
|
theme,
|
|
139
|
-
theme.generalSettings.isMobile,
|
|
140
138
|
ownerState.size || "medium",
|
|
141
139
|
"action",
|
|
142
140
|
(height) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
3
|
import { T as TEXT_FIELD_CLASSES } from "./constants.js";
|
|
4
4
|
const textFieldStyles = {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
2
|
import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
|
|
3
3
|
const typographyStyles = {
|
|
4
4
|
/**
|
|
@@ -42,7 +42,6 @@ const typographyStyles = {
|
|
|
42
42
|
skeleton: ({ theme, ownerState }) => ({
|
|
43
43
|
...getSizeStyles(
|
|
44
44
|
theme,
|
|
45
|
-
theme.generalSettings.isMobile,
|
|
46
45
|
ownerState.size || "medium",
|
|
47
46
|
"base"
|
|
48
47
|
)
|
package/index.js
CHANGED
|
@@ -205,11 +205,11 @@ import { i as i2 } from "./utils/isValidDate.js";
|
|
|
205
205
|
import { g as g26 } from "./utils/getComponentUtilityClass.js";
|
|
206
206
|
import { g as g27 } from "./utils/getPaletteColor.js";
|
|
207
207
|
import { g as g28 } from "./utils/getTypographyStyles.js";
|
|
208
|
-
import {
|
|
208
|
+
import { a as a15 } from "./utils/getSizeStyles/getSizeStyles.js";
|
|
209
209
|
import { O as O2 } from "./utils/ObjectQueue.js";
|
|
210
|
-
import { g as
|
|
210
|
+
import { g as g29, a as a16 } from "./utils/getComponentSlotRoot.js";
|
|
211
211
|
import { f } from "./utils/formatDistanceToNow/formatDistanteToNow.js";
|
|
212
|
-
import { W as W7, c as c6, b as b4, a as
|
|
212
|
+
import { W as W7, c as c6, b as b4, a as a17, e as e3, d as d7, f as f2 } from "./vendor.js";
|
|
213
213
|
export {
|
|
214
214
|
A5 as AREAS_DICCTIONARY,
|
|
215
215
|
a4 as AREAS_DICTIONARY_ID,
|
|
@@ -386,7 +386,7 @@ export {
|
|
|
386
386
|
W7 as WithContexts,
|
|
387
387
|
c6 as WithFormAutoValidation,
|
|
388
388
|
b4 as WithForms,
|
|
389
|
-
|
|
389
|
+
a17 as WithPopupsProvider,
|
|
390
390
|
e3 as WithScaleIcons,
|
|
391
391
|
d7 as WithWindowsContainer,
|
|
392
392
|
f2 as WithWrapper,
|
|
@@ -406,8 +406,8 @@ export {
|
|
|
406
406
|
b2 as getAreasComponentsDictionary,
|
|
407
407
|
g3 as getAreasDictionary,
|
|
408
408
|
g14 as getCommonActionsDictionary,
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
g29 as getComponentClasses,
|
|
410
|
+
a16 as getComponentSlotRoot,
|
|
411
411
|
g26 as getComponentUtilityClass,
|
|
412
412
|
g as getDataGridComponentsDictionary,
|
|
413
413
|
g2 as getDataGridRowsFromSet,
|
|
@@ -420,7 +420,7 @@ export {
|
|
|
420
420
|
g9 as getFormatPoints,
|
|
421
421
|
g11 as getFormatPrice,
|
|
422
422
|
g13 as getFormattersComponentsDictionary,
|
|
423
|
-
|
|
423
|
+
a15 as getHeightSizeStyles,
|
|
424
424
|
g17 as getLoadingErrorComponentsDictionary,
|
|
425
425
|
g18 as getMFLoaderComponentsDictionary,
|
|
426
426
|
a8 as getMenuActionsComponentsDictionary,
|
package/package.json
CHANGED
|
@@ -16,7 +16,6 @@ export declare const getHeightSizeStyles: (isMobile: boolean, size: Extract<Size
|
|
|
16
16
|
/**
|
|
17
17
|
* Utilidad que se encarga de obtener los estilos de tamaño para ser usados en el css de los componentes.
|
|
18
18
|
* @param theme - Objeto de tema de MUI.
|
|
19
|
-
* @param isMobile - Modalidad de dispositivo en el que se encuentra la aplicación (Escritorio y móvil). Se espera que se obtenga del objeto
|
|
20
19
|
* theme.generalSettings.isMobile.
|
|
21
20
|
* @param size - Formato de tamaño definido por el componente o el contexto de AppearanceComponentProvider, puede ser small,
|
|
22
21
|
* medium o large.
|
|
@@ -25,4 +24,4 @@ export declare const getHeightSizeStyles: (isMobile: boolean, size: Extract<Size
|
|
|
25
24
|
* @param property - Propiedad CSS que se desea aplicar (por defecto es 'height').
|
|
26
25
|
* @returns Objeto con los estilos calculados.
|
|
27
26
|
*/
|
|
28
|
-
export declare const getSizeStyles: (theme: Theme,
|
|
27
|
+
export declare const getSizeStyles: (theme: Theme, size: Extract<Sizes, "small" | "medium">, variantSize: SizesComponentsTypes, css?: Record<string, any> | ((sizeValue: string | number) => Record<string, any>), property?: "height" | "width") => any;
|
|
@@ -8,8 +8,8 @@ const getHeightSizeStyles = (isMobile, size, variantSize, css) => {
|
|
|
8
8
|
...resolvedCss
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
const getSizeStyles = (theme,
|
|
12
|
-
const sizeValue = theme.vars.size[isMobile ? "mobile" : "desktop"][size][variantSize];
|
|
11
|
+
const getSizeStyles = (theme, size, variantSize, css, property = "height") => {
|
|
12
|
+
const sizeValue = theme.vars.size[theme.generalSettings.isMobile ? "mobile" : "desktop"][size][variantSize];
|
|
13
13
|
const resolvedCss = typeof css === "function" ? css(sizeValue) : css;
|
|
14
14
|
return {
|
|
15
15
|
[property]: sizeValue,
|
|
@@ -17,6 +17,6 @@ const getSizeStyles = (theme, isMobile, size, variantSize, css, property = "heig
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
getHeightSizeStyles as a,
|
|
21
|
+
getSizeStyles as g
|
|
22
22
|
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { DynamicSort } from './DynamicSort';
|
|
3
|
-
declare const meta: Meta<typeof DynamicSort>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof DynamicSort>;
|
|
6
|
-
/**
|
|
7
|
-
* Base DynamicSort component
|
|
8
|
-
*/
|
|
9
|
-
export declare const Base: Story;
|
|
10
|
-
/**
|
|
11
|
-
* DynamicSort in skeleton mode
|
|
12
|
-
*/
|
|
13
|
-
export declare const WithSkeleton: Story;
|
|
14
|
-
/**
|
|
15
|
-
* DynamicFilter With fixed field
|
|
16
|
-
*/
|
|
17
|
-
export declare const WithFixedField: Story;
|
|
18
|
-
/**
|
|
19
|
-
* DynamicFilter With props `automatic=true`
|
|
20
|
-
*/
|
|
21
|
-
export declare const WithAutomatic: Story;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Skeleton } from "@mui/material";
|
|
3
|
-
function InputFilterSkeleton() {
|
|
4
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5
|
-
/* @__PURE__ */ jsx(
|
|
6
|
-
Skeleton,
|
|
7
|
-
{
|
|
8
|
-
variant: "circular",
|
|
9
|
-
width: "16px",
|
|
10
|
-
height: "16px",
|
|
11
|
-
sx: { minWidth: "16px", minHeight: "16px" }
|
|
12
|
-
}
|
|
13
|
-
),
|
|
14
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: "16px", sx: { minWidth: "80px" } })
|
|
15
|
-
] });
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
InputFilterSkeleton as I
|
|
19
|
-
};
|