@m4l/components 9.1.41 → 9.1.42
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.
- package/.storybook/constants.d.ts +11 -0
- package/.storybook/decorators/WithDictionaryContext/contants.d.ts +3 -0
- package/.storybook/decorators/WithDictionaryContext/index.d.ts +1 -0
- package/components/BaseModule/BaseModule.js +3 -1
- package/components/BaseModule/types.d.ts +2 -0
- package/components/CommonActions/components/ActionFormIntro/index.js +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +7 -4
- package/components/MFIsolationApp/types.d.ts +10 -0
- package/components/MenuActions/MenuActions.js +17 -14
- package/components/MenuActions/types.d.ts +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/subcomponents/MyActions/index.js +1 -1
- package/components/mui_extended/Button/Button.js +6 -3
- package/components/mui_extended/LoadingButton/LoadingButton.d.ts +1 -1
- package/components/mui_extended/LoadingButton/LoadingButton.js +17 -55
- package/components/mui_extended/LoadingButton/LoadingButton.styles.js +10 -155
- package/components/mui_extended/LoadingButton/constants.d.ts +5 -0
- package/components/mui_extended/LoadingButton/slots/LoadingButtonEnum.d.ts +1 -3
- package/components/mui_extended/LoadingButton/slots/LoadingButtonEnum.js +1 -3
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +4 -20
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.js +6 -18
- package/components/mui_extended/LoadingButton/types.d.ts +3 -5
- package/components/mui_extended/MenuItem/MenuItem.js +28 -29
- package/components/mui_extended/Popover/Popover.d.ts +1 -1
- package/components/mui_extended/Popover/Popover.js +7 -0
- package/package.json +3 -3
- package/test/TestAppWrapper.d.ts +2 -0
|
@@ -8,6 +8,15 @@ export declare const MODES_ITEMS: {
|
|
|
8
8
|
value: string;
|
|
9
9
|
title: string;
|
|
10
10
|
}[];
|
|
11
|
+
export declare const DEVICE_TYPES: {
|
|
12
|
+
automatic: string;
|
|
13
|
+
mobile: string;
|
|
14
|
+
desktop: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const DEVICE_TYPES_ITEMS: {
|
|
17
|
+
value: string;
|
|
18
|
+
title: string;
|
|
19
|
+
}[];
|
|
11
20
|
export declare const COLORS_THEME: Record<ThemeUserColor, ThemeUserColor>;
|
|
12
21
|
export declare const COLORS_THEME_ITEMS: Record<string, string>[];
|
|
13
22
|
export declare const USER = "carloszapata@gmail.com";
|
|
@@ -17,3 +26,5 @@ export declare const ENVIRONMENT_ASSETS = "d1";
|
|
|
17
26
|
export declare const HOST_API_LOCAL = "http://localhost:3000/domain";
|
|
18
27
|
export declare const HOST_API_REMOTE = "https://lab1.stage.made4labs.com/api/v1/domain";
|
|
19
28
|
export declare const HOST_STATIC_ASSETS = "https://s3.amazonaws.com/static.made4labs/environments";
|
|
29
|
+
export declare const DOMAIN_TOKEN = "lab1";
|
|
30
|
+
export declare const STORYBOOK_MODULE_ID = "login";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WithDictionaryContext';
|
|
@@ -10,7 +10,8 @@ function BaseModule(props) {
|
|
|
10
10
|
moduleNameField,
|
|
11
11
|
skeletonFlags,
|
|
12
12
|
privileges,
|
|
13
|
-
componentsDictionary
|
|
13
|
+
componentsDictionary,
|
|
14
|
+
moduleDictionaryLoaded
|
|
14
15
|
} = props;
|
|
15
16
|
const localeString = useLocales().currentLocale?.localeString;
|
|
16
17
|
return /* @__PURE__ */ jsx(FlagsProvider, { children: /* @__PURE__ */ jsx(
|
|
@@ -21,6 +22,7 @@ function BaseModule(props) {
|
|
|
21
22
|
moduleNameField,
|
|
22
23
|
componentsDictionary,
|
|
23
24
|
currentLang: localeString,
|
|
25
|
+
moduleDictionaryLoaded,
|
|
24
26
|
children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, { flags: skeletonFlags, children: isAuth ? /* @__PURE__ */ jsx(ModulePrivilegesProvider, { queryPrivileges: privileges, children: /* @__PURE__ */ jsx(ModalProvider, { children }) }) : /* @__PURE__ */ jsx(ModalProvider, { children }) })
|
|
25
27
|
}
|
|
26
28
|
) });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModuleDictionary } from '@m4l/core';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
export type BaseModuleProps = {
|
|
3
4
|
moduleId: string;
|
|
@@ -7,4 +8,5 @@ export type BaseModuleProps = {
|
|
|
7
8
|
componentsDictionary: string[];
|
|
8
9
|
isAuth?: boolean;
|
|
9
10
|
children: ReactNode;
|
|
11
|
+
moduleDictionaryLoaded?: ModuleDictionary;
|
|
10
12
|
};
|
|
@@ -4,7 +4,7 @@ import { unstable_HistoryRouter } from "react-router-dom";
|
|
|
4
4
|
import { createBrowserHistory } from "history";
|
|
5
5
|
import EventEmitter from "eventemitter3";
|
|
6
6
|
import NProgress from "nprogress";
|
|
7
|
-
import { LocalesProvider, getLocaleFromNetwork, ResponsiveContainerProvider } from "@m4l/graphics";
|
|
7
|
+
import { LocalesProvider, getLocaleFromNetwork, DeviceTypeProvider, ResponsiveContainerProvider } from "@m4l/graphics";
|
|
8
8
|
import { EnvironmentProvider, HostToolsProvider, NetworkProvider, axiosOperation, AuthProvider } from "@m4l/core";
|
|
9
9
|
import { T as TOAST_CONTAINER_ID } from "./constants.js";
|
|
10
10
|
import { A as AppearanceComponentProvider } from "../../contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
@@ -35,7 +35,9 @@ function MFIsolationApp(props) {
|
|
|
35
35
|
onLoad,
|
|
36
36
|
activeAreasNetwork = false,
|
|
37
37
|
activeCookiesFromNetwork = false,
|
|
38
|
-
observedDivRef
|
|
38
|
+
observedDivRef,
|
|
39
|
+
moduleDictionaryLoaded,
|
|
40
|
+
forcedDeviceType
|
|
39
41
|
} = props;
|
|
40
42
|
const eventEmitter = useMemo(() => new EventEmitter(), []);
|
|
41
43
|
const events_add_listener = useCallback(
|
|
@@ -98,7 +100,7 @@ function MFIsolationApp(props) {
|
|
|
98
100
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
99
101
|
[]
|
|
100
102
|
);
|
|
101
|
-
return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation, children: /* @__PURE__ */ jsx(unstable_HistoryRouter, { history, children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: false, getLocaleFromNetwork, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(MFAuthApp, { user, pwd, children: /* @__PURE__ */ jsxs(
|
|
103
|
+
return /* @__PURE__ */ jsx(EnvironmentProvider, { ...environment, children: /* @__PURE__ */ jsx(HostToolsProvider, { ...hostTools, children: /* @__PURE__ */ jsx(NetworkProvider, { axiosOperation, children: /* @__PURE__ */ jsx(unstable_HistoryRouter, { history, children: /* @__PURE__ */ jsx(LocalesProvider, { isMicroFrontEnd: false, getLocaleFromNetwork, children: /* @__PURE__ */ jsx(DeviceTypeProvider, { forcedDeviceType, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(MFAuthApp, { user, pwd, children: /* @__PURE__ */ jsxs(
|
|
102
104
|
BaseModule,
|
|
103
105
|
{
|
|
104
106
|
moduleId,
|
|
@@ -106,6 +108,7 @@ function MFIsolationApp(props) {
|
|
|
106
108
|
skeletonFlags,
|
|
107
109
|
componentsDictionary,
|
|
108
110
|
moduleNameField,
|
|
111
|
+
moduleDictionaryLoaded,
|
|
109
112
|
children: [
|
|
110
113
|
/* @__PURE__ */ jsx(ToastContainer, { containerId: TOAST_CONTAINER_ID }),
|
|
111
114
|
" ",
|
|
@@ -123,7 +126,7 @@ function MFIsolationApp(props) {
|
|
|
123
126
|
)
|
|
124
127
|
]
|
|
125
128
|
}
|
|
126
|
-
) }) }) }) }) }) }) });
|
|
129
|
+
) }) }) }) }) }) }) }) });
|
|
127
130
|
}
|
|
128
131
|
export {
|
|
129
132
|
MFIsolationApp as M
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ModuleDictionary } from '@m4l/core';
|
|
1
2
|
import { BaseModuleProps } from '../BaseModule';
|
|
3
|
+
import { DeviceType } from '@m4l/graphics';
|
|
2
4
|
export type MFIsolationAppProps = BaseModuleProps & {
|
|
3
5
|
user: string;
|
|
4
6
|
pwd: string;
|
|
@@ -12,4 +14,12 @@ export type MFIsolationAppProps = BaseModuleProps & {
|
|
|
12
14
|
activeAreasNetwork?: boolean;
|
|
13
15
|
activeCookiesFromNetwork?: boolean;
|
|
14
16
|
observedDivRef: Element | Text | null;
|
|
17
|
+
/**
|
|
18
|
+
* Diccionario de componentes, se puede proporcionar ya el diccionario cargado, para evitar que se llame al endpoint nuevamente.
|
|
19
|
+
*/
|
|
20
|
+
moduleDictionaryLoaded?: ModuleDictionary;
|
|
21
|
+
/**
|
|
22
|
+
* Tipo de dispositivo forzado, si no se proporciona se determina automáticamente. Normalmente se usa esta propieadad para pruebas en storybook.
|
|
23
|
+
*/
|
|
24
|
+
forcedDeviceType?: DeviceType;
|
|
15
25
|
};
|
|
@@ -73,6 +73,7 @@ function MenuActions(props) {
|
|
|
73
73
|
}
|
|
74
74
|
return ret;
|
|
75
75
|
}, [menuActions, objItem]);
|
|
76
|
+
const open = Boolean(externalOpen ?? anchorEl);
|
|
76
77
|
return /* @__PURE__ */ jsxs(RootStyled, { ownerState: { ownerState }, children: [
|
|
77
78
|
/* @__PURE__ */ jsx(
|
|
78
79
|
IconButton,
|
|
@@ -83,17 +84,17 @@ function MenuActions(props) {
|
|
|
83
84
|
onClick: handleButtonClick,
|
|
84
85
|
tooltip: toolTip,
|
|
85
86
|
className: iconButtonClassName,
|
|
86
|
-
selected:
|
|
87
|
+
selected: open,
|
|
87
88
|
disabled,
|
|
88
89
|
componentPaletteColor: "default",
|
|
89
90
|
badgeContent
|
|
90
91
|
}
|
|
91
92
|
),
|
|
92
|
-
/* @__PURE__ */ jsxs(
|
|
93
|
+
open && /* @__PURE__ */ jsxs(
|
|
93
94
|
Popover,
|
|
94
95
|
{
|
|
95
96
|
id: "Popover",
|
|
96
|
-
open
|
|
97
|
+
open,
|
|
97
98
|
anchorEl: externalOpen ?? anchorEl,
|
|
98
99
|
onClose: () => handleOpenClose(),
|
|
99
100
|
arrowType,
|
|
@@ -102,17 +103,19 @@ function MenuActions(props) {
|
|
|
102
103
|
},
|
|
103
104
|
...other,
|
|
104
105
|
children: [
|
|
105
|
-
finalActions.length > 0 ? /* @__PURE__ */ jsx(MenuListStyled, { ownerState: { ownerState }, children: finalActions.map((menuAction, index) =>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
finalActions.length > 0 ? /* @__PURE__ */ jsx(MenuListStyled, { ownerState: { ownerState }, children: finalActions.map((menuAction, index) => {
|
|
107
|
+
return /* @__PURE__ */ createElement(
|
|
108
|
+
MenuItem,
|
|
109
|
+
{
|
|
110
|
+
size,
|
|
111
|
+
...menuAction,
|
|
112
|
+
onClick: (e) => {
|
|
113
|
+
handleClick(e, menuAction);
|
|
114
|
+
},
|
|
115
|
+
key: `${MENU_ACTIONS_}${menuAction.label ?? index}`
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}) }) : /* @__PURE__ */ jsx(
|
|
116
119
|
MenuItem,
|
|
117
120
|
{
|
|
118
121
|
size,
|
|
@@ -37,7 +37,7 @@ export interface MenuAction extends Pick<MenuItemProps, 'startIcon' | 'endIcon'
|
|
|
37
37
|
* Propiedades del componente `MenuActions`.
|
|
38
38
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
39
39
|
*/
|
|
40
|
-
export interface MenuActionsProps extends Omit<PopoverProps, 'open'> {
|
|
40
|
+
export interface MenuActionsProps extends Omit<PopoverProps, 'open' | 'anchorEl'> {
|
|
41
41
|
/**
|
|
42
42
|
* Tamaño opcional del menú (pequeño o mediano).
|
|
43
43
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
@@ -53,7 +53,7 @@ function MyActions(props) {
|
|
|
53
53
|
return /* @__PURE__ */ jsxs(ActionsContainer, { children: [
|
|
54
54
|
/* @__PURE__ */ jsx(RHFHelperError, { name: "geometry" }),
|
|
55
55
|
/* @__PURE__ */ jsx(Button, { onClick: onClickCancelLocal, disabled: inEdition, label: getLabel(MAP_GPSTOOLS_DICCTIONARY.ACTION_CANCEL) }),
|
|
56
|
-
/* @__PURE__ */ jsx(ActionFormIntro, { disabled: inEdition })
|
|
56
|
+
/* @__PURE__ */ jsx(ActionFormIntro, { label: "", disabled: inEdition })
|
|
57
57
|
] });
|
|
58
58
|
}
|
|
59
59
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
3
3
|
import { useTheme } from "@mui/material";
|
|
4
4
|
import clsx from "clsx";
|
|
@@ -62,7 +62,7 @@ const Button = forwardRef((props, ref) => {
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
66
|
ButtonRootStyled,
|
|
67
67
|
{
|
|
68
68
|
"aria-disabled": disabled,
|
|
@@ -77,7 +77,10 @@ const Button = forwardRef((props, ref) => {
|
|
|
77
77
|
ownerState: { ...ownerState },
|
|
78
78
|
ref,
|
|
79
79
|
...others,
|
|
80
|
-
children:
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx(TextButtonStyled, { ownerState: { ...ownerState }, color: adjustedColor, children: label }),
|
|
82
|
+
props.children
|
|
83
|
+
]
|
|
81
84
|
}
|
|
82
85
|
);
|
|
83
86
|
});
|
|
@@ -2,4 +2,4 @@ import { LoadingButtonProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Componente LoadingButton que extiende las props de Button
|
|
4
4
|
*/
|
|
5
|
-
export declare const LoadingButton:
|
|
5
|
+
export declare const LoadingButton: (props: LoadingButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
4
|
+
import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
|
|
5
|
+
import { S as SkeletonLoadingButtonStyled, R as RootStyled, C as CircularProgressStyled } from "./slots/LoadingButtonSlots.js";
|
|
6
|
+
import { L as LOADING_BUTTON_KEY_COMPONENT } from "./constants.js";
|
|
7
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
|
-
const LoadingButton =
|
|
8
|
+
const LoadingButton = (props) => {
|
|
9
9
|
const {
|
|
10
10
|
className,
|
|
11
11
|
endIcon,
|
|
12
12
|
label,
|
|
13
13
|
startIcon,
|
|
14
|
-
color = "
|
|
14
|
+
color = "primary",
|
|
15
15
|
disabled = false,
|
|
16
16
|
size = "small",
|
|
17
17
|
variant = "contained",
|
|
@@ -21,73 +21,35 @@ const LoadingButton = forwardRef((props, ref) => {
|
|
|
21
21
|
} = props;
|
|
22
22
|
const { currentSize } = useComponentSize(size);
|
|
23
23
|
const isSkeleton = useModuleSkeleton();
|
|
24
|
-
const theme = useTheme();
|
|
25
24
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
26
|
-
const paletteColor = getPropertyByString(
|
|
27
|
-
theme.vars.palette,
|
|
28
|
-
disabled ? "default" : color || "default",
|
|
29
|
-
theme.vars.palette.default
|
|
30
|
-
);
|
|
31
25
|
const ownerState = {
|
|
32
26
|
size,
|
|
33
27
|
variant,
|
|
34
28
|
disabled,
|
|
35
|
-
paletteColor,
|
|
36
29
|
color,
|
|
37
30
|
loading
|
|
38
31
|
};
|
|
39
32
|
if (isSkeleton) {
|
|
40
33
|
return /* @__PURE__ */ jsx(SkeletonLoadingButtonStyled, { "data-testid": "SkeletonButton", width: skeletonWidth, ownerState: { ...ownerState } });
|
|
41
34
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const adjustedColor = getAdjustedColor(color, variant);
|
|
46
|
-
const renderIcon = (icon, instaceDataTestId) => {
|
|
47
|
-
if (!icon) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
if (typeof icon !== "string") {
|
|
51
|
-
return icon;
|
|
52
|
-
} else {
|
|
53
|
-
return /* @__PURE__ */ jsx(
|
|
54
|
-
LoadingButtonIconStyled,
|
|
55
|
-
{
|
|
56
|
-
color: adjustedColor,
|
|
57
|
-
ownerState: { ...ownerState },
|
|
58
|
-
src: icon,
|
|
59
|
-
alt: "icon",
|
|
60
|
-
size: adjustedSize,
|
|
61
|
-
disabled: loading || disabled,
|
|
62
|
-
instaceDataTestId,
|
|
63
|
-
className: clsx(className)
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
return /* @__PURE__ */ jsxs(
|
|
69
|
-
LoadingButtonRootStyled,
|
|
35
|
+
const classRoot = getComponentSlotRoot(LOADING_BUTTON_KEY_COMPONENT);
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
RootStyled,
|
|
70
38
|
{
|
|
71
|
-
|
|
72
|
-
role: "button",
|
|
73
|
-
startIcon: renderIcon(startIcon, "LoadingButtonStartIcon"),
|
|
74
|
-
endIcon: renderIcon(endIcon, "LoadingButtonEndIcon"),
|
|
75
|
-
className: clsx(className),
|
|
39
|
+
color,
|
|
76
40
|
variant,
|
|
77
41
|
size,
|
|
42
|
+
label,
|
|
78
43
|
disabled: loading || disabled,
|
|
79
|
-
disableRipple: true,
|
|
80
44
|
ownerState: { ...ownerState },
|
|
81
|
-
|
|
45
|
+
className: clsx(className, classRoot),
|
|
46
|
+
startIcon,
|
|
47
|
+
endIcon,
|
|
82
48
|
...others,
|
|
83
|
-
children:
|
|
84
|
-
/* @__PURE__ */ jsx(TextLoadingButtonStyled, { ownerState: { ...ownerState }, color: adjustedColor, children: label }),
|
|
85
|
-
loading === true && /* @__PURE__ */ jsx(CircularProgressStyled, { ownerState: { ...ownerState }, size: adjustedSize })
|
|
86
|
-
]
|
|
49
|
+
children: loading === true && /* @__PURE__ */ jsx(CircularProgressStyled, { color: "primary", ownerState: { ...ownerState }, size: adjustedSize })
|
|
87
50
|
}
|
|
88
51
|
);
|
|
89
|
-
}
|
|
90
|
-
LoadingButton.displayName = "LoadingButton";
|
|
52
|
+
};
|
|
91
53
|
export {
|
|
92
54
|
LoadingButton as L
|
|
93
55
|
};
|
|
@@ -1,161 +1,16 @@
|
|
|
1
1
|
const loadingButtonStyles = {
|
|
2
2
|
/**
|
|
3
|
-
* Estilos para el
|
|
4
|
-
*
|
|
5
|
-
* Maneja los estados de enfoque, hover, activo y deshabilitado, incluyendo colores específicos y comportamientos de fondo.
|
|
3
|
+
* Estilos para el componente Button de M4L.
|
|
4
|
+
* Componente boton con variantes y paletas de colores.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
padding: `0px ${theme.vars.size.baseSpacings.sp2}`,
|
|
12
|
-
boxShadow: "none",
|
|
13
|
-
borderRadius: theme.vars.size.borderRadius.r1,
|
|
14
|
-
// Estilos para la variante 'text'
|
|
15
|
-
...ownerState.variant === "text" && {
|
|
16
|
-
color: ownerState.paletteColor?.semanticText,
|
|
17
|
-
'& [class*="M4LIcon-icon"]': {
|
|
18
|
-
backgroundColor: ownerState.paletteColor?.semanticText
|
|
6
|
+
root: ({ ownerState }) => ({
|
|
7
|
+
...ownerState.loading && {
|
|
8
|
+
"&>.MuiTypography-root": {
|
|
9
|
+
visibility: "hidden"
|
|
19
10
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
backgroundColor: "transparent",
|
|
24
|
-
...ownerState.color === "default" && {
|
|
25
|
-
color: theme.vars.palette.text.primary,
|
|
26
|
-
'& [class*="M4LIcon-icon"]': {
|
|
27
|
-
backgroundColor: theme.vars.palette.text.primary
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
...ownerState.color === "primary" && {
|
|
31
|
-
color: ownerState.paletteColor?.enabled,
|
|
32
|
-
'& [class*="M4LIcon-icon"]': {
|
|
33
|
-
backgroundColor: ownerState.paletteColor?.enabled
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"&:hover": {
|
|
37
|
-
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
38
|
-
},
|
|
39
|
-
"&:active": {
|
|
40
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
41
|
-
},
|
|
42
|
-
"&:focus-visible": {
|
|
43
|
-
boxShadow: "none",
|
|
44
|
-
outline: theme.vars.size.borderStroke.container,
|
|
45
|
-
outlineColor: ownerState.paletteColor?.focusVisible,
|
|
46
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
47
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
// Estilos para la variante 'outlined'
|
|
51
|
-
...ownerState.variant === "outlined" && {
|
|
52
|
-
borderColor: ownerState.paletteColor?.enabled,
|
|
53
|
-
color: ownerState.paletteColor?.semanticText,
|
|
54
|
-
'& [class*="M4LIcon-icon"]': {
|
|
55
|
-
backgroundColor: ownerState.paletteColor?.semanticText
|
|
56
|
-
},
|
|
57
|
-
backgroundColor: "transparent",
|
|
58
|
-
...ownerState.color === "default" && {
|
|
59
|
-
color: theme.vars.palette.text.primary,
|
|
60
|
-
borderColor: ownerState.paletteColor?.enabled,
|
|
61
|
-
'& [class*="M4LIcon-icon"]': {
|
|
62
|
-
backgroundColor: theme.vars.palette.text.primary
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
...ownerState.color === "primary" && {
|
|
66
|
-
color: ownerState.paletteColor?.enabled,
|
|
67
|
-
'& [class*="M4LIcon-icon"]': {
|
|
68
|
-
backgroundColor: ownerState.paletteColor?.enabled
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"&:hover": {
|
|
72
|
-
borderColor: ownerState.paletteColor?.hover,
|
|
73
|
-
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
74
|
-
},
|
|
75
|
-
"&:active": {
|
|
76
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity,
|
|
77
|
-
borderColor: ownerState.paletteColor?.active
|
|
78
|
-
},
|
|
79
|
-
"&:focus-visible": {
|
|
80
|
-
boxShadow: "none",
|
|
81
|
-
outline: theme.vars.size.borderStroke.container,
|
|
82
|
-
outlineColor: ownerState.paletteColor?.focusVisible,
|
|
83
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
84
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity,
|
|
85
|
-
borderColor: ownerState.paletteColor?.active
|
|
11
|
+
"&>.MuiButton-icon": {
|
|
12
|
+
visibility: "hidden"
|
|
86
13
|
}
|
|
87
|
-
},
|
|
88
|
-
// Estilos para la variante 'contained'
|
|
89
|
-
...ownerState.variant === "contained" && {
|
|
90
|
-
backgroundColor: ownerState.paletteColor?.enabled,
|
|
91
|
-
color: ownerState.paletteColor?.contrastText,
|
|
92
|
-
...ownerState.color === "default" && {
|
|
93
|
-
color: theme.vars.palette.text.primary
|
|
94
|
-
},
|
|
95
|
-
"&:hover": {
|
|
96
|
-
backgroundColor: ownerState.paletteColor?.hover
|
|
97
|
-
},
|
|
98
|
-
"&:active": {
|
|
99
|
-
backgroundColor: ownerState.paletteColor?.active
|
|
100
|
-
},
|
|
101
|
-
"&:focus-visible": {
|
|
102
|
-
boxShadow: "none",
|
|
103
|
-
outline: theme.vars.size.borderStroke.container,
|
|
104
|
-
outlineColor: theme.vars.palette.border.main,
|
|
105
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
106
|
-
backgroundColor: ownerState.paletteColor?.active
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
// Estilo para el texto dentro del botón
|
|
110
|
-
"& span": {
|
|
111
|
-
margin: "0px"
|
|
112
|
-
},
|
|
113
|
-
// Styles for small button size
|
|
114
|
-
...ownerState.size === "small" && {
|
|
115
|
-
...theme.generalSettings.isMobile ? {
|
|
116
|
-
height: theme.vars.size.mobile.small.action,
|
|
117
|
-
minHeight: theme.vars.size.mobile.small.action
|
|
118
|
-
} : {
|
|
119
|
-
height: theme.vars.size.desktop.small.action,
|
|
120
|
-
minHeight: theme.vars.size.desktop.small.action
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
// Styles for medium button size
|
|
124
|
-
...ownerState.size === "medium" && {
|
|
125
|
-
...theme.generalSettings.isMobile ? {
|
|
126
|
-
height: theme.vars.size.mobile.medium.action,
|
|
127
|
-
minHeight: theme.vars.size.mobile.medium.action
|
|
128
|
-
} : {
|
|
129
|
-
height: theme.vars.size.desktop.medium.action,
|
|
130
|
-
minHeight: theme.vars.size.desktop.medium.action
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}),
|
|
134
|
-
/**
|
|
135
|
-
* Estilos para el ícono dentro del botón.
|
|
136
|
-
* Ajusta la visibilidad para los estados de carga y deshabilitado.
|
|
137
|
-
*/
|
|
138
|
-
loadingButtonIcon: ({ theme, ownerState }) => ({
|
|
139
|
-
...ownerState.loading === true && {
|
|
140
|
-
visibility: "hidden"
|
|
141
|
-
},
|
|
142
|
-
...ownerState.disabled === true && {
|
|
143
|
-
'& [class*="M4LIcon-icon"]': {
|
|
144
|
-
backgroundColor: theme.vars.palette.text.disabled
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}),
|
|
148
|
-
/**
|
|
149
|
-
* Estilos para el texto del botón.
|
|
150
|
-
* Incluye ajustes para los estados de carga y deshabilitado.
|
|
151
|
-
*/
|
|
152
|
-
textLoadingButton: ({ theme, ownerState }) => ({
|
|
153
|
-
...theme.typography.bodyDens,
|
|
154
|
-
...ownerState.loading === true && {
|
|
155
|
-
visibility: "hidden"
|
|
156
|
-
},
|
|
157
|
-
...ownerState.disabled === true && {
|
|
158
|
-
color: theme.vars.palette.text.disabled
|
|
159
14
|
}
|
|
160
15
|
}),
|
|
161
16
|
/**
|
|
@@ -190,9 +45,9 @@ const loadingButtonStyles = {
|
|
|
190
45
|
* Estilos para el componente CircularProgress.
|
|
191
46
|
* Posiciona el cargador dentro del botón y aplica un color consistente.
|
|
192
47
|
*/
|
|
193
|
-
circularProgress: ({ theme }) => ({
|
|
48
|
+
circularProgress: ({ theme, ownerState }) => ({
|
|
194
49
|
position: "absolute",
|
|
195
|
-
color: theme.vars.palette.text.disabled
|
|
50
|
+
color: ownerState.color === "default" ? theme.vars.palette.text.disabled : theme.vars.palette[ownerState.color || "default"].main
|
|
196
51
|
})
|
|
197
52
|
};
|
|
198
53
|
export {
|
|
@@ -6,3 +6,8 @@
|
|
|
6
6
|
* @default 'M4LLoadingButton'
|
|
7
7
|
*/
|
|
8
8
|
export declare const LOADING_BUTTON_KEY_COMPONENT = "M4LLoadingButton";
|
|
9
|
+
/**
|
|
10
|
+
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
11
|
+
* tener la necesidad de agregar valores en !important.
|
|
12
|
+
*/
|
|
13
|
+
export declare const LOADING_BUTTON_CLASS_NAME_SPECIFY = "M4lclassCssSpecificityLoadingButton";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare enum LoadingButtonSlots {
|
|
2
|
-
|
|
2
|
+
root = "root",
|
|
3
3
|
skeletonLoadingButton = "skeletonLoadingButton",
|
|
4
|
-
loadingButtonIcon = "loadingButtonIcon",
|
|
5
|
-
textLoadingButton = "textLoadingButton",
|
|
6
4
|
circularProgress = "circularProgress"
|
|
7
5
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
var LoadingButtonSlots = /* @__PURE__ */ ((LoadingButtonSlots2) => {
|
|
2
|
-
LoadingButtonSlots2["
|
|
2
|
+
LoadingButtonSlots2["root"] = "root";
|
|
3
3
|
LoadingButtonSlots2["skeletonLoadingButton"] = "skeletonLoadingButton";
|
|
4
|
-
LoadingButtonSlots2["loadingButtonIcon"] = "loadingButtonIcon";
|
|
5
|
-
LoadingButtonSlots2["textLoadingButton"] = "textLoadingButton";
|
|
6
4
|
LoadingButtonSlots2["circularProgress"] = "circularProgress";
|
|
7
5
|
return LoadingButtonSlots2;
|
|
8
6
|
})(LoadingButtonSlots || {});
|
|
@@ -2,37 +2,21 @@
|
|
|
2
2
|
* `LoadingButtonRootStyled`
|
|
3
3
|
* Componente raíz del botón que usa el componente `Button` de material UI.
|
|
4
4
|
*/
|
|
5
|
-
declare const
|
|
6
|
-
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
7
|
-
}, "children" | "size" | "action" | "color" | "style" | "disabled" | "variant" | "sx" | "classes" | "className" | "tabIndex" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "href" | "startIcon" | "endIcon" | "fullWidth" | "disableElevation">, "children" | "value" | "ref" | "title" | "size" | "name" | "id" | "type" | "action" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "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" | "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" | "onResize" | "onResizeCapture" | "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" | "form" | "key" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "startIcon" | "endIcon" | "fullWidth" | "disableElevation"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
5
|
+
declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "children" | "value" | "title" | "component" | "size" | "name" | "id" | "type" | "action" | "hidden" | "color" | "content" | "style" | "disabled" | "variant" | "translate" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "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" | "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" | "onResize" | "onResizeCapture" | "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" | "form" | "label" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "startIcon" | "endIcon" | "skeletonWidth" | "fullWidth" | "disableElevation" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
8
6
|
ownerState: Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown>;
|
|
9
7
|
}, {}, {}>;
|
|
10
8
|
/**
|
|
11
9
|
* `SkeletonLoadingButtonStyled`
|
|
12
10
|
* Esqueleto de carga del botón que usa el componente `Skeleton` de M4L.
|
|
13
11
|
*/
|
|
14
|
-
declare const SkeletonLoadingButtonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Skeleton/types').SkeletonProps, keyof import('../../Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
15
|
-
ownerState: Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown>;
|
|
16
|
-
}, {}, {}>;
|
|
17
|
-
/**
|
|
18
|
-
* `LoadingButtonIconStyled`
|
|
19
|
-
* Ícono estilizado del botón (inicio o fin) que usa el componente `Icon` de M4L.
|
|
20
|
-
*/
|
|
21
|
-
declare const LoadingButtonIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../..').IconProps, keyof import('../../..').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
22
|
-
ownerState: Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown>;
|
|
23
|
-
}, {}, {}>;
|
|
24
|
-
/**
|
|
25
|
-
* `TextLoadingButtonStyled`
|
|
26
|
-
* Texto estilizado del botón del componente `Typography` de M4L.
|
|
27
|
-
*/
|
|
28
|
-
declare const TextLoadingButtonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Typography/types').TypographyProps, keyof import('../../Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
12
|
+
declare const SkeletonLoadingButtonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Skeleton/types').SkeletonProps, keyof import('../../Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
29
13
|
ownerState: Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown>;
|
|
30
14
|
}, {}, {}>;
|
|
31
15
|
/**
|
|
32
16
|
* `CircularProgressStyled`
|
|
33
17
|
* Indicador de progreso circular estilizado del componente `CircularProgress` de M4L.
|
|
34
18
|
*/
|
|
35
|
-
declare const CircularProgressStyled: import('@emotion/styled').StyledComponent<Pick<import('../../CircularProgress/types').CircularProgressProps, keyof import('../../CircularProgress/types').CircularProgressProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
19
|
+
declare const CircularProgressStyled: import('@emotion/styled').StyledComponent<Pick<import('../../CircularProgress/types').CircularProgressProps, keyof import('../../CircularProgress/types').CircularProgressProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown> & {
|
|
36
20
|
ownerState: Partial<import('../types').LoadingButtonOwnerState> & Record<string, unknown>;
|
|
37
21
|
}, {}, {}>;
|
|
38
|
-
export {
|
|
22
|
+
export { RootStyled, SkeletonLoadingButtonStyled, CircularProgressStyled, };
|
|
@@ -1,36 +1,24 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { Button } from "@mui/material";
|
|
3
2
|
import { S as Skeleton } from "../../Skeleton/Skeleton.js";
|
|
4
|
-
import { I as Icon } from "../../../Icon/Icon.js";
|
|
5
|
-
import { T as Typography } from "../../Typography/Typography.js";
|
|
6
3
|
import { C as CircularProgress } from "../../CircularProgress/CircularProgress.js";
|
|
7
4
|
import { l as loadingButtonStyles } from "../LoadingButton.styles.js";
|
|
8
5
|
import { L as LOADING_BUTTON_KEY_COMPONENT } from "../constants.js";
|
|
9
6
|
import { L as LoadingButtonSlots } from "./LoadingButtonEnum.js";
|
|
10
|
-
|
|
7
|
+
import { B as Button } from "../../Button/Button.js";
|
|
8
|
+
const RootStyled = styled(Button, {
|
|
11
9
|
name: LOADING_BUTTON_KEY_COMPONENT,
|
|
12
|
-
slot: LoadingButtonSlots.
|
|
13
|
-
})(loadingButtonStyles?.
|
|
10
|
+
slot: LoadingButtonSlots.root
|
|
11
|
+
})(loadingButtonStyles?.root);
|
|
14
12
|
const SkeletonLoadingButtonStyled = styled(Skeleton, {
|
|
15
13
|
name: LOADING_BUTTON_KEY_COMPONENT,
|
|
16
14
|
slot: LoadingButtonSlots.skeletonLoadingButton
|
|
17
15
|
})(loadingButtonStyles?.skeletonLoadingButton);
|
|
18
|
-
const LoadingButtonIconStyled = styled(Icon, {
|
|
19
|
-
name: LOADING_BUTTON_KEY_COMPONENT,
|
|
20
|
-
slot: LoadingButtonSlots.loadingButtonIcon
|
|
21
|
-
})(loadingButtonStyles?.loadingButtonIcon);
|
|
22
|
-
const TextLoadingButtonStyled = styled(Typography, {
|
|
23
|
-
name: LOADING_BUTTON_KEY_COMPONENT,
|
|
24
|
-
slot: LoadingButtonSlots.textLoadingButton
|
|
25
|
-
})(loadingButtonStyles?.textLoadingButton);
|
|
26
16
|
const CircularProgressStyled = styled(CircularProgress, {
|
|
27
17
|
name: LOADING_BUTTON_KEY_COMPONENT,
|
|
28
18
|
slot: LoadingButtonSlots.circularProgress
|
|
29
19
|
})(loadingButtonStyles?.circularProgress);
|
|
30
20
|
export {
|
|
31
21
|
CircularProgressStyled as C,
|
|
32
|
-
|
|
33
|
-
SkeletonLoadingButtonStyled as S
|
|
34
|
-
TextLoadingButtonStyled as T,
|
|
35
|
-
LoadingButtonIconStyled as a
|
|
22
|
+
RootStyled as R,
|
|
23
|
+
SkeletonLoadingButtonStyled as S
|
|
36
24
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
2
|
-
import {
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
3
|
import { LOADING_BUTTON_KEY_COMPONENT } from './constants';
|
|
4
4
|
import { LoadingButtonSlots } from './slots/LoadingButtonEnum';
|
|
5
5
|
import { ButtonProps } from '../Button/types';
|
|
6
|
-
export interface LoadingButtonProps extends
|
|
7
|
-
label?: string;
|
|
6
|
+
export interface LoadingButtonProps extends ButtonProps {
|
|
8
7
|
loading?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export interface LoadingButtonOwnerState extends Pick<LoadingButtonProps, 'size' | 'variant' | 'color' | 'disabled' | 'loading'> {
|
|
11
10
|
disabled?: boolean;
|
|
12
|
-
paletteColor: PaletteColor;
|
|
13
11
|
}
|
|
14
12
|
export type LoadingButtonSlotsType = keyof typeof LoadingButtonSlots;
|
|
15
|
-
export type LoadingButtonStyles =
|
|
13
|
+
export type LoadingButtonStyles = OverridesStyleRules<LoadingButtonSlotsType, typeof LOADING_BUTTON_KEY_COMPONENT, Theme>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createElement } from "react";
|
|
3
2
|
import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
4
3
|
import { useTheme } from "@mui/material";
|
|
5
4
|
import clsx from "clsx";
|
|
@@ -12,7 +11,6 @@ const MenuItem = (props) => {
|
|
|
12
11
|
const {
|
|
13
12
|
startIcon,
|
|
14
13
|
endIcon,
|
|
15
|
-
key,
|
|
16
14
|
label,
|
|
17
15
|
value,
|
|
18
16
|
skeletonWidth = "100%",
|
|
@@ -74,41 +72,42 @@ const MenuItem = (props) => {
|
|
|
74
72
|
};
|
|
75
73
|
const checkedIcon = "https://s3.us-east-1.amazonaws.com/static.made4labs/environments/d1/frontend/components/menu_item/checked.svg";
|
|
76
74
|
const hasCheckedIcon = checked && checkedIcon;
|
|
77
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsxs(
|
|
78
76
|
MenuItemRootStyled,
|
|
79
77
|
{
|
|
80
78
|
...other,
|
|
81
|
-
key,
|
|
82
79
|
value,
|
|
83
80
|
ownerState: { ...ownerState },
|
|
84
81
|
disabled,
|
|
85
82
|
disableRipple: true,
|
|
86
83
|
className: clsx("M4LMenuItemRoot", classes.root, className),
|
|
87
|
-
"data-testid": "MenuItemRoot"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
84
|
+
"data-testid": "MenuItemRoot",
|
|
85
|
+
children: [
|
|
86
|
+
hasCheckedIcon && /* @__PURE__ */ jsx(
|
|
87
|
+
MenuItemIconCheckedStyled,
|
|
88
|
+
{
|
|
89
|
+
src: checkedIcon,
|
|
90
|
+
ownerState: { ...ownerState },
|
|
91
|
+
className: classes.menuItemIconChecked
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState }, className: classes.menuItemContainer, children: [
|
|
95
|
+
renderIcon(startIcon, "MenuItemStartIcon", getComponentSlotRoot("MenuItemStartIcon")),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
MenuItemTypographyStyled,
|
|
98
|
+
{
|
|
99
|
+
ownerState: { ...ownerState },
|
|
100
|
+
variant: "body",
|
|
101
|
+
size: adjustedSize,
|
|
102
|
+
"data-testid": "MenuItemLabel",
|
|
103
|
+
className: classes.menuItemTypography,
|
|
104
|
+
children: label
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
renderIcon(endIcon, "MenuItemEndIcon", getComponentSlotRoot("MenuItemEndIcon"))
|
|
108
|
+
] })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
112
111
|
);
|
|
113
112
|
};
|
|
114
113
|
export {
|
|
@@ -19,4 +19,4 @@ import { PopoverProps } from './types';
|
|
|
19
19
|
* @updatedAt 2024-12-27 08:28:37 - automatic
|
|
20
20
|
* @updatedUser Andrés Quintero - automatic
|
|
21
21
|
*/
|
|
22
|
-
export declare const Popover: (props: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const Popover: (props: PopoverProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -12,8 +12,14 @@ const Popover = (props) => {
|
|
|
12
12
|
instaceDataTestId,
|
|
13
13
|
anchorOrigin = { vertical: "bottom", horizontal: "right" },
|
|
14
14
|
transformOrigin = { vertical: "top", horizontal: "right" },
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
arrowType = "no-arrow",
|
|
17
|
+
open,
|
|
15
18
|
...other
|
|
16
19
|
} = props;
|
|
20
|
+
if (!open) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
17
23
|
return (
|
|
18
24
|
/* PopoverRoot: Contenedor principal del componente, es usado para aplicar los estilos css de los
|
|
19
25
|
overrides que provienen del objeto del tema. Se usa para garantizar de que estos estilos no se
|
|
@@ -22,6 +28,7 @@ const Popover = (props) => {
|
|
|
22
28
|
PopoverRootStyled,
|
|
23
29
|
{
|
|
24
30
|
ownerState: {},
|
|
31
|
+
open,
|
|
25
32
|
className: clsx(className, POPOVER_CLASS_NAME_SPECIFY),
|
|
26
33
|
"data-testid": "PopoverRoot",
|
|
27
34
|
anchorOrigin,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.42",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"lint-staged": {
|
|
6
6
|
"*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"zustand": "4.3.6"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@m4l/core": "^2.0.
|
|
56
|
-
"@m4l/graphics": "
|
|
55
|
+
"@m4l/core": "^2.0.15",
|
|
56
|
+
"@m4l/graphics": "7.0.8",
|
|
57
57
|
"@m4l/styles": "^7.1.18",
|
|
58
58
|
"@mui/lab": "5.0.0-alpha.173",
|
|
59
59
|
"@mui/material": "5.16.7",
|