bpr-library 0.0.13 → 0.0.14
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.
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
interface ClickableRowsProps<T> {
|
|
2
|
-
onRowClick: (row: T) => void;
|
|
3
|
-
isRowClickable: (row: T) => boolean;
|
|
4
|
-
}
|
|
5
|
-
interface NonClickableRowsProps {
|
|
6
|
-
onRowClick?: never;
|
|
7
|
-
isRowClickable?: never;
|
|
8
|
-
}
|
|
9
1
|
export interface Column<T> {
|
|
10
2
|
key: keyof T & string;
|
|
11
3
|
label: string;
|
|
12
4
|
render?: (value: T[keyof T], row: T) => React.ReactNode;
|
|
13
5
|
width?: number | string;
|
|
14
6
|
}
|
|
7
|
+
export interface IColumnSort<T> {
|
|
8
|
+
key: keyof T & string;
|
|
9
|
+
direction: 'asc' | 'desc';
|
|
10
|
+
}
|
|
15
11
|
interface BaseDataTableProps<T> {
|
|
16
12
|
tableId: string;
|
|
17
13
|
columns: Column<T>[];
|
|
18
14
|
data: (T & {
|
|
19
15
|
id: number;
|
|
20
16
|
})[];
|
|
21
|
-
onRowClick?: (row: T) => void;
|
|
22
17
|
actions?: (row: T) => React.ReactNode;
|
|
18
|
+
sortedBy?: IColumnSort<T>;
|
|
19
|
+
handleSort?: (data?: IColumnSort<T>) => void;
|
|
20
|
+
useContext?: boolean;
|
|
23
21
|
}
|
|
24
|
-
export type DataTableProps<T> = BaseDataTableProps<T
|
|
25
|
-
export declare function DataTable<T>({ tableId, columns, data, actions,
|
|
22
|
+
export type DataTableProps<T> = BaseDataTableProps<T>;
|
|
23
|
+
export declare function DataTable<T>({ tableId, columns, data, actions, sortedBy, handleSort, useContext, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
26
24
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DataTable } from './DataTable';
|
|
2
|
-
export type { DataTableProps, Column } from './DataTable';
|
|
2
|
+
export type { DataTableProps, Column, IColumnSort } from './DataTable';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { CSSProperties,
|
|
1
|
+
import { CSSProperties, ReactNode, RefObject } from 'react';
|
|
2
2
|
export interface PopUpProps {
|
|
3
|
-
containerRef
|
|
3
|
+
containerRef?: RefObject<HTMLDivElement | HTMLButtonElement | null>;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
handleClose: () => void;
|
|
6
6
|
disabledMinWidth?: boolean;
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
7
9
|
style?: CSSProperties;
|
|
8
10
|
}
|
|
9
|
-
export declare
|
|
11
|
+
export declare function PopUp({ containerRef, handleClose, children, disabledMinWidth, x, y, style, }: PopUpProps): import('react').ReactPortal;
|