react-kd-grid 2.2.4 → 3.0.0
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 +1 -10
- package/dist/components/SearchToolbar.d.ts +2 -17
- 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 +308 -308
- package/package.json +1 -1
|
@@ -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,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GridRow } from "../types";
|
|
3
|
-
export interface ContextMenuItem {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
icon?: ReactNode;
|
|
7
|
-
onClick: (row: GridRow) => void;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
separator?: boolean;
|
|
10
|
-
}
|
|
1
|
+
import { GridRow, ContextMenuItem } from "../types";
|
|
11
2
|
interface RowContextMenuProps {
|
|
12
3
|
row: GridRow;
|
|
13
4
|
position: {
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
import { ReactNode, ChangeEvent } from "react";
|
|
2
|
-
import type { Density } from "../types";
|
|
2
|
+
import type { Density, BulkActionOption, SavedFilter } from "../types";
|
|
3
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
|
-
}
|
|
13
4
|
interface ColumnVisibility {
|
|
14
5
|
[columnKey: string]: boolean;
|
|
15
6
|
}
|
|
16
|
-
interface SavedFilter {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
globalFilter: string;
|
|
20
|
-
columnFilters: Record<string, any>;
|
|
21
|
-
}
|
|
22
7
|
interface SearchToolbarProps {
|
|
23
8
|
globalFilter: string;
|
|
24
9
|
filteredDataLength: number;
|
|
@@ -47,7 +32,7 @@ interface SearchToolbarProps {
|
|
|
47
32
|
columnFilters?: Record<string, any>;
|
|
48
33
|
savedFilters?: SavedFilter[];
|
|
49
34
|
bulkActions?: BulkActionOption[];
|
|
50
|
-
|
|
35
|
+
loading?: boolean;
|
|
51
36
|
exportOptions?: {
|
|
52
37
|
enabled: boolean;
|
|
53
38
|
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, 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";
|