@m4l/components 9.3.19-BE061025-beta.1 → 9.3.19-BE101025-beta.1

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 (95) hide show
  1. package/components/Card/constants.d.ts +1 -1
  2. package/components/Chip/constants.d.ts +1 -1
  3. package/components/ContainerFlow/constants.d.ts +1 -1
  4. package/components/DataGrid/subcomponents/editors/EditLabelEditor/formatter.d.ts +8 -0
  5. package/components/DataGrid/subcomponents/editors/EditLabelEditor/index.d.ts +3 -0
  6. package/components/DataGrid/subcomponents/editors/EditLabelEditor/types.d.ts +5 -0
  7. package/components/DataGrid/subcomponents/editors/EditLabelEditor/useColumnEditLabel.d.ts +9 -0
  8. package/components/DataGrid/tests/helpers/types.d.ts +2 -0
  9. package/components/EditLabel/constants.d.ts +1 -1
  10. package/components/EditLabel/slots/EditLabelEnum.d.ts +1 -0
  11. package/components/EditLabel/slots/EditLabelSlots.d.ts +3 -0
  12. package/components/EditLabel/types.d.ts +2 -2
  13. package/components/FormContainer/constants.d.ts +1 -1
  14. package/components/Image/constant.d.ts +1 -1
  15. package/components/ImageText/constants.d.ts +1 -1
  16. package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.d.ts +5 -0
  17. package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.js +154 -0
  18. package/components/MFIsolationAppStorybook/constants.d.ts +1 -0
  19. package/components/MFIsolationAppStorybook/icons.d.ts +3 -0
  20. package/components/MFIsolationAppStorybook/icons.js +6 -0
  21. package/components/MFIsolationAppStorybook/index.d.ts +1 -0
  22. package/components/MFIsolationAppStorybook/index.js +1 -0
  23. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
  24. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.js +21 -0
  25. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.d.ts +1 -0
  26. package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.js +1 -0
  27. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.d.ts +5 -0
  28. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js +44 -0
  29. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.d.ts +1 -0
  30. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.js +1 -0
  31. package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/types.d.ts +4 -0
  32. package/components/MFIsolationAppStorybook/types.d.ts +31 -0
  33. package/components/MenuActions/constants.d.ts +1 -1
  34. package/components/NoItemSelected/constant.d.ts +1 -1
  35. package/components/Stepper/Stepper.styles.js +17 -14
  36. package/components/Stepper/helpers/getInitialFieldValues/index.d.ts +12 -0
  37. package/components/Stepper/helpers/getInitialFieldValues/index.js +14 -0
  38. package/components/Stepper/helpers/index.d.ts +2 -0
  39. package/components/Stepper/helpers/parseWatchedValues/index.d.ts +17 -0
  40. package/components/Stepper/helpers/parseWatchedValues/index.js +12 -0
  41. package/components/Stepper/hooks/useDynamicValidation/index.d.ts +11 -0
  42. package/components/Stepper/hooks/useDynamicValidation/index.js +69 -0
  43. package/components/Stepper/hooks/useStepperActions/index.js +19 -3
  44. package/components/Stepper/store/StepperStore/index.js +20 -1
  45. package/components/Stepper/subcomponents/StepArea/index.js +45 -25
  46. package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.js +18 -10
  47. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -1
  48. package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +38 -5
  49. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.d.ts +2 -1
  50. package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +5 -3
  51. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.d.ts +2 -1
  52. package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +5 -3
  53. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.d.ts +2 -1
  54. package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -3
  55. package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +30 -11
  56. package/components/Stepper/subcomponents/StepperFooter/subcomponents/StepperFooterRightActions/index.js +20 -10
  57. package/components/Stepper/types.d.ts +7 -0
  58. package/components/WindowBase/constants.d.ts +1 -1
  59. package/components/extended/React-Json-Viewer/constants.d.ts +1 -1
  60. package/components/extended/React-resizable-panels/SplitLayout.js +1 -1
  61. package/components/formatters/ChipStatusFormatter/constants.d.ts +1 -1
  62. package/components/formatters/EditLabelFormatter/constants.d.ts +1 -1
  63. package/components/formatters/EditLabelFormatter/slots/EditLabelFormatterSlots.d.ts +1 -0
  64. package/components/formatters/EditLabelFormatter/types.d.ts +1 -1
  65. package/components/hook-form/RHFAutocomplete/types.d.ts +1 -1
  66. package/components/hook-form/RHFCheckbox/constants.d.ts +1 -1
  67. package/components/hook-form/RHFSelect/constants.d.ts +1 -1
  68. package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +25 -1
  69. package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.js +5 -1
  70. package/components/hook-form/RHFormContext/index.d.ts +1 -1
  71. package/components/hook-form/RHFormContext/index.js +14 -2
  72. package/components/index.d.ts +1 -0
  73. package/components/mui_extended/Autocomplete/hooks/useStartAdornments.d.ts +3 -3
  74. package/components/mui_extended/Autocomplete/hooks/useStartAdornments.js +2 -2
  75. package/components/mui_extended/Button/Button.js +15 -4
  76. package/components/mui_extended/Button/ButtonStyles.js +155 -82
  77. package/components/mui_extended/Button/{constans.d.ts → constants.d.ts} +1 -0
  78. package/components/mui_extended/Button/constants.js +8 -0
  79. package/components/mui_extended/Button/slots/ButtonSlots.js +1 -1
  80. package/components/mui_extended/Button/types.d.ts +1 -1
  81. package/components/mui_extended/IconButton/constants.d.ts +1 -1
  82. package/components/mui_extended/IconButton/constants.js +4 -1
  83. package/components/mui_extended/MenuItem/MenuItem.js +1 -1
  84. package/components/mui_extended/MenuItem/constants.d.ts +1 -1
  85. package/components/mui_extended/NavLink/constants.d.ts +1 -1
  86. package/components/mui_extended/Select/Select.js +2 -2
  87. package/components/mui_extended/Select/constants.d.ts +1 -1
  88. package/components/mui_extended/TextField/constants.d.ts +1 -1
  89. package/components/mui_extended/Tooltip/Tooltip.styles.js +8 -1
  90. package/components/mui_extended/Tooltip/constants.d.ts +1 -1
  91. package/components/mui_extended/Typography/constants.d.ts +1 -1
  92. package/index.js +12 -10
  93. package/package.json +1 -1
  94. package/utils/getComponentSlotRoot.d.ts +3 -1
  95. package/components/mui_extended/Button/constans.js +0 -4
@@ -1,5 +1,5 @@
1
1
  export declare const CARD_KEY = "M4LCard";
2
- export declare const CARD_CLASSES: Record<string, string>;
2
+ export declare const CARD_CLASSES: Record<"text" | "selected" | "outlined" | "root", string>;
3
3
  export declare const CARD_SIZES: {
4
4
  compact: number;
5
5
  standard: number;
@@ -18,4 +18,4 @@ export declare const COMBINED_CHIP_ENUMS: {
18
18
  /**
19
19
  * Inventario de clases CSS para el componente Chip
20
20
  */
21
- export declare const CHIP_CLASSES: Record<string, string>;
21
+ export declare const CHIP_CLASSES: Record<"root" | "iconButton" | "closeIcon" | "skeletonChip" | "chipIcon" | "textChip", string>;
@@ -1,5 +1,5 @@
1
1
  export declare const CONTAINER_FLOW_KEY_COMPONENT = "M4LContainerFlow";
2
- export declare const CONTAINER_FLOW_CLASSES: Record<string, string>;
2
+ export declare const CONTAINER_FLOW_CLASSES: Record<"root" | "wrapperItem", string>;
3
3
  export declare const CONTAINER_FLOW_GAP_VALUES: {
4
4
  compact: number;
5
5
  standard: number;
@@ -0,0 +1,8 @@
1
+ import { ColumnEditLabelFormatterProps } from './types';
2
+ import { RenderCellProps } from 'react-data-grid';
3
+ /**
4
+ * Formatter para mostrar un etiqueta en una columna de un DataGrid
5
+ * @param props - Propiedades del formatter
6
+ * @returns Componente EditLabelFormatter
7
+ */
8
+ export declare const ColumnEditLabelFormatter: <TRow>(props: ColumnEditLabelFormatterProps<TRow>) => (renderProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { ColumnEditLabelFormatter } from './formatter';
2
+ export { useColumnEditLabel } from './useColumnEditLabel';
3
+ export type { ColumnEditLabelFormatterProps } from './types';
@@ -0,0 +1,5 @@
1
+ import { EditLabelFormatterProps } from '../../../../formatters/EditLabelFormatter';
2
+ import { DeepKeyOf } from '../../../../../utils/types';
3
+ export interface ColumnEditLabelFormatterProps<TRow> extends Pick<EditLabelFormatterProps, 'fieldWidth'> {
4
+ fieldLabel: DeepKeyOf<TRow>;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { ColumnEditLabelFormatterProps } from './types';
2
+ /**
3
+ * Funcion helper que retorna el formatter, filter y customSort de la columna concatenada.
4
+ */
5
+ export declare const useColumnEditLabel: <TRow>(props: ColumnEditLabelFormatterProps<TRow>) => {
6
+ formatter: (renderProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
7
+ customFilter: (row: TRow, value: string | number) => boolean;
8
+ customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
9
+ };
@@ -17,6 +17,7 @@ export interface SeedProps {
17
17
  withSetCheck?: boolean;
18
18
  withCesar?: boolean;
19
19
  withChipStatus?: boolean;
20
+ withEditLabel?: boolean;
20
21
  withActions?: boolean;
21
22
  withActionsUser?: boolean;
22
23
  withBooleanStatus?: boolean;
@@ -30,6 +31,7 @@ export type ColumnType = 'string' | 'number' | 'boolean' | 'date' | 'custom';
30
31
  export interface RowType {
31
32
  id: string;
32
33
  name: string;
34
+ editLabel: string;
33
35
  filterableOnlyOne: string;
34
36
  email: string;
35
37
  phone: string;
@@ -1,2 +1,2 @@
1
1
  export declare const EDIT_LABEL_KEY_COMPONENT = "M4LEditLabel";
2
- export declare const EDIT_LABEL_CLASSES: Record<string, string>;
2
+ export declare const EDIT_LABEL_CLASSES: Record<"icon" | "root" | "label" | "iconButton" | "textField" | "containerActions", string>;
@@ -1,6 +1,7 @@
1
1
  export declare enum EditLabelSlots {
2
2
  root = "root",
3
3
  textField = "textField",
4
+ label = "label",
4
5
  icon = "icon",
5
6
  containerActions = "containerActions",
6
7
  iconButton = "iconButton"
@@ -4,6 +4,9 @@ export declare const EditLabelRootStyled: import('@emotion/styled').StyledCompon
4
4
  export declare const TextFieldStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/TextField/types').TextFieldProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "value" | "size" | "children" | "title" | "component" | "name" | "error" | "select" | "rows" | "id" | "type" | "disabled" | "hidden" | "content" | "style" | "variant" | "margin" | "translate" | "className" | "classes" | "sx" | "label" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "dataTestId" | "autoComplete" | "maxLength" | "placeholder" | "required" | keyof import('react').RefAttributes<HTMLDivElement> | "maxRows" | "fullWidth" | "inputProps" | "inputRef" | "multiline" | "minRows" | "hiddenLabel" | "focused" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps" | "SelectProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
5
5
  ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
6
6
  }, {}, {}>;
7
+ export declare const LabelStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
8
+ ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
9
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
7
10
  export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
8
11
  ownerState?: (Partial<import('..').EditLabelOwnerState> & Record<string, unknown>) | undefined;
9
12
  }, {}, {}>;
@@ -23,7 +23,7 @@ export interface EditLabelProps {
23
23
  /**
24
24
  * The width of the input
25
25
  */
26
- width?: string;
26
+ fieldWidth?: string;
27
27
  }
28
28
  export interface EditLabelOwnerState {
29
29
  /**
@@ -37,7 +37,7 @@ export interface EditLabelOwnerState {
37
37
  /**
38
38
  * The width of the input
39
39
  */
40
- width?: string;
40
+ fieldWidth?: string;
41
41
  }
42
42
  export type EditLabelSlotsType = keyof typeof EditLabelSlots;
43
43
  export type EditLabelStyles = M4LOverridesStyleRules<EditLabelSlotsType, typeof EDIT_LABEL_KEY_COMPONENT, Theme>;
@@ -1,2 +1,2 @@
1
1
  export declare const FORM_CONTAINER_COMPONENT_KEY = "M4LFormContainer";
2
- export declare const FORM_CONTAINER_CLASSES: Record<string, string>;
2
+ export declare const FORM_CONTAINER_CLASSES: Record<"root" | "formContainer" | "buttonGroup", string>;
@@ -3,4 +3,4 @@ export declare const svgDataUriSkeleton = "data:image/svg+xml,%3Csvg width='36'
3
3
  /**
4
4
  * Clases de los slots del componente Image
5
5
  */
6
- export declare const IMAGE_CLASSES: Record<string, string>;
6
+ export declare const IMAGE_CLASSES: Record<"root" | "intersectComponent" | "scrollIntersectRoot" | "skeletonComponent" | "divContainerSkeleton" | "imgSkeleton", string>;
@@ -5,7 +5,7 @@ export declare const IMAGE_TEXT_KEY_COMPONENT = "M4LImageText";
5
5
  /**
6
6
  * Clases del componente ImageTextContainer.
7
7
  */
8
- export declare const IMAGE_TEXT_CLASSES: Record<string, string>;
8
+ export declare const IMAGE_TEXT_CLASSES: Record<"title" | "message" | "root" | "img" | "imageContainer" | "wrapperTitleMessage", string>;
9
9
  /**
10
10
  * URL de la imagen por defecto.
11
11
  */
@@ -0,0 +1,5 @@
1
+ import { MFIsolationAppStorybookProps } from './types';
2
+ /**
3
+ * TODO: Documentar
4
+ */
5
+ export declare function MFIsolationAppStorybook(props: MFIsolationAppStorybookProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,154 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useCallback, useId } from "react";
3
+ import { unstable_HistoryRouter } from "react-router-dom";
4
+ import { createBrowserHistory } from "history";
5
+ import EventEmitter from "eventemitter3";
6
+ import NProgress from "nprogress";
7
+ import { DeviceTypeProvider, ThemeSettingsProvider, LocalesProvider } from "@m4l/graphics";
8
+ import { EnvironmentProvider, HostToolsProvider, NetworkProvider } from "@m4l/core";
9
+ import { A as AppearanceComponentProvider } from "../../contexts/AppearanceComponentContext/AppearanceComponentContext.js";
10
+ import enLocale from "date-fns/locale/en-US";
11
+ import { c as createToaster } from "../ToastContainer/helpers/toaster.js";
12
+ import { M as MFAuthAppStorybook } from "./subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.js";
13
+ import { B as BaseModule } from "../BaseModule/BaseModule.js";
14
+ import { S as SettingsLayout } from "../SettingsLayout/SettingsLayout.js";
15
+ import { T as ToastContainer } from "../ToastContainer/ToastContainer.js";
16
+ import { A as AppBarSettings } from "./subcomponents/AppBarSettings/AppBarSettings.js";
17
+ import { P as PopupsProvider } from "../popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext.js";
18
+ import { A as AreasProvider } from "../areas/contexts/AreasContext/index.js";
19
+ import { S as Stack } from "../mui_extended/Stack/Stack.js";
20
+ const LOCALE_HOST_EN = {
21
+ lang: "en",
22
+ script: void 0,
23
+ region: "US",
24
+ name: "English US",
25
+ urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/commons/assets/icons/langs/lang_en.svg",
26
+ module: enLocale,
27
+ localeString: "en-US"
28
+ };
29
+ const history = createBrowserHistory({ window });
30
+ function MFIsolationAppStorybook(props) {
31
+ const {
32
+ children,
33
+ database = "domain",
34
+ // 'domain
35
+ host_api_local,
36
+ host_api_icons = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/gclick/my_device_status/assets/icons",
37
+ //'https://dev1.gclick.co/api/v1/main/na/icons',
38
+ host_api_remote,
39
+ host_static_assets,
40
+ environment_assets,
41
+ moduleId,
42
+ skeletonFlags,
43
+ moduleNameField,
44
+ privileges,
45
+ componentsDictionary,
46
+ onLoad,
47
+ // observedDivRef,
48
+ moduleDictionaryLoaded,
49
+ forcedDeviceType,
50
+ areasStoreId,
51
+ areasStoreDevtoolsEnabled,
52
+ appBarSettings = false
53
+ } = props;
54
+ const eventEmitter = useMemo(() => new EventEmitter(), []);
55
+ const events_add_listener = useCallback(
56
+ (eventName, handler) => {
57
+ eventEmitter.on(eventName, handler);
58
+ },
59
+ [eventEmitter]
60
+ );
61
+ const events_remove_listener = useCallback(
62
+ (eventName, handler) => {
63
+ if (handler === null) {
64
+ eventEmitter.removeListener(eventName);
65
+ return;
66
+ }
67
+ eventEmitter.removeListener(eventName, handler);
68
+ },
69
+ [eventEmitter]
70
+ );
71
+ const events_emit = useCallback(
72
+ (eventName, arg) => {
73
+ eventEmitter.emit(eventName, arg);
74
+ },
75
+ [eventEmitter]
76
+ );
77
+ const startProgress = () => {
78
+ NProgress.configure({
79
+ showSpinner: true
80
+ });
81
+ NProgress.start();
82
+ };
83
+ const stopProgress = () => {
84
+ NProgress.done();
85
+ };
86
+ const environment = useMemo(
87
+ () => ({
88
+ host: "",
89
+ isLocalhost: true,
90
+ domain_token: "lab1",
91
+ database,
92
+ host_api_local,
93
+ host_api_icons,
94
+ host_api_remote,
95
+ host_static_assets,
96
+ environment_assets
97
+ }),
98
+ // eslint-disable-next-line react-hooks/exhaustive-deps
99
+ []
100
+ );
101
+ const toastContainerId = useId();
102
+ const toaster = createToaster(toastContainerId);
103
+ const hostTools = useMemo(
104
+ () => ({
105
+ history,
106
+ toast: toaster,
107
+ startProgress,
108
+ stopProgress,
109
+ events_add_listener,
110
+ events_remove_listener,
111
+ events_emit
112
+ }),
113
+ // eslint-disable-next-line react-hooks/exhaustive-deps
114
+ []
115
+ );
116
+ const mockNetworkOperation = useCallback(async (_networkProps) => {
117
+ return Promise.resolve({
118
+ data: [],
119
+ status: 200,
120
+ statusText: "OK"
121
+ });
122
+ }, []);
123
+ return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation: mockNetworkOperation, children: /* @__PURE__ */ jsx(unstable_HistoryRouter, { history, children: /* @__PURE__ */ jsx(DeviceTypeProvider, { forcedDeviceType, children: /* @__PURE__ */ jsx(MFAuthAppStorybook, { children: /* @__PURE__ */ jsx(ThemeSettingsProvider, { children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: true, localeHost: LOCALE_HOST_EN, children: /* @__PURE__ */ jsx(
124
+ BaseModule,
125
+ {
126
+ moduleId,
127
+ privileges,
128
+ skeletonFlags,
129
+ componentsDictionary,
130
+ moduleNameField,
131
+ moduleDictionaryLoaded,
132
+ children: /* @__PURE__ */ jsxs(AppearanceComponentProvider, { children: [
133
+ /* @__PURE__ */ jsx(SettingsLayout, {}),
134
+ /* @__PURE__ */ jsx(ToastContainer, { containerId: toastContainerId }),
135
+ " ",
136
+ /* @__PURE__ */ jsx(
137
+ PopupsProvider,
138
+ {
139
+ baseZindex: 1e3,
140
+ storeId: areasStoreId,
141
+ storeDevtoolsEnabled: areasStoreDevtoolsEnabled,
142
+ children: /* @__PURE__ */ jsx(AreasProvider, { loadAreasFromNetwork: false, loadCookiesFromNetwork: false, onLoad, children: /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "100%", flexDirection: "column", overflow: "hidden", position: "relative", children: [
143
+ appBarSettings && /* @__PURE__ */ jsx(AppBarSettings, {}),
144
+ /* @__PURE__ */ jsx(Stack, { width: "100%", flexGrow: 1, flexDirection: "column", overflow: "hidden", position: "relative", children })
145
+ ] }) })
146
+ }
147
+ )
148
+ ] })
149
+ }
150
+ ) }) }) }) }) }) }) }) });
151
+ }
152
+ export {
153
+ MFIsolationAppStorybook as M
154
+ };
@@ -0,0 +1 @@
1
+ export declare const TOAST_CONTAINER_ID = "toast-host";
@@ -0,0 +1,3 @@
1
+ export declare const PATH_ICONS: {
2
+ SETTINGS: string;
3
+ };
@@ -0,0 +1,6 @@
1
+ const PATH_ICONS = {
2
+ SETTINGS: "frontend/components/account_popover/assets/icons/configuration.svg"
3
+ };
4
+ export {
5
+ PATH_ICONS as P
6
+ };
@@ -0,0 +1 @@
1
+ export { MFIsolationAppStorybook } from './MFIsolationAppStorybook';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Componente base para la aplicación en modo de aislamiento
3
+ */
4
+ export declare function AppBarSettings(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useThemeSettingsStore } from "@m4l/graphics";
3
+ import { P as PATH_ICONS } from "../../icons.js";
4
+ import { useEnvironment } from "@m4l/core";
5
+ import { S as Stack } from "../../../mui_extended/Stack/Stack.js";
6
+ import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
7
+ import { L as LanguagePopover } from "../../../LanguagePopover/LanguagePopover.js";
8
+ function AppBarSettings() {
9
+ const handleOpen = useThemeSettingsStore((state) => state.settingsActions.handleOpen);
10
+ const { host_static_assets, environment_assets } = useEnvironment();
11
+ return /* @__PURE__ */ jsxs(Stack, { width: "100%", height: "40px", justifyContent: "space-between", flexDirection: "row", overflow: "hidden", position: "relative", padding: [0, 2], children: [
12
+ /* @__PURE__ */ jsx(Stack, { width: "100%", height: "100%" }),
13
+ /* @__PURE__ */ jsxs(Stack, { flexDirection: "row", gap: 2, height: "100%", width: "auto", alignItems: "center", children: [
14
+ /* @__PURE__ */ jsx(LanguagePopover, {}),
15
+ /* @__PURE__ */ jsx(IconButton, { src: `${host_static_assets}/${environment_assets}/${PATH_ICONS.SETTINGS}`, onClick: handleOpen })
16
+ ] })
17
+ ] });
18
+ }
19
+ export {
20
+ AppBarSettings as A
21
+ };
@@ -0,0 +1 @@
1
+ export { AppBarSettings } from './AppBarSettings';
@@ -0,0 +1,5 @@
1
+ import { MFAuthAppStorybookProps } from './types';
2
+ /**
3
+ * TODO: Documentar
4
+ */
5
+ export declare function MFAuthAppStorybook(props: MFAuthAppStorybookProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { format } from "date-fns";
3
+ import { DomainCountryProvider } from "@m4l/core";
4
+ import { HostThemeProvider, FormatterProvider } from "@m4l/graphics";
5
+ import { fnComponentsOverrides, getUserThemeOptions } from "@m4l/styles";
6
+ function MFAuthAppStorybook(props) {
7
+ const { children } = props;
8
+ const domianCountry = {
9
+ currency: "USD",
10
+ currency_decimal_digits: 2
11
+ };
12
+ const domainCountry = {
13
+ id: 1,
14
+ currency: "USD",
15
+ currency_decimal_digits: 2,
16
+ decimal_symbol: ".",
17
+ thousands_symbol: ","
18
+ };
19
+ return /* @__PURE__ */ jsx(
20
+ HostThemeProvider,
21
+ {
22
+ hostThemeOptions: getUserThemeOptions("light", "patronus"),
23
+ fnComponentsOverrides,
24
+ isMicroFrontEnd: true,
25
+ children: /* @__PURE__ */ jsx(DomainCountryProvider, { ...domainCountry, isMicroFrontEnd: false, children: /* @__PURE__ */ jsx(
26
+ FormatterProvider,
27
+ {
28
+ isMicroFrontEnd: false,
29
+ dateFormatter: {
30
+ formatDate: format
31
+ },
32
+ currencyFormatter: {
33
+ code: domianCountry.currency,
34
+ decimalDigits: domianCountry.currency_decimal_digits
35
+ },
36
+ children
37
+ }
38
+ ) })
39
+ }
40
+ );
41
+ }
42
+ export {
43
+ MFAuthAppStorybook as M
44
+ };
@@ -0,0 +1 @@
1
+ export { MFAuthAppStorybook } from './MFAuthAppStorybook';
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export type MFAuthAppStorybookProps = {
3
+ children: ReactNode;
4
+ };
@@ -0,0 +1,31 @@
1
+ import { ModuleDictionary } from '@m4l/core';
2
+ import { BaseModuleProps } from '../BaseModule';
3
+ import { DeviceType } from '@m4l/graphics';
4
+ export type MFIsolationAppStorybookProps = BaseModuleProps & {
5
+ host_api_local: string;
6
+ host_api_icons?: string;
7
+ database?: string;
8
+ host_api_remote: string;
9
+ host_static_assets: string;
10
+ environment_assets: string;
11
+ onLoad: () => void;
12
+ activeAreasNetwork?: boolean;
13
+ activeCookiesFromNetwork?: boolean;
14
+ appBarSettings?: boolean;
15
+ /**
16
+ * Diccionario de componentes, se puede proporcionar ya el diccionario cargado, para evitar que se llame al endpoint nuevamente.
17
+ */
18
+ moduleDictionaryLoaded?: ModuleDictionary;
19
+ /**
20
+ * Tipo de dispositivo forzado, si no se proporciona se determina automáticamente. Normalmente se usa esta propieadad para pruebas en storybook.
21
+ */
22
+ forcedDeviceType?: DeviceType;
23
+ /**
24
+ * Id del store de las áreas
25
+ */
26
+ areasStoreId?: string;
27
+ /**
28
+ * Determina si se debe usar devtools para el store de las áreas
29
+ */
30
+ areasStoreDevtoolsEnabled?: boolean;
31
+ };
@@ -20,4 +20,4 @@ export declare const MENU_ACTIONS_EMPTY = "menu_action_empty";
20
20
  * Prefijo de la clave que se utiliza cuando un ítem del menú está cargando en React.
21
21
  */
22
22
  export declare const MENU_ACTIONS_ = "menu_action_";
23
- export declare const MENU_ACTIONS_CLASSES: Record<string, string>;
23
+ export declare const MENU_ACTIONS_CLASSES: Record<"selected" | "root" | "menuList" | "menuLoader" | "iconButton" | "headerMenuActions" | "footerMenuActions", string>;
@@ -1,2 +1,2 @@
1
1
  export declare const NO_ITEM_SELECTED_KEY_COMPONENT = "M4LNoItemSelected";
2
- export declare const NO_ITEM_SELECTED_CLASSES: Record<string, string>;
2
+ export declare const NO_ITEM_SELECTED_CLASSES: Record<"root", string>;
@@ -24,8 +24,13 @@ const stepperStyles = {
24
24
  flexDirection: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? "column" : "row",
25
25
  gap: theme.vars.size.baseSpacings.sp8
26
26
  }),
27
+ /**
28
+ * Estilos para el contenido del paso dentro del Stepper.
29
+ */
27
30
  stepContent: ({ ownerState }) => ({
28
- display: ownerState?.isStepVisible ? "block" : "none"
31
+ height: "100%",
32
+ display: ownerState?.isStepVisible ? "flex" : "none",
33
+ flexDirection: "column"
29
34
  }),
30
35
  /**
31
36
  * Estilos para la sección que contiene los botones de acción del Stepper.
@@ -71,8 +76,7 @@ const stepperStyles = {
71
76
  const isLastStep = step === totalSteps - 1;
72
77
  return {
73
78
  cursor: "pointer",
74
- display: "flex",
75
- visibility: ownerState?.isStepVisible ? "visible" : "hidden",
79
+ display: ownerState?.isStepVisible ? "flex" : "none",
76
80
  flexDirection: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? "column" : "row",
77
81
  alignItems: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? "center" : "start",
78
82
  justifyContent: ownerState?.visibleTitle ? "space-between" : "center",
@@ -126,7 +130,7 @@ const stepperStyles = {
126
130
  whiteSpace: "normal",
127
131
  order: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? 1 : 0,
128
132
  "&.M4LTypography-root": {
129
- color: (ownerState?.currentStep ?? 0) > (ownerState?.step ?? 0) ? theme.vars.palette.primary.semanticText : (ownerState?.currentStep ?? 0) === (ownerState?.step ?? 0) ? theme.vars.palette.text.primary : theme.vars.palette.text.secondary,
133
+ color: ownerState?.originalStepIndex !== void 0 && typeof ownerState.originalStepIndex === "number" ? (ownerState.currentStep ?? 0) > ownerState.originalStepIndex ? theme.vars.palette.primary.semanticText : (ownerState.currentStep ?? 0) === ownerState.originalStepIndex ? theme.vars.palette.text.primary : theme.vars.palette.text.secondary : theme.vars.palette.text.secondary,
130
134
  textAlign: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? "center" : "right"
131
135
  }
132
136
  }),
@@ -134,13 +138,12 @@ const stepperStyles = {
134
138
  * Estilos para el indicador numérico de cada paso del Stepper.
135
139
  */
136
140
  indicator: ({ theme, ownerState }) => {
137
- const currentStep = ownerState?.currentStep ?? 0;
138
141
  const step = ownerState?.step ?? 0;
139
142
  const totalSteps = ownerState?.totalSteps ?? 0;
140
- const isCompleted = currentStep > step;
141
- const isCurrent = currentStep === step;
143
+ const isCompleted = ownerState?.isCompleted ?? false;
144
+ const isCurrent = ownerState?.isCurrent ?? false;
145
+ const isValidStep = ownerState?.isValidStep ?? true;
142
146
  const isLastStep = step === totalSteps - 1;
143
- const isValidStep = ownerState?.stepValidationStatus?.[step] ?? true;
144
147
  return {
145
148
  ...ownerState?.orientation === "horizontal" ? {
146
149
  marginTop: theme.generalSettings.isMobile ? "6px" : theme.vars.size.baseSpacings.sp1
@@ -150,7 +153,7 @@ const stepperStyles = {
150
153
  justifyContent: "center",
151
154
  flexShrink: 0,
152
155
  order: ownerState?.orientation === "vertical" || theme.generalSettings.isMobile ? 0 : 1,
153
- background: isCompleted ? ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.primary.toneOpacity : !isValidStep ? theme.vars.palette.error.enabled : ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : isCurrent ? theme.vars.palette.primary.enabled : theme.vars.palette.default.enabled,
156
+ background: !isValidStep && ownerState?.hasBeenValidated ? theme.vars.palette.error.enabled : isCompleted && isValidStep ? ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.primary.toneOpacity : isCurrent ? ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.primary.enabled : ownerState?.indicatorType === "dot" || theme.generalSettings.isMobile ? theme.vars.palette.background.default : theme.vars.palette.default.enabled,
154
157
  borderRadius: theme.vars.size.borderRadius.r2,
155
158
  ...ownerState?.indicatorType === "number" && !theme.generalSettings.isMobile && {
156
159
  boxShadow: isCurrent ? "0 2px 8px 0 rgb(0, 100, 255, 0.16)" : "none"
@@ -178,13 +181,13 @@ const stepperStyles = {
178
181
  * Estilos para el número de texto dentro del indicador numérico del Stepper.
179
182
  */
180
183
  textNumber: ({ theme, ownerState }) => {
181
- const currentStep = ownerState?.currentStep ?? 0;
182
- const step = ownerState?.step ?? 0;
183
- const isCompleted = currentStep > step;
184
- const isCurrent = currentStep === step;
184
+ const isCompleted = ownerState?.isCompleted ?? false;
185
+ const isCurrent = ownerState?.isCurrent ?? false;
186
+ const isValidStep = ownerState?.isValidStep ?? true;
187
+ const hasBeenValidated = ownerState?.hasBeenValidated ?? false;
185
188
  return {
186
189
  "&.M4LTypography-root": {
187
- color: isCompleted || isCurrent ? theme.vars.palette.primary.contrastText : theme.vars.palette.text.primary
190
+ color: !isValidStep && hasBeenValidated ? theme.vars.palette.error.contrastText : isCompleted || isCurrent ? theme.vars.palette.primary.contrastText : theme.vars.palette.text.primary
188
191
  }
189
192
  };
190
193
  },
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Obtiene los valores iniciales de campos específicos del formulario.
3
+ * Se usa para inicializar el ref que trackea cambios en los campos.
4
+ * @param allValues - Todos los valores del formulario (de getValues())
5
+ * @param fields - Lista de nombres de campos de los que queremos obtener valores
6
+ * @returns Objeto con solo los valores de los campos especificados
7
+ * @example
8
+ * const formValues = { name: 'John', age: 25, city: 'NY', country: 'USA' };
9
+ * getInitialFieldValues(formValues, ['name', 'age'])
10
+ * // Retorna: { name: 'John', age: 25 }
11
+ */
12
+ export declare function getInitialFieldValues(allValues: Record<string, any>, fields?: string[]): Record<string, any>;
@@ -0,0 +1,14 @@
1
+ function getInitialFieldValues(allValues, fields = []) {
2
+ if (fields.length === 0) {
3
+ return {};
4
+ }
5
+ return fields.reduce((acc, field) => {
6
+ if (field in allValues) {
7
+ acc[field] = allValues[field];
8
+ }
9
+ return acc;
10
+ }, {});
11
+ }
12
+ export {
13
+ getInitialFieldValues as g
14
+ };
@@ -2,3 +2,5 @@ export { evaluateVisibilityStepCondition } from './evaluateVisibilityStepConditi
2
2
  export { findNextVisibleValidStep } from './findNextVisibleValidStep';
3
3
  export { findPrevVisibleValidStep } from './findPrevVisibleValidStep';
4
4
  export { isLastVisibleValidStep } from './isLastVisibleValidStep';
5
+ export { parseWatchedValues } from './parseWatchedValues';
6
+ export { getInitialFieldValues } from './getInitialFieldValues';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Convierte los valores observados de useWatch en un objeto estructurado con los nombres de campos como keys.
3
+ *
4
+ * useWatch de react-hook-form retorna diferentes estructuras según la cantidad de campos observados:
5
+ * - Un solo campo: retorna el valor directamente
6
+ * - Múltiples campos: retorna un array con los valores en el mismo orden de los campos
7
+ * @param watchValues - Valores observados de useWatch (puede ser un valor único o un array)
8
+ * @param fields - Lista de nombres de campos que se están observando
9
+ * @returns Objeto con los valores actuales mapeados a sus respectivos nombres de campo
10
+ * @example
11
+ * // Para un solo campo
12
+ * parseWatchedValues('John', ['name']) // { name: 'John' }
13
+ *
14
+ * // Para múltiples campos
15
+ * parseWatchedValues(['John', 25], ['name', 'age']) // { name: 'John', age: 25 }
16
+ */
17
+ export declare function parseWatchedValues(watchValues: any, fields: string[]): Record<string, any>;