react-kd-grid 2.2.4 → 3.0.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.
- package/dist/components/GridRows.d.ts +10 -18
- package/dist/components/RowContextMenu.d.ts +6 -10
- package/dist/components/SearchToolbar.d.ts +2 -18
- package/dist/hooks/useExport.d.ts +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +310 -308
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, MouseEvent } from "react";
|
|
2
|
-
import { GridRow, GridColumn, VirtualizedRange } from "../types";
|
|
2
|
+
import { GridRow, GridColumn, VirtualizedRange, ContextMenuItem, RowEventParams, CellClickParams, CellContextMenuParams } from "../types";
|
|
3
3
|
interface GridRowsProps {
|
|
4
4
|
data: GridRow[];
|
|
5
5
|
columns: GridColumn[];
|
|
@@ -14,25 +14,15 @@ interface GridRowsProps {
|
|
|
14
14
|
hvPadLeft?: number;
|
|
15
15
|
hvPadRight?: number;
|
|
16
16
|
rowStyle?: (row: GridRow) => CSSProperties | undefined;
|
|
17
|
+
rowClassName?: string | ((row: GridRow, index: number) => string);
|
|
17
18
|
globalFilter?: string;
|
|
18
|
-
onContextMenu?: (
|
|
19
|
-
onRowDoubleClick?: (
|
|
20
|
-
onRowClick?: (
|
|
21
|
-
onCellClick?: (
|
|
22
|
-
row: GridRow;
|
|
23
|
-
column: GridColumn;
|
|
24
|
-
value: any;
|
|
25
|
-
event: MouseEvent;
|
|
26
|
-
}) => void;
|
|
19
|
+
onContextMenu?: (params: RowEventParams) => void;
|
|
20
|
+
onRowDoubleClick?: (params: RowEventParams) => void;
|
|
21
|
+
onRowClick?: (params: RowEventParams) => void;
|
|
22
|
+
onCellClick?: (params: CellClickParams) => void;
|
|
27
23
|
isCellFocused?: (rowId: string | number, columnKey: string) => boolean;
|
|
28
24
|
isCellSelected?: (rowId: string | number, columnKey: string) => boolean;
|
|
29
|
-
onCellContextMenu?: (
|
|
30
|
-
row: GridRow;
|
|
31
|
-
column: GridColumn;
|
|
32
|
-
value: any;
|
|
33
|
-
displayValue: string;
|
|
34
|
-
event: MouseEvent;
|
|
35
|
-
}) => void;
|
|
25
|
+
onCellContextMenu?: (params: CellContextMenuParams) => void;
|
|
36
26
|
onCellMouseDown?: (args: {
|
|
37
27
|
row: GridRow;
|
|
38
28
|
column: GridColumn;
|
|
@@ -43,10 +33,12 @@ interface GridRowsProps {
|
|
|
43
33
|
column: GridColumn;
|
|
44
34
|
event: MouseEvent;
|
|
45
35
|
}) => void;
|
|
36
|
+
/** Custom items for the row right-click context menu. */
|
|
37
|
+
contextMenuItems?: ContextMenuItem[];
|
|
46
38
|
getRowId?: (row: GridRow) => string | number;
|
|
47
39
|
}
|
|
48
40
|
export declare const GridRows: import("react").MemoExoticComponent<{
|
|
49
|
-
({ data, columns, selectedRows, virtualized, virtualizedRange, rowHeight, selectable, isRowSelectable, onRowSelect, pinnedColumns, hvPadLeft, hvPadRight, rowStyle, globalFilter, onContextMenu, onRowDoubleClick, onRowClick, onCellClick, isCellFocused, isCellSelected, onCellContextMenu, onCellMouseDown, onCellMouseEnter, getRowId, }: GridRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
({ data, columns, selectedRows, virtualized, virtualizedRange, rowHeight, selectable, isRowSelectable, onRowSelect, pinnedColumns, hvPadLeft, hvPadRight, rowStyle, rowClassName, globalFilter, onContextMenu, onRowDoubleClick, onRowClick, onCellClick, isCellFocused, isCellSelected, onCellContextMenu, onCellMouseDown, onCellMouseEnter, contextMenuItems, getRowId, }: GridRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
50
42
|
displayName: string;
|
|
51
43
|
}>;
|
|
52
44
|
export {};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
icon?: ReactNode;
|
|
7
|
-
onClick: (row: GridRow) => void;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
separator?: boolean;
|
|
10
|
-
}
|
|
1
|
+
import { GridRow, ContextMenuItem } from "../types";
|
|
2
|
+
/** Ready-made starter items — ONLY for development / demos.
|
|
3
|
+
* All items are no-ops in dev environments (they log in DEV only).
|
|
4
|
+
* Do NOT rely on these in production; wire your own `contextMenuItems`. */
|
|
5
|
+
export declare const defaultContextMenuItems: ContextMenuItem[];
|
|
11
6
|
interface RowContextMenuProps {
|
|
12
7
|
row: GridRow;
|
|
13
8
|
position: {
|
|
@@ -16,6 +11,7 @@ interface RowContextMenuProps {
|
|
|
16
11
|
};
|
|
17
12
|
isVisible: boolean;
|
|
18
13
|
onClose: () => void;
|
|
14
|
+
/** Custom menu items. If not provided the menu will not render. */
|
|
19
15
|
menuItems?: ContextMenuItem[];
|
|
20
16
|
}
|
|
21
17
|
export declare const RowContextMenu: ({ row, position, isVisible, onClose, menuItems, }: RowContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
import { ReactNode, ChangeEvent } from "react";
|
|
2
|
-
import type { Density } from "../types";
|
|
3
|
-
export type ExportFormat = "csv" | "json" | "xlsx";
|
|
4
|
-
export type BulkAction = "delete" | "archive" | "copy" | "edit" | "export";
|
|
5
|
-
export interface BulkActionOption {
|
|
6
|
-
id: BulkAction;
|
|
7
|
-
label: string;
|
|
8
|
-
icon: ReactNode;
|
|
9
|
-
onClick: (selectedRows: Set<string | number>) => void;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
destructive?: boolean;
|
|
12
|
-
}
|
|
2
|
+
import type { Density, BulkActionOption, SavedFilter, ExportFormat } from "../types";
|
|
13
3
|
interface ColumnVisibility {
|
|
14
4
|
[columnKey: string]: boolean;
|
|
15
5
|
}
|
|
16
|
-
interface SavedFilter {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
globalFilter: string;
|
|
20
|
-
columnFilters: Record<string, any>;
|
|
21
|
-
}
|
|
22
6
|
interface SearchToolbarProps {
|
|
23
7
|
globalFilter: string;
|
|
24
8
|
filteredDataLength: number;
|
|
@@ -47,7 +31,7 @@ interface SearchToolbarProps {
|
|
|
47
31
|
columnFilters?: Record<string, any>;
|
|
48
32
|
savedFilters?: SavedFilter[];
|
|
49
33
|
bulkActions?: BulkActionOption[];
|
|
50
|
-
|
|
34
|
+
loading?: boolean;
|
|
51
35
|
exportOptions?: {
|
|
52
36
|
enabled: boolean;
|
|
53
37
|
formats?: ExportFormat[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { KDGrid } from "./core/DataGrid";
|
|
2
|
-
export type { KDGridProps, KDGridRef, GridColumn, GridRow, Density, SortConfig, SortDirection, PaginationConfig, GroupConfig, ActiveFilters, ColumnFilterValue,
|
|
2
|
+
export type { KDGridProps, KDGridRef, GridColumn, GridRow, Density, SortConfig, SortDirection, PaginationConfig, PaginationOptions, ExportOptions, PerformanceConfig, GroupConfig, ActiveFilters, ColumnFilterValue, ColumnConfig, ContextMenuItem, BulkActionOption, SavedFilter, SearchMode, ExportFormat, RowEventParams, CellClickParams, CellContextMenuParams, CellFocusParams, CellSelectionPayload, CopyCellsPayload, } from "./types";
|
|
3
3
|
export { usePagination } from "./hooks/usePagination";
|
|
4
4
|
export { useVirtualization } from "./hooks/useVirtualization";
|
|
5
5
|
export { useSelection } from "./hooks/useSelection";
|