@m4l/components 9.1.87 → 9.1.88
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/components/MenuActions/MenuActions.d.ts +1 -1
- package/components/MenuActions/MenuActions.js +18 -2
- package/components/MenuActions/MenuActions.styles.js +17 -4
- package/components/MenuActions/slots/MenuActionsEnum.d.ts +3 -1
- package/components/MenuActions/slots/MenuActionsEnum.js +2 -0
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +6 -0
- package/components/MenuActions/slots/MenuActionsSlots.js +10 -0
- package/components/MenuActions/types.d.ts +11 -3
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { MenuActionsProps } from './types';
|
|
|
7
7
|
* y estilos configurables.
|
|
8
8
|
* @author cesar - automatic
|
|
9
9
|
* @createdAt 2024-12-17 15:41:39 - automatic
|
|
10
|
-
* @updatedAt 2025-01-
|
|
10
|
+
* @updatedAt 2025-01-27 09:46:55 - automatic
|
|
11
11
|
* @updatedUser cesar - automatic
|
|
12
12
|
*/
|
|
13
13
|
export declare function MenuActions(props: MenuActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useMemo } from "react";
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
@@ -7,7 +7,7 @@ import { M as MenuItem } from "../mui_extended/MenuItem/MenuItem.js";
|
|
|
7
7
|
import { I as ICON_PATH, a as ICONS, M as MENU_ACTIONS_ } from "./constants.js";
|
|
8
8
|
import { g as getMenuActionsDictionary, D as DICTIONARY } from "./dictionary.js";
|
|
9
9
|
import { M as MenuDivider } from "../mui_extended/MenuDivider/MenuDivider.js";
|
|
10
|
-
import { R as RootStyled, I as IconButtonStyled, M as MenuListStyled, a as MenuLoaderStyled } from "./slots/MenuActionsSlots.js";
|
|
10
|
+
import { R as RootStyled, I as IconButtonStyled, M as MenuListStyled, a as MenuLoaderStyled, H as HeaderMenuActionsStyled, F as FooterMenuActionsStyled } from "./slots/MenuActionsSlots.js";
|
|
11
11
|
import { C as CircularProgress } from "../mui_extended/CircularProgress/CircularProgress.js";
|
|
12
12
|
function MenuActions(props) {
|
|
13
13
|
const {
|
|
@@ -28,6 +28,8 @@ function MenuActions(props) {
|
|
|
28
28
|
paperProps = {},
|
|
29
29
|
color = "primary",
|
|
30
30
|
actionKey,
|
|
31
|
+
header,
|
|
32
|
+
footer,
|
|
31
33
|
...other
|
|
32
34
|
} = props;
|
|
33
35
|
const { currentSize } = useComponentSize(size);
|
|
@@ -69,7 +71,17 @@ function MenuActions(props) {
|
|
|
69
71
|
if (!finalActions.length) {
|
|
70
72
|
return /* @__PURE__ */ jsx(MenuItem, { disabled: true, role: "menu-no-actions", label: getLabel(getMenuActionsDictionary(DICTIONARY.no_actions_label)) });
|
|
71
73
|
}
|
|
74
|
+
const renderHeader = () => {
|
|
75
|
+
return /* @__PURE__ */ jsx(HeaderMenuActionsStyled, { ownerState: {}, children: header });
|
|
76
|
+
};
|
|
77
|
+
const renderFooter = () => {
|
|
78
|
+
return /* @__PURE__ */ jsx(FooterMenuActionsStyled, { ownerState: {}, children: footer });
|
|
79
|
+
};
|
|
72
80
|
return /* @__PURE__ */ jsxs(MenuListStyled, { ownerState: { ownerState }, children: [
|
|
81
|
+
header && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
+
renderHeader(),
|
|
83
|
+
/* @__PURE__ */ jsx(MenuDivider, { variant: "solid", size })
|
|
84
|
+
] }),
|
|
73
85
|
finalActions.map((menuAction, index) => {
|
|
74
86
|
const key = actionKey ?? index;
|
|
75
87
|
switch (menuAction.type) {
|
|
@@ -94,6 +106,10 @@ function MenuActions(props) {
|
|
|
94
106
|
return null;
|
|
95
107
|
}
|
|
96
108
|
}),
|
|
109
|
+
footer && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
110
|
+
/* @__PURE__ */ jsx(MenuDivider, { variant: "solid", size }),
|
|
111
|
+
renderFooter()
|
|
112
|
+
] }),
|
|
97
113
|
endListElement && endListElement
|
|
98
114
|
] });
|
|
99
115
|
};
|
|
@@ -3,7 +3,7 @@ const menuActionsStyles = {
|
|
|
3
3
|
* Estilos para el contenedor raíz del menú.
|
|
4
4
|
* @author Andrés Quintero - automatic
|
|
5
5
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
6
|
-
* @updatedAt 2025-01-
|
|
6
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
7
7
|
* @updatedUser cesar - automatic
|
|
8
8
|
*/
|
|
9
9
|
root: () => ({
|
|
@@ -13,7 +13,7 @@ const menuActionsStyles = {
|
|
|
13
13
|
* Estilos para el MenuList
|
|
14
14
|
* @author Andrés Quintero - automatic
|
|
15
15
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
16
|
-
* @updatedAt 2025-01-
|
|
16
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
17
17
|
* @updatedUser cesar - automatic
|
|
18
18
|
*/
|
|
19
19
|
menuList: ({ theme }) => ({
|
|
@@ -31,7 +31,7 @@ const menuActionsStyles = {
|
|
|
31
31
|
* Estilos para el MenuLoader
|
|
32
32
|
* @author cesar - automatic
|
|
33
33
|
* @createdAt 2025-01-20 15:47:07 - automatic
|
|
34
|
-
* @updatedAt 2025-01-
|
|
34
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
35
35
|
* @updatedUser cesar - automatic
|
|
36
36
|
*/
|
|
37
37
|
menuLoader: () => ({
|
|
@@ -42,7 +42,7 @@ const menuActionsStyles = {
|
|
|
42
42
|
* Estilos para el IconButton
|
|
43
43
|
* @author cesar - automatic
|
|
44
44
|
* @createdAt 2025-01-20 16:37:00 - automatic
|
|
45
|
-
* @updatedAt 2025-01-
|
|
45
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
46
46
|
* @updatedUser cesar - automatic
|
|
47
47
|
*/
|
|
48
48
|
iconButton: ({ theme, ownerState }) => ({
|
|
@@ -57,6 +57,19 @@ const menuActionsStyles = {
|
|
|
57
57
|
'& [class*="M4LIcon-icon"]': {
|
|
58
58
|
backgroundColor: ownerState.selected ? theme.vars.palette[ownerState.paletteColor ?? "default"].selected : void 0
|
|
59
59
|
}
|
|
60
|
+
}),
|
|
61
|
+
/**
|
|
62
|
+
* Estilos para el HeaderMenuActions
|
|
63
|
+
* @author cesar - automatic
|
|
64
|
+
* @createdAt 2025-01-26 23:53:56 - automatic
|
|
65
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
66
|
+
* @updatedUser cesar - automatic
|
|
67
|
+
*/
|
|
68
|
+
headerMenuActions: () => ({
|
|
69
|
+
width: "100%"
|
|
70
|
+
}),
|
|
71
|
+
footerMenuActions: () => ({
|
|
72
|
+
width: "100%"
|
|
60
73
|
})
|
|
61
74
|
};
|
|
62
75
|
export {
|
|
@@ -3,6 +3,8 @@ var MenuActionsSlots = /* @__PURE__ */ ((MenuActionsSlots2) => {
|
|
|
3
3
|
MenuActionsSlots2["menuList"] = "menuList";
|
|
4
4
|
MenuActionsSlots2["menuLoader"] = "menuLoader";
|
|
5
5
|
MenuActionsSlots2["iconButton"] = "iconButton";
|
|
6
|
+
MenuActionsSlots2["headerMenuActions"] = "headerMenuActions";
|
|
7
|
+
MenuActionsSlots2["footerMenuActions"] = "footerMenuActions";
|
|
6
8
|
return MenuActionsSlots2;
|
|
7
9
|
})(MenuActionsSlots || {});
|
|
8
10
|
export {
|
|
@@ -24,3 +24,9 @@ export declare const MenuLoaderStyled: import('@emotion/styled').StyledComponent
|
|
|
24
24
|
export declare const IconButtonStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/IconButton/types').IconButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>, "children" | "value" | "title" | "component" | "size" | "name" | "id" | "type" | "selected" | "action" | "hidden" | "content" | "style" | "icon" | "tooltip" | "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" | "placement" | "form" | "src" | "rotationAngle" | "tooltipContent" | "instaceDataTestId" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "componentPaletteColor" | "badgeContent" | "dictionaryTooltipId" | keyof import('react').RefAttributes<HTMLButtonElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').MenuActionsOwnerState> & Record<string, unknown> & {
|
|
25
25
|
ownerState: Partial<import('../types').MenuActionsOwnerState> & Record<string, unknown>;
|
|
26
26
|
}, {}, {}>;
|
|
27
|
+
export declare const HeaderMenuActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').MenuActionsOwnerState> & Record<string, unknown> & {
|
|
28
|
+
ownerState: Partial<import('../types').MenuActionsOwnerState> & Record<string, unknown>;
|
|
29
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
30
|
+
export declare const FooterMenuActionsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').MenuActionsOwnerState> & Record<string, unknown> & {
|
|
31
|
+
ownerState: Partial<import('../types').MenuActionsOwnerState> & Record<string, unknown>;
|
|
32
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
@@ -20,7 +20,17 @@ const IconButtonStyled = styled(IconButton, {
|
|
|
20
20
|
name: MENU_ACTIONS_KEY_COMPONENT,
|
|
21
21
|
slot: MenuActionsSlots.iconButton
|
|
22
22
|
})(menuActionsStyles?.iconButton);
|
|
23
|
+
const HeaderMenuActionsStyled = styled("div", {
|
|
24
|
+
name: MENU_ACTIONS_KEY_COMPONENT,
|
|
25
|
+
slot: MenuActionsSlots.headerMenuActions
|
|
26
|
+
})(menuActionsStyles?.headerMenuActions);
|
|
27
|
+
const FooterMenuActionsStyled = styled("div", {
|
|
28
|
+
name: MENU_ACTIONS_KEY_COMPONENT,
|
|
29
|
+
slot: MenuActionsSlots.footerMenuActions
|
|
30
|
+
})(menuActionsStyles?.footerMenuActions);
|
|
23
31
|
export {
|
|
32
|
+
FooterMenuActionsStyled as F,
|
|
33
|
+
HeaderMenuActionsStyled as H,
|
|
24
34
|
IconButtonStyled as I,
|
|
25
35
|
MenuListStyled as M,
|
|
26
36
|
RootStyled as R,
|
|
@@ -13,7 +13,7 @@ import { MENU_ACTIONS_KEY_COMPONENT } from './constants';
|
|
|
13
13
|
* onClick - Función a ejecutar al hacer clic en la acción.
|
|
14
14
|
* @author Andrés Quintero - automatic
|
|
15
15
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
16
|
-
* @updatedAt 2025-01-
|
|
16
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
17
17
|
* @updatedUser cesar - automatic
|
|
18
18
|
*/
|
|
19
19
|
export interface ComponentActionProps {
|
|
@@ -96,7 +96,7 @@ export interface MenuActionsProps extends Omit<PopoverProps, 'open' | 'anchorEl'
|
|
|
96
96
|
* Acciones del menú, puede ser un array o una función que genere acciones.
|
|
97
97
|
* @author Andrés Quintero - automatic
|
|
98
98
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
99
|
-
* @updatedAt 2025-01-
|
|
99
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
100
100
|
* @updatedUser cesar - automatic
|
|
101
101
|
*/
|
|
102
102
|
menuActions: MenuAction[] | ((row: any) => MenuAction[]);
|
|
@@ -159,7 +159,7 @@ export interface MenuActionsProps extends Omit<PopoverProps, 'open' | 'anchorEl'
|
|
|
159
159
|
* Función externa para cerrar el menú.
|
|
160
160
|
* @author Andrés Quintero - automatic
|
|
161
161
|
* @createdAt 2024-12-27 08:27:30 - automatic
|
|
162
|
-
* @updatedAt 2025-01-
|
|
162
|
+
* @updatedAt 2025-01-26 23:53:57 - automatic
|
|
163
163
|
* @updatedUser cesar - automatic
|
|
164
164
|
*/
|
|
165
165
|
externalClose?: (element: null | HTMLDivElement) => void;
|
|
@@ -191,6 +191,14 @@ export interface MenuActionsProps extends Omit<PopoverProps, 'open' | 'anchorEl'
|
|
|
191
191
|
* Define la clave de la acción.
|
|
192
192
|
*/
|
|
193
193
|
actionKey?: string;
|
|
194
|
+
/**
|
|
195
|
+
* agrega un header al menú
|
|
196
|
+
*/
|
|
197
|
+
header?: ReactNode;
|
|
198
|
+
/**
|
|
199
|
+
* agrega un footer al menú
|
|
200
|
+
*/
|
|
201
|
+
footer?: ReactNode;
|
|
194
202
|
}
|
|
195
203
|
/**
|
|
196
204
|
* Estado del propietario para `MenuActions`.
|