@m4l/components 9.3.24-JT04112025.beta.1 → 9.3.24-JT04112025.beta.2

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 (151) hide show
  1. package/@types/export.d.ts +6 -0
  2. package/@types/types.d.ts +26 -1
  3. package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +8 -17
  4. package/components/CommonActions/components/ActionFormCancel/types.d.ts +0 -9
  5. package/components/DataGrid/DataGrid.js +6 -2
  6. package/components/DataGrid/Datagrid.styles.js +67 -18
  7. package/components/DataGrid/constants.d.ts +19 -0
  8. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +1 -2
  9. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +3 -6
  10. package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +0 -1
  11. package/components/DataGrid/formatters/ColumnIconFormatter/types.d.ts +2 -4
  12. package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +7 -1
  13. package/components/DataGrid/formatters/ColumnSetCheckFormatter/types.d.ts +1 -0
  14. package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.d.ts +8 -0
  15. package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.js +16 -0
  16. package/components/DataGrid/formatters/ColumnTagsFormatter/index.d.ts +3 -0
  17. package/components/DataGrid/formatters/ColumnTagsFormatter/index.js +1 -0
  18. package/components/DataGrid/formatters/ColumnTagsFormatter/types.d.ts +5 -0
  19. package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.d.ts +9 -0
  20. package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.js +60 -0
  21. package/components/DataGrid/formatters/index.d.ts +1 -0
  22. package/components/DataGrid/hooks/useModalCardDetail.d.ts +2 -2
  23. package/components/DataGrid/hooks/useModalCardDetail.js +49 -48
  24. package/components/DataGrid/index.d.ts +1 -1
  25. package/components/DataGrid/slots/DataGridEnum.d.ts +2 -0
  26. package/components/DataGrid/slots/DataGridEnum.js +2 -0
  27. package/components/DataGrid/slots/DataGridSlot.d.ts +3 -1
  28. package/components/DataGrid/slots/DataGridSlot.js +45 -37
  29. package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.d.ts +18 -0
  30. package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.js +10 -0
  31. package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.d.ts +9 -0
  32. package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +25 -0
  33. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -2
  34. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +62 -73
  35. package/components/DataGrid/subcomponents/Cards/index.js +71 -16
  36. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +36 -18
  37. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.d.ts +1 -1
  38. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +13 -20
  39. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +6 -1
  40. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +67 -36
  41. package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.js +9 -2
  42. package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.js +4 -2
  43. package/components/DataGrid/subcomponents/Cards/types.d.ts +50 -1
  44. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +5 -2
  45. package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
  46. package/components/DataGrid/subcomponents/HeaderActions/index.js +1 -1
  47. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
  48. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
  49. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
  50. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
  51. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
  52. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.js +1 -1
  53. package/components/DataGrid/subcomponents/Table/index.js +60 -41
  54. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +16 -18
  55. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +3 -3
  56. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  57. package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
  58. package/components/DataGrid/tests/helpers/types.d.ts +3 -0
  59. package/components/DataGrid/types.d.ts +17 -4
  60. package/components/Label/Label.js +1 -1
  61. package/components/ObjectLogs/slots/ObjectLogsSlots.js +3 -5
  62. package/components/PaperForm/PaperForm.js +1 -1
  63. package/components/PaperForm/components/Header.js +7 -9
  64. package/components/PaperForm/styles.js +4 -9
  65. package/components/PaperForm/types.d.ts +2 -3
  66. package/components/Stepper/Stepper.styles.js +0 -2
  67. package/components/Stepper/dictionary.js +1 -0
  68. package/components/Stepper/subcomponents/StepArea/index.js +115 -7
  69. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -2
  70. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +53 -3
  71. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +2 -3
  72. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +2 -3
  73. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -24
  74. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +51 -2
  75. package/components/Stepper/types.d.ts +0 -4
  76. package/components/ToastContainer/ToastContainer.js +0 -1
  77. package/components/ToastContainer/constants.d.ts +1 -1
  78. package/components/ToastContainer/constants.js +1 -1
  79. package/components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js +3 -47
  80. package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +1 -1
  81. package/components/WindowBase/subcomponents/Component/index.d.ts +1 -12
  82. package/components/WindowBase/subcomponents/Component/index.js +2 -56
  83. package/components/WindowBase/subcomponents/Component/types.d.ts +0 -1
  84. package/components/WindowBase/types.d.ts +1 -1
  85. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +0 -1
  86. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +1 -1
  87. package/components/areas/contexts/AreasContext/store.js +1 -5
  88. package/components/areas/contexts/AreasContext/types.d.ts +1 -1
  89. package/components/formatters/IconsFormatter/IconsFormatter.d.ts +6 -0
  90. package/components/formatters/IconsFormatter/IconsFormatter.js +22 -0
  91. package/components/formatters/IconsFormatter/IconsFormatter.styles.d.ts +2 -0
  92. package/components/formatters/IconsFormatter/IconsFormatter.styles.js +29 -0
  93. package/components/formatters/IconsFormatter/constants.d.ts +1 -0
  94. package/components/formatters/IconsFormatter/constants.js +4 -0
  95. package/components/{DataGrid/formatters/ColumnIconFormatter → formatters/IconsFormatter}/helpers/renderIcon.d.ts +2 -2
  96. package/components/formatters/IconsFormatter/helpers/renderIcon.js +24 -0
  97. package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.d.ts +7 -0
  98. package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.js +16 -0
  99. package/components/formatters/IconsFormatter/index.d.ts +3 -0
  100. package/components/formatters/IconsFormatter/index.js +1 -0
  101. package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.d.ts +5 -0
  102. package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.js +9 -0
  103. package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.d.ts +9 -0
  104. package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.js +22 -0
  105. package/components/formatters/IconsFormatter/types.d.ts +57 -0
  106. package/components/formatters/IconsFormatter/types.js +1 -0
  107. package/components/formatters/TagsFormatter/TagsFormatter.d.ts +5 -0
  108. package/components/formatters/TagsFormatter/TagsFormatter.js +28 -0
  109. package/components/formatters/TagsFormatter/TagsFormatter.styles.d.ts +2 -0
  110. package/components/formatters/TagsFormatter/TagsFormatter.styles.js +41 -0
  111. package/components/formatters/TagsFormatter/constants.d.ts +5 -0
  112. package/components/formatters/TagsFormatter/constants.js +11 -0
  113. package/components/formatters/TagsFormatter/helpers/renderMultipleTag.d.ts +8 -0
  114. package/components/formatters/TagsFormatter/helpers/renderMultipleTag.js +19 -0
  115. package/components/formatters/TagsFormatter/helpers/renderTag.d.ts +7 -0
  116. package/components/formatters/TagsFormatter/helpers/renderTag.js +9 -0
  117. package/components/formatters/TagsFormatter/helpers/validateHexColor.d.ts +8 -0
  118. package/components/formatters/TagsFormatter/helpers/validateHexColor.js +9 -0
  119. package/components/formatters/TagsFormatter/index.d.ts +2 -0
  120. package/components/formatters/TagsFormatter/index.js +1 -0
  121. package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.d.ts +5 -0
  122. package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.js +9 -0
  123. package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.d.ts +6 -0
  124. package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.js +16 -0
  125. package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.d.ts +5 -0
  126. package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.js +35 -0
  127. package/components/formatters/TagsFormatter/subcomponents/Tag/index.d.ts +0 -0
  128. package/components/formatters/TagsFormatter/types.d.ts +47 -0
  129. package/components/formatters/index.d.ts +6 -5
  130. package/components/hook-form/RHFormContext/styles.js +1 -2
  131. package/components/mui_extended/CircularProgress/types.d.ts +1 -1
  132. package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +1 -5
  133. package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +1 -1
  134. package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +4 -2
  135. package/components/popups/components/PopupsProvider/hooks/usePopups.js +7 -19
  136. package/components/popups/components/PopupsViewer/PopupsViewer.js +1 -1
  137. package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +1 -1
  138. package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +21 -32
  139. package/contexts/ModalContext/index.js +5 -5
  140. package/index.js +32 -28
  141. package/package.json +1 -1
  142. package/components/DataGrid/formatters/ColumnIconFormatter/constants.js +0 -4
  143. package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.js +0 -58
  144. package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.d.ts +0 -7
  145. package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.js +0 -19
  146. package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +0 -13
  147. package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +0 -111
  148. package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.d.ts +0 -8
  149. package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.js +0 -79
  150. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.d.ts +0 -8
  151. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.js +0 -93
@@ -1,8 +1,58 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { A as ActionFormCancel } from "../../../../CommonActions/components/ActionFormCancel/ActionFormCancel.js";
2
+ import { useCallback } from "react";
3
+ import { useFormContext, useFormState } from "react-hook-form";
4
+ import { u as useStepperActions } from "../../../hooks/useStepperActions/index.js";
5
+ import { D as DICTIONARY$1 } from "../../../dictionary.js";
6
+ import { D as DICTIONARY } from "../../../../CommonActions/dictionary.js";
7
+ import { useModuleDictionary } from "@m4l/core";
8
+ import { u as useModal } from "../../../../../hooks/useModal/index.js";
9
+ import { u as useWindowToolsMF } from "../../../../WindowBase/hooks/useWindowToolsMF/index.js";
10
+ import { W as WindowConfirm } from "../../../../WindowConfirm/WindowConfirm.js";
11
+ import { B as Button } from "../../../../mui_extended/Button/Button.js";
3
12
  function StepperCancelButton(props) {
4
- const { ...rest } = props;
5
- return /* @__PURE__ */ jsx(ActionFormCancel, { "data-testid": "stepper-cancel-button", ...rest });
13
+ const { label, ...rest } = props;
14
+ const { getLabel } = useModuleDictionary();
15
+ const { cancelAction } = useStepperActions();
16
+ const { openModal } = useModal();
17
+ const { close: closeWindow } = useWindowToolsMF();
18
+ const { control } = useFormContext();
19
+ const { isDirty } = useFormState({
20
+ control
21
+ });
22
+ const onConfirmQuit = useCallback(() => {
23
+ cancelAction();
24
+ closeWindow();
25
+ }, [cancelAction, closeWindow]);
26
+ const handleCancel = useCallback(() => {
27
+ if (isDirty) {
28
+ openModal({
29
+ window: /* @__PURE__ */ jsx(
30
+ WindowConfirm,
31
+ {
32
+ variant: "warning",
33
+ title: getLabel(DICTIONARY.CONFIRM_QUIT_TITLE),
34
+ msg: getLabel(DICTIONARY.CONFIRM_QUIT_MSG),
35
+ onClickIntro: onConfirmQuit
36
+ }
37
+ ),
38
+ variant: "warning"
39
+ });
40
+ } else {
41
+ onConfirmQuit();
42
+ }
43
+ }, [getLabel, isDirty, openModal, onConfirmQuit]);
44
+ return /* @__PURE__ */ jsx(
45
+ Button,
46
+ {
47
+ type: "button",
48
+ label: label || getLabel(DICTIONARY$1.LABEL_CANCEL_BUTTON),
49
+ variant: "outlined",
50
+ color: "default",
51
+ onClick: handleCancel,
52
+ ...rest,
53
+ "data-testid": "stepper-cancel-button"
54
+ }
55
+ );
6
56
  }
7
57
  export {
8
58
  StepperCancelButton as S
@@ -7,16 +7,15 @@ 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, forceIsMobile, ...rest } = props;
10
+ const { label, ...rest } = props;
11
11
  const { nextStepAction } = useStepperActions();
12
12
  const isMobile = useIsMobile();
13
- const isMobileForce = forceIsMobile !== void 0 ? forceIsMobile : isMobile;
14
13
  const { getLabel } = useModuleDictionary();
15
14
  const { host_static_assets, environment_assets } = useEnvironment();
16
15
  const handleNext = async () => {
17
16
  await nextStepAction();
18
17
  };
19
- return isMobileForce ? /* @__PURE__ */ jsx(
18
+ return isMobile ? /* @__PURE__ */ jsx(
20
19
  IconButton,
21
20
  {
22
21
  type: "button",
@@ -8,13 +8,12 @@ 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, forceIsMobile, ...rest } = props;
11
+ const { label, ...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;
18
17
  const { getLabel } = useModuleDictionary();
19
18
  const { prevStepAction } = useStepperActions();
20
19
  const handlePrev = () => {
@@ -23,7 +22,7 @@ function StepperPrevButton(props) {
23
22
  if (currentStep === 0) {
24
23
  return null;
25
24
  }
26
- return isMobileForce ? /* @__PURE__ */ jsx(
25
+ return isMobile ? /* @__PURE__ */ jsx(
27
26
  IconButton,
28
27
  {
29
28
  type: "button",
@@ -1,37 +1,18 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { D as DICTIONARY } from "../../../dictionary.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";
3
+ import { useModuleDictionary } from "@m4l/core";
4
+ import { B as Button } from "../../../../mui_extended/Button/Button.js";
10
5
  function StepperSubmitButton(props) {
11
- const { label, forceIsMobile, ...rest } = props;
6
+ const { label, ...rest } = props;
12
7
  const { getLabel } = useModuleDictionary();
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,
8
+ return /* @__PURE__ */ jsx(
9
+ Button,
28
10
  {
29
11
  type: "submit",
30
12
  label: label || getLabel(DICTIONARY.LABEL_SUBMIT_BUTTON),
31
13
  variant: "contained",
32
14
  color: "primary",
33
15
  "data-testid": "stepper-submit-button",
34
- loading: isSubmitting,
35
16
  ...rest
36
17
  }
37
18
  );
@@ -1,9 +1,58 @@
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";
2
5
  import { j as StepContentStyled } from "../../../../slots/StepperSlot.js";
3
- import { u as useIsStepVisible } from "./hooks/useIsStepVisible.js";
6
+ import { e as evaluateVisibilityStepCondition } from "../../../../helpers/evaluateVisibilityStepCondition/index.js";
4
7
  function Step(props) {
5
8
  const { stepKey, children } = props;
6
- const isStepVisible = useIsStepVisible({ stepKey });
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]);
7
56
  return /* @__PURE__ */ jsx(StepContentStyled, { ownerState: { isStepVisible }, children });
8
57
  }
9
58
  export {
@@ -150,10 +150,6 @@ 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;
157
153
  label?: string;
158
154
  }
159
155
  /**
@@ -28,7 +28,6 @@ const ToastContainer = (props) => {
28
28
  icon: false,
29
29
  closeButton: false,
30
30
  autoClose: DEFAULT_CLOSE_TIME,
31
- position: "bottom-left",
32
31
  theme: "light",
33
32
  ...restProps
34
33
  }
@@ -1,5 +1,5 @@
1
1
  export declare const TOAST_KEY_COMPONENT = "M4LToastContainer";
2
- export declare const DEFAULT_CLOSE_TIME = 10000;
2
+ export declare const DEFAULT_CLOSE_TIME = 30000;
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 = 1e4;
2
+ const DEFAULT_CLOSE_TIME = 3e4;
3
3
  const ICONS_PATH = "frontend/components/toast/assets/icons";
4
4
  const TOAST_NATIVE_STYLES = {
5
5
  "&": {
@@ -1,53 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React, { createContext, useMemo } from "react";
2
+ import React, { createContext } from "react";
3
3
  const WindowToolsMFContext = createContext(null);
4
4
  function WindowToolsMFProvider(props) {
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 });
5
+ const { children, ...other } = props;
6
+ return /* @__PURE__ */ jsx(WindowToolsMFContext.Provider, { value: { ...other }, children });
51
7
  }
52
8
  const MemonizedWindowToolsMFContext = React.memo(WindowToolsMFProvider);
53
9
  export {
@@ -53,7 +53,7 @@ export interface WindowToolsMF {
53
53
  /**
54
54
  * Método para cerrar la ventana actual.
55
55
  */
56
- close: (useFnQueryClose?: boolean) => void;
56
+ close: () => 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,18 +1,7 @@
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 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).
4
+ * Componente encargado de renderizar el componente de la ventana.
16
5
  */
17
6
  export declare const WindowBaseComponent: (props: ComponentProps) => import("react/jsx-runtime").JSX.Element;
18
7
  export declare const MemonizedComponent: React.MemoExoticComponent<(props: ComponentProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,65 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React, { useTransition, useState, useRef, useMemo, createElement, useEffect } from "react";
2
+ import React from "react";
3
3
  import { a as WindowContainerComponentStyled } from "../../slots/WindowBaseSlots.js";
4
- import { P as PropagateLoaderSpinner } from "../../../extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.js";
5
4
  import { a as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/WindowToolsMFContext.js";
6
5
  import { a as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/DynamicMFParmsContext.js";
7
6
  const WindowBaseComponent = (props) => {
8
7
  const { component, dynamicMFStore, windowTools, componentProps, emergeType } = props;
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
- ) }) });
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 }) }) });
63
9
  };
64
10
  React.memo(WindowBaseComponent);
65
11
  export {
@@ -3,7 +3,6 @@ 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;
7
6
  emergeType: EmergeType;
8
7
  windowTools: WindowToolsMF;
9
8
  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) | JSX.Element;
19
+ export type JSX_REACT_NODE = ((props?: any) => JSX.Element) | ReactNode;
20
20
  /**
21
21
  * Tipo que representa el tipo de ventana: microfrontend o componente.
22
22
  */
@@ -90,7 +90,6 @@ const Window = (props) => {
90
90
  ) : /* @__PURE__ */ jsx(
91
91
  WindowBaseComponent,
92
92
  {
93
- id: windowId,
94
93
  emergeType,
95
94
  dynamicMFStore,
96
95
  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: (useFnQueryClose = true) => close(windowId, useFnQueryClose),
71
+ close: () => close(windowId),
72
72
  startProgress: () => startProgress(windowId),
73
73
  stopProgress: () => stopProgress(windowId),
74
74
  setFnQueryClose: (fnQueryClose) => setFnQueryClose(windowId, fnQueryClose),
@@ -721,13 +721,9 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
721
721
  /**
722
722
  * close window
723
723
  */
724
- close: (windowId, useFnQueryClose = true) => {
724
+ close: (windowId) => {
725
725
  const hW = get().hashWindows[windowId];
726
726
  if (hW) {
727
- if (hW.fnQueryClose && useFnQueryClose) {
728
- hW.fnQueryClose();
729
- return;
730
- }
731
727
  const onClose = hW.onClose;
732
728
  if (onClose) {
733
729
  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, useFnQueryClose?: boolean) => void;
288
+ close: (windowId: string) => void;
289
289
  startProgress: (windowId: string) => void;
290
290
  stopProgress: (windowId: string) => void;
291
291
  loadCookiesFromApi: (windowId: string) => void;
@@ -0,0 +1,6 @@
1
+ import { IconsFormatterProps } from './types';
2
+ /**
3
+ * IconsFormatter
4
+ * Componente formatter que renderiza uno o varios iconos
5
+ */
6
+ export declare const IconsFormatter: (props: IconsFormatterProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,22 @@
1
+ import { useMemo } from "react";
2
+ import { r as renderIcon } from "./helpers/renderIcon.js";
3
+ import { r as renderMultipleIcons } from "./helpers/renderMultipleIcons.js";
4
+ const IconsFormatter = (props) => {
5
+ const { icons } = props;
6
+ const iconsArray = useMemo(() => {
7
+ if (!icons) {
8
+ return null;
9
+ }
10
+ return Array.isArray(icons) ? icons : [icons];
11
+ }, [icons]);
12
+ if (!iconsArray || iconsArray.length === 0) {
13
+ return null;
14
+ }
15
+ if (iconsArray.length === 1) {
16
+ return renderIcon(iconsArray[0]);
17
+ }
18
+ return renderMultipleIcons(iconsArray);
19
+ };
20
+ export {
21
+ IconsFormatter as I
22
+ };
@@ -0,0 +1,2 @@
1
+ import { IconsFormatterStyles } from './types';
2
+ export declare const iconsFormatterStyles: IconsFormatterStyles;
@@ -0,0 +1,29 @@
1
+ const iconsFormatterStyles = {
2
+ /**
3
+ * Estilo del contenedor de array de iconos
4
+ */
5
+ iconsContainer: ({ theme }) => ({
6
+ display: "flex",
7
+ alignItems: "center",
8
+ flexWrap: "wrap",
9
+ gap: theme.vars.size.baseSpacings.sp1,
10
+ maxHeight: "100%",
11
+ overflow: "hidden"
12
+ }),
13
+ /**
14
+ * Estilo del icono
15
+ */
16
+ icon: () => ({
17
+ flexShrink: 0
18
+ }),
19
+ /**
20
+ * Estilo del icono clickeable
21
+ */
22
+ iconClickeable: () => ({
23
+ cursor: "pointer",
24
+ flexShrink: 0
25
+ })
26
+ };
27
+ export {
28
+ iconsFormatterStyles as i
29
+ };
@@ -0,0 +1 @@
1
+ export declare const ICONS_FORMATTER_KEY_COMPONENT = "M4LIconsFormatter";
@@ -0,0 +1,4 @@
1
+ const ICONS_FORMATTER_KEY_COMPONENT = "M4LIconsFormatter";
2
+ export {
3
+ ICONS_FORMATTER_KEY_COMPONENT as I
4
+ };
@@ -1,8 +1,8 @@
1
- import { ColumnIconResponse } from '../types';
1
+ import { IconConfig } from '../types';
2
2
  /**
3
3
  * Helper que renderiza un único icono
4
4
  * @param iconConfig - Configuración del icono
5
5
  * @param key - Clave opcional para listas
6
6
  * @returns Componente de icono renderizado
7
7
  */
8
- export declare function renderIcon(iconConfig: ColumnIconResponse, key?: number): import("react/jsx-runtime").JSX.Element;
8
+ export declare function renderIcon(iconConfig: IconConfig, key?: number): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { I as IconClickeableStyled, a as IconStyled } from "../slots/IconsFormatterSlots.js";
3
+ function renderIcon(iconConfig, key) {
4
+ const { iconUrl, onClick, tooltip, dataTestId, color, visible, size } = iconConfig;
5
+ if (visible === false) {
6
+ return null;
7
+ }
8
+ const IconComponent = onClick ? IconClickeableStyled : IconStyled;
9
+ return /* @__PURE__ */ jsx(
10
+ IconComponent,
11
+ {
12
+ src: iconUrl,
13
+ onClick,
14
+ tooltipContent: tooltip,
15
+ instaceDataTestId: dataTestId,
16
+ color,
17
+ size
18
+ },
19
+ key
20
+ );
21
+ }
22
+ export {
23
+ renderIcon as r
24
+ };
@@ -0,0 +1,7 @@
1
+ import { IconConfig } from '../types';
2
+ /**
3
+ * Helper que renderiza múltiples iconos
4
+ * @param icons - Array de configuraciones de iconos
5
+ * @returns Componente contenedor con múltiples iconos
6
+ */
7
+ export declare function renderMultipleIcons(icons: IconConfig[]): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { b as IconsContainerStyled } from "../slots/IconsFormatterSlots.js";
3
+ import { r as renderIcon } from "./renderIcon.js";
4
+ function renderMultipleIcons(icons) {
5
+ const visibleIcons = icons.filter((icon) => icon.visible !== false);
6
+ if (visibleIcons.length === 0) {
7
+ return null;
8
+ }
9
+ if (visibleIcons.length === 1) {
10
+ return renderIcon(visibleIcons[0]);
11
+ }
12
+ return /* @__PURE__ */ jsx(IconsContainerStyled, { children: visibleIcons.map((icon, index) => renderIcon(icon, index)) });
13
+ }
14
+ export {
15
+ renderMultipleIcons as r
16
+ };
@@ -0,0 +1,3 @@
1
+ export { IconsFormatter } from './IconsFormatter';
2
+ export * from './types';
3
+ export * from './constants';
@@ -0,0 +1,5 @@
1
+ export declare enum IconsFormatterSlots {
2
+ iconsContainer = "iconsContainer",
3
+ icon = "icon",
4
+ iconClickeable = "iconClickeable"
5
+ }
@@ -0,0 +1,9 @@
1
+ var IconsFormatterSlots = /* @__PURE__ */ ((IconsFormatterSlots2) => {
2
+ IconsFormatterSlots2["iconsContainer"] = "iconsContainer";
3
+ IconsFormatterSlots2["icon"] = "icon";
4
+ IconsFormatterSlots2["iconClickeable"] = "iconClickeable";
5
+ return IconsFormatterSlots2;
6
+ })(IconsFormatterSlots || {});
7
+ export {
8
+ IconsFormatterSlots as I
9
+ };
@@ -0,0 +1,9 @@
1
+ export declare const IconsContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
2
+ ownerState?: any;
3
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
4
+ export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
5
+ ownerState?: any;
6
+ }, {}, {}>;
7
+ export declare const IconClickeableStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
8
+ ownerState?: any;
9
+ }, {}, {}>;