@m4l/components 9.3.14 â 9.3.15-BE110925-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/Card/Card.js +49 -0
- package/components/Card/Card.styles.js +56 -0
- package/components/Card/constants.js +17 -0
- package/components/Card/helpers/getSizeSpacing.d.ts +3 -2
- package/components/Card/helpers/getSizeSpacing.js +10 -0
- package/components/Card/index.js +1 -0
- package/components/Card/slots/CardEnum.js +7 -0
- package/components/Card/slots/CardSlots.js +11 -0
- package/components/Card/types.d.ts +7 -5
- package/components/MenuActions/MenuActions.js +3 -2
- package/components/MenuActions/MenuActions.styles.js +1 -1
- package/components/MenuActions/constants.d.ts +1 -0
- package/components/MenuActions/constants.js +12 -1
- package/components/MenuActions/slots/MenuActionsSlots.js +1 -1
- package/components/WindowBase/WindowBase.styles.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Autocomplete/types.d.ts +45 -2
- package/components/mui_extended/Badge/Badge.styles.js +4 -2
- package/components/mui_extended/IconButton/IconButton.js +12 -2
- package/components/mui_extended/IconButton/IconButton.styles.js +7 -7
- package/components/mui_extended/IconButton/constants.js +8 -1
- package/components/mui_extended/Typography/Typography.js +3 -1
- package/components/mui_extended/Typography/constants.d.ts +4 -0
- package/components/mui_extended/Typography/constants.js +6 -1
- package/components/mui_extended/Typography/types.d.ts +5 -0
- package/components/mui_extended/Typography/typography.styles.js +2 -0
- package/index.js +36 -34
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { C as CardRootStyled } from "./slots/CardSlots.js";
|
|
3
|
+
import { C as CARD_CLASSES } from "./constants.js";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
const Card = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
className,
|
|
8
|
+
variant = "text",
|
|
9
|
+
gap,
|
|
10
|
+
height = "auto",
|
|
11
|
+
children,
|
|
12
|
+
direction = "row",
|
|
13
|
+
justifyContent = "center",
|
|
14
|
+
alignItems = "center",
|
|
15
|
+
selected = false,
|
|
16
|
+
padding,
|
|
17
|
+
...others
|
|
18
|
+
} = props;
|
|
19
|
+
const ownerState = {
|
|
20
|
+
variant,
|
|
21
|
+
cardGap: gap,
|
|
22
|
+
height,
|
|
23
|
+
direction,
|
|
24
|
+
onClick: !!props.onClick,
|
|
25
|
+
justifyContent,
|
|
26
|
+
alignItems,
|
|
27
|
+
selected,
|
|
28
|
+
cardPadding: padding
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
CardRootStyled,
|
|
32
|
+
{
|
|
33
|
+
ownerState,
|
|
34
|
+
className: clsx(
|
|
35
|
+
CARD_CLASSES.root,
|
|
36
|
+
variant === "outlined" && CARD_CLASSES.outlined,
|
|
37
|
+
variant === "text" && CARD_CLASSES.text,
|
|
38
|
+
selected && CARD_CLASSES.selected,
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
role: "card",
|
|
42
|
+
...others,
|
|
43
|
+
children
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
Card as C
|
|
49
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { g as getSizeSpacing } from "./helpers/getSizeSpacing.js";
|
|
2
|
+
const cardStyles = {
|
|
3
|
+
/**
|
|
4
|
+
* Estilos para el contenedor principal del card.
|
|
5
|
+
*/
|
|
6
|
+
root: ({ theme, ownerState }) => {
|
|
7
|
+
const gap = getSizeSpacing(ownerState?.cardGap, theme);
|
|
8
|
+
const padding = getSizeSpacing(ownerState?.cardPadding, theme);
|
|
9
|
+
return {
|
|
10
|
+
display: "flex",
|
|
11
|
+
justifyContent: ownerState?.justifyContent ?? "center",
|
|
12
|
+
alignItems: ownerState?.alignItems ?? "center",
|
|
13
|
+
flexDirection: ownerState?.direction ?? "column",
|
|
14
|
+
gap,
|
|
15
|
+
padding,
|
|
16
|
+
transition: "all 0.2s ease-in-out",
|
|
17
|
+
width: "100%",
|
|
18
|
+
outline: "unset!important",
|
|
19
|
+
borderRadius: theme.vars.size.borderRadius.r2,
|
|
20
|
+
backgroundColor: theme.palette.background.paper,
|
|
21
|
+
height: ownerState?.height ?? "auto",
|
|
22
|
+
minHeight: ownerState?.height ?? "auto",
|
|
23
|
+
maxHeight: ownerState?.height ?? "auto",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
...ownerState?.onClick && {
|
|
26
|
+
cursor: "pointer",
|
|
27
|
+
"&:hover": {
|
|
28
|
+
backgroundColor: theme.vars.palette.background.base
|
|
29
|
+
},
|
|
30
|
+
"&:active": {
|
|
31
|
+
backgroundColor: theme.vars.palette.default.activeOpacity
|
|
32
|
+
},
|
|
33
|
+
"&:focus-visible, &:focus-within": {
|
|
34
|
+
border: theme.vars.size.borderStroke.container,
|
|
35
|
+
borderColor: `${theme.vars.palette.primary.focusVisible}!important`,
|
|
36
|
+
outline: "unset!important"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
...ownerState?.variant === "outlined" && {
|
|
40
|
+
border: theme.vars.size.borderStroke.container,
|
|
41
|
+
borderColor: theme.vars.palette.border.disabled
|
|
42
|
+
},
|
|
43
|
+
...ownerState?.variant === "text" && {
|
|
44
|
+
border: theme.vars.size.borderStroke.container,
|
|
45
|
+
borderColor: "transparent"
|
|
46
|
+
},
|
|
47
|
+
...ownerState?.selected && {
|
|
48
|
+
border: theme.vars.size.borderStroke.container,
|
|
49
|
+
borderColor: theme.vars.palette.primary.enabled
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
cardStyles as c
|
|
56
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { C as CardSlots } from "./slots/CardEnum.js";
|
|
3
|
+
const CARD_KEY = "M4LCard";
|
|
4
|
+
const CARD_VARIANTS = {
|
|
5
|
+
text: "text",
|
|
6
|
+
outlined: "outlined"
|
|
7
|
+
};
|
|
8
|
+
const COMBINED_CLASSES = {
|
|
9
|
+
...CARD_VARIANTS,
|
|
10
|
+
...CardSlots,
|
|
11
|
+
selected: "selected"
|
|
12
|
+
};
|
|
13
|
+
const CARD_CLASSES = getComponentClasses(CARD_KEY, COMBINED_CLASSES);
|
|
14
|
+
export {
|
|
15
|
+
CARD_CLASSES as C,
|
|
16
|
+
CARD_KEY as a
|
|
17
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CardProps } from '../types';
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
2
3
|
/**
|
|
3
4
|
* Obtiene el tamaÃąo del gap de la tarjeta.
|
|
4
|
-
* @param
|
|
5
|
+
* @param spacing - El gap de la tarjeta.
|
|
5
6
|
* @returns El tamaÃąo del gap de la tarjeta.
|
|
6
7
|
*/
|
|
7
|
-
export declare const getSizeSpacing: (
|
|
8
|
+
export declare const getSizeSpacing: (spacing: CardProps["gap"] | number | undefined | null, theme: Theme) => string | number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { a as CARD_KEY } from "../constants.js";
|
|
3
|
+
import { C as CardSlots } from "./CardEnum.js";
|
|
4
|
+
import { c as cardStyles } from "../Card.styles.js";
|
|
5
|
+
const CardRootStyled = styled("div", {
|
|
6
|
+
name: CARD_KEY,
|
|
7
|
+
slot: CardSlots.root
|
|
8
|
+
})(cardStyles?.root);
|
|
9
|
+
export {
|
|
10
|
+
CardRootStyled as C
|
|
11
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
1
|
+
import { Theme } from '@mui/material/styles';
|
|
2
2
|
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
3
3
|
import { CARD_KEY } from './constants';
|
|
4
4
|
import { CardSlots } from './slots/CardEnum';
|
|
5
|
+
import { Density } from '@m4l/styles';
|
|
6
|
+
export type SpacingsCard = number | keyof Density;
|
|
5
7
|
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
8
|
/**
|
|
7
9
|
* Contenido de la tarjeta.
|
|
@@ -14,11 +16,11 @@ export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
14
16
|
/**
|
|
15
17
|
* Espacio entre los elementos de la tarjeta.
|
|
16
18
|
*/
|
|
17
|
-
gap?:
|
|
19
|
+
gap?: SpacingsCard;
|
|
18
20
|
/**
|
|
19
21
|
* Espacio entre los elementos de la tarjeta.
|
|
20
22
|
*/
|
|
21
|
-
padding?:
|
|
23
|
+
padding?: SpacingsCard;
|
|
22
24
|
/**
|
|
23
25
|
* DirecciÃģn de la tarjeta.
|
|
24
26
|
*/
|
|
@@ -47,9 +49,9 @@ export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
47
49
|
export type CardSlotsType = keyof typeof CardSlots;
|
|
48
50
|
export type CardOwnerState = {
|
|
49
51
|
variant: CardProps['variant'];
|
|
50
|
-
|
|
52
|
+
cardGap: CardProps['gap'];
|
|
51
53
|
height: CardProps['height'];
|
|
52
|
-
|
|
54
|
+
cardPadding: CardProps['padding'];
|
|
53
55
|
direction: CardProps['direction'];
|
|
54
56
|
onClick: boolean;
|
|
55
57
|
justifyContent: CardProps['justifyContent'];
|
|
@@ -4,9 +4,10 @@ import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
|
4
4
|
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
5
5
|
import { P as Popover } from "../mui_extended/Popover/Popover.js";
|
|
6
6
|
import { M as MenuItem } from "../mui_extended/MenuItem/MenuItem.js";
|
|
7
|
-
import { I as ICON_PATH, a as ICONS, M as MENU_ACTIONS_ } from "./constants.js";
|
|
7
|
+
import { I as ICON_PATH, a as ICONS, M as MENU_ACTIONS_, b as MENU_ACTIONS_CLASSES } from "./constants.js";
|
|
8
8
|
import { a as getMenuActionsDictionary, D as DICTIONARY } from "./dictionary.js";
|
|
9
9
|
import { M as MenuDivider } from "../mui_extended/MenuDivider/MenuDivider.js";
|
|
10
|
+
import clsx from "clsx";
|
|
10
11
|
import { M as MenuListStyled, a as MenuLoaderStyled, R as RootStyled, I as IconButtonStyled, H as HeaderMenuActionsStyled, F as FooterMenuActionsStyled } from "./slots/MenuActionsSlots.js";
|
|
11
12
|
import { C as CircularProgress } from "../mui_extended/CircularProgress/CircularProgress.js";
|
|
12
13
|
function MenuActions(props) {
|
|
@@ -128,7 +129,7 @@ function MenuActions(props) {
|
|
|
128
129
|
endListElement && endListElement
|
|
129
130
|
] });
|
|
130
131
|
}, [menuActions, header, size, footer, endListElement, objItem, getLabel, actionKey, handleClick]);
|
|
131
|
-
return /* @__PURE__ */ jsxs(RootStyled, { className, ownerState: { ownerState }, children: [
|
|
132
|
+
return /* @__PURE__ */ jsxs(RootStyled, { className: clsx(className, MENU_ACTIONS_CLASSES.root, ownerState.selected && MENU_ACTIONS_CLASSES.selected), ownerState: { ownerState }, children: [
|
|
132
133
|
/* @__PURE__ */ jsx(
|
|
133
134
|
IconButtonStyled,
|
|
134
135
|
{
|
|
@@ -38,7 +38,7 @@ const menuActionsStyles = {
|
|
|
38
38
|
"& active": {
|
|
39
39
|
backgroundColor: theme.vars.palette[ownerState?.paletteColor ?? "default"].selectedOpacity
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
"& .M4LIcon-icon": {
|
|
42
42
|
backgroundColor: ownerState?.selected ? theme.vars.palette[ownerState?.paletteColor ?? "default"].selected : void 0
|
|
43
43
|
}
|
|
44
44
|
}),
|
|
@@ -20,3 +20,4 @@ export declare const MENU_ACTIONS_EMPTY = "menu_action_empty";
|
|
|
20
20
|
* Prefijo de la clave que se utiliza cuando un Ãtem del menÚ estÃĄ cargando en React.
|
|
21
21
|
*/
|
|
22
22
|
export declare const MENU_ACTIONS_ = "menu_action_";
|
|
23
|
+
export declare const MENU_ACTIONS_CLASSES: Record<string, string>;
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { M as MenuActionsSlots } from "./slots/MenuActionsEnum.js";
|
|
1
3
|
const ICON_PATH = "frontend/components/menu_actions/assets/icons";
|
|
2
4
|
const ICONS = {
|
|
3
5
|
MENU: "menu.svg"
|
|
4
6
|
};
|
|
5
7
|
const MENU_ACTIONS_KEY_COMPONENT = "M4LMenuActions";
|
|
6
8
|
const MENU_ACTIONS_ = "menu_action_";
|
|
9
|
+
const MenuActionsComplementaryClasses = {
|
|
10
|
+
selected: "selected"
|
|
11
|
+
};
|
|
12
|
+
const MENU_ACTIONS_COMBINATE_CLASSES = {
|
|
13
|
+
...MenuActionsSlots,
|
|
14
|
+
...MenuActionsComplementaryClasses
|
|
15
|
+
};
|
|
16
|
+
const MENU_ACTIONS_CLASSES = getComponentClasses(MENU_ACTIONS_KEY_COMPONENT, MENU_ACTIONS_COMBINATE_CLASSES);
|
|
7
17
|
export {
|
|
8
18
|
ICON_PATH as I,
|
|
9
19
|
MENU_ACTIONS_ as M,
|
|
10
20
|
ICONS as a,
|
|
11
|
-
|
|
21
|
+
MENU_ACTIONS_CLASSES as b,
|
|
22
|
+
MENU_ACTIONS_KEY_COMPONENT as c
|
|
12
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MenuList } from "@mui/material";
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
|
-
import {
|
|
3
|
+
import { c as MENU_ACTIONS_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { m as menuActionsStyles } from "../MenuActions.styles.js";
|
|
5
5
|
import { M as MenuActionsSlots } from "./MenuActionsEnum.js";
|
|
6
6
|
import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
|
|
@@ -291,7 +291,7 @@ const windowBaseStyles = {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
},
|
|
294
|
-
"&.MuiButtonBase-root:not(:hover, :active, :focus) .M4LIcon-root .M4LIcon-icon": {
|
|
294
|
+
"&.MuiButtonBase-root:not(:hover, :active, :focus, .M4LIconButton-selected) .M4LIcon-root .M4LIcon-icon": {
|
|
295
295
|
backgroundColor: `${theme.vars.palette.text.disabled} !important`
|
|
296
296
|
}
|
|
297
297
|
},
|
package/components/index.d.ts
CHANGED
|
@@ -8,30 +8,72 @@ import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
|
8
8
|
export type GetOptionString<T> = (option: T | null) => string;
|
|
9
9
|
export type AutocompleteVariants = 'outlined' | 'text';
|
|
10
10
|
export interface BaseAutocompleteProps {
|
|
11
|
+
/**
|
|
12
|
+
* The size of the autocomplete input field.
|
|
13
|
+
*/
|
|
11
14
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
15
|
+
/**
|
|
16
|
+
* The variant of the autocomplete (e.g., outlined, contained, text).
|
|
17
|
+
*/
|
|
12
18
|
variant?: AutocompleteVariants;
|
|
19
|
+
/**
|
|
20
|
+
* Custom data-testid for testing purposes.
|
|
21
|
+
*/
|
|
13
22
|
dataTestid?: string;
|
|
14
23
|
}
|
|
15
24
|
/**
|
|
16
25
|
* Props for the unified Autocomplete component.
|
|
17
26
|
* Supports both single and multiple selection, and two types: `text` and `image`.
|
|
18
27
|
*/
|
|
19
|
-
export interface AutocompleteProps<T, Multiple extends boolean | undefined> extends Pick<MUIAutocompleteProps<T, Multiple, undefined, false>, 'options' | 'onOpen' | 'onClose' | 'loading' | 'disabled'>, Pick<TextFieldProps, 'error'>, BaseAutocompleteProps {
|
|
28
|
+
export interface AutocompleteProps<T, Multiple extends boolean | undefined> extends Pick<MUIAutocompleteProps<T, Multiple, undefined, false>, 'options' | 'onOpen' | 'onClose' | 'loading' | 'disabled' | 'open'>, Pick<TextFieldProps, 'error' | 'focused'>, BaseAutocompleteProps {
|
|
29
|
+
/**
|
|
30
|
+
* Indica si el campo de texto estÃĄ en modo de solo lectura.
|
|
31
|
+
* readOnly={true}
|
|
32
|
+
*/
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The placeholder of the autocomplete.
|
|
36
|
+
* placeholder={}
|
|
37
|
+
*/
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether multiple selections are allowed.
|
|
41
|
+
* multiple={true}
|
|
42
|
+
*/
|
|
20
43
|
multiple?: boolean;
|
|
21
44
|
/**
|
|
22
45
|
* The value of the autocomplete, supports single or multiple selection.
|
|
23
46
|
* Extended to include `null` for controlled components.
|
|
24
47
|
*/
|
|
25
|
-
value: T | T[] | null |
|
|
48
|
+
value: T | T[] | null | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Function to get the label for a given option.
|
|
51
|
+
*/
|
|
26
52
|
getOptionLabel: (option: T | AutocompleteFreeSoloValueMapping<false>) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Function to compare if an option matches the selected value.
|
|
55
|
+
*/
|
|
27
56
|
isOptionEqualToValue: (option: T, value: T) => boolean;
|
|
28
57
|
/**
|
|
29
58
|
* Function to refresh the options.
|
|
30
59
|
*/
|
|
31
60
|
refresh?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Callback for filtering options based on user input.
|
|
63
|
+
*/
|
|
32
64
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Function to get the image URL for a given option (only for `type: 'image'`).
|
|
67
|
+
*/
|
|
33
68
|
getOptionUrlImage?: (option: T) => string;
|
|
69
|
+
/**
|
|
70
|
+
* se cambia el nativo de Autocomplete por este, debido a que el value esta disponible para procesar
|
|
71
|
+
* Handler for when the selected value changes.
|
|
72
|
+
*/
|
|
34
73
|
onChange: (event: ChangeEvent<{}> | undefined, value: T | T[] | null, reason: AutocompleteChangeReason) => void;
|
|
74
|
+
/**
|
|
75
|
+
* "htmlFor" attribute for the autocomplete field.
|
|
76
|
+
*/
|
|
35
77
|
htmlFor?: string;
|
|
36
78
|
}
|
|
37
79
|
/**
|
|
@@ -41,6 +83,7 @@ export interface AutocompleteOwnerState extends Pick<BaseAutocompleteProps, 'siz
|
|
|
41
83
|
error?: boolean;
|
|
42
84
|
disabled?: boolean;
|
|
43
85
|
multiple?: boolean;
|
|
86
|
+
readOnly?: boolean;
|
|
44
87
|
}
|
|
45
88
|
/**
|
|
46
89
|
* Defines the types of Slots available for the Autocomplete.
|
|
@@ -24,11 +24,13 @@ const badgeStyles = {
|
|
|
24
24
|
...theme.generalSettings.isMobile ? {
|
|
25
25
|
height: theme.vars.size.baseSpacings.sp5,
|
|
26
26
|
width: ownerState?.displayBadgeContent ? "26px" : theme.vars.size.baseSpacings.sp5,
|
|
27
|
-
right: ownerState?.displayBadgeContent ?
|
|
27
|
+
right: ownerState?.displayBadgeContent ? 0 : 2,
|
|
28
|
+
top: ownerState?.displayBadgeContent ? 0 : 2
|
|
28
29
|
} : {
|
|
29
30
|
height: theme.vars.size.baseSpacings["sp3-5"],
|
|
30
31
|
width: ownerState?.displayBadgeContent ? "23px" : theme.vars.size.baseSpacings["sp3-5"],
|
|
31
|
-
right: ownerState?.displayBadgeContent ?
|
|
32
|
+
right: ownerState?.displayBadgeContent ? 0 : 2,
|
|
33
|
+
top: ownerState?.displayBadgeContent ? 0 : 2
|
|
32
34
|
},
|
|
33
35
|
// Estilos para variantes
|
|
34
36
|
...ownerState?.BadgeVariant === "dot" && {
|
|
@@ -88,7 +88,12 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
88
88
|
color,
|
|
89
89
|
role: "button",
|
|
90
90
|
...other,
|
|
91
|
-
className: clsx(
|
|
91
|
+
className: clsx(
|
|
92
|
+
ICON_BUTTON_CLASSES[variant],
|
|
93
|
+
ICON_BUTTON_CLASSES.styledMUIIconButton,
|
|
94
|
+
selected && ICON_BUTTON_CLASSES.selected,
|
|
95
|
+
className
|
|
96
|
+
),
|
|
92
97
|
children: renderIcon(icon || src)
|
|
93
98
|
}
|
|
94
99
|
)
|
|
@@ -104,7 +109,12 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
104
109
|
"data-testid": "IconButtonRoot",
|
|
105
110
|
color,
|
|
106
111
|
...other,
|
|
107
|
-
className: clsx(
|
|
112
|
+
className: clsx(
|
|
113
|
+
ICON_BUTTON_CLASSES[variant],
|
|
114
|
+
ICON_BUTTON_CLASSES.styledMUIIconButton,
|
|
115
|
+
selected && ICON_BUTTON_CLASSES.selected,
|
|
116
|
+
className
|
|
117
|
+
),
|
|
108
118
|
children: renderIcon(icon || src)
|
|
109
119
|
}
|
|
110
120
|
);
|
|
@@ -13,7 +13,7 @@ const iconButtonStyles = {
|
|
|
13
13
|
overflow: "hidden",
|
|
14
14
|
cursor: ownerState?.disabled ? "not-allowed" : "pointer",
|
|
15
15
|
color: theme.vars.palette.text.primary,
|
|
16
|
-
borderRadius: theme.size.borderRadius
|
|
16
|
+
borderRadius: theme.size.borderRadius["r1-5"],
|
|
17
17
|
pointerEvents: ownerState?.disabled ? "none" : "auto",
|
|
18
18
|
display: ownerState?.isSkeleton ? "none" : "flex",
|
|
19
19
|
justifyContent: "center",
|
|
@@ -47,24 +47,24 @@ const iconButtonStyles = {
|
|
|
47
47
|
// Estilos para la variante contained
|
|
48
48
|
...ownerState?.variant === "contained" && {
|
|
49
49
|
// ðŊ Color de fondo segÚn variante y color del componente
|
|
50
|
-
backgroundColor: ownerState?.variant === "contained" ? ownerState?.color === "error" ? paletteColor.active : ownerState?.color === "default" ? theme.vars.palette.primary.selected : paletteColor.selected : ownerState?.color === "error" ? paletteColor.activeOpacity : paletteColor.selectedOpacity,
|
|
50
|
+
backgroundColor: ownerState?.variant === "contained" ? ownerState?.color === "error" ? paletteColor.active : ownerState?.color === "default" ? theme.vars.palette.primary.selected : ownerState?.color === "success" ? theme.vars.palette.success.selected : paletteColor.selected : ownerState?.color === "error" ? paletteColor.activeOpacity : paletteColor.selectedOpacity,
|
|
51
51
|
"&&& .M4LIcon-icon": {
|
|
52
52
|
backgroundColor: ownerState?.variant === "contained" ? theme.vars.palette.primary.contrastText : paletteColor.semanticText
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
// Estilos para la variante text
|
|
56
56
|
...ownerState.variant === "outline" && {
|
|
57
|
-
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.
|
|
57
|
+
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.selectedOpacity : paletteColor.selectedOpacity,
|
|
58
58
|
border: theme.vars.size.borderStroke.actionInput,
|
|
59
59
|
borderColor: ownerState.color === "default" ? theme.vars.palette.primary.active : paletteColor.active,
|
|
60
60
|
"&&& .M4LIcon-icon": {
|
|
61
|
-
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.semanticText : paletteColor.selected
|
|
61
|
+
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.semanticText : ownerState.color === "warning" ? paletteColor.active : paletteColor.selected
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
...ownerState.variant === "text" && {
|
|
65
|
-
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.
|
|
65
|
+
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.selectedOpacity : paletteColor.selectedOpacity,
|
|
66
66
|
"&&& .M4LIcon-icon": {
|
|
67
|
-
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.semanticText : paletteColor.selected
|
|
67
|
+
backgroundColor: ownerState.color === "default" ? theme.vars.palette.primary.semanticText : ownerState.color === "warning" ? paletteColor.active : paletteColor.selected
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
} : {
|
|
@@ -128,7 +128,7 @@ const iconButtonStyles = {
|
|
|
128
128
|
backgroundColor: paletteColor.enabled,
|
|
129
129
|
// ðžïļ Color del icono
|
|
130
130
|
"&&& .M4LIcon-icon": {
|
|
131
|
-
backgroundColor: paletteColor.semanticText
|
|
131
|
+
backgroundColor: ownerState?.color === "default" ? paletteColor.semanticText : paletteColor.contrastText
|
|
132
132
|
},
|
|
133
133
|
// ðąïļ Estado Hover
|
|
134
134
|
"&:hover": {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
2
|
import { I as IconButtonSlots } from "./slots/IconButtonEnum.js";
|
|
3
3
|
const ICON_BUTTON_KEY_COMPONENT = "M4LIconButton";
|
|
4
|
-
const
|
|
4
|
+
const IconButtonComplementaryClasses = {
|
|
5
|
+
selected: "selected"
|
|
6
|
+
};
|
|
7
|
+
const IconButtonCombineClasses = {
|
|
8
|
+
...IconButtonSlots,
|
|
9
|
+
...IconButtonComplementaryClasses
|
|
10
|
+
};
|
|
11
|
+
const ICON_BUTTON_CLASSES = getComponentClasses(ICON_BUTTON_KEY_COMPONENT, IconButtonCombineClasses);
|
|
5
12
|
export {
|
|
6
13
|
ICON_BUTTON_CLASSES as I,
|
|
7
14
|
ICON_BUTTON_KEY_COMPONENT as a
|
|
@@ -18,6 +18,7 @@ function Typography(props) {
|
|
|
18
18
|
children,
|
|
19
19
|
disabled,
|
|
20
20
|
ellipsis = false,
|
|
21
|
+
fontFamily = "Inter",
|
|
21
22
|
...other
|
|
22
23
|
} = props;
|
|
23
24
|
const isSkeleton = useModuleSkeleton();
|
|
@@ -30,7 +31,8 @@ function Typography(props) {
|
|
|
30
31
|
skeletonRows,
|
|
31
32
|
variant,
|
|
32
33
|
skeleton: isSkeleton,
|
|
33
|
-
ellipsis
|
|
34
|
+
ellipsis,
|
|
35
|
+
fontFamily
|
|
34
36
|
};
|
|
35
37
|
return /* @__PURE__ */ jsx(
|
|
36
38
|
StyledMUITypography,
|
|
@@ -11,3 +11,7 @@ export declare const TYPOGRAPHY_CLASS_NAME_SPECIFY = "M4lclassCssSpecificity";
|
|
|
11
11
|
* Inventario de clases CSS para el componente Typography.
|
|
12
12
|
*/
|
|
13
13
|
export declare const TYPOGRAPHY_CLASSES: Record<string, string>;
|
|
14
|
+
export declare const TYPOGRAPHY_FONTS: {
|
|
15
|
+
Inter: string;
|
|
16
|
+
Jura: string;
|
|
17
|
+
};
|
|
@@ -3,8 +3,13 @@ import { T as TypographySlots } from "./slots/typographyEnum.js";
|
|
|
3
3
|
const TYPOGRAPHY_KEY_COMPONENT = "M4LTypography";
|
|
4
4
|
const TYPOGRAPHY_CLASS_NAME_SPECIFY = "M4lclassCssSpecificity";
|
|
5
5
|
const TYPOGRAPHY_CLASSES = getComponentClasses(TYPOGRAPHY_KEY_COMPONENT, TypographySlots);
|
|
6
|
+
const TYPOGRAPHY_FONTS = {
|
|
7
|
+
Inter: "Inter",
|
|
8
|
+
Jura: "Jura"
|
|
9
|
+
};
|
|
6
10
|
export {
|
|
7
11
|
TYPOGRAPHY_CLASSES as T,
|
|
8
12
|
TYPOGRAPHY_KEY_COMPONENT as a,
|
|
9
|
-
TYPOGRAPHY_CLASS_NAME_SPECIFY as b
|
|
13
|
+
TYPOGRAPHY_CLASS_NAME_SPECIFY as b,
|
|
14
|
+
TYPOGRAPHY_FONTS as c
|
|
10
15
|
};
|
|
@@ -47,6 +47,10 @@ export interface TypographyProps extends Omit<MUITypographyProps, 'color' | 'var
|
|
|
47
47
|
* Si se activa, el texto se corta y se muestra un elipsis.
|
|
48
48
|
*/
|
|
49
49
|
ellipsis?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Familia de fuentes a usar para el componente.
|
|
52
|
+
*/
|
|
53
|
+
fontFamily?: 'Inter' | 'Jura';
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* Define valores de estado necesarios para estilar el componente.
|
|
@@ -59,6 +63,7 @@ export interface TypographyOwnerState {
|
|
|
59
63
|
skeletonRows: TypographyProps['skeletonRows'];
|
|
60
64
|
skeleton: boolean;
|
|
61
65
|
ellipsis: TypographyProps['ellipsis'];
|
|
66
|
+
fontFamily: TypographyProps['fontFamily'];
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
64
69
|
* Agrupa la lista de slots del componente.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { g as getSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
2
|
import { g as getTypographyStyles } from "../../../utils/getTypographyStyles.js";
|
|
3
|
+
import { c as TYPOGRAPHY_FONTS } from "./constants.js";
|
|
3
4
|
const typographyStyles = {
|
|
4
5
|
/**
|
|
5
6
|
* Slot: root
|
|
@@ -8,6 +9,7 @@ const typographyStyles = {
|
|
|
8
9
|
root: ({ ownerState, theme }) => ({
|
|
9
10
|
margin: 0,
|
|
10
11
|
cursor: "default",
|
|
12
|
+
fontFamily: TYPOGRAPHY_FONTS[ownerState?.fontFamily || "Inter"],
|
|
11
13
|
"&.M4lclassCssSpecificity": {
|
|
12
14
|
// Estilos generales ð
|
|
13
15
|
// skeleton spacing when multiple rows ðĶī
|
package/index.js
CHANGED
|
@@ -18,7 +18,8 @@ import { a as a2, A as A6 } from "./components/areas/contexts/AreasContext/index
|
|
|
18
18
|
import { u } from "./components/areas/hooks/useAreas/index.js";
|
|
19
19
|
import { A as A7, a as a3, L as L2, b as b2, g as g3 } from "./components/areas/dictionary.js";
|
|
20
20
|
import { B } from "./components/BaseModule/BaseModule.js";
|
|
21
|
-
import { C } from "./components/
|
|
21
|
+
import { C } from "./components/Card/Card.js";
|
|
22
|
+
import { C as C2 } from "./components/Chip/Chip.js";
|
|
22
23
|
import { A as A8 } from "./components/commercial/AppBarCommercial/index.js";
|
|
23
24
|
import { H } from "./components/commercial/HamburgerMenu/HamburgerMenu.js";
|
|
24
25
|
import { T } from "./components/commercial/TopBar/TopBar.js";
|
|
@@ -29,32 +30,32 @@ import { A as A11 } from "./components/CommonActions/components/ActionIntro/Acti
|
|
|
29
30
|
import { A as A12 } from "./components/CommonActions/components/ActionFormCancel/ActionFormCancel.js";
|
|
30
31
|
import { A as A13 } from "./components/CommonActions/components/ActionFormIntro/ActionFormIntro.js";
|
|
31
32
|
import { D, d, g as g4 } from "./components/CommonActions/dictionary.js";
|
|
32
|
-
import { C as
|
|
33
|
+
import { C as C3 } from "./components/ContainerFlow/ContainerFlow.js";
|
|
33
34
|
import { D as D2 } from "./components/DataGrid/DataGrid.js";
|
|
34
35
|
import { g as g5 } from "./components/DataGrid/dictionary.js";
|
|
35
36
|
import { N, T as T2 } from "./components/DataGrid/subcomponents/editors/TextEditor/index.js";
|
|
36
37
|
import { g as g6 } from "./components/DataGrid/utils/getDataGridRowsFromSet.js";
|
|
37
38
|
import { b as b3, a as a4, e } from "./components/DataGrid/constants.js";
|
|
38
|
-
import { C as
|
|
39
|
+
import { C as C4 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js";
|
|
39
40
|
import { u as u2 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.js";
|
|
40
|
-
import { C as
|
|
41
|
+
import { C as C5 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js";
|
|
41
42
|
import { u as u3 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.js";
|
|
42
|
-
import { C as
|
|
43
|
+
import { C as C6 } from "./components/DataGrid/formatters/ColumnDateFormatter/formatter.js";
|
|
43
44
|
import { u as u4 } from "./components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.js";
|
|
44
|
-
import { C as
|
|
45
|
-
import { C as
|
|
45
|
+
import { C as C7 } from "./components/DataGrid/formatters/ColumnIconFormatter/formatter.js";
|
|
46
|
+
import { C as C8 } from "./components/DataGrid/formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
46
47
|
import { u as u5 } from "./components/DataGrid/formatters/ColumnInteractiveCheckFormatter/useColumnInteractiveCheck.js";
|
|
47
|
-
import { C as
|
|
48
|
+
import { C as C9 } from "./components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.js";
|
|
48
49
|
import { u as u6 } from "./components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.js";
|
|
49
|
-
import { C as
|
|
50
|
+
import { C as C10 } from "./components/DataGrid/formatters/ColumnPointsFormatter/formatter.js";
|
|
50
51
|
import { u as u7 } from "./components/DataGrid/formatters/ColumnPointsFormatter/useColumnPoints.js";
|
|
51
|
-
import { C as
|
|
52
|
+
import { C as C11 } from "./components/DataGrid/formatters/ColumnPriceFormatter/formatter.js";
|
|
52
53
|
import { u as u8 } from "./components/DataGrid/formatters/ColumnPriceFormatter/useColumnPrice.js";
|
|
53
|
-
import { C as
|
|
54
|
+
import { C as C12 } from "./components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js";
|
|
54
55
|
import { u as u9 } from "./components/DataGrid/formatters/ColumnSetCheckFormatter/useColumnSetCheck.js";
|
|
55
|
-
import { C as
|
|
56
|
+
import { C as C13 } from "./components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.js";
|
|
56
57
|
import { u as u10 } from "./components/DataGrid/formatters/ColumnUncertaintyFormatter/useColumnUncertainty.js";
|
|
57
|
-
import { C as
|
|
58
|
+
import { C as C14 } from "./components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js";
|
|
58
59
|
import { u as u11 } from "./components/DataGrid/formatters/ColumnChipStatusFormatter/useColumnChipStatus.js";
|
|
59
60
|
import { D as D3 } from "./components/DragResizeWindowRND/DragResizeWindowRND.js";
|
|
60
61
|
import { d as d2 } from "./components/DragResizeWindowRND/classes/index.js";
|
|
@@ -77,7 +78,7 @@ import { R as R3 } from "./components/extended/React-Json-Viewer/ReactJsonViewer
|
|
|
77
78
|
import { A as A14 } from "./components/mui_extended/Avatar/Avatar.js";
|
|
78
79
|
import { B as B2 } from "./components/mui_extended/BoxIcon/index.js";
|
|
79
80
|
import { B as B3 } from "./components/mui_extended/Breadcrumbs/index.js";
|
|
80
|
-
import { C as
|
|
81
|
+
import { C as C15 } from "./components/mui_extended/CircularProgress/CircularProgress.js";
|
|
81
82
|
import { B as B4 } from "./components/mui_extended/Badge/Badge.js";
|
|
82
83
|
import { L as L3 } from "./components/mui_extended/LinearProgress/index.js";
|
|
83
84
|
import { L as L4 } from "./components/mui_extended/LinkWithRoute/index.js";
|
|
@@ -87,7 +88,7 @@ import { A as A15 } from "./components/mui_extended/Accordion/Accordion.js";
|
|
|
87
88
|
import { T as T3 } from "./components/mui_extended/Tooltip/Tooltip.js";
|
|
88
89
|
import { I as I2 } from "./components/mui_extended/IconButton/IconButton.js";
|
|
89
90
|
import { B as B5 } from "./components/mui_extended/Button/Button.js";
|
|
90
|
-
import { C as
|
|
91
|
+
import { C as C16 } from "./components/mui_extended/CheckBox/CheckBox.js";
|
|
91
92
|
import { I as I3 } from "./components/mui_extended/ImageButton/ImageButton.js";
|
|
92
93
|
import { P as P2 } from "./components/mui_extended/Popover/Popover.js";
|
|
93
94
|
import { S as S4 } from "./components/mui_extended/Select/Select.js";
|
|
@@ -115,10 +116,10 @@ import { B as B6 } from "./components/formatters/BooleanFormatter/BooleanFormatt
|
|
|
115
116
|
import { D as D8, g as g12 } from "./components/formatters/DateFormatter/DateFormatter.js";
|
|
116
117
|
import { U, g as g13 } from "./components/formatters/UncertaintyFormatter/UncertaintyFormatter.js";
|
|
117
118
|
import { P as P3, g as g14 } from "./components/formatters/PointsFormatter/PointsFormatter.js";
|
|
118
|
-
import { C as
|
|
119
|
+
import { C as C17, g as g15 } from "./components/formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
|
|
119
120
|
import { P as P4, u as u12 } from "./components/formatters/PeriodFormatter/PeriodFormatter.js";
|
|
120
121
|
import { P as P5, g as g16 } from "./components/formatters/PriceFormatter/PriceFormatter.js";
|
|
121
|
-
import { C as
|
|
122
|
+
import { C as C18 } from "./components/formatters/ChipStatusFormatter/ChipStatusFormatter.js";
|
|
122
123
|
import { g as g17 } from "./components/formatters/DistanceToNowFormatter/dictionary.js";
|
|
123
124
|
import { D as D9 } from "./components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js";
|
|
124
125
|
import { g as g18 } from "./components/formatters/dictionary.js";
|
|
@@ -265,23 +266,24 @@ export {
|
|
|
265
266
|
B2 as BoxIcon,
|
|
266
267
|
B3 as Breadcrumbs,
|
|
267
268
|
B5 as Button,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
C5 as
|
|
276
|
-
C6 as
|
|
277
|
-
C7 as
|
|
278
|
-
C8 as
|
|
279
|
-
C9 as
|
|
280
|
-
C10 as
|
|
281
|
-
C11 as
|
|
282
|
-
C12 as
|
|
283
|
-
|
|
284
|
-
|
|
269
|
+
C as Card,
|
|
270
|
+
C16 as CheckBox,
|
|
271
|
+
C2 as Chip,
|
|
272
|
+
C18 as ChipStatusFormatter,
|
|
273
|
+
C15 as CircularProgress,
|
|
274
|
+
C4 as ColumnBooleanFormatter,
|
|
275
|
+
C14 as ColumnChipStatusFormatter,
|
|
276
|
+
C5 as ColumnConcatenatedValueFormatter,
|
|
277
|
+
C6 as ColumnDateFormatter,
|
|
278
|
+
C7 as ColumnIconFormatter,
|
|
279
|
+
C8 as ColumnInteractiveCheckFormatter,
|
|
280
|
+
C9 as ColumnNestedValueFormatter,
|
|
281
|
+
C10 as ColumnPointsFormatter,
|
|
282
|
+
C11 as ColumnPriceFormatter,
|
|
283
|
+
C12 as ColumnSetCheckFormatter,
|
|
284
|
+
C13 as ColumnUncertaintyFormatter,
|
|
285
|
+
C17 as ConcatenatedFormatter,
|
|
286
|
+
C3 as ContainerFlow,
|
|
285
287
|
b3 as DATAGRID_ROW_HEADER_HEIGHTS,
|
|
286
288
|
a4 as DATAGRID_ROW_HEIGHTS,
|
|
287
289
|
e as DATAGRID_SEMANTIC_WIDTHS,
|