@m4l/components 9.2.52 → 9.2.53
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 +3 -1
- package/components/Chip/ChipStyles.js +1 -1
- package/components/Chip/types.d.ts +4 -0
- package/components/DataGrid/constants.d.ts +21 -0
- package/components/DataGrid/constants.js +24 -1
- package/components/DataGrid/contexts/DataGridContext/index.js +1 -1
- package/components/DataGrid/contexts/FilterContext/index.js +1 -1
- package/components/DataGrid/dictionary.js +0 -3
- package/components/DataGrid/index.d.ts +1 -0
- package/components/DataGrid/slots/DataGridEnum.js +2 -2
- package/components/DataGrid/slots/DataGridSlot.js +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +2 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +2 -2
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +0 -1
- package/components/DynamicFilter/dictionary.js +0 -12
- package/components/DynamicFilter/store/DynamicFilterContext.js +1 -1
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +1 -1
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +3 -2
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicFilter/types.d.ts +2 -2
- package/components/DynamicSort/dictionary.js +0 -5
- package/components/DynamicSort/slots/DynamicSortSlots.js +1 -1
- package/components/DynamicSort/store/DynamicSortContext.js +1 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +1 -1
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/GridLayout/GridLayout.js +1 -1
- package/components/GridLayout/styles.js +1 -1
- package/components/GridLayout/subcomponents/GridItem/index.js +1 -1
- package/components/GridLayout/subcomponents/Responsive/helper.js +1 -1
- package/components/GridLayout/subcomponents/Responsive/index.js +1 -1
- package/components/GridLayout/subcomponents/Responsive/responsiveUtils.js +3 -3
- package/components/GridLayout/subcomponents/withSizeProvider/index.js +1 -1
- package/components/Icon/Icon.js +1 -1
- package/components/Icon/constants.js +2 -2
- package/components/Icon/slots/IconSlots.js +1 -1
- package/components/Image/Image.js +1 -1
- package/components/Image/constant.js +2 -2
- package/components/Image/slots/ImageSlots.js +1 -1
- package/components/Image/subcomponents/IntersectComponent/index.js +1 -1
- package/components/LanguagePopover/LanguagePopover.js +1 -1
- package/components/LoadingError/LoadingError.js +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.js +1 -1
- package/components/NoItemSelected/NoItemSelected.js +1 -1
- package/components/NumberInput/hooks/useNumberInput/NumberInputReducer.js +1 -1
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
- package/components/ObjectLogs/dictionary.js +0 -3
- package/components/ObjectLogs/subcomponents/ObjectLogsByM4L/ObjectLogsByM4L.js +1 -1
- package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +2 -2
- package/components/Pager/Pager.styles.js +0 -8
- package/components/Pager/dicctionary.js +0 -5
- package/components/PrintingSystem/subcomponents/ChartNode/index.js +1 -1
- package/components/PropertyValue/PropertyValue.js +2 -2
- package/components/ScrollBar/ScrollBar.js +1 -1
- package/components/SideBar/slots/SideBarEnum.js +4 -4
- package/components/SideBar/slots/SideBarSlots.js +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +1 -1
- package/components/ToastContainer/ToastContainer.js +1 -1
- package/components/WindowBase/slots/WindowBaseSlots.js +1 -1
- package/components/animate/variants/bounce.js +1 -1
- package/components/animate/variants/fade.js +1 -1
- package/components/animate/variants/transition.js +2 -2
- package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
- package/components/areas/components/AreasViewer/AreasViewer.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +1 -1
- package/components/areas/contexts/AreasContext/helpers/helper.js +14 -14
- package/components/areas/contexts/AreasContext/store.js +5 -5
- package/components/areas/icons.js +0 -8
- package/components/commercial/HamburgerMenu/classes/index.js +1 -1
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -1
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.js +3 -3
- package/components/formatters/PeriodFormatter/PeriodFormatter.js +1 -1
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.js +2 -2
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +30 -19
- package/components/hook-form/RHFAutocomplete/tests/common.d.ts +37 -0
- package/components/hook-form/RHFAutocomplete/types.d.ts +3 -8
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +32 -5
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +49 -84
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsyncStyles.d.ts +2 -2
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.d.ts +5 -0
- package/components/hook-form/RHFAutocompleteAsync/hooks/useFetchOptions.js +64 -0
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.d.ts +14 -0
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +79 -0
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/tests/OnChangFilterParmsDefined.test.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/OnChangFilterParmsUndefined.test.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/RHFAutocompleteReducer.test.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/common.d.ts +41 -0
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts +120 -4
- package/components/hook-form/RHFAutocompleteAsync/types.js +38 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.js +1 -1
- package/components/hook-form/RHFPeriod/RHFPeriod.js +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +3 -2
- package/components/hook-form/RHFTextField/RHFTextField.styles.js +1 -3
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.js +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +1 -1
- package/components/hook-form/RHFormContext/classes/index.js +1 -1
- package/components/hook-form/RHFormContext/index.js +1 -1
- package/components/mui_extended/Accordion/Accordion.js +1 -1
- package/components/mui_extended/Accordion/slots/AccordionSlots.js +2 -2
- package/components/mui_extended/Autocomplete/Autocomplete.d.ts +7 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +59 -196
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +27 -16
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +14 -0
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +47 -0
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +21 -0
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +31 -0
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.d.ts +23 -0
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +135 -0
- package/components/mui_extended/Autocomplete/icons.d.ts +4 -0
- package/components/mui_extended/Autocomplete/icons.js +7 -0
- package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +7 -2
- package/components/mui_extended/Autocomplete/renderOptions/index.js +7 -6
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +10 -11
- package/components/mui_extended/Autocomplete/types.d.ts +2 -0
- package/components/mui_extended/CheckBox/CheckBox.js +1 -1
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.js +2 -2
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.js +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.js +1 -1
- package/components/mui_extended/ImageButton/utils/Clases/index.js +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
- package/components/mui_extended/NavLink/NavLink.js +1 -1
- package/components/mui_extended/NavLink/constants.js +2 -2
- package/components/mui_extended/NavLink/slots/NavLinkSlots.js +1 -1
- package/components/mui_extended/Popover/Popover.js +1 -1
- package/components/mui_extended/Popover/Popover.styles.js +1 -5
- package/components/mui_extended/Popover/constants.js +2 -2
- package/components/mui_extended/Select/Select.js +1 -1
- package/components/mui_extended/Select/Select.styles.js +1 -1
- package/components/mui_extended/Select/constants.js +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.js +1 -1
- package/components/mui_extended/Tab/Tab.js +1 -1
- package/components/mui_extended/TextField/constants.js +1 -1
- package/components/mui_extended/Tooltip/Tooltip.js +2 -2
- package/components/mui_extended/Tooltip/slots/TooltipSlots.js +2 -2
- package/components/mui_extended/Typography/Typography.js +1 -1
- package/components/mui_extended/Typography/constants.js +3 -3
- package/components/mui_extended/Typography/slots/typographySlots.js +1 -1
- package/components/popups/components/PopupsViewer/icons.js +0 -1
- package/hooks/useDataGridPersistence/constants.js +2 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +13 -10
- package/hooks/useSvgColor/constants.js +2 -2
- package/hooks/useSvgColor/helpers.js +1 -1
- package/hooks/useSvgColor/useSvgColor.js +1 -1
- package/index.js +14 -12
- package/mockServiceWorker.js +1 -1
- package/package.json +1 -1
- package/storybook/components/extended/mui/Autocomplete/AutoComple.stories.d.ts +1 -0
- package/storybook/hook-form/RHFAutocomplete/RHFAutocomplete.stories.d.ts +8 -6
- package/storybook/hook-form/RHFAutocomplete/constants.d.ts +23 -0
- package/storybook/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.stories.d.ts +11 -4
- package/storybook/hook-form/RHFAutocompleteAsync/constants.d.ts +10 -1
- package/storybook/hook-form/RHFAutocompleteAsync/handlers.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/oldTypes.d.ts +0 -43
- /package/components/hook-form/RHFAutocomplete/{RHFAutocomplete.test.d.ts → tests/RHFAutocomplete.test.d.ts} +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
2
|
+
function useValuesAndHandlers(props) {
|
|
3
|
+
const {
|
|
4
|
+
getOptionLabel,
|
|
5
|
+
isOptionEqualToValue,
|
|
6
|
+
options,
|
|
7
|
+
onOpen,
|
|
8
|
+
onClose,
|
|
9
|
+
onChangeFilterParmsLocal,
|
|
10
|
+
multiple,
|
|
11
|
+
getOptionUrlImage,
|
|
12
|
+
// Diferencia
|
|
13
|
+
refresh,
|
|
14
|
+
onChange,
|
|
15
|
+
value
|
|
16
|
+
} = props;
|
|
17
|
+
const [open, setOpen] = useState(false);
|
|
18
|
+
const scrollPositionOptionsRef = useRef(0);
|
|
19
|
+
const [selectedValue, setSelectedValue] = useState(
|
|
20
|
+
value || (multiple ? [] : null)
|
|
21
|
+
);
|
|
22
|
+
const isOptionEqualToValueLocal = useCallback(
|
|
23
|
+
(option, val) => {
|
|
24
|
+
if (val === null || val === void 0) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return isOptionEqualToValue(option, val);
|
|
28
|
+
},
|
|
29
|
+
[isOptionEqualToValue]
|
|
30
|
+
);
|
|
31
|
+
const handleDelete = useCallback((optionToDelete) => {
|
|
32
|
+
if (Array.isArray(selectedValue)) {
|
|
33
|
+
const updatedValue = selectedValue.filter(
|
|
34
|
+
(val) => !isOptionEqualToValueLocal(val, optionToDelete)
|
|
35
|
+
);
|
|
36
|
+
setSelectedValue(updatedValue);
|
|
37
|
+
onChange?.(
|
|
38
|
+
{},
|
|
39
|
+
updatedValue,
|
|
40
|
+
"removeOption"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}, [selectedValue, isOptionEqualToValueLocal, onChange]);
|
|
44
|
+
const handleRefresh = useCallback(() => {
|
|
45
|
+
refresh?.();
|
|
46
|
+
setOpen(true);
|
|
47
|
+
}, [refresh]);
|
|
48
|
+
const handleChange = (event, newSelectedValue, reason) => {
|
|
49
|
+
let updatedValue = multiple ? Array.isArray(newSelectedValue) ? newSelectedValue : [] : newSelectedValue;
|
|
50
|
+
if (multiple && Array.isArray(updatedValue)) {
|
|
51
|
+
updatedValue = updatedValue?.filter((option) => options.some((opt) => isOptionEqualToValueLocal(opt, option)));
|
|
52
|
+
}
|
|
53
|
+
setSelectedValue(updatedValue);
|
|
54
|
+
onChange?.(event, updatedValue, reason);
|
|
55
|
+
};
|
|
56
|
+
const handleInputChange = (_event, newValue, reason) => {
|
|
57
|
+
setInputValue(newValue);
|
|
58
|
+
if (onChangeFilterParmsLocal && reason === "input") {
|
|
59
|
+
onChangeFilterParmsLocal(newValue, reason);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const onCloseLocal = (event, reason) => {
|
|
63
|
+
let mustClose = true;
|
|
64
|
+
if (!(reason !== "selectOption" && reason !== "removeOption")) {
|
|
65
|
+
if (multiple) {
|
|
66
|
+
mustClose = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (mustClose) {
|
|
70
|
+
scrollPositionOptionsRef.current = 0;
|
|
71
|
+
setOpen(false);
|
|
72
|
+
if (onClose) {
|
|
73
|
+
onClose(event, reason);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const onOpenLocal = useCallback((event) => {
|
|
78
|
+
setOpen(true);
|
|
79
|
+
if (onOpen) {
|
|
80
|
+
onOpen(event);
|
|
81
|
+
}
|
|
82
|
+
}, [onOpen]);
|
|
83
|
+
const getOptionLabelLocal = useCallback(
|
|
84
|
+
(option) => {
|
|
85
|
+
if (typeof option === "string") {
|
|
86
|
+
return option;
|
|
87
|
+
}
|
|
88
|
+
if (option === null || option === void 0) {
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
return getOptionLabel(option);
|
|
92
|
+
},
|
|
93
|
+
[getOptionLabel]
|
|
94
|
+
);
|
|
95
|
+
const getOptionUrlImageLocal = useCallback((option) => {
|
|
96
|
+
if (option === void 0 || option === null || getOptionUrlImage === void 0) {
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
return getOptionUrlImage(option);
|
|
100
|
+
}, [getOptionUrlImage]);
|
|
101
|
+
const [inputValue, setInputValue] = useState("");
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (open === false && value === null && inputValue !== "") {
|
|
104
|
+
setInputValue("");
|
|
105
|
+
}
|
|
106
|
+
}, [value, open, inputValue]);
|
|
107
|
+
const checkKeyDown = (e) => {
|
|
108
|
+
if (e.code === "Enter") {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const selectedOption = options.find((option) => {
|
|
113
|
+
return isOptionEqualToValueLocal(option, selectedValue);
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
open,
|
|
117
|
+
inputValue,
|
|
118
|
+
selectedValue,
|
|
119
|
+
selectedOption,
|
|
120
|
+
isOptionEqualToValueLocal,
|
|
121
|
+
handleDelete,
|
|
122
|
+
handleRefresh,
|
|
123
|
+
handleChange,
|
|
124
|
+
handleInputChange,
|
|
125
|
+
onCloseLocal,
|
|
126
|
+
onOpenLocal,
|
|
127
|
+
getOptionLabelLocal,
|
|
128
|
+
getOptionUrlImageLocal,
|
|
129
|
+
checkKeyDown,
|
|
130
|
+
scrollPositionOptionsRef
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
useValuesAndHandlers as u
|
|
135
|
+
};
|
|
@@ -5,11 +5,16 @@ import { Sizes } from '@m4l/styles';
|
|
|
5
5
|
* It supports rendering options with `startAd` and `endIcon`.
|
|
6
6
|
* @param color - The color for the MenuItem.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
type OptionType<T> = T & {
|
|
9
9
|
label: string;
|
|
10
10
|
selected?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
startAdornment?: ReactNode;
|
|
13
13
|
endAdornment?: ReactNode;
|
|
14
14
|
size: Extract<Sizes, 'small' | 'medium'>;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Render option for Autocomplete.
|
|
18
|
+
*/
|
|
19
|
+
export declare const renderOption: <T>(optionProps: HTMLAttributes<HTMLLIElement>, option: OptionType<T>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
2
3
|
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
3
|
-
|
|
4
|
+
const MemoizedMenuItem = memo(MenuItem);
|
|
5
|
+
const renderOption = (optionProps, option) => {
|
|
4
6
|
const { className, ...otherOptionProps } = optionProps;
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
MemoizedMenuItem,
|
|
7
9
|
{
|
|
8
10
|
...otherOptionProps,
|
|
9
11
|
selected: option.selected,
|
|
10
12
|
color: "default",
|
|
11
|
-
key: option.id || option.label,
|
|
12
13
|
label: option.label,
|
|
13
14
|
disabled: option.disabled,
|
|
14
15
|
startIcon: option.startAdornment,
|
|
@@ -16,7 +17,7 @@ function renderOption(optionProps, option) {
|
|
|
16
17
|
size: option.size
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
|
-
}
|
|
20
|
+
};
|
|
20
21
|
export {
|
|
21
22
|
renderOption as r
|
|
22
23
|
};
|
|
@@ -5,13 +5,13 @@ 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 { I as IconButton } from "../../IconButton/IconButton.js";
|
|
9
|
-
import { T as TextField } from "../../TextField/TextField.js";
|
|
10
|
-
import { T as Typography } from "../../Typography/Typography.js";
|
|
11
8
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
9
|
+
import { T as TextField } from "../../TextField/TextField.js";
|
|
12
10
|
import { P as Popper } from "../../Popper/Popper.js";
|
|
13
|
-
import {
|
|
11
|
+
import { I as IconButton } from "../../IconButton/IconButton.js";
|
|
12
|
+
import { T as Typography } from "../../Typography/Typography.js";
|
|
14
13
|
import { C as CircularProgress } from "../../CircularProgress/CircularProgress.js";
|
|
14
|
+
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
15
15
|
const AutocompleteRootStyled = styled(Autocomplete, {
|
|
16
16
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
17
17
|
slot: AutocompleteSlots.root
|
|
@@ -44,7 +44,7 @@ styled(Typography, {
|
|
|
44
44
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
45
45
|
slot: AutocompleteSlots.typography
|
|
46
46
|
})(autocompleteSyles?.typography);
|
|
47
|
-
|
|
47
|
+
styled(Image, {
|
|
48
48
|
name: AUTOCOMPLETE_KEY_COMPONENT,
|
|
49
49
|
slot: AutocompleteSlots.image
|
|
50
50
|
})(autocompleteSyles?.image);
|
|
@@ -65,13 +65,12 @@ const AdormentsStyled = styled("div", {
|
|
|
65
65
|
slot: AutocompleteSlots.adorments
|
|
66
66
|
})(autocompleteSyles?.adorments);
|
|
67
67
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
AutocompleteRootStyled as A,
|
|
69
|
+
CircularProgressStyled as C,
|
|
70
|
+
IconButtonStyled as I,
|
|
71
71
|
PopperComponentStyled as P,
|
|
72
72
|
RenderInputStyled as R,
|
|
73
73
|
SkeletonAutocompleteStyled as S,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
AutocompleteRootStyled as c
|
|
74
|
+
AdormentsStyled as a,
|
|
75
|
+
ChipStyled as b
|
|
77
76
|
};
|
|
@@ -32,11 +32,13 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
32
32
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
33
33
|
getOptionUrlImage?: (option: T) => string;
|
|
34
34
|
onChange: (event: ChangeEvent<{}> | undefined, value: T | T[] | null, reason: AutocompleteChangeReason) => void;
|
|
35
|
+
htmlFor?: string;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Represents the owner state of the Autocomplete component for styling purposes.
|
|
38
39
|
*/
|
|
39
40
|
export interface AutocompleteOwnerState extends Pick<BaseAutocompleteProps, 'size' | 'variant'> {
|
|
41
|
+
error?: boolean;
|
|
40
42
|
disabled?: boolean;
|
|
41
43
|
multiple?: boolean;
|
|
42
44
|
}
|
|
@@ -5,7 +5,7 @@ import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js
|
|
|
5
5
|
import { C as CHECK_BOX_KEY_COMPONENT } from "./constants.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
|
-
import { C as CheckBoxRootStyled, M as MUICheckboxStyled, I as
|
|
8
|
+
import { C as CheckBoxRootStyled, M as MUICheckboxStyled, I as IconStyled, a as IconCheckedStyled, T as TypographyStyled, S as SkeletonStyled } from "./slots/CheckBoxSlots.js";
|
|
9
9
|
import { C as CheckBoxSlots } from "./slots/CheckBoxEnum.js";
|
|
10
10
|
const CheckBox = forwardRef((props, ref) => {
|
|
11
11
|
const {
|
|
@@ -31,9 +31,9 @@ const IconStyled = styled(Icon, {
|
|
|
31
31
|
})(checkBoxStyles.icon);
|
|
32
32
|
export {
|
|
33
33
|
CheckBoxRootStyled as C,
|
|
34
|
-
|
|
34
|
+
IconStyled as I,
|
|
35
35
|
MUICheckboxStyled as M,
|
|
36
36
|
SkeletonStyled as S,
|
|
37
37
|
TypographyStyled as T,
|
|
38
|
-
|
|
38
|
+
IconCheckedStyled as a
|
|
39
39
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled, Popper, Paper } from "@mui/material";
|
|
2
|
-
import {
|
|
2
|
+
import { PickersCalendarHeader, PickersDay, MobileDateTimePicker, DesktopDateTimePicker } from "@mui/x-date-pickers";
|
|
3
3
|
import { d as dateTimePickerStyles } from "../DateTimePicker.styles.js";
|
|
4
4
|
import { D as DATE_TIME_PICKER_KEY_COMPONENT } from "../constants.js";
|
|
5
5
|
import { D as DateTimePickerEnum } from "./DateTimePickerEnum.js";
|
|
@@ -3,8 +3,8 @@ import { styled } from "@mui/material/styles";
|
|
|
3
3
|
import { i as iconButtonStyles } from "../IconButton.styles.js";
|
|
4
4
|
import { a as ICON_BUTTON_KEY_COMPONENT } from "../constants.js";
|
|
5
5
|
import { I as IconButtonSlots } from "./IconButtonEnum.js";
|
|
6
|
-
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
7
6
|
import { I as Icon } from "../../../Icon/Icon.js";
|
|
7
|
+
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
8
8
|
const StyledMUIIconButton = styled(IconButton, {
|
|
9
9
|
name: ICON_BUTTON_KEY_COMPONENT,
|
|
10
10
|
slot: IconButtonSlots.styledMUIIconButton
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { generateUtilityClass, generateUtilityClasses } from "@mui/material";
|
|
2
2
|
import { unstable_composeClasses } from "@mui/base";
|
|
3
3
|
import { c as componentName } from "./constants.js";
|
|
4
4
|
generateUtilityClasses(componentName, [
|
|
@@ -3,8 +3,8 @@ import { MenuItem } from "@mui/material";
|
|
|
3
3
|
import { a as MENUITEM_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { m as menuItemStyles } from "../MenuItem.styles.js";
|
|
5
5
|
import { M as MenuItemSlots } from "./MenuItemEnum.js";
|
|
6
|
-
import { T as Typography } from "../../Typography/Typography.js";
|
|
7
6
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
7
|
+
import { T as Typography } from "../../Typography/Typography.js";
|
|
8
8
|
import { I as Icon } from "../../../Icon/Icon.js";
|
|
9
9
|
const MenuItemRootStyled = styled(MenuItem, {
|
|
10
10
|
name: MENUITEM_KEY_COMPONENT,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { R as RouterNavLinkRootStyled, a as RouterNavLinkStyled, T as TypographyStyled, S as SkeletonStyled } from "./slots/NavLinkSlots.js";
|
|
3
3
|
import { useModuleSkeleton } from "@m4l/core";
|
|
4
|
-
import {
|
|
4
|
+
import { c as classNavLinkRoot, N as NAV_LINK_SPECIFY, a as NAV_LINK_KEY_COMPONENT } from "./constants.js";
|
|
5
5
|
import { N as NavLinkSlots } from "./slots/NavLinkEnum.js";
|
|
6
6
|
import { clsx } from "clsx";
|
|
7
7
|
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
@@ -4,7 +4,7 @@ const NAV_LINK_KEY_COMPONENT = "M4LNavLink";
|
|
|
4
4
|
const NAV_LINK_SPECIFY = "M4lclassCssSpecificity";
|
|
5
5
|
const classNavLinkRoot = getComponentClasses(NAV_LINK_KEY_COMPONENT, NavLinkSlots);
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
NAV_LINK_SPECIFY as N,
|
|
8
|
+
NAV_LINK_KEY_COMPONENT as a,
|
|
9
9
|
classNavLinkRoot as c
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NavLink } from "react-router-dom";
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
3
|
import { N as NavLinkSlots } from "./NavLinkEnum.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as NAV_LINK_KEY_COMPONENT } from "../constants.js";
|
|
5
5
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
6
6
|
import { n as navLinkStyles } from "../NavLink.styles.js";
|
|
7
7
|
import { T as Typography } from "../../Typography/Typography.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
3
|
-
import { P as
|
|
3
|
+
import { P as POPOVER_PREFIX, a as POPOVER_CLASS_NAME_SPECIFY } from "./constants.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { P as PopoverRootStyled } from "./slots/PopoverSlots.js";
|
|
6
6
|
import { P as PopoverSlots } from "./slots/PopoverEnum.js";
|
|
@@ -2,7 +2,7 @@ const POPOVER_KEY_COMPONENT = "M4LPopover";
|
|
|
2
2
|
const POPOVER_PREFIX = "Popover";
|
|
3
3
|
const POPOVER_CLASS_NAME_SPECIFY = "M4lclassCssSpecificity";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
POPOVER_PREFIX as P,
|
|
6
|
+
POPOVER_CLASS_NAME_SPECIFY as a,
|
|
7
7
|
POPOVER_KEY_COMPONENT as b
|
|
8
8
|
};
|
|
@@ -4,7 +4,7 @@ import { useTheme } from "@mui/material";
|
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { forwardRef, useMemo, useState, useCallback } from "react";
|
|
6
6
|
import { A as ArrowDownStyled, a as AdormentStyled, S as SelectRootStyled, b as SkeletonSelectStyled, M as MenuItemListStyled, c as MenuItemNoOptionStyled, L as LabelPlaceholerStyled, R as RenderValueContainerStyled, d as RenderValueTypography } from "./slots/SelectSlots.js";
|
|
7
|
-
import {
|
|
7
|
+
import { I as ICON_ARROW_DOWN, S as SELECT_CLASSES, a as SELECT_KEY_COMPONENT } from "./constants.js";
|
|
8
8
|
import { S as SELECT_DICTIONARY } from "./dictionary.js";
|
|
9
9
|
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
10
10
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SELECT_CLASSES } from "./constants.js";
|
|
2
|
-
import {
|
|
2
|
+
import { g as getSizeStyles, a as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
3
|
const selectStyles = {
|
|
4
4
|
/**
|
|
5
5
|
* Estilos para el componente Select
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as SelectComplementaryClasses, S as SelectSlots } from "./slots/SelectEnum.js";
|
|
3
3
|
const SELECT_KEY_COMPONENT = "M4LSelect";
|
|
4
4
|
const ICON_ARROW_DOWN = "frontend/components/select/arrow_down.svg";
|
|
5
5
|
const COMBINATED_TEXTFIELD_ENUMS = {
|
|
@@ -4,8 +4,8 @@ import { a as SELECT_KEY_COMPONENT } from "../constants.js";
|
|
|
4
4
|
import { s as selectStyles } from "../Select.styles.js";
|
|
5
5
|
import { S as SelectSlots } from "./SelectEnum.js";
|
|
6
6
|
import { I as IconButton } from "../../IconButton/IconButton.js";
|
|
7
|
-
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
8
7
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
8
|
+
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
9
9
|
import { T as Typography } from "../../Typography/Typography.js";
|
|
10
10
|
import { I as Icon } from "../../../Icon/Icon.js";
|
|
11
11
|
const SelectRootStyled = () => styled(Select, {
|
|
@@ -5,7 +5,7 @@ import { T as TabSlots } from "./Slots/TabEnum.js";
|
|
|
5
5
|
import { T as TAB_KEY_COMPONENT } from "./constants.js";
|
|
6
6
|
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
7
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
|
-
import { R as RootStyled,
|
|
8
|
+
import { R as RootStyled, I as IconStyled, T as TypographyStyled } from "./Slots/TabSlots.js";
|
|
9
9
|
function Tab(props) {
|
|
10
10
|
const {
|
|
11
11
|
size = "medium",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as TexFieldComplementaryClasses, T as TextFieldSlots } from "./slots/TextFieldEnum.js";
|
|
3
3
|
const TEXT_FIELD_KEY_COMPONENT = "M4LTextField";
|
|
4
4
|
const COMBINATED_TEXTFIELD_ENUMS = {
|
|
5
5
|
...TextFieldSlots,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { R as RootStyled, T as
|
|
3
|
-
import {
|
|
2
|
+
import { R as RootStyled, T as TooltipStyled, a as TextStyled } from "./slots/TooltipSlots.js";
|
|
3
|
+
import { D as DEFAULT_TOOLTIP_OFFSET, T as TOOLTIP_CLASSES } from "./constants.js";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
6
6
|
const Tooltip = (props) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useModuleSkeleton } from "@m4l/core";
|
|
4
|
-
import { T as
|
|
4
|
+
import { T as TYPOGRAPHY_CLASSES, a as TYPOGRAPHY_KEY_COMPONENT, b as TYPOGRAPHY_CLASS_NAME_SPECIFY } from "./constants.js";
|
|
5
5
|
import { T as TypographySlots } from "./slots/typographyEnum.js";
|
|
6
6
|
import { S as StyledMUITypography, a as StyledSkeleton } from "./slots/typographySlots.js";
|
|
7
7
|
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
@@ -4,7 +4,7 @@ const TYPOGRAPHY_KEY_COMPONENT = "M4LTypography";
|
|
|
4
4
|
const TYPOGRAPHY_CLASS_NAME_SPECIFY = "M4lclassCssSpecificity";
|
|
5
5
|
const TYPOGRAPHY_CLASSES = getComponentClasses(TYPOGRAPHY_KEY_COMPONENT, TypographySlots);
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
TYPOGRAPHY_CLASSES as T,
|
|
8
|
+
TYPOGRAPHY_KEY_COMPONENT as a,
|
|
9
|
+
TYPOGRAPHY_CLASS_NAME_SPECIFY as b
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Typography } from "@mui/material";
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
|
-
import {
|
|
3
|
+
import { a as TYPOGRAPHY_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { T as TypographySlots } from "./typographyEnum.js";
|
|
5
5
|
import { t as typographyStyles } from "../typography.styles.js";
|
|
6
6
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useCallback } from "react";
|
|
2
2
|
import { g as getColumnsConfigCookie } from "./helpers.js";
|
|
3
|
-
import { C as
|
|
3
|
+
import { C as COOKIE_COLUMNS_CONFIG, a as COOKIE_COLUMNS_WIDTHS } from "./constants.js";
|
|
4
4
|
import { u as useWindowToolsMF } from "../../components/WindowBase/hooks/useWindowToolsMF/index.js";
|
|
5
5
|
const useDataGridPersistence = (props) => {
|
|
6
6
|
const { prefixCookie } = props;
|
|
@@ -27,7 +27,7 @@ const useDynamicFilterAndSort = (props) => {
|
|
|
27
27
|
setCookie,
|
|
28
28
|
getCookie,
|
|
29
29
|
filterSortAutomatic = true,
|
|
30
|
-
visibleRefresh,
|
|
30
|
+
visibleRefresh = false,
|
|
31
31
|
withExternalRefresh
|
|
32
32
|
} = props;
|
|
33
33
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -91,16 +91,19 @@ const useDynamicFilterAndSort = (props) => {
|
|
|
91
91
|
}
|
|
92
92
|
}, [onChangeFilterSort, prefixCookie, setCookie, setInvisibleBadge, isValidFilters]);
|
|
93
93
|
const onRefresh = useCallback(() => {
|
|
94
|
-
if (
|
|
95
|
-
fireOnChangeFilterRef.current
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
fireOnChangeSortRef.current
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
if (!filterSortAutomatic) {
|
|
95
|
+
if (fireOnChangeFilterRef.current) {
|
|
96
|
+
fireOnChangeFilterRef.current.fireOnChangeFilter();
|
|
97
|
+
}
|
|
98
|
+
if (fireOnChangeSortRef.current) {
|
|
99
|
+
fireOnChangeSortRef.current.fireOnChangeSort();
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
if (isValidFilters()) {
|
|
103
|
+
onChangeFilterSort(eventRefs.current);
|
|
104
|
+
}
|
|
102
105
|
}
|
|
103
|
-
}, [
|
|
106
|
+
}, [filterSortAutomatic, isValidFilters, onChangeFilterSort]);
|
|
104
107
|
const leftActions = useMemo(() => /* @__PURE__ */ jsxs(StackLeftActionsStyled, { direction: "row", ownerState: {}, ...getPropDataTestId(M4LDYNAMIC_KEY_FILTER_AND_SORT, DynamicFilterAndSortSlots.stackLeftActions, dataTestId), children: [
|
|
105
108
|
/* @__PURE__ */ jsx(Badge, { badgeContent: "", size: "small", color: "primary", invisible: invisibleBadge.filter, children: /* @__PURE__ */ jsx(ToggleIconButton, { icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_FILTER}`, isToggled: togglesLeftActions.filter, onToggle: () => handleToggles("filter") }) }),
|
|
106
109
|
/* @__PURE__ */ jsx(Badge, { badgeContent: "", size: "small", color: "primary", invisible: invisibleBadge.sort, children: /* @__PURE__ */ jsx(ToggleIconButton, { icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_SORT}`, isToggled: togglesLeftActions.sort, onToggle: () => handleToggles("sort") }) })
|
|
@@ -31,8 +31,8 @@ const SVG_ICON_ERROR = "data:image/svg+xml;base64," + btoa(`<svg viewBox="0 0 64
|
|
|
31
31
|
</svg>`);
|
|
32
32
|
export {
|
|
33
33
|
REPLACEMENT_PRYMARY_COLOR as R,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
SKELETON_SVG_ICON as S,
|
|
35
|
+
SVG_CACHE_PREFIX as a,
|
|
36
36
|
SVG_ICON_ERROR as b,
|
|
37
37
|
REPLACEMENT_SECONDARY_COLOR as c
|
|
38
38
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
|
-
import { b as SVG_ICON_ERROR,
|
|
2
|
+
import { b as SVG_ICON_ERROR, a as SVG_CACHE_PREFIX, R as REPLACEMENT_PRYMARY_COLOR, c as REPLACEMENT_SECONDARY_COLOR } from "./constants.js";
|
|
3
3
|
import { g as getSVG, p as purgedColor } from "./helpers.js";
|
|
4
4
|
function useSvgColor(props) {
|
|
5
5
|
const { src, cacheKey, primaryColor, secondaryColor = "#FFFFFF", skeletonIcon, fallBackIcon = SVG_ICON_ERROR } = props;
|