@m4l/components 9.1.56 → 9.1.57
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/augmentations.d.ts +7 -0
- package/components/Chip/ChipStyles.js +1 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.d.ts +4 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.js +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +7 -1
- package/components/formatters/PointsFormatter/PointsFormatter.d.ts +22 -0
- package/components/formatters/PointsFormatter/PointsFormatter.js +51 -0
- package/components/formatters/PointsFormatter/PointsFormatter.styles.d.ts +2 -0
- package/components/formatters/PointsFormatter/PointsFormatter.styles.js +17 -0
- package/components/formatters/PointsFormatter/constants.d.ts +1 -0
- package/components/formatters/PointsFormatter/constants.js +4 -0
- package/components/formatters/PointsFormatter/slots/PointsFormatterEnum.d.ts +3 -0
- package/components/formatters/PointsFormatter/slots/PointsFormatterEnum.js +7 -0
- package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.d.ts +1 -0
- package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.js +12 -0
- package/components/formatters/PointsFormatter/tests/PointsFormatter.test.d.ts +1 -0
- package/components/formatters/PointsFormatter/types.d.ts +32 -2
- package/components/formatters/index.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +2 -20
- package/components/hook-form/RHFAutocomplete/types.d.ts +2 -8
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +16 -3
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts +3 -7
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/mui_extended/Autocomplete/Autocomplete.d.ts +1 -1
- package/components/mui_extended/Autocomplete/Autocomplete.js +114 -116
- package/components/mui_extended/Autocomplete/{AutocompleteStyles.js → Autocomplete.styles.js} +20 -28
- package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +3 -3
- package/components/mui_extended/Autocomplete/renderOptions/index.js +18 -20
- package/components/mui_extended/Autocomplete/slots /AutocompleteSlots.d.ts +12 -12
- package/components/mui_extended/Autocomplete/slots /AutocompleteSlots.js +6 -7
- package/components/mui_extended/Autocomplete/types.d.ts +18 -35
- package/components/mui_extended/TextField/TextField.d.ts +1 -1
- package/components/mui_extended/TextField/TextField.js +5 -3
- package/components/mui_extended/TextField/TextField.styles.js +2 -2
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +2 -2
- package/components/mui_extended/TextField/types.d.ts +3 -3
- package/index.js +1 -1
- package/package.json +1 -1
- package/components/formatters/PointsFormatter/index.d.ts +0 -9
- package/components/formatters/PointsFormatter/index.js +0 -25
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsyncStyles.js +0 -6
- package/components/hook-form/RHFAutocompleteAsync/constants.js +0 -4
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteEnumAsync.js +0 -7
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.js +0 -12
- package/components/hook-form/RHFAutocompleteAsync/slots/index.js +0 -1
- /package/components/mui_extended/Autocomplete/{AutocompleteStyles.d.ts → Autocomplete.styles.d.ts} +0 -0
|
@@ -1,52 +1,37 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useModuleDictionary, useModuleSkeleton, useEnvironment
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
3
|
+
import { forwardRef, useState, useEffect, useCallback, useMemo } from "react";
|
|
4
|
+
import { r as renderOption } from "./renderOptions/index.js";
|
|
5
|
+
import { Autocomplete as Autocomplete$1 } from "@mui/material";
|
|
6
6
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
7
|
-
import {
|
|
7
|
+
import { C as ChipStyled, I as ImageStyled, a as CircularProgressStyled, b as IconButtonStyled, S as SkeletonAutocompleteStyled, P as PopperComponentStyled, R as RenderInputStyled } from "./slots /AutocompleteSlots.js";
|
|
8
8
|
import { T as Typography } from "../Typography/Typography.js";
|
|
9
9
|
const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
10
10
|
const {
|
|
11
11
|
getOptionLabel,
|
|
12
12
|
isOptionEqualToValue,
|
|
13
|
-
skeletonWidth = 100,
|
|
14
13
|
options,
|
|
15
14
|
disabled,
|
|
16
15
|
onOpen,
|
|
17
16
|
onClose,
|
|
18
17
|
loading,
|
|
19
18
|
variant = "outlined",
|
|
20
|
-
helperMessage,
|
|
21
19
|
size = "medium",
|
|
22
20
|
onChangeFilterParmsLocal,
|
|
23
21
|
multiple,
|
|
24
|
-
imageScale = true,
|
|
25
|
-
//Diferencia
|
|
26
|
-
imageRepeat,
|
|
27
|
-
// Diferencia
|
|
28
22
|
getOptionUrlImage,
|
|
29
23
|
// Diferencia
|
|
30
|
-
type = "outlined",
|
|
31
|
-
color = "primary",
|
|
32
24
|
refresh,
|
|
33
25
|
error = false,
|
|
34
26
|
onChange,
|
|
35
|
-
value
|
|
36
|
-
customError,
|
|
37
|
-
...other
|
|
27
|
+
value
|
|
38
28
|
} = props;
|
|
39
29
|
const { getLabel } = useModuleDictionary();
|
|
40
|
-
useModuleSkeleton();
|
|
41
|
-
const theme = useTheme();
|
|
30
|
+
const isSkeleton = useModuleSkeleton();
|
|
42
31
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
43
32
|
const [open, setOpen] = useState(false);
|
|
44
33
|
const { currentSize } = useComponentSize(size);
|
|
45
34
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
46
|
-
useMemo(
|
|
47
|
-
() => getOptionUrlImage !== void 0,
|
|
48
|
-
[getOptionUrlImage]
|
|
49
|
-
);
|
|
50
35
|
const [selectedValue, setSelectedValue] = useState(
|
|
51
36
|
value || (multiple ? [] : null)
|
|
52
37
|
);
|
|
@@ -60,7 +45,16 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
60
45
|
}
|
|
61
46
|
setSelectedValue(value || (multiple ? [] : null));
|
|
62
47
|
}, [value, multiple, getOptionLabel]);
|
|
63
|
-
const
|
|
48
|
+
const isOptionEqualToValueLocal = useCallback(
|
|
49
|
+
(option, val) => {
|
|
50
|
+
if (val === null || val === void 0) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return isOptionEqualToValue(option, val);
|
|
54
|
+
},
|
|
55
|
+
[isOptionEqualToValue]
|
|
56
|
+
);
|
|
57
|
+
const handleDelete = useCallback((optionToDelete) => {
|
|
64
58
|
if (Array.isArray(selectedValue)) {
|
|
65
59
|
const updatedValue = selectedValue.filter(
|
|
66
60
|
(val) => !isOptionEqualToValueLocal(val, optionToDelete)
|
|
@@ -72,11 +66,11 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
72
66
|
"removeOption"
|
|
73
67
|
);
|
|
74
68
|
}
|
|
75
|
-
};
|
|
76
|
-
const handleRefresh = () => {
|
|
69
|
+
}, [selectedValue, isOptionEqualToValueLocal, onChange]);
|
|
70
|
+
const handleRefresh = useCallback(() => {
|
|
77
71
|
refresh?.();
|
|
78
72
|
setOpen(true);
|
|
79
|
-
};
|
|
73
|
+
}, [refresh]);
|
|
80
74
|
const handleChange = (event, newSelectedValue, reason) => {
|
|
81
75
|
const updatedValue = multiple ? Array.isArray(newSelectedValue) ? newSelectedValue : [] : newSelectedValue;
|
|
82
76
|
setSelectedValue(updatedValue);
|
|
@@ -91,27 +85,18 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
91
85
|
onChangeFilterParmsLocal(newValue, reason);
|
|
92
86
|
}
|
|
93
87
|
};
|
|
94
|
-
const isOptionEqualToValueLocal = useCallback(
|
|
95
|
-
(option, val) => {
|
|
96
|
-
if (val === null || val === void 0) {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
return isOptionEqualToValue(option, val);
|
|
100
|
-
},
|
|
101
|
-
[isOptionEqualToValue]
|
|
102
|
-
);
|
|
103
88
|
const onCloseLocal = (event, reason) => {
|
|
104
89
|
setOpen(false);
|
|
105
90
|
if (onClose) {
|
|
106
91
|
onClose(event, reason);
|
|
107
92
|
}
|
|
108
93
|
};
|
|
109
|
-
const onOpenLocal = (event) => {
|
|
94
|
+
const onOpenLocal = useCallback((event) => {
|
|
110
95
|
setOpen((currentState) => !currentState);
|
|
111
96
|
if (onOpen) {
|
|
112
97
|
onOpen(event);
|
|
113
98
|
}
|
|
114
|
-
};
|
|
99
|
+
}, [onOpen]);
|
|
115
100
|
const getOptionLabelLocal = useCallback(
|
|
116
101
|
(option) => {
|
|
117
102
|
if (typeof option === "string") {
|
|
@@ -124,26 +109,18 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
124
109
|
},
|
|
125
110
|
[getOptionLabel]
|
|
126
111
|
);
|
|
127
|
-
const getOptionUrlImageLocal = (option) => {
|
|
112
|
+
const getOptionUrlImageLocal = useCallback((option) => {
|
|
128
113
|
if (option === void 0 || option === null || getOptionUrlImage === void 0) {
|
|
129
114
|
return "";
|
|
130
115
|
}
|
|
131
116
|
return getOptionUrlImage(option);
|
|
132
|
-
};
|
|
133
|
-
const
|
|
134
|
-
theme.vars.palette,
|
|
135
|
-
disabled ? "default" : color || "default",
|
|
136
|
-
theme.vars.palette.default
|
|
137
|
-
);
|
|
138
|
-
const ownerState = {
|
|
117
|
+
}, [getOptionUrlImage]);
|
|
118
|
+
const ownerState = useMemo(() => ({
|
|
139
119
|
size: adjustedSize,
|
|
140
120
|
variant,
|
|
141
121
|
disabled,
|
|
142
|
-
paletteColor,
|
|
143
|
-
autocompleteColor: color,
|
|
144
|
-
imageScale: Boolean(imageScale),
|
|
145
122
|
multiple: Boolean(multiple)
|
|
146
|
-
};
|
|
123
|
+
}), [adjustedSize, disabled, multiple, variant]);
|
|
147
124
|
const [inputValue, setInputValue] = useState("");
|
|
148
125
|
useEffect(() => {
|
|
149
126
|
if (!open && value === null && inputValue !== "") {
|
|
@@ -168,16 +145,83 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
168
145
|
e.preventDefault();
|
|
169
146
|
}
|
|
170
147
|
};
|
|
148
|
+
const selectedOption = options.find((option) => {
|
|
149
|
+
return isOptionEqualToValueLocal(option, selectedValue);
|
|
150
|
+
});
|
|
151
|
+
const adornments = useMemo(() => {
|
|
152
|
+
const returnValue = {};
|
|
153
|
+
if (Array.isArray(selectedValue) && multiple) {
|
|
154
|
+
returnValue.startAdornment = selectedValue.map((option, index) => /* @__PURE__ */ jsx(
|
|
155
|
+
ChipStyled,
|
|
156
|
+
{
|
|
157
|
+
size: adjustedSize,
|
|
158
|
+
label: getOptionLabelLocal(option),
|
|
159
|
+
opacity: true,
|
|
160
|
+
onDeleted: () => handleDelete(option),
|
|
161
|
+
ownerState: { ...ownerState }
|
|
162
|
+
},
|
|
163
|
+
index
|
|
164
|
+
));
|
|
165
|
+
} else {
|
|
166
|
+
if (getOptionUrlImage && selectedOption) {
|
|
167
|
+
returnValue.startAdornment = /* @__PURE__ */ jsx(
|
|
168
|
+
ImageStyled,
|
|
169
|
+
{
|
|
170
|
+
ownerState: { ...ownerState },
|
|
171
|
+
src: getOptionUrlImageLocal(selectedOption),
|
|
172
|
+
alt: getOptionLabelLocal(selectedOption)
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (loading) {
|
|
178
|
+
returnValue.endAdornment = /* @__PURE__ */ jsx(
|
|
179
|
+
CircularProgressStyled,
|
|
180
|
+
{
|
|
181
|
+
ownerState: { ...ownerState },
|
|
182
|
+
color: "primary",
|
|
183
|
+
size: adjustedSize
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
} else {
|
|
187
|
+
returnValue.endAdornment = /* @__PURE__ */ jsx("div", { children: refresh ? /* @__PURE__ */ jsx(
|
|
188
|
+
IconButtonStyled,
|
|
189
|
+
{
|
|
190
|
+
ownerState: { ...ownerState },
|
|
191
|
+
icon: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/round_refresh.svg`,
|
|
192
|
+
onClick: handleRefresh,
|
|
193
|
+
disabled,
|
|
194
|
+
size: adjustedSize
|
|
195
|
+
}
|
|
196
|
+
) : /* @__PURE__ */ jsx(
|
|
197
|
+
IconButtonStyled,
|
|
198
|
+
{
|
|
199
|
+
ownerState: { ...ownerState },
|
|
200
|
+
icon: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/chevronDown.svg`,
|
|
201
|
+
onClick: (event) => onOpenLocal(event),
|
|
202
|
+
disabled,
|
|
203
|
+
size: adjustedSize
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
206
|
+
}
|
|
207
|
+
return returnValue;
|
|
208
|
+
}, [selectedValue, multiple, loading, adjustedSize, getOptionLabelLocal, ownerState, handleDelete, getOptionUrlImage, selectedOption, getOptionUrlImageLocal, refresh, host_static_assets, environment_assets, handleRefresh, disabled, onOpenLocal]);
|
|
209
|
+
if (isSkeleton) {
|
|
210
|
+
return /* @__PURE__ */ jsx(
|
|
211
|
+
SkeletonAutocompleteStyled,
|
|
212
|
+
{
|
|
213
|
+
ownerState: { ...ownerState }
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
}
|
|
171
217
|
return /* @__PURE__ */ jsx(
|
|
172
|
-
|
|
218
|
+
Autocomplete$1,
|
|
173
219
|
{
|
|
174
|
-
ownerState: { ...ownerState },
|
|
175
|
-
tabIndex: 0,
|
|
176
|
-
disableClearable: true,
|
|
177
220
|
multiple,
|
|
178
221
|
onKeyDown: checkKeyDown,
|
|
179
222
|
size: adjustedSize,
|
|
180
223
|
ref,
|
|
224
|
+
forcePopupIcon: false,
|
|
181
225
|
autoSelect: false,
|
|
182
226
|
options,
|
|
183
227
|
getOptionLabel: getOptionLabelLocal,
|
|
@@ -202,14 +246,14 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
202
246
|
open,
|
|
203
247
|
onInputChange: handleInputChange,
|
|
204
248
|
onChange: handleChange,
|
|
205
|
-
filterOptions: onChangeFilterParmsLocal ? (x) => x : void 0,
|
|
206
249
|
loading,
|
|
207
250
|
loadingText: /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: getLabel("autocomplete.loading_options") }),
|
|
208
251
|
disabled,
|
|
209
252
|
noOptionsText: /* @__PURE__ */ jsx(Typography, { variant: "body", size: adjustedSize, children: getLabel("autocomplete.no_options") }),
|
|
253
|
+
filterOptions: onChangeFilterParmsLocal ? (x) => x : void 0,
|
|
210
254
|
renderOption: (renderProps, option) => {
|
|
211
255
|
const isSelected = multiple ? Array.isArray(selectedValue) && selectedValue.some((val) => isOptionEqualToValueLocal(option, val)) : isOptionEqualToValueLocal(option, selectedValue);
|
|
212
|
-
return
|
|
256
|
+
return renderOption(renderProps, {
|
|
213
257
|
...typeof option === "object" && option !== null ? option : {},
|
|
214
258
|
label: getOptionLabelLocal(option),
|
|
215
259
|
selected: isSelected,
|
|
@@ -218,76 +262,30 @@ const Autocomplete = forwardRef(function Autocomplete2(props, ref) {
|
|
|
218
262
|
});
|
|
219
263
|
},
|
|
220
264
|
renderInput: (params) => {
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
}
|
|
265
|
+
const { InputLabelProps, inputProps, InputProps, ...renderInputOhers } = params;
|
|
266
|
+
const { className: _classNoCount, ...otherInputProps } = InputProps;
|
|
267
|
+
const { className: _ClassNoCount2, ...otherinputProps } = inputProps;
|
|
224
268
|
return /* @__PURE__ */ jsx(
|
|
225
269
|
RenderInputStyled,
|
|
226
270
|
{
|
|
227
|
-
ownerState: { ...ownerState },
|
|
228
|
-
...params,
|
|
229
|
-
color,
|
|
230
|
-
error,
|
|
231
|
-
size: adjustedSize,
|
|
232
271
|
variant,
|
|
272
|
+
ownerState: { ...ownerState },
|
|
233
273
|
InputLabelProps: {
|
|
234
|
-
...
|
|
274
|
+
...InputLabelProps,
|
|
235
275
|
shrink: true
|
|
236
276
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
277
|
+
inputProps: { ...otherinputProps },
|
|
278
|
+
error,
|
|
279
|
+
...renderInputOhers,
|
|
280
|
+
autoComplete: "off",
|
|
240
281
|
InputProps: {
|
|
241
|
-
...
|
|
242
|
-
|
|
243
|
-
// Asegura que sea string.
|
|
244
|
-
startAdornment: multiple ? Array.isArray(selectedValue) ? selectedValue.map((option, index) => /* @__PURE__ */ jsx(
|
|
245
|
-
ChipStyled,
|
|
246
|
-
{
|
|
247
|
-
size: adjustedSize,
|
|
248
|
-
label: getOptionLabelLocal(option),
|
|
249
|
-
opacity: true,
|
|
250
|
-
onDeleted: () => handleDelete(option),
|
|
251
|
-
ownerState: { ...ownerState }
|
|
252
|
-
},
|
|
253
|
-
index
|
|
254
|
-
)) : null : type === "image" && !multiple && selectedOption ? /* @__PURE__ */ jsx(
|
|
255
|
-
ImageStyled,
|
|
256
|
-
{
|
|
257
|
-
ownerState: { ...ownerState },
|
|
258
|
-
src: getOptionUrlImageLocal(selectedOption),
|
|
259
|
-
alt: getOptionLabelLocal(selectedOption)
|
|
260
|
-
}
|
|
261
|
-
) : params.InputProps.startAdornment,
|
|
262
|
-
endAdornment: loading ? /* @__PURE__ */ jsx(
|
|
263
|
-
CircularProgressStyled,
|
|
264
|
-
{
|
|
265
|
-
ownerState: { ...ownerState },
|
|
266
|
-
color,
|
|
267
|
-
size: adjustedSize
|
|
268
|
-
}
|
|
269
|
-
) : /* @__PURE__ */ jsx("div", { children: refresh ? /* @__PURE__ */ jsx(
|
|
270
|
-
IconButtonStyled,
|
|
271
|
-
{
|
|
272
|
-
ownerState: { ...ownerState },
|
|
273
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/round_refresh.svg`,
|
|
274
|
-
onClick: handleRefresh,
|
|
275
|
-
disabled,
|
|
276
|
-
size: adjustedSize
|
|
277
|
-
}
|
|
278
|
-
) : /* @__PURE__ */ jsx(
|
|
279
|
-
IconButtonStyled,
|
|
280
|
-
{
|
|
281
|
-
ownerState: { ...ownerState },
|
|
282
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/chevronDown.svg`,
|
|
283
|
-
onClick: (event) => onOpenLocal(event),
|
|
284
|
-
disabled,
|
|
285
|
-
size: adjustedSize
|
|
286
|
-
}
|
|
287
|
-
) })
|
|
282
|
+
...otherInputProps,
|
|
283
|
+
...adornments
|
|
288
284
|
},
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
SelectProps: { native: true },
|
|
286
|
+
size: adjustedSize,
|
|
287
|
+
fullWidth: true,
|
|
288
|
+
disabled
|
|
291
289
|
}
|
|
292
290
|
);
|
|
293
291
|
}
|
package/components/mui_extended/Autocomplete/{AutocompleteStyles.js → Autocomplete.styles.js}
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js";
|
|
1
2
|
const autocompleteSyles = {
|
|
2
3
|
/**
|
|
3
4
|
* Styles for the icon button component.
|
|
@@ -65,8 +66,8 @@ const autocompleteSyles = {
|
|
|
65
66
|
* @updatedUser SebastianM - automatic
|
|
66
67
|
*/
|
|
67
68
|
textField: ({ theme }) => ({
|
|
68
|
-
position:
|
|
69
|
-
height: "auto",
|
|
69
|
+
// position: 'relative',
|
|
70
|
+
height: "auto !important",
|
|
70
71
|
"& .MuiInputBase-root": {
|
|
71
72
|
padding: theme.vars.size.baseSpacings.sp1,
|
|
72
73
|
gap: theme.vars.size.baseSpacings.sp1
|
|
@@ -92,8 +93,7 @@ const autocompleteSyles = {
|
|
|
92
93
|
* @updatedAt 2024-12-10 15:24:11 - automatic
|
|
93
94
|
* @updatedUser SebastianM - automatic
|
|
94
95
|
*/
|
|
95
|
-
circularProgress: ({ theme
|
|
96
|
-
color: ownerState.paletteColor?.main,
|
|
96
|
+
circularProgress: ({ theme }) => ({
|
|
97
97
|
position: "absolute",
|
|
98
98
|
top: "18%",
|
|
99
99
|
right: theme.vars.size.baseSpacings.sp2,
|
|
@@ -106,30 +106,22 @@ const autocompleteSyles = {
|
|
|
106
106
|
* @updatedAt 2024-12-10 15:24:11 - automatic
|
|
107
107
|
* @updatedUser SebastianM - automatic
|
|
108
108
|
*/
|
|
109
|
-
skeletonAutocomplete: ({ theme, ownerState }) =>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
minHeight:
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
height: theme.vars.size.mobile.medium.base,
|
|
126
|
-
minHeight: theme.vars.size.mobile.medium.base
|
|
127
|
-
} : {
|
|
128
|
-
height: theme.vars.size.desktop.medium.base,
|
|
129
|
-
minHeight: theme.vars.size.desktop.medium.base
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
})
|
|
109
|
+
skeletonAutocomplete: ({ theme, ownerState }) => {
|
|
110
|
+
return {
|
|
111
|
+
width: "100%",
|
|
112
|
+
background: theme.vars.palette.skeleton.transition,
|
|
113
|
+
display: "flex",
|
|
114
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
115
|
+
...getHeightSizeStyles(
|
|
116
|
+
theme.generalSettings.isMobile,
|
|
117
|
+
ownerState?.size || "medium",
|
|
118
|
+
"action",
|
|
119
|
+
(height) => ({ minHeight: height })
|
|
120
|
+
)
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
autocompleteRoot: {},
|
|
124
|
+
renderInputText: {}
|
|
133
125
|
};
|
|
134
126
|
export {
|
|
135
127
|
autocompleteSyles as a
|
|
@@ -9,11 +9,11 @@ import { Sizes } from '@m4l/styles';
|
|
|
9
9
|
* @updatedAt 2024-11-29 10:03:38 - automatic
|
|
10
10
|
* @updatedUser SebastianM - automatic
|
|
11
11
|
*/
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function renderOption<T>(optionProps: HTMLAttributes<HTMLLIElement>, option: T & {
|
|
13
13
|
label: string;
|
|
14
14
|
selected?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
startAdornment?: ReactNode;
|
|
17
17
|
endAdornment?: ReactNode;
|
|
18
|
-
size: Extract<Sizes,
|
|
19
|
-
})
|
|
18
|
+
size: Extract<Sizes, 'small' | 'medium'>;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
import { M as
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
};
|
|
2
|
+
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
3
|
+
function renderOption(optionProps, option) {
|
|
4
|
+
const { className, ...otherOptionProps } = optionProps;
|
|
5
|
+
return /* @__PURE__ */ createElement(
|
|
6
|
+
MenuItem,
|
|
7
|
+
{
|
|
8
|
+
...otherOptionProps,
|
|
9
|
+
selected: option.selected,
|
|
10
|
+
color: "primary",
|
|
11
|
+
key: option.id || option.label,
|
|
12
|
+
label: option.label,
|
|
13
|
+
disabled: option.disabled,
|
|
14
|
+
startIcon: option.startAdornment,
|
|
15
|
+
endIcon: option.endAdornment,
|
|
16
|
+
size: option.size
|
|
17
|
+
}
|
|
18
|
+
);
|
|
21
19
|
}
|
|
22
20
|
export {
|
|
23
|
-
|
|
21
|
+
renderOption as r
|
|
24
22
|
};
|