helppeople-ui 1.3.2 → 1.4.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.
@@ -0,0 +1,109 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { TableProps, PaginationProps, SpinProps } from 'antd';
3
+ export interface LeftPanelConfig<T = any> {
4
+ /** Título del panel izquierdo */
5
+ title: string;
6
+ /** Contenido del extra del Card (ej: contador, loading) */
7
+ extra?: ReactNode;
8
+ /** Nodo de filtros personalizados (Select, Input, etc.) */
9
+ filters?: ReactNode;
10
+ /** Configuración de la tabla */
11
+ table: {
12
+ /** Columnas de la tabla */
13
+ columns: TableProps<T>["columns"];
14
+ /** Datos de la tabla */
15
+ dataSource: T[];
16
+ /** Clave única para cada fila */
17
+ rowKey: string | ((record: T) => string);
18
+ /** Configuración de selección de filas */
19
+ rowSelection?: TableProps<T>["rowSelection"];
20
+ /** Configuración de paginación */
21
+ pagination?: PaginationProps | false;
22
+ /** Estado de carga */
23
+ loading?: boolean;
24
+ /** Scroll de la tabla */
25
+ scroll?: TableProps<T>["scroll"];
26
+ /** Tamaño de la tabla */
27
+ size?: "small" | "middle" | "large";
28
+ /** Clase CSS personalizada */
29
+ className?: string;
30
+ /** Texto cuando no hay datos */
31
+ locale?: TableProps<T>["locale"];
32
+ };
33
+ /** Configuración del botón de acción principal */
34
+ actionButton?: {
35
+ /** Texto del botón */
36
+ text: string;
37
+ /** Icono del botón */
38
+ icon?: ReactNode;
39
+ /** Función al hacer click */
40
+ onClick: () => void;
41
+ /** Estado deshabilitado */
42
+ disabled?: boolean;
43
+ /** Estado de carga */
44
+ loading?: boolean;
45
+ /** Tipo de botón */
46
+ type?: "primary" | "default" | "dashed" | "link" | "text";
47
+ /** Estilo peligro */
48
+ danger?: boolean;
49
+ };
50
+ /** Mensaje de error */
51
+ error?: string;
52
+ /** Clase CSS del Card */
53
+ cardClassName?: string;
54
+ }
55
+ export interface RightPanelConfig<T = any> {
56
+ /** Título del panel derecho */
57
+ title: string;
58
+ /** Contenido del extra del Card (ej: contador) */
59
+ extra?: ReactNode;
60
+ /** Datos de la lista */
61
+ data: T[];
62
+ /** Estado de carga */
63
+ loading?: boolean;
64
+ /** Configuración de la paginación de la lista */
65
+ pagination?: PaginationProps | false;
66
+ /** Función para renderizar cada item */
67
+ renderItem: (item: T) => {
68
+ /** Título del item */
69
+ title: ReactNode;
70
+ /** Descripción del item */
71
+ description?: ReactNode;
72
+ /** Acciones del item (ej: botón eliminar) */
73
+ actions?: ReactNode[];
74
+ };
75
+ /** Mensaje cuando no hay datos */
76
+ emptyText?: string;
77
+ /** Clave única para cada item */
78
+ rowKey: string | ((record: T) => string);
79
+ /** Clase CSS del Card */
80
+ cardClassName?: string;
81
+ /** Layout de la lista */
82
+ itemLayout?: "horizontal" | "vertical";
83
+ /** Clase CSS de la lista */
84
+ listClassName?: string;
85
+ /** Tipo de spinner */
86
+ spinType?: SpinProps["indicator"];
87
+ }
88
+ export interface CustomRelationSelectorProps<L = any, R = any> {
89
+ /** Configuración del panel izquierdo */
90
+ leftPanel: LeftPanelConfig<L>;
91
+ /** Configuración del panel derecho */
92
+ rightPanel: RightPanelConfig<R>;
93
+ /** Configuración de columnas responsive */
94
+ responsive?: {
95
+ xs?: number;
96
+ sm?: number;
97
+ md?: number;
98
+ lg?: number;
99
+ xl?: number;
100
+ };
101
+ /** Espaciado entre columnas y filas */
102
+ gutter?: [number, number];
103
+ /** Clase CSS del contenedor principal */
104
+ className?: string;
105
+ /** Estilos del contenedor principal */
106
+ style?: React.CSSProperties;
107
+ }
108
+ declare const CustomRelationSelector: <L extends object = any, R extends object = any>({ leftPanel, rightPanel, responsive, gutter, className, style, }: CustomRelationSelectorProps<L, R>) => import("react/jsx-runtime").JSX.Element;
109
+ export default CustomRelationSelector;
@@ -0,0 +1,2 @@
1
+ export { default } from './CustomRelationSelector';
2
+ export type { CustomRelationSelectorProps, LeftPanelConfig, RightPanelConfig, } from './CustomRelationSelector';
@@ -1,5 +1,6 @@
1
1
  import { TableProps as AntTableProps } from 'antd';
2
2
  export interface CustomTableProps<T> extends AntTableProps<T> {
3
+ containerClassName?: string;
3
4
  }
4
- declare const CustomTable: <T extends object>({ columns, dataSource, pagination, loading, ...rest }: CustomTableProps<T>) => import("react/jsx-runtime").JSX.Element;
5
+ declare const CustomTable: <T extends object>({ columns, dataSource, pagination, loading, scroll, containerClassName, ...rest }: CustomTableProps<T>) => import("react/jsx-runtime").JSX.Element;
5
6
  export default CustomTable;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const CustomFilterToolbarExample: React.FC;
3
+ export default CustomFilterToolbarExample;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const CustomRelationSelectorExample: React.FC;
3
+ export default CustomRelationSelectorExample;
package/dist/index.d.ts CHANGED
@@ -42,11 +42,13 @@ export { default as DragAndDrop } from './components/CustomDragAndDrop/CustomDra
42
42
  export { default as Accordion } from './components/CustomAccordion/CustomAccordion';
43
43
  export { default as Transfer } from './components/CustomTransfer/CustomTransfer';
44
44
  export { default as TableTransfer } from './components/CustomTableTransfer/CustomTableTransfer';
45
+ export { default as RelationSelector } from './components/CustomRelationSelector/CustomRelationSelector';
45
46
  export { default as NotificationBadge } from './components/CustomNotificationBadge/CustomNotificationBadge';
46
47
  export { default as NotificationDropdown } from './components/CustomNotificationDropdown/CustomNotificationDropdown';
47
48
  export type { AccordionItem, CustomAccordionProps, } from './components/CustomAccordion/CustomAccordion';
48
49
  export type { TransferDataItem, CustomTransferProps, } from './components/CustomTransfer/CustomTransfer';
49
50
  export type { CustomTableTransferProps, RemotePaginationConfig, PagerState, PagerPosition, } from './components/CustomTableTransfer/CustomTableTransfer';
51
+ export type { CustomRelationSelectorProps, LeftPanelConfig, RightPanelConfig, } from './components/CustomRelationSelector/CustomRelationSelector';
50
52
  export type { DragAndDropItem } from './components/CustomDragAndDrop/CustomDragAndDrop';
51
53
  export type { CustomNotificationBadgeProps } from './components/CustomNotificationBadge/CustomNotificationBadge';
52
54
  export type { CustomNotificationDropdownProps, NotificationItem, NotificationAction, } from './components/CustomNotificationDropdown/CustomNotificationDropdown';