@m4l/components 9.3.1 → 9.3.2-B04082025-beta.3

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.
Files changed (113) hide show
  1. package/@types/types.d.ts +9 -1
  2. package/components/DataGrid/Datagrid.styles.js +1 -1
  3. package/components/DragResizeWindowRND/constants.d.ts +44 -0
  4. package/components/DragResizeWindowRND/constants.js +46 -1
  5. package/components/DragResizeWindowRND/index.d.ts +1 -0
  6. package/components/DynamicFilter/DynamicFilter.styles.js +2 -2
  7. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +3 -0
  8. package/components/DynamicSort/DynamicSort.styles.js +2 -2
  9. package/components/ImageText/components/ImageTextContainer/ImageTextContainer.d.ts +7 -0
  10. package/components/ImageText/components/ImageTextContainer/ImageTextContainer.js +25 -0
  11. package/components/ImageText/components/ImageTextContainer/ImageTextContainerStyle.d.ts +2 -0
  12. package/components/ImageText/components/ImageTextContainer/ImageTextContainerStyle.js +22 -0
  13. package/components/ImageText/components/ImageTextContainer/constants.d.ts +8 -0
  14. package/components/ImageText/components/ImageTextContainer/constants.js +8 -0
  15. package/components/ImageText/components/ImageTextContainer/index.d.ts +1 -0
  16. package/components/ImageText/components/ImageTextContainer/slots/ImageTextContainerEnum.d.ts +3 -0
  17. package/components/ImageText/components/ImageTextContainer/slots/ImageTextContainerEnum.js +7 -0
  18. package/components/ImageText/components/ImageTextContainer/slots/ImageTextContainerSlots.d.ts +3 -0
  19. package/components/ImageText/components/ImageTextContainer/slots/ImageTextContainerSlots.js +12 -0
  20. package/components/ImageText/components/ImageTextContainer/types.d.ts +22 -0
  21. package/components/ImageText/components/NoItemPrivileges/NoItemPrivileges.d.ts +7 -0
  22. package/components/ImageText/components/NoItemPrivileges/NoItemPrivileges.js +65 -0
  23. package/components/ImageText/components/NoItemPrivileges/NoItemPrivilegesStyles.d.ts +5 -0
  24. package/components/ImageText/components/NoItemPrivileges/NoItemPrivilegesStyles.js +62 -0
  25. package/components/ImageText/components/NoItemPrivileges/constants.d.ts +4 -0
  26. package/components/ImageText/components/NoItemPrivileges/constants.js +11 -0
  27. package/components/ImageText/components/NoItemPrivileges/dictionary.d.ts +5 -0
  28. package/components/ImageText/components/NoItemPrivileges/dictionary.js +12 -0
  29. package/components/ImageText/components/NoItemPrivileges/index.d.ts +3 -0
  30. package/components/ImageText/components/NoItemPrivileges/index.js +1 -0
  31. package/components/ImageText/components/NoItemPrivileges/slots/NoItemPrivilegesEnum.d.ts +7 -0
  32. package/components/ImageText/components/NoItemPrivileges/slots/NoItemPrivilegesEnum.js +11 -0
  33. package/components/ImageText/components/NoItemPrivileges/slots/NoItemPrivilegesSlots.d.ts +15 -0
  34. package/components/ImageText/components/NoItemPrivileges/slots/NoItemPrivilegesSlots.js +33 -0
  35. package/components/ImageText/components/NoItemPrivileges/test/NoItemPrivileges.test.d.ts +1 -0
  36. package/components/ImageText/components/NoItemPrivileges/types.d.ts +36 -0
  37. package/components/ImageText/components/NoItemSelected/NoItemSelected.js +62 -0
  38. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/NoItemSelected.styles.js +4 -20
  39. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/constant.js +1 -1
  40. package/components/ImageText/components/NoItemSelected/index.js +1 -0
  41. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/slots/NoItemSelectedEnum.d.ts +0 -1
  42. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/slots/NoItemSelectedEnum.js +0 -1
  43. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/slots/NoItemSelectedSlots.d.ts +4 -7
  44. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/slots/NoItemSelectedSlots.js +5 -10
  45. package/components/{NoItemSelected → ImageText/components/NoItemSelected}/types.d.ts +2 -2
  46. package/components/ImageText/hooks/useIsVisible/index.d.ts +6 -0
  47. package/components/ImageText/hooks/useIsVisible/index.js +24 -0
  48. package/components/ImageText/index.d.ts +3 -0
  49. package/components/ImageText/index.js +1 -0
  50. package/components/ObjectLogs/helpers/Fields/filterFields.d.ts +5 -0
  51. package/components/ObjectLogs/helpers/Fields/filterFields.js +81 -0
  52. package/components/ObjectLogs/hooks/useDetailFormatter.js +1 -1
  53. package/components/ObjectLogs/hooks/useFilterAndSort.d.ts +15 -0
  54. package/components/ObjectLogs/hooks/useFilterAndSort.js +51 -0
  55. package/components/ObjectLogs/slots/ObjectLogsSlots.js +1 -2
  56. package/components/ObjectLogs/subcomponents/ObjectLogsByM4L/ObjectLogsByM4L.js +39 -88
  57. package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +30 -104
  58. package/components/PropertyValue/PropertyValue.styles.js +1 -1
  59. package/components/SideBar/subcomponents/TreeGroupItems/styles.js +1 -1
  60. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +1 -1
  61. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions.d.ts +1 -1
  62. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useHeaderActions.js +4 -2
  63. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.d.ts +1 -1
  64. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +50 -47
  65. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +2 -1
  66. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +5 -1
  67. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/WindowModal.js +12 -7
  68. package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -0
  69. package/components/formatters/ChipStatusFormatter/ChipStatusFormatter.js +7 -1
  70. package/components/formatters/ChipStatusFormatter/types.d.ts +9 -1
  71. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
  72. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  73. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +1 -1
  74. package/components/index.d.ts +1 -1
  75. package/components/mui_extended/Accordion/Accordion.js +1 -1
  76. package/components/mui_extended/Autocomplete/Autocomplete.js +2 -1
  77. package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +1 -0
  78. package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +4 -2
  79. package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +1 -1
  80. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +1 -1
  81. package/components/mui_extended/Tab/Tab.styles.js +4 -4
  82. package/components/mui_extended/TabContent/TabContent.styles.js +0 -1
  83. package/components/mui_extended/TextField/TextField.js +16 -3
  84. package/components/mui_extended/TextField/TextField.styles.js +20 -4
  85. package/components/mui_extended/TextField/constants.d.ts +3 -0
  86. package/components/mui_extended/TextField/helpers/getLimitCharacters/getLimitCharacters.d.ts +7 -0
  87. package/components/mui_extended/TextField/helpers/getLimitCharacters/getLimitCharacters.js +11 -0
  88. package/components/mui_extended/TextField/helpers/getLimitCharacters/index.d.ts +1 -0
  89. package/components/mui_extended/TextField/helpers/getLimitCharacters/index.js +1 -0
  90. package/components/mui_extended/TextField/helpers/getLimitCharacters/test/getLimitCharacters.test.d.ts +1 -0
  91. package/components/mui_extended/TextField/helpers/getLimitCharacters/types.d.ts +5 -0
  92. package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +4 -1
  93. package/components/mui_extended/TextField/slots/TextFieldEnum.js +3 -0
  94. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +13 -0
  95. package/components/mui_extended/TextField/slots/TextFieldSlots.js +17 -2
  96. package/components/mui_extended/TextField/types.d.ts +9 -0
  97. package/hooks/useDynamicFilterAndSort/types.d.ts +2 -0
  98. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +5 -3
  99. package/index.js +42 -34
  100. package/mockServiceWorker.js +1 -1
  101. package/package.json +3 -3
  102. package/storybook/components/Areas/AreasViewer/subcomponents/Launcher/PopupButton.d.ts +1 -1
  103. package/storybook/components/NoItemPrivileges/NoItemPrivileges.stories.d.ts +12 -0
  104. package/storybook/components/NoItemSelect/NoItemSelect.stories.d.ts +1 -1
  105. package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +7 -0
  106. package/components/NoItemSelected/NoItemSelected.js +0 -77
  107. /package/components/{NoItemSelected → ImageText/components/ImageTextContainer}/index.js +0 -0
  108. /package/components/{NoItemSelected → ImageText/components/NoItemSelected}/NoItemSelected.d.ts +0 -0
  109. /package/components/{NoItemSelected → ImageText/components/NoItemSelected}/NoItemSelected.styles.d.ts +0 -0
  110. /package/components/{NoItemSelected → ImageText/components/NoItemSelected}/constant.d.ts +0 -0
  111. /package/components/{NoItemSelected → ImageText/components/NoItemSelected}/dictionary.d.ts +0 -0
  112. /package/components/{NoItemSelected → ImageText/components/NoItemSelected}/dictionary.js +0 -0
  113. /package/components/{NoItemSelected → ImageText/components/NoItemSelected}/index.d.ts +0 -0
@@ -0,0 +1,36 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ import { M4LOverridesStyleRules } from '../../../../@types/augmentations';
3
+ import { NoItemPrivilegesSlots } from './slots/NoItemPrivilegesEnum';
4
+ import { NO_ITEM_PRIVILEGES_KEY_COMPONENT } from './constants';
5
+ import { Theme } from '@mui/material';
6
+ export type NoItemPrivilegesProps = {
7
+ /**
8
+ * Imagen que se muestra en el componente.
9
+ */
10
+ image?: string;
11
+ /**
12
+ * Título que se muestra en el componente.
13
+ */
14
+ title?: string;
15
+ /**
16
+ * Mensaje que se muestra en el componente.
17
+ */
18
+ message?: string;
19
+ /**
20
+ * Clase que se aplica al componente.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * ID de prueba que se aplica al componente.
25
+ */
26
+ dataTestId?: string;
27
+ /**
28
+ * Tamaño del componente.
29
+ */
30
+ size?: Extract<Sizes, 'small' | 'medium'>;
31
+ };
32
+ export type NoItemPrivilegesOwnerState = {
33
+ isVisible: boolean;
34
+ };
35
+ export type NoItemPrivilegesSlotsType = keyof typeof NoItemPrivilegesSlots;
36
+ export type NoItemPrivilegesStyles = M4LOverridesStyleRules<NoItemPrivilegesSlotsType, typeof NO_ITEM_PRIVILEGES_KEY_COMPONENT, Theme>;
@@ -0,0 +1,62 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
+ import { useMemo, useRef } from "react";
4
+ import { N as NoItemSelectedContainer, I as ImgStyled, W as WrapperTpography, T as TypographyStyledTitle, a as TypographyStyledDetail, L as LabelDetail } from "./slots/NoItemSelectedSlots.js";
5
+ import { clsx } from "clsx";
6
+ import { c as classNoItemSelected, N as NO_ITEM_SELECT_KEY_COMPONENT } from "./constant.js";
7
+ import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
8
+ import { N as NoItemSelectedSlots } from "./slots/NoItemSelectedEnum.js";
9
+ import { D as DICTIONARY } from "./dictionary.js";
10
+ import { u as useIsVisible } from "../../hooks/useIsVisible/index.js";
11
+ import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
12
+ import { I as ImageTextContainer } from "../ImageTextContainer/ImageTextContainer.js";
13
+ function NoItemSelected(props) {
14
+ const { image, message, size = "medium", className, dataTestId } = props;
15
+ const { host_static_assets, environment_assets } = useEnvironment();
16
+ const { currentSize } = useComponentSize(size);
17
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
18
+ const { getLabel } = useModuleDictionary();
19
+ const defaultImage = useMemo(() => {
20
+ return `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
21
+ }, []);
22
+ const ownerState = {
23
+ size
24
+ };
25
+ const containerRef = useRef(null);
26
+ const isVisible = useIsVisible(containerRef);
27
+ return /* @__PURE__ */ jsxs(ImageTextContainer, { dataTestId, children: [
28
+ /* @__PURE__ */ jsx(NoItemSelectedContainer, { ref: containerRef, ownerState: { isVisible }, children: /* @__PURE__ */ jsx(
29
+ ImgStyled,
30
+ {
31
+ className: clsx(classNoItemSelected.img, "noItemSelectedImg", className),
32
+ src: image || defaultImage,
33
+ alt: "No item selected"
34
+ }
35
+ ) }),
36
+ !message ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(WrapperTpography, { size: adjustedSize, children: [
37
+ /* @__PURE__ */ jsx(
38
+ TypographyStyledTitle,
39
+ {
40
+ ownerState: { ...ownerState },
41
+ skeletonWidth: 100,
42
+ size: adjustedSize,
43
+ "data-testid": getPropDataTestId(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots.typographyStyledTitle, dataTestId),
44
+ children: getLabel(DICTIONARY.LABEL_TITLE)
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsx(
48
+ TypographyStyledDetail,
49
+ {
50
+ ownerState: { ...ownerState },
51
+ skeletonWidth: 200,
52
+ size: adjustedSize,
53
+ "data-testid": getPropDataTestId(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots.typographyStyledDetail, dataTestId),
54
+ children: getLabel(DICTIONARY.LABEL_DETAIL)
55
+ }
56
+ )
57
+ ] }) }) : /* @__PURE__ */ jsx(LabelDetail, { children: message })
58
+ ] });
59
+ }
60
+ export {
61
+ NoItemSelected as N
62
+ };
@@ -1,21 +1,5 @@
1
- import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
1
+ import { g as getTypographyStyles } from "../../../../utils/getTypographyStyles.js";
2
2
  const noItemSelectedStyles = {
3
- /**
4
- * 📦 Estilos para el contenedor principal del componente NoItemSelected 📦.
5
- */
6
- root: ({ theme }) => ({
7
- display: "flex",
8
- flexDirection: "column",
9
- alignItems: "center",
10
- justifyContent: "center",
11
- height: "80%",
12
- width: "100%",
13
- maxWidth: "600px",
14
- minWidth: "200px",
15
- padding: "10px",
16
- gap: theme.vars.size.baseSpacings.sp2,
17
- minHeight: "60px"
18
- }),
19
3
  /**
20
4
  * 📸 Estilos para la imagen del componente NoItemSelected 📸.
21
5
  */
@@ -77,15 +61,15 @@ const noItemSelectedStyles = {
77
61
  /**
78
62
  * 🎁 Estilos para el wrapper de la imagen de NoItemSelect. 🎁
79
63
  */
80
- noItemSelectedContainer: () => ({
81
- justifyContent: "center",
64
+ noItemSelectedContainer: ({ ownerState }) => ({
65
+ visibility: ownerState?.isVisible ? "visible" : "hidden",
82
66
  display: "flex",
67
+ justifyContent: "center",
83
68
  height: "100%",
84
69
  width: "100%",
85
70
  maxWidth: "150px",
86
71
  maxHeight: "106px",
87
72
  minWidth: "70px",
88
- minHeight: "50px",
89
73
  '& [class*="M4LImage-imgSkeleton"]': {
90
74
  opacity: 0
91
75
  },
@@ -1,4 +1,4 @@
1
- import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
1
+ import { g as getComponentClasses } from "../../../../utils/getComponentSlotRoot.js";
2
2
  import { N as NoItemSelectedSlots } from "./slots/NoItemSelectedEnum.js";
3
3
  const NO_ITEM_SELECT_KEY_COMPONENT = "M4LNoItemSelected";
4
4
  const classNoItemSelected = getComponentClasses(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots);
@@ -1,5 +1,4 @@
1
1
  export declare enum NoItemSelectedSlots {
2
- root = "root",
3
2
  img = "img",
4
3
  typographyStyledTitle = "typographyStyledTitle",
5
4
  typographyStyledDetail = "typographyStyledDetail",
@@ -1,5 +1,4 @@
1
1
  var NoItemSelectedSlots = /* @__PURE__ */ ((NoItemSelectedSlots2) => {
2
- NoItemSelectedSlots2["root"] = "root";
3
2
  NoItemSelectedSlots2["img"] = "img";
4
3
  NoItemSelectedSlots2["typographyStyledTitle"] = "typographyStyledTitle";
5
4
  NoItemSelectedSlots2["typographyStyledDetail"] = "typographyStyledDetail";
@@ -1,16 +1,13 @@
1
- export declare const WrapperNoItemSelectedStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
2
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
3
- }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
4
- export declare const ImgStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Image').ImageProps, keyof import('../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
1
+ export declare const ImgStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../../Image').ImageProps, keyof import('../../../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
5
2
  ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
6
3
  }, {}, {}>;
7
- export declare const TypographyStyledTitle: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
4
+ export declare const TypographyStyledTitle: import('@emotion/styled').StyledComponent<Pick<import('../../../../mui_extended/Typography/types').TypographyProps, keyof import('../../../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
8
5
  ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
9
6
  }, {}, {}>;
10
- export declare const TypographyStyledDetail: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
7
+ export declare const TypographyStyledDetail: import('@emotion/styled').StyledComponent<Pick<import('../../../../mui_extended/Typography/types').TypographyProps, keyof import('../../../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
11
8
  ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
12
9
  }, {}, {}>;
13
- export declare const LabelDetail: import('@emotion/styled').StyledComponent<Pick<import('../../Label').LabelProps, keyof import('../../Label').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
10
+ export declare const LabelDetail: import('@emotion/styled').StyledComponent<Pick<import('../../../../Label').LabelProps, keyof import('../../../../Label').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
14
11
  ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
15
12
  }, {}, {}>;
16
13
  export declare const NoItemSelectedContainer: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
@@ -2,13 +2,9 @@ import { styled } from "@mui/material/styles";
2
2
  import { N as NoItemSelectedSlots } from "./NoItemSelectedEnum.js";
3
3
  import { N as NO_ITEM_SELECT_KEY_COMPONENT } from "../constant.js";
4
4
  import { n as noItemSelectedStyles } from "../NoItemSelected.styles.js";
5
- import { T as Typography } from "../../mui_extended/Typography/Typography.js";
6
- import { L as Label } from "../../Label/Label.js";
7
- import { I as Image } from "../../Image/Image.js";
8
- const WrapperNoItemSelectedStyled = styled("div", {
9
- name: NO_ITEM_SELECT_KEY_COMPONENT,
10
- slot: NoItemSelectedSlots.root
11
- })(noItemSelectedStyles?.root);
5
+ import { T as Typography } from "../../../../mui_extended/Typography/Typography.js";
6
+ import { L as Label } from "../../../../Label/Label.js";
7
+ import { I as Image } from "../../../../Image/Image.js";
12
8
  const ImgStyled = styled(Image, {
13
9
  name: NO_ITEM_SELECT_KEY_COMPONENT,
14
10
  slot: NoItemSelectedSlots.img
@@ -38,7 +34,6 @@ export {
38
34
  LabelDetail as L,
39
35
  NoItemSelectedContainer as N,
40
36
  TypographyStyledTitle as T,
41
- WrapperNoItemSelectedStyled as W,
42
- WrapperTpography as a,
43
- TypographyStyledDetail as b
37
+ WrapperTpography as W,
38
+ TypographyStyledDetail as a
44
39
  };
@@ -1,9 +1,9 @@
1
1
  import { Theme, PaletteColor } from '@mui/material';
2
- import { M4LOverridesStyleRules } from '../../@types/augmentations';
2
+ import { M4LOverridesStyleRules } from '../../../../@types/augmentations';
3
3
  import { NO_ITEM_SELECT_KEY_COMPONENT } from './constant';
4
4
  import { Sizes } from '@m4l/styles';
5
5
  import { NoItemSelectedSlots } from './slots/NoItemSelectedEnum';
6
- import { LabelProps } from '../Label';
6
+ import { LabelProps } from '../../../Label';
7
7
  export interface NoItemSelectedProps extends Pick<LabelProps, 'label'> {
8
8
  image?: string;
9
9
  message?: string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Hook para verificar si el componente es visible en la pantalla.
3
+ * @param containerRef - Referencia al contenedor del componente.
4
+ * @returns true si el componente es visible, false en caso contrario.
5
+ */
6
+ export declare const useIsVisible: (containerRef: React.RefObject<HTMLDivElement>) => boolean;
@@ -0,0 +1,24 @@
1
+ import { useState, useEffect } from "react";
2
+ const useIsVisible = (containerRef) => {
3
+ const [isVisible, setIsVisible] = useState(true);
4
+ useEffect(() => {
5
+ const observer = new ResizeObserver((entries) => {
6
+ for (const entry of entries) {
7
+ const shouldBeVisible = entry.contentRect.height >= 55;
8
+ setIsVisible(shouldBeVisible);
9
+ }
10
+ });
11
+ if (containerRef.current) {
12
+ observer.observe(containerRef.current);
13
+ const rect = containerRef.current.getBoundingClientRect();
14
+ setIsVisible(rect.height >= 55);
15
+ }
16
+ return () => {
17
+ observer.disconnect();
18
+ };
19
+ }, [containerRef]);
20
+ return isVisible;
21
+ };
22
+ export {
23
+ useIsVisible as u
24
+ };
@@ -0,0 +1,3 @@
1
+ export * from './components/NoItemPrivileges';
2
+ export * from './components/NoItemSelected';
3
+ export * from './components/ImageTextContainer';
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,5 @@
1
+ import { FilterField } from '@m4l/components';
2
+ /**
3
+ * Opciones del filtro
4
+ */
5
+ export declare const filterFieldsGenerator: (urlAssetsPrefix: string, otherApp?: boolean | undefined) => FilterField[];
@@ -0,0 +1,81 @@
1
+ import { endOfDay, startOfDay, startOfMonth } from "date-fns";
2
+ import { D as DICTIONARY } from "../../dictionary.js";
3
+ const filterFieldsGenerator = (urlAssetsPrefix, otherApp) => {
4
+ if (otherApp) {
5
+ return [
6
+ {
7
+ name: "createdAt",
8
+ dictionaryId: DICTIONARY.LABEL_CREATED_AT,
9
+ type: "datetime",
10
+ multiple: false,
11
+ presence: "initialized",
12
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`,
13
+ defaultOperand1: startOfDay(/* @__PURE__ */ new Date()),
14
+ defaultOperand2: endOfDay(/* @__PURE__ */ new Date())
15
+ },
16
+ {
17
+ name: "userId",
18
+ dictionaryId: DICTIONARY.LABEL_USER,
19
+ type: "string",
20
+ multiple: true,
21
+ presence: "optional",
22
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`
23
+ },
24
+ {
25
+ name: "logPreview",
26
+ dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
27
+ type: "string",
28
+ multiple: true,
29
+ presence: "optional",
30
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_preview.svg`
31
+ },
32
+ {
33
+ name: "logDetail",
34
+ dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
35
+ type: "string",
36
+ multiple: true,
37
+ presence: "optional",
38
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_detail.svg`
39
+ }
40
+ ];
41
+ }
42
+ return [
43
+ {
44
+ name: "user_logs.created_at",
45
+ dictionaryId: DICTIONARY.LABEL_CREATED_AT,
46
+ type: "datetime",
47
+ multiple: false,
48
+ presence: "fixed",
49
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`,
50
+ defaultOperand1: startOfMonth(/* @__PURE__ */ new Date()),
51
+ defaultOperand2: endOfDay(/* @__PURE__ */ new Date())
52
+ },
53
+ {
54
+ name: "users.email",
55
+ dictionaryId: DICTIONARY.LABEL_USER,
56
+ type: "string",
57
+ multiple: true,
58
+ presence: "optional",
59
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`
60
+ },
61
+ {
62
+ name: "user_logs.log_preview",
63
+ dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
64
+ type: "string",
65
+ multiple: true,
66
+ presence: "optional",
67
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_preview.svg`
68
+ },
69
+ {
70
+ name: "user_logs.log_detail",
71
+ dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
72
+ type: "string",
73
+ multiple: true,
74
+ presence: "optional",
75
+ urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_detail.svg`
76
+ }
77
+ ];
78
+ };
79
+ export {
80
+ filterFieldsGenerator as f
81
+ };
@@ -14,7 +14,7 @@ const useDetailFormatter = (type) => {
14
14
  (rowProps) => {
15
15
  let logId;
16
16
  if (type === "m4l") {
17
- logId = rowProps.row.id;
17
+ logId = rowProps.id;
18
18
  } else {
19
19
  logId = rowProps.row.uuid;
20
20
  }
@@ -0,0 +1,15 @@
1
+ import { ObjectLogsByOtherProps } from '../subcomponents/ObjectLogsByOthers/ObjectLogsByOthers';
2
+ interface UseFilterAndSortProps extends Partial<ObjectLogsByOtherProps> {
3
+ setBackendQueryParams: React.Dispatch<React.SetStateAction<Record<string, any>>>;
4
+ Refresh: () => void;
5
+ otherApp?: boolean;
6
+ }
7
+ /**
8
+ * Hook para obtener DynamicFilter and Sort
9
+ */
10
+ export declare function useFilterAndSort(props: UseFilterAndSortProps): {
11
+ leftActions: import("react/jsx-runtime").JSX.Element;
12
+ visibleCustomHeader: boolean;
13
+ customHeaderComponent: import("react/jsx-runtime").JSX.Element;
14
+ };
15
+ export {};
@@ -0,0 +1,51 @@
1
+ import { useCallback } from "react";
2
+ import { getRawFiltersForNetwork, useDynamicFilterAndSort } from "@m4l/components";
3
+ import { useEnvironment } from "@m4l/core";
4
+ import { f as filterFieldsGenerator } from "../helpers/Fields/filterFields.js";
5
+ function useFilterAndSort(props) {
6
+ const { setBackendQueryParams, Refresh, otherApp = false, resourceTypeId, resourceSerialId } = props;
7
+ const { host_static_assets, environment_assets } = useEnvironment();
8
+ const onChangeFilterSort = useCallback((params) => {
9
+ const fixedFields = [
10
+ {
11
+ n: "resourceTypeId",
12
+ o: "c",
13
+ o1: resourceTypeId,
14
+ ft: "string"
15
+ },
16
+ {
17
+ n: "resourceSerialId",
18
+ o: "c",
19
+ o1: resourceSerialId,
20
+ ft: "string"
21
+ }
22
+ ];
23
+ const allFields = [...fixedFields, ...params.eventFilters?.rawFilters || []];
24
+ if (otherApp) {
25
+ setBackendQueryParams({
26
+ f: getRawFiltersForNetwork(allFields, "snakeCase")
27
+ });
28
+ } else {
29
+ setBackendQueryParams((prevParams) => ({
30
+ ...prevParams,
31
+ f: getRawFiltersForNetwork(prevParams.eventFilters?.rawFilters || [], "snakeCase")
32
+ }));
33
+ }
34
+ Refresh();
35
+ }, [Refresh, setBackendQueryParams, otherApp, resourceTypeId, resourceSerialId]);
36
+ const { leftActions, visibleCustomHeader, customHeaderComponent } = useDynamicFilterAndSort({
37
+ onChangeFilterSort,
38
+ fields: filterFieldsGenerator(`${host_static_assets}/${environment_assets}`, otherApp),
39
+ withAllField: true,
40
+ visibleRefresh: true,
41
+ filterSortAutomatic: false
42
+ });
43
+ return {
44
+ leftActions,
45
+ visibleCustomHeader,
46
+ customHeaderComponent
47
+ };
48
+ }
49
+ export {
50
+ useFilterAndSort as u
51
+ };
@@ -13,7 +13,7 @@ const ContainerWrapperStyled = styled("div", {
13
13
  name: OBJECT_LOGS_KEY_COMPONENT,
14
14
  slot: ObjectLogsSlots.root
15
15
  })(objectLogsStyles?.root);
16
- const ActionsWrapperStyled = styled("div", {
16
+ styled("div", {
17
17
  name: OBJECT_LOGS_KEY_COMPONENT,
18
18
  slot: ObjectLogsSlots.actionsWrapperStyled
19
19
  })(objectLogsStyles?.actionsWrapperStyled);
@@ -54,7 +54,6 @@ styled(ReactJson, {
54
54
  slot: ObjectLogsSlots.reactJsonSlot
55
55
  })(objectLogsStyles?.reactJsonSlot);
56
56
  export {
57
- ActionsWrapperStyled as A,
58
57
  ContainerWrapperStyled as C,
59
58
  DetailDialogComponent as D,
60
59
  GridWrapperStyled as G,
@@ -1,20 +1,16 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { D as DataGrid } from "../../../DataGrid/DataGrid.js";
4
- import { useEnvironment } from "@m4l/core";
5
- import { D as DynamicFilter } from "../../../DynamicFilter/DynamicFilter.js";
6
4
  import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
7
- import { C as ContainerWrapperStyled, A as ActionsWrapperStyled, G as GridWrapperStyled } from "../../slots/ObjectLogsSlots.js";
8
- import { D as DICTIONARY } from "../../dictionary.js";
5
+ import { C as ContainerWrapperStyled, G as GridWrapperStyled } from "../../slots/ObjectLogsSlots.js";
9
6
  import { usePaginate } from "@m4l/graphics";
10
7
  import { u as useObjectLogsColumns } from "../../hooks/useObjectLogsColumns.js";
11
8
  import { a as OBJECT_LOGS_M4L_END_POINT, O as OBJECT_LOGS_KEY_COMPONENT } from "../../constants.js";
12
9
  import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
13
- import { endOfDay, startOfMonth } from "date-fns";
10
+ import { u as useFilterAndSort } from "../../hooks/useFilterAndSort.js";
14
11
  import { O as ObjectLogsSlots } from "../../slots/ObjectLogsEnum.js";
15
12
  function ObjectLogsByM4L(props) {
16
13
  const { resourceId, objectId, dataTestId = "" } = props;
17
- const { host_static_assets, environment_assets } = useEnvironment();
18
14
  const [backendQueryParams, setBackendQueryParams] = useState(() => {
19
15
  return { resource_id: resourceId, object_id: objectId };
20
16
  });
@@ -31,92 +27,47 @@ function ObjectLogsByM4L(props) {
31
27
  clearRows();
32
28
  setBackendQueryParams({ resource_id: resourceId, object_id: objectId });
33
29
  }, [resourceId, objectId]);
34
- const onChangeFilter = (_initFilters, rawFilters) => {
35
- setBackendQueryParams((oldParms) => ({ ...oldParms, f: rawFilters }));
36
- Refresh();
37
- };
38
- return /* @__PURE__ */ jsxs(
30
+ const { leftActions, visibleCustomHeader, customHeaderComponent } = useFilterAndSort({ setBackendQueryParams, Refresh, otherApp: false });
31
+ return /* @__PURE__ */ jsx(
39
32
  ContainerWrapperStyled,
40
33
  {
41
34
  ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: `m4ldatagrid-${dataTestId}` } : {},
42
35
  ...getPropDataTestId(OBJECT_LOGS_KEY_COMPONENT, ObjectLogsSlots.root, dataTestId),
43
- children: [
44
- /* @__PURE__ */ jsx(ActionsWrapperStyled, { children: /* @__PURE__ */ jsx(
45
- DynamicFilter,
46
- {
47
- withAllField: true,
48
- onChangeFilters: onChangeFilter,
49
- automatic: false,
50
- fields: [
51
- {
52
- name: "user_logs.created_at",
53
- dictionaryId: DICTIONARY.LABEL_CREATED_AT,
54
- type: "datetime",
55
- multiple: false,
56
- presence: "fixed",
57
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/email.svg`,
58
- defaultOperand1: startOfMonth(/* @__PURE__ */ new Date()),
59
- defaultOperand2: endOfDay(/* @__PURE__ */ new Date())
60
- },
61
- {
62
- name: "users.email",
63
- dictionaryId: DICTIONARY.LABEL_USER,
64
- type: "string",
65
- multiple: true,
66
- presence: "optional",
67
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/email.svg`
68
- },
69
- {
70
- name: "user_logs.log_preview",
71
- dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
72
- type: "string",
73
- multiple: true,
74
- presence: "optional",
75
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/log_preview.svg`
76
- },
77
- {
78
- name: "user_logs.log_detail",
79
- dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
80
- type: "string",
81
- multiple: true,
82
- presence: "optional",
83
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/log_detail.svg`
84
- }
85
- ],
86
- initialAppliedFilters: []
87
- }
88
- ) }),
89
- /* @__PURE__ */ jsx(
90
- GridWrapperStyled,
91
- {
92
- children: /* @__PURE__ */ jsx(
93
- DataGrid,
94
- {
95
- id: "users_logs_list",
96
- dataTestId,
97
- columns,
98
- rows,
99
- rowKeyGetter: (row) => row.id,
100
- withActions: true,
101
- actionsProps: {
102
- withPager: true,
103
- withLocalFilters: true,
104
- pagerOptions: {
105
- records: rows.length,
106
- totalRecords: pagerState.totalRecords,
107
- rowsPerPageOptions: [1, 2, 3, 4, 5, 10, 25],
108
- page: pagerState.page,
109
- rowsPerPage: pagerState.rowsPerPage,
110
- onPageChange,
111
- onRowsPerPageChange
112
- }
36
+ role: "grid",
37
+ "aria-label": "object-logs",
38
+ children: /* @__PURE__ */ jsx(
39
+ GridWrapperStyled,
40
+ {
41
+ children: /* @__PURE__ */ jsx(
42
+ DataGrid,
43
+ {
44
+ id: "users_logs_list",
45
+ dataTestId,
46
+ columns,
47
+ rows,
48
+ rowKeyGetter: (row) => row.id,
49
+ visibleCustomHeader,
50
+ customHeader: customHeaderComponent,
51
+ withActions: true,
52
+ actionsProps: {
53
+ leftActions,
54
+ withPager: true,
55
+ withLocalFilters: true,
56
+ pagerOptions: {
57
+ records: rows.length,
58
+ totalRecords: pagerState.totalRecords,
59
+ rowsPerPageOptions: [1, 2, 3, 4, 5, 10, 25],
60
+ page: pagerState.page,
61
+ rowsPerPage: pagerState.rowsPerPage,
62
+ onPageChange,
63
+ onRowsPerPageChange
113
64
  }
114
- },
115
- "users_list_logs"
116
- )
117
- }
118
- )
119
- ]
65
+ }
66
+ },
67
+ "users_list_logs"
68
+ )
69
+ }
70
+ )
120
71
  }
121
72
  );
122
73
  }