@m4l/components 9.3.19-BE241025-beta.1 → 9.3.19-BE241025-beta.3
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/AccountPopover/subcomponents/MenuPopover/MenuPopover.js +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +2 -2
- package/components/mui_extended/Autocomplete/Autocomplete.js +82 -57
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +4 -2
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +2 -2
- package/components/mui_extended/MenuItem/MenuItem.styles.js +4 -1
- package/package.json +2 -2
|
@@ -64,7 +64,7 @@ const MenuPopover = (props) => {
|
|
|
64
64
|
/* @__PURE__ */ jsx(DividerStyled, {}),
|
|
65
65
|
asyncState === "loading" ? /* @__PURE__ */ jsx(CircularProgressStyled, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
66
66
|
/* @__PURE__ */ jsx(MenuItemSettingsStyled, { skeletonWidth: `calc(${getLabel("account_popover.label_settings").length}ex + ${sp2})`, onClick: handleClickSetting, label: getLabel("account_popover.label_settings"), endIcon: `${host_static_assets}/${environment_assets}/${PATH_CONFIGURATION}` }),
|
|
67
|
-
data.map((option) => /* @__PURE__ */ jsx(MenuItemStyled, { variant: "body", skeletonWidth: `calc(${option.title.length}ex + ${sp2})`, onClick: () => handleItemClick(option), label: option.title }, `${option.title}-${option.module_id}`)),
|
|
67
|
+
data.length > 0 && Array.isArray(data) && data.map((option) => /* @__PURE__ */ jsx(MenuItemStyled, { variant: "body", skeletonWidth: `calc(${option.title.length}ex + ${sp2})`, onClick: () => handleItemClick(option), label: option.title }, `${option.title}-${option.module_id}`)),
|
|
68
68
|
/* @__PURE__ */ jsx(DividerStyled, {})
|
|
69
69
|
] }),
|
|
70
70
|
/* @__PURE__ */ jsx(MenuItemLogoutStyled, { variant: "body", skeletonWidth: `calc(${getLabel("account_popover.label_logout").length}ex + ${sp2})`, onClick: handleLogout, label: getLabel("account_popover.label_logout"), endIcon: `${host_static_assets}/${environment_assets}/${PATH_SIGN_OFF}` })
|
|
@@ -134,9 +134,9 @@ function MFIsolationApp(props) {
|
|
|
134
134
|
onLoad,
|
|
135
135
|
loadAreasFromNetwork: activeAreasNetwork,
|
|
136
136
|
loadCookiesFromNetwork: activeCookiesFromNetwork,
|
|
137
|
-
children: /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "100%", flexDirection: "column",
|
|
137
|
+
children: /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "100%", flexDirection: "column", position: "absolute", children: [
|
|
138
138
|
appBarSettings && /* @__PURE__ */ jsx(AppBarSettings, {}),
|
|
139
|
-
/* @__PURE__ */ jsx(Stack, { width: "100%", flexGrow: 1, flexDirection: "column",
|
|
139
|
+
/* @__PURE__ */ jsx(Stack, { width: "100%", flexGrow: 1, flexDirection: "column", position: "relative", children })
|
|
140
140
|
] })
|
|
141
141
|
}
|
|
142
142
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
|
-
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { forwardRef, useMemo, useCallback } from "react";
|
|
4
4
|
import { r as renderOption } from "./renderOptions/index.js";
|
|
5
5
|
import { u as useValuesAndHandlers } from "./hooks/useValuesAndHandlers.js";
|
|
6
6
|
import { u as useStartAdornments } from "./hooks/useStartAdornments.js";
|
|
7
7
|
import { u as useEndAdornments } from "./hooks/useEndAdornments.js";
|
|
8
8
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
9
|
-
import {
|
|
9
|
+
import { P as PopperComponentStyled, R as RenderInputStyled, S as SkeletonAutocompleteStyled, A as AutocompleteRootStyled } from "./slots/AutocompleteSlots.js";
|
|
10
10
|
import { T as Typography } from "../Typography/Typography.js";
|
|
11
11
|
function AutocompleteComponent(props, ref) {
|
|
12
12
|
const {
|
|
@@ -78,6 +78,81 @@ function AutocompleteComponent(props, ref) {
|
|
|
78
78
|
open,
|
|
79
79
|
readOnly
|
|
80
80
|
});
|
|
81
|
+
const MemoizedPopperComponent = useCallback((popperProps) => {
|
|
82
|
+
const { color: popperColor, ...otherPopperProps } = popperProps;
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
PopperComponentStyled,
|
|
85
|
+
{
|
|
86
|
+
...otherPopperProps,
|
|
87
|
+
size: adjustedSize,
|
|
88
|
+
placement: "bottom-start",
|
|
89
|
+
ownerState: { ...ownerState }
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}, [adjustedSize, ownerState]);
|
|
93
|
+
const memoizedRenderOption = useCallback((renderProps, option) => {
|
|
94
|
+
const isSelected = multiple ? Array.isArray(selectedValue) && selectedValue.some((val) => isOptionEqualToValueLocal(option, val)) : isOptionEqualToValueLocal(option, selectedValue);
|
|
95
|
+
return renderOption(renderProps, {
|
|
96
|
+
...typeof option === "object" && option !== null ? option : {},
|
|
97
|
+
label: getOptionLabelLocal(option),
|
|
98
|
+
selected: isSelected,
|
|
99
|
+
disabled,
|
|
100
|
+
size
|
|
101
|
+
}, getOptionStartAdornment, getOptionEndAdornment);
|
|
102
|
+
}, [
|
|
103
|
+
multiple,
|
|
104
|
+
selectedValue,
|
|
105
|
+
isOptionEqualToValueLocal,
|
|
106
|
+
getOptionLabelLocal,
|
|
107
|
+
disabled,
|
|
108
|
+
size,
|
|
109
|
+
getOptionStartAdornment,
|
|
110
|
+
getOptionEndAdornment
|
|
111
|
+
]);
|
|
112
|
+
const memoizedRenderInput = useCallback((params) => {
|
|
113
|
+
const { InputLabelProps, inputProps, InputProps, ...renderInputOhers } = params;
|
|
114
|
+
const { className: _classNoCount, ...otherInputProps } = InputProps;
|
|
115
|
+
const { className: _ClassNoCount2, ...otherinputProps } = inputProps;
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
RenderInputStyled,
|
|
118
|
+
{
|
|
119
|
+
variant,
|
|
120
|
+
ownerState: { ...ownerState },
|
|
121
|
+
InputLabelProps: {
|
|
122
|
+
...InputLabelProps,
|
|
123
|
+
shrink: true
|
|
124
|
+
},
|
|
125
|
+
inputProps: { ...otherinputProps, id: htmlFor },
|
|
126
|
+
error,
|
|
127
|
+
...renderInputOhers,
|
|
128
|
+
autoComplete: "off",
|
|
129
|
+
InputProps: {
|
|
130
|
+
...otherInputProps,
|
|
131
|
+
startAdornment: startAdornments,
|
|
132
|
+
endAdornment: endAdornments,
|
|
133
|
+
readOnly
|
|
134
|
+
},
|
|
135
|
+
SelectProps: { native: true },
|
|
136
|
+
size: adjustedSize,
|
|
137
|
+
fullWidth: true,
|
|
138
|
+
disabled,
|
|
139
|
+
placeholder
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}, [
|
|
143
|
+
variant,
|
|
144
|
+
ownerState,
|
|
145
|
+
htmlFor,
|
|
146
|
+
error,
|
|
147
|
+
startAdornments,
|
|
148
|
+
endAdornments,
|
|
149
|
+
readOnly,
|
|
150
|
+
adjustedSize,
|
|
151
|
+
disabled,
|
|
152
|
+
placeholder
|
|
153
|
+
]);
|
|
154
|
+
const memoizedLoadingText = useMemo(() => /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: getLabel("autocomplete.loading_options") }), [adjustedSize, getLabel]);
|
|
155
|
+
const memoizedNoOptionsText = useMemo(() => /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: getLabel("autocomplete.no_options") }), [adjustedSize, getLabel]);
|
|
81
156
|
if (isSkeleton) {
|
|
82
157
|
return /* @__PURE__ */ jsx(
|
|
83
158
|
SkeletonAutocompleteStyled,
|
|
@@ -99,18 +174,7 @@ function AutocompleteComponent(props, ref) {
|
|
|
99
174
|
options,
|
|
100
175
|
getOptionLabel: getOptionLabelLocal,
|
|
101
176
|
clearOnBlur: false,
|
|
102
|
-
PopperComponent:
|
|
103
|
-
const { color: popperColor, ...otherPopperProps } = popperProps;
|
|
104
|
-
return /* @__PURE__ */ jsx(
|
|
105
|
-
PopperComponentStyled,
|
|
106
|
-
{
|
|
107
|
-
...otherPopperProps,
|
|
108
|
-
size: adjustedSize,
|
|
109
|
-
placement: "bottom-start",
|
|
110
|
-
ownerState: { ...ownerState }
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
},
|
|
177
|
+
PopperComponent: MemoizedPopperComponent,
|
|
114
178
|
isOptionEqualToValue: isOptionEqualToValueLocal,
|
|
115
179
|
value: selectedValue,
|
|
116
180
|
inputValue,
|
|
@@ -120,20 +184,11 @@ function AutocompleteComponent(props, ref) {
|
|
|
120
184
|
onInputChange: handleInputChange,
|
|
121
185
|
onChange: handleChange,
|
|
122
186
|
loading,
|
|
123
|
-
loadingText:
|
|
187
|
+
loadingText: memoizedLoadingText,
|
|
124
188
|
disabled,
|
|
125
|
-
noOptionsText:
|
|
189
|
+
noOptionsText: memoizedNoOptionsText,
|
|
126
190
|
filterOptions: onChangeFilterParmsLocal ? (x) => x : void 0,
|
|
127
|
-
renderOption:
|
|
128
|
-
const isSelected = multiple ? Array.isArray(selectedValue) && selectedValue.some((val) => isOptionEqualToValueLocal(option, val)) : isOptionEqualToValueLocal(option, selectedValue);
|
|
129
|
-
return renderOption(renderProps, {
|
|
130
|
-
...typeof option === "object" && option !== null ? option : {},
|
|
131
|
-
label: getOptionLabelLocal(option),
|
|
132
|
-
selected: isSelected,
|
|
133
|
-
disabled,
|
|
134
|
-
size
|
|
135
|
-
}, getOptionStartAdornment, getOptionEndAdornment);
|
|
136
|
-
},
|
|
191
|
+
renderOption: memoizedRenderOption,
|
|
137
192
|
ListboxProps: {
|
|
138
193
|
//Esto para no perder el scroll de la lista de opciones, cuando es multiple, ya que MUI no lo guarda
|
|
139
194
|
onScroll: (event) => {
|
|
@@ -148,37 +203,7 @@ function AutocompleteComponent(props, ref) {
|
|
|
148
203
|
}
|
|
149
204
|
}
|
|
150
205
|
},
|
|
151
|
-
renderInput:
|
|
152
|
-
const { InputLabelProps, inputProps, InputProps, ...renderInputOhers } = params;
|
|
153
|
-
const { className: _classNoCount, ...otherInputProps } = InputProps;
|
|
154
|
-
const { className: _ClassNoCount2, ...otherinputProps } = inputProps;
|
|
155
|
-
return /* @__PURE__ */ jsx(
|
|
156
|
-
RenderInputStyled,
|
|
157
|
-
{
|
|
158
|
-
variant,
|
|
159
|
-
ownerState: { ...ownerState },
|
|
160
|
-
InputLabelProps: {
|
|
161
|
-
...InputLabelProps,
|
|
162
|
-
shrink: true
|
|
163
|
-
},
|
|
164
|
-
inputProps: { ...otherinputProps, id: htmlFor },
|
|
165
|
-
error,
|
|
166
|
-
...renderInputOhers,
|
|
167
|
-
autoComplete: "off",
|
|
168
|
-
InputProps: {
|
|
169
|
-
...otherInputProps,
|
|
170
|
-
startAdornment: startAdornments,
|
|
171
|
-
endAdornment: endAdornments,
|
|
172
|
-
readOnly
|
|
173
|
-
},
|
|
174
|
-
SelectProps: { native: true },
|
|
175
|
-
size: adjustedSize,
|
|
176
|
-
fullWidth: true,
|
|
177
|
-
disabled,
|
|
178
|
-
placeholder
|
|
179
|
-
}
|
|
180
|
-
);
|
|
181
|
-
}
|
|
206
|
+
renderInput: memoizedRenderInput
|
|
182
207
|
}
|
|
183
208
|
);
|
|
184
209
|
}
|
|
@@ -108,9 +108,11 @@ const autocompleteSyles = {
|
|
|
108
108
|
minWidth: "100%",
|
|
109
109
|
maxHeight: "200px",
|
|
110
110
|
"& .MuiAutocomplete-listbox": {
|
|
111
|
+
display: "grid",
|
|
112
|
+
gridTemplateColumns: "auto",
|
|
111
113
|
height: "100%",
|
|
112
114
|
"& .M4LMenuItem-root ": {
|
|
113
|
-
width: "
|
|
115
|
+
width: "100%",
|
|
114
116
|
"& .M4LTypography-root": {
|
|
115
117
|
width: "fit-content",
|
|
116
118
|
overflow: "unset"
|
|
@@ -120,7 +122,7 @@ const autocompleteSyles = {
|
|
|
120
122
|
}
|
|
121
123
|
}),
|
|
122
124
|
/**
|
|
123
|
-
*
|
|
125
|
+
* styles for the circular progress component.
|
|
124
126
|
*/
|
|
125
127
|
circularProgress: {},
|
|
126
128
|
/**
|
|
@@ -5,9 +5,9 @@ import { I as Image } from "../../../Image/Image.js";
|
|
|
5
5
|
import { a as autocompleteSyles } from "../Autocomplete.styles.js";
|
|
6
6
|
import { A as AUTOCOMPLETE_KEY_COMPONENT } from "../constants.js";
|
|
7
7
|
import { A as AutocompleteSlots } from "./AutocompleteEnum.js";
|
|
8
|
-
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
9
|
-
import { T as TextField } from "../../TextField/TextField.js";
|
|
10
8
|
import { P as Popper } from "../../Popper/Popper.js";
|
|
9
|
+
import { T as TextField } from "../../TextField/TextField.js";
|
|
10
|
+
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
11
11
|
import { I as IconButton } from "../../IconButton/IconButton.js";
|
|
12
12
|
import { T as Typography } from "../../Typography/Typography.js";
|
|
13
13
|
import { C as CircularProgress } from "../../CircularProgress/CircularProgress.js";
|
|
@@ -17,6 +17,8 @@ const menuItemStyles = {
|
|
|
17
17
|
paddingLeft: theme.vars.size.baseSpacings.sp4,
|
|
18
18
|
paddingRight: theme.vars.size.baseSpacings.sp4,
|
|
19
19
|
borderRadius: theme.vars.size.borderRadius.r0,
|
|
20
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
21
|
+
borderLeftColor: "transparent",
|
|
20
22
|
// Estilos base para el texto y el ícono
|
|
21
23
|
"&&& .M4LTypography-root": {
|
|
22
24
|
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
@@ -46,10 +48,11 @@ const menuItemStyles = {
|
|
|
46
48
|
// outlineOffset: theme.vars.size.baseSpacings['sp0-5'],
|
|
47
49
|
// },
|
|
48
50
|
...ownerState?.selected && {
|
|
49
|
-
borderLeft: theme.vars.size.borderStroke.container,
|
|
50
51
|
borderLeftColor: paletteColor.enabled
|
|
51
52
|
},
|
|
52
53
|
"& .M4LImage-root": {
|
|
54
|
+
marginRight: 6,
|
|
55
|
+
marginLeft: 6,
|
|
53
56
|
...getHeightSizeStyles(
|
|
54
57
|
theme.generalSettings.isMobile,
|
|
55
58
|
ownerState?.size || "medium",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.3.19-BE241025-beta.
|
|
3
|
+
"version": "9.3.19-BE241025-beta.3",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "M4L Components",
|
|
6
6
|
"lint-staged": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@googlemaps/js-api-loader": "^1.16.6",
|
|
12
12
|
"@hookform/resolvers": "2.9.11",
|
|
13
13
|
"@m4l/core": "^2.0.0",
|
|
14
|
-
"@m4l/graphics": "7.2.0-
|
|
14
|
+
"@m4l/graphics": "7.2.0-BE241025-beta.1",
|
|
15
15
|
"@m4l/styles": "7.1.34-BE171025-beta.1",
|
|
16
16
|
"@mui/lab": "5.0.0-alpha.173",
|
|
17
17
|
"@mui/material": "5.16.7",
|