@m4l/components 9.2.47 → 9.2.49
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/Chip/types.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js +1 -1
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/types.d.ts +4 -3
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/useColumnChipStatus.js +4 -4
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/formatters/ChipStatusFormatter/types.d.ts +3 -2
- package/components/mui_extended/Button/Button.js +2 -1
- package/components/mui_extended/Button/ButtonStyles.js +40 -126
- package/components/mui_extended/Button/types.d.ts +1 -12
- package/mockServiceWorker.js +1 -1
- package/package.json +1 -6
- package/storybook/components/extended/mui/Button/Button.stories.d.ts +0 -8
- package/components/mui_extended/Button/classes/constants.d.ts +0 -1
- package/components/mui_extended/Button/classes/index.d.ts +0 -10
- package/components/mui_extended/Button/classes/types.d.ts +0 -29
|
@@ -5,6 +5,7 @@ import { CHIP_KEY_COMPONENT } from './constants';
|
|
|
5
5
|
import { ChipSlots } from './slots';
|
|
6
6
|
import { IconButtonProps as MUIIconButtonProps } from '@mui/material';
|
|
7
7
|
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
8
|
+
import { Maybe } from '@m4l/core';
|
|
8
9
|
export type ChipVariants = 'contained' | 'outlined';
|
|
9
10
|
/**
|
|
10
11
|
* Propiedades del componente `Chip`.
|
|
@@ -25,7 +26,7 @@ export interface ChipProps {
|
|
|
25
26
|
/**
|
|
26
27
|
* Text describing the `Chip`.
|
|
27
28
|
*/
|
|
28
|
-
label?: string
|
|
29
|
+
label?: Maybe<string>;
|
|
29
30
|
/**
|
|
30
31
|
* Defines the variant of the `Chip` (default 'contained').
|
|
31
32
|
*/
|
|
@@ -4,7 +4,7 @@ import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWith
|
|
|
4
4
|
import { C as ChipStatusFormatterColumnWrapperStyled } from "../../../formatters/ChipStatusFormatter/slots/ChipStatusFormatterSlots.js";
|
|
5
5
|
import { C as ChipStatusFormatter } from "../../../formatters/ChipStatusFormatter/ChipStatusFormatter.js";
|
|
6
6
|
const ColumnChipStatusFormatter = (props) => {
|
|
7
|
-
const { uriStatus, uriLabel, statusesColors, fallbackColor } = props;
|
|
7
|
+
const { fieldStatus: uriStatus, fieldLabel: uriLabel, statusesColors, fallbackColor } = props;
|
|
8
8
|
return (obProps) => {
|
|
9
9
|
const label = typeof uriLabel === "string" ? getPropertyByString(obProps, getFieldValueWithRow(uriStatus.toString())) : uriLabel(obProps, uriStatus);
|
|
10
10
|
const status = getPropertyByString(obProps, getFieldValueWithRow(uriStatus.toString()));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DeepKeyOf } from '../../../../utils/types';
|
|
1
2
|
import { ChipStatusKey, ChipStatusFormatterProps } from '../../../formatters/ChipStatusFormatter/types';
|
|
2
|
-
export interface ColumnChipStatusFormatterProps<
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface ColumnChipStatusFormatterProps<TRow> extends Pick<ChipStatusFormatterProps, 'statusesColors' | 'fallbackColor'> {
|
|
4
|
+
fieldStatus: DeepKeyOf<TRow>;
|
|
5
|
+
fieldLabel: DeepKeyOf<TRow> | ((row: TRow, status: ChipStatusKey) => string);
|
|
5
6
|
}
|
|
@@ -4,16 +4,16 @@ import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
|
4
4
|
import { deepEqual } from "fast-equals";
|
|
5
5
|
import { useState, useRef, useEffect, useMemo } from "react";
|
|
6
6
|
const getCustomChipStatusFilter = (props) => {
|
|
7
|
-
const { uriLabel } = props;
|
|
7
|
+
const { fieldLabel: uriLabel } = props;
|
|
8
8
|
return (row, value) => {
|
|
9
|
-
const valueMaybeString = typeof uriLabel === "string" ? getPropertyByString(row, getColumnKey(uriLabel), "") : uriLabel(row, props.
|
|
9
|
+
const valueMaybeString = typeof uriLabel === "string" ? getPropertyByString(row, getColumnKey(uriLabel), "") : uriLabel(row, props.fieldStatus);
|
|
10
10
|
return valueMaybeString.includes(value.toString());
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
const getCustomChipStatusSort = (props) => {
|
|
14
14
|
return (a, b) => {
|
|
15
|
-
const valueA = typeof props.
|
|
16
|
-
const valueB = typeof props.
|
|
15
|
+
const valueA = typeof props.fieldLabel === "string" ? getPropertyByString(a, getColumnKey(props.fieldLabel), "") : props.fieldLabel(a, props.fieldStatus);
|
|
16
|
+
const valueB = typeof props.fieldLabel === "string" ? getPropertyByString(b, getColumnKey(props.fieldLabel), "") : props.fieldLabel(b, props.fieldStatus);
|
|
17
17
|
return valueA > valueB ? 1 : valueA < valueB ? -1 : 0;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -17,11 +17,11 @@ declare function usePopoverFilter(): {
|
|
|
17
17
|
filterFormValue: FormFilterValue;
|
|
18
18
|
formFilter: FormFilterFieldApplied;
|
|
19
19
|
popupValidationSchema: import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ObjectSchema<{
|
|
20
|
-
[x: string]: import('yup').ObjectSchema
|
|
20
|
+
[x: string]: import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>>, any>;
|
|
21
21
|
}, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<{
|
|
22
|
-
[x: string]: import('yup').ObjectSchema
|
|
22
|
+
[x: string]: import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>>, any>;
|
|
23
23
|
}>, import('yup/lib/object').AssertsShape<{
|
|
24
|
-
[x: string]: import('yup').ObjectSchema
|
|
24
|
+
[x: string]: import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>>, any>;
|
|
25
25
|
}>> | undefined;
|
|
26
26
|
statusLoad: "initial" | "reload_values_provider" | "ready";
|
|
27
27
|
};
|
|
@@ -17,11 +17,11 @@ declare function usePopoverSort(): {
|
|
|
17
17
|
sortFormValue: import('../../types').FormSortValueBase;
|
|
18
18
|
formSort: FormSortFieldApplied;
|
|
19
19
|
popupValidationSchema: import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ObjectSchema<{
|
|
20
|
-
[x: string]: import('yup').ObjectSchema
|
|
20
|
+
[x: string]: import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>>, any>;
|
|
21
21
|
}, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<{
|
|
22
|
-
[x: string]: import('yup').ObjectSchema
|
|
22
|
+
[x: string]: import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>>, any>;
|
|
23
23
|
}>, import('yup/lib/object').AssertsShape<{
|
|
24
|
-
[x: string]: import('yup').ObjectSchema
|
|
24
|
+
[x: string]: import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema<any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<any>, import('yup/lib/object').AssertsShape<any>>, any>;
|
|
25
25
|
}>> | undefined;
|
|
26
26
|
statusLoad: "initial" | "reload_values_provider" | "ready";
|
|
27
27
|
};
|
|
@@ -4,16 +4,17 @@ import { CHIP_STATUS_FORMATTER_KEY_COMPONENT } from './constants';
|
|
|
4
4
|
import { ChipStatusFormatterSlots as Slots } from './slots/ChipStatusFormatterEnum';
|
|
5
5
|
import { Theme } from '@mui/material';
|
|
6
6
|
import { ChipVariants } from '../../Chip/types';
|
|
7
|
+
import { Maybe } from '@m4l/core';
|
|
7
8
|
export type ChipStatusKey = string | number;
|
|
8
9
|
export interface ChipStatusFormatterProps {
|
|
9
10
|
/**
|
|
10
11
|
* Etiqueta del chip
|
|
11
12
|
*/
|
|
12
|
-
label
|
|
13
|
+
label?: Maybe<string>;
|
|
13
14
|
/**
|
|
14
15
|
* Estado del chip
|
|
15
16
|
*/
|
|
16
|
-
status
|
|
17
|
+
status?: Maybe<string | number>;
|
|
17
18
|
/**
|
|
18
19
|
* Conjuntos de colores para los estados del chip
|
|
19
20
|
*/
|
|
@@ -15,7 +15,7 @@ const Button = forwardRef((props, ref) => {
|
|
|
15
15
|
disabled = false,
|
|
16
16
|
size = "small",
|
|
17
17
|
variant = "contained",
|
|
18
|
-
skeletonWidth = "
|
|
18
|
+
skeletonWidth = "15%",
|
|
19
19
|
...others
|
|
20
20
|
} = props;
|
|
21
21
|
const { currentSize } = useComponentSize(size);
|
|
@@ -74,6 +74,7 @@ const Button = forwardRef((props, ref) => {
|
|
|
74
74
|
size,
|
|
75
75
|
disabled,
|
|
76
76
|
disableRipple: true,
|
|
77
|
+
tabIndex: 0,
|
|
77
78
|
ownerState: { ...ownerState },
|
|
78
79
|
ref,
|
|
79
80
|
...others,
|
|
@@ -5,14 +5,36 @@ const buttonStyles = {
|
|
|
5
5
|
*/
|
|
6
6
|
buttonRoot: ({ theme, ownerState }) => ({
|
|
7
7
|
display: "flex",
|
|
8
|
+
flexWrap: "wrap",
|
|
8
9
|
alignItems: "center",
|
|
9
10
|
gap: theme.vars.size.baseSpacings.sp1,
|
|
10
11
|
padding: `0px ${theme.vars.size.baseSpacings.sp1}`,
|
|
11
12
|
boxShadow: "none",
|
|
12
13
|
borderRadius: theme.vars.size.borderRadius.r1,
|
|
14
|
+
"&:hover": {
|
|
15
|
+
backgroundColor: ownerState.paletteColor?.hoverOpacity,
|
|
16
|
+
borderColor: ownerState.paletteColor?.hover
|
|
17
|
+
},
|
|
18
|
+
"&:active": {
|
|
19
|
+
boxShadow: "none",
|
|
20
|
+
borderColor: ownerState.paletteColor?.active,
|
|
21
|
+
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
22
|
+
},
|
|
23
|
+
"&:focus-visible": {
|
|
24
|
+
boxShadow: "none",
|
|
25
|
+
outline: theme.vars.size.borderStroke.container,
|
|
26
|
+
outlineColor: theme.vars.palette.border.main,
|
|
27
|
+
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
28
|
+
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
29
|
+
},
|
|
13
30
|
"&:disabled": {
|
|
14
|
-
|
|
15
|
-
|
|
31
|
+
backgroundColor: "none",
|
|
32
|
+
"&&& .M4LIcon-icon": {
|
|
33
|
+
backgroundColor: theme.vars.palette.text.disabled
|
|
34
|
+
},
|
|
35
|
+
...ownerState.variant === "contained" && {
|
|
36
|
+
backgroundColor: ownerState.paletteColor?.enabled
|
|
37
|
+
}
|
|
16
38
|
},
|
|
17
39
|
...ownerState.variant === "contained" && {
|
|
18
40
|
backgroundColor: ownerState.paletteColor?.enabled,
|
|
@@ -20,109 +42,46 @@ const buttonStyles = {
|
|
|
20
42
|
backgroundColor: ownerState.paletteColor?.hover
|
|
21
43
|
},
|
|
22
44
|
"&:active": {
|
|
23
|
-
backgroundColor: ownerState.paletteColor?.active
|
|
24
|
-
},
|
|
25
|
-
"&:focus-visible": {
|
|
26
45
|
boxShadow: "none",
|
|
27
|
-
outline: theme.vars.size.borderStroke.container,
|
|
28
|
-
outlineColor: theme.vars.palette.border.main,
|
|
29
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
30
46
|
backgroundColor: ownerState.paletteColor?.active
|
|
31
47
|
}
|
|
32
48
|
},
|
|
33
49
|
...ownerState.variant === "outlined" && {
|
|
34
|
-
color: ownerState.paletteColor?.enabled,
|
|
35
50
|
borderColor: ownerState.paletteColor?.enabled,
|
|
36
|
-
backgroundColor: "transparent",
|
|
37
51
|
"&&& .M4LIcon-icon": {
|
|
38
52
|
backgroundColor: ownerState.paletteColor?.semanticText
|
|
39
|
-
},
|
|
40
|
-
...ownerState.color === "default" && {
|
|
41
|
-
borderColor: theme.vars.palette.border.default
|
|
42
|
-
},
|
|
43
|
-
"&&&:hover": {
|
|
44
|
-
borderColor: ownerState.paletteColor?.enabled,
|
|
45
|
-
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
46
|
-
},
|
|
47
|
-
"&&&:active": {
|
|
48
|
-
borderColor: ownerState.paletteColor?.active,
|
|
49
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
50
|
-
},
|
|
51
|
-
"&&&:focus-visible": {
|
|
52
|
-
boxShadow: "none",
|
|
53
|
-
outline: theme.vars.size.borderStroke.container,
|
|
54
|
-
outlineColor: theme.vars.palette.border.main,
|
|
55
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
56
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
57
53
|
}
|
|
58
54
|
},
|
|
59
55
|
...ownerState.variant === "text" && {
|
|
60
56
|
color: ownerState.paletteColor?.semanticText,
|
|
61
57
|
borderColor: ownerState.paletteColor?.enabled,
|
|
62
|
-
backgroundColor: "transparent",
|
|
63
58
|
"&&& .M4LIcon-icon": {
|
|
64
59
|
backgroundColor: ownerState.paletteColor?.semanticText
|
|
65
|
-
},
|
|
66
|
-
"&&&:hover": {
|
|
67
|
-
backgroundColor: ownerState.paletteColor?.hoverOpacity
|
|
68
|
-
},
|
|
69
|
-
"&&&:active": {
|
|
70
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
71
|
-
},
|
|
72
|
-
"&:focus-visible": {
|
|
73
|
-
boxShadow: "none",
|
|
74
|
-
outline: theme.vars.size.borderStroke.container,
|
|
75
|
-
outlineColor: theme.vars.palette.border.main,
|
|
76
|
-
outlineOffset: theme.vars.size.baseSpacings["sp0-5"],
|
|
77
|
-
backgroundColor: ownerState.paletteColor?.activeOpacity
|
|
78
60
|
}
|
|
79
61
|
},
|
|
80
62
|
"& span": {
|
|
81
63
|
margin: "0px"
|
|
82
64
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"action"
|
|
87
|
-
)
|
|
88
|
-
// // Estilos específicos para el tamaño small
|
|
89
|
-
// ...(ownerState.size === 'small' && {
|
|
90
|
-
// ...(theme.generalSettings.isMobile
|
|
91
|
-
// ? {
|
|
92
|
-
// height: theme.vars.size.mobile.small.action,
|
|
93
|
-
// minHeight: theme.vars.size.mobile.small.action,
|
|
94
|
-
// }
|
|
95
|
-
// : {
|
|
96
|
-
// height: theme.vars.size.desktop.small.action,
|
|
97
|
-
// minHeight: theme.vars.size.desktop.small.action,
|
|
98
|
-
// }),
|
|
99
|
-
// }),
|
|
100
|
-
// // Estilos específicos para el tamaño medium
|
|
101
|
-
// ...(ownerState.size === 'medium' && {
|
|
102
|
-
// ...(theme.generalSettings.isMobile
|
|
103
|
-
// ? {
|
|
104
|
-
// height: theme.vars.size.mobile.medium.action,
|
|
105
|
-
// minHeight: theme.vars.size.mobile.medium.action,
|
|
106
|
-
// }
|
|
107
|
-
// : {
|
|
108
|
-
// height: theme.vars.size.desktop.medium.action,
|
|
109
|
-
// minHeight: theme.vars.size.desktop.medium.action,
|
|
110
|
-
// }),
|
|
111
|
-
// }),
|
|
65
|
+
maxWidth: "100%",
|
|
66
|
+
height: "auto !important",
|
|
67
|
+
minHeight: theme.generalSettings?.isMobile ? theme.vars.size.mobile[ownerState.size || "medium"].action : theme.vars.size.desktop[ownerState.size || "medium"].action
|
|
112
68
|
}),
|
|
113
|
-
buttonIcon: {},
|
|
114
69
|
/**
|
|
115
70
|
* Styles for the text of the button component.
|
|
116
71
|
*/
|
|
117
72
|
textButton: ({ theme, ownerState }) => ({
|
|
73
|
+
cursor: ownerState.disabled ? "not-allowed" : "pointer",
|
|
118
74
|
...theme.typography.bodyDens,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
75
|
+
whiteSpace: "normal",
|
|
76
|
+
wordBreak: "break-word",
|
|
77
|
+
...ownerState.variant === "contained" && {
|
|
78
|
+
color: ownerState.paletteColor?.contrastText
|
|
79
|
+
},
|
|
80
|
+
...(ownerState.variant === "outlined" || ownerState.variant === "text") && {
|
|
81
|
+
color: ownerState.paletteColor?.semanticText
|
|
82
|
+
},
|
|
83
|
+
...ownerState.disabled && {
|
|
84
|
+
color: theme.vars.palette.text.disabled
|
|
126
85
|
}
|
|
127
86
|
}),
|
|
128
87
|
/**
|
|
@@ -141,54 +100,9 @@ const buttonStyles = {
|
|
|
141
100
|
minHeight: sizeValue
|
|
142
101
|
})
|
|
143
102
|
)
|
|
144
|
-
// // Estilos específicos para el tamaño small
|
|
145
|
-
// ...(ownerState.size === 'small' && {
|
|
146
|
-
// ...(theme.generalSettings.isMobile
|
|
147
|
-
// ? {
|
|
148
|
-
// height: theme.vars.size.mobile.small.action,
|
|
149
|
-
// minHeight: theme.vars.size.mobile.small.action,
|
|
150
|
-
// }
|
|
151
|
-
// : {
|
|
152
|
-
// height: theme.vars.size.desktop.small.action,
|
|
153
|
-
// minHeight: theme.vars.size.desktop.small.action,
|
|
154
|
-
// }),
|
|
155
|
-
// [theme.breakpoints.up('sm')]: {
|
|
156
|
-
// ...(theme.generalSettings.isMobile
|
|
157
|
-
// ? {
|
|
158
|
-
// height: theme.vars.size.mobile.small.action,
|
|
159
|
-
// minHeight: theme.vars.size.mobile.small.action,
|
|
160
|
-
// }
|
|
161
|
-
// : {
|
|
162
|
-
// height: theme.vars.size.desktop.small.action,
|
|
163
|
-
// minHeight: theme.vars.size.desktop.small.action,
|
|
164
|
-
// }),
|
|
165
|
-
// },
|
|
166
|
-
// }),
|
|
167
|
-
// // Estilos específicos para el tamaño medium
|
|
168
|
-
// ...(ownerState.size === 'medium' && {
|
|
169
|
-
// ...(theme.generalSettings.isMobile
|
|
170
|
-
// ? {
|
|
171
|
-
// height: theme.vars.size.mobile.medium.action,
|
|
172
|
-
// minHeight: theme.vars.size.mobile.medium.action,
|
|
173
|
-
// }
|
|
174
|
-
// : {
|
|
175
|
-
// height: theme.vars.size.desktop.medium.action,
|
|
176
|
-
// minHeight: theme.vars.size.desktop.medium.action,
|
|
177
|
-
// }),
|
|
178
|
-
// [theme.breakpoints.up('md')]: {
|
|
179
|
-
// ...(theme.generalSettings.isMobile
|
|
180
|
-
// ? {
|
|
181
|
-
// height: theme.vars.size.mobile.small.action,
|
|
182
|
-
// minHeight: theme.vars.size.mobile.small.action,
|
|
183
|
-
// }
|
|
184
|
-
// : {
|
|
185
|
-
// height: theme.vars.size.desktop.small.action,
|
|
186
|
-
// minHeight: theme.vars.size.desktop.small.action,
|
|
187
|
-
// }),
|
|
188
|
-
// },
|
|
189
|
-
// }),
|
|
190
103
|
}
|
|
191
|
-
})
|
|
104
|
+
}),
|
|
105
|
+
buttonIcon: {}
|
|
192
106
|
};
|
|
193
107
|
export {
|
|
194
108
|
buttonStyles as b
|
|
@@ -8,17 +8,6 @@ import { ReactNode } from 'react';
|
|
|
8
8
|
* [ButtonVariants] - Defines the possible variants for the `Button` component.
|
|
9
9
|
*/
|
|
10
10
|
export type ButtonVariants = 'contained' | 'outlined' | 'text';
|
|
11
|
-
/**
|
|
12
|
-
* Props for the `Button` component, extending the original properties of Material UI.
|
|
13
|
-
* [startIcon] - Optional prop for the icon on the left in the `Button`.
|
|
14
|
-
* [endIcon] - Optional prop for the icon on the right in the `Button`.
|
|
15
|
-
* label - Text describing the `Button`.
|
|
16
|
-
* [disabled] - Indicates if the `Button` is disabled.
|
|
17
|
-
* [size] - Size of the `Button` (default 'medium').
|
|
18
|
-
* [error] - Indicates if the `Button` is in an error state.
|
|
19
|
-
* [variant] - Defines the variant of the `Button` (default 'contained').
|
|
20
|
-
* [color] - Defines the color of the `Button`.
|
|
21
|
-
*/
|
|
22
11
|
export interface ButtonProps extends Omit<MUIButtonProps, 'size' | 'variant' | 'color'> {
|
|
23
12
|
startIcon?: ReactNode;
|
|
24
13
|
endIcon?: ReactNode;
|
|
@@ -43,4 +32,4 @@ export type ButtonSlotsType = keyof typeof ButtonSlots;
|
|
|
43
32
|
/**
|
|
44
33
|
* Styles applicable to the `Button` using themes and custom slots.
|
|
45
34
|
*/
|
|
46
|
-
export type ButtonStyles =
|
|
35
|
+
export type ButtonStyles = OverridesStyleRules<ButtonSlotsType, typeof BUTTON_KEY_COMPONENT, Theme>;
|
package/mockServiceWorker.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const PACKAGE_VERSION = '2.7.
|
|
11
|
+
const PACKAGE_VERSION = '2.7.5'
|
|
12
12
|
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
|
13
13
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
14
|
const activeClientIds = new Set()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.49",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"lint-staged": {
|
|
6
6
|
"*.{js,ts,tsx}": "eslint --fix --max-warnings 0 --no-warn-ignored"
|
|
@@ -19,21 +19,17 @@
|
|
|
19
19
|
"atmosphere.js": "^4.0.0",
|
|
20
20
|
"chart.js": "^4.4.0",
|
|
21
21
|
"chartjs-chart-error-bars": "^4.3.3",
|
|
22
|
-
"date-fns": "^2.29.2",
|
|
23
22
|
"eventemitter3": "^4.0.7",
|
|
24
23
|
"fast-equals": "^5.0.1",
|
|
25
24
|
"framer-motion": "^6.5.0",
|
|
26
25
|
"history": "5.3.0",
|
|
27
|
-
"immer": "^9.0.21",
|
|
28
26
|
"install": "^0.13.0",
|
|
29
27
|
"jwt-decode": "^4.0.0",
|
|
30
28
|
"leaflet": "^1.9.4",
|
|
31
29
|
"leaflet-polylinedecorator": "^1.6.0",
|
|
32
30
|
"leaflet.markercluster": "^1.5.3",
|
|
33
|
-
"lodash-es": "^4.17.21",
|
|
34
31
|
"nprogress": "^0.2.0",
|
|
35
32
|
"qrcode.react": "^3.1.0",
|
|
36
|
-
"qs": "^6.0.0",
|
|
37
33
|
"react": "^18.0.0",
|
|
38
34
|
"react-chartjs-2": "^5.2.0",
|
|
39
35
|
"react-color": "^2.19.3",
|
|
@@ -52,7 +48,6 @@
|
|
|
52
48
|
"react-rnd": "^10.5.2",
|
|
53
49
|
"react-router-dom": "6.3.0",
|
|
54
50
|
"react-spinners": "^0.13.8",
|
|
55
|
-
"react-toastify": "10.0.5",
|
|
56
51
|
"react-transition-group": "^4.4.5",
|
|
57
52
|
"react-virtualized-auto-sizer": "^1.0.25",
|
|
58
53
|
"react-window": "^1.8.11",
|
|
@@ -6,14 +6,6 @@ type Story = StoryObj<typeof Button>;
|
|
|
6
6
|
* Base story for `Button` in standard mode.
|
|
7
7
|
*/
|
|
8
8
|
export declare const Default: Story;
|
|
9
|
-
/**
|
|
10
|
-
* Base story for `Button` with start icon.
|
|
11
|
-
*/
|
|
12
|
-
export declare const WithStartIcon: Story;
|
|
13
|
-
/**
|
|
14
|
-
* Base story for `Button` with end icon.
|
|
15
|
-
*/
|
|
16
|
-
export declare const WithEndIcon: Story;
|
|
17
9
|
/**
|
|
18
10
|
* Base story for `Button` with start and end icon.
|
|
19
11
|
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const componentName = "M4LButton";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonClassesType, OwnerState } from './types';
|
|
2
|
-
export declare const buttonClasses: ButtonClassesType;
|
|
3
|
-
export declare function getButtonUtilityClass(slot: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* TODO: Documentar
|
|
6
|
-
*/
|
|
7
|
-
export declare const useUtilityClasses: (onwerState: OwnerState) => {
|
|
8
|
-
skeleton: string;
|
|
9
|
-
root: string;
|
|
10
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ButtonProps as MUIButtonProps } from '@mui/material';
|
|
2
|
-
import { useUtilityClasses } from '.';
|
|
3
|
-
export interface ButtonClassesType {
|
|
4
|
-
root: string;
|
|
5
|
-
skeleton: string;
|
|
6
|
-
sizeSmall: string;
|
|
7
|
-
sizeMedium: string;
|
|
8
|
-
variantOutlined: string;
|
|
9
|
-
variantContained: string;
|
|
10
|
-
variantText: string;
|
|
11
|
-
isDisabled: string;
|
|
12
|
-
colorError: string;
|
|
13
|
-
colorSuccess: string;
|
|
14
|
-
colorWarning: string;
|
|
15
|
-
/**Toggle */
|
|
16
|
-
togglePressed: string;
|
|
17
|
-
toggleNotPressed: string;
|
|
18
|
-
}
|
|
19
|
-
export type ButtonClassesKey = keyof ButtonClassesType;
|
|
20
|
-
export type Classes = ReturnType<typeof useUtilityClasses>;
|
|
21
|
-
export interface ButtonProps extends Omit<MUIButtonProps, 'size'> {
|
|
22
|
-
size?: 'small' | 'medium';
|
|
23
|
-
skeletonWidth?: number | string;
|
|
24
|
-
skeletonHeight?: number | string;
|
|
25
|
-
colorState?: 'error' | 'success' | 'warning';
|
|
26
|
-
}
|
|
27
|
-
export interface OwnerState extends Pick<ButtonProps, 'size' | 'variant' | 'colorState'> {
|
|
28
|
-
isDisabled?: boolean;
|
|
29
|
-
}
|