next-recomponents 2.0.27 → 2.0.29

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/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode, Dispatch, SetStateAction, InputHTMLAttributes, TextareaHTMLAttributes, ReactElement, TableHTMLAttributes } from 'react';
3
+ import { React as React$2 } from 'next/dist/server/route-modules/app-page/vendored/rsc/entrypoints';
3
4
  import { GridValidRowModel } from '@mui/x-data-grid';
4
5
 
5
6
  interface Props$5 extends React.HTMLAttributes<HTMLDivElement> {
@@ -46,10 +47,10 @@ interface Props$3 {
46
47
  declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.ActionDispatch<[action: Partial<T>]>];
47
48
  declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$3): react_jsx_runtime.JSX.Element;
48
49
 
49
- interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
50
- label: React.ReactNode;
50
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
51
+ label: React$2.ReactNode;
51
52
  regex?: RegExp;
52
- invalidMessage?: React.ReactNode;
53
+ invalidMessage?: React$2.ReactNode;
53
54
  }
54
55
  declare function Input({ label, className, regex, invalidMessage, ...props }: InputProps): react_jsx_runtime.JSX.Element;
55
56
 
@@ -66,8 +67,11 @@ type FooterAggregation = "sum" | "avg" | "count";
66
67
  interface FooterType {
67
68
  [key: string]: FooterAggregation;
68
69
  }
70
+ type GridDensity = "compact" | "standard" | "comfortable";
69
71
  interface TableProps {
70
72
  data: any;
73
+ /** Muestra un input de búsqueda general que filtra filas por palabras clave */
74
+ searchable?: boolean;
71
75
  flex?: number;
72
76
  editableFields?: string[];
73
77
  onSelect?: (data: GridValidRowModel[]) => void;
@@ -86,6 +90,28 @@ interface TableProps {
86
90
  className?: string;
87
91
  fontSize?: string;
88
92
  colSize?: Record<string, number>;
93
+ /**
94
+ * Alto fijo de fila en px.
95
+ * Si se omite usa el default de MUI según `density`
96
+ * (compact ≈ 36, standard ≈ 52, comfortable ≈ 68).
97
+ * Se ignora automáticamente cuando `wrapText` es true.
98
+ */
99
+ rowHeight?: number;
100
+ /**
101
+ * Cuando es true el texto largo hace wrap en lugar de truncarse,
102
+ * y el alto de cada fila crece para mostrar todo el contenido.
103
+ * Internamente activa `getRowHeight={() => "auto"}` en el DataGrid.
104
+ */
105
+ wrapText?: boolean;
106
+ /**
107
+ * Densidad visual de la tabla.
108
+ * Afecta el padding de celdas y encabezados independientemente
109
+ * del tamaño de fuente.
110
+ * - "compact" → padding mínimo, tabla muy densa
111
+ * - "standard" → (default) comportamiento por defecto de MUI
112
+ * - "comfortable" → padding generoso, fácil de leer
113
+ */
114
+ density?: GridDensity;
89
115
  [key: string]: any;
90
116
  }
91
117
  declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React$1, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode, Dispatch, SetStateAction, InputHTMLAttributes, TextareaHTMLAttributes, ReactElement, TableHTMLAttributes } from 'react';
3
+ import { React as React$2 } from 'next/dist/server/route-modules/app-page/vendored/rsc/entrypoints';
3
4
  import { GridValidRowModel } from '@mui/x-data-grid';
4
5
 
5
6
  interface Props$5 extends React.HTMLAttributes<HTMLDivElement> {
@@ -46,10 +47,10 @@ interface Props$3 {
46
47
  declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.ActionDispatch<[action: Partial<T>]>];
47
48
  declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$3): react_jsx_runtime.JSX.Element;
48
49
 
49
- interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
50
- label: React.ReactNode;
50
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
51
+ label: React$2.ReactNode;
51
52
  regex?: RegExp;
52
- invalidMessage?: React.ReactNode;
53
+ invalidMessage?: React$2.ReactNode;
53
54
  }
54
55
  declare function Input({ label, className, regex, invalidMessage, ...props }: InputProps): react_jsx_runtime.JSX.Element;
55
56
 
@@ -66,8 +67,11 @@ type FooterAggregation = "sum" | "avg" | "count";
66
67
  interface FooterType {
67
68
  [key: string]: FooterAggregation;
68
69
  }
70
+ type GridDensity = "compact" | "standard" | "comfortable";
69
71
  interface TableProps {
70
72
  data: any;
73
+ /** Muestra un input de búsqueda general que filtra filas por palabras clave */
74
+ searchable?: boolean;
71
75
  flex?: number;
72
76
  editableFields?: string[];
73
77
  onSelect?: (data: GridValidRowModel[]) => void;
@@ -86,6 +90,28 @@ interface TableProps {
86
90
  className?: string;
87
91
  fontSize?: string;
88
92
  colSize?: Record<string, number>;
93
+ /**
94
+ * Alto fijo de fila en px.
95
+ * Si se omite usa el default de MUI según `density`
96
+ * (compact ≈ 36, standard ≈ 52, comfortable ≈ 68).
97
+ * Se ignora automáticamente cuando `wrapText` es true.
98
+ */
99
+ rowHeight?: number;
100
+ /**
101
+ * Cuando es true el texto largo hace wrap en lugar de truncarse,
102
+ * y el alto de cada fila crece para mostrar todo el contenido.
103
+ * Internamente activa `getRowHeight={() => "auto"}` en el DataGrid.
104
+ */
105
+ wrapText?: boolean;
106
+ /**
107
+ * Densidad visual de la tabla.
108
+ * Afecta el padding de celdas y encabezados independientemente
109
+ * del tamaño de fuente.
110
+ * - "compact" → padding mínimo, tabla muy densa
111
+ * - "standard" → (default) comportamiento por defecto de MUI
112
+ * - "comfortable" → padding generoso, fácil de leer
113
+ */
114
+ density?: GridDensity;
89
115
  [key: string]: any;
90
116
  }
91
117
  declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;