@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
|
@@ -2,8 +2,8 @@ import { styled } from "@mui/material/styles";
|
|
|
2
2
|
import { L as LOADING_ERROR_KEY_COMPONENT } from "../constants.js";
|
|
3
3
|
import { L as LoadingErrorSlots } from "./LoadingErrorEnum.js";
|
|
4
4
|
import { l as loadingErrorStyles } from "../LoadingError.styles.js";
|
|
5
|
-
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
6
5
|
import { L as LinearProgressIndeterminate } from "../../LinearProgressIndeterminate/LinearProgressIndeterminate.js";
|
|
6
|
+
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
7
7
|
import { I as Image } from "../../Image/Image.js";
|
|
8
8
|
const LoadingErrorRootStyled = styled("div", {
|
|
9
9
|
name: LOADING_ERROR_KEY_COMPONENT,
|
|
@@ -3,7 +3,7 @@ import { useEffect } from "react";
|
|
|
3
3
|
import { format } from "date-fns";
|
|
4
4
|
import { useAuth, DomainCountryProvider } from "@m4l/core";
|
|
5
5
|
import { HostThemeProvider, FormatterProvider } from "@m4l/graphics";
|
|
6
|
-
import {
|
|
6
|
+
import { fnComponentsOverrides, getUserThemeOptions } from "@m4l/styles";
|
|
7
7
|
function MFAuthApp(props) {
|
|
8
8
|
const { children, user, pwd } = props;
|
|
9
9
|
const { isAuthenticated, isInitialized, login, user: authUser } = useAuth();
|
|
@@ -3,7 +3,7 @@ import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
|
3
3
|
import { useMemo, useRef, useState, useEffect } from "react";
|
|
4
4
|
import { W as WrapperNoItemSelectedStyled, N as NoItemSelectedContainer, I as ImgStyled, a as WrapperTpography, T as TypographyStyledTitle, b as TypographyStyledDetail, L as LabelDetail } from "./slots/NoItemSelectedSlots.js";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
|
-
import {
|
|
6
|
+
import { c as classNoItemSelected, N as NO_ITEM_SELECT_KEY_COMPONENT } from "./constant.js";
|
|
7
7
|
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
8
8
|
import { N as NoItemSelectedSlots } from "./slots/NoItemSelectedEnum.js";
|
|
9
9
|
import { D as DICTIONARY } from "./dictionary.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as isNumber, c as clampStepwise } from "../../utils.js";
|
|
2
2
|
import { N as NumberInputActionTypes } from "./NumberInputActions.js";
|
|
3
3
|
function getClampedValues(rawValue, context) {
|
|
4
4
|
const { min, max, step, withDecimal } = context;
|
|
@@ -56,9 +56,11 @@ const useNumberInput = (parameters) => {
|
|
|
56
56
|
(event, field, fieldValue, reason) => {
|
|
57
57
|
if (field === "value" && typeof fieldValue !== "string") {
|
|
58
58
|
switch (reason) {
|
|
59
|
+
// only a blur event will dispatch `numberInput:clamp`
|
|
59
60
|
case "numberInput:inputChange":
|
|
60
61
|
onChange?.(event, fieldValue);
|
|
61
62
|
break;
|
|
63
|
+
// only a blur event will dispatch `numberInput:clamp`
|
|
62
64
|
case "numberInput:clamp":
|
|
63
65
|
onChange?.(event, fieldValue);
|
|
64
66
|
break;
|
|
@@ -5,13 +5,10 @@ function getObjectLogsComponentsDictionary() {
|
|
|
5
5
|
return [DICTIONARY_OBJECT_LOGS_ID].concat(getDataGridComponentsDictionary()).concat(getDynamicFilterComponentsDictionary());
|
|
6
6
|
}
|
|
7
7
|
const DICTIONARY = {
|
|
8
|
-
LABEL_RESOURCE_TYPE_ID: `${DICTIONARY_OBJECT_LOGS_ID}.resource_type_id`,
|
|
9
|
-
LABEL_RESOURCE_SERIAL_ID: `${DICTIONARY_OBJECT_LOGS_ID}.resource_serial_id`,
|
|
10
8
|
LABEL_CREATED_AT: `${DICTIONARY_OBJECT_LOGS_ID}.created_at`,
|
|
11
9
|
LABEL_USER: `${DICTIONARY_OBJECT_LOGS_ID}.email`,
|
|
12
10
|
LABEL_RESOURCE_NAME: `${DICTIONARY_OBJECT_LOGS_ID}.resource_name`,
|
|
13
11
|
LABEL_SERVICE_ID: `${DICTIONARY_OBJECT_LOGS_ID}.service_id`,
|
|
14
|
-
LABEL_PRIVILEGE_NAME: `${DICTIONARY_OBJECT_LOGS_ID}.privilege_name`,
|
|
15
12
|
LABEL_LOG_PREVIEW: `${DICTIONARY_OBJECT_LOGS_ID}.log_preview`,
|
|
16
13
|
LABEL_LOG_DETAIL: `${DICTIONARY_OBJECT_LOGS_ID}.log_detail`,
|
|
17
14
|
LABEL_IP: `${DICTIONARY_OBJECT_LOGS_ID}.ip`
|
|
@@ -10,7 +10,7 @@ import { usePaginate } from "@m4l/graphics";
|
|
|
10
10
|
import { u as useObjectLogsColumns } from "../../hooks/useObjectLogsColumns.js";
|
|
11
11
|
import { a as OBJECT_LOGS_M4L_END_POINT, O as OBJECT_LOGS_KEY_COMPONENT } from "../../constants.js";
|
|
12
12
|
import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
13
|
-
import {
|
|
13
|
+
import { endOfDay, startOfMonth } from "date-fns";
|
|
14
14
|
import { O as ObjectLogsSlots } from "../../slots/ObjectLogsEnum.js";
|
|
15
15
|
function ObjectLogsByM4L(props) {
|
|
16
16
|
const { resourceId, objectId, dataTestId = "" } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { endOfDay, startOfDay } from "date-fns";
|
|
4
4
|
import { D as DataGrid } from "../../../DataGrid/DataGrid.js";
|
|
5
5
|
import { useEnvironment } from "@m4l/core";
|
|
6
6
|
import { D as DynamicFilter } from "../../../DynamicFilter/DynamicFilter.js";
|
|
@@ -125,7 +125,7 @@ function ObjectLogsByOthers(props) {
|
|
|
125
125
|
columns,
|
|
126
126
|
rows,
|
|
127
127
|
rowKeyGetter: (row) => row.id,
|
|
128
|
-
withActions:
|
|
128
|
+
withActions: true,
|
|
129
129
|
actionsProps: {}
|
|
130
130
|
},
|
|
131
131
|
"users_list_logs"
|
|
@@ -25,14 +25,6 @@ const pagerStyles = {
|
|
|
25
25
|
height: theme.vars.size.baseSpacings.sp8
|
|
26
26
|
}
|
|
27
27
|
}),
|
|
28
|
-
/**
|
|
29
|
-
* Rows Per Page Container Styles
|
|
30
|
-
*/
|
|
31
|
-
rowsPerPageContainer: () => ({
|
|
32
|
-
display: "flex",
|
|
33
|
-
flexDirection: "row",
|
|
34
|
-
alignItems: "center"
|
|
35
|
-
}),
|
|
36
28
|
/**
|
|
37
29
|
* Label Select Container Styles
|
|
38
30
|
*/
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
const PAGER_DICTIONARY = {
|
|
2
2
|
rows_per_page: "pager.rows_per_page",
|
|
3
|
-
first: "pager.first",
|
|
4
|
-
previous: "pager.previous",
|
|
5
|
-
before: "pager.before",
|
|
6
|
-
last: "pager.last",
|
|
7
3
|
of: "pager.of",
|
|
8
4
|
page: "pager.page",
|
|
9
5
|
no_records: "pager.no_records",
|
|
10
|
-
total_rows: "pager.total_rows",
|
|
11
6
|
rows: "pager.rows"
|
|
12
7
|
};
|
|
13
8
|
function getPagerComponentsDictionary() {
|
|
@@ -3,7 +3,7 @@ import { c as classes } from "../../classes/index.js";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { createRef, useEffect } from "react";
|
|
5
5
|
import { Chart, registerables } from "chart.js";
|
|
6
|
-
import {
|
|
6
|
+
import { LineWithErrorBarsChart, ScatterWithErrorBarsController, PointWithErrorBar } from "chartjs-chart-error-bars";
|
|
7
7
|
import { useBase, getPropertyByString, evaluateWithContext } from "@m4l/core";
|
|
8
8
|
import { C as ChartNodeRootStyled } from "../../slots/PrintingSystemSlots.js";
|
|
9
9
|
Chart.register(
|
|
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { useId } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { T as TEST_PROPS_DATA, C as COMPONENT_PREFIX, P as PROPERTY_VALUE_KEY_COMPONENT } from "./constants.js";
|
|
6
|
+
import { a as getNameDataTestId, g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
7
7
|
import { P as PropertyValueRootStyled, N as NameStyled, V as ValueStyled } from "./slots/PropertyValueSlots.js";
|
|
8
8
|
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
9
9
|
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
@@ -4,7 +4,7 @@ import clsx from "clsx";
|
|
|
4
4
|
import { Box } from "@mui/material";
|
|
5
5
|
import { useIsMobile } from "@m4l/graphics";
|
|
6
6
|
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
7
|
-
import {
|
|
7
|
+
import { S as SCROLL_KEY_COMPONENT, c as classScrollRoot } from "./constants.js";
|
|
8
8
|
import { R as RootScrollBar, S as SimpleBarStyled } from "./slots/ScrollBarSlots.js";
|
|
9
9
|
import { S as ScrollBarSlots } from "./slots/ScrollBarEnum.js";
|
|
10
10
|
function ScrollBar(props) {
|
|
@@ -37,11 +37,11 @@ var ContainerMenuItemsMainSlots = /* @__PURE__ */ ((ContainerMenuItemsMainSlots2
|
|
|
37
37
|
return ContainerMenuItemsMainSlots2;
|
|
38
38
|
})(ContainerMenuItemsMainSlots || {});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
ContentComponentSlots as C,
|
|
41
41
|
HeaderSidebarSlots as H,
|
|
42
42
|
SideBarDesktopSlots as S,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
SideBarMobileSlots as a,
|
|
44
|
+
SideBarFooterSlots as b,
|
|
45
|
+
ContentGroupsSlots as c,
|
|
46
46
|
ContainerMenuItemsMainSlots as d
|
|
47
47
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { S as SideBarDesktopSlots,
|
|
2
|
+
import { S as SideBarDesktopSlots, a as SideBarMobileSlots, C as ContentComponentSlots, b as SideBarFooterSlots, H as HeaderSidebarSlots, c as ContentGroupsSlots, d as ContainerMenuItemsMainSlots } from "./SideBarEnum.js";
|
|
3
3
|
import { S as SIDEBAR_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { s as sideBarStyles } from "../styles.js";
|
|
5
5
|
const ContainerDesktopRootStyled = styled("section", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as getHeightSizeStyles } from "../../../../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
|
-
import {
|
|
2
|
+
import { I as ITEM_ACTIVE, b as ITEM_IN_TREE_ACTIVE } from "../../../../constants.js";
|
|
3
3
|
const containerMenuItemsMainStyles = {
|
|
4
4
|
/**
|
|
5
5
|
* Style aplicado al contenedor de los items del menú
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ToastContainer as ToastContainer$1 } from "react-toastify";
|
|
3
|
-
import {
|
|
3
|
+
import { D as DEFAULT_CLOSE_TIME, T as TOAST_KEY_COMPONENT } from "./constants.js";
|
|
4
4
|
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
5
5
|
import { ModuleSkeletonProvider } from "@m4l/core";
|
|
6
6
|
import "react-toastify/dist/ReactToastify.min.css";
|
|
@@ -2,9 +2,9 @@ import { styled } from "@mui/material/styles";
|
|
|
2
2
|
import { W as WINDOW_BASE_KEY_COMPONENT } from "../constants.js";
|
|
3
3
|
import { W as WindowBaseSlots } from "./WindowBaseEnum.js";
|
|
4
4
|
import { w as windowBaseStyles } from "../WindowBase.styles.js";
|
|
5
|
+
import { L as LinearProgressIndeterminate } from "../../LinearProgressIndeterminate/LinearProgressIndeterminate.js";
|
|
5
6
|
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
6
7
|
import { M as MenuActions } from "../../MenuActions/MenuActions.js";
|
|
7
|
-
import { L as LinearProgressIndeterminate } from "../../LinearProgressIndeterminate/LinearProgressIndeterminate.js";
|
|
8
8
|
import { I as Icon } from "../../Icon/Icon.js";
|
|
9
9
|
const WindowBaseStyled = styled("div", {
|
|
10
10
|
name: WINDOW_BASE_KEY_COMPONENT,
|
|
@@ -15,9 +15,9 @@ import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoo
|
|
|
15
15
|
import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
16
16
|
import { S as ScrollBar } from "../../../ScrollBar/ScrollBar.js";
|
|
17
17
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
18
|
-
import { A as AreasAdminSlots } from "./slots/AreasAdminEnum.js";
|
|
19
18
|
import { T as Typography } from "../../../mui_extended/Typography/Typography.js";
|
|
20
19
|
import { M as MenuActions } from "../../../MenuActions/MenuActions.js";
|
|
20
|
+
import { A as AreasAdminSlots } from "./slots/AreasAdminEnum.js";
|
|
21
21
|
const AreasAdmin = (props) => {
|
|
22
22
|
const {
|
|
23
23
|
color = "primary",
|
|
@@ -4,7 +4,7 @@ import { u as useAreasStore } from "../../hooks/useAreas/index.js";
|
|
|
4
4
|
import { A as AreaMemonizedWindowModal } from "./subcomponents/Area/subcomponents/WindowModal/WindowModal.js";
|
|
5
5
|
import { shallow } from "zustand/shallow";
|
|
6
6
|
import { L as LoadingError } from "../../../LoadingError/LoadingError.js";
|
|
7
|
-
import {
|
|
7
|
+
import { a as getNameDataTestId, g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
8
8
|
import { A as AREAS_VIEWER_CLASS_NAME } from "../../constants.js";
|
|
9
9
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
10
10
|
import { A as AreasViewerRootStyled } from "./slots/AreasViewerSlots.js";
|
|
@@ -4,7 +4,7 @@ import { W as Window } from "../Window/Window.js";
|
|
|
4
4
|
import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
|
|
5
5
|
import { a as areasViewerClasses } from "../../../../classes/index.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
|
-
import {
|
|
7
|
+
import { P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, R as RESPONSIVE_ROW_HEIGHTS, a as RESPONSIVE_COLAPSED_HEIGHTS } from "../../../../../../contexts/AreasContext/helpers/helper.js";
|
|
8
8
|
import { M as MemonizePopupsViewer } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { d as dragResizeWindowRNDClasses } from "../../../../../../../DragResizeWindowRND/classes/index.js";
|
|
@@ -192,23 +192,23 @@ function getSelectedAreaIdFromCookies(cookiesResponse) {
|
|
|
192
192
|
}
|
|
193
193
|
export {
|
|
194
194
|
COOKIE_WINDOW_SELECTED as C,
|
|
195
|
-
|
|
195
|
+
DEBOUCED_SAVE_TIME as D,
|
|
196
196
|
MARGIN_GRIDLAYOUT as M,
|
|
197
197
|
NORMALIZED_COLS as N,
|
|
198
198
|
PADDING_GRIDLAYOUT as P,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
RESPONSIVE_ROW_HEIGHTS as R,
|
|
200
|
+
RESPONSIVE_COLAPSED_HEIGHTS as a,
|
|
201
|
+
getDataFromResponse as b,
|
|
202
|
+
getParmsFromValue as c,
|
|
203
|
+
COOKIE_BREAKPOINT_LAYOUTS as d,
|
|
204
204
|
DEFAULT_WINDOW as e,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
COOKIE_WINDOWS as f,
|
|
206
|
+
getCookiesContainer as g,
|
|
207
|
+
deleteLayoutFromBreakPoints as h,
|
|
208
|
+
addArea as i,
|
|
209
|
+
DEFAULT_AREA as j,
|
|
210
|
+
getSelectedAreaIdFromCookies as k,
|
|
211
|
+
COOKIE_AREAS_ADMIN_CONTAINER_ID as l,
|
|
212
|
+
COOKIE_AREAS_ADMIN_ID as m,
|
|
213
213
|
setColapsedLayoutBreakPoints as s
|
|
214
214
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createStore } from "zustand";
|
|
2
2
|
import { devtools } from "zustand/middleware";
|
|
3
3
|
import { immer } from "zustand/middleware/immer";
|
|
4
|
-
import { b as
|
|
4
|
+
import { g as getCookiesContainer, b as getDataFromResponse, c as getParmsFromValue, s as setColapsedLayoutBreakPoints, d as COOKIE_BREAKPOINT_LAYOUTS, D as DEBOUCED_SAVE_TIME, e as DEFAULT_WINDOW, M as MARGIN_GRIDLAYOUT, f as COOKIE_WINDOWS, h as deleteLayoutFromBreakPoints, R as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, N as NORMALIZED_COLS, i as addArea, j as DEFAULT_AREA, k as getSelectedAreaIdFromCookies, C as COOKIE_WINDOW_SELECTED, l as COOKIE_AREAS_ADMIN_CONTAINER_ID, m as COOKIE_AREAS_ADMIN_ID } from "./helpers/helper.js";
|
|
5
5
|
import { c as createDynamicMFStore } from "../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
|
|
6
6
|
import cloneDeep from "lodash-es/cloneDeep";
|
|
7
7
|
import debounce from "lodash-es/debounce";
|
|
8
8
|
import { g as generateModuleCount } from "./helpers/generateModuleCount.js";
|
|
9
9
|
import { a as AREAS_STORE_ID } from "../../constants.js";
|
|
10
10
|
import { h as helperSelectLayout } from "./helpers/selectLayout.js";
|
|
11
|
-
import {
|
|
12
|
-
import { d as addLayoutItemToBreakPoints, e as cloneLayouts } from "../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
11
|
+
import { d as deleteCookie, s as setCookie, g as getCookie } from "../../../../helpers/cookies/cookies.js";
|
|
13
12
|
import { k as isEqualLayouts } from "../../../GridLayout/utils.js";
|
|
13
|
+
import { d as cloneLayouts, e as addLayoutItemToBreakPoints } from "../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
14
14
|
const createDevtools = (immerMiddlewere, config) => {
|
|
15
15
|
const { enabled = false } = config;
|
|
16
16
|
if (enabled && process.env.NODE_ENV === "development") {
|
|
@@ -441,8 +441,8 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
441
441
|
bounds: {
|
|
442
442
|
left: MARGIN_GRIDLAYOUT,
|
|
443
443
|
top: MARGIN_GRIDLAYOUT,
|
|
444
|
-
right: -
|
|
445
|
-
bottom: -
|
|
444
|
+
right: -11,
|
|
445
|
+
bottom: -11
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
448
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const ICONS = {
|
|
2
|
-
CLOSE: "close.svg",
|
|
3
2
|
MAXIMIZE: "maximize.svg",
|
|
4
3
|
NORMALIZE: "normalize.svg",
|
|
5
4
|
COLAPSE: "colapse.svg",
|
|
@@ -8,16 +7,9 @@ const ICONS = {
|
|
|
8
7
|
SAVE_COOKIES: "save_cookies.svg",
|
|
9
8
|
DELETE_AREA: "delete_area.svg",
|
|
10
9
|
ADD_AREA: "add_area.svg",
|
|
11
|
-
LAYERS: "layers.svg",
|
|
12
|
-
NAVIGATE_ERROR: "navegate_error.svg",
|
|
13
10
|
EDIT_AREA: "edit.svg",
|
|
14
11
|
CHECK: "checkmarkInCircle.svg",
|
|
15
|
-
RESIZE: "controlSize.svg",
|
|
16
|
-
VERSION: "version.svg",
|
|
17
|
-
SHOW_OPTIONS: "showMoreVertical.svg",
|
|
18
12
|
CHEVRON_DOWN: "chevronDown.svg",
|
|
19
|
-
MODULE: "module.svg",
|
|
20
|
-
POPUP: "popup.svg",
|
|
21
13
|
PENDING_ORDER: "pending_order.svg",
|
|
22
14
|
MORE_VERTICAL: "more_vertical.svg"
|
|
23
15
|
};
|
|
@@ -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, ["root", "ImageLogo"]);
|
|
@@ -6,7 +6,7 @@ import clsx from "clsx";
|
|
|
6
6
|
import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
|
|
7
7
|
import { B as BOOLEAN_FORMATTER_KEY_COMPONENT } from "./constants.js";
|
|
8
8
|
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
9
|
-
import { B as
|
|
9
|
+
import { B as BooleanFormatterRootStyled, a as BooleanFormatterIconStyled, b as BooleanFormatterChipStyled } from "./slots/BooleanFormatterSlots.js";
|
|
10
10
|
import { B as BooleanFormatterSlots } from "./slots/BooleanFormatterEnum.js";
|
|
11
11
|
function getFormatBoolean(presentationType, value = false, getLabel) {
|
|
12
12
|
if (presentationType === "string_yes_no") {
|
|
@@ -18,7 +18,7 @@ const BooleanFormatterChipStyled = styled(Chip, {
|
|
|
18
18
|
slot: BooleanFormatterSlots.chip
|
|
19
19
|
})(booleanFormatterStyles?.chip);
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
BooleanFormatterRootStyled as B,
|
|
22
|
+
BooleanFormatterIconStyled as a,
|
|
23
|
+
BooleanFormatterChipStyled as b
|
|
24
24
|
};
|
|
@@ -6,8 +6,8 @@ import clsx from "clsx";
|
|
|
6
6
|
import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
|
|
7
7
|
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
8
8
|
import { d as dictionary } from "./dictionary.js";
|
|
9
|
+
import { P as PeriodFormatterRootStyled, a as PeriodFormatterSkeletonStyled } from "./slots/PeriodFormatterSlots.js";
|
|
9
10
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
10
|
-
import { P as PeriodFormatterSkeletonStyled, a as PeriodFormatterRootStyled } from "./slots/PeriodFormatterSlots.js";
|
|
11
11
|
import { P as PeriodFormatterSlots } from "./slots/PeriodFomatterEnum.js";
|
|
12
12
|
function useFormatPeriod(years, months, days) {
|
|
13
13
|
const { getLabel } = useModuleDictionary();
|
|
@@ -13,6 +13,6 @@ const PeriodFormatterSkeletonStyled = styled(Skeleton, {
|
|
|
13
13
|
slot: PeriodFormatterSlots.skeleton
|
|
14
14
|
})(periodFormatterStyles?.skeleton);
|
|
15
15
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
PeriodFormatterRootStyled as P,
|
|
17
|
+
PeriodFormatterSkeletonStyled as a
|
|
18
18
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import { useIsMobile } from "@m4l/graphics";
|
|
4
4
|
import { useTheme } from "@mui/material";
|
|
5
|
-
import { useState, useEffect } from "react";
|
|
5
|
+
import { useId, useState, useCallback, useEffect } from "react";
|
|
6
6
|
import { useFormContext, Controller } from "react-hook-form";
|
|
7
7
|
import { A as AutocompleteRootStyled, L as LabelStyled } from "./slots/RHFAutocompleteSlots.js";
|
|
8
8
|
import { A as Autocomplete } from "../../mui_extended/Autocomplete/Autocomplete.js";
|
|
@@ -29,28 +29,36 @@ function RHFAutocomplete(props) {
|
|
|
29
29
|
imageScale = true,
|
|
30
30
|
imageRepeat,
|
|
31
31
|
refresh
|
|
32
|
+
// onChange: onChangeRHF,
|
|
32
33
|
} = props;
|
|
34
|
+
const htmlForId = useId();
|
|
33
35
|
const theme = useTheme();
|
|
34
36
|
const [open, setOpen] = useState(false);
|
|
35
37
|
const isDesktop = !useIsMobile();
|
|
36
|
-
const onCloseLocal = (event, reason) => {
|
|
38
|
+
const onCloseLocal = useCallback((event, reason) => {
|
|
37
39
|
setOpen(false);
|
|
38
40
|
if (onClose) {
|
|
39
41
|
onClose(event, reason);
|
|
40
42
|
}
|
|
41
|
-
};
|
|
42
|
-
const onOpenLocal = (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onOpen
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
}, [onClose]);
|
|
44
|
+
const onOpenLocal = useCallback(
|
|
45
|
+
(event) => {
|
|
46
|
+
setOpen((currentState) => !currentState);
|
|
47
|
+
if (onOpen) {
|
|
48
|
+
onOpen(event);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[onOpen]
|
|
52
|
+
);
|
|
53
|
+
const getOptionLabelLocal = useCallback(
|
|
54
|
+
(option) => {
|
|
55
|
+
if (option === void 0 || option === null) {
|
|
56
|
+
return "";
|
|
57
|
+
}
|
|
58
|
+
return getOptionLabel(option);
|
|
59
|
+
},
|
|
60
|
+
[getOptionLabel]
|
|
61
|
+
);
|
|
54
62
|
const paletteColor = getPropertyByString(
|
|
55
63
|
theme.vars.palette,
|
|
56
64
|
disabled ? "default" : color || "default",
|
|
@@ -108,11 +116,11 @@ function RHFAutocomplete(props) {
|
|
|
108
116
|
{
|
|
109
117
|
ownerState: { ...ownerState },
|
|
110
118
|
label,
|
|
119
|
+
htmlFor: htmlForId,
|
|
111
120
|
size,
|
|
112
121
|
mandatory,
|
|
113
122
|
mandatoryMessage,
|
|
114
123
|
helperMessage,
|
|
115
|
-
htmlFor: `autocomplete-${nameRHF}`,
|
|
116
124
|
disabled
|
|
117
125
|
}
|
|
118
126
|
),
|
|
@@ -124,8 +132,10 @@ function RHFAutocomplete(props) {
|
|
|
124
132
|
options,
|
|
125
133
|
getOptionLabel,
|
|
126
134
|
isOptionEqualToValue,
|
|
127
|
-
multiple
|
|
128
|
-
onChange: (
|
|
135
|
+
multiple,
|
|
136
|
+
onChange: (_event, newValue, _reason) => {
|
|
137
|
+
onChange(newValue);
|
|
138
|
+
},
|
|
129
139
|
onChangeFilterParmsLocal,
|
|
130
140
|
refresh,
|
|
131
141
|
disabled,
|
|
@@ -133,7 +143,8 @@ function RHFAutocomplete(props) {
|
|
|
133
143
|
onOpen: onOpenLocal,
|
|
134
144
|
onClose: onCloseLocal,
|
|
135
145
|
size,
|
|
136
|
-
value
|
|
146
|
+
value,
|
|
147
|
+
htmlFor: htmlForId
|
|
137
148
|
}
|
|
138
149
|
),
|
|
139
150
|
currentVariant === "error" ? /* @__PURE__ */ jsx(HelperError, { message: error?.message }) : null
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { renderMaterialUI } from '../../../../test';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { RHFAutocompleteProps } from '../types';
|
|
4
|
+
import * as Yup from 'yup';
|
|
5
|
+
export declare const FIELD_NAME = "rhf-autocomplete";
|
|
6
|
+
export declare const FIELD_NAME_REQUIRED = "rhf-autocomplete-required";
|
|
7
|
+
export declare const FIELD_NAME_PRESELECTED = "rhf-autocomplete-preselected";
|
|
8
|
+
export declare const FIELD_NAME_PRESELECTED_NOT_IN_OPTIONS = "rhf-autocomplete-preselected-not-in-options";
|
|
9
|
+
export declare const FIELD_NAME_PRESELECTED_MULTIPLE = "rhf-autocomplete-preselected-multiple";
|
|
10
|
+
export declare const FIELD_NAME_PRESELECTED_MULTIPLE_NOT_IN_OPTIONS = "rhf-autocomplete-preselected-multiple-not-in-options";
|
|
11
|
+
export interface OptionsTests {
|
|
12
|
+
id: number;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const mockItems: OptionsTests[];
|
|
16
|
+
export declare const mockItemPreselected: OptionsTests;
|
|
17
|
+
export declare const mockItemPreselectedMultiple: OptionsTests[];
|
|
18
|
+
export declare const mockItemPreselectedNotInOptions: OptionsTests;
|
|
19
|
+
export declare const mockItemPreselectedMultipleNotInOptions: OptionsTests[];
|
|
20
|
+
export declare const INITIAL_FORM_VALUES: FieldValues;
|
|
21
|
+
export declare const DEFAULT_PROPS: RHFAutocompleteProps<OptionsTests>;
|
|
22
|
+
export declare const errorMessage = "This field is required";
|
|
23
|
+
export declare const VALIDATION_SCHEMA: Yup.ObjectSchema<import('yup/lib/object').Assign<import('yup/lib/object').ObjectShape, {
|
|
24
|
+
"rhf-autocomplete-required": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
25
|
+
}>, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<import('yup/lib/object').Assign<import('yup/lib/object').ObjectShape, {
|
|
26
|
+
"rhf-autocomplete-required": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
27
|
+
}>>, import('yup/lib/object').AssertsShape<import('yup/lib/object').Assign<import('yup/lib/object').ObjectShape, {
|
|
28
|
+
"rhf-autocomplete-required": import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
29
|
+
}>>>;
|
|
30
|
+
/**
|
|
31
|
+
* Renderiza el componente con el contexto de EnvironmentProvider y RHFormProvider.
|
|
32
|
+
*/
|
|
33
|
+
export declare const renderWithContexts: (ui: React.ReactElement, initialValuesFormContext?: FieldValues, validationSchema?: any) => ReturnType<typeof renderMaterialUI>;
|
|
34
|
+
/**
|
|
35
|
+
* Renders the RHFAutocompleteAsync component with the provided props.
|
|
36
|
+
*/
|
|
37
|
+
export declare const renderRHFAutocomplete: (fieldName: string, overrideProps?: Partial<RHFAutocompleteProps<OptionsTests>>, withFormValidation?: boolean) => ReturnType<typeof renderMaterialUI>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompleteCloseReason, AutocompleteFreeSoloValueMapping, AutocompleteInputChangeReason,
|
|
1
|
+
import { AutocompleteCloseReason, AutocompleteFreeSoloValueMapping, AutocompleteInputChangeReason, AutocompleteProps as MUIAutocompleteProps, Theme, PaletteColor, PopperProps } from '@mui/material';
|
|
2
2
|
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
3
3
|
import { TextFieldProps } from '../../mui_extended/TextField/types';
|
|
4
4
|
import { RFHAUTOCOMPLETE_KEY_COMPONENT } from './constants';
|
|
@@ -12,7 +12,7 @@ export type RHFAutocompleteType = 'text' | 'image';
|
|
|
12
12
|
* Props for the unified Autocomplete component.
|
|
13
13
|
* Supports both single and multiple selection, and two types: `text` and `image`.
|
|
14
14
|
*/
|
|
15
|
-
export interface RHFAutocompleteProps<T, Multiple extends boolean | undefined =
|
|
15
|
+
export interface RHFAutocompleteProps<T = any, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> extends Omit<MUIAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, 'variant' | 'color' | 'size' | 'value' | 'classes' | 'defaultValue' | 'onBlur' | 'onFocus' | 'autoComplete' | 'renderInput' | 'onChange' | 'open' | 'value' | 'multiple'>, Omit<TextFieldProps, 'label' | 'variant' | 'defaultValue' | 'classes' | 'onBlur' | 'onFocus' | 'onKeyDown' | 'ref' | 'onChange' | 'helperText' | 'value'>, Omit<LabelProps, 'label'> {
|
|
16
16
|
name: string;
|
|
17
17
|
/**
|
|
18
18
|
* The label for the autocomplete field.
|
|
@@ -20,11 +20,6 @@ export interface RHFAutocompleteProps<T, Multiple extends boolean | undefined =
|
|
|
20
20
|
popperProps?: Omit<PopperProps, 'color'>;
|
|
21
21
|
onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
22
22
|
autoComplete?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The value of the autocomplete, supports single or multiple selection.
|
|
25
|
-
* Extended to include `null` for controlled components.
|
|
26
|
-
*/
|
|
27
|
-
value?: AutocompleteValue<T, Multiple, DisableClearable, FreeSolo> | null | undefined;
|
|
28
23
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
29
24
|
variant?: RHFAutocompleteVariants;
|
|
30
25
|
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
@@ -42,7 +37,7 @@ export interface RHFAutocompleteProps<T, Multiple extends boolean | undefined =
|
|
|
42
37
|
helperMessage?: string;
|
|
43
38
|
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
44
39
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
45
|
-
multiple?:
|
|
40
|
+
multiple?: boolean;
|
|
46
41
|
type?: RHFAutocompleteType;
|
|
47
42
|
getOptionUrlImage?: (option: T) => string;
|
|
48
43
|
imageScale?: boolean;
|