@m4l/components 9.3.34-JT25112025.beta.2 → 9.3.34-JT26112025.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.
Files changed (73) hide show
  1. package/@types/export.d.ts +3 -0
  2. package/@types/types.d.ts +11 -0
  3. package/components/DataGrid/Datagrid.styles.js +40 -111
  4. package/components/DataGrid/dictionary.d.ts +0 -1
  5. package/components/DataGrid/dictionary.js +1 -2
  6. package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +4 -0
  7. package/components/DataGrid/formatters/ColumnImageFormatter/ImageFormatterCell.d.ts +13 -0
  8. package/components/DataGrid/formatters/ColumnImageFormatter/ImageFormatterCell.js +33 -0
  9. package/components/DataGrid/formatters/ColumnImageFormatter/constants.d.ts +6 -0
  10. package/components/DataGrid/formatters/ColumnImageFormatter/constants.js +6 -0
  11. package/components/DataGrid/formatters/ColumnImageFormatter/formatter.d.ts +8 -0
  12. package/components/DataGrid/formatters/ColumnImageFormatter/formatter.js +25 -0
  13. package/components/DataGrid/formatters/ColumnImageFormatter/index.d.ts +3 -0
  14. package/components/DataGrid/formatters/ColumnImageFormatter/index.js +1 -0
  15. package/components/DataGrid/formatters/ColumnImageFormatter/types.d.ts +44 -0
  16. package/components/DataGrid/formatters/ColumnImageFormatter/types.js +1 -0
  17. package/components/DataGrid/formatters/ColumnImageFormatter/useColumnImage.d.ts +9 -0
  18. package/components/DataGrid/formatters/ColumnImageFormatter/useColumnImage.js +22 -0
  19. package/components/DataGrid/formatters/index.d.ts +1 -0
  20. package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
  21. package/components/DataGrid/hooks/useModalCardDetail.js +1 -6
  22. package/components/DataGrid/icons.d.ts +0 -1
  23. package/components/DataGrid/icons.js +1 -2
  24. package/components/DataGrid/slots/DataGridEnum.d.ts +1 -4
  25. package/components/DataGrid/slots/DataGridEnum.js +0 -3
  26. package/components/DataGrid/slots/DataGridSlot.d.ts +0 -3
  27. package/components/DataGrid/slots/DataGridSlot.js +33 -48
  28. package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +2 -2
  29. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
  30. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +5 -47
  31. package/components/DataGrid/subcomponents/Cards/index.js +19 -9
  32. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
  33. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +15 -59
  34. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +1 -1
  35. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
  36. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +2 -5
  37. package/components/DataGrid/subcomponents/Cards/types.d.ts +0 -16
  38. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +1 -1
  39. package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
  40. package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
  41. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
  42. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
  43. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
  44. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
  45. package/components/DataGrid/subcomponents/Table/index.js +11 -2
  46. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +0 -1
  47. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +14 -39
  48. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
  49. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  50. package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
  51. package/components/DataGrid/tests/helpers/types.d.ts +10 -0
  52. package/components/DataGrid/types.d.ts +0 -12
  53. package/components/formatters/ImageFormatter/ImageFormatter.d.ts +10 -0
  54. package/components/formatters/ImageFormatter/ImageFormatter.js +72 -0
  55. package/components/formatters/ImageFormatter/ImageFormatter.styles.d.ts +2 -0
  56. package/components/formatters/ImageFormatter/ImageFormatter.styles.js +42 -0
  57. package/components/formatters/ImageFormatter/constants.d.ts +5 -0
  58. package/components/formatters/ImageFormatter/constants.js +10 -0
  59. package/components/formatters/ImageFormatter/index.d.ts +2 -0
  60. package/components/formatters/ImageFormatter/index.js +1 -0
  61. package/components/formatters/ImageFormatter/slots/ImageFormatterEnum.d.ts +5 -0
  62. package/components/formatters/ImageFormatter/slots/ImageFormatterEnum.js +9 -0
  63. package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +9 -0
  64. package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.js +23 -0
  65. package/components/formatters/ImageFormatter/types.d.ts +51 -0
  66. package/components/formatters/ImageFormatter/types.js +1 -0
  67. package/components/formatters/index.d.ts +1 -0
  68. package/index.js +68 -62
  69. package/package.json +1 -1
  70. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts +0 -1
  71. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +0 -1
  72. /package/components/DataGrid/formatters/{ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts → ColumnImageFormatter/tests/ColumnImageFormatter.test.d.ts} +0 -0
  73. /package/components/{DataGrid/formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts → formatters/ImageFormatter/tests/ImageFormatter.test.d.ts} +0 -0
@@ -12,7 +12,6 @@ const CheckboxFormatter = forwardRef(function CheckboxFormatter2({ onChange, che
12
12
  checked,
13
13
  size: "small",
14
14
  icon: /* @__PURE__ */ jsx(CheckboxIcon, {}),
15
- disableRipple: true,
16
15
  checkedIcon: /* @__PURE__ */ jsx(CheckboxCheckedIcon, {}),
17
16
  indeterminateIcon: /* @__PURE__ */ jsx(CheckboxIndeterminateIcon, {}),
18
17
  onChange: handleChange,
@@ -1,47 +1,22 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useEnvironment } from "@m4l/core";
3
- import "@mui/material";
4
- import { I as Icon } from "../../../../Icon/Icon.js";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { SvgIcon } from "@mui/material";
5
3
  function CheckboxIcon(props) {
6
- const { host_static_assets, environment_assets } = useEnvironment();
7
- const uncheckedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/unchecked.svg`;
8
- return /* @__PURE__ */ jsx(
9
- Icon,
10
- {
11
- src: uncheckedIconUrl,
12
- size: "small",
13
- color: "text.primary",
14
- className: "checkbox-unChecked",
15
- ...props
16
- }
17
- );
4
+ return /* @__PURE__ */ jsx(SvgIcon, { ...props, viewBox: "0 0 16 17", className: "checkbox-unChecked", children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
5
+ /* @__PURE__ */ jsx("g", { "clip-path": "url(#clip0_13395_49048)", children: /* @__PURE__ */ jsx("path", { d: "M13.0156 2.5H3.01562C2.75041 2.5 2.49605 2.60536 2.30852 2.79289C2.12098 2.98043 2.01563 3.23478 2.01562 3.5V13.5C2.01563 13.7652 2.12098 14.0196 2.30852 14.2071C2.49605 14.3946 2.75041 14.5 3.01562 14.5H13.0156C13.2808 14.5 13.5352 14.3946 13.7227 14.2071C13.9103 14.0196 14.0156 13.7652 14.0156 13.5V3.5C14.0156 3.23478 13.9103 2.98043 13.7227 2.79289C13.5352 2.60536 13.2808 2.5 13.0156 2.5ZM3.01562 13.5V3.5H13.0156V13.5H3.01562Z", fill: "#323B3B" }) }),
6
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_13395_49048", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0 0.5)" }) }) })
7
+ ] }) });
18
8
  }
19
9
  function CheckboxCheckedIcon(props) {
20
- const { host_static_assets, environment_assets } = useEnvironment();
21
- const checkedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/checked.svg`;
22
- return /* @__PURE__ */ jsx(
23
- Icon,
24
- {
25
- src: checkedIconUrl,
26
- size: "small",
27
- color: "primary.enabled",
28
- className: "checkbox-checked",
29
- ...props
30
- }
31
- );
10
+ return /* @__PURE__ */ jsxs(SvgIcon, { ...props, viewBox: "0 0 16 17", className: "checkbox-checked", children: [
11
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#clip0_13395_49057)", children: [
12
+ /* @__PURE__ */ jsx("path", { d: "M13.4323 2H2.59896C2.31164 2 2.03609 2.11414 1.83293 2.3173C1.62976 2.52047 1.51563 2.79602 1.51562 3.08333V13.9167C1.51563 14.204 1.62976 14.4795 1.83293 14.6827C2.03609 14.8859 2.31164 15 2.59896 15H13.4323C13.7196 15 13.9952 14.8859 14.1983 14.6827C14.4015 14.4795 14.5156 14.204 14.5156 13.9167V3.08333C14.5156 2.79602 14.4015 2.52047 14.1983 2.3173C13.9952 2.11414 13.7196 2 13.4323 2Z", fill: "#323B3B" }),
13
+ /* @__PURE__ */ jsx("path", { d: "M6.92119 11.6245L4.10001 8.8274L4.99759 7.95696L6.92119 9.84467L11.1014 5.70001L11.9996 6.58993L6.92119 11.6245Z", fill: "#F3F5F7" })
14
+ ] }),
15
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_13395_49057", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0 0.5)" }) }) })
16
+ ] });
32
17
  }
33
18
  function CheckboxIndeterminateIcon(props) {
34
- const { host_static_assets, environment_assets } = useEnvironment();
35
- const indeterminateIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/indeterminate.svg`;
36
- return /* @__PURE__ */ jsx(
37
- Icon,
38
- {
39
- src: indeterminateIconUrl,
40
- size: "small",
41
- color: "primary.enabled",
42
- ...props
43
- }
44
- );
19
+ return /* @__PURE__ */ jsx(SvgIcon, { ...props, children: /* @__PURE__ */ jsx("path", { d: "M17 3a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4h10zm-1.75 8h-6.5a.75.75 0 00-.75.75v.5c0 .414.336.75.75.75h6.5a.75.75 0 00.75-.75v-.5a.75.75 0 00-.75-.75z" }) });
45
20
  }
46
21
  export {
47
22
  CheckboxIndeterminateIcon as C,
@@ -5,7 +5,7 @@ import { useDrag, useDrop } from "react-dnd";
5
5
  import { renderHeaderCell } from "react-data-grid";
6
6
  import { u as useFocusRef } from "../hooks/useFocusRef.js";
7
7
  import { u as useFilters } from "../../../hooks/useFilters.js";
8
- import { N as NameColumnIconStyled, F as NameColumnStyled, G as IconColumnStyled, H as DraggableHeaderRootStyled, J as ButtonHeaderActionsStyled, K as DraggableWrapperInputBaseStyled, M as IconSearchStyled, O as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
8
+ import { N as NameColumnIconStyled, B as NameColumnStyled, I as IconColumnStyled, F as DraggableHeaderRootStyled, G as ButtonHeaderActionsStyled, H as DraggableWrapperInputBaseStyled, J as IconSearchStyled, K as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
9
9
  import { p as pathIcons } from "../../../icons.js";
10
10
  import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
11
11
  import { I as Icon } from "../../../../Icon/Icon.js";
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useMemo, useEffect, useCallback } from "react";
3
3
  import { useModuleDictionary } from "@m4l/core";
4
4
  import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
5
- import { P as MenuListStyled, Q as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
5
+ import { M as MenuListStyled, O as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
6
6
  import { M as MenuDivider } from "../../../../../mui_extended/MenuDivider/MenuDivider.js";
7
7
  import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
8
8
  import { D as DICTIONARY } from "../../../../dictionary.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { S as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
2
+ import { P as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
3
3
  function autoFocusAndSelect(input) {
4
4
  input?.focus();
5
5
  input?.select();
@@ -20,6 +20,12 @@ export interface SeedProps {
20
20
  withCesar?: boolean;
21
21
  withChipStatus?: boolean;
22
22
  withTags?: boolean;
23
+ withImage?: boolean;
24
+ withImageCustomSize?: {
25
+ width: number;
26
+ height: number;
27
+ };
28
+ withImageWithoutText?: boolean;
23
29
  withActions?: boolean;
24
30
  withActionsUser?: boolean;
25
31
  withBooleanStatus?: boolean;
@@ -69,6 +75,10 @@ export interface RowType {
69
75
  currentStatus: 'superadmin' | 'admin' | 'user';
70
76
  };
71
77
  color?: string;
78
+ image?: {
79
+ url: string;
80
+ text?: string;
81
+ };
72
82
  }
73
83
  interface RangesUncertainty {
74
84
  cmcMin: number;
@@ -193,10 +193,6 @@ export interface UseModalDetailProps<TRow> {
193
193
  columns: readonly Column<TRow, any>[];
194
194
  viewMode: ViewMode;
195
195
  onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
196
- /**
197
- * Array completo de todas las filas (necesario para reconstruir el array al editar en el modal)
198
- */
199
- rows: readonly TRow[];
200
196
  }
201
197
  /**
202
198
  * Configuración de una columna específica en vista "cards"
@@ -256,14 +252,6 @@ export interface CardContentProps<TRow> {
256
252
  columns: readonly Column<TRow, any>[];
257
253
  originalColumns: readonly Column<TRow, any>[];
258
254
  onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
259
- /**
260
- * Array completo de todas las filas (necesario para reconstruir el array al editar)
261
- */
262
- rows: readonly TRow[];
263
- /**
264
- * Índice de la fila actual en el array de filas
265
- */
266
- rowIndex: number;
267
255
  }
268
256
  /**
269
257
  * Configuración de densidad para el DataGrid.
@@ -0,0 +1,10 @@
1
+ import { ImageFormatterProps } from './types';
2
+ /**
3
+ * ImageFormatter
4
+ * Componente para formatear y mostrar una imagen con texto opcional.
5
+ * Fuerza enableIntersectionObserver a false ya que se usa en contextos donde
6
+ * el lazy loading es manejado por el contenedor padre (ej. DataGrid).
7
+ * @param {ImageFormatterProps} props - Las propiedades del componente.
8
+ * @returns JSX.Element
9
+ */
10
+ export declare function ImageFormatter(props: ImageFormatterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { I as ImageStyled, T as TextImageStyled, R as RootStyled } from "./slots/ImageFormatterSlots.js";
4
+ import { I as ImageFormatterSlots } from "./slots/ImageFormatterEnum.js";
5
+ import clsx from "clsx";
6
+ import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
7
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
8
+ import { I as IMAGE_FORMATTER_KEY_COMPONENT } from "./constants.js";
9
+ function ImageFormatter(props) {
10
+ const { src, alt, text, width, height, cover, dataTestId, className } = props;
11
+ const ownerState = useMemo(
12
+ () => ({
13
+ width,
14
+ height,
15
+ hasDefinedSize: width !== void 0 && height !== void 0,
16
+ cover
17
+ }),
18
+ [width, height, cover]
19
+ );
20
+ const content = useMemo(() => {
21
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
22
+ /* @__PURE__ */ jsx(
23
+ ImageStyled,
24
+ {
25
+ ownerState,
26
+ ...getPropDataTestId(
27
+ IMAGE_FORMATTER_KEY_COMPONENT,
28
+ ImageFormatterSlots.image,
29
+ dataTestId
30
+ ),
31
+ src,
32
+ alt,
33
+ width,
34
+ height,
35
+ cover,
36
+ enableIntersectionObserver: false
37
+ }
38
+ ),
39
+ text && /* @__PURE__ */ jsx(
40
+ TextImageStyled,
41
+ {
42
+ ...getPropDataTestId(
43
+ IMAGE_FORMATTER_KEY_COMPONENT,
44
+ ImageFormatterSlots.textImage,
45
+ dataTestId
46
+ ),
47
+ variant: "body",
48
+ children: text
49
+ }
50
+ )
51
+ ] });
52
+ }, [src, alt, text, width, height, cover, dataTestId, ownerState]);
53
+ return /* @__PURE__ */ jsx(
54
+ RootStyled,
55
+ {
56
+ ownerState,
57
+ className: clsx(
58
+ getComponentSlotRoot(IMAGE_FORMATTER_KEY_COMPONENT),
59
+ className
60
+ ),
61
+ ...getPropDataTestId(
62
+ IMAGE_FORMATTER_KEY_COMPONENT,
63
+ ImageFormatterSlots.root,
64
+ dataTestId
65
+ ),
66
+ children: content
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ ImageFormatter as I
72
+ };
@@ -0,0 +1,2 @@
1
+ import { ImageFormatterStyles } from './types';
2
+ export declare const imageFormatterStyles: ImageFormatterStyles;
@@ -0,0 +1,42 @@
1
+ const imageFormatterStyles = {
2
+ /**
3
+ * Estilos del root principal
4
+ */
5
+ root: ({ theme, ownerState }) => ({
6
+ display: "flex",
7
+ alignItems: "center",
8
+ gap: theme.vars.size.baseSpacings.sp2,
9
+ width: "100%",
10
+ ...!ownerState?.hasDefinedSize && {
11
+ height: "100%"
12
+ }
13
+ }),
14
+ /**
15
+ * Estilos de la imagen
16
+ */
17
+ image: ({ theme, ownerState }) => ({
18
+ flexShrink: 0,
19
+ borderRadius: theme.vars.size.borderRadius.r2,
20
+ border: `1px solid ${theme.vars.palette.border.disabled}`,
21
+ ...!ownerState?.hasDefinedSize && {
22
+ height: "90%",
23
+ aspectRatio: "1 / 1"
24
+ },
25
+ objectFit: ownerState?.cover ? "cover" : "contain"
26
+ }),
27
+ /**
28
+ * Estilos del texto de la imagen
29
+ */
30
+ textImage: ({ theme }) => ({
31
+ overflow: "hidden",
32
+ textOverflow: "ellipsis",
33
+ whiteSpace: "nowrap",
34
+ flex: 1,
35
+ "&.M4LTypography-root": {
36
+ color: theme.vars.palette.primary
37
+ }
38
+ })
39
+ };
40
+ export {
41
+ imageFormatterStyles as i
42
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Clave del componente ImageFormatter
3
+ */
4
+ export declare const IMAGE_FORMATTER_KEY_COMPONENT = "M4LImageFormatter";
5
+ export declare const IMAGE_FORMATTER_CLASSES: Record<"root" | "image" | "textImage", string>;
@@ -0,0 +1,10 @@
1
+ import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
2
+ import { I as ImageFormatterSlots } from "./slots/ImageFormatterEnum.js";
3
+ const IMAGE_FORMATTER_KEY_COMPONENT = "M4LImageFormatter";
4
+ getComponentClasses(
5
+ IMAGE_FORMATTER_KEY_COMPONENT,
6
+ ImageFormatterSlots
7
+ );
8
+ export {
9
+ IMAGE_FORMATTER_KEY_COMPONENT as I
10
+ };
@@ -0,0 +1,2 @@
1
+ export { ImageFormatter } from './ImageFormatter';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ export declare enum ImageFormatterSlots {
2
+ root = "root",
3
+ image = "image",
4
+ textImage = "textImage"
5
+ }
@@ -0,0 +1,9 @@
1
+ var ImageFormatterSlots = /* @__PURE__ */ ((ImageFormatterSlots2) => {
2
+ ImageFormatterSlots2["root"] = "root";
3
+ ImageFormatterSlots2["image"] = "image";
4
+ ImageFormatterSlots2["textImage"] = "textImage";
5
+ return ImageFormatterSlots2;
6
+ })(ImageFormatterSlots || {});
7
+ export {
8
+ ImageFormatterSlots as I
9
+ };
@@ -0,0 +1,9 @@
1
+ export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
2
+ ownerState?: (Partial<import('..').ImageFormatterOwnerState> & Record<string, unknown>) | undefined;
3
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
4
+ export declare const ImageStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Image').ImageProps, keyof import('../../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
5
+ ownerState?: (Partial<import('..').ImageFormatterOwnerState> & Record<string, unknown>) | undefined;
6
+ }, {}, {}>;
7
+ export declare const TextImageStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/Typography/types').TypographyProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "size" | "children" | "title" | "component" | "zIndex" | "id" | "disabled" | "paragraph" | "border" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontSize" | "textTransform" | "fontFamily" | "typography" | "flex" | "hidden" | "color" | "left" | "right" | "bottom" | "top" | "ellipsis" | "content" | "style" | "position" | "padding" | "variant" | "borderRadius" | "width" | "display" | "borderColor" | "height" | "gap" | "minHeight" | "margin" | "overflow" | "boxShadow" | "minWidth" | "justifyContent" | "alignItems" | "paddingLeft" | "borderLeft" | "borderTop" | "maxWidth" | "flexDirection" | "paddingRight" | "borderRight" | "flexGrow" | "marginLeft" | "textOverflow" | "borderBottom" | "gridTemplateColumns" | "marginBottom" | "dataTestid" | "alignContent" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateRows" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginRight" | "marginTop" | "maxHeight" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingTop" | "rowGap" | "textAlign" | "translate" | "visibility" | "whiteSpace" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "p" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "htmlFor" | "gutterBottom" | "noWrap" | "variantMapping" | "skeletonWidth" | "skeletonRows" | keyof import('react').RefAttributes<HTMLSpanElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
8
+ ownerState?: (Partial<import('..').ImageFormatterOwnerState> & Record<string, unknown>) | undefined;
9
+ }, {}, {}>;
@@ -0,0 +1,23 @@
1
+ import { styled } from "@mui/material";
2
+ import { I as IMAGE_FORMATTER_KEY_COMPONENT } from "../constants.js";
3
+ import { I as ImageFormatterSlots } from "./ImageFormatterEnum.js";
4
+ import { i as imageFormatterStyles } from "../ImageFormatter.styles.js";
5
+ import { I as Image } from "../../../Image/Image.js";
6
+ import { T as Typography } from "../../../mui_extended/Typography/Typography.js";
7
+ const RootStyled = styled("div", {
8
+ name: IMAGE_FORMATTER_KEY_COMPONENT,
9
+ slot: ImageFormatterSlots.root
10
+ })(imageFormatterStyles.root);
11
+ const ImageStyled = styled(Image, {
12
+ name: IMAGE_FORMATTER_KEY_COMPONENT,
13
+ slot: ImageFormatterSlots.image
14
+ })(imageFormatterStyles.image);
15
+ const TextImageStyled = styled(Typography, {
16
+ name: IMAGE_FORMATTER_KEY_COMPONENT,
17
+ slot: ImageFormatterSlots.textImage
18
+ })(imageFormatterStyles.textImage);
19
+ export {
20
+ ImageStyled as I,
21
+ RootStyled as R,
22
+ TextImageStyled as T
23
+ };
@@ -0,0 +1,51 @@
1
+ import { M4LOverridesStyleRules } from '../../../@types/augmentations';
2
+ import { ImageFormatterSlots } from './slots/ImageFormatterEnum';
3
+ import { ImageProps } from '../../Image';
4
+ import { IMAGE_FORMATTER_KEY_COMPONENT } from './constants';
5
+ import { Theme } from '@mui/material';
6
+ /**
7
+ * Props del ImageFormatter
8
+ */
9
+ export interface ImageFormatterProps extends Pick<ImageProps, 'src' | 'alt' | 'width' | 'height' | 'cover' | 'enableIntersectionObserver'> {
10
+ /**
11
+ * Texto de la imagen
12
+ */
13
+ text?: string;
14
+ /**
15
+ * ID para testing
16
+ */
17
+ dataTestId?: string;
18
+ /**
19
+ * Clase CSS personalizada
20
+ */
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Owner state del ImageFormatter
25
+ */
26
+ export interface ImageFormatterOwnerState {
27
+ /**
28
+ * Ancho de la imagen
29
+ */
30
+ width?: number | string;
31
+ /**
32
+ * Alto de la imagen
33
+ */
34
+ height?: number | string;
35
+ /**
36
+ * Si la imagen tiene tamaño definido o debe usar 100% + aspect ratio
37
+ */
38
+ hasDefinedSize: boolean;
39
+ /**
40
+ * Si es verdadero, la imagen se ajusta al contenedor y se recorta si es necesario.
41
+ */
42
+ cover?: boolean;
43
+ }
44
+ /**
45
+ * Tipos de slots disponibles para el ImageFormatter
46
+ */
47
+ export type ImageFormatterSlotsType = ImageFormatterSlots;
48
+ /**
49
+ * Estilos aplicables al ImageFormatter
50
+ */
51
+ export type ImageFormatterStyles = M4LOverridesStyleRules<ImageFormatterSlotsType, typeof IMAGE_FORMATTER_KEY_COMPONENT, Theme>;
@@ -10,3 +10,4 @@ export * from './DistanceToNowFormatter';
10
10
  export type { UncertaintyRange } from './UncertaintyFormatter/types';
11
11
  export { TagsFormatter } from './TagsFormatter';
12
12
  export { ColorFormatter } from './ColorFormatter';
13
+ export { ImageFormatter } from './ImageFormatter';