@m4l/components 9.2.56-beta.4 → 9.2.56-beta.6
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/.storybook/utils/getStylesColorsByMode.d.ts +48 -0
- package/components/Chip/Chip.js +1 -1
- package/components/CommonActions/components/ActionCancel/ActionCancel.js +1 -1
- package/components/CommonActions/components/ActionIntro/ActionIntro.js +1 -1
- package/components/CommonActions/components/ActionsContainer/ActionsContainerStyles.js +1 -1
- package/components/DataGrid/Datagrid.styles.js +27 -7
- package/components/Label/Label.js +1 -1
- package/components/Label/Label.styles.js +11 -2
- package/components/LoadingError/LoadingError.styles.js +6 -3
- package/components/NoItemSelected/NoItemSelected.js +20 -2
- package/components/PropertyValue/PropertyValue.styles.js +30 -29
- package/components/WindowBase/WindowBase.styles.js +14 -31
- package/components/WindowConfirm/WindowConfirm.styles.js +1 -3
- package/components/areas/components/AreasAdmin/AreasAdmin.styles.js +12 -3
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/AreaChip.js +1 -1
- package/components/areas/components/AreasViewer/AreasViewer.js +6 -1
- package/components/areas/components/AreasViewer/AreasViewer.styles.js +7 -6
- package/components/areas/components/AreasViewer/types.d.ts +1 -0
- package/components/areas/contexts/AreasContext/helpers/helper.d.ts +1 -1
- package/components/areas/contexts/AreasContext/helpers/helper.js +1 -1
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +3 -1
- package/components/formatters/BooleanFormatter/BooleanFormatter.styles.js +2 -2
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +1 -1
- package/components/hook-form/RHFColorPicker/RFHColorPicker.js +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +2 -0
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +1 -1
- package/components/hook-form/RHFormContext/styles.js +2 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +1 -1
- package/components/mui_extended/Button/Button.js +4 -5
- package/components/mui_extended/Button/ButtonStyles.js +13 -2
- package/components/mui_extended/LoadingButton/LoadingButton.js +1 -1
- package/components/mui_extended/TabContent/TabContent.styles.js +9 -3
- package/components/mui_extended/TabContent/index.d.ts +1 -0
- package/components/mui_extended/TextField/TextField.js +4 -2
- package/components/mui_extended/TextField/TextField.styles.js +63 -60
- package/components/mui_extended/TextField/constants.d.ts +1 -0
- package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +2 -1
- package/components/mui_extended/TextField/slots/TextFieldEnum.js +1 -0
- package/components/mui_extended/TextField/types.d.ts +12 -0
- package/package.json +3 -3
- package/storybook/components/NoItemSelect/NoItemSelect.stories.d.ts +4 -0
- package/storybook/components/PropertyValue/PropertyValue.stories.d.ts +5 -1
- package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +11 -0
|
@@ -11,8 +11,8 @@ const textFieldStyles = {
|
|
|
11
11
|
padding: 0,
|
|
12
12
|
borderRadius: theme.vars.size.borderRadius.r1,
|
|
13
13
|
display: "flex",
|
|
14
|
-
// Estilos globales del TextField 🌎
|
|
15
14
|
"& .MuiInputBase-root": {
|
|
15
|
+
// Estilos globales del TextField 🌎
|
|
16
16
|
// Paddings
|
|
17
17
|
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
18
18
|
paddingRight: 0,
|
|
@@ -20,7 +20,7 @@ const textFieldStyles = {
|
|
|
20
20
|
paddingBottom: 0,
|
|
21
21
|
// Estilo de los bordes
|
|
22
22
|
border: theme.vars.size.borderStroke.actionInput,
|
|
23
|
-
borderColor: ownerState?.error ? `${ownerState?.paletteColor?.enabled}!important` : `${theme.vars.palette.border.default}!important`,
|
|
23
|
+
borderColor: ownerState?.error && !ownerState?.readOnly ? `${ownerState?.paletteColor?.enabled}!important` : `${theme.vars.palette.border.default}!important`,
|
|
24
24
|
// Redondeado de los bordes
|
|
25
25
|
borderRadius: theme.vars.size.borderRadius.r1,
|
|
26
26
|
// Altura
|
|
@@ -39,68 +39,71 @@ const textFieldStyles = {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
+
...ownerState?.readOnly ? {
|
|
43
|
+
backgroundColor: theme.vars.palette.background.neutral
|
|
44
|
+
} : {}
|
|
45
|
+
},
|
|
46
|
+
// ↴ Overrides ❌
|
|
47
|
+
// Estilos del input
|
|
48
|
+
"& .MuiInputBase-input": {
|
|
42
49
|
// ↴ Overrides ❌
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
),
|
|
57
|
-
"&::placeholder": {
|
|
58
|
-
color: theme.palette.text.disabled
|
|
59
|
-
},
|
|
60
|
-
"&:-webkit-autofill": {
|
|
61
|
-
backgroundColor: "transparent!important"
|
|
62
|
-
}
|
|
50
|
+
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
51
|
+
paddingRight: theme.vars.size.baseSpacings.sp1,
|
|
52
|
+
paddingTop: 0,
|
|
53
|
+
paddingBottom: 0,
|
|
54
|
+
fontFamily: theme.typography.fontFamily,
|
|
55
|
+
color: ownerState?.disabled ? theme.vars.palette.text.disabled : theme.vars.palette.text.primary,
|
|
56
|
+
...getTypographyStyles(
|
|
57
|
+
theme.generalSettings.isMobile,
|
|
58
|
+
ownerState?.size || "medium",
|
|
59
|
+
"body"
|
|
60
|
+
),
|
|
61
|
+
"&::placeholder": {
|
|
62
|
+
color: theme.palette.text.disabled
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
"&:-webkit-autofill": {
|
|
65
|
+
backgroundColor: "transparent!important"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
// Estilos de cuando esta deshabilitado
|
|
69
|
+
...ownerState?.disabled && {
|
|
70
|
+
borderColor: `${theme.vars.palette.border.disabled}!important`,
|
|
71
|
+
pointerEvents: ownerState?.disabled ? "none" : "auto"
|
|
72
|
+
},
|
|
73
|
+
// Estilos del los adorments
|
|
74
|
+
"& .MuiInputAdornment-root": {
|
|
75
|
+
height: "auto",
|
|
76
|
+
width: "auto",
|
|
77
|
+
// ↴ Overrides ❌
|
|
78
|
+
margin: 0
|
|
79
|
+
},
|
|
80
|
+
// Estilos de la mascara fieldset, es un elemento interno del textfield, material lo usa como mascara para el estilo.
|
|
81
|
+
// por practicidad se oculta en nuestra versión, sin embargo no se elimina porque es parte de la semántica del componente.
|
|
82
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
83
|
+
all: "unset",
|
|
84
|
+
display: "none"
|
|
85
|
+
},
|
|
86
|
+
"& .MuiInputAdornment-root .M4LIcon-icon": {
|
|
87
|
+
backgroundColor: ownerState?.error ? ownerState?.paletteColor?.enabled : theme.vars.palette.text.primary,
|
|
65
88
|
...ownerState?.disabled && {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// ↴ Overrides ❌
|
|
74
|
-
margin: 0
|
|
75
|
-
},
|
|
76
|
-
// Estilos de la mascara fieldset, es un elemento interno del textfield, material lo usa como mascara para el estilo.
|
|
77
|
-
// por practicidad se oculta en nuestra versión, sin embargo no se elimina porque es parte de la semántica del componente.
|
|
78
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
79
|
-
all: "unset",
|
|
80
|
-
display: "none"
|
|
81
|
-
},
|
|
82
|
-
"& .MuiInputAdornment-root .M4LIcon-icon": {
|
|
83
|
-
backgroundColor: ownerState?.error ? ownerState?.paletteColor?.enabled : theme.vars.palette.text.primary,
|
|
84
|
-
...ownerState?.disabled && {
|
|
85
|
-
backgroundColor: theme.vars.palette.text.disabled
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"&:hover": {
|
|
89
|
-
backgroundColor: ownerState?.paletteColor?.hoverOpacity,
|
|
90
|
-
...ownerState?.error && {
|
|
91
|
-
borderColor: `${ownerState?.paletteColor?.hover}!important`,
|
|
92
|
-
"& .MuiInputAdornment-root .M4LIcon-icon": {
|
|
93
|
-
backgroundColor: ownerState?.paletteColor?.hover
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
"&:focus-within": {
|
|
98
|
-
borderColor: `${ownerState?.paletteColor?.enabled}!important`,
|
|
89
|
+
backgroundColor: theme.vars.palette.text.disabled
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"&:not(.M4LTextField-readOnly ) .MuiInputBase-root:hover": {
|
|
93
|
+
backgroundColor: ownerState?.paletteColor?.hoverOpacity,
|
|
94
|
+
...ownerState?.error && {
|
|
95
|
+
borderColor: `${ownerState?.paletteColor?.hover}!important`,
|
|
99
96
|
"& .MuiInputAdornment-root .M4LIcon-icon": {
|
|
100
|
-
backgroundColor: ownerState?.paletteColor?.
|
|
97
|
+
backgroundColor: ownerState?.paletteColor?.hover
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
},
|
|
101
|
+
"&:not(.M4LTextField-readOnly ) .MuiInputBase-root:focus-within": {
|
|
102
|
+
borderColor: `${ownerState?.paletteColor?.enabled}!important`,
|
|
103
|
+
"& .MuiInputAdornment-root .M4LIcon-icon": {
|
|
104
|
+
backgroundColor: ownerState?.paletteColor?.focus
|
|
105
|
+
}
|
|
106
|
+
},
|
|
104
107
|
// Variant Outlined TextField
|
|
105
108
|
...ownerState?.variant === "outlined" && {
|
|
106
109
|
[`&.${TEXT_FIELD_CLASSES.outlined} .MuiInputBase-root`]: {
|
|
@@ -122,13 +125,13 @@ const textFieldStyles = {
|
|
|
122
125
|
...ownerState?.variant === "contained" && {
|
|
123
126
|
[`&.${TEXT_FIELD_CLASSES.contained} .MuiInputBase-root`]: {
|
|
124
127
|
border: "none",
|
|
125
|
-
backgroundColor: theme.vars.palette[ownerState?.color || "default"][ownerState?.error ? "toneOpacity" : "enabled"]
|
|
128
|
+
backgroundColor: ownerState?.readOnly ? theme.vars.palette.background.neutral : theme.vars.palette[ownerState?.color || "default"][ownerState?.error ? "toneOpacity" : "enabled"]
|
|
126
129
|
},
|
|
127
|
-
...ownerState?.error && {
|
|
130
|
+
...ownerState?.error && !ownerState?.readOnly && {
|
|
128
131
|
border: theme.vars.size.borderStroke.actionInput,
|
|
129
132
|
borderColor: `${ownerState?.paletteColor?.enabled}!important`
|
|
130
133
|
},
|
|
131
|
-
"&:focus-within": {
|
|
134
|
+
"&:not(.M4LTextField-readOnly ) .MuiInputBase-root:focus-within": {
|
|
132
135
|
border: theme.vars.size.borderStroke.actionInput,
|
|
133
136
|
borderColor: `${ownerState?.paletteColor?.enabled}!important`
|
|
134
137
|
}
|
|
@@ -4,6 +4,7 @@ export declare const COMBINATED_TEXTFIELD_ENUMS: {
|
|
|
4
4
|
outlined: TexFieldComplementaryClasses.outlined;
|
|
5
5
|
text: TexFieldComplementaryClasses.text;
|
|
6
6
|
contained: TexFieldComplementaryClasses.contained;
|
|
7
|
+
readOnly: TexFieldComplementaryClasses.readOnly;
|
|
7
8
|
root: TextFieldSlots.root;
|
|
8
9
|
skeleton: TextFieldSlots.skeleton;
|
|
9
10
|
};
|
|
@@ -7,6 +7,7 @@ var TexFieldComplementaryClasses = /* @__PURE__ */ ((TexFieldComplementaryClasse
|
|
|
7
7
|
TexFieldComplementaryClasses2["outlined"] = "outlined";
|
|
8
8
|
TexFieldComplementaryClasses2["text"] = "text";
|
|
9
9
|
TexFieldComplementaryClasses2["contained"] = "contained";
|
|
10
|
+
TexFieldComplementaryClasses2["readOnly"] = "readOnly";
|
|
10
11
|
return TexFieldComplementaryClasses2;
|
|
11
12
|
})(TexFieldComplementaryClasses || {});
|
|
12
13
|
export {
|
|
@@ -36,6 +36,11 @@ export interface TextFieldProps extends Omit<MUITextFieldProps, 'size' | 'color'
|
|
|
36
36
|
* size="medium"
|
|
37
37
|
*/
|
|
38
38
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
39
|
+
/**
|
|
40
|
+
* Indica si el campo de texto está en modo de solo lectura.
|
|
41
|
+
* readOnly={true}
|
|
42
|
+
*/
|
|
43
|
+
readOnly?: boolean;
|
|
39
44
|
}
|
|
40
45
|
/**
|
|
41
46
|
* Estado del propietario del campo de texto.
|
|
@@ -61,7 +66,14 @@ export interface TextFieldOwnerState {
|
|
|
61
66
|
* Indica si el campo de texto es error.
|
|
62
67
|
*/
|
|
63
68
|
error?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Color del campo de texto.
|
|
71
|
+
*/
|
|
64
72
|
color?: Extract<ComponentPalletColor, 'default' | 'error'>;
|
|
73
|
+
/**
|
|
74
|
+
* Indica si el campo de texto está en modo de solo lectura.
|
|
75
|
+
*/
|
|
76
|
+
readOnly?: boolean;
|
|
65
77
|
}
|
|
66
78
|
export type TextFieldSlotsType = keyof typeof TextFieldSlots;
|
|
67
79
|
export type TextFieldStyles = M4LOverridesStyleRules<TextFieldSlotsType, typeof TEXT_FIELD_KEY_COMPONENT, Theme>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.2.56-beta.
|
|
3
|
+
"version": "9.2.56-beta.6",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "M4L Components",
|
|
6
6
|
"lint-staged": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@googlemaps/js-api-loader": "^1.16.6",
|
|
12
12
|
"@hookform/resolvers": "^2.9.5",
|
|
13
13
|
"@m4l/core": "^2.0.0",
|
|
14
|
-
"@m4l/graphics": "7.1.1-beta.
|
|
15
|
-
"@m4l/styles": "7.1.28-beta.
|
|
14
|
+
"@m4l/graphics": "7.1.1-beta.6",
|
|
15
|
+
"@m4l/styles": "7.1.28-beta.6",
|
|
16
16
|
"@microlink/react-json-view": "^1.23.3",
|
|
17
17
|
"@mui/lab": "5.0.0-alpha.173",
|
|
18
18
|
"@mui/material": "5.16.7",
|
|
@@ -5,4 +5,8 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof NoItemSelected>;
|
|
6
6
|
/** Base component */
|
|
7
7
|
export declare const NoItemSelectedComponent: Story;
|
|
8
|
+
/**
|
|
9
|
+
* Version skeleton del componente
|
|
10
|
+
*/
|
|
11
|
+
export declare const Skeleton: Story;
|
|
8
12
|
export declare const WithSplitLayout: Story;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { PropertyValue } from '../../../src/components/PropertyValue
|
|
2
|
+
import { PropertyValue } from '../../../src/components/PropertyValue';
|
|
3
3
|
declare const meta: Meta<typeof PropertyValue>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof PropertyValue>;
|
|
@@ -59,3 +59,7 @@ export declare const LargeProperty: Story;
|
|
|
59
59
|
* Historia sin formulario con valor largo.
|
|
60
60
|
*/
|
|
61
61
|
export declare const LargeValue: Story;
|
|
62
|
+
/**
|
|
63
|
+
* Historia que muestra todos los estados semánticos de semanticWidth de manera vertical.
|
|
64
|
+
*/
|
|
65
|
+
export declare const SemanticWidths: Story;
|
|
@@ -8,6 +8,17 @@ import { TextField } from '../../../../../src/components/mui_extended/TextField/
|
|
|
8
8
|
declare const meta: Meta<typeof TextField>;
|
|
9
9
|
type Story = StoryObj<typeof TextField>;
|
|
10
10
|
export declare const Default: Story;
|
|
11
|
+
/**
|
|
12
|
+
* Se aplica cuando el input está en modo de solo lectura y no puede ser interactuado por el usuario.
|
|
13
|
+
*
|
|
14
|
+
* readOnly
|
|
15
|
+
*/
|
|
16
|
+
export declare const ReadOnly: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Se aplica cuando el input tiene adornos.
|
|
19
|
+
*
|
|
20
|
+
* disabled
|
|
21
|
+
*/
|
|
11
22
|
export declare const WhitAdorment: Story;
|
|
12
23
|
export declare const WithSkeleton: Story;
|
|
13
24
|
export default meta;
|