@m4l/components 9.3.25 → 9.3.26

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 (51) hide show
  1. package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +17 -8
  2. package/components/CommonActions/components/ActionFormCancel/types.d.ts +9 -0
  3. package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +1 -0
  4. package/components/DataGrid/index.d.ts +1 -1
  5. package/components/DataGrid/types.d.ts +2 -0
  6. package/components/Label/Label.js +1 -1
  7. package/components/PaperForm/PaperForm.js +1 -1
  8. package/components/PaperForm/components/Header.js +9 -7
  9. package/components/PaperForm/styles.js +9 -4
  10. package/components/PaperForm/types.d.ts +3 -2
  11. package/components/Stepper/Stepper.styles.js +2 -0
  12. package/components/Stepper/dictionary.js +0 -1
  13. package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +13 -0
  14. package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +111 -0
  15. package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.d.ts +8 -0
  16. package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.js +79 -0
  17. package/components/Stepper/subcomponents/StepArea/index.js +7 -115
  18. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -2
  19. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +3 -53
  20. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +3 -2
  21. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +3 -2
  22. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +24 -5
  23. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.d.ts +8 -0
  24. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.js +93 -0
  25. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +2 -51
  26. package/components/Stepper/types.d.ts +4 -0
  27. package/components/ToastContainer/ToastContainer.js +1 -0
  28. package/components/ToastContainer/constants.d.ts +1 -1
  29. package/components/ToastContainer/constants.js +1 -1
  30. package/components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js +47 -3
  31. package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +1 -1
  32. package/components/WindowBase/subcomponents/Component/index.d.ts +12 -1
  33. package/components/WindowBase/subcomponents/Component/index.js +56 -2
  34. package/components/WindowBase/subcomponents/Component/types.d.ts +1 -0
  35. package/components/WindowBase/types.d.ts +1 -1
  36. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +1 -0
  37. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +1 -1
  38. package/components/areas/contexts/AreasContext/store.js +7 -3
  39. package/components/areas/contexts/AreasContext/types.d.ts +1 -1
  40. package/components/hook-form/RHFormContext/index.d.ts +1 -1
  41. package/components/hook-form/RHFormContext/styles.js +2 -1
  42. package/components/mui_extended/CircularProgress/types.d.ts +1 -1
  43. package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +5 -1
  44. package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +1 -1
  45. package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +2 -4
  46. package/components/popups/components/PopupsProvider/hooks/usePopups.js +19 -7
  47. package/components/popups/components/PopupsViewer/PopupsViewer.js +1 -1
  48. package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +1 -1
  49. package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +32 -21
  50. package/index.js +62 -60
  51. package/package.json +1 -1
@@ -7,15 +7,16 @@ import { useModuleDictionary, useEnvironment } from "@m4l/core";
7
7
  import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
8
8
  import { B as Button } from "../../../../mui_extended/Button/Button.js";
9
9
  function StepperNextButton(props) {
10
- const { label, ...rest } = props;
10
+ const { label, forceIsMobile, ...rest } = props;
11
11
  const { nextStepAction } = useStepperActions();
12
12
  const isMobile = useIsMobile();
13
+ const isMobileForce = forceIsMobile !== void 0 ? forceIsMobile : isMobile;
13
14
  const { getLabel } = useModuleDictionary();
14
15
  const { host_static_assets, environment_assets } = useEnvironment();
15
16
  const handleNext = async () => {
16
17
  await nextStepAction();
17
18
  };
18
- return isMobile ? /* @__PURE__ */ jsx(
19
+ return isMobileForce ? /* @__PURE__ */ jsx(
19
20
  IconButton,
20
21
  {
21
22
  type: "button",
@@ -8,12 +8,13 @@ import { D as DICTIONARY } from "../../../dictionary.js";
8
8
  import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
9
9
  import { B as Button } from "../../../../mui_extended/Button/Button.js";
10
10
  function StepperPrevButton(props) {
11
- const { label, ...rest } = props;
11
+ const { label, forceIsMobile, ...rest } = props;
12
12
  const { currentStep } = useStepper((state) => ({
13
13
  currentStep: state.currentStep
14
14
  }));
15
15
  const { host_static_assets, environment_assets } = useEnvironment();
16
16
  const isMobile = useIsMobile();
17
+ const isMobileForce = forceIsMobile !== void 0 ? forceIsMobile : isMobile;
17
18
  const { getLabel } = useModuleDictionary();
18
19
  const { prevStepAction } = useStepperActions();
19
20
  const handlePrev = () => {
@@ -22,7 +23,7 @@ function StepperPrevButton(props) {
22
23
  if (currentStep === 0) {
23
24
  return null;
24
25
  }
25
- return isMobile ? /* @__PURE__ */ jsx(
26
+ return isMobileForce ? /* @__PURE__ */ jsx(
26
27
  IconButton,
27
28
  {
28
29
  type: "button",
@@ -1,18 +1,37 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { D as DICTIONARY } from "../../../dictionary.js";
3
- import { useModuleDictionary } from "@m4l/core";
4
- import { B as Button } from "../../../../mui_extended/Button/Button.js";
3
+ import { useModuleDictionary, useEnvironment } from "@m4l/core";
4
+ import { useIsMobile } from "@m4l/graphics";
5
+ import { p as pathIcons } from "../../../icons.js";
6
+ import { useFormContext } from "react-hook-form";
7
+ import { L as LoadingButton } from "../../../../mui_extended/LoadingButton/LoadingButton.js";
8
+ import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
9
+ import { C as CircularProgress } from "../../../../mui_extended/CircularProgress/CircularProgress.js";
5
10
  function StepperSubmitButton(props) {
6
- const { label, ...rest } = props;
11
+ const { label, forceIsMobile, ...rest } = props;
7
12
  const { getLabel } = useModuleDictionary();
8
- return /* @__PURE__ */ jsx(
9
- Button,
13
+ const { host_static_assets, environment_assets } = useEnvironment();
14
+ const isMobile = useIsMobile();
15
+ const isMobileForce = forceIsMobile !== void 0 ? forceIsMobile : isMobile;
16
+ const { formState: { isSubmitting } } = useFormContext();
17
+ return isMobileForce ? /* @__PURE__ */ jsx(
18
+ IconButton,
19
+ {
20
+ type: "submit",
21
+ icon: isSubmitting ? /* @__PURE__ */ jsx(CircularProgress, { color: "default" }) : `${host_static_assets}/${environment_assets}/${pathIcons.circleCheck}`,
22
+ "data-testid": "stepper-prev-button",
23
+ variant: "contained",
24
+ color: "primary"
25
+ }
26
+ ) : /* @__PURE__ */ jsx(
27
+ LoadingButton,
10
28
  {
11
29
  type: "submit",
12
30
  label: label || getLabel(DICTIONARY.LABEL_SUBMIT_BUTTON),
13
31
  variant: "contained",
14
32
  color: "primary",
15
33
  "data-testid": "stepper-submit-button",
34
+ loading: isSubmitting,
16
35
  ...rest
17
36
  }
18
37
  );
@@ -0,0 +1,8 @@
1
+ import { StepProps } from '../../../../../types';
2
+ /**
3
+ * Hook que determina si un step debe ser visible
4
+ * Usa useSyncExternalStore para optimizar re-renders:
5
+ * - Solo re-renderiza el componente si el valor booleano cambia realmente
6
+ * - Aunque el formulario cambie, si la visibilidad sigue siendo la misma, no re-renderiza
7
+ */
8
+ export declare function useIsStepVisible(props: Pick<StepProps, 'stepKey'>): boolean;
@@ -0,0 +1,93 @@
1
+ import { useRef, useCallback, useSyncExternalStore } from "react";
2
+ import { u as useStepper } from "../../../../../hooks/useStepper/index.js";
3
+ import { useFormContext } from "react-hook-form";
4
+ import { d as deepShallow } from "../../../../../../../utils/deepShallow.js";
5
+ import { e as evaluateVisibilityStepCondition } from "../../../../../helpers/evaluateVisibilityStepCondition/index.js";
6
+ function calculateStepVisibility(stepKey, steps, currentStep, formValues, visibilityData) {
7
+ const stepConfig = steps.find((step) => step.key === stepKey);
8
+ if (!stepConfig) {
9
+ return false;
10
+ }
11
+ const meetsVisibilityCondition = evaluateVisibilityStepCondition(
12
+ stepConfig,
13
+ formValues || {},
14
+ visibilityData || {}
15
+ );
16
+ if (!meetsVisibilityCondition) {
17
+ return false;
18
+ }
19
+ const currentStepConfig = steps[currentStep];
20
+ if (!currentStepConfig) {
21
+ return false;
22
+ }
23
+ if (evaluateVisibilityStepCondition(currentStepConfig, formValues || {}, visibilityData || {})) {
24
+ return stepKey === currentStepConfig.key;
25
+ }
26
+ const visibleStepsUpToCurrent = [];
27
+ for (let i = 0; i <= currentStep; i++) {
28
+ const step = steps[i];
29
+ if (evaluateVisibilityStepCondition(step, formValues || {}, visibilityData || {})) {
30
+ visibleStepsUpToCurrent.push(step);
31
+ }
32
+ }
33
+ if (visibleStepsUpToCurrent.length === 0) {
34
+ for (let i = currentStep + 1; i < steps.length; i++) {
35
+ const step = steps[i];
36
+ if (evaluateVisibilityStepCondition(step, formValues || {}, visibilityData || {})) {
37
+ return stepKey === step.key;
38
+ }
39
+ }
40
+ return false;
41
+ }
42
+ const activeVisibleStep = visibleStepsUpToCurrent[visibleStepsUpToCurrent.length - 1];
43
+ return stepKey === activeVisibleStep.key;
44
+ }
45
+ function useIsStepVisible(props) {
46
+ const { stepKey } = props;
47
+ const formContext = useFormContext();
48
+ const { currentStep, steps, visibilityData } = useStepper((state) => ({
49
+ currentStep: state.currentStep,
50
+ steps: state.steps,
51
+ visibilityData: state.visibilityData
52
+ }), deepShallow);
53
+ const previousValueRef = useRef(null);
54
+ const listenersRef = useRef(/* @__PURE__ */ new Set());
55
+ const subscribe = useCallback((callback) => {
56
+ listenersRef.current.add(callback);
57
+ const { unsubscribe } = formContext.watch((formValues) => {
58
+ const newValue = calculateStepVisibility(
59
+ stepKey,
60
+ steps,
61
+ currentStep,
62
+ formValues,
63
+ visibilityData
64
+ );
65
+ if (newValue !== previousValueRef.current) {
66
+ previousValueRef.current = newValue;
67
+ listenersRef.current.forEach((listener) => listener());
68
+ }
69
+ });
70
+ return () => {
71
+ listenersRef.current.delete(callback);
72
+ unsubscribe();
73
+ };
74
+ }, [formContext, stepKey, steps, currentStep, visibilityData]);
75
+ const getSnapshot = useCallback(() => {
76
+ const formValues = formContext.getValues();
77
+ const value = calculateStepVisibility(
78
+ stepKey,
79
+ steps,
80
+ currentStep,
81
+ formValues,
82
+ visibilityData
83
+ );
84
+ if (previousValueRef.current === null) {
85
+ previousValueRef.current = value;
86
+ }
87
+ return value;
88
+ }, [formContext, stepKey, steps, currentStep, visibilityData]);
89
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
90
+ }
91
+ export {
92
+ useIsStepVisible as u
93
+ };
@@ -1,58 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { u as useStepper } from "../../../../hooks/useStepper/index.js";
4
- import { useWatch } from "react-hook-form";
5
2
  import { j as StepContentStyled } from "../../../../slots/StepperSlot.js";
6
- import { e as evaluateVisibilityStepCondition } from "../../../../helpers/evaluateVisibilityStepCondition/index.js";
3
+ import { u as useIsStepVisible } from "./hooks/useIsStepVisible.js";
7
4
  function Step(props) {
8
5
  const { stepKey, children } = props;
9
- const formValues = useWatch();
10
- const { currentStep, steps, visibilityData } = useStepper((state) => ({
11
- currentStep: state.currentStep,
12
- steps: state.steps,
13
- visibilityData: state.visibilityData
14
- }));
15
- const stepConfig = useMemo(() => {
16
- return steps.find((step) => step.key === stepKey);
17
- }, [steps, stepKey]);
18
- const isStepVisible = useMemo(() => {
19
- if (!stepConfig) {
20
- return false;
21
- }
22
- const meetsVisibilityCondition = evaluateVisibilityStepCondition(
23
- stepConfig,
24
- formValues || {},
25
- visibilityData
26
- );
27
- if (!meetsVisibilityCondition) {
28
- return false;
29
- }
30
- const currentStepConfig = steps[currentStep];
31
- if (!currentStepConfig) {
32
- return false;
33
- }
34
- if (evaluateVisibilityStepCondition(currentStepConfig, formValues || {}, visibilityData)) {
35
- return stepKey === currentStepConfig.key;
36
- }
37
- const visibleStepsUpToCurrent = [];
38
- for (let i = 0; i <= currentStep; i++) {
39
- const step = steps[i];
40
- if (evaluateVisibilityStepCondition(step, formValues || {}, visibilityData)) {
41
- visibleStepsUpToCurrent.push(step);
42
- }
43
- }
44
- if (visibleStepsUpToCurrent.length === 0) {
45
- for (let i = currentStep + 1; i < steps.length; i++) {
46
- const step = steps[i];
47
- if (evaluateVisibilityStepCondition(step, formValues || {}, visibilityData)) {
48
- return stepKey === step.key;
49
- }
50
- }
51
- return false;
52
- }
53
- const activeVisibleStep = visibleStepsUpToCurrent[visibleStepsUpToCurrent.length - 1];
54
- return stepKey === activeVisibleStep.key;
55
- }, [currentStep, stepKey, stepConfig, steps, formValues, visibilityData]);
6
+ const isStepVisible = useIsStepVisible({ stepKey });
56
7
  return /* @__PURE__ */ jsx(StepContentStyled, { ownerState: { isStepVisible }, children });
57
8
  }
58
9
  export {
@@ -150,6 +150,10 @@ export interface StepperFooterLeftActionsProps {
150
150
  * Props para los botones del Stepper que extienden las props de Button de mui_extended
151
151
  */
152
152
  export interface StepperButtonProps extends Omit<ButtonProps, 'label'> {
153
+ /**
154
+ * Forzar a un una versión especifica no importando el dispositivo
155
+ */
156
+ forceIsMobile?: boolean;
153
157
  label?: string;
154
158
  }
155
159
  /**
@@ -28,6 +28,7 @@ const ToastContainer = (props) => {
28
28
  icon: false,
29
29
  closeButton: false,
30
30
  autoClose: DEFAULT_CLOSE_TIME,
31
+ position: "bottom-left",
31
32
  theme: "light",
32
33
  ...restProps
33
34
  }
@@ -1,5 +1,5 @@
1
1
  export declare const TOAST_KEY_COMPONENT = "M4LToastContainer";
2
- export declare const DEFAULT_CLOSE_TIME = 30000;
2
+ export declare const DEFAULT_CLOSE_TIME = 10000;
3
3
  export declare const ICONS_PATH = "frontend/components/toast/assets/icons";
4
4
  export declare const TOAST_NATIVE_STYLES: {
5
5
  '&': {
@@ -1,5 +1,5 @@
1
1
  const TOAST_KEY_COMPONENT = "M4LToastContainer";
2
- const DEFAULT_CLOSE_TIME = 3e4;
2
+ const DEFAULT_CLOSE_TIME = 1e4;
3
3
  const ICONS_PATH = "frontend/components/toast/assets/icons";
4
4
  const TOAST_NATIVE_STYLES = {
5
5
  "&": {
@@ -1,9 +1,53 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React, { createContext } from "react";
2
+ import React, { createContext, useMemo } from "react";
3
3
  const WindowToolsMFContext = createContext(null);
4
4
  function WindowToolsMFProvider(props) {
5
- const { children, ...other } = props;
6
- return /* @__PURE__ */ jsx(WindowToolsMFContext.Provider, { value: { ...other }, children });
5
+ const {
6
+ children,
7
+ getCookie,
8
+ getWindowId,
9
+ getCookies,
10
+ setActions,
11
+ setCookie,
12
+ startProgress,
13
+ stopProgress,
14
+ toast,
15
+ close,
16
+ setFnQueryClose,
17
+ setWindowTitle,
18
+ setWindowSubTitle,
19
+ setWindowEditionInfo
20
+ } = props;
21
+ const value = useMemo(() => ({
22
+ getCookie,
23
+ getWindowId,
24
+ getCookies,
25
+ setActions,
26
+ setCookie,
27
+ startProgress,
28
+ stopProgress,
29
+ toast,
30
+ close,
31
+ setFnQueryClose,
32
+ setWindowTitle,
33
+ setWindowSubTitle,
34
+ setWindowEditionInfo
35
+ }), [
36
+ getCookie,
37
+ getWindowId,
38
+ getCookies,
39
+ setActions,
40
+ setCookie,
41
+ startProgress,
42
+ stopProgress,
43
+ toast,
44
+ close,
45
+ setFnQueryClose,
46
+ setWindowTitle,
47
+ setWindowSubTitle,
48
+ setWindowEditionInfo
49
+ ]);
50
+ return /* @__PURE__ */ jsx(WindowToolsMFContext.Provider, { value, children });
7
51
  }
8
52
  const MemonizedWindowToolsMFContext = React.memo(WindowToolsMFProvider);
9
53
  export {
@@ -53,7 +53,7 @@ export interface WindowToolsMF {
53
53
  /**
54
54
  * Método para cerrar la ventana actual.
55
55
  */
56
- close: () => void;
56
+ close: (useFnQueryClose?: boolean) => void;
57
57
  /**
58
58
  * Método para establecer la función de consulta de cierre de la ventana.
59
59
  * @param fnQueryClose La función de consulta de cierre de la ventana que se desea establecer.
@@ -1,7 +1,18 @@
1
1
  import { default as React } from 'react';
2
2
  import { ComponentProps } from './types';
3
3
  /**
4
- * Componente encargado de renderizar el componente de la ventana.
4
+ * Componente encargado de renderizar el componente de la ventana con transición y loader.
5
+ * Usa useTransition para priorizar el loader y mantener la UI responsive durante el renderizado pesado.
6
+ *
7
+ * ## Flujo de renderizado:
8
+ * 1. Monta con shouldRender=false, isPending=false → muestra nada (o loader inicial)
9
+ * 2. useEffect ejecuta: startTransition(() => setShouldRender(true))
10
+ * 3. React marca la actualización como "no urgente" e inmediatamente isPending=true → muestra loader
11
+ * 4. React procesa el cambio de shouldRender: useMemo se re-ejecuta y crea el componente pesado
12
+ * 5. Cuando termina TODO el trabajo de render: isPending=false → muestra componente con fade in
13
+ *
14
+ * La clave es que React mantiene isPending=true durante TODO el tiempo que tarde en procesar
15
+ * la actualización de estado y el render que causa (incluyendo el useMemo pesado).
5
16
  */
6
17
  export declare const WindowBaseComponent: (props: ComponentProps) => import("react/jsx-runtime").JSX.Element;
7
18
  export declare const MemonizedComponent: React.MemoExoticComponent<(props: ComponentProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,11 +1,65 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React from "react";
2
+ import React, { useTransition, useState, useRef, useMemo, createElement, useEffect } from "react";
3
3
  import { a as WindowContainerComponentStyled } from "../../slots/WindowBaseSlots.js";
4
+ import { P as PropagateLoaderSpinner } from "../../../extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.js";
4
5
  import { a as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/WindowToolsMFContext.js";
5
6
  import { a as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/DynamicMFParmsContext.js";
6
7
  const WindowBaseComponent = (props) => {
7
8
  const { component, dynamicMFStore, windowTools, componentProps, emergeType } = props;
8
- return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(WindowContainerComponentStyled, { ownerState: { emergeType }, children: typeof component === "function" ? component(componentProps) : component }) }) });
9
+ const [isPending, startTransition] = useTransition();
10
+ const [shouldRender, setShouldRender] = useState(false);
11
+ const mountTimeRef = useRef(performance.now());
12
+ const renderedComponent = useMemo(() => {
13
+ if (!shouldRender) {
14
+ return null;
15
+ }
16
+ const renderStartTime = performance.now();
17
+ const component_result = typeof component === "function" ? createElement(component, componentProps) : component;
18
+ const renderTime = performance.now() - renderStartTime;
19
+ if (process.env.NODE_ENV === "development" && renderTime > 100) {
20
+ console.warn(`⚠️ WindowBase component rendering took ${renderTime.toFixed(2)}ms`);
21
+ }
22
+ return component_result;
23
+ }, [shouldRender, component, componentProps]);
24
+ useEffect(() => {
25
+ startTransition(() => {
26
+ setShouldRender(true);
27
+ });
28
+ const timer = setTimeout(() => {
29
+ const totalTime = performance.now() - mountTimeRef.current;
30
+ if (process.env.NODE_ENV === "development" && totalTime > 500) {
31
+ console.warn(`⏱️ WindowBase total mount time: ${totalTime.toFixed(2)}ms`);
32
+ }
33
+ }, 0);
34
+ return () => clearTimeout(timer);
35
+ }, []);
36
+ return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(
37
+ WindowContainerComponentStyled,
38
+ {
39
+ ownerState: { emergeType },
40
+ children: isPending ? (
41
+ // Mientras isPending=true, mostrar solo el loader
42
+ /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
45
+ style: {
46
+ position: "absolute",
47
+ display: "flex",
48
+ justifyContent: "center",
49
+ alignItems: "center",
50
+ width: "100%",
51
+ height: "100%",
52
+ zIndex: 1e3
53
+ },
54
+ children: /* @__PURE__ */ jsx(PropagateLoaderSpinner, {})
55
+ }
56
+ )
57
+ ) : (
58
+ // Cuando isPending=false, mostrar componente con fade in
59
+ renderedComponent
60
+ )
61
+ }
62
+ ) }) });
9
63
  };
10
64
  React.memo(WindowBaseComponent);
11
65
  export {
@@ -3,6 +3,7 @@ import { DynamicMFStore } from '../../contexts/DynamicMFParmsContext/store';
3
3
  import { JSX_REACT_NODE } from '../../../WindowBase/types';
4
4
  import { EmergeType } from '../../../areas/types';
5
5
  export interface ComponentProps {
6
+ id: string;
6
7
  emergeType: EmergeType;
7
8
  windowTools: WindowToolsMF;
8
9
  dynamicMFStore: DynamicMFStore;
@@ -16,7 +16,7 @@ export type WindowOptions = {
16
16
  */
17
17
  allowPersistCookies: boolean;
18
18
  };
19
- export type JSX_REACT_NODE = ((props?: any) => JSX.Element) | ReactNode;
19
+ export type JSX_REACT_NODE = ((props?: any) => JSX.Element) | JSX.Element;
20
20
  /**
21
21
  * Tipo que representa el tipo de ventana: microfrontend o componente.
22
22
  */
@@ -90,6 +90,7 @@ const Window = (props) => {
90
90
  ) : /* @__PURE__ */ jsx(
91
91
  WindowBaseComponent,
92
92
  {
93
+ id: windowId,
93
94
  emergeType,
94
95
  dynamicMFStore,
95
96
  windowTools,
@@ -68,7 +68,7 @@ const useWindow = (windowId, areaId) => {
68
68
  getCookie: (id) => getCookie(windowId, id),
69
69
  getCookies: (type) => getCookies(windowId, type),
70
70
  setCookie: (id, type, cookie) => setCookie(windowId, id, type, cookie),
71
- close: () => close(windowId),
71
+ close: (useFnQueryClose = true) => close(windowId, useFnQueryClose),
72
72
  startProgress: () => startProgress(windowId),
73
73
  stopProgress: () => stopProgress(windowId),
74
74
  setFnQueryClose: (fnQueryClose) => setFnQueryClose(windowId, fnQueryClose),
@@ -441,8 +441,8 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
441
441
  bounds: {
442
442
  left: MARGIN_GRIDLAYOUT,
443
443
  top: MARGIN_GRIDLAYOUT,
444
- right: -MARGIN_GRIDLAYOUT,
445
- bottom: -MARGIN_GRIDLAYOUT
444
+ right: -10,
445
+ bottom: -10
446
446
  }
447
447
  });
448
448
  }
@@ -721,9 +721,13 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
721
721
  /**
722
722
  * close window
723
723
  */
724
- close: (windowId) => {
724
+ close: (windowId, useFnQueryClose = true) => {
725
725
  const hW = get().hashWindows[windowId];
726
726
  if (hW) {
727
+ if (hW.fnQueryClose && useFnQueryClose) {
728
+ hW.fnQueryClose();
729
+ return;
730
+ }
727
731
  const onClose = hW.onClose;
728
732
  if (onClose) {
729
733
  onClose(hW.windowId);
@@ -285,7 +285,7 @@ export interface AreasStoreStateWithActions extends AreasStoreState {
285
285
  getCookie: (windowId: string, id: string) => Record<string, any> | undefined;
286
286
  getCookies: (windowId: string, type: CookieType) => Record<string, any>;
287
287
  setCookie: (windowId: string, id: string, type: CookieType, cookie: Record<string, any>) => void;
288
- close: (windowId: string) => void;
288
+ close: (windowId: string, useFnQueryClose?: boolean) => void;
289
289
  startProgress: (windowId: string) => void;
290
290
  stopProgress: (windowId: string) => void;
291
291
  loadCookiesFromApi: (windowId: string) => void;
@@ -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, FieldValues>;
6
+ export declare function useCustomForm({ validationSchema, values, statusLoad, mode, }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any, undefined>;
7
7
  /**
8
8
  * TODO: Documentar
9
9
  */
@@ -1,7 +1,8 @@
1
1
  import { styled } from "@mui/material";
2
2
  const FormProviderRoot = styled("form")(({ theme }) => ({
3
3
  ...theme.components?.M4LRHFormProvider?.styleOverrides || {},
4
- width: "100%"
4
+ width: "100%",
5
+ overflow: "hidden"
5
6
  }));
6
7
  export {
7
8
  FormProviderRoot as F
@@ -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?: Extract<ComponentPalletColor, 'primary'>;
20
+ color?: ComponentPalletColor;
21
21
  /**
22
22
  * Tamaño del componente.
23
23
  * Solo se aceptan los valores `small` y `medium`, que representan tamaños predefinidos.
@@ -262,10 +262,14 @@ const createPopupsStore = (initProps, storeDevtoolsEnabled = false) => {
262
262
  /**
263
263
  * closePopup: Cierra un popup
264
264
  */
265
- close: (popupId) => {
265
+ close: (popupId, useFnQueryClose = true) => {
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
+ }
269
273
  set((state) => {
270
274
  state.hashPopups[popupId].status = "closing";
271
275
  });
@@ -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) => void;
299
+ close: (popupId: string, useFnQueryClose?: boolean) => void;
300
300
  /**
301
301
  * Modifica un popup espeficio
302
302
  */
@@ -5,9 +5,6 @@ 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.
11
8
  */
12
9
  export declare const usePopups: (popupId: string) => {
13
10
  winType: "component" | "microfrontend";
@@ -17,7 +14,8 @@ export declare const usePopups: (popupId: string) => {
17
14
  iconUrl: string;
18
15
  selected: boolean;
19
16
  mfProps: import('../../../../MFLoader/types').MFBaseProps | undefined;
20
- component: import('../../../../WindowBase').JSX_REACT_NODE;
17
+ component: import('../../../../WindowBase').JSX_REACT_NODE | undefined;
18
+ componentProps: Record<string, any> | undefined;
21
19
  loading: boolean | undefined;
22
20
  status: import('../../PopupsViewer/types').PopupStatus;
23
21
  version: string | undefined;