@m4l/components 9.3.0-BE24072025-beta.1 → 9.3.0-BE25072025-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -0
- package/components/NumberInput/NumberInput.styles.js +1 -0
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
- package/components/PaperForm/PaperForm.js +1 -2
- package/components/PaperForm/components/Header.js +1 -10
- package/components/PaperForm/styles.js +1 -4
- package/components/PropertyValue/PropertyValue.js +1 -1
- package/components/ToastContainer/ToastContainer.js +0 -1
- package/components/ToastContainer/ToastContainer.styles.js +126 -122
- package/components/ToastContainer/constants.d.ts +670 -0
- package/components/ToastContainer/constants.js +672 -1
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +5 -0
- package/components/hook-form/RHFColorPicker/RHFColorPicker.styles.js +2 -1
- package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +2 -1
- package/components/hook-form/RHFNumberInput/RHFNumberInput.styles.js +2 -1
- package/components/hook-form/RHFPeriod/RHFPeriod.styles.js +2 -5
- package/components/hook-form/RHFPeriod/slots/RHFPeriodEnum.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodEnum.js +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +2 -2
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.js +6 -6
- package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +13 -11
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +1 -1
- package/components/hook-form/RHFPeriod/subcomponents/Period/types.d.ts +2 -2
- package/components/hook-form/RHFSelect/RHFSelect.styles.js +2 -1
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +1 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +1 -1
- package/components/mui_extended/Button/ButtonStyles.js +2 -1
- package/components/mui_extended/IconButton/IconButton.styles.js +1 -1
- package/components/mui_extended/MenuItem/MenuItem.styles.js +2 -1
- package/components/mui_extended/Select/index.d.ts +2 -2
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.js +1 -1
- package/components/mui_extended/Select/types.js +1 -0
- package/components/mui_extended/TextField/constants.d.ts +5 -5
- package/components/mui_extended/TextField/constants.js +2 -2
- package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldEnum.js +8 -8
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +1 -1
- package/components/mui_extended/index.d.ts +0 -1
- package/index.js +19 -21
- package/package.json +1 -1
- package/storybook/components/paperForm/PaperForm.stories.d.ts +4 -0
- package/components/hook-form/RHFDateTime/styles.d.ts +0 -1
|
@@ -17,6 +17,7 @@ function getComparator(columns, sortColumn) {
|
|
|
17
17
|
return column.customSort;
|
|
18
18
|
}
|
|
19
19
|
switch (typeOrder) {
|
|
20
|
+
//Si el tipo de dato de la columna es un numerico, retorna una función de ordenamiento numérica
|
|
20
21
|
case "number":
|
|
21
22
|
return (a, b) => {
|
|
22
23
|
try {
|
|
@@ -25,6 +26,7 @@ function getComparator(columns, sortColumn) {
|
|
|
25
26
|
return -1;
|
|
26
27
|
}
|
|
27
28
|
};
|
|
29
|
+
//Por defecto retorna una función de ordenamiento de string
|
|
28
30
|
default:
|
|
29
31
|
return (a, b) => {
|
|
30
32
|
try {
|
|
@@ -15,6 +15,7 @@ const numberInputStyles = {
|
|
|
15
15
|
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
16
16
|
paddingRight: ownerState?.noButtons && theme.vars.size.baseSpacings.sp1,
|
|
17
17
|
boxSizing: "border-box",
|
|
18
|
+
overflow: "hidden",
|
|
18
19
|
...getHeightSizeStyles(
|
|
19
20
|
theme.generalSettings.isMobile,
|
|
20
21
|
ownerState?.size || "medium",
|
|
@@ -56,9 +56,11 @@ const useNumberInput = (parameters) => {
|
|
|
56
56
|
(event, field, fieldValue, reason) => {
|
|
57
57
|
if (field === "value" && typeof fieldValue !== "string") {
|
|
58
58
|
switch (reason) {
|
|
59
|
+
// only a blur event will dispatch `numberInput:clamp`
|
|
59
60
|
case "numberInput:inputChange":
|
|
60
61
|
onChange?.(event, fieldValue);
|
|
61
62
|
break;
|
|
63
|
+
// only a blur event will dispatch `numberInput:clamp`
|
|
62
64
|
case "numberInput:clamp":
|
|
63
65
|
onChange?.(event, fieldValue);
|
|
64
66
|
break;
|
|
@@ -29,9 +29,8 @@ function PaperForm(props) {
|
|
|
29
29
|
const { currentSize } = useComponentSize(size);
|
|
30
30
|
const paperFormRef = useRef(null);
|
|
31
31
|
const rootClass = getComponentSlotRoot(PAPER_FORM_KEY);
|
|
32
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
33
32
|
const ownerState = {
|
|
34
|
-
size:
|
|
33
|
+
size: currentSize,
|
|
35
34
|
color,
|
|
36
35
|
isForm,
|
|
37
36
|
paperFormVariant: variant
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useModuleSkeleton } from "@m4l/core";
|
|
3
2
|
import { H as HeaderStyled, I as IconStyled, T as TitleStyled } from "../slots/PaperFormSlots.js";
|
|
4
|
-
import { S as Skeleton } from "../../mui_extended/Skeleton/Skeleton.js";
|
|
5
3
|
const Header = (props) => {
|
|
6
4
|
const { urlIcon, title, size, dataTestId, color } = props;
|
|
7
|
-
const isSkeleton = useModuleSkeleton();
|
|
8
5
|
const ownerState = {
|
|
9
6
|
color
|
|
10
7
|
};
|
|
11
|
-
const renderSkeleton = () => {
|
|
12
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
-
urlIcon ? /* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: 16, height: 16 }) : null,
|
|
14
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 80, height: 16 })
|
|
15
|
-
] });
|
|
16
|
-
};
|
|
17
8
|
const renderContentHeader = () => {
|
|
18
9
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19
10
|
urlIcon ? /* @__PURE__ */ jsx(IconStyled, { src: urlIcon, size }) : null,
|
|
20
11
|
/* @__PURE__ */ jsx(TitleStyled, { variant: "bodyDens", size, children: title })
|
|
21
12
|
] });
|
|
22
13
|
};
|
|
23
|
-
return /* @__PURE__ */ jsx(HeaderStyled, { role: "heading", ownerState, ...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {}, children:
|
|
14
|
+
return /* @__PURE__ */ jsx(HeaderStyled, { role: "heading", ownerState, ...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {}, children: renderContentHeader() });
|
|
24
15
|
};
|
|
25
16
|
export {
|
|
26
17
|
Header as H
|
|
@@ -58,10 +58,7 @@ const paperFormStyles = {
|
|
|
58
58
|
* @param theme
|
|
59
59
|
***********************************************************
|
|
60
60
|
*/
|
|
61
|
-
containerIcon:
|
|
62
|
-
display: "grid",
|
|
63
|
-
placeItems: "center"
|
|
64
|
-
}),
|
|
61
|
+
containerIcon: {},
|
|
65
62
|
/**
|
|
66
63
|
* ************************************************************
|
|
67
64
|
* Estilos del contenido del componente PaperForm
|
|
@@ -3,7 +3,6 @@ import { ToastContainer as ToastContainer$1 } from "react-toastify";
|
|
|
3
3
|
import { D as DEFAULT_CLOSE_TIME, T as TOAST_KEY_COMPONENT } from "./constants.js";
|
|
4
4
|
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
5
5
|
import { ModuleSkeletonProvider } from "@m4l/core";
|
|
6
|
-
import "react-toastify/dist/ReactToastify.min.css";
|
|
7
6
|
import { R as RootStyled } from "./slots/toastContainerSlots.js";
|
|
8
7
|
import { T as ToastContainerSlots } from "./slots/ToastContainerEnum.js";
|
|
9
8
|
const ToastContainer = (props) => {
|
|
@@ -1,132 +1,136 @@
|
|
|
1
|
+
import { a as TOAST_NATIVE_STYLES } from "./constants.js";
|
|
1
2
|
const toastStyles = {
|
|
2
3
|
/** Root del componente ToastContainer */
|
|
3
4
|
root: ({ theme, ownerState }) => ({
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
position: "absolute",
|
|
45
|
-
zIndex: theme.vars.zIndex.snackbar,
|
|
46
|
-
"@supports (position: sticky)": {
|
|
47
|
-
position: "sticky"
|
|
48
|
-
}
|
|
49
|
-
} : {},
|
|
50
|
-
"& .Toastify": {
|
|
51
|
-
margin: 0,
|
|
52
|
-
padding: 0,
|
|
53
|
-
height: 0
|
|
54
|
-
},
|
|
55
|
-
"& .Toastify__toast-container": {
|
|
56
|
-
display: "flex",
|
|
57
|
-
flexDirection: "column",
|
|
58
|
-
gap: "16px",
|
|
5
|
+
...TOAST_NATIVE_STYLES,
|
|
6
|
+
"&&&": {
|
|
7
|
+
"--toastify-color-light": theme.vars.palette.background.default,
|
|
8
|
+
"--toastify-color-dark": theme.vars.palette.background.default,
|
|
9
|
+
"--toastify-color-info": theme.vars.palette.info.enabled,
|
|
10
|
+
"--toastify-color-success": theme.vars.palette.success.enabled,
|
|
11
|
+
"--toastify-color-warning": theme.vars.palette.warning.enabled,
|
|
12
|
+
"--toastify-color-error": theme.vars.palette.error.enabled,
|
|
13
|
+
"--toastify-color-transparent": "rgba(255, 255, 255, 0.7)",
|
|
14
|
+
"--toastify-icon-color-info": "var(--toastify-color-info)",
|
|
15
|
+
"--toastify-icon-color-success": "var(--toastify-color-success)",
|
|
16
|
+
"--toastify-icon-color-warning": "var(--toastify-color-warning)",
|
|
17
|
+
"--toastify-icon-color-error": "var(--toastify-color-error)",
|
|
18
|
+
"--toastify-toast-width": "320px",
|
|
19
|
+
"--toastify-toast-background": "#fff",
|
|
20
|
+
"--toastify-toast-min-height": "64px",
|
|
21
|
+
"--toastify-toast-max-height": "800px",
|
|
22
|
+
"--toastify-font-family": "sans-serif",
|
|
23
|
+
"--toastify-z-index": "9999",
|
|
24
|
+
"--toastify-text-color-light": "#757575",
|
|
25
|
+
"--toastify-text-color-dark": "#fff",
|
|
26
|
+
//Used only for colored theme
|
|
27
|
+
"--toastify-text-color-info": "#fff",
|
|
28
|
+
"--toastify-text-color-success": "#fff",
|
|
29
|
+
"--toastify-text-color-warning": "#fff",
|
|
30
|
+
"--toastify-text-color-error": "#fff",
|
|
31
|
+
"--toastify-spinner-color": "#616161",
|
|
32
|
+
"--toastify-spinner-color-empty-area": "#e0e0e0",
|
|
33
|
+
// Used when no type is provided
|
|
34
|
+
// toast("**hello**")
|
|
35
|
+
// '--toastify-color-progress-light': 'var(--toastify-color-info)',
|
|
36
|
+
// // Used when no type is provided
|
|
37
|
+
// '--toastify-color-progress-dark': 'var(--toastify-color-info)',
|
|
38
|
+
// '--toastify-color-progress-info': 'var(--toastify-color-info)',
|
|
39
|
+
// '--toastify-color-progress-success': 'var(--toastify-color-success)',
|
|
40
|
+
// '--toastify-color-progress-warning': 'var(--toastify-color-warning)',
|
|
41
|
+
// '--toastify-color-progress-error': 'var(--toastify-color-error)',
|
|
42
|
+
"--toastify-toast-bd-radius": "8px",
|
|
43
|
+
// used to control the opacity of the progress trail
|
|
44
|
+
"--toastify-color-progress-bgo": ".2",
|
|
59
45
|
...ownerState?.fixed === false ? {
|
|
60
|
-
top:
|
|
61
|
-
position: "absolute"
|
|
46
|
+
top: 0,
|
|
47
|
+
position: "absolute",
|
|
48
|
+
zIndex: theme.vars.zIndex.snackbar,
|
|
49
|
+
"@supports (position: sticky)": {
|
|
50
|
+
position: "sticky"
|
|
51
|
+
}
|
|
62
52
|
} : {},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
53
|
+
"& .Toastify": {
|
|
54
|
+
margin: 0,
|
|
55
|
+
padding: 0,
|
|
56
|
+
height: 0
|
|
57
|
+
},
|
|
58
|
+
"& .Toastify__toast-container": {
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "column",
|
|
61
|
+
gap: "16px",
|
|
62
|
+
...ownerState?.fixed === false ? {
|
|
63
|
+
top: "20px",
|
|
64
|
+
position: "absolute"
|
|
65
|
+
} : {},
|
|
66
|
+
[theme.breakpoints.down(480)]: {
|
|
67
|
+
width: "100%",
|
|
68
|
+
minWidth: "100%",
|
|
69
|
+
padding: "0"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
/** Used to define the position of the ToastContainer */
|
|
73
|
+
// '.Toastify__toast-container--top-left': {},
|
|
74
|
+
// '.Toastify__toast-container--top-center': {},
|
|
75
|
+
// '.Toastify__toast-container--top-right': {},
|
|
76
|
+
// '.Toastify__toast-container--bottom-left': {},
|
|
77
|
+
// '.Toastify__toast-container--bottom-center': {},
|
|
78
|
+
// '.Toastify__toast-container--bottom-right': {},
|
|
79
|
+
"& .Toastify__toast--stacked[data-collapsed=true]:not(:last-child) > *": {
|
|
80
|
+
opacity: 0.2
|
|
81
|
+
},
|
|
82
|
+
/** Classes for the displayed toast */
|
|
83
|
+
"& .Toastify__toast": {
|
|
84
|
+
minHeight: "min-content",
|
|
85
|
+
margin: "0",
|
|
86
|
+
padding: "0",
|
|
87
|
+
backgroundColor: theme.vars.palette.background.default,
|
|
88
|
+
boxShadow: theme.customShadows?.z4,
|
|
89
|
+
borderRadius: "4px",
|
|
90
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
91
|
+
[theme.breakpoints.down(480)]: {
|
|
92
|
+
margin: "1%",
|
|
93
|
+
width: "98% !important"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
".Toastify__toast--rtl": {},
|
|
97
|
+
"& .Toastify__toast-body": {
|
|
98
|
+
margin: "0px",
|
|
99
|
+
padding: "0px"
|
|
100
|
+
},
|
|
101
|
+
/** Used to position the icon */
|
|
102
|
+
// '& .Toastify__toast-icon': {},
|
|
103
|
+
/** handle the notification color and the text color based on the theme */
|
|
104
|
+
// '& .Toastify__toast-theme--dark': {},
|
|
105
|
+
// '& .Toastify__toast-theme--light': {},
|
|
106
|
+
// '& .Toastify__toast-theme--colored.Toastify__toast--default': {},
|
|
107
|
+
// '& .Toastify__toast-theme--colored.Toastify__toast--info': {},
|
|
108
|
+
// '& .Toastify__toast-theme--colored.Toastify__toast--success': {},
|
|
109
|
+
// '& .Toastify__toast-theme--colored.Toastify__toast--warning': {},
|
|
110
|
+
// '& .Toastify__toast-theme--colored.Toastify__toast--error': {},
|
|
111
|
+
"& .Toastify__progress-bar--wrp": {
|
|
112
|
+
position: "absolute",
|
|
113
|
+
top: 0,
|
|
114
|
+
height: "2px",
|
|
115
|
+
borderTopLeftRadius: "2px",
|
|
116
|
+
borderTopRightRadius: "2px",
|
|
117
|
+
borderBottomLeftRadius: "0",
|
|
118
|
+
borderBottomRightRadius: "0",
|
|
119
|
+
overflow: "hidden"
|
|
120
|
+
},
|
|
121
|
+
"& .Toastify__progress-bar": {
|
|
122
|
+
borderTopLeftRadius: "2px",
|
|
123
|
+
borderBottomLeftRadius: "0",
|
|
124
|
+
borderBottomRightRadius: "0"
|
|
91
125
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// '& .Toastify__toast-icon': {},
|
|
100
|
-
/** handle the notification color and the text color based on the theme */
|
|
101
|
-
// '& .Toastify__toast-theme--dark': {},
|
|
102
|
-
// '& .Toastify__toast-theme--light': {},
|
|
103
|
-
// '& .Toastify__toast-theme--colored.Toastify__toast--default': {},
|
|
104
|
-
// '& .Toastify__toast-theme--colored.Toastify__toast--info': {},
|
|
105
|
-
// '& .Toastify__toast-theme--colored.Toastify__toast--success': {},
|
|
106
|
-
// '& .Toastify__toast-theme--colored.Toastify__toast--warning': {},
|
|
107
|
-
// '& .Toastify__toast-theme--colored.Toastify__toast--error': {},
|
|
108
|
-
"& .Toastify__progress-bar--wrp": {
|
|
109
|
-
position: "absolute",
|
|
110
|
-
top: 0,
|
|
111
|
-
height: "2px",
|
|
112
|
-
borderTopLeftRadius: "2px",
|
|
113
|
-
borderTopRightRadius: "2px",
|
|
114
|
-
borderBottomLeftRadius: "0",
|
|
115
|
-
borderBottomRightRadius: "0",
|
|
116
|
-
overflow: "hidden"
|
|
117
|
-
},
|
|
118
|
-
"& .Toastify__progress-bar": {
|
|
119
|
-
borderTopLeftRadius: "2px",
|
|
120
|
-
borderBottomLeftRadius: "0",
|
|
121
|
-
borderBottomRightRadius: "0"
|
|
126
|
+
// '& .Toastify__progress-bar--rtl': {},
|
|
127
|
+
// '& .Toastify__progress-bar-theme--light': {},
|
|
128
|
+
// '& .Toastify__progress-bar-theme--dark': {},
|
|
129
|
+
// '& .Toastify__progress-bar--info': {},
|
|
130
|
+
// '& .Toastify__progress-bar--success': {},
|
|
131
|
+
// '& .Toastify__progress-bar--warning': {},
|
|
132
|
+
// '& .Toastify__progress-bar--error': {},
|
|
122
133
|
}
|
|
123
|
-
// '& .Toastify__progress-bar--rtl': {},
|
|
124
|
-
// '& .Toastify__progress-bar-theme--light': {},
|
|
125
|
-
// '& .Toastify__progress-bar-theme--dark': {},
|
|
126
|
-
// '& .Toastify__progress-bar--info': {},
|
|
127
|
-
// '& .Toastify__progress-bar--success': {},
|
|
128
|
-
// '& .Toastify__progress-bar--warning': {},
|
|
129
|
-
// '& .Toastify__progress-bar--error': {},
|
|
130
134
|
}),
|
|
131
135
|
/** 📦 Contenedor Principal del Toast 📦 */
|
|
132
136
|
messageRoot: ({ theme }) => ({
|