@m4l/components 9.1.87 → 9.1.89
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/@types/types.d.ts +9 -1
- package/components/Chip/Chip.js +3 -1
- package/components/Chip/ChipStyles.js +19 -14
- package/components/Chip/types.d.ts +8 -3
- 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/components/hook-form/RHFDateTime/RHFDateTime.d.ts +4 -0
- package/components/hook-form/RHFDateTime/RHFDateTime.js +39 -86
- package/components/hook-form/RHFDateTime/RHFDateTime.styles.d.ts +2 -0
- package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +17 -0
- package/components/hook-form/RHFDateTime/constants.d.ts +1 -0
- package/components/hook-form/RHFDateTime/constants.js +4 -0
- package/components/hook-form/RHFDateTime/slots/RHFDateTimeEnum.d.ts +3 -0
- package/components/hook-form/RHFDateTime/slots/RHFDateTimeEnum.js +7 -0
- package/components/hook-form/RHFDateTime/slots/RHFDateTimeSlots.d.ts +1 -0
- package/components/hook-form/RHFDateTime/slots/RHFDateTimeSlots.js +9 -0
- package/components/hook-form/RHFDateTime/tests/RHFDateTime.test.d.ts +1 -0
- package/components/hook-form/RHFDateTime/types.d.ts +13 -12
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +1 -5
- package/components/mui_extended/DateTimePicker/DateTimePicker.d.ts +33 -0
- package/components/mui_extended/DateTimePicker/DateTimePicker.js +154 -0
- package/components/mui_extended/DateTimePicker/DateTimePicker.styles.d.ts +2 -0
- package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +752 -0
- package/components/mui_extended/DateTimePicker/constants.d.ts +1 -0
- package/components/mui_extended/DateTimePicker/constants.js +4 -0
- package/components/mui_extended/DateTimePicker/icons.d.ts +4 -0
- package/components/mui_extended/DateTimePicker/icons.js +10 -0
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerEnum.d.ts +10 -0
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerEnum.js +14 -0
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +26 -0
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.js +49 -0
- package/components/mui_extended/DateTimePicker/tests/DateTimePicker.test.d.ts +1 -0
- package/components/mui_extended/DateTimePicker/types.d.ts +51 -0
- package/package.json +1 -1
- package/components/hook-form/RHFDateTime/classes/constants.d.ts +0 -1
- package/components/hook-form/RHFDateTime/classes/constants.js +0 -4
- package/components/hook-form/RHFDateTime/classes/index.d.ts +0 -11
- package/components/hook-form/RHFDateTime/classes/index.js +0 -45
- package/components/hook-form/RHFDateTime/classes/types.d.ts +0 -16
- package/components/hook-form/RHFDateTime/styles.js +0 -7
- package/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.d.ts +0 -5
- package/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.js +0 -15
- package/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +0 -5
- package/components/hook-form/RHFDateTime/test/constants.d.ts +0 -1
- package/components/hook-form/RHFDateTime/test/constants.js +0 -4
- package/components/hook-form/RHFDateTime/test/utils.d.ts +0 -2
- package/components/hook-form/RHFDateTime/test/utils.js +0 -7
package/@types/types.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ import { LinearProgressIndeterminateOwnerState, LinearProgressIndeterminateType
|
|
|
143
143
|
import { MenuDividerOwnerState, MenuDividerSlotsType } from '../components/mui_extended/MenuDivider/types';
|
|
144
144
|
import { RHFSelectSlotsType, RHFSelectOwnerState } from '../components/hook-form/RHFSelect/types';
|
|
145
145
|
import { RHFCheckBoxOwnerState, RHFCheckBoxSlotsType } from '../components/hook-form/RHFCheckbox/types';
|
|
146
|
+
import { DateTimePickerOwnerState, DateTimePickerSlotsType } from '../components/mui_extended/DateTimePicker/types';
|
|
146
147
|
import { DividerOwnerState, DividerSlotsType } from '../components/mui_extended/Divider/types';
|
|
147
148
|
|
|
148
149
|
declare module '@mui/material/styles' {
|
|
@@ -203,6 +204,7 @@ declare module '@mui/material/styles' {
|
|
|
203
204
|
M4LLinearProgressIndeterminate: LinearProgressIndeterminateType;
|
|
204
205
|
M4LMenuDivider: MenuDividerSlotsType;
|
|
205
206
|
M4LRHFSelect: RHFSelectSlotsType;
|
|
207
|
+
M4LDateTimePicker: DateTimePickerSlotsType;
|
|
206
208
|
M4LDivider: DividerSlotsType;
|
|
207
209
|
}
|
|
208
210
|
|
|
@@ -263,8 +265,8 @@ declare module '@mui/material/styles' {
|
|
|
263
265
|
M4LLinearProgressIndeterminate: Partial<LinearProgressIndeterminateOwnerState>;
|
|
264
266
|
M4LMenuDivider: Partial<MenuDividerOwnerState>;
|
|
265
267
|
M4LRHFSelect: Partial<RHFSelectOwnerState>;
|
|
268
|
+
M4LDateTimePicker: Partial<DateTimePickerOwnerState>;
|
|
266
269
|
M4LDivider: Partial<DividerOwnerState>;
|
|
267
|
-
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
interface Components {
|
|
@@ -544,6 +546,12 @@ declare module '@mui/material/styles' {
|
|
|
544
546
|
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFSelect'];
|
|
545
547
|
variants?: ComponentsVariants['M4LRHFSelect'];
|
|
546
548
|
};
|
|
549
|
+
|
|
550
|
+
M4LDateTimePicker?: {
|
|
551
|
+
defaultProps?: ComponentsPropsList['M4LDateTimePicker'];
|
|
552
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LDateTimePicker'];
|
|
553
|
+
variants?: ComponentsVariants['M4LDateTimePicker'];
|
|
554
|
+
};
|
|
547
555
|
M4LDivider?: {
|
|
548
556
|
defaultProps?: ComponentsPropsList['M4LDivider'];
|
|
549
557
|
styleOverrides?: ComponentsOverrides<Theme>['M4LDivider'];
|
package/components/Chip/Chip.js
CHANGED
|
@@ -11,6 +11,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
11
11
|
label,
|
|
12
12
|
startIcon,
|
|
13
13
|
color = "default",
|
|
14
|
+
externalColor,
|
|
14
15
|
size = "small",
|
|
15
16
|
variant = "contained",
|
|
16
17
|
skeletonWidth = "100%",
|
|
@@ -29,7 +30,8 @@ const Chip = forwardRef((props, ref) => {
|
|
|
29
30
|
chipSize: adjustedSize,
|
|
30
31
|
variant,
|
|
31
32
|
color,
|
|
32
|
-
opacity
|
|
33
|
+
opacity,
|
|
34
|
+
externalColor
|
|
33
35
|
};
|
|
34
36
|
if (isSkeleton) {
|
|
35
37
|
return /* @__PURE__ */ jsx(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../utils/getHeightSizeStyles.js";
|
|
1
2
|
const chipStyles = {
|
|
2
3
|
/**
|
|
3
4
|
* Styles for the root element of the chip.
|
|
@@ -7,25 +8,30 @@ const chipStyles = {
|
|
|
7
8
|
* @updatedUser Andrés Quintero - automatic
|
|
8
9
|
*/
|
|
9
10
|
root: ({ theme, ownerState }) => {
|
|
10
|
-
const keyColor = ownerState.color
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const bgColor = ownerState.
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const color = ownerState.variant === "contained" && !ownerState.opacity ? theme.vars.palette.chips[keyColorConditionalOpacity].contrastText : theme.vars.palette.chips[keyColorConditionalOpacity].semanticText;
|
|
11
|
+
const keyColor = ownerState.variant === "contained" ? ownerState.color + "Contained" : ownerState.color + "Outlined";
|
|
12
|
+
const finalPalette = ownerState.externalColor ? ownerState.externalColor : theme.vars.palette.chips[keyColor ?? "default"];
|
|
13
|
+
const color = ownerState.opacity ? finalPalette.color : finalPalette.colorTone;
|
|
14
|
+
const bgColor = ownerState.opacity ? finalPalette.backgroundColor : finalPalette.backgroundColorTone;
|
|
15
|
+
const bgHover = ownerState.opacity ? finalPalette.backgroundHover : finalPalette.backgroundHoverTone;
|
|
16
|
+
const bgActive = ownerState.opacity ? finalPalette.backgroundActive : finalPalette.backgroundActiveTone;
|
|
17
17
|
return {
|
|
18
18
|
display: "flex",
|
|
19
19
|
alignItems: "center",
|
|
20
20
|
padding: theme.vars.size.baseSpacings.sp1,
|
|
21
|
+
paddingRight: 0,
|
|
21
22
|
borderRadius: theme.vars.size.borderRadius["r0-5"],
|
|
22
23
|
width: "max-content",
|
|
23
24
|
cursor: "pointer",
|
|
24
25
|
color,
|
|
25
|
-
backgroundColor: bgColor,
|
|
26
|
+
backgroundColor: !(ownerState.variant === "outlined") ? bgColor : "transparent",
|
|
26
27
|
"& .M4LIcon-icon": {
|
|
27
28
|
backgroundColor: `${color} !important`
|
|
28
29
|
},
|
|
30
|
+
...getHeightSizeStyles(
|
|
31
|
+
theme.generalSettings.isMobile,
|
|
32
|
+
ownerState.chipSize || "medium",
|
|
33
|
+
"base"
|
|
34
|
+
),
|
|
29
35
|
"&:hover": {
|
|
30
36
|
backgroundColor: bgHover
|
|
31
37
|
},
|
|
@@ -37,15 +43,14 @@ const chipStyles = {
|
|
|
37
43
|
},
|
|
38
44
|
...ownerState.variant === "outlined" && {
|
|
39
45
|
border: `${theme.vars.size.borderStroke.container}`,
|
|
40
|
-
borderColor:
|
|
46
|
+
borderColor: bgColor
|
|
41
47
|
},
|
|
42
48
|
"&:focus-visible": {
|
|
43
49
|
boxShadow: "none",
|
|
44
|
-
outline: theme.vars.size.borderStroke.container
|
|
45
|
-
outlineColor: theme.vars.palette.border.main,
|
|
46
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
50
|
+
outline: `${theme.vars.size.borderStroke.container} ${theme.vars.palette.border.main}`,
|
|
47
51
|
backgroundColor: bgActive
|
|
48
|
-
}
|
|
52
|
+
},
|
|
53
|
+
variants: []
|
|
49
54
|
};
|
|
50
55
|
},
|
|
51
56
|
/**
|
|
@@ -58,7 +63,7 @@ const chipStyles = {
|
|
|
58
63
|
textChip: ({ theme }) => ({
|
|
59
64
|
whiteSpace: "nowrap",
|
|
60
65
|
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
61
|
-
paddingRight: theme.vars.size.baseSpacings.
|
|
66
|
+
paddingRight: theme.vars.size.baseSpacings.sp2
|
|
62
67
|
}),
|
|
63
68
|
/**
|
|
64
69
|
* Styles for the chip icon element.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
1
|
+
import { ChipColor, ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
2
2
|
import { Theme } from '@mui/material';
|
|
3
3
|
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
4
4
|
import { EventHandler, ReactNode } from 'react';
|
|
@@ -39,7 +39,11 @@ export interface ChipProps {
|
|
|
39
39
|
* Defines the color of the `Chip`.
|
|
40
40
|
* @createdAt 2025-01-08 10:36:39 - automatic
|
|
41
41
|
*/
|
|
42
|
-
color?: Exclude<ComponentPalletColor, 'primary'
|
|
42
|
+
color?: Exclude<ComponentPalletColor, 'primary'> | 'florest' | 'disabled';
|
|
43
|
+
/**
|
|
44
|
+
* Alternative color for the `Chip`.
|
|
45
|
+
*/
|
|
46
|
+
externalColor?: ChipColor;
|
|
43
47
|
/**
|
|
44
48
|
* Define el with of skeleton mode
|
|
45
49
|
* @createdAt 2025-01-08 10:36:39 - automatic
|
|
@@ -75,9 +79,10 @@ export interface ChipProps {
|
|
|
75
79
|
/**
|
|
76
80
|
* Owner state of the `Chip` used to define internal style and behavior properties.
|
|
77
81
|
*/
|
|
78
|
-
export interface ChipOwnerState extends Pick<ChipProps, 'variant' | '
|
|
82
|
+
export interface ChipOwnerState extends Pick<ChipProps, 'variant' | 'externalColor'> {
|
|
79
83
|
opacity?: boolean;
|
|
80
84
|
chipSize: ChipProps['size'];
|
|
85
|
+
color: Exclude<ComponentPalletColor, 'primary'> | 'florest' | 'disabled';
|
|
81
86
|
}
|
|
82
87
|
/**
|
|
83
88
|
* Defines the types of Slots available for the `Chip`.
|
|
@@ -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`.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { RHFDateTimeProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* TODO: Documentar
|
|
4
|
+
* @author DanielEscobar - automatic
|
|
5
|
+
* @createdAt 2025-01-27 14:53:37 - automatic
|
|
6
|
+
* @updatedAt 2025-01-28 12:16:07 - automatic
|
|
7
|
+
* @updatedUser DanielEscobar - automatic
|
|
4
8
|
*/
|
|
5
9
|
export declare function RHFDateTime(props: RHFDateTimeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,79 +1,44 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { DateTimePicker } from "@mui/x-date-pickers";
|
|
4
|
-
import { useEnvironment, useModuleSkeleton } from "@m4l/core";
|
|
5
|
-
import { S as SkeletonRHFDateTime } from "./subcomponents/Skeleton/index.js";
|
|
6
|
-
import { useFormatter, useResponsiveDesktop } from "@m4l/graphics";
|
|
7
|
-
import { useState, useEffect } from "react";
|
|
8
|
-
import { u as useUtilityClasses } from "./classes/index.js";
|
|
9
2
|
import clsx from "clsx";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { useFormContext, Controller } from "react-hook-form";
|
|
5
|
+
import { useFormatter } from "@m4l/graphics";
|
|
6
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
7
|
+
import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
|
|
8
|
+
import { D as DateTimePicker } from "../../mui_extended/DateTimePicker/DateTimePicker.js";
|
|
9
|
+
import { R as RHFDateTimeRootStyled } from "./slots/RHFDateTimeSlots.js";
|
|
10
|
+
import { R as RHF_DATE_TIME_KEY_COMPONENT } from "./constants.js";
|
|
11
|
+
import { R as RHFDateTimeSlots } from "./slots/RHFDateTimeEnum.js";
|
|
12
|
+
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
14
13
|
import { L as Label } from "../../Label/Label.js";
|
|
15
14
|
import { H as HelperError } from "../../HelperError/HelperError.js";
|
|
16
|
-
import { I as Icon } from "../../Icon/Icon.js";
|
|
17
15
|
function RHFDateTime(props) {
|
|
18
16
|
const {
|
|
19
17
|
name: nameRHF,
|
|
20
18
|
disabled,
|
|
21
|
-
size = "
|
|
19
|
+
size = "medium",
|
|
22
20
|
variant,
|
|
23
|
-
skeletonWidth = "50%",
|
|
24
|
-
skeletonHeight = 14,
|
|
25
|
-
className,
|
|
26
21
|
label,
|
|
27
22
|
helperMessage,
|
|
28
23
|
mandatory,
|
|
29
|
-
mandatoryMessage
|
|
24
|
+
mandatoryMessage,
|
|
25
|
+
className,
|
|
26
|
+
dataTestId
|
|
30
27
|
} = props;
|
|
31
|
-
const {
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
34
|
-
Icon,
|
|
35
|
-
{
|
|
36
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/rhfdate/ended_at.svg`
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
const [currentVariant, setCurrentVariant] = useState(void 0);
|
|
41
|
-
const { isFocus, isTabSelected, handlerFocus, handlerOnKeyUp, handlerOnBlur } = useFormFocus();
|
|
42
|
-
const {
|
|
43
|
-
control,
|
|
44
|
-
formState: { errors }
|
|
45
|
-
} = useFormContext();
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (errors[nameRHF]) {
|
|
48
|
-
setCurrentVariant("error");
|
|
49
|
-
} else if (variant) {
|
|
50
|
-
setCurrentVariant(variant);
|
|
51
|
-
} else {
|
|
52
|
-
setCurrentVariant(void 0);
|
|
53
|
-
}
|
|
54
|
-
}, [errors[nameRHF], variant, control]);
|
|
55
|
-
const isSkeleton = useModuleSkeleton();
|
|
28
|
+
const { control } = useFormContext();
|
|
29
|
+
const htmlForId = useId();
|
|
56
30
|
const {
|
|
57
31
|
dateFormatter: { datetimeFormat }
|
|
58
32
|
} = useFormatter();
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
isTabSelected: !isSkeleton ? isTabSelected : false,
|
|
63
|
-
disabled,
|
|
64
|
-
size: isDesktop ? size : "medium",
|
|
65
|
-
variant: currentVariant
|
|
66
|
-
};
|
|
67
|
-
const classes = useUtilityClasses(ownerState);
|
|
33
|
+
const { currentSize } = useComponentSize(size);
|
|
34
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
35
|
+
const classes = getComponentClasses(RHF_DATE_TIME_KEY_COMPONENT, RHFDateTimeSlots);
|
|
68
36
|
return /* @__PURE__ */ jsx(
|
|
69
|
-
|
|
37
|
+
RHFDateTimeRootStyled,
|
|
70
38
|
{
|
|
71
|
-
className: clsx(classes.root
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onKeyUp: handlerOnKeyUp,
|
|
75
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameRHFDateTimeDataTestId("root") } : {},
|
|
76
|
-
children: !isSkeleton ? /* @__PURE__ */ jsx(
|
|
39
|
+
className: clsx(className, classes.root),
|
|
40
|
+
...getPropDataTestId(RHF_DATE_TIME_KEY_COMPONENT, RHFDateTimeSlots.root, dataTestId),
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
77
42
|
Controller,
|
|
78
43
|
{
|
|
79
44
|
name: nameRHF,
|
|
@@ -83,7 +48,9 @@ function RHFDateTime(props) {
|
|
|
83
48
|
label && /* @__PURE__ */ jsx(
|
|
84
49
|
Label,
|
|
85
50
|
{
|
|
86
|
-
|
|
51
|
+
disabled,
|
|
52
|
+
htmlFor: htmlForId,
|
|
53
|
+
size: adjustedSize,
|
|
87
54
|
label,
|
|
88
55
|
mandatory,
|
|
89
56
|
mandatoryMessage,
|
|
@@ -93,41 +60,27 @@ function RHFDateTime(props) {
|
|
|
93
60
|
/* @__PURE__ */ jsx(
|
|
94
61
|
DateTimePicker,
|
|
95
62
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
},
|
|
63
|
+
variant,
|
|
64
|
+
size: adjustedSize,
|
|
65
|
+
disabled,
|
|
101
66
|
inputRef: ref,
|
|
102
|
-
ampm: true,
|
|
103
|
-
value,
|
|
104
|
-
onChange: (newValue) => {
|
|
105
|
-
onChange(newValue);
|
|
106
|
-
},
|
|
107
|
-
slots: {
|
|
108
|
-
openPickerIcon: resourceIcon
|
|
109
|
-
},
|
|
110
67
|
slotProps: {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
onBlur: handlerOnBlur
|
|
68
|
+
field: {
|
|
69
|
+
format: datetimeFormat
|
|
114
70
|
},
|
|
115
|
-
|
|
116
|
-
|
|
71
|
+
textField: {
|
|
72
|
+
id: htmlForId
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
value,
|
|
76
|
+
onChange,
|
|
77
|
+
error: !!error?.message
|
|
117
78
|
}
|
|
118
79
|
),
|
|
119
|
-
error?.message && /* @__PURE__ */ jsx(HelperError, { message: error?.message + "" })
|
|
80
|
+
error?.message && /* @__PURE__ */ jsx(HelperError, { size: adjustedSize, htmlFor: htmlForId, message: error?.message + "" })
|
|
120
81
|
] });
|
|
121
82
|
}
|
|
122
83
|
}
|
|
123
|
-
) : /* @__PURE__ */ jsx(
|
|
124
|
-
SkeletonRHFDateTime,
|
|
125
|
-
{
|
|
126
|
-
skeletonWidth,
|
|
127
|
-
skeletonHeight,
|
|
128
|
-
className: classes,
|
|
129
|
-
label
|
|
130
|
-
}
|
|
131
84
|
)
|
|
132
85
|
}
|
|
133
86
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const rhfDateTimeStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* estilos root
|
|
4
|
+
* @author DanielEscobar - automatic
|
|
5
|
+
* @createdAt 2025-01-27 11:56:49 - automatic
|
|
6
|
+
* @updatedAt 2025-01-27 11:56:50 - automatic
|
|
7
|
+
* @updatedUser DanielEscobar - automatic
|
|
8
|
+
*/
|
|
9
|
+
root: ({ theme }) => ({
|
|
10
|
+
display: "flex",
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
gap: theme.vars.size.baseSpacings["sp0-5"]
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
rhfDateTimeStyles as r
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RHF_DATE_TIME_KEY_COMPONENT = "M4LRHFDateTime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RHFDateTimeRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import { R as RHF_DATE_TIME_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { r as rhfDateTimeStyles } from "../RHFDateTime.styles.js";
|
|
4
|
+
const RHFDateTimeRootStyled = styled("div", {
|
|
5
|
+
name: RHF_DATE_TIME_KEY_COMPONENT
|
|
6
|
+
})(rhfDateTimeStyles.root);
|
|
7
|
+
export {
|
|
8
|
+
RHFDateTimeRootStyled as R
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|