@m4l/components 9.3.19-BE101025-beta.2 → 9.3.19-BE241025-beta.1
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/types.d.ts +1 -1
- package/components/AccountPopover/AccountPopover.js +12 -13
- package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.d.ts +1 -1
- package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.js +7 -4
- package/components/AccountPopover/subcomponents/MenuPopover/types.d.ts +1 -1
- package/components/Chip/Chip.js +9 -7
- package/components/Chip/ChipStyles.js +4 -31
- package/components/Chip/helpers.d.ts +10 -0
- package/components/Chip/helpers.js +34 -0
- package/components/Chip/types.d.ts +6 -0
- package/components/DataGrid/DataGrid.js +9 -4
- package/components/DataGrid/Datagrid.styles.js +270 -0
- package/components/DataGrid/constants.js +2 -2
- package/components/DataGrid/contexts/DataGridContext/index.js +322 -112
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +63 -4
- package/components/DataGrid/dictionary.d.ts +5 -0
- package/components/DataGrid/dictionary.js +6 -1
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +2 -2
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +6 -0
- package/components/DataGrid/hooks/useModalCardDetail.js +74 -0
- package/components/DataGrid/hooks/useProcessedColumns.d.ts +50 -0
- package/components/DataGrid/hooks/useProcessedColumns.js +44 -0
- package/components/DataGrid/icons.d.ts +7 -0
- package/components/DataGrid/icons.js +5 -1
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +22 -1
- package/components/DataGrid/slots/DataGridEnum.js +21 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +24 -0
- package/components/DataGrid/slots/DataGridSlot.js +123 -21
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +9 -0
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +91 -0
- package/components/DataGrid/subcomponents/Cards/index.d.ts +5 -0
- package/components/DataGrid/subcomponents/Cards/index.js +40 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +8 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +79 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.d.ts +7 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +98 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +6 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +71 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.d.ts +20 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.js +46 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.d.ts +17 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.js +34 -0
- package/components/DataGrid/subcomponents/Cards/types.d.ts +118 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.d.ts +7 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +43 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/types.d.ts +7 -0
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +5 -3
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/index.js +11 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.d.ts +2 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +304 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/types.d.ts +31 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.d.ts +4 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +125 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +3 -3
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.d.ts +7 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.js +74 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/types.d.ts +4 -0
- package/components/DataGrid/subcomponents/RenderContent/index.d.ts +5 -0
- package/components/DataGrid/subcomponents/RenderContent/index.js +11 -0
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +2 -2
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +1 -1
- package/components/DataGrid/subcomponents/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/components/CardDetails.test.d.ts +1 -0
- package/components/DataGrid/tests/components/CardHeader.test.d.ts +1 -0
- package/components/DataGrid/tests/components/CardRow.test.d.ts +1 -0
- package/components/DataGrid/tests/components/Cards.test.d.ts +1 -0
- package/components/DataGrid/tests/components/CheckboxCellAdapter.test.d.ts +1 -0
- package/components/DataGrid/tests/components/ColumnsConfigCards.test.d.ts +1 -0
- package/components/DataGrid/tests/components/IntersectCard.test.d.ts +1 -0
- package/components/DataGrid/tests/components/ViewMode.test.d.ts +1 -0
- package/components/DataGrid/tests/helpers/types.d.ts +1 -0
- package/components/DataGrid/tests/helpers/useCardsViewConfig.d.ts +24 -0
- package/components/DataGrid/tests/helpers/useCustomCardExample.d.ts +7 -0
- package/components/DataGrid/tests/hooks/useCardContent.test.d.ts +1 -0
- package/components/DataGrid/tests/hooks/useModalDetail.test.d.ts +1 -0
- package/components/DataGrid/tests/hooks/useModalSettingsCards.test.d.ts +1 -0
- package/components/DataGrid/tests/hooks/useProcessedColumns.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +87 -5
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +14 -10
- package/components/DragResizeWindowRND/helpers/expandingParentContainer.d.ts +1 -1
- package/components/DragResizeWindowRND/helpers/expandingParentContainer.js +24 -19
- package/components/DragResizeWindowRND/helpers/getInitialSize.d.ts +3 -3
- package/components/DragResizeWindowRND/helpers/getInitialSize.js +18 -15
- package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.d.ts +1 -1
- package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.js +17 -9
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.js +4 -1
- package/components/DragResizeWindowRND/index.d.ts +1 -0
- package/components/DragResizeWindowRND/types.d.ts +12 -2
- package/components/DynamicFilter/DynamicFilter.js +2 -1
- package/components/DynamicFilter/helpers/formatToInitialFilters.js +3 -3
- package/components/DynamicFilter/helpers/frontEndHelpers.d.ts +2 -2
- package/components/DynamicFilter/helpers/frontEndHelpers.js +31 -9
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.d.ts +2 -1
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +4 -2
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/types.d.ts +3 -0
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/helpers.js +11 -3
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/helpers.js +16 -4
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/helpers.js +11 -8
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/helpers.js +21 -8
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/helpers.js +18 -8
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/helpers.js +5 -3
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +1 -1
- package/components/DynamicFilter/types.d.ts +4 -0
- package/components/DynamicSort/DynamicSort.js +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +4 -2
- package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts +3 -0
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +1 -1
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/EditLabel/hooks/useEditLabel.d.ts +1 -0
- package/components/GridLayout/subcomponents/GridItem/index.js +2 -2
- package/components/Image/Image.js +4 -1
- package/components/LanguagePopover/LanguagePopover.js +2 -0
- package/components/MFIsolationApp/MFIsolationApp.js +1 -4
- package/components/MFIsolationApp/subcomponents/AppBarSettings/AppBarSettings.js +1 -1
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.js +4 -20
- package/components/MFIsolationAppStorybook/types.d.ts +0 -4
- package/components/MFLoader/MFLoader.js +8 -3
- package/components/MFLoader/styles.js +1 -1
- package/components/MFLoader/types.d.ts +10 -0
- package/components/MenuActions/MenuActions.js +105 -55
- package/components/ObjectLogs/hooks/useDetailFormatter.js +1 -1
- package/components/WindowBase/WindowBase.js +3 -3
- package/components/WindowBase/WindowBase.styles.js +36 -31
- package/components/WindowBase/constants.d.ts +1 -1
- package/components/WindowBase/constants.js +2 -2
- package/components/WindowBase/index.d.ts +1 -0
- package/components/WindowBase/subcomponents/Component/index.js +2 -2
- package/components/WindowBase/subcomponents/Component/types.d.ts +2 -0
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +7 -7
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/MicroFrontend/types.d.ts +4 -0
- package/components/WindowBase/types.d.ts +3 -3
- package/components/WindowConfirm/WindowConfirm.js +1 -1
- package/components/areas/components/AreasViewer/AreasViewer.styles.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +6 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.d.ts +1 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +21 -3
- package/components/areas/index.d.ts +1 -1
- package/components/areas/types.d.ts +1 -1
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js +3 -34
- package/components/formatters/DistanceToNowFormatter/dictionary.d.ts +8 -0
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.d.ts +13 -0
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.js +65 -0
- package/components/formatters/DistanceToNowFormatter/index.d.ts +1 -0
- package/components/formatters/DistanceToNowFormatter/types.d.ts +4 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +8 -4
- package/components/hook-form/RHFAutocomplete/constants.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/constants.js +5 -1
- package/components/hook-form/RHFAutocomplete/types.d.ts +2 -2
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +6 -4
- package/components/hook-form/RHFAutocompleteAsync/slots/RHFAutocompleteSlotsAsync.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts +4 -0
- package/components/mui_extended/Autocomplete/Autocomplete.d.ts +4 -8
- package/components/mui_extended/Autocomplete/Autocomplete.js +11 -11
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +7 -3
- package/components/mui_extended/Autocomplete/RenderAdornment/RenderAdornment.d.ts +6 -0
- package/components/mui_extended/Autocomplete/RenderAdornment/RenderAdornment.js +45 -0
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +2 -1
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +4 -12
- package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +72 -23
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.d.ts +0 -2
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +0 -13
- package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +4 -17
- package/components/mui_extended/Autocomplete/renderOptions/index.js +42 -5
- package/components/mui_extended/Autocomplete/renderOptions/types.d.ts +7 -0
- package/components/mui_extended/Autocomplete/types.d.ts +10 -3
- package/components/mui_extended/Button/ButtonStyles.js +15 -5
- package/components/mui_extended/ToggleIconButton/ToggleIconButton.js +6 -2
- package/components/mui_extended/ToggleIconButton/ToggleIconButton.styles.js +9 -0
- package/components/mui_extended/ToggleIconButton/types.d.ts +1 -0
- package/components/mui_extended/index.d.ts +1 -1
- package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +2 -2
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +0 -1
- package/components/popups/components/PopupsViewer/PopupsViewer.js +4 -3
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +5 -2
- package/components/popups/components/PopupsViewer/subcomponents/Popup/types.d.ts +5 -0
- package/components/popups/components/PopupsViewer/types.d.ts +3 -0
- package/contexts/AppearanceComponentContext/AppearanceComponentContext.js +4 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/useDataGridPersistence/helpers.d.ts +2 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts +2 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +5 -0
- package/hooks/useSizeContainer/index.d.ts +2 -1
- package/hooks/useSizeContainer/index.js +22 -13
- package/hooks/useSizeContainer/types.d.ts +6 -0
- package/hooks/useStateRef/index.d.ts +1 -1
- package/hooks/useStateRef/index.js +6 -6
- package/index.js +53 -46
- package/package.json +3 -4
- package/utils/deepShallow.d.ts +17 -0
- package/utils/deepShallow.js +76 -0
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts +2 -2
- package/utils/formatDistanceToNow/formatDistanteToNow.js +18 -2
- package/utils/formatDistanceToNow/types.d.ts +13 -0
- package/utils/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/icons.js +0 -6
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.d.ts +0 -4
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.js +0 -21
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.d.ts +0 -1
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.js +0 -1
|
@@ -3,9 +3,13 @@ const autocompleteSyles = {
|
|
|
3
3
|
/**
|
|
4
4
|
* Styles for the root component.
|
|
5
5
|
*/
|
|
6
|
-
root: () => ({
|
|
6
|
+
root: ({ theme }) => ({
|
|
7
7
|
width: "100%",
|
|
8
|
-
padding: 0
|
|
8
|
+
padding: 0,
|
|
9
|
+
"& .M4LImage-root": {
|
|
10
|
+
width: theme.vars.size.baseSpacings["sp3-5"],
|
|
11
|
+
height: theme.vars.size.baseSpacings["sp3-5"]
|
|
12
|
+
}
|
|
9
13
|
}),
|
|
10
14
|
/**
|
|
11
15
|
* Styles for the icon button component.
|
|
@@ -81,7 +85,7 @@ const autocompleteSyles = {
|
|
|
81
85
|
...ownerState?.startAdornment ? {
|
|
82
86
|
padding: `${sp1} ${sp7} ${sp1} ${sp5}!important`
|
|
83
87
|
} : {
|
|
84
|
-
padding: `${sp1} ${sp7} ${sp1}
|
|
88
|
+
padding: `${sp1} ${sp7} ${sp1} ${sp1}!important`
|
|
85
89
|
},
|
|
86
90
|
gap: sp1,
|
|
87
91
|
flexWrap: "wrap",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Sizes } from '@m4l/styles';
|
|
2
|
+
import { ResourceType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Render adornment function similar to useStartAdornments
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderAdornment: (propsResource: ResourceType, adjustedSize: Extract<Sizes, "small" | "medium">) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { I as Image } from "../../../Image/Image.js";
|
|
4
|
+
import { I as Icon } from "../../../Icon/Icon.js";
|
|
5
|
+
const renderAdornment = (propsResource, adjustedSize) => {
|
|
6
|
+
const { resource, type } = propsResource;
|
|
7
|
+
if (!resource) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (React.isValidElement(resource)) {
|
|
11
|
+
try {
|
|
12
|
+
return React.cloneElement(resource, {
|
|
13
|
+
size: adjustedSize
|
|
14
|
+
});
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.warn("Error cloning React element:", error);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (typeof resource === "string") {
|
|
21
|
+
if (type === "image") {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Image,
|
|
24
|
+
{
|
|
25
|
+
src: resource,
|
|
26
|
+
width: 14,
|
|
27
|
+
height: 14
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
} else {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Icon,
|
|
33
|
+
{
|
|
34
|
+
src: resource,
|
|
35
|
+
size: adjustedSize
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
console.warn("Invalid icon type provided to renderAdornment:", typeof resource);
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
renderAdornment as r
|
|
45
|
+
};
|
|
@@ -40,7 +40,8 @@ function useEndAdornments(props) {
|
|
|
40
40
|
onClick: (event) => !readOnly ? onOpenLocal(event) : void 0,
|
|
41
41
|
disabled,
|
|
42
42
|
size: adjustedSize,
|
|
43
|
-
rotationAngle: open ? 180 : 0
|
|
43
|
+
rotationAngle: open ? 180 : 0,
|
|
44
|
+
"aria-label": "toggle Autocomplete"
|
|
44
45
|
}
|
|
45
46
|
)
|
|
46
47
|
] });
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { AutocompleteOwnerState, AutocompleteProps } from '../types';
|
|
3
|
-
export type UseAdornmentsProps<T> = {
|
|
2
|
+
export type UseAdornmentsProps<T, Multiple extends boolean | undefined = undefined> = {
|
|
4
3
|
selectedValue: T | T[] | null;
|
|
5
4
|
multiple?: boolean;
|
|
6
|
-
loading?: boolean;
|
|
7
5
|
adjustedSize: 'small' | 'medium';
|
|
8
6
|
getOptionLabelLocal: (option: T) => string;
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
getOptionStartAdornment?: AutocompleteProps<T, Multiple>['getOptionStartAdornment'];
|
|
8
|
+
getOptionEndAdornment?: AutocompleteProps<T, Multiple>['getOptionEndAdornment'];
|
|
11
9
|
ownerState: AutocompleteOwnerState;
|
|
12
10
|
handleDelete: (option: T) => void;
|
|
13
|
-
getOptionUrlImage?: (option: T) => string;
|
|
14
|
-
selectedOption?: T;
|
|
15
|
-
getOptionUrlImageLocal: (option: T) => string;
|
|
16
|
-
refresh?: () => void;
|
|
17
|
-
handleRefresh: () => void;
|
|
18
11
|
disabled?: boolean;
|
|
19
|
-
onOpenLocal: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
20
12
|
startAdornment?: AutocompleteProps<unknown, true>['startAdornment'];
|
|
21
13
|
};
|
|
22
14
|
/**
|
|
23
15
|
* Hook para el componente Autocomplete local
|
|
24
16
|
*/
|
|
25
|
-
export declare function useStartAdornments<T>(props: UseAdornmentsProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export declare function useStartAdornments<T, Multiple extends boolean | undefined = undefined>(props: UseAdornmentsProps<T, Multiple>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
|
+
import { r as renderAdornment } from "../RenderAdornment/RenderAdornment.js";
|
|
3
4
|
import { b as ContainerMultipleValuesStyled, c as ContainerWrapperStyled, d as ChipStyled, W as WrapperStartAdornmentStyled } from "../slots/AutocompleteSlots.js";
|
|
4
5
|
function useStartAdornments(props) {
|
|
5
6
|
const {
|
|
@@ -11,30 +12,68 @@ function useStartAdornments(props) {
|
|
|
11
12
|
handleDelete,
|
|
12
13
|
disabled,
|
|
13
14
|
startAdornment,
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
getOptionStartAdornment,
|
|
16
|
+
getOptionEndAdornment
|
|
16
17
|
} = props;
|
|
17
|
-
const startAdornmentClone =
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const startAdornmentClone = useMemo(() => {
|
|
19
|
+
if (!startAdornment) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
return React.cloneElement(startAdornment, {
|
|
24
|
+
size: adjustedSize
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.warn("Error cloning startAdornment:", error);
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}, [startAdornment, adjustedSize]);
|
|
31
|
+
const memoizedIcons = useMemo(() => {
|
|
32
|
+
if (!Array.isArray(selectedValue) || !multiple || selectedValue.length === 0) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const iconMap = /* @__PURE__ */ new Map();
|
|
36
|
+
selectedValue.forEach((option) => {
|
|
37
|
+
const optionKey = getOptionLabelLocal(option);
|
|
38
|
+
const startAdornmentResource = getOptionStartAdornment?.(option);
|
|
39
|
+
const endAdornmentResource = getOptionEndAdornment?.(option);
|
|
40
|
+
if (startAdornmentResource) {
|
|
41
|
+
iconMap.set(`${optionKey}-start`, renderAdornment(startAdornmentResource, adjustedSize));
|
|
42
|
+
}
|
|
43
|
+
if (endAdornmentResource) {
|
|
44
|
+
iconMap.set(`${optionKey}-end`, renderAdornment(endAdornmentResource, adjustedSize));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return iconMap;
|
|
48
|
+
}, [
|
|
49
|
+
selectedValue,
|
|
50
|
+
multiple,
|
|
51
|
+
getOptionLabelLocal,
|
|
52
|
+
getOptionStartAdornment,
|
|
53
|
+
getOptionEndAdornment,
|
|
54
|
+
adjustedSize
|
|
55
|
+
]);
|
|
20
56
|
const internalAdornments = useMemo(() => {
|
|
21
57
|
if (!(Array.isArray(selectedValue) && multiple)) {
|
|
22
58
|
return null;
|
|
23
59
|
}
|
|
24
|
-
return /* @__PURE__ */ jsx(ContainerMultipleValuesStyled, { children: /* @__PURE__ */ jsx(ContainerWrapperStyled, { children: selectedValue.map((option, index) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
return /* @__PURE__ */ jsx(ContainerMultipleValuesStyled, { role: "list", "aria-label": "Selected options", children: /* @__PURE__ */ jsx(ContainerWrapperStyled, { children: selectedValue.map((option, index) => {
|
|
61
|
+
const optionKey = getOptionLabelLocal(option);
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
63
|
+
ChipStyled,
|
|
64
|
+
{
|
|
65
|
+
size: adjustedSize,
|
|
66
|
+
label: optionKey,
|
|
67
|
+
opacity: true,
|
|
68
|
+
onDeleted: () => handleDelete(option),
|
|
69
|
+
disabledDeleteButton: disabled,
|
|
70
|
+
ownerState: { ...ownerState },
|
|
71
|
+
startIcon: memoizedIcons?.get(`${optionKey}-start`),
|
|
72
|
+
endIcon: memoizedIcons?.get(`${optionKey}-end`)
|
|
73
|
+
},
|
|
74
|
+
`${optionKey}-${index}`
|
|
75
|
+
);
|
|
76
|
+
}) }) });
|
|
38
77
|
}, [
|
|
39
78
|
selectedValue,
|
|
40
79
|
multiple,
|
|
@@ -43,16 +82,26 @@ function useStartAdornments(props) {
|
|
|
43
82
|
handleDelete,
|
|
44
83
|
disabled,
|
|
45
84
|
ownerState,
|
|
46
|
-
|
|
47
|
-
getOptionalEndAdornment
|
|
85
|
+
memoizedIcons
|
|
48
86
|
]);
|
|
49
87
|
if (startAdornmentClone && internalAdornments) {
|
|
50
88
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
-
/* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { children: startAdornmentClone }),
|
|
89
|
+
/* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", children: startAdornmentClone }),
|
|
52
90
|
internalAdornments
|
|
53
91
|
] });
|
|
54
92
|
}
|
|
55
|
-
|
|
93
|
+
if (startAdornmentClone) {
|
|
94
|
+
return /* @__PURE__ */ jsx(WrapperStartAdornmentStyled, { role: "img", "aria-hidden": "true", children: startAdornmentClone });
|
|
95
|
+
}
|
|
96
|
+
if (!getOptionLabelLocal) {
|
|
97
|
+
console.error("useStartAdornments: getOptionLabelLocal is required");
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
if (!handleDelete) {
|
|
101
|
+
console.error("useStartAdornments: handleDelete is required");
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return internalAdornments;
|
|
56
105
|
}
|
|
57
106
|
export {
|
|
58
107
|
useStartAdornments as u
|
|
@@ -8,7 +8,6 @@ export declare function useValuesAndHandlers<T, Multiple extends boolean | undef
|
|
|
8
8
|
open: boolean;
|
|
9
9
|
inputValue: string;
|
|
10
10
|
selectedValue: T | T[] | null;
|
|
11
|
-
selectedOption: T | undefined;
|
|
12
11
|
isOptionEqualToValueLocal: (option: unknown, val: unknown) => boolean;
|
|
13
12
|
handleDelete: (optionToDelete: T) => void;
|
|
14
13
|
handleRefresh: () => void;
|
|
@@ -17,7 +16,6 @@ export declare function useValuesAndHandlers<T, Multiple extends boolean | undef
|
|
|
17
16
|
onCloseLocal: (event: React.SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
18
17
|
onOpenLocal: (event: React.SyntheticEvent) => void;
|
|
19
18
|
getOptionLabelLocal: (option: unknown) => string;
|
|
20
|
-
getOptionUrlImageLocal: (option: T | null) => string;
|
|
21
19
|
checkKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
22
20
|
scrollPositionOptionsRef: import('react').MutableRefObject<number>;
|
|
23
21
|
};
|
|
@@ -9,8 +9,6 @@ function useValuesAndHandlers(props) {
|
|
|
9
9
|
onClose,
|
|
10
10
|
onChangeFilterParmsLocal,
|
|
11
11
|
multiple,
|
|
12
|
-
getOptionUrlImage,
|
|
13
|
-
// Diferencia
|
|
14
12
|
refresh,
|
|
15
13
|
onChange,
|
|
16
14
|
value,
|
|
@@ -115,12 +113,6 @@ function useValuesAndHandlers(props) {
|
|
|
115
113
|
},
|
|
116
114
|
[getOptionLabel]
|
|
117
115
|
);
|
|
118
|
-
const getOptionUrlImageLocal = useCallback((option) => {
|
|
119
|
-
if (option === void 0 || option === null || getOptionUrlImage === void 0) {
|
|
120
|
-
return "";
|
|
121
|
-
}
|
|
122
|
-
return getOptionUrlImage(option);
|
|
123
|
-
}, [getOptionUrlImage]);
|
|
124
116
|
const [inputValue, setInputValue] = useState("");
|
|
125
117
|
useEffect(() => {
|
|
126
118
|
if (readOnly && value !== null && value !== void 0 && !multiple) {
|
|
@@ -161,14 +153,10 @@ function useValuesAndHandlers(props) {
|
|
|
161
153
|
}
|
|
162
154
|
}
|
|
163
155
|
};
|
|
164
|
-
const selectedOption = options.find((option) => {
|
|
165
|
-
return isOptionEqualToValueLocal(option, selectedValue);
|
|
166
|
-
});
|
|
167
156
|
return {
|
|
168
157
|
open,
|
|
169
158
|
inputValue,
|
|
170
159
|
selectedValue,
|
|
171
|
-
selectedOption,
|
|
172
160
|
isOptionEqualToValueLocal,
|
|
173
161
|
handleDelete,
|
|
174
162
|
handleRefresh,
|
|
@@ -177,7 +165,6 @@ function useValuesAndHandlers(props) {
|
|
|
177
165
|
onCloseLocal,
|
|
178
166
|
onOpenLocal,
|
|
179
167
|
getOptionLabelLocal,
|
|
180
|
-
getOptionUrlImageLocal,
|
|
181
168
|
checkKeyDown,
|
|
182
169
|
scrollPositionOptionsRef
|
|
183
170
|
};
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import { HTMLAttributes
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
* Higher-order function to generate a render option function for Autocomplete.
|
|
5
|
-
* It supports rendering options with `startAd` and `endIcon`.
|
|
6
|
-
* @param color - The color for the MenuItem.
|
|
7
|
-
*/
|
|
8
|
-
type OptionType<T> = T & {
|
|
9
|
-
label: string;
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
startAdornment?: ReactNode;
|
|
13
|
-
endAdornment?: ReactNode;
|
|
14
|
-
size: Extract<Sizes, 'small' | 'medium'>;
|
|
15
|
-
};
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ResourceType } from '../types';
|
|
3
|
+
import { RenderOptionType } from './types';
|
|
16
4
|
/**
|
|
17
5
|
* Render option for Autocomplete.
|
|
18
6
|
*/
|
|
19
7
|
export declare const renderOption: <T>(optionProps: HTMLAttributes<HTMLLIElement> & {
|
|
20
8
|
key: string;
|
|
21
|
-
}, option:
|
|
22
|
-
export {};
|
|
9
|
+
}, option: RenderOptionType<T>, getOptionStartAdornment?: (option: T) => ResourceType | undefined, getOptionEndAdornment?: (option: T) => ResourceType | undefined) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { r as renderAdornment } from "../RenderAdornment/RenderAdornment.js";
|
|
3
4
|
import { M as MenuItem } from "../../MenuItem/MenuItem.js";
|
|
4
5
|
const MemoizedMenuItem = memo(MenuItem);
|
|
5
|
-
const
|
|
6
|
+
const RenderOptionComponent = ({
|
|
7
|
+
optionProps,
|
|
8
|
+
option,
|
|
9
|
+
getOptionStartAdornment,
|
|
10
|
+
getOptionEndAdornment
|
|
11
|
+
}) => {
|
|
6
12
|
const { className, key, ...otherOptionProps } = optionProps;
|
|
13
|
+
const processedStartAdornment = useMemo(() => {
|
|
14
|
+
if (!getOptionStartAdornment) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const startAdornment = getOptionStartAdornment(option);
|
|
18
|
+
if (!startAdornment) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return renderAdornment(startAdornment, option.size);
|
|
22
|
+
}, [getOptionStartAdornment, option]);
|
|
23
|
+
const processedEndAdornment = useMemo(() => {
|
|
24
|
+
if (!getOptionEndAdornment) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const endAdornment = getOptionEndAdornment(option);
|
|
28
|
+
if (!endAdornment) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return renderAdornment(endAdornment, option.size);
|
|
32
|
+
}, [getOptionEndAdornment, option]);
|
|
7
33
|
return /* @__PURE__ */ jsx(
|
|
8
34
|
MemoizedMenuItem,
|
|
9
35
|
{
|
|
@@ -12,13 +38,24 @@ const renderOption = (optionProps, option) => {
|
|
|
12
38
|
color: "default",
|
|
13
39
|
label: option.label,
|
|
14
40
|
disabled: option.disabled,
|
|
15
|
-
startIcon:
|
|
16
|
-
endIcon:
|
|
17
|
-
size: option.size
|
|
41
|
+
startIcon: processedStartAdornment,
|
|
42
|
+
endIcon: processedEndAdornment
|
|
18
43
|
},
|
|
19
44
|
option.label
|
|
20
45
|
);
|
|
21
46
|
};
|
|
47
|
+
const MemoizedRenderOptionComponent = memo(RenderOptionComponent);
|
|
48
|
+
const renderOption = (optionProps, option, getOptionStartAdornment, getOptionEndAdornment) => {
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
MemoizedRenderOptionComponent,
|
|
51
|
+
{
|
|
52
|
+
optionProps,
|
|
53
|
+
option,
|
|
54
|
+
getOptionStartAdornment,
|
|
55
|
+
getOptionEndAdornment
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
22
59
|
export {
|
|
23
60
|
renderOption as r
|
|
24
61
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutocompleteChangeReason, AutocompleteFreeSoloValueMapping, AutocompleteInputChangeReason, AutocompleteProps as MUIAutocompleteProps, Theme } from '@mui/material';
|
|
2
2
|
import { Sizes } from '@m4l/styles';
|
|
3
|
-
import { ChangeEvent, ReactElement } from 'react';
|
|
3
|
+
import { ChangeEvent, ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { TextFieldProps } from '../TextField/types';
|
|
5
5
|
import { AUTOCOMPLETE_KEY_COMPONENT } from './constants';
|
|
6
6
|
import { AutocompleteSlots } from './slots';
|
|
@@ -21,6 +21,7 @@ export interface BaseAutocompleteProps {
|
|
|
21
21
|
*/
|
|
22
22
|
dataTestid?: string;
|
|
23
23
|
}
|
|
24
|
+
export type AdornmentType = ReactElement | string;
|
|
24
25
|
/**
|
|
25
26
|
* Props for the unified Autocomplete component.
|
|
26
27
|
* Supports both single and multiple selection, and two types: `text` and `image`.
|
|
@@ -47,17 +48,18 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
47
48
|
*/
|
|
48
49
|
value: T | T[] | null | undefined;
|
|
49
50
|
/**
|
|
51
|
+
*
|
|
50
52
|
* Function to get the label for a given option.
|
|
51
53
|
*/
|
|
52
54
|
getOptionLabel: (option: T | AutocompleteFreeSoloValueMapping<false>) => string;
|
|
53
55
|
/**
|
|
54
56
|
* Function to get the start adornment for a given option.
|
|
55
57
|
*/
|
|
56
|
-
|
|
58
|
+
getOptionStartAdornment?: (option: T) => ResourceType;
|
|
57
59
|
/**
|
|
58
60
|
* Function to get the end adornment for a given option.
|
|
59
61
|
*/
|
|
60
|
-
|
|
62
|
+
getOptionEndAdornment?: (option: T) => ResourceType;
|
|
61
63
|
/**
|
|
62
64
|
* Function to compare if an option matches the selected value.
|
|
63
65
|
*/
|
|
@@ -72,6 +74,7 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
72
74
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
73
75
|
/**
|
|
74
76
|
* Function to get the image URL for a given option (only for `type: 'image'`).
|
|
77
|
+
* @deprecated Use getOptionStartAdornment or getOptionEndAdornment instead.
|
|
75
78
|
*/
|
|
76
79
|
getOptionUrlImage?: (option: T) => string;
|
|
77
80
|
/**
|
|
@@ -88,6 +91,10 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined> exte
|
|
|
88
91
|
*/
|
|
89
92
|
startAdornment?: ReactElement;
|
|
90
93
|
}
|
|
94
|
+
export type ResourceType = {
|
|
95
|
+
resource: ReactNode;
|
|
96
|
+
type?: 'icon' | 'image';
|
|
97
|
+
};
|
|
91
98
|
/**
|
|
92
99
|
* Represents the owner state of the Autocomplete component for styling purposes.
|
|
93
100
|
*/
|
|
@@ -6,7 +6,7 @@ const buttonStyles = {
|
|
|
6
6
|
*/
|
|
7
7
|
buttonRoot: ({ theme, ownerState }) => {
|
|
8
8
|
const selectionEffect = {
|
|
9
|
-
boxShadow: `inset 0px 0px 0px 1px ${theme.vars.palette.
|
|
9
|
+
boxShadow: `inset 0px 0px 0px 1px ${theme.vars.palette.primary.focusVisible}`
|
|
10
10
|
};
|
|
11
11
|
return {
|
|
12
12
|
// Configuración general
|
|
@@ -38,11 +38,21 @@ const buttonStyles = {
|
|
|
38
38
|
boxShadow: "unset",
|
|
39
39
|
// Color del texto
|
|
40
40
|
[`&&& .${BUTTON_CLASSES.textButton}`]: {
|
|
41
|
-
color
|
|
41
|
+
...ownerState?.color === "default" && {
|
|
42
|
+
color: theme.vars.palette.text.primary
|
|
43
|
+
},
|
|
44
|
+
...ownerState?.color !== "default" && {
|
|
45
|
+
color: ownerState?.paletteColor?.contrastText
|
|
46
|
+
}
|
|
42
47
|
},
|
|
43
48
|
// Color de los adornos laterales
|
|
44
49
|
"&&& .M4LIcon-icon": {
|
|
45
|
-
|
|
50
|
+
...ownerState?.color === "default" && {
|
|
51
|
+
backgroundColor: theme.vars.palette.text.primary
|
|
52
|
+
},
|
|
53
|
+
...ownerState?.color !== "default" && {
|
|
54
|
+
backgroundColor: ownerState?.paletteColor?.contrastText
|
|
55
|
+
}
|
|
46
56
|
},
|
|
47
57
|
// Estado Hover
|
|
48
58
|
"&:hover": {
|
|
@@ -51,12 +61,12 @@ const buttonStyles = {
|
|
|
51
61
|
},
|
|
52
62
|
// Estado Active
|
|
53
63
|
"&:active": {
|
|
54
|
-
backgroundColor: ownerState?.paletteColor?.
|
|
64
|
+
backgroundColor: ownerState?.paletteColor?.active,
|
|
55
65
|
boxShadow: "unset"
|
|
56
66
|
},
|
|
57
67
|
// Estado focus visible
|
|
58
68
|
"&:focus-visible": {
|
|
59
|
-
backgroundColor: ownerState?.paletteColor?.
|
|
69
|
+
backgroundColor: ownerState?.paletteColor?.active,
|
|
60
70
|
...selectionEffect
|
|
61
71
|
}
|
|
62
72
|
},
|
|
@@ -14,20 +14,24 @@ const ToggleAbleIconButton = ({
|
|
|
14
14
|
variant = "text",
|
|
15
15
|
color,
|
|
16
16
|
badgeProps,
|
|
17
|
+
disabled,
|
|
18
|
+
className,
|
|
17
19
|
...props
|
|
18
20
|
}) => {
|
|
19
21
|
const ownerState = {
|
|
20
22
|
isToggled,
|
|
21
|
-
variant
|
|
23
|
+
variant,
|
|
24
|
+
disabled
|
|
22
25
|
};
|
|
23
26
|
return /* @__PURE__ */ jsx(
|
|
24
27
|
ToggleIconButtonRootStyled,
|
|
25
28
|
{
|
|
26
29
|
...props,
|
|
27
30
|
variant,
|
|
31
|
+
disabled,
|
|
28
32
|
color,
|
|
29
33
|
badgeProps,
|
|
30
|
-
className: clsx(getComponentSlotRoot(TOGGLE_ICON_BUTTON_KEY_COMPONENT), TOGGLE_ICON_BUTTON_CLASS_NAME_SPECIFY),
|
|
34
|
+
className: clsx(className, getComponentSlotRoot(TOGGLE_ICON_BUTTON_KEY_COMPONENT), TOGGLE_ICON_BUTTON_CLASS_NAME_SPECIFY),
|
|
31
35
|
...getPropDataTestId(TOGGLE_ICON_BUTTON_KEY_COMPONENT, ToggleIconButtonSlots.toggleIconButtonRoot, dataTestId),
|
|
32
36
|
role: "toggle-iconButton",
|
|
33
37
|
ownerState,
|
|
@@ -24,6 +24,15 @@ const toggleIconButtonStyles = {
|
|
|
24
24
|
},
|
|
25
25
|
"&:focus-visible": {
|
|
26
26
|
backgroundColor: theme.vars.palette.primary.enabledOpacity
|
|
27
|
+
},
|
|
28
|
+
...ownerState?.disabled && {
|
|
29
|
+
backgroundColor: theme.vars.palette.default.opacity,
|
|
30
|
+
"& .M4LIcon-root .M4LIcon-icon": {
|
|
31
|
+
backgroundColor: `${theme.vars.palette.text.disabled} !important`
|
|
32
|
+
},
|
|
33
|
+
...ownerState?.variant === "outline" && {
|
|
34
|
+
backgroundColor: theme.vars.palette.border.disabled
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
}
|
|
@@ -22,6 +22,7 @@ export interface ToggleIconButtonProps extends Omit<IconButtonProps, 'onClick' |
|
|
|
22
22
|
* Estado del propietario del componente ToggleIconButton.
|
|
23
23
|
*/
|
|
24
24
|
export interface ToggleIconButtonOwnerState extends Record<string, unknown> {
|
|
25
|
+
disabled?: boolean;
|
|
25
26
|
/** Indica si el valor es verdadero o falso. */
|
|
26
27
|
isToggled?: boolean;
|
|
27
28
|
/** Valor de la variante del componente. */
|
|
@@ -23,7 +23,7 @@ export * from './Tabs';
|
|
|
23
23
|
export * from './TabContent';
|
|
24
24
|
export * from './TabContext';
|
|
25
25
|
export { getPagerComponentsDictionary } from '../Pager/dicctionary';
|
|
26
|
-
export * from './Typography
|
|
26
|
+
export * from './Typography';
|
|
27
27
|
export * from './ToggleButton';
|
|
28
28
|
export * from './ToggleIconButton';
|
|
29
29
|
export * from './NavLink';
|
|
@@ -17,7 +17,7 @@ export declare const usePopups: (popupId: string) => {
|
|
|
17
17
|
iconUrl: string;
|
|
18
18
|
selected: boolean;
|
|
19
19
|
mfProps: import('../../../../MFLoader/types').MFBaseProps | undefined;
|
|
20
|
-
component: import('../../../../WindowBase
|
|
20
|
+
component: import('../../../../WindowBase').JSX_REACT_NODE;
|
|
21
21
|
loading: boolean | undefined;
|
|
22
22
|
status: import('../../PopupsViewer/types').PopupStatus;
|
|
23
23
|
version: string | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const usePopups: (popupId: string) => {
|
|
|
32
32
|
variant: import('../contexts/PopupsContext/types').PopupVariantType;
|
|
33
33
|
draggable: boolean;
|
|
34
34
|
resizable: boolean;
|
|
35
|
-
defaultPosition: import('
|
|
35
|
+
defaultPosition: import('../../../..').RNDDefaultPosition | undefined;
|
|
36
36
|
bounds: import('../../../../DragResizeWindowRND/types').DraggableWindowBounds | undefined;
|
|
37
37
|
onMouseDown: ((e: MouseEvent) => void) | undefined;
|
|
38
38
|
allowHeightResizeContainer: boolean | undefined;
|
|
@@ -7,7 +7,7 @@ import { u as useSizeContainer } from "../../../../hooks/useSizeContainer/index.
|
|
|
7
7
|
import { R as RootStyled } from "./slots/popupsViewerSlots.js";
|
|
8
8
|
import { useRef, createRef, useEffect, memo } from "react";
|
|
9
9
|
const PopupsViewer = (props) => {
|
|
10
|
-
const { groupId = "global", onResizeStart, onResizeStop, onDragStart, onDragStop, containerElement } = props;
|
|
10
|
+
const { groupId = "global", onResizeStart, onResizeStop, onDragStart, onDragStop, containerElement, className, loggedUser } = props;
|
|
11
11
|
const popupsIds = usePopupsStore(
|
|
12
12
|
(state) => state.popupsIds.filter((pId) => groupId === state.hashPopups[pId].groupId && state.hashPopups[pId].status !== "closing"),
|
|
13
13
|
shallow
|
|
@@ -29,7 +29,7 @@ const PopupsViewer = (props) => {
|
|
|
29
29
|
if (!containerElement || !containerSize) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
return /* @__PURE__ */ jsx(RootStyled, { ownerState: { baseZindex }, children: /* @__PURE__ */ jsx(TransitionGroup, { children: popupsIds.map((id) => {
|
|
32
|
+
return /* @__PURE__ */ jsx(RootStyled, { ownerState: { baseZindex }, className, children: /* @__PURE__ */ jsx(TransitionGroup, { children: popupsIds.map((id) => {
|
|
33
33
|
return /* @__PURE__ */ jsx(
|
|
34
34
|
CSSTransition,
|
|
35
35
|
{
|
|
@@ -57,7 +57,8 @@ const PopupsViewer = (props) => {
|
|
|
57
57
|
"data-testid": "popup",
|
|
58
58
|
popupId: id,
|
|
59
59
|
containerElement,
|
|
60
|
-
containerSize
|
|
60
|
+
containerSize,
|
|
61
|
+
loggedUser
|
|
61
62
|
},
|
|
62
63
|
id
|
|
63
64
|
)
|