@m4l/components 9.3.25-beta.0 → 9.3.25
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/export.d.ts +6 -0
- package/@types/types.d.ts +26 -1
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +7 -10
- package/components/CommonActions/components/ActionFormCancel/types.d.ts +0 -8
- package/components/DataGrid/DataGrid.js +6 -2
- package/components/DataGrid/Datagrid.styles.js +67 -18
- package/components/DataGrid/constants.d.ts +19 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +1 -2
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +3 -6
- package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +0 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/types.d.ts +2 -4
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +7 -1
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/types.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.d.ts +8 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.js +16 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/index.js +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/types.d.ts +4 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.d.ts +9 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.js +60 -0
- package/components/DataGrid/formatters/index.d.ts +1 -0
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +2 -2
- package/components/DataGrid/hooks/useModalCardDetail.js +49 -48
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +2 -0
- package/components/DataGrid/slots/DataGridEnum.js +2 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +3 -1
- package/components/DataGrid/slots/DataGridSlot.js +45 -37
- package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.d.ts +18 -0
- package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.js +10 -0
- package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.d.ts +9 -0
- package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +25 -0
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -2
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +62 -73
- package/components/DataGrid/subcomponents/Cards/index.js +71 -16
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +36 -18
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +13 -20
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +6 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +67 -36
- package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.js +9 -2
- package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.js +4 -2
- package/components/DataGrid/subcomponents/Cards/types.d.ts +50 -1
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +5 -2
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/index.js +60 -41
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +16 -18
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +3 -3
- 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/helpers/types.d.ts +3 -0
- package/components/DataGrid/types.d.ts +17 -4
- package/components/Label/Label.js +1 -1
- package/components/ObjectLogs/slots/ObjectLogsSlots.js +3 -5
- package/components/PaperForm/PaperForm.js +1 -1
- package/components/PaperForm/components/Header.js +7 -9
- package/components/PaperForm/styles.js +4 -9
- package/components/PaperForm/types.d.ts +2 -3
- package/components/Stepper/Stepper.styles.js +0 -1
- package/components/Stepper/dictionary.js +1 -0
- package/components/Stepper/subcomponents/StepArea/index.js +115 -7
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -2
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +53 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +2 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +2 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -24
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +51 -2
- package/components/Stepper/types.d.ts +0 -4
- package/components/ToastContainer/ToastContainer.js +0 -1
- package/components/ToastContainer/constants.d.ts +1 -1
- package/components/ToastContainer/constants.js +1 -1
- package/components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js +3 -47
- package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/Component/index.d.ts +1 -12
- package/components/WindowBase/subcomponents/Component/index.js +2 -56
- package/components/WindowBase/subcomponents/Component/types.d.ts +0 -1
- package/components/WindowBase/types.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +0 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +1 -1
- package/components/areas/contexts/AreasContext/store.js +3 -7
- package/components/areas/contexts/AreasContext/types.d.ts +1 -1
- package/components/formatters/IconsFormatter/IconsFormatter.d.ts +6 -0
- package/components/formatters/IconsFormatter/IconsFormatter.js +22 -0
- package/components/formatters/IconsFormatter/IconsFormatter.styles.d.ts +2 -0
- package/components/formatters/IconsFormatter/IconsFormatter.styles.js +29 -0
- package/components/formatters/IconsFormatter/constants.d.ts +1 -0
- package/components/formatters/IconsFormatter/constants.js +4 -0
- package/components/{DataGrid/formatters/ColumnIconFormatter → formatters/IconsFormatter}/helpers/renderIcon.d.ts +2 -2
- package/components/formatters/IconsFormatter/helpers/renderIcon.js +24 -0
- package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.d.ts +7 -0
- package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.js +16 -0
- package/components/formatters/IconsFormatter/index.d.ts +3 -0
- package/components/formatters/IconsFormatter/index.js +1 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.d.ts +5 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.js +9 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.d.ts +9 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.js +22 -0
- package/components/formatters/IconsFormatter/types.d.ts +57 -0
- package/components/formatters/IconsFormatter/types.js +1 -0
- package/components/formatters/TagsFormatter/TagsFormatter.d.ts +5 -0
- package/components/formatters/TagsFormatter/TagsFormatter.js +28 -0
- package/components/formatters/TagsFormatter/TagsFormatter.styles.d.ts +2 -0
- package/components/formatters/TagsFormatter/TagsFormatter.styles.js +41 -0
- package/components/formatters/TagsFormatter/constants.d.ts +5 -0
- package/components/formatters/TagsFormatter/constants.js +11 -0
- package/components/formatters/TagsFormatter/helpers/renderMultipleTag.d.ts +8 -0
- package/components/formatters/TagsFormatter/helpers/renderMultipleTag.js +19 -0
- package/components/formatters/TagsFormatter/helpers/renderTag.d.ts +7 -0
- package/components/formatters/TagsFormatter/helpers/renderTag.js +9 -0
- package/components/formatters/TagsFormatter/helpers/validateHexColor.d.ts +8 -0
- package/components/formatters/TagsFormatter/helpers/validateHexColor.js +9 -0
- package/components/formatters/TagsFormatter/index.d.ts +2 -0
- package/components/formatters/TagsFormatter/index.js +1 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.d.ts +5 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.js +9 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.d.ts +6 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.js +16 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.d.ts +5 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.js +35 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/index.d.ts +1 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/index.js +1 -0
- package/components/formatters/TagsFormatter/types.d.ts +47 -0
- package/components/formatters/index.d.ts +6 -5
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/mui_extended/CircularProgress/types.d.ts +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +1 -5
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +1 -1
- package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +4 -2
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +7 -19
- package/components/popups/components/PopupsViewer/PopupsViewer.js +1 -1
- package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +1 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +21 -32
- package/contexts/ModalContext/index.js +5 -5
- package/index.js +32 -28
- package/package.json +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/constants.js +0 -4
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.js +0 -58
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.d.ts +0 -7
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.js +0 -19
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +0 -13
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +0 -111
- package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.d.ts +0 -8
- package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.js +0 -79
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.d.ts +0 -8
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.js +0 -93
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
import { DeepKeyOf } from '../../../utils/types';
|
|
3
|
+
import { Sizes } from '@m4l/styles';
|
|
4
|
+
import { IconsFormatterSlots } from './slots/IconsFormatterEnum';
|
|
5
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
6
|
+
import { ICONS_FORMATTER_KEY_COMPONENT } from './constants';
|
|
7
|
+
export type IconColorDeep = DeepKeyOf<Theme['vars']['palette']> | string;
|
|
8
|
+
/**
|
|
9
|
+
* Configuración para un solo icono
|
|
10
|
+
*/
|
|
11
|
+
export interface IconConfig {
|
|
12
|
+
/**
|
|
13
|
+
* URL o ruta de la imagen del icono
|
|
14
|
+
*/
|
|
15
|
+
iconUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* Tooltip que se mostrará al pasar el cursor sobre el icono
|
|
18
|
+
*/
|
|
19
|
+
tooltip?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Función que se ejecuta al hacer clic en el icono
|
|
22
|
+
*/
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Data test id para testing
|
|
26
|
+
*/
|
|
27
|
+
dataTestId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Controla la visibilidad del icono
|
|
30
|
+
*/
|
|
31
|
+
visible?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Color del icono
|
|
34
|
+
*/
|
|
35
|
+
color?: IconColorDeep;
|
|
36
|
+
/**
|
|
37
|
+
* Tamaño del icono
|
|
38
|
+
*/
|
|
39
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props para el IconsFormatter
|
|
43
|
+
*/
|
|
44
|
+
export interface IconsFormatterProps {
|
|
45
|
+
/**
|
|
46
|
+
* Array de configuraciones de iconos (puede ser uno o varios)
|
|
47
|
+
*/
|
|
48
|
+
icons: IconConfig | IconConfig[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Tipos de slots disponibles para el TagFormatter
|
|
52
|
+
*/
|
|
53
|
+
export type IconsFormatterSlotsType = IconsFormatterSlots;
|
|
54
|
+
/**
|
|
55
|
+
* Estilos aplicables al TagFormatter
|
|
56
|
+
*/
|
|
57
|
+
export type IconsFormatterStyles = M4LOverridesStyleRules<IconsFormatterSlotsType, typeof ICONS_FORMATTER_KEY_COMPONENT, Theme>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { r as renderTag } from "./helpers/renderTag.js";
|
|
3
|
+
import { r as renderMultipleTags } from "./helpers/renderMultipleTag.js";
|
|
4
|
+
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
5
|
+
const TagsFormatter = (props) => {
|
|
6
|
+
const { tags, className, size } = props;
|
|
7
|
+
const { currentSize } = useComponentSize(size);
|
|
8
|
+
const tagsArray = useMemo(() => {
|
|
9
|
+
if (!tags) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return Array.isArray(tags) ? tags : [tags];
|
|
13
|
+
}, [tags]);
|
|
14
|
+
if (!tagsArray || tagsArray.length === 0) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (tagsArray.length === 1) {
|
|
18
|
+
return renderTag({
|
|
19
|
+
tag: tagsArray[0],
|
|
20
|
+
size: currentSize,
|
|
21
|
+
className
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return renderMultipleTags(tagsArray, currentSize, className);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
TagsFormatter as T
|
|
28
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
|
+
import { getContrastTextColor } from "@m4l/graphics";
|
|
3
|
+
const tagsFormatterStyles = {
|
|
4
|
+
/**
|
|
5
|
+
* Contenedor de multiple tags
|
|
6
|
+
*/
|
|
7
|
+
tagsContainer: ({ theme }) => ({
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexWrap: "wrap",
|
|
10
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
11
|
+
maxHeight: "100%",
|
|
12
|
+
overflow: "hidden"
|
|
13
|
+
}),
|
|
14
|
+
/**
|
|
15
|
+
* Estilos del tag individual
|
|
16
|
+
*/
|
|
17
|
+
tag: ({ theme, ownerState }) => {
|
|
18
|
+
const backgroundColor = ownerState?.backgroundColor || "#000000";
|
|
19
|
+
const textColor = getContrastTextColor(backgroundColor);
|
|
20
|
+
return {
|
|
21
|
+
display: "inline-block",
|
|
22
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
23
|
+
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
24
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
25
|
+
cursor: "default",
|
|
26
|
+
maxWidth: "200px",
|
|
27
|
+
whiteSpace: "nowrap",
|
|
28
|
+
overflowY: "hidden",
|
|
29
|
+
overflowX: "auto",
|
|
30
|
+
verticalAlign: "middle",
|
|
31
|
+
...getSizeStyles(theme, ownerState?.size || "medium", "base"),
|
|
32
|
+
...theme.typography.body,
|
|
33
|
+
lineHeight: getSizeStyles(theme, ownerState?.size || "medium", "base").height,
|
|
34
|
+
backgroundColor,
|
|
35
|
+
color: textColor
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
tagsFormatterStyles as t
|
|
41
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { T as TagsFormatterSlots } from "./slots/TagsFormatterEnum.js";
|
|
3
|
+
const TAGS_FORMATTER_KEY_COMPONENT = "M4LTagsFormatter";
|
|
4
|
+
const TAGS_FORMATTER_CLASSES = getComponentClasses(
|
|
5
|
+
TAGS_FORMATTER_KEY_COMPONENT,
|
|
6
|
+
TagsFormatterSlots
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
TAGS_FORMATTER_KEY_COMPONENT as T,
|
|
10
|
+
TAGS_FORMATTER_CLASSES as a
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TagConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Helper que renderiza múltiples tags
|
|
4
|
+
* @param tags - Array de tags
|
|
5
|
+
* @param size - Tamaño de los chips
|
|
6
|
+
* @returns Array de componentes de tags renderizados
|
|
7
|
+
*/
|
|
8
|
+
export declare const renderMultipleTags: (tags: TagConfig[], size: "small" | "medium", className?: string) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { T as TagsContainerStyled } from "../slots/TagsFormatterSlots.js";
|
|
3
|
+
import { r as renderTag } from "./renderTag.js";
|
|
4
|
+
const renderMultipleTags = (tags, size, className) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(TagsContainerStyled, { children: tags.map((tag, index) => {
|
|
6
|
+
const tagWithKey = {
|
|
7
|
+
...tag,
|
|
8
|
+
key: tag.key || `${tag.label}-${index}`
|
|
9
|
+
};
|
|
10
|
+
return renderTag({
|
|
11
|
+
tag: tagWithKey,
|
|
12
|
+
size,
|
|
13
|
+
className
|
|
14
|
+
});
|
|
15
|
+
}) });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
renderMultipleTags as r
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { T as Tag } from "../subcomponents/Tag/Tag.js";
|
|
3
|
+
const renderTag = (props) => {
|
|
4
|
+
const { tag, size, className } = props;
|
|
5
|
+
return /* @__PURE__ */ jsx(Tag, { ...tag, size, className });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
renderTag as r
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Valida que un color sea hexadecimal válido
|
|
3
|
+
* - Debe existir
|
|
4
|
+
* - Debe empezar con #
|
|
5
|
+
* @param backgroundColor - Color a validar
|
|
6
|
+
* @returns true si el color es válido, false en caso contrario
|
|
7
|
+
*/
|
|
8
|
+
export declare const validateHexColor: (backgroundColor: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var TagsFormatterSlots = /* @__PURE__ */ ((TagsFormatterSlots2) => {
|
|
2
|
+
TagsFormatterSlots2["root"] = "root";
|
|
3
|
+
TagsFormatterSlots2["tagsContainer"] = "tagsContainer";
|
|
4
|
+
TagsFormatterSlots2["tag"] = "tag";
|
|
5
|
+
return TagsFormatterSlots2;
|
|
6
|
+
})(TagsFormatterSlots || {});
|
|
7
|
+
export {
|
|
8
|
+
TagsFormatterSlots as T
|
|
9
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const TagsContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: any;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const TagStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: any;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import { T as TAGS_FORMATTER_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { T as TagsFormatterSlots } from "./TagsFormatterEnum.js";
|
|
4
|
+
import { t as tagsFormatterStyles } from "../TagsFormatter.styles.js";
|
|
5
|
+
const TagsContainerStyled = styled("div", {
|
|
6
|
+
name: TAGS_FORMATTER_KEY_COMPONENT,
|
|
7
|
+
slot: TagsFormatterSlots.tagsContainer
|
|
8
|
+
})(tagsFormatterStyles.tagsContainer);
|
|
9
|
+
const TagStyled = styled("div", {
|
|
10
|
+
name: TAGS_FORMATTER_KEY_COMPONENT,
|
|
11
|
+
slot: TagsFormatterSlots.tag
|
|
12
|
+
})(tagsFormatterStyles.tag);
|
|
13
|
+
export {
|
|
14
|
+
TagsContainerStyled as T,
|
|
15
|
+
TagStyled as a
|
|
16
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { v as validateHexColor } from "../../helpers/validateHexColor.js";
|
|
4
|
+
import { a as TagStyled } from "../../slots/TagsFormatterSlots.js";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { a as TAGS_FORMATTER_CLASSES } from "../../constants.js";
|
|
7
|
+
import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
|
+
const Tag = (props) => {
|
|
9
|
+
const { label, backgroundColor, size, className } = props;
|
|
10
|
+
const { currentSize } = useComponentSize(size);
|
|
11
|
+
const ownerState = useMemo(
|
|
12
|
+
() => ({
|
|
13
|
+
size: currentSize,
|
|
14
|
+
backgroundColor
|
|
15
|
+
}),
|
|
16
|
+
[currentSize, backgroundColor]
|
|
17
|
+
);
|
|
18
|
+
if (!validateHexColor(backgroundColor)) {
|
|
19
|
+
console.error(
|
|
20
|
+
`backgroundColor no válido: "${backgroundColor}". backgroundColor debe ser un color hexadecimal.`
|
|
21
|
+
);
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
TagStyled,
|
|
26
|
+
{
|
|
27
|
+
ownerState,
|
|
28
|
+
className: clsx(className, TAGS_FORMATTER_CLASSES.root),
|
|
29
|
+
children: label
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
Tag as T
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from './Tag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Maybe } from '@m4l/core';
|
|
2
|
+
import { Sizes } from '@m4l/styles';
|
|
3
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
4
|
+
import { Theme } from '@mui/material';
|
|
5
|
+
import { TAGS_FORMATTER_KEY_COMPONENT } from './constants';
|
|
6
|
+
import { TagsFormatterSlots } from './slots/TagsFormatterEnum';
|
|
7
|
+
/**
|
|
8
|
+
* Props de configuración de un tag
|
|
9
|
+
*/
|
|
10
|
+
export interface TagConfig {
|
|
11
|
+
key?: number | string;
|
|
12
|
+
label: string;
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props del TagFormatter
|
|
19
|
+
*/
|
|
20
|
+
export interface TagsFormatterProps {
|
|
21
|
+
tags: Maybe<TagConfig | TagConfig[]>;
|
|
22
|
+
className?: string;
|
|
23
|
+
dataTestId?: string;
|
|
24
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props del renderTag
|
|
28
|
+
*/
|
|
29
|
+
export interface RenderTagProps {
|
|
30
|
+
tag: TagConfig;
|
|
31
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Owner state del TagFormatter
|
|
36
|
+
*/
|
|
37
|
+
export interface TagFormatterOwnerState extends Pick<TagConfig, 'size'> {
|
|
38
|
+
backgroundColor?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Tipos de slots disponibles para el TagFormatter
|
|
42
|
+
*/
|
|
43
|
+
export type TagsFormatterSlotsType = TagsFormatterSlots;
|
|
44
|
+
/**
|
|
45
|
+
* Estilos aplicables al TagFormatter
|
|
46
|
+
*/
|
|
47
|
+
export type TagsFormatterStyles = M4LOverridesStyleRules<TagsFormatterSlotsType, typeof TAGS_FORMATTER_KEY_COMPONENT, Theme>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { BooleanFormatter } from './BooleanFormatter/BooleanFormatter';
|
|
2
2
|
export * from './ChipStatusFormatter';
|
|
3
3
|
export { getFormatDate, DateFormatter } from './DateFormatter/DateFormatter';
|
|
4
|
-
export { UncertaintyFormatter, getUncertaintyFormat } from './UncertaintyFormatter/UncertaintyFormatter';
|
|
5
|
-
export { PointsFormatter, getFormatPoints } from './PointsFormatter/PointsFormatter';
|
|
6
|
-
export { getFormatConcatenated, ConcatenatedFormatter } from './ConcatenatedFormatter/ConcatenatedFormatter';
|
|
7
|
-
export { useFormatPeriod, PeriodFormatter } from './PeriodFormatter/PeriodFormatter';
|
|
8
|
-
export { PriceFormatter, getFormatPrice } from './PriceFormatter/PriceFormatter';
|
|
4
|
+
export { UncertaintyFormatter, getUncertaintyFormat, } from './UncertaintyFormatter/UncertaintyFormatter';
|
|
5
|
+
export { PointsFormatter, getFormatPoints, } from './PointsFormatter/PointsFormatter';
|
|
6
|
+
export { getFormatConcatenated, ConcatenatedFormatter, } from './ConcatenatedFormatter/ConcatenatedFormatter';
|
|
7
|
+
export { useFormatPeriod, PeriodFormatter, } from './PeriodFormatter/PeriodFormatter';
|
|
8
|
+
export { PriceFormatter, getFormatPrice, } from './PriceFormatter/PriceFormatter';
|
|
9
9
|
export * from './DistanceToNowFormatter';
|
|
10
10
|
export type { UncertaintyRange } from './UncertaintyFormatter/types';
|
|
11
|
+
export { TagsFormatter } from './TagsFormatter';
|
|
@@ -3,7 +3,7 @@ import { CustomFormArguments, FormProviderCustomProps, FormProviderProps } from
|
|
|
3
3
|
/**
|
|
4
4
|
* TODO: Documentar
|
|
5
5
|
*/
|
|
6
|
-
export declare function useCustomForm({ validationSchema, values, statusLoad, mode, }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any,
|
|
6
|
+
export declare function useCustomForm({ validationSchema, values, statusLoad, mode, }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any, FieldValues>;
|
|
7
7
|
/**
|
|
8
8
|
* TODO: Documentar
|
|
9
9
|
*/
|
|
@@ -17,7 +17,7 @@ export interface CircularProgressProps extends Omit<MUICircularProgressProps, 'c
|
|
|
17
17
|
* Este debe ser un valor de la paleta de colores personalizada (`ComponentPalletColor`),
|
|
18
18
|
* restringido actualmente al color `primary`.
|
|
19
19
|
*/
|
|
20
|
-
color?: ComponentPalletColor
|
|
20
|
+
color?: Extract<ComponentPalletColor, 'primary'>;
|
|
21
21
|
/**
|
|
22
22
|
* Tamaño del componente.
|
|
23
23
|
* Solo se aceptan los valores `small` y `medium`, que representan tamaños predefinidos.
|
|
@@ -262,14 +262,10 @@ const createPopupsStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
262
262
|
/**
|
|
263
263
|
* closePopup: Cierra un popup
|
|
264
264
|
*/
|
|
265
|
-
close: (popupId
|
|
265
|
+
close: (popupId) => {
|
|
266
266
|
if (!get().hashPopups[popupId]) {
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
if (get().hashPopups[popupId].fnQueryClose && useFnQueryClose) {
|
|
270
|
-
get().hashPopups[popupId].fnQueryClose?.();
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
269
|
set((state) => {
|
|
274
270
|
state.hashPopups[popupId].status = "closing";
|
|
275
271
|
});
|
|
@@ -296,7 +296,7 @@ export interface PopupsProviderStoreStateWithActions extends PopupsProviderStore
|
|
|
296
296
|
/**
|
|
297
297
|
* pasa el status a closing para que las las transiciones se ejecuten.
|
|
298
298
|
*/
|
|
299
|
-
close: (popupId: string
|
|
299
|
+
close: (popupId: string) => void;
|
|
300
300
|
/**
|
|
301
301
|
* Modifica un popup espeficio
|
|
302
302
|
*/
|
|
@@ -5,6 +5,9 @@ import { WindowToolsMF } from '../../../../WindowBase/contexts';
|
|
|
5
5
|
* Este hook encapsula la lógica relacionada con el estado y las funciones necesarias
|
|
6
6
|
* para el componente Popup. Retorna un objeto con el estado, las acciones y las herramientas
|
|
7
7
|
* de la ventana popup.
|
|
8
|
+
* @param {string} areaId - Identificador del área.
|
|
9
|
+
* @param {string} popupId - Identificador del popup.
|
|
10
|
+
* @returns {Object} Objeto con estado, acciones y herramientas del popup.
|
|
8
11
|
*/
|
|
9
12
|
export declare const usePopups: (popupId: string) => {
|
|
10
13
|
winType: "component" | "microfrontend";
|
|
@@ -14,8 +17,7 @@ export declare const usePopups: (popupId: string) => {
|
|
|
14
17
|
iconUrl: string;
|
|
15
18
|
selected: boolean;
|
|
16
19
|
mfProps: import('../../../../MFLoader/types').MFBaseProps | undefined;
|
|
17
|
-
component: import('../../../../WindowBase').JSX_REACT_NODE
|
|
18
|
-
componentProps: Record<string, any> | undefined;
|
|
20
|
+
component: import('../../../../WindowBase').JSX_REACT_NODE;
|
|
19
21
|
loading: boolean | undefined;
|
|
20
22
|
status: import('../../PopupsViewer/types').PopupStatus;
|
|
21
23
|
version: string | undefined;
|
|
@@ -43,10 +43,6 @@ const usePopups = (popupId) => {
|
|
|
43
43
|
(state) => state.hashPopups[popupId].winType === "component" ? state.hashPopups[popupId].component : void 0,
|
|
44
44
|
shallow
|
|
45
45
|
);
|
|
46
|
-
const componentProps = usePopupsStore(
|
|
47
|
-
(state) => state.hashPopups[popupId].winType === "component" ? state.hashPopups[popupId].componentProps : void 0,
|
|
48
|
-
shallow
|
|
49
|
-
);
|
|
50
46
|
const selectedPopupId = usePopupsStore(
|
|
51
47
|
(state) => state.hashGroups[state.hashPopups[popupId].groupId].selectedPopupId,
|
|
52
48
|
shallow
|
|
@@ -69,21 +65,16 @@ const usePopups = (popupId) => {
|
|
|
69
65
|
setActions: (newActions, newVersion, newBuildTime) => {
|
|
70
66
|
setActions(popupId, newActions, newVersion, newBuildTime);
|
|
71
67
|
},
|
|
72
|
-
/**
|
|
73
|
-
* TODO: Implementar
|
|
74
|
-
*/
|
|
75
68
|
getCookie: () => {
|
|
76
|
-
|
|
69
|
+
throw new Error("getCookie not implemented");
|
|
77
70
|
},
|
|
78
|
-
/**
|
|
79
|
-
* TODO: Implementar
|
|
80
|
-
*/
|
|
81
71
|
getCookies: () => {
|
|
82
|
-
|
|
72
|
+
throw new Error("getCookies not implemented");
|
|
83
73
|
},
|
|
84
|
-
setCookie: (
|
|
74
|
+
setCookie: (key, value) => {
|
|
75
|
+
throw new Error(`setCookie not implemented: ${key}, ${value}`);
|
|
85
76
|
},
|
|
86
|
-
close: (
|
|
77
|
+
close: () => close(popupId),
|
|
87
78
|
startProgress: () => startProgress(popupId),
|
|
88
79
|
stopProgress: () => stopProgress(popupId),
|
|
89
80
|
setFnQueryClose: (fnQueryClose) => setFnQueryClose(popupId, fnQueryClose),
|
|
@@ -98,6 +89,7 @@ const usePopups = (popupId) => {
|
|
|
98
89
|
}),
|
|
99
90
|
[
|
|
100
91
|
popupId,
|
|
92
|
+
buildTime,
|
|
101
93
|
setActions,
|
|
102
94
|
//getCookie,
|
|
103
95
|
//getCookies,
|
|
@@ -105,10 +97,7 @@ const usePopups = (popupId) => {
|
|
|
105
97
|
close,
|
|
106
98
|
startProgress,
|
|
107
99
|
stopProgress,
|
|
108
|
-
setFnQueryClose
|
|
109
|
-
update,
|
|
110
|
-
hide,
|
|
111
|
-
show
|
|
100
|
+
setFnQueryClose
|
|
112
101
|
]
|
|
113
102
|
);
|
|
114
103
|
const memoizedActions = useHeaderActionsPopups({
|
|
@@ -123,7 +112,6 @@ const usePopups = (popupId) => {
|
|
|
123
112
|
selected: selectedPopupId === popupId,
|
|
124
113
|
mfProps,
|
|
125
114
|
component,
|
|
126
|
-
componentProps,
|
|
127
115
|
loading,
|
|
128
116
|
status,
|
|
129
117
|
version,
|
|
@@ -33,7 +33,7 @@ const PopupsViewer = (props) => {
|
|
|
33
33
|
return /* @__PURE__ */ jsx(
|
|
34
34
|
CSSTransition,
|
|
35
35
|
{
|
|
36
|
-
timeout: { appear: 0, enter:
|
|
36
|
+
timeout: { appear: 0, enter: 1300, exit: 0 },
|
|
37
37
|
nodeRef: popupRefsMap.current[id],
|
|
38
38
|
unmountOnExit: true,
|
|
39
39
|
onEntered: () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useRef, useEffect
|
|
2
|
+
import { forwardRef, useRef, useEffect } from "react";
|
|
3
3
|
import { shallow } from "zustand/shallow";
|
|
4
4
|
import { u as usePopupsStore } from "../../../PopupsProvider/hooks/usePopupsStore.js";
|
|
5
5
|
import { P as PopupDragWindowRootStyled } from "../../slots/popupsViewerSlots.js";
|
|
@@ -9,11 +9,10 @@ import { a as POPUPS_VIEWER_CLASS_NAME } from "../../constants.js";
|
|
|
9
9
|
import { a as getNameDataTestId } from "../../../../../../test/getNameDataTestId.js";
|
|
10
10
|
import { M as MemonizedWindowBaseMicroFrontend } from "../../../../../WindowBase/subcomponents/MicroFrontend/MicroFrontend.js";
|
|
11
11
|
import { W as WindowBaseComponent } from "../../../../../WindowBase/subcomponents/Component/index.js";
|
|
12
|
-
import { d as deepShallow } from "../../../../../../utils/deepShallow.js";
|
|
13
12
|
import { W as WindowBase } from "../../../../../WindowBase/WindowBase.js";
|
|
14
13
|
const Popup = forwardRef((props, ref) => {
|
|
15
14
|
const { popupId, containerElement, containerSize, style, onResizeStart, onResizeStop, onDragStart, onDragStop, loggedUser } = props;
|
|
16
|
-
const popup = usePopupsStore((state) => state.hashPopups[popupId],
|
|
15
|
+
const popup = usePopupsStore((state) => state.hashPopups[popupId], shallow);
|
|
17
16
|
const { bringPopupOnFront } = usePopupsStore((state) => state.popupsActions, shallow);
|
|
18
17
|
const { close } = usePopupsStore((state) => state.popupActions, shallow);
|
|
19
18
|
const refHandler = useRef(null);
|
|
@@ -33,7 +32,6 @@ const Popup = forwardRef((props, ref) => {
|
|
|
33
32
|
windowTools,
|
|
34
33
|
mfProps,
|
|
35
34
|
component,
|
|
36
|
-
componentProps,
|
|
37
35
|
//onTouch,
|
|
38
36
|
memoizedActions,
|
|
39
37
|
loading,
|
|
@@ -77,33 +75,6 @@ const Popup = forwardRef((props, ref) => {
|
|
|
77
75
|
refHandler.current?.ensureVisible();
|
|
78
76
|
}
|
|
79
77
|
}, [popup.enforceVisibleCount, popupId]);
|
|
80
|
-
const memoComponent = useMemo(() => {
|
|
81
|
-
if (winType === "microfrontend") {
|
|
82
|
-
return /* @__PURE__ */ jsx(
|
|
83
|
-
MemonizedWindowBaseMicroFrontend,
|
|
84
|
-
{
|
|
85
|
-
emergeType: "popup",
|
|
86
|
-
moduleId,
|
|
87
|
-
dynamicMFStore,
|
|
88
|
-
windowTools,
|
|
89
|
-
loggedUser,
|
|
90
|
-
...mfProps ?? { debugPort: 0, prefix: "" }
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
} else {
|
|
94
|
-
return /* @__PURE__ */ jsx(
|
|
95
|
-
WindowBaseComponent,
|
|
96
|
-
{
|
|
97
|
-
id: popupId,
|
|
98
|
-
emergeType: "popup",
|
|
99
|
-
dynamicMFStore,
|
|
100
|
-
windowTools,
|
|
101
|
-
component,
|
|
102
|
-
componentProps
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}, [winType, component, componentProps, moduleId, dynamicMFStore, windowTools, loggedUser, mfProps, popupId]);
|
|
107
78
|
if (!popup) {
|
|
108
79
|
return null;
|
|
109
80
|
}
|
|
@@ -155,7 +126,25 @@ const Popup = forwardRef((props, ref) => {
|
|
|
155
126
|
"root"
|
|
156
127
|
)
|
|
157
128
|
} : {},
|
|
158
|
-
children:
|
|
129
|
+
children: winType === "microfrontend" ? /* @__PURE__ */ jsx(
|
|
130
|
+
MemonizedWindowBaseMicroFrontend,
|
|
131
|
+
{
|
|
132
|
+
emergeType: "popup",
|
|
133
|
+
moduleId,
|
|
134
|
+
dynamicMFStore,
|
|
135
|
+
windowTools,
|
|
136
|
+
loggedUser,
|
|
137
|
+
...mfProps ?? { debugPort: 0, prefix: "" }
|
|
138
|
+
}
|
|
139
|
+
) : /* @__PURE__ */ jsx(
|
|
140
|
+
WindowBaseComponent,
|
|
141
|
+
{
|
|
142
|
+
emergeType: "popup",
|
|
143
|
+
dynamicMFStore,
|
|
144
|
+
windowTools,
|
|
145
|
+
component
|
|
146
|
+
}
|
|
147
|
+
)
|
|
159
148
|
}
|
|
160
149
|
)
|
|
161
150
|
}
|