@m4l/components 9.2.54-beta.1 → 9.2.54

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 (139) hide show
  1. package/.storybook/utils/getStylesColorsByMode.d.ts +4 -4
  2. package/components/Chip/ChipStyles.js +1 -1
  3. package/components/DataGrid/constants.js +2 -2
  4. package/components/DataGrid/contexts/DataGridContext/index.js +1 -1
  5. package/components/DataGrid/contexts/FilterContext/index.js +1 -1
  6. package/components/DataGrid/dictionary.js +0 -3
  7. package/components/DataGrid/slots/DataGridEnum.js +2 -2
  8. package/components/DataGrid/slots/DataGridSlot.js +1 -1
  9. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -0
  10. package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
  11. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -1
  12. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +2 -2
  13. package/components/DragResizeWindowRND/DragResizeWindowRND.js +0 -1
  14. package/components/DynamicFilter/dictionary.js +0 -12
  15. package/components/DynamicFilter/store/DynamicFilterContext.js +1 -1
  16. package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +1 -1
  17. package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
  18. package/components/DynamicSort/dictionary.js +0 -5
  19. package/components/DynamicSort/slots/DynamicSortSlots.js +1 -1
  20. package/components/DynamicSort/store/DynamicSortContext.js +1 -1
  21. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +1 -1
  22. package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
  23. package/components/GridLayout/GridLayout.js +1 -1
  24. package/components/GridLayout/styles.js +1 -1
  25. package/components/GridLayout/subcomponents/GridItem/index.js +1 -1
  26. package/components/GridLayout/subcomponents/Responsive/helper.js +1 -1
  27. package/components/GridLayout/subcomponents/Responsive/index.js +1 -1
  28. package/components/GridLayout/subcomponents/Responsive/responsiveUtils.js +3 -3
  29. package/components/GridLayout/subcomponents/withSizeProvider/index.js +1 -1
  30. package/components/Icon/Icon.js +1 -1
  31. package/components/Icon/constants.js +2 -2
  32. package/components/Icon/slots/IconSlots.js +1 -1
  33. package/components/Image/Image.js +1 -1
  34. package/components/Image/constant.js +2 -2
  35. package/components/Image/slots/ImageSlots.js +1 -1
  36. package/components/Image/subcomponents/IntersectComponent/index.js +1 -1
  37. package/components/LanguagePopover/LanguagePopover.js +1 -1
  38. package/components/LoadingError/LoadingError.js +1 -1
  39. package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
  40. package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.js +1 -1
  41. package/components/NoItemSelected/NoItemSelected.js +1 -1
  42. package/components/NumberInput/hooks/useNumberInput/NumberInputReducer.js +1 -1
  43. package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
  44. package/components/ObjectLogs/dictionary.js +0 -3
  45. package/components/ObjectLogs/subcomponents/ObjectLogsByM4L/ObjectLogsByM4L.js +1 -1
  46. package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +1 -1
  47. package/components/Pager/Pager.styles.js +0 -8
  48. package/components/Pager/dicctionary.js +0 -5
  49. package/components/PrintingSystem/subcomponents/ChartNode/index.js +1 -1
  50. package/components/PropertyValue/PropertyValue.js +2 -2
  51. package/components/ScrollBar/ScrollBar.js +1 -1
  52. package/components/SideBar/slots/SideBarEnum.js +4 -4
  53. package/components/SideBar/slots/SideBarSlots.js +1 -1
  54. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +1 -1
  55. package/components/ToastContainer/ToastContainer.js +1 -1
  56. package/components/ToastContainer/ToastContainer.styles.js +2 -8
  57. package/components/WindowBase/WindowBase.js +2 -0
  58. package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +2 -1
  59. package/components/WindowBase/index.d.ts +1 -1
  60. package/components/WindowBase/slots/WindowBaseSlots.js +1 -1
  61. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.d.ts +0 -26
  62. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +29 -38
  63. package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
  64. package/components/WindowBase/subcomponents/Header/useButtonActions.d.ts +5 -0
  65. package/components/WindowBase/subcomponents/Header/useButtonActions.js +36 -0
  66. package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts +1 -1
  67. package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.js +1 -1
  68. package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts +4 -0
  69. package/components/WindowBase/types.d.ts +32 -37
  70. package/components/animate/variants/bounce.js +1 -1
  71. package/components/animate/variants/fade.js +1 -1
  72. package/components/animate/variants/transition.js +2 -2
  73. package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
  74. package/components/areas/components/AreasViewer/AreasViewer.js +1 -1
  75. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +1 -1
  76. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +2 -0
  77. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.d.ts +1 -0
  78. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +8 -3
  79. package/components/areas/contexts/AreasContext/helpers/helper.js +14 -14
  80. package/components/areas/contexts/AreasContext/store.js +7 -6
  81. package/components/areas/contexts/AreasContext/types.d.ts +1 -1
  82. package/components/areas/icons.js +0 -8
  83. package/components/areas/types.d.ts +4 -0
  84. package/components/commercial/HamburgerMenu/classes/index.js +1 -1
  85. package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -1
  86. package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.js +3 -3
  87. package/components/formatters/PeriodFormatter/PeriodFormatter.js +1 -1
  88. package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.js +2 -2
  89. package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +5 -0
  90. package/components/hook-form/RHFAutocompleteAsync/tests/common.d.ts +4 -2
  91. package/components/hook-form/RHFAutocompleteAsync/types.js +0 -6
  92. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.js +1 -1
  93. package/components/hook-form/RHFPeriod/RHFPeriod.js +1 -1
  94. package/components/hook-form/RHFTextField/RHFTextField.styles.js +1 -3
  95. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.js +1 -1
  96. package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +1 -1
  97. package/components/hook-form/RHFormContext/classes/index.js +1 -1
  98. package/components/hook-form/RHFormContext/index.js +1 -1
  99. package/components/mui_extended/Accordion/Accordion.js +1 -1
  100. package/components/mui_extended/Accordion/slots/AccordionSlots.js +2 -2
  101. package/components/mui_extended/Autocomplete/Autocomplete.js +2 -11
  102. package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +11 -1
  103. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.js +4 -4
  104. package/components/mui_extended/CheckBox/CheckBox.js +1 -1
  105. package/components/mui_extended/CheckBox/slots/CheckBoxSlots.js +2 -2
  106. package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.js +1 -1
  107. package/components/mui_extended/IconButton/slots/IconButtonSlots.js +1 -1
  108. package/components/mui_extended/ImageButton/utils/Clases/index.js +1 -1
  109. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
  110. package/components/mui_extended/NavLink/NavLink.js +1 -1
  111. package/components/mui_extended/NavLink/constants.js +2 -2
  112. package/components/mui_extended/NavLink/slots/NavLinkSlots.js +1 -1
  113. package/components/mui_extended/Popover/Popover.js +1 -1
  114. package/components/mui_extended/Popover/Popover.styles.js +1 -5
  115. package/components/mui_extended/Popover/constants.js +2 -2
  116. package/components/mui_extended/Select/Select.js +1 -1
  117. package/components/mui_extended/Select/Select.styles.js +1 -1
  118. package/components/mui_extended/Select/constants.js +1 -1
  119. package/components/mui_extended/Select/slots/SelectSlots.js +1 -1
  120. package/components/mui_extended/Tab/Tab.js +1 -1
  121. package/components/mui_extended/TextField/constants.js +1 -1
  122. package/components/mui_extended/Tooltip/Tooltip.js +2 -2
  123. package/components/mui_extended/Tooltip/slots/TooltipSlots.js +2 -2
  124. package/components/mui_extended/Typography/Typography.js +1 -1
  125. package/components/mui_extended/Typography/constants.js +3 -3
  126. package/components/mui_extended/Typography/slots/typographySlots.js +1 -1
  127. package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +2 -1
  128. package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +6 -2
  129. package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.js +1 -3
  130. package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +1 -0
  131. package/components/popups/components/PopupsProvider/hooks/usePopups.js +5 -2
  132. package/components/popups/components/PopupsViewer/icons.js +0 -1
  133. package/hooks/useDataGridPersistence/constants.js +2 -2
  134. package/hooks/useDataGridPersistence/useDataGridPersistence.js +1 -1
  135. package/hooks/useSvgColor/constants.js +2 -2
  136. package/hooks/useSvgColor/helpers.js +1 -1
  137. package/hooks/useSvgColor/useSvgColor.js +1 -1
  138. package/index.js +19 -19
  139. package/package.json +3 -3
@@ -1,13 +1,8 @@
1
1
  const PAGER_DICTIONARY = {
2
2
  rows_per_page: "pager.rows_per_page",
3
- first: "pager.first",
4
- previous: "pager.previous",
5
- before: "pager.before",
6
- last: "pager.last",
7
3
  of: "pager.of",
8
4
  page: "pager.page",
9
5
  no_records: "pager.no_records",
10
- total_rows: "pager.total_rows",
11
6
  rows: "pager.rows"
12
7
  };
13
8
  function getPagerComponentsDictionary() {
@@ -3,7 +3,7 @@ import { c as classes } from "../../classes/index.js";
3
3
  import clsx from "clsx";
4
4
  import { createRef, useEffect } from "react";
5
5
  import { Chart, registerables } from "chart.js";
6
- import { ScatterWithErrorBarsController, LineWithErrorBarsChart, PointWithErrorBar } from "chartjs-chart-error-bars";
6
+ import { LineWithErrorBarsChart, ScatterWithErrorBarsController, PointWithErrorBar } from "chartjs-chart-error-bars";
7
7
  import { useBase, getPropertyByString, evaluateWithContext } from "@m4l/core";
8
8
  import { C as ChartNodeRootStyled } from "../../slots/PrintingSystemSlots.js";
9
9
  Chart.register(
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import React, { useId } from "react";
3
3
  import clsx from "clsx";
4
4
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.js";
5
- import { P as PROPERTY_VALUE_KEY_COMPONENT, T as TEST_PROPS_DATA, C as COMPONENT_PREFIX } from "./constants.js";
6
- import { g as getPropDataTestId, a as getNameDataTestId } from "../../test/getNameDataTestId.js";
5
+ import { T as TEST_PROPS_DATA, C as COMPONENT_PREFIX, P as PROPERTY_VALUE_KEY_COMPONENT } from "./constants.js";
6
+ import { a as getNameDataTestId, g as getPropDataTestId } from "../../test/getNameDataTestId.js";
7
7
  import { P as PropertyValueRootStyled, N as NameStyled, V as ValueStyled } from "./slots/PropertyValueSlots.js";
8
8
  import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
9
9
  import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
@@ -4,7 +4,7 @@ import clsx from "clsx";
4
4
  import { Box } from "@mui/material";
5
5
  import { useIsMobile } from "@m4l/graphics";
6
6
  import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
7
- import { c as classScrollRoot, S as SCROLL_KEY_COMPONENT } from "./constants.js";
7
+ import { S as SCROLL_KEY_COMPONENT, c as classScrollRoot } from "./constants.js";
8
8
  import { R as RootScrollBar, S as SimpleBarStyled } from "./slots/ScrollBarSlots.js";
9
9
  import { S as ScrollBarSlots } from "./slots/ScrollBarEnum.js";
10
10
  function ScrollBar(props) {
@@ -37,11 +37,11 @@ var ContainerMenuItemsMainSlots = /* @__PURE__ */ ((ContainerMenuItemsMainSlots2
37
37
  return ContainerMenuItemsMainSlots2;
38
38
  })(ContainerMenuItemsMainSlots || {});
39
39
  export {
40
- ContentGroupsSlots as C,
40
+ ContentComponentSlots as C,
41
41
  HeaderSidebarSlots as H,
42
42
  SideBarDesktopSlots as S,
43
- SideBarFooterSlots as a,
44
- SideBarMobileSlots as b,
45
- ContentComponentSlots as c,
43
+ SideBarMobileSlots as a,
44
+ SideBarFooterSlots as b,
45
+ ContentGroupsSlots as c,
46
46
  ContainerMenuItemsMainSlots as d
47
47
  };
@@ -1,5 +1,5 @@
1
1
  import { styled } from "@mui/material/styles";
2
- import { S as SideBarDesktopSlots, C as ContentGroupsSlots, H as HeaderSidebarSlots, a as SideBarFooterSlots, b as SideBarMobileSlots, c as ContentComponentSlots, d as ContainerMenuItemsMainSlots } from "./SideBarEnum.js";
2
+ import { S as SideBarDesktopSlots, a as SideBarMobileSlots, C as ContentComponentSlots, b as SideBarFooterSlots, H as HeaderSidebarSlots, c as ContentGroupsSlots, d as ContainerMenuItemsMainSlots } from "./SideBarEnum.js";
3
3
  import { S as SIDEBAR_KEY_COMPONENT } from "../constants.js";
4
4
  import { s as sideBarStyles } from "../styles.js";
5
5
  const ContainerDesktopRootStyled = styled("section", {
@@ -1,5 +1,5 @@
1
1
  import { a as getHeightSizeStyles } from "../../../../../../utils/getSizeStyles/getSizeStyles.js";
2
- import { b as ITEM_IN_TREE_ACTIVE, I as ITEM_ACTIVE } from "../../../../constants.js";
2
+ import { I as ITEM_ACTIVE, b as ITEM_IN_TREE_ACTIVE } from "../../../../constants.js";
3
3
  const containerMenuItemsMainStyles = {
4
4
  /**
5
5
  * Style aplicado al contenedor de los items del menú
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { ToastContainer as ToastContainer$1 } from "react-toastify";
3
- import { T as TOAST_KEY_COMPONENT, D as DEFAULT_CLOSE_TIME } from "./constants.js";
3
+ import { D as DEFAULT_CLOSE_TIME, T as TOAST_KEY_COMPONENT } from "./constants.js";
4
4
  import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
5
5
  import { ModuleSkeletonProvider } from "@m4l/core";
6
6
  import "react-toastify/dist/ReactToastify.min.css";
@@ -1,4 +1,3 @@
1
- import { a as getHeightSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
2
1
  const toastStyles = {
3
2
  /** Root del componente ToastContainer */
4
3
  root: ({ theme, ownerState }) => ({
@@ -139,16 +138,11 @@ const toastStyles = {
139
138
  gap: theme.vars.size.baseSpacings.sp1
140
139
  }),
141
140
  /** 🗣️ Header del ToastContainer 🗣️ */
142
- messageHeader: ({ theme, ownerState }) => ({
141
+ messageHeader: ({ theme }) => ({
143
142
  width: "100%",
144
143
  display: "flex",
145
144
  gap: theme.vars.size.baseSpacings.sp1,
146
- alignItems: "center",
147
- ...getHeightSizeStyles(
148
- theme.generalSettings.isMobile,
149
- ownerState.size || "medium",
150
- "container"
151
- )
145
+ alignItems: "center"
152
146
  }),
153
147
  /** 🔠 Titulo del Header 🔠 */
154
148
  messageTitle: () => ({
@@ -17,6 +17,7 @@ const WindowBase = (props) => {
17
17
  selected = false,
18
18
  variant = "outlined",
19
19
  version,
20
+ buildTime,
20
21
  dataTestId,
21
22
  onClose,
22
23
  className,
@@ -46,6 +47,7 @@ const WindowBase = (props) => {
46
47
  {
47
48
  ...getPropDataTestId(WINDOW_BASE_KEY_COMPONENT, WindowBaseSlots.headerContentWindowBase, dataTestId),
48
49
  version,
50
+ buildTime,
49
51
  size,
50
52
  selected,
51
53
  onClose,
@@ -27,8 +27,9 @@ export interface WindowToolsMF {
27
27
  * Método para establecer las acciones de ventana para el área actual.
28
28
  * @param newActions Las nuevas acciones de ventana que se desean establecer.
29
29
  * @param version (Opcional) La versión de las acciones de ventana.
30
+ * @param buildTime (Opcional) El buildTime del Microfrontend.
30
31
  */
31
- setActions: (newActions: ModuleAction[], version?: string) => void;
32
+ setActions: (newActions: ModuleAction[], version?: string, buildTime?: string) => void;
32
33
  /**
33
34
  * Método para establecer una cookie específica.
34
35
  * @param id El ID de la cookie que se desea establecer.
@@ -4,4 +4,4 @@ export * from './hooks/useDynamicMFParameters';
4
4
  export * from './contexts/WindowToolsMFContext';
5
5
  export * from './contexts/DynamicMFParmsContext';
6
6
  export type { WindowToolsMFContextProps } from './contexts/WindowToolsMFContext/types';
7
- export type { ModuleAction } from './types';
7
+ export type { ModuleAction, GroupActionMenuItem, ModuleActionGroup } from './types';
@@ -2,9 +2,9 @@ import { styled } from "@mui/material/styles";
2
2
  import { W as WINDOW_BASE_KEY_COMPONENT } from "../constants.js";
3
3
  import { W as WindowBaseSlots } from "./WindowBaseEnum.js";
4
4
  import { w as windowBaseStyles } from "../WindowBase.styles.js";
5
+ import { L as LinearProgressIndeterminate } from "../../LinearProgressIndeterminate/LinearProgressIndeterminate.js";
5
6
  import { T as Typography } from "../../mui_extended/Typography/Typography.js";
6
7
  import { M as MenuActions } from "../../MenuActions/MenuActions.js";
7
- import { L as LinearProgressIndeterminate } from "../../LinearProgressIndeterminate/LinearProgressIndeterminate.js";
8
8
  import { I as Icon } from "../../Icon/Icon.js";
9
9
  const WindowBaseStyled = styled("div", {
10
10
  name: WINDOW_BASE_KEY_COMPONENT,
@@ -11,31 +11,5 @@ import { WindowBaseOwnerState } from '../../types';
11
11
  * - Display the header for a `WindowBase` component.
12
12
  * - Provides flexibility to add a title, subtitle, icon, version label, and menu actions.
13
13
  * - Visually supports a selected state (`selected`) for a distinct appearance when the window is active.
14
- *
15
- * ### Props:
16
- * - `title` (string): The title to be displayed in the header.
17
- * - `subTitle` (string, optional): The subtitle displayed below the title.
18
- * - `onClose` (VoidFunction, optional): Callback executed when the close button is clicked.
19
- * - `urlIcon` (string, optional): The URL for the icon to be shown in the header.
20
- * - `menuActions` (MenuAction[], optional): List of actions for the header's dropdown menu.
21
- * - `size` ('small' | 'medium' | 'large', optional): Defines the header size, default is `medium`.
22
- * - `color` ('default', optional): Base color of the header, default is `default`.
23
- * - `selected` (boolean, optional): Indicates if the window is selected. Modifies visual appearance when active.
24
- * - `version` (string, optional): Version label to be displayed in the header.
25
- *
26
- * ### Example Usage:
27
- * ```tsx
28
- * <HeaderWindowBase
29
- * title="My Window"
30
- * subTitle="Additional Details"
31
- * onClose={() => console.log('Closing window')}
32
- * iconUrl="https://example.com/icon.png"
33
- * menuActions={[
34
- * { label: 'Action 1', onClick: () => console.log('Action 1 selected') },
35
- * { label: 'Action 2', onClick: () => console.log('Action 2 selected') },
36
- * ]}
37
- * selected={true}
38
- * />
39
- * ```
40
14
  */
41
15
  export declare const HeaderWindowBase: (props: HeaderProps & WindowBaseOwnerState) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,12 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useEnvironment } from "@m4l/core";
3
3
  import { useState, useEffect, useMemo } from "react";
4
4
  import { I as ICONS } from "../../icons.js";
5
5
  import { d as dragResizeWindowRNDClasses } from "../../../DragResizeWindowRND/classes/index.js";
6
6
  import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
7
7
  import { deepEqual } from "fast-equals";
8
- import { M as MemoizedIconButton } from "../MemoizedIconButton/MemoizedIconButton.js";
8
+ import { useFormatter } from "@m4l/graphics";
9
+ import { u as useButtonActions } from "./useButtonActions.js";
9
10
  import { H as HeaderWindowComponentStyled, c as HeaderContentStyled, I as IconWindowStyled, T as TitleWindowStyled, S as SubtitleContainerStyled, P as PointStyled, d as PointIconStyled, e as SubtitleWindowStyled, f as IconsWrapperStyled, M as MenuActionsWindowsStyled } from "../../slots/WindowBaseSlots.js";
10
11
  const HeaderWindowBase = (props) => {
11
12
  const {
@@ -16,10 +17,12 @@ const HeaderWindowBase = (props) => {
16
17
  size,
17
18
  selected,
18
19
  version,
20
+ buildTime,
19
21
  variant,
20
22
  actions = []
21
23
  } = props;
22
24
  const { host_static_assets, environment_assets } = useEnvironment();
25
+ const { dateFormatter } = useFormatter();
23
26
  const [leftActions, setLeftActions] = useState(() => actions.filter((action) => action.place === "left"));
24
27
  const [rightActions, setRightActions] = useState(() => actions.filter((action) => action.place === "right"));
25
28
  const [insideActions, setInsideActions] = useState(() => actions.filter((action) => action.place === "inside"));
@@ -52,58 +55,46 @@ const HeaderWindowBase = (props) => {
52
55
  }, [actions]);
53
56
  const menuActions = useMemo(() => {
54
57
  const memoizedActions = [
55
- ...insideActions.map((action) => ({
56
- type: "menuItem",
57
- startIcon: action.iconUrl,
58
- label: action.label,
59
- onClick: action.onClick,
60
- disabled: action.disabled
61
- }))
58
+ ...insideActions.map((action) => {
59
+ if (action.type === "groupActions") {
60
+ return action.actions.map((groupAction) => ({
61
+ type: "menuItem",
62
+ startIcon: groupAction.iconUrl,
63
+ label: groupAction.label,
64
+ onClick: groupAction.onClick,
65
+ disabled: groupAction.disabled,
66
+ checkable: true,
67
+ checked: groupAction.key === action.selectedActionKey
68
+ }));
69
+ }
70
+ return {
71
+ type: "menuItem",
72
+ startIcon: action.iconUrl,
73
+ label: action.label,
74
+ onClick: action.onClick,
75
+ disabled: action.disabled
76
+ };
77
+ }).flat()
62
78
  ];
63
79
  if (version) {
64
80
  memoizedActions.push({
65
81
  type: "menuItem",
66
82
  startIcon: `${host_static_assets}/${environment_assets}/frontend/components/menu_actions/assets/icons/${ICONS.VERSION}`,
67
- label: version,
83
+ label: buildTime ? `${version} - ${dateFormatter.formatDate(new Date(buildTime), dateFormatter.datetimeFormat)}` : version,
68
84
  onClick: () => {
69
85
  },
70
86
  disabled: true
71
87
  });
72
88
  }
73
89
  return memoizedActions;
74
- }, [insideActions, version, host_static_assets, environment_assets]);
90
+ }, [insideActions, version, host_static_assets, environment_assets, buildTime, dateFormatter]);
75
91
  const ownerState = {
76
92
  selected,
77
93
  variant,
78
94
  size
79
95
  };
80
- const IconButtonLeftActions = useMemo(() => /* @__PURE__ */ jsx(Fragment, { children: leftActions.map((action) => /* @__PURE__ */ jsx(
81
- MemoizedIconButton,
82
- {
83
- iconUrl: action.iconUrl,
84
- label: action.label,
85
- disabled: action.disabled,
86
- onClick: action.onClick || (() => {
87
- })
88
- },
89
- action.key
90
- )) }), [leftActions]);
91
- const IconButtonRightActions = useMemo(() => {
92
- if (rightActions.length === 0) {
93
- return null;
94
- }
95
- return /* @__PURE__ */ jsx(Fragment, { children: rightActions.map((action) => /* @__PURE__ */ jsx(
96
- MemoizedIconButton,
97
- {
98
- iconUrl: action.iconUrl,
99
- label: action.label,
100
- disabled: action.disabled,
101
- onClick: action.onClick || (() => {
102
- })
103
- },
104
- action.key
105
- )) });
106
- }, [rightActions]);
96
+ const IconButtonLeftActions = useButtonActions(leftActions);
97
+ const IconButtonRightActions = useButtonActions(rightActions);
107
98
  return /* @__PURE__ */ jsxs(HeaderWindowComponentStyled, { className: dragResizeWindowRNDClasses.draggableHandle, ownerState, children: [
108
99
  /* @__PURE__ */ jsxs(HeaderContentStyled, { ownerState, children: [
109
100
  iconUrl && /* @__PURE__ */ jsx(IconWindowStyled, { size, ownerState, src: iconUrl, "aria-label": "main icon" }),
@@ -32,7 +32,7 @@ import { WindowBaseAction, WindowBaseProps } from '../../types';
32
32
  * - `selected` modifies the visual appearance to indicate the selected state.
33
33
  * @see WindowBaseProps - General properties for the window base.
34
34
  */
35
- export type HeaderProps = Pick<WindowBaseProps, 'title' | 'subTitle' | 'iconUrl' | 'onClose' | 'version' | 'selected' | 'variant'> & {
35
+ export type HeaderProps = Pick<WindowBaseProps, 'title' | 'subTitle' | 'iconUrl' | 'onClose' | 'version' | 'selected' | 'variant' | 'buildTime'> & {
36
36
  actions?: WindowBaseAction[];
37
37
  };
38
38
  /**
@@ -0,0 +1,5 @@
1
+ import { WindowBaseAction } from '../../types';
2
+ /**
3
+ * `useButtonActions` Devuelve un componente de iconos para los botones de la cabecera, manejando los grupos de iconos
4
+ */
5
+ export declare const useButtonActions: (actions: WindowBaseAction[]) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { M as MemoizedIconButton } from "../MemoizedIconButton/MemoizedIconButton.js";
4
+ const useButtonActions = (actions) => {
5
+ const MemoActions = useMemo(() => /* @__PURE__ */ jsx(Fragment, { children: actions.map((action) => {
6
+ if (action.type === "groupActions") {
7
+ return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "row", gap: "8px" }, children: action.actions.map((groupAction) => /* @__PURE__ */ jsx(
8
+ MemoizedIconButton,
9
+ {
10
+ iconUrl: groupAction.iconUrl,
11
+ label: groupAction.label,
12
+ disabled: groupAction.disabled,
13
+ selected: groupAction.key === action.selectedActionKey,
14
+ onClick: groupAction.onClick || (() => {
15
+ })
16
+ },
17
+ groupAction.key
18
+ )) }, action.key);
19
+ }
20
+ return /* @__PURE__ */ jsx(
21
+ MemoizedIconButton,
22
+ {
23
+ iconUrl: action.iconUrl,
24
+ label: action.label,
25
+ disabled: action.disabled,
26
+ onClick: action.onClick || (() => {
27
+ })
28
+ },
29
+ action.key
30
+ );
31
+ }) }), [actions]);
32
+ return MemoActions;
33
+ };
34
+ export {
35
+ useButtonActions as u
36
+ };
@@ -6,5 +6,5 @@ import { MemoizedIconButtonProps } from './types';
6
6
  * This component renders an `IconButton` with an icon and tooltip.
7
7
  * It is memoized to avoid unnecessary re-renders when the props do not change.
8
8
  */
9
- declare const MemoizedIconButton: React.MemoExoticComponent<({ iconUrl, label, disabled, onClick }: MemoizedIconButtonProps) => import("react/jsx-runtime").JSX.Element>;
9
+ declare const MemoizedIconButton: React.MemoExoticComponent<({ iconUrl, label, disabled, onClick, selected }: MemoizedIconButtonProps) => import("react/jsx-runtime").JSX.Element>;
10
10
  export default MemoizedIconButton;
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
4
4
  const MemoizedIconButton = React.memo(
5
- ({ iconUrl, label, disabled, onClick }) => /* @__PURE__ */ jsx(IconButton, { role: "button", "aria-label": label, tooltip: label, icon: iconUrl, disabled, onClick })
5
+ ({ iconUrl, label, disabled, onClick, selected }) => /* @__PURE__ */ jsx(IconButton, { role: "button", "aria-label": label, tooltip: label, icon: iconUrl, disabled, onClick, selected })
6
6
  );
7
7
  export {
8
8
  MemoizedIconButton as M
@@ -18,4 +18,8 @@ export interface MemoizedIconButtonProps {
18
18
  * Callback function executed when the button is clicked.
19
19
  */
20
20
  onClick: () => void;
21
+ /**
22
+ * Whether the button is selected.
23
+ */
24
+ selected?: boolean;
21
25
  }
@@ -26,7 +26,8 @@ export type WinType = 'microfrontend' | 'component';
26
26
  * normal: Se muestra inside del menu.
27
27
  */
28
28
  export type WindowActionType = 'main' | 'allways' | 'normal';
29
- export interface ModuleAction extends Pick<MenuItemAction, 'label' | 'selected' | 'color' | 'disabled' | 'checkable' | 'checked' | 'onClick'> {
29
+ export interface BaseModuleAction {
30
+ type?: 'menuItem' | 'groupActions';
30
31
  /**
31
32
  * Tipo de visibilidad de la acción de ventana.
32
33
  *
@@ -40,55 +41,44 @@ export interface ModuleAction extends Pick<MenuItemAction, 'label' | 'selected'
40
41
  * Etiqueta opcional para la acción de ventana.
41
42
  */
42
43
  tag?: any;
44
+ }
45
+ export type ModuleMenuItemAction = Pick<MenuItemAction, 'label' | 'selected' | 'color' | 'disabled' | 'checkable' | 'checked' | 'onClick'> & {
46
+ /**
47
+ * Icono opcional para la acción de ventana.
48
+ */
49
+ iconUrl: string;
43
50
  /**
44
51
  * Clase CSS opcional para la acción de ventana.
45
52
  */
46
53
  className?: string;
54
+ };
55
+ export interface ModuleActionMenuItem extends BaseModuleAction, ModuleMenuItemAction {
56
+ type?: 'menuItem';
57
+ }
58
+ export type GroupActionMenuItem<T extends string = string> = ModuleMenuItemAction & {
59
+ key: T;
60
+ };
61
+ export interface ModuleActionGroup<T extends string = string> extends BaseModuleAction {
62
+ type: 'groupActions';
47
63
  /**
48
- * Icono opcional para la acción de ventana.
64
+ * Clave de la acción seleccionada.
49
65
  */
50
- iconUrl: string;
66
+ selectedActionKey: T;
67
+ /**
68
+ * Lista de acciones del grupo.
69
+ */
70
+ actions: Array<GroupActionMenuItem<T>>;
51
71
  }
72
+ export type ModuleAction = ModuleActionMenuItem | ModuleActionGroup;
73
+ export type WindowBaseModuleAction = Omit<ModuleActionMenuItem, 'visibility'> | Omit<ModuleActionGroup, 'visibility'>;
52
74
  /**
53
75
  * Type representing a single action in the `WindowBase` component.
54
76
  */
55
- export interface WindowBaseAction extends Pick<ModuleAction, 'label' | 'selected' | 'color' | 'disabled' | 'checkable' | 'checked' | 'onClick' | 'key' | 'iconUrl'> {
77
+ export type WindowBaseAction = WindowBaseModuleAction & {
56
78
  place: 'left' | 'right' | 'inside';
57
- }
79
+ };
58
80
  /**
59
81
  * Interface representing the main properties of the `WindowBase` component.
60
- *
61
- * Defines the structure and functionality of the component, including its title, subtitle, content,
62
- * icon URL, menu actions, visual configurations, and other related attributes.
63
- * title (required) - The main title of the window.
64
- * subTitle (optional) - Subtitle for the window.
65
- * children (required) - Content to be rendered inside the window.
66
- * urlIcon (optional) - URL for the icon displayed in the header.
67
- * variant (optional) - Visual style of the window, with values `'outlined'` or `'text'`.
68
- * size (optional) - Size of the window: `'small'` or `'medium'`.
69
- * color (optional) - Theme color of the window, restricted to `'default'`.
70
- * selected (optional) - Indicates if the window is selected.
71
- * version (optional) - Component version (e.g., `1.0.0`).
72
- * dataTestId (optional) - Identifier for automated testing.
73
- * onClose (optional) - Function executed when the window is closed.
74
- *
75
- * ### Example:
76
- * ```typescript
77
- * const windowProps: WindowBaseProps = {
78
- * title: 'Main Window',
79
- * subTitle: 'Details',
80
- * children: <div>Window Content</div>,
81
- * urlIcon: 'https://example.com/icon.png',
82
- * variant: 'outlined',
83
- * menuActions: [{ label: 'Action 1', onClick: () => console.log('Action 1') }],
84
- * size: 'medium',
85
- * color: 'default',
86
- * selected: true,
87
- * version: '1.0.0',
88
- * dataTestId: 'main-window',
89
- * onClose: () => console.log('Cancel Clicked'),
90
- * };
91
- * ```
92
82
  */
93
83
  export interface WindowBaseProps {
94
84
  /**
@@ -135,6 +125,11 @@ export interface WindowBaseProps {
135
125
  * Useful for displaying version information (e.g., `1.0.0`) in the header or footer.
136
126
  */
137
127
  version?: string;
128
+ /**
129
+ * The build time for the window. si se proporcionana mostrá la versión y la fecha de compilación.
130
+ *
131
+ */
132
+ buildTime?: string;
138
133
  /**
139
134
  * A unique identifier for automated testing.
140
135
  * Provides a `data-testid` attribute for querying this component in tests.
@@ -1,4 +1,4 @@
1
- import { v as varTranEnter, a as varTranExit } from "./transition.js";
1
+ import { v as varTranExit, a as varTranEnter } from "./transition.js";
2
2
  const varBounce = (props) => {
3
3
  const durationIn = props?.durationIn;
4
4
  const durationOut = props?.durationOut;
@@ -1,4 +1,4 @@
1
- import { v as varTranEnter, a as varTranExit } from "./transition.js";
1
+ import { v as varTranExit, a as varTranEnter } from "./transition.js";
2
2
  const varFade = (props) => {
3
3
  const distance = props?.distance || 120;
4
4
  const durationIn = props?.durationIn;
@@ -14,7 +14,7 @@ const varTranExit = (props) => {
14
14
  return { duration, ease };
15
15
  };
16
16
  export {
17
- varTranExit as a,
17
+ varTranEnter as a,
18
18
  varTranHover as b,
19
- varTranEnter as v
19
+ varTranExit as v
20
20
  };
@@ -15,9 +15,9 @@ import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoo
15
15
  import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
16
16
  import { S as ScrollBar } from "../../../ScrollBar/ScrollBar.js";
17
17
  import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
18
- import { A as AreasAdminSlots } from "./slots/AreasAdminEnum.js";
19
18
  import { T as Typography } from "../../../mui_extended/Typography/Typography.js";
20
19
  import { M as MenuActions } from "../../../MenuActions/MenuActions.js";
20
+ import { A as AreasAdminSlots } from "./slots/AreasAdminEnum.js";
21
21
  const AreasAdmin = (props) => {
22
22
  const {
23
23
  color = "primary",
@@ -4,7 +4,7 @@ import { u as useAreasStore } from "../../hooks/useAreas/index.js";
4
4
  import { A as AreaMemonizedWindowModal } from "./subcomponents/Area/subcomponents/WindowModal/WindowModal.js";
5
5
  import { shallow } from "zustand/shallow";
6
6
  import { L as LoadingError } from "../../../LoadingError/LoadingError.js";
7
- import { g as getPropDataTestId, a as getNameDataTestId } from "../../../../test/getNameDataTestId.js";
7
+ import { a as getNameDataTestId, g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
8
8
  import { A as AREAS_VIEWER_CLASS_NAME } from "../../constants.js";
9
9
  import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
10
10
  import { A as AreasViewerRootStyled } from "./slots/AreasViewerSlots.js";
@@ -4,7 +4,7 @@ import { W as Window } from "../Window/Window.js";
4
4
  import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
5
5
  import { a as areasViewerClasses } from "../../../../classes/index.js";
6
6
  import clsx from "clsx";
7
- import { R as RESPONSIVE_COLAPSED_HEIGHTS, a as RESPONSIVE_ROW_HEIGHTS, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../../../../../contexts/AreasContext/helpers/helper.js";
7
+ import { P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, R as RESPONSIVE_ROW_HEIGHTS, a as RESPONSIVE_COLAPSED_HEIGHTS } from "../../../../../../contexts/AreasContext/helpers/helper.js";
8
8
  import { M as MemonizePopupsViewer } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
9
9
  import { useState } from "react";
10
10
  import { d as dragResizeWindowRNDClasses } from "../../../../../../../DragResizeWindowRND/classes/index.js";
@@ -16,6 +16,7 @@ const Window = (props) => {
16
16
  title,
17
17
  iconUrl,
18
18
  version,
19
+ buildTime,
19
20
  moduleCount,
20
21
  selected,
21
22
  mfProps,
@@ -39,6 +40,7 @@ const Window = (props) => {
39
40
  isLoading: loading,
40
41
  onClose: () => windowTools.close(),
41
42
  version,
43
+ buildTime,
42
44
  actions: memoizedActions,
43
45
  windowId,
44
46
  selected,
@@ -16,6 +16,7 @@ export declare const useWindow: (windowId: string, areaId?: string) => {
16
16
  title: string;
17
17
  iconUrl: string;
18
18
  version: string | undefined;
19
+ buildTime: string | undefined;
19
20
  moduleCount: number | undefined;
20
21
  selected: boolean;
21
22
  mfProps: any;
@@ -5,7 +5,7 @@ import { u as useHeaderActions } from "./useHeaderActions.js";
5
5
  import { u as usePopupsStore } from "../../../../../../../../popups/components/PopupsProvider/hooks/usePopupsStore.js";
6
6
  import { c as createToaster } from "../../../../../../../../ToastContainer/helpers/toaster.js";
7
7
  const useWindow = (windowId, areaId) => {
8
- const [emergeType, moduleId, winType, title, iconUrl, version, moduleCount, selected, loading, status, dynamicMFStore] = useAreasStore((state) => {
8
+ const [emergeType, moduleId, winType, title, iconUrl, version, buildTime, moduleCount, selected, loading, status, dynamicMFStore] = useAreasStore((state) => {
9
9
  const window = state.hashWindows[windowId];
10
10
  const selected2 = areaId ? state.hashAreas[areaId]?.currentLayoutId === windowId : false;
11
11
  return [
@@ -15,6 +15,7 @@ const useWindow = (windowId, areaId) => {
15
15
  window?.title,
16
16
  window?.iconUrl,
17
17
  window?.version,
18
+ window?.buildTime,
18
19
  window?.moduleCount,
19
20
  selected2,
20
21
  window?.loading,
@@ -39,8 +40,11 @@ const useWindow = (windowId, areaId) => {
39
40
  const windowTools = useMemo(
40
41
  () => ({
41
42
  getWindowId: () => windowId,
42
- setActions: (newActions, newVersion) => {
43
- setActions(windowId, newActions, newVersion);
43
+ /**
44
+ * Actualizar las acciones de la ventana
45
+ */
46
+ setActions: (newActions, newVersion, newBuildTime) => {
47
+ setActions(windowId, newActions, newVersion, newBuildTime);
44
48
  },
45
49
  getCookie: (id) => getCookie(windowId, id),
46
50
  getCookies: (type) => getCookies(windowId, type),
@@ -82,6 +86,7 @@ const useWindow = (windowId, areaId) => {
82
86
  title,
83
87
  iconUrl,
84
88
  version,
89
+ buildTime,
85
90
  moduleCount,
86
91
  selected,
87
92
  mfProps,