@m4l/components 9.3.11 → 9.3.12-BE270825-beta.2

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.
@@ -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 = "standard",
10
+ height = "auto",
11
+ children,
12
+ direction = "row",
13
+ justifyContent = "center",
14
+ alignItems = "center",
15
+ selected = false,
16
+ padding = "standard",
17
+ ...others
18
+ } = props;
19
+ const ownerState = {
20
+ variant,
21
+ gap,
22
+ height,
23
+ direction,
24
+ onClick: !!props.onClick,
25
+ justifyContent,
26
+ alignItems,
27
+ selected,
28
+ 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,52 @@
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
+ display: "flex",
8
+ justifyContent: ownerState?.justifyContent ?? "center",
9
+ alignItems: ownerState?.alignItems ?? "center",
10
+ flexDirection: ownerState?.direction ?? "column",
11
+ gap: getSizeSpacing(ownerState?.gap),
12
+ padding: getSizeSpacing(ownerState?.padding),
13
+ transition: "all 0.2s ease-in-out",
14
+ width: "100%",
15
+ outline: "unset!important",
16
+ borderRadius: theme.vars.size.borderRadius.r2,
17
+ backgroundColor: theme.palette.background.paper,
18
+ height: ownerState?.height ?? "auto",
19
+ minHeight: ownerState?.height ?? "auto",
20
+ maxHeight: ownerState?.height ?? "auto",
21
+ overflow: "hidden",
22
+ ...ownerState?.onClick && {
23
+ cursor: "pointer",
24
+ "&:hover": {
25
+ backgroundColor: theme.vars.palette.background.base
26
+ },
27
+ "&:active": {
28
+ backgroundColor: theme.vars.palette.default.activeOpacity
29
+ },
30
+ "&:focus-visible, &:focus-within": {
31
+ border: theme.vars.size.borderStroke.container,
32
+ borderColor: `${theme.vars.palette.primary.focusVisible}!important`,
33
+ outline: "unset!important"
34
+ }
35
+ },
36
+ ...ownerState?.variant === "outlined" && {
37
+ border: theme.vars.size.borderStroke.container,
38
+ borderColor: theme.vars.palette.border.disabled
39
+ },
40
+ ...ownerState?.variant === "text" && {
41
+ border: theme.vars.size.borderStroke.container,
42
+ borderColor: "transparent"
43
+ },
44
+ ...ownerState?.selected && {
45
+ border: theme.vars.size.borderStroke.container,
46
+ borderColor: theme.vars.palette.primary.enabled
47
+ }
48
+ })
49
+ };
50
+ export {
51
+ cardStyles as c
52
+ };
@@ -0,0 +1,23 @@
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
+ const CARD_SIZES = {
15
+ compact: 8,
16
+ standard: 16,
17
+ comfortable: 24
18
+ };
19
+ export {
20
+ CARD_CLASSES as C,
21
+ CARD_SIZES as a,
22
+ CARD_KEY as b
23
+ };
@@ -0,0 +1,10 @@
1
+ import { a as CARD_SIZES } from "../constants.js";
2
+ const getSizeSpacing = (gap) => {
3
+ if (typeof gap === "number") {
4
+ return gap;
5
+ }
6
+ return CARD_SIZES[gap ?? "standard"];
7
+ };
8
+ export {
9
+ getSizeSpacing as g
10
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,7 @@
1
+ var CardSlots = /* @__PURE__ */ ((CardSlots2) => {
2
+ CardSlots2["root"] = "root";
3
+ return CardSlots2;
4
+ })(CardSlots || {});
5
+ export {
6
+ CardSlots as C
7
+ };
@@ -0,0 +1,11 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { b 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
+ };
@@ -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 {
@@ -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;
@@ -441,8 +441,8 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
441
441
  bounds: {
442
442
  left: MARGIN_GRIDLAYOUT,
443
443
  top: MARGIN_GRIDLAYOUT,
444
- right: -10,
445
- bottom: -10
444
+ right: -MARGIN_GRIDLAYOUT,
445
+ bottom: -MARGIN_GRIDLAYOUT
446
446
  }
447
447
  });
448
448
  }
@@ -65,6 +65,11 @@ const RHFAutocompleteAsyncReducer = (onChangeFilterParms) => (state, action) =>
65
65
  ...state,
66
66
  isOpen: false
67
67
  };
68
+ // case actionsType.SET_SELECTED_OPTIONS_TO_AUTOCOMPLETE:
69
+ // return {
70
+ // ...state,
71
+ // selectedOptions: action.payload,
72
+ // };
68
73
  default:
69
74
  return state;
70
75
  }
@@ -4,6 +4,7 @@ export * from './AppBar';
4
4
  export * from './AppBar/AppBar';
5
5
  export * from './areas';
6
6
  export * from './BaseModule';
7
+ export * from './Card';
7
8
  export * from './Chip';
8
9
  export * from './commercial';
9
10
  export * from './CommonActions/';
@@ -176,6 +176,7 @@ const Select = forwardRef(
176
176
  paddingBottom: theme.vars.size.baseSpacings.sp3,
177
177
  paddingLeft: 0,
178
178
  paddingRight: 0,
179
+ maxHeight: "200px",
179
180
  "& .MuiList-root": {
180
181
  padding: 0,
181
182
  display: "flex",
@@ -35,7 +35,12 @@ const selectStyles = {
35
35
  },
36
36
  "& .MuiSelect-select": {
37
37
  padding: `${theme.vars.size.baseSpacings.sp1}!important`,
38
- minHeight: "unset"
38
+ minHeight: "unset",
39
+ maxHeight: "80px",
40
+ overflow: "auto",
41
+ boxSizing: "border-box",
42
+ display: "flex",
43
+ flexDirection: "column"
39
44
  },
40
45
  // Estilos para la variante text
41
46
  [`&.${SELECT_CLASSES.text}`]: {
@@ -69,7 +74,8 @@ const selectStyles = {
69
74
  (height) => {
70
75
  return {
71
76
  minHeight: height,
72
- maxHeight: height
77
+ height: "fit-content",
78
+ maxHeight: "80px"
73
79
  };
74
80
  }
75
81
  )
@@ -88,7 +94,9 @@ const selectStyles = {
88
94
  display: "flex",
89
95
  alignItems: "center",
90
96
  gap: theme.vars.size.baseSpacings.sp1,
91
- flexWrap: "wrap"
97
+ flexWrap: "wrap",
98
+ overflow: "auto",
99
+ flexShrink: 1
92
100
  }),
93
101
  arrowDown: {},
94
102
  renderValueTypography: () => ({
@@ -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,
@@ -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.
@@ -8,6 +8,7 @@ const typographyStyles = {
8
8
  root: ({ ownerState, theme }) => ({
9
9
  margin: 0,
10
10
  cursor: "default",
11
+ fontFamily: ownerState?.fontFamily === "jura" ? "Jura" : "Inter",
11
12
  "&.M4lclassCssSpecificity": {
12
13
  // Estilos generales 🌐
13
14
  // 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/Chip/Chip.js";
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 C2 } from "./components/ContainerFlow/ContainerFlow.js";
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 C3 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js";
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 C4 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js";
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 C5 } from "./components/DataGrid/formatters/ColumnDateFormatter/formatter.js";
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 C6 } from "./components/DataGrid/formatters/ColumnIconFormatter/formatter.js";
45
- import { C as C7 } from "./components/DataGrid/formatters/ColumnInteractiveCheckFormatter/formatter.js";
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 C8 } from "./components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.js";
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 C9 } from "./components/DataGrid/formatters/ColumnPointsFormatter/formatter.js";
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 C10 } from "./components/DataGrid/formatters/ColumnPriceFormatter/formatter.js";
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 C11 } from "./components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js";
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 C12 } from "./components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.js";
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 C13 } from "./components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js";
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 C14 } from "./components/mui_extended/CircularProgress/CircularProgress.js";
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 C15 } from "./components/mui_extended/CheckBox/CheckBox.js";
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 C16, g as g15 } from "./components/formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
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 C17 } from "./components/formatters/ChipStatusFormatter/ChipStatusFormatter.js";
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";
@@ -251,23 +252,24 @@ export {
251
252
  B2 as BoxIcon,
252
253
  B3 as Breadcrumbs,
253
254
  B5 as Button,
254
- C15 as CheckBox,
255
- C as Chip,
256
- C17 as ChipStatusFormatter,
257
- C14 as CircularProgress,
258
- C3 as ColumnBooleanFormatter,
259
- C13 as ColumnChipStatusFormatter,
260
- C4 as ColumnConcatenatedValueFormatter,
261
- C5 as ColumnDateFormatter,
262
- C6 as ColumnIconFormatter,
263
- C7 as ColumnInteractiveCheckFormatter,
264
- C8 as ColumnNestedValueFormatter,
265
- C9 as ColumnPointsFormatter,
266
- C10 as ColumnPriceFormatter,
267
- C11 as ColumnSetCheckFormatter,
268
- C12 as ColumnUncertaintyFormatter,
269
- C16 as ConcatenatedFormatter,
270
- C2 as ContainerFlow,
255
+ C as Card,
256
+ C16 as CheckBox,
257
+ C2 as Chip,
258
+ C18 as ChipStatusFormatter,
259
+ C15 as CircularProgress,
260
+ C4 as ColumnBooleanFormatter,
261
+ C14 as ColumnChipStatusFormatter,
262
+ C5 as ColumnConcatenatedValueFormatter,
263
+ C6 as ColumnDateFormatter,
264
+ C7 as ColumnIconFormatter,
265
+ C8 as ColumnInteractiveCheckFormatter,
266
+ C9 as ColumnNestedValueFormatter,
267
+ C10 as ColumnPointsFormatter,
268
+ C11 as ColumnPriceFormatter,
269
+ C12 as ColumnSetCheckFormatter,
270
+ C13 as ColumnUncertaintyFormatter,
271
+ C17 as ConcatenatedFormatter,
272
+ C3 as ContainerFlow,
271
273
  b3 as DATAGRID_ROW_HEADER_HEIGHTS,
272
274
  a4 as DATAGRID_ROW_HEIGHTS,
273
275
  e as DATAGRID_SEMANTIC_WIDTHS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.3.11",
3
+ "version": "9.3.12-BE270825-beta.2",
4
4
  "license": "UNLICENSED",
5
5
  "description": "M4L Components",
6
6
  "lint-staged": {